-
Notifications
You must be signed in to change notification settings - Fork 340
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
Danwt/fix seq params - DO NOT MERGE #1448
Conversation
if !subspace.HasKeyTable() { | ||
subspace.WithKeyTable(keyTable) | ||
} |
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.
LoadDeprecatedParamsSubspaces is useless and unnecessary
it does nothing because the adjusted subspace isn't passed anywhere
The only place that needs it is the consensus params upgrade but that does it by itself
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.
outdated comment I believe
upgradetypes.ModuleName, | ||
epochstypes.ModuleName, |
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.
Epochs being first led to delayedack and incentives trying to access new params before they have been set in migration
|
||
sequencermodule.NewAppModule(appCodec, a.SequencerKeeper, a.AccountKeeper, a.BankKeeper), |
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.
completely deleted sequencer param store migration because we liteerally just set all params to default, so can just do that very simply, without a module specific migration
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.
module specific migration is the preferred way, though
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.
🤷
params := streamertypes.DefaultParams() | ||
sk.SetParams(ctx, params) |
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.
avoid reading new param before setting it
func migrateIncentivesParams(ctx sdk.Context, ik *incentiveskeeper.Keeper) { | ||
params := ik.GetParams(ctx) | ||
defaultParams := incentivestypes.DefaultParams() | ||
params.CreateGaugeBaseFee = defaultParams.CreateGaugeBaseFee | ||
params.AddToGaugeBaseFee = defaultParams.AddToGaugeBaseFee | ||
params.AddDenomFee = defaultParams.AddDenomFee | ||
params := incentivestypes.DefaultParams() | ||
params.DistrEpochIdentifier = ik.DistrEpochIdentifier(ctx) |
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.
same as what alex did
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.
I this it's fine but we should still remove all use of GetParamsSet, as I did in my PR, otherwise we will likely see more panics
|
||
sequencermodule.NewAppModule(appCodec, a.SequencerKeeper, a.AccountKeeper, a.BankKeeper), |
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.
module specific migration is the preferred way, though
@@ -51,7 +51,46 @@ func CreateUpgradeHandler( | |||
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | |||
logger := ctx.Logger().With("upgrade", UpgradeName) | |||
|
|||
LoadDeprecatedParamsSubspaces(keepers) | |||
for _, subspace := range keepers.ParamsKeeper.GetSubspaces() { |
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.
why move this code here instead of where it was?
if !subspace.HasKeyTable() { | ||
subspace.WithKeyTable(keyTable) | ||
} |
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.
outdated comment I believe
@zale144 re I this it's fine but we should still remove all use of GetParamsSet, as I did in my PR, otherwise we will likely see more panics Why do you think so? They have now been migrated so.. |
other pr is up #1459 |
Description
Closes #XXX
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.
PR review checkboxes:
I have...
Unreleased
section inCHANGELOG.md
godoc
commentsSDK Checklist
map
time.Now()
sendCoin
and notSendCoins
Full security checklist here
For Reviewer:
After reviewer approval: