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

feat: app hash error channel #1

Merged
merged 3 commits into from
Jan 6, 2024

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented Jan 3, 2024

This PR implements an error channel which allows cometBFT to stream app hash errors to the sdk. With this information, the sdk can provide a more useful error message, specifically the hash of every module at the problematic block height.

Screenshot 2024-01-02 at 9 58 28 PM

The respective cosmos sdk PR: osmosis-labs/cosmos-sdk#500

Comment on lines +369 to +377
if strings.Contains(err.Error(), "wrong Block.Header.AppHash") {
bcR.BaseReactor.AppHashErrorChanBR <- p2p.AppHashError{
Err: err,
Height: uint64(first.Height),
}
} else if strings.Contains(err.Error(), "wrong Block.Header.LastResultsHash") {
bcR.BaseReactor.AppHashErrorChanBR <- p2p.AppHashError{
Err: err,
Height: uint64(first.Height - 1),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used height-1 for lastResultHash and height for AppHash. I think this is correct, but highlighting that I would like this double checked

Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, this is cool!

@czarcas7ic czarcas7ic merged commit 28d7d17 into osmo/v0.37.2 Jan 6, 2024
14 of 15 checks passed
czarcas7ic added a commit that referenced this pull request Jan 6, 2024
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

Successfully merging this pull request may close these issues.

2 participants