-
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
CLI --height does not set timestamp #15256
Labels
Comments
In order for the timestamp to be set on the |
Seems like the node should do this then (and later on figure out how to lower time overhead for this) |
@ValarDragon I'm gonna close this as a duplicate of #12226 if that's OK with you. Feel free to re-open if you think otherwise :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
related #12226
Summary of Bug
Setting
--height
for queries in the CLI does not setup the timestamp correctly, which results in erroneous query results. https://github.com/cosmos/cosmos-sdk/blob/8fb95f06ed65416f800ce092c7fb6e7fe460711f/client/cmd.go#L190C65-L193So doing any historical query today will return the incorrect result, if the query relies on a timestamp.
imo this is a notable bug, as contract devs / app devs should expect to be able to run historic queries to simulate things at past states, or recreate indexes. (For their end user application & data analysis, ofc not in the state machine)
Its possible that there are corrupt datasets due to this bug, in ways noone's today aware of.
Version
All versions as far as I can tell?
Suggested solution
When
--height
is set, have the CLI require reading the timestamp by querying something (I'm not sure where its stored, Tendermint DB's, or in IAVL somewhere?), and use that as the correct block timestamp. Ideally we would query the full header, and have the context populated with the correct header.The text was updated successfully, but these errors were encountered: