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

server,cometbft: ensure app height < chain height #1066

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jchappelow
Copy link
Member

This adds a check in the node's db provider constructor to ensure app height is less than node blockstore height.

We already had this:

Error: panic while building kwild: state.AppHash does not match AppHash after replay. Got
72287A9265100116BF4564B601389D5AF0ACC6CC6068D215579F5798C058ED71, expected .

State: {{{11 1} 0.38.12} prod-chain 1 0 :0:000000000000 2024-10-14 16:12:11.499512 +0000 UTC ValidatorSet{
  Proposer: Validator{9A34D1C8EB16B73D598C2D9823C3BAC25B82E200 PubKeyEd25519{58E3FF8608521626FEA099EE08EF7EF81C2CF57A0848D8EA67B544E4797B3E06} VP:1 A:0}
  Validators:
    Validator{5959A864439F1B470F12AC69A6E5B592E07DD794 PubKeyEd25519{3A026BD5CF4A64EE8510B9012C652BD9CCC2B07505C3D442EFEAF126F8549BDE} VP:1 A:0}
    Validator{9A34D1C8EB16B73D598C2D9823C3BAC25B82E200 PubKeyEd25519{58E3FF8608521626FEA099EE08EF7EF81C2CF57A0848D8EA67B544E4797B3E06} VP:1 A:0}
} ValidatorSet{
  Proposer: Validator{5959A864439F1B470F12AC69A6E5B592E07DD794 PubKeyEd25519{3A026BD5CF4A64EE8510B9012C652BD9CCC2B07505C3D442EFEAF126F8549BDE} VP:1 A:-1}
  Validators:
    Validator{5959A864439F1B470F12AC69A6E5B592E07DD794 PubKeyEd25519{3A026BD5CF4A64EE8510B9012C652BD9CCC2B07505C3D442EFEAF126F8549BDE} VP:1 A:-1}
    Validator{9A34D1C8EB16B73D598C2D9823C3BAC25B82E200 PubKeyEd25519{58E3FF8608521626FEA099EE08EF7EF81C2CF57A0848D8EA67B544E4797B3E06} VP:1 A:1}
} ValidatorSet{
  Proposer: nil-Validator
  Validators:

} 1 {{6291456 -1} {100000 48h0m0s 1048576} {[ed25519]} {1} {0}} 1 [] []}

Did you reset CometBFT without resetting your application's data?

But it's extremely confusing. So, rather than wait for cometbft to begin replaying blocks, which is when it finds out about the invalid application state, we can give a clearer error with a possible resolution:

Error: panic while building kwild: failed to build comet node: failed to create CometBFT node: application (postgresql) height is past blockchain database -- drop postgresql to proceed.

However, this was a quick fix, and I want to reconsider this. Open to suggestions for a better resolution.

@charithabandi
Copy link
Contributor

Looks reasonable to me.

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