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

fix(x/bank): miss keypair of SendEnabled to restore legacy param set before migration #18107

Merged

Conversation

mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Oct 13, 2023

this change was introduced in https://github.com/cosmos/cosmos-sdk/pull/11977/files, but accidently get removed in https://github.com/cosmos/cosmos-sdk/pull/12630/files, since bank send_enabled refactor before params migration

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@mmsqe mmsqe force-pushed the release/v0.47.x_fix_send_enabled branch from 00f71ef to 02453f6 Compare October 13, 2023 03:09
@mmsqe mmsqe force-pushed the release/v0.47.x_fix_send_enabled branch 2 times, most recently from 68c0f8c to 4467f6b Compare October 13, 2023 03:49
…before migration

this change was introduced in https://github.com/cosmos/cosmos-sdk/pull/11977/files,
but accidently get removed in https://github.com/cosmos/cosmos-sdk/pull/12630/files,
since bank send_enabled refactor before params migration
@mmsqe mmsqe force-pushed the release/v0.47.x_fix_send_enabled branch from 4467f6b to efc8aa3 Compare October 13, 2023 04:11
@mmsqe mmsqe marked this pull request as ready for review October 13, 2023 04:38
@mmsqe mmsqe requested a review from a team as a code owner October 13, 2023 04:38
@julienrbrt
Copy link
Member

julienrbrt commented Oct 13, 2023

Wow, good catch (other reviewers, see https://github.com/cosmos/cosmos-sdk/pull/12630/files#diff-c58b556b8ace809b59cce155271115f96a755f2d04d3ac9368c5c58e5791bc1eL30-L36).

Given that v0.47 is already released and that it means chains have already migrated bank, I think we should have this additionally extracted as a public helper. This way, chains on v0.47 can run it in their next major upgrade (as now it won't be run for them), we'll add this in the release notes.

Another note is this should probably target v0.50 and be backported to v0.47 (main has no params migration anymore).

@yihuang
Copy link
Collaborator

yihuang commented Oct 13, 2023

This way, chains on v0.47 can run it in their next major upgrade (as now it won't be run for them)

The chains already on v0.47 has lost the send-enabled settings, they must get from the historical state, and recover them using the gov proposal.

@julienrbrt
Copy link
Member

julienrbrt commented Oct 13, 2023

This way, chains on v0.47 can run it in their next major upgrade (as now it won't be run for them)

The chains already on v0.47 has lost the send-enabled settings, they must get from the historical state, and recover them using the gov proposal.

They can, but I believe these are still stored in x/params, so we could add a helper getting it for them.

@yihuang
Copy link
Collaborator

yihuang commented Oct 13, 2023

This way, chains on v0.47 can run it in their next major upgrade (as now it won't be run for them)

The chains already on v0.47 has lost the send-enabled settings, they must get from the historical state, and recover them using the gov proposal.

They can, but I believe these are still stored in x/params, so we could add a helper getting it for them.

you are right, we didn't remove the x/params store.

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

Mostly lgtm, just one request :)

@@ -31,5 +32,7 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error {

// Migrate3to4 migrates x/bank storage from version 3 to 4.
func (m Migrator) Migrate3to4(ctx sdk.Context) error {
Copy link
Member

Choose a reason for hiding this comment

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

Can we add an helper, that gets already migrated bank params (so current v047 users), get the send enabled params from x/params and update the bank params?
This way affected users (I've checked, found none, but just in case), can use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if you mean add a public helper in app module, or do you have any example I should put it in.

Copy link
Member

@julienrbrt julienrbrt Oct 13, 2023

Choose a reason for hiding this comment

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

This is almost what I meant, yes, but no need to have anything in AppModule.

You can keep Migrate3to4 as you had it, with the fix, and move MigrateSubspaceParams here (package keeper or v4), named MigrateSendEnabledParams with a comment explaining this is only needed for chains having migrated from <= v0.47 to v0.47.0-5

@mmsqe mmsqe force-pushed the release/v0.47.x_fix_send_enabled branch from 1de6e99 to 142bc2e Compare October 13, 2023 15:41
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

lgtm! Thank you

@julienrbrt julienrbrt merged commit 91b44c5 into cosmos:release/v0.47.x Oct 16, 2023
24 of 25 checks passed
czarcas7ic added a commit to osmosis-labs/cosmos-sdk that referenced this pull request Oct 24, 2023
czarcas7ic added a commit to osmosis-labs/cosmos-sdk that referenced this pull request Oct 24, 2023
@faddat faddat mentioned this pull request Mar 20, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants