Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying through ABCI #347

Closed
aakoshh opened this issue Feb 16, 2023 · 0 comments · Fixed by consensus-shipyard/fendermint#35
Closed

Querying through ABCI #347

aakoshh opened this issue Feb 16, 2023 · 0 comments · Fixed by consensus-shipyard/fendermint#35

Comments

@aakoshh
Copy link
Contributor

aakoshh commented Feb 16, 2023

To interrogate the state we must implement the query method. To do so, create a new ADT to represent all possible queries, and create a new interpreter to handle it. It may be a good idea to split the interpreter modules into further pieces.

I'm not exactly sure how it should work with FEVM in the future. During integration testing, to query EVM contracts I had to send transactions, even if they were views. But there are plenty of other Web3 JSON-RPC methods that might be supported by queries. I'll look at Ethermint when the time comes.

For now, it would be enough to return a balance and the state root of the actor: the latter is useful because we can use general CBOR/IPLD resolution to actually get the state independently.

The ABCI query message allows the client to supply the block height at which they want the results to be evaluated. To support that, we'd need to save the last N state root hashes. Depends on what we want to do:

  • if we have to run two queries to serve the balance and the state separately, they can be out-of-sync if a block is updated
  • if we return the balance and the state in a single query (they are together as ActorState) then they will be consistent
  • but if we want to query two different accounts' balances/states, they can again be out-of-sync
  • if we allow the queries to be a list, rather than one by one, they can all run on the same root hash
  • or we allow specifying the block height, and return an error if it's no longer available; then we can query one by one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants