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

v3 Upgrade Params #837

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions app/upgrades/v3/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ func CreateUpgradeHandler(

// Set rate-limit params
keepers.RatelimitKeeper.SetParams(ctx, ratelimittypes.DefaultParams())

// Set pfm params
err = keepers.PFMRouterKeeper.SetParams(ctx, pfmtypes.DefaultParams())
if err != nil {
return nil, err
}

// fee market params
// TODO: change values from default after discussion
ctx.Logger().Info("Setting dynamicfees/feemarket params...")
err = setFeeMarketParams(ctx, keepers.FeeMarketKeeper)
if err != nil {
return nil, err
Expand All @@ -77,11 +77,20 @@ func CreateUpgradeHandler(

func setFeeMarketParams(ctx sdk.Context, feemarketKeeper *feemarketkeeper.Keeper) error {
feemarketParams := feemarkettypes.DefaultParams()
feemarketParams.MinBaseGasPrice = math.LegacyMustNewDecFromStr("0.10000000000000000")
feemarketParams.MaxBlockUtilization = uint64(120_000_000)
feemarketParams.FeeDenom = appparams.DefaultBondDenom
feemarketParams.Enabled = true

// update params
feemarketParams.Alpha = math.LegacyMustNewDecFromStr("0.003000000000000000")
feemarketParams.Beta = math.LegacyMustNewDecFromStr("0.980000000000000000")
feemarketParams.Delta = math.LegacyMustNewDecFromStr("0.001500000000000000")
feemarketParams.DistributeFees = true
feemarketParams.Enabled = true
feemarketParams.FeeDenom = appparams.DefaultBondDenom
feemarketParams.Gamma = math.LegacyMustNewDecFromStr("0.008000000000000000")
feemarketParams.MaxBlockUtilization = uint64(120000000)
feemarketParams.MaxLearningRate = math.LegacyMustNewDecFromStr("0.125000000000000000")
feemarketParams.MinBaseGasPrice = math.LegacyMustNewDecFromStr("0.100000000000000000")
feemarketParams.MinLearningRate = math.LegacyMustNewDecFromStr("0.075000000000000000")
feemarketParams.Window = uint64(7)

feemarketState := feemarkettypes.NewState(feemarketParams.Window, feemarketParams.MinBaseGasPrice, feemarketParams.MinLearningRate)
err := feemarketKeeper.SetParams(ctx, feemarketParams)
Expand Down
14 changes: 11 additions & 3 deletions app/upgrades/v3/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,18 @@ func (s *UpgradeTestSuite) TestUpgrade() {
feemarketParams, err := keepers.FeeMarketKeeper.GetParams(ctx)
s.Require().NoError(err, "Error getting feemarket params after upgrade")
expectedFeeMarketParams := feemarkettypes.DefaultParams()
expectedFeeMarketParams.MinBaseGasPrice = math.LegacyMustNewDecFromStr("0.10000000000000000")
expectedFeeMarketParams.MaxBlockUtilization = uint64(120000000)
expectedFeeMarketParams.FeeDenom = "uqsr"
expectedFeeMarketParams.Alpha = math.LegacyMustNewDecFromStr("0.003000000000000000")
expectedFeeMarketParams.Beta = math.LegacyMustNewDecFromStr("0.980000000000000000")
expectedFeeMarketParams.Delta = math.LegacyMustNewDecFromStr("0.001500000000000000")
expectedFeeMarketParams.DistributeFees = true
expectedFeeMarketParams.Enabled = true
expectedFeeMarketParams.FeeDenom = "uqsr"
expectedFeeMarketParams.Gamma = math.LegacyMustNewDecFromStr("0.008000000000000000")
expectedFeeMarketParams.MaxBlockUtilization = uint64(120000000)
expectedFeeMarketParams.MaxLearningRate = math.LegacyMustNewDecFromStr("0.125000000000000000")
expectedFeeMarketParams.MinBaseGasPrice = math.LegacyMustNewDecFromStr("0.100000000000000000")
expectedFeeMarketParams.MinLearningRate = math.LegacyMustNewDecFromStr("0.075000000000000000")
expectedFeeMarketParams.Window = uint64(7)
s.Require().Equal(expectedFeeMarketParams, feemarketParams, "Fee market params do not match expected values after upgrade")
}

Expand Down
Loading