-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat!: ics parameter migration #1408
Conversation
5ec7e3d
to
4af7cc0
Compare
4af7cc0
to
e47868f
Compare
e47868f
to
849d913
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.
Looks good!
I don't have any logic comments, just some nitpicks. Please address the nitpicks (around keys and such) so we don't get confuced in the future.
Also, on the consumer we will need to set the consensus version to 3
because there's a migration in main that has to be rebased into feat/v50-upgrade
- I'll handle that part.
@@ -106,13 +106,21 @@ const ( | |||
// SlashRecordByteKey is the single byte key storing the consumer's slash record. | |||
SlashRecordByteKey | |||
|
|||
// ParametersKey is the single byte key for storing consumer's parameters. | |||
ParametersByteKey |
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.
Mark unused keys as deprecated, please.
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.
For consumer the deprecated ones are in x/ccv/types/params.go#48
Marked them deprecated as discussed
x/ccv/provider/module.go
Outdated
@@ -119,6 +119,12 @@ func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { | |||
func (am AppModule) RegisterServices(cfg module.Configurator) { | |||
providertypes.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) | |||
providertypes.RegisterQueryServer(cfg.QueryServer(), am.keeper) | |||
|
|||
migrator := keeper.NewMigrator(*am.keeper, am.paramSpace) | |||
err := cfg.RegisterMigration(am.Name(), 2, migrator.MigrateParams) |
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.
Maybe call the migrator.MigrateParams -> migrator.Migrate2to3
@@ -138,13 +138,21 @@ const ( | |||
// handled in the current block | |||
VSCMaturedHandledThisBlockBytePrefix | |||
|
|||
// ParametersKey is the is the single byte key for storing provider's parameters. |
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.
Comment on the deprecated keys and tag them as deprecated
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.
depreacted keys for parameter values are located in x/ccv/provider/types/params.go#49
Added deprecation comment on related keys
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.
Approve!
Thanks for the changes
Description
Closes: #1378
Migrate legacy params to store parameters directly in the module itself as x/params SDK moduel is deprecated since Cosmos SDK v0.46.
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 state-machine breaking change (i.e., requires coordinated upgrade)CHANGELOG.md
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