From c15cc9d7f105e6fe2c1003007cf6997f81749839 Mon Sep 17 00:00:00 2001 From: Arham Chordia Date: Fri, 30 Aug 2024 18:16:40 +0530 Subject: [PATCH 1/2] Updating feemarket params for mainnet. --- app/upgrades/v3/upgrades.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 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) From e59297b0b046428b43872ce1d41fe8254def0ab5 Mon Sep 17 00:00:00 2001 From: Arham Chordia Date: Fri, 30 Aug 2024 18:26:00 +0530 Subject: [PATCH 2/2] Fix upgrades_test.go --- app/upgrades/v3/upgrades_test.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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") }