-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Bug]: Certain calls with x-cosmos-block-height are broken #19822
Comments
We are experiencing a similar issue with supply metrics. Historical supply values are not being returned correct using the x-cosmos-block-height parameter. Here is the current supply. The following value should be roughly 324240612.620618 however Atom supply returned is almost identical to the current supply. |
Hello, personally, I think the error is pretty self-explanatory. It seems like the historical height you're querying against is pruned or no longer exists. What are you pruning settings on these node(s)? |
Hi @alexanderbez you can see this:
which states the earliest block is 1, this call also used to work until this week, and i have ran into it across alot of different archive nodes, implying that this has something to do with a version upgrade |
@evyatar-tres That's CometBFT's perspective on state, not the application. You're querying the application state. CometBFT pruning and application pruning are handled independently. |
In our case, we have been querying this node and another node from block 5200791 successfully everyday for months until this morning. |
@alexanderbez from looking at the following endpoint https://cosmoshub-api.cosmosrescue.dev/cosmos/base/tendermint/v1beta1/blocks/5200791 I can see that you are correct about the nodes now being pruned. Is this expected after the upgrade. Is it likely that a period of resyncing is required for nodes after the upgrade? |
@alexanderbez |
Also, might be related to this? |
as reece mentioned in his patch this is on purpose to prevent other bugs, We can look into it in the future but for we recommend running a patch until we have the bandwidth to fix this. If anyone here wants to look into it we are happy to review prs |
closing this as it seems a resolution was met. We cant gurantee queries cross upgrades due to versions breaking. Best chance is to query the block using the old binary instead of the latest |
Is there an existing issue for this?
What happened?
A bug happened!
General
Until recently, across all cosmos blockchains, I was able to query historical rewards using the "x-cosmos-block-height", this was done in correspondence to the RPC's sync_info and earliest_block_height on that specific node
Starting last week (probably related to some versioning upgrade), this does not work anymore
Usecase
RPC URL: https://rpc-us-1.kyve.network/status?
earliest_block: "1"
version: "0.37.2
SDK URL:
https://api-us-1.kyve.network/cosmos/distribution/v1beta1/delegators/kyve13jgzfjfwp2mmfrmegvmulrrmkm4fqectts76uq/rewards
SDK Version: "v0.47.6"
Using headers + error:
code 2
message "codespace sdk code 18: invalid request: failed to load state at height 100000; version mismatch on immutable IAVL tree; version does not exist. Version has either been pruned, or is for a future block height (latest height: 5457144)"
details []
Note, until last week this worked for all block heights
Cosmos SDK Version
"v0.47.6"
How to reproduce?
https://api-us-1.kyve.network/cosmos/distribution/v1beta1/delegators/kyve13jgzfjfwp2mmfrmegvmulrrmkm4fqectts76uq/rewards
with x-cosmos-block-height, using this value: 100000
The text was updated successfully, but these errors were encountered: