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

[CORE-850] Update default values for new Gov parameters #34

Merged
merged 5 commits into from
Jan 26, 2024

Conversation

teddyding
Copy link

Description

Update default values for new gov parameters in v0.50 migration. See values and rationale here.


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)

Copy link

@teddyding your pull request is missing a changelog!

@teddyding teddyding changed the title Update default values for new Gov parameters [CORE-850] Update default values for new Gov parameters Jan 11, 2024
Copy link

linear bot commented Jan 11, 2024

@@ -36,7 +36,7 @@ func MigrateStore(ctx sdk.Context, storeService corestoretypes.KVStoreService, c
}
Copy link
Author

Choose a reason for hiding this comment

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

Note: this MigrationStore is registered here, which is run in RunMigrations during the v_4_0_0_0 upgrade.

Copy link

Choose a reason for hiding this comment

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

can we make sure that this gets tested during our qualification in staging + testnet?

DefaultVetoThreshold = sdkmath.LegacyNewDecWithPrec(334, 3)
DefaultMinInitialDepositRatio = sdkmath.LegacyZeroDec()
// (New default value for v0.50 migration) 100% of deposit will not be returned to the depositors,
// if the proposal is cancelled. Also, `MsgCancelProposal` is disabled in application.
Copy link
Author

Choose a reason for hiding this comment

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

Disabling MsgCancelProposal will be done in the follow-up PR that points v4-chain to this commit.

@@ -36,7 +36,7 @@ func MigrateStore(ctx sdk.Context, storeService corestoretypes.KVStoreService, c
}
Copy link

Choose a reason for hiding this comment

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

can we make sure that this gets tested during our qualification in staging + testnet?

@@ -36,7 +36,7 @@ func MigrateStore(ctx sdk.Context, storeService corestoretypes.KVStoreService, c
}

defaultParams := govv1.DefaultParams()
params.ExpeditedMinDeposit = defaultParams.ExpeditedMinDeposit
params.ExpeditedMinDeposit = params.MinDeposit // Use regular `min_deposit` as `expedited_min_deposit`
Copy link

Choose a reason for hiding this comment

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

how come we only update the min deposit but not the expedited voting period and threshold?

Copy link
Author

Choose a reason for hiding this comment

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

We update these other params by though updated value of defaultParams := govv1.DefaultParams(). I added a comment to highlight

Only ExpeditedMinDeposit needs to be explicitly updated here since we need the min_deposit value from state.

Copy link

Choose a reason for hiding this comment

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

makes sense. can we update the comment to highlight "need to use min_deposit from state to use the same denom"?

the current comment doesn't explain why we are doing this

x/gov/types/v1/params.go Show resolved Hide resolved
Comment on lines 48 to 49
require.Equal(t, v1.DefaultParams().ExpeditedThreshold, params.ExpeditedThreshold)
require.Equal(t, v1.DefaultParams().ExpeditedVotingPeriod, params.ExpeditedVotingPeriod)
Copy link

Choose a reason for hiding this comment

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

shouldn't some of these values change?

Copy link
Author

Choose a reason for hiding this comment

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

These lines weren't updated since both v1.DefaultParams().XXXX and params.ExpeditedVotingPeriod were updated. I changed them to literals to be explicit

@@ -36,7 +36,7 @@ func MigrateStore(ctx sdk.Context, storeService corestoretypes.KVStoreService, c
}

defaultParams := govv1.DefaultParams()
params.ExpeditedMinDeposit = defaultParams.ExpeditedMinDeposit
params.ExpeditedMinDeposit = params.MinDeposit // Use regular `min_deposit` as `expedited_min_deposit`
Copy link

Choose a reason for hiding this comment

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

makes sense. can we update the comment to highlight "need to use min_deposit from state to use the same denom"?

the current comment doesn't explain why we are doing this

@teddyding teddyding merged commit c748d7e into dydx-fork-v0.50.1 Jan 26, 2024
34 of 38 checks passed
@teddyding teddyding deleted the td/gov-migration branch January 26, 2024 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants