From 3b83f60be14100eeac027d7d9aa68b5873e9795e Mon Sep 17 00:00:00 2001 From: Arham Chordia <43543921+arhamchordia@users.noreply.github.com> Date: Fri, 30 Aug 2024 18:50:26 +0530 Subject: [PATCH] v3 Upgrade Params (#837) --- app/upgrades/v3/upgrades.go | 21 +++++++++++++++------ app/upgrades/v3/upgrades_test.go | 14 +++++++++++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/app/upgrades/v3/upgrades.go b/app/upgrades/v3/upgrades.go index ec34c024f..25faab826 100644 --- a/app/upgrades/v3/upgrades.go +++ b/app/upgrades/v3/upgrades.go @@ -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 @@ -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) diff --git a/app/upgrades/v3/upgrades_test.go b/app/upgrades/v3/upgrades_test.go index dd4c540a0..ba6a197f8 100644 --- a/app/upgrades/v3/upgrades_test.go +++ b/app/upgrades/v3/upgrades_test.go @@ -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") }