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

Danwt/fix seq params - DO NOT MERGE #1448

Closed
wants to merge 15 commits into from

Conversation

danwt
Copy link
Contributor

@danwt danwt commented Nov 8, 2024

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...

  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Targeted PR against the correct branch
  • included the correct type prefix in the PR title
  • Linked to the GitHub issue with discussion and accepted design
  • Targets only one GitHub issue
  • Wrote unit and integration tests
  • Wrote relevant migration scripts if necessary
  • All CI checks have passed
  • Added relevant godoc comments
  • Updated the scripts for local run, e.g genesis_config_commands.sh if the PR changes parameters
  • Add an issue in the e2e-tests repo if necessary

SDK Checklist

  • Import/Export Genesis
  • Registered Invariants
  • Registered Events
  • Updated openapi.yaml
  • No usage of go map
  • No usage of time.Now()
  • Used fixed point arithmetic and not float arithmetic
  • Avoid panicking in Begin/End block as much as possible
  • No unexpected math Overflow
  • Used sendCoin and not SendCoins
  • Out-of-block compute is bounded
  • No serialized ID at the end of store keys
  • UInt to byte conversion should use BigEndian

Full security checklist here


For Reviewer:

  • Confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • Confirmed all author checklist items have been addressed

After reviewer approval:

  • In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
  • In case the PR targets a release branch, PR must be rebased.

@danwt danwt requested a review from a team as a code owner November 8, 2024 19:59
@danwt danwt changed the base branch from main to feature/mainnet-simulation-rc01 November 8, 2024 19:59
Comment on lines -155 to -157
if !subspace.HasKeyTable() {
subspace.WithKeyTable(keyTable)
}
Copy link
Contributor Author

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

Copy link
Contributor

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,
Copy link
Contributor Author

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

Comment on lines +208 to +209

sequencermodule.NewAppModule(appCodec, a.SequencerKeeper, a.AccountKeeper, a.BankKeeper),
Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤷

Comment on lines +150 to +151
params := streamertypes.DefaultParams()
sk.SetParams(ctx, params)
Copy link
Contributor Author

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

Comment on lines 214 to +216
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)
Copy link
Contributor Author

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

@omritoptix omritoptix changed the title Danwt/fix seq params Danwt/fix seq params - DO NOT MERGE Nov 9, 2024
Copy link
Contributor

@zale144 zale144 left a 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

Comment on lines +208 to +209

sequencermodule.NewAppModule(appCodec, a.SequencerKeeper, a.AccountKeeper, a.BankKeeper),
Copy link
Contributor

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() {
Copy link
Contributor

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?

Comment on lines -155 to -157
if !subspace.HasKeyTable() {
subspace.WithKeyTable(keyTable)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

outdated comment I believe

@danwt
Copy link
Contributor Author

danwt commented Nov 11, 2024

@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..

@danwt
Copy link
Contributor Author

danwt commented Nov 11, 2024

other pr is up #1459

@danwt danwt closed this Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants