Skip to content

Conversation

@Subham2804
Copy link

No description provided.

@Subham2804 Subham2804 changed the title add 2.2.1 migration 2.2.1 migration Dec 8, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 6 to +7
const FROM_VERSION: &str = "2.1.0";
const TO_VERSION: &str = "2.2.0";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Collaborator

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

Comment on lines 6 to +7
const FROM_VERSION: &str = "2.0.1";
const TO_VERSION: &str = "2.1.0";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Subham2804 Subham2804 requested a review from markonmars December 8, 2025 09:45
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.

3 participants