-
Notifications
You must be signed in to change notification settings - Fork 292
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
panic: loading latest version: failed to load latest version: version of store qgb mismatch root store's version; expected 1 got 0
#3462
Comments
We likely would've prevented the PR that introduced the regression if we did #3337 |
I repro'ed this behavior with d0d2a3f |
I'm on block height 4 and it looks like the
|
A few stores are missing from this list:
notably, blob and qgb |
#3320 missed adding the blob key for v2. The qgb key should be absent from v2. |
Okay after fixing the blob key issue, this is still broken because https://github.com/rootulp/celestia-app/blob/d7b03f260b3bde92cb661454004822f1daff8135/app/app.go#L523 returns |
The app version in the param store isn't actually set yet
even though it should be v1. |
On the main branch and If the chain starts at app version 1 and then upgrades to v2 via an upgrade height, restarting works. #3405 is broken for chains that start on app version 2. |
This goes all the way back to celestiaorg/cosmos-sdk#347 because // InitChain implements the ABCI interface. This method is a wrapper around
// baseapp's InitChain so we can take the app version and setup the multicommit
// store.
//
// Side-effect: calls baseapp.Init()
func (app *App) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
// genesis must always contain the consensus params. The validator set however is derived from the
// initial genesis state. The genesis must always contain a non zero app version which is the initial
// version that the chain starts on
if req.ConsensusParams == nil || req.ConsensusParams.Version == nil {
panic("no consensus params set")
}
if req.ConsensusParams.Version.AppVersion == 0 {
panic("app version 0 is not accepted. Please set an app version in the genesis")
}
appVersion := req.ConsensusParams.Version.AppVersion
// mount the stores for the provided app version if it has not already been mounted
if app.AppVersion() == 0 && !app.IsSealed() {
app.mountKeysAndInit(appVersion)
}
res = app.BaseApp.InitChain(req)
ctx := app.NewContext(false, tmproto.Header{})
if appVersion != v1 {
// set the initial app version in the consensus params
app.SetInitialAppVersionInConsensusParams(ctx, appVersion)
app.SetAppVersion(ctx, appVersion)
}
return res
} |
Closes #3462 Previously, `InitChain` for a genesis with app version 2 wouldn't save the app version to consensus params. This means that if the node stopped and started up again, it would fetch `0` from consensus params and default to using app version 1 because of [these lines](https://github.com/rootulp/celestia-app/blob/dd6b188c0553d7cdd81161c62558db88a353d173/app/app.go#L520-L525). The fix in this PR is to save app version 2 and above to consensus params in `InitGenesis`. ## Testing ```shell ./scripts/single-node.sh # wait a block then stop the node with CTRL + C celestia-appd start # works and doesn't panic ```
Closes celestiaorg/celestia-app#3462 Previously, `InitChain` for a genesis with app version 2 wouldn't save the app version to consensus params. This means that if the node stopped and started up again, it would fetch `0` from consensus params and default to using app version 1 because of [these lines](https://github.com/rootulp/celestia-app/blob/dd6b188c0553d7cdd81161c62558db88a353d173/app/app.go#L520-L525). The fix in this PR is to save app version 2 and above to consensus params in `InitGenesis`. ## Testing ```shell ./scripts/single-node.sh # wait a block then stop the node with CTRL + C celestia-appd start # works and doesn't panic ```
Problem
I can't start a node, stop it, and start it again on current
main
The text was updated successfully, but these errors were encountered: