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

Implement Height Parameter for Queries #1063

Open
msteiner96 opened this issue Feb 25, 2022 · 3 comments
Open

Implement Height Parameter for Queries #1063

msteiner96 opened this issue Feb 25, 2022 · 3 comments

Comments

@msteiner96
Copy link
Member

I suggest that we add another parameter to ALL querys, using which you can execute queries not automatically to the current blockheight but to a lower blockheight.

This needs an archive node, since most nodes only have 100 heights saved. Anyways, we can catch that error and it might be helpful.

Flags:
      --height int      Use a specific height to query state at (this can error if the node is pruning state)
@webmaster128
Copy link
Member

First step is here: #1250

@lovrobiljeskovic
Copy link

@webmaster128 Hey, I am looking for this same functionality as well. I'm not sure that I follow how #1250 allows for querying with a block height? Or is there still some implementation needed for us to be able to do any query with a block height?

Appreciate any help that you can provide!

@webmaster128
Copy link
Member

Turns out the gRPC interface does not support height parameters directly. However, they can be passed as metadata. See https://docs.cosmos.network/v0.47/run-node/interact-node#query-for-historical-state-using-grpcurl and https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md.

In #1378 you see a proof of concept how this can be added to our client to preserve and send it as part of the tendermint RPC request.

I dod not test that in a live system yet. If someone wants to explore this forther, have a look at #1378.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants