-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Upgrade height judgment error #6346
Comments
The implementation looks correct for me.
|
At least in the standard gaia app (and all xrnd apps that tested this in public testnets), this is definitely not 0 and is loaded first.
This is a valid point and should be well documented. I think the current implementation is if you set an upgrade height to 54000, then block 54000 will be run with the old code and then the upgrade occurs before running 54001. This should be checked and documented in any case. Also, maybe we rename |
Of course, it may be my understanding error, but I also tested it several times, and it does not load the height correctly. I think there may be a problem in this place: func (app *BaseApp) LoadLatestVersion() error {
err := app.storeLoader(app.cms)
if err != nil {
return fmt.Errorf("failed to load latest version: %w", err)
}
return app.init()
} When calling func (app *BaseApp) LoadLatestVersion() error {
if err := app.cms.LoadLatestVersion() ;err != nil {
return err
}
err := app.storeLoader(app.cms)
if err != nil {
return fmt.Errorf("failed to load latest version: %w", err)
}
return app.init()
} |
The issue is what you set The two StoreLoaders we provide as standard options both load the cms. In fact, the default is DefaultStoreLoader which is nothing more than The issue is likely a misconfiguration of storeLoader in your application. |
Thanks, it is possible that the method I used is wrong or the order of the code is wrong |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Does this affect Launchpad as well? |
cosmos-sdk/x/upgrade/types/storeloader.go
Line 13 in 1a5f2b7
There are two errors in this place:
The
CommitMultiStore
has not been loaded yet, soms.LastCommitID().Version
is always equal to0
;When the upgrade height is reached, the pain in the
beginblocker
, so the height has not yet been submitted, Should usems.LastCommitID().Version == upgradeHeight-1
The text was updated successfully, but these errors were encountered: