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

I don't understand how to update the store through migrations #21630

Closed
1 task done
valli0x opened this issue Sep 10, 2024 · 2 comments
Closed
1 task done

I don't understand how to update the store through migrations #21630

valli0x opened this issue Sep 10, 2024 · 2 comments

Comments

@valli0x
Copy link

valli0x commented Sep 10, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

If the current commit version and the update height do not match when starting the node, then there will be no update of the store?
Do I need to launch the application before the block that has a planned update?

app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))

if upgradeHeight == ms.LastCommitID().Version+1 {

Cosmos SDK Version

0.50.x

How to reproduce?

No response

@valli0x valli0x added the T:Bug label Sep 10, 2024
@julienrbrt julienrbrt changed the title [Bug]: I don't understand how to update the store through migrations I don't understand how to update the store through migrations Sep 10, 2024
@tac0turtle
Copy link
Member

If the current commit version and the update height do not match when starting the node, then there will be no update of the store? Do I need to launch the application before the block that has a planned update?

correct if you stop and start the node with the updated binary the node will not be able to start. If you would like to run migrations the module itself needs to specify the migration and in the module.go it will register the migrations that need to be run at the upgrade height.

Ill close this issue for now, but please ask further questions if you need

@valli0x
Copy link
Author

valli0x commented Sep 13, 2024

@tac0turtle I mean, migrations for the store are not checked in the preblock upgrade of the module and are launched at the start of the node
The condition is that the launch should start at a height determined by a height in plan, so immediately upon node startup, it should start at the height of the plan block.

if upgradeHeight == ms.LastCommitID().Version+1 {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

No branches or pull requests

3 participants