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

Make query to find what states a given node exposes #15463

Open
ValarDragon opened this issue Mar 20, 2023 · 3 comments
Open

Make query to find what states a given node exposes #15463

ValarDragon opened this issue Mar 20, 2023 · 3 comments
Labels
T: Client UX T: Dev UX UX for SDK developers (i.e. how to call our code) T: UX

Comments

@ValarDragon
Copy link
Contributor

Summary

If you want to make some tooling to run a query across many heights, you need to know what states a given full node has. (E.g. an indexer). The current ecosystem default as far as I can tell, is to use an archive node, which provides much slower queries. And in general is a bit less robust than what many people's needs could afford them. (E.g. resync from full nodes maintaining last 10k blocks, and only revert to an archive node if too old)

Right now the closest thing we have is earliest_block_height in the STATUS RPC endpoint. However this exposes the Tendermint earliest block height, not the state machine's which is subject to pruning conditions.

The proposal is to add a query of some sort, that returns the earliest state that a given node is serving queries from.

Its not obvious to me what the most natural way to expose this info is, but its pretty easy for integrators to adapt to whatever standard we want to set. E.g.
an "Earliest State Query", or a more general "status" query from the state machine.

@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Mar 20, 2023
@tac0turtle tac0turtle added T: UX T: Dev UX UX for SDK developers (i.e. how to call our code) T: Client UX T:Sprint and removed needs-triage Issue that needs to be triaged labels Mar 20, 2023
@tac0turtle
Copy link
Member

we should look at adding other configurations like state sync and pruning settings so there is a predicable way to work with. nodes

@tac0turtle tac0turtle self-assigned this Mar 25, 2023
@ValarDragon
Copy link
Contributor Author

Another one I ran into:
Tendermint/Status returns the last block Tendermint has received, but not that the state machine has processed! So if you go off the TM status, you can get:

RPC error -32603 - Internal error: height {query_height} must be less than or equal to the current blockchain height {other_height}

and

rpc error: code = InvalidArgument desc = failed to load state at height {query height}; (latest height: {state machine height}): invalid request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: Client UX T: Dev UX UX for SDK developers (i.e. how to call our code) T: UX
Projects
None yet
Development

No branches or pull requests

3 participants