-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(x/bank): miss keypair of SendEnabled to restore legacy param set before migration #18107
Conversation
00f71ef
to
02453f6
Compare
68c0f8c
to
4467f6b
Compare
…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
4467f6b
to
efc8aa3
Compare
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). |
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 |
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.
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 { |
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.
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.
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.
Not sure if you mean add a public helper in app module, or do you have any example I should put it in.
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.
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
1de6e99
to
142bc2e
Compare
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.
lgtm! Thank you
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
make lint
andmake test
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...
!
in the type prefix if API or client breaking change