-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Return app hash from InitChain
#7020
Comments
The genesis docs that I've thus far seen typically don't have an AppHash. How is this typically constructed or evaluated? I hope this won't be difficult to implement because, in order to get an app hash during |
In that case I guess you would just return an empty hash from |
Ok I guess, we can just return an empty hash for now? |
That will work, although the hash of an empty input would probably be more consistent with what IAVL and Tendermint does. Not sure how this affects upgrades - I believe the genesis file then contains some app state and probably an app hash as well, so InitChain would have to return the same app hash as specified in the genesis file. |
I believe there might be some overlap or common bits to shared with #7018. |
Following user feedback I've changed the behavior such that |
Just thinking out loud, I think the Thoughts @zmanian? |
I don't know the details of the SDK's state and hashing, but in general, identical states should give identical hashes. If height 2 is empty (contains no user-submitted transaction data), presumably height 1 should have the same hash as height 2? |
Not quite, even if there is no new state between 1 and 2, the height/version is increased which gives you a new hash. |
That must be because the SDK changes its internal state then. IAVL returns the same hash for version 1 and 2 if there were no changes. Either way, this is application-specific, so the SDK is free to choose whatever hashing scheme it finds appropriate. Not having to special-case version 1 for e.g. proofs and stuff might be helpful to users though, but probably not a big deal. |
Perhaps yeah, but in |
Summary
In tendermint/tendermint#5227 (will be released in 0.34.0-rc3), Tendermint added
ResponseInitChain.app_hash
which replaces the value in the genesis file and is recorded in the genesis block. The SDK should probably return the app hash here instead.For Admin Use
The text was updated successfully, but these errors were encountered: