-
Notifications
You must be signed in to change notification settings - Fork 23
2.2.1 migration #451
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
base: master
Are you sure you want to change the base?
2.2.1 migration #451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const FROM_VERSION: &str = "2.1.0"; | ||
| const TO_VERSION: &str = "2.2.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration leaves credit-manager version at 2.2.0
Upgrading a contract still at 2.1.0 with this 2.2.1 binary can only call MigrateMsg::V2_1_0ToV2_2_0, which sets the stored cw2 version to the hard-coded TO_VERSION of "2.2.0". Because a CosmWasm migrate call runs only once per code upload, there is no way to reach 2.2.1 metadata in the same upgrade, leaving the on-chain contract_version behind the deployed code and blocking future migrations that expect 2.2.1 as the starting point.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this does not affect us as we are on latest versions (2.1.0 for RB, 2.2.0 for CM) I think it is a potential cause of bugs. Perhaps we should think about this pattern and see if there are better alternatives. The problem with using CONTRACT_VERSION is that it breaks old tests
| const FROM_VERSION: &str = "2.0.1"; | ||
| const TO_VERSION: &str = "2.1.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Red-bank migration records 2.1.0 when upgrading to 2.1.1
The new red-bank binary is version 2.1.1, but the only migration path for older contracts (V2_0_1ToV2_1_0) writes the cw2 metadata to TO_VERSION = "2.1.0". Because a CosmWasm migrate executes once per upgrade, a contract migrating directly from 2.0.1 to this code will be left with contract_version 2.1.0 even though the running code is 2.1.1, making later upgrades that expect 2.1.1 as the starting point fail.
Useful? React with 👍 / 👎.
No description provided.