From 3132f15a9cb5811fe0fa43eec1203487e87113d3 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 30 Apr 2024 10:54:39 -0600 Subject: [PATCH 1/4] consensus param change --- app/upgrades/v25/constants.go | 5 +++++ app/upgrades/v25/upgrades.go | 6 ++++++ app/upgrades/v25/upgrades_test.go | 16 ++++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v25/constants.go b/app/upgrades/v25/constants.go index ac6276bfe53..02f3dce9349 100644 --- a/app/upgrades/v25/constants.go +++ b/app/upgrades/v25/constants.go @@ -1,6 +1,8 @@ package v25 import ( + "time" + "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v25/app/upgrades" @@ -17,6 +19,9 @@ const ( // Noble USDC is used as the auction denom AuctionUSDCDenom = "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4" + + NewMaxAgeNumBlocks = int64(1_000_000) // 1.5s blocks * 1_000_000 = 1.5M seconds > 2 weeks + NewMaxAgeDuration = time.Second * 1209600 // 2 weeks ) var Upgrade = upgrades.Upgrade{ diff --git a/app/upgrades/v25/upgrades.go b/app/upgrades/v25/upgrades.go index 1e4684e757e..27c1326008c 100644 --- a/app/upgrades/v25/upgrades.go +++ b/app/upgrades/v25/upgrades.go @@ -84,6 +84,12 @@ func CreateUpgradeHandler( authenticatorParams.IsSmartAccountActive = false keepers.SmartAccountKeeper.SetParams(ctx, authenticatorParams) + // Update consensus params in order to safely enable comet + consensusParams, err := keepers.ConsensusParamsKeeper.Get(ctx) + consensusParams.Evidence.MaxAgeNumBlocks = NewMaxAgeNumBlocks + consensusParams.Evidence.MaxAgeDuration = NewMaxAgeDuration + keepers.ConsensusParamsKeeper.Set(ctx, consensusParams) + return migrations, nil } } diff --git a/app/upgrades/v25/upgrades_test.go b/app/upgrades/v25/upgrades_test.go index cd7f6ee25a9..e3f66040dc4 100644 --- a/app/upgrades/v25/upgrades_test.go +++ b/app/upgrades/v25/upgrades_test.go @@ -42,17 +42,23 @@ func (s *UpgradeTestSuite) TestUpgrade() { oldMigrationList, lastPoolPositionID, migratedPoolBeforeUpgradeSpreadRewards, nonMigratedPoolBeforeUpgradeSpreadRewards := s.PrepareSpreadRewardsMigrationTestEnv() preMigrationSigningInfo := s.prepareMissedBlocksCounterTest() + // Check consensus params before upgrade + consParamsPre, err := s.App.ConsensusParamsKeeper.Get(s.Ctx) + s.Require().NoError(err) + s.Require().NotEqual(consParamsPre.Evidence.MaxAgeDuration, v25.NewMaxAgeDuration) + s.Require().NotEqual(consParamsPre.Evidence.MaxAgeNumBlocks, v25.NewMaxAgeNumBlocks) + // Run the upgrade dummyUpgrade(s) s.Require().NotPanics(func() { s.App.BeginBlocker(s.Ctx, abci.RequestBeginBlock{}) }) - // check auction params + // Check auction params params, err := s.App.AuctionKeeper.GetParams(s.Ctx) s.Require().NoError(err) - // check auction params + // Check auction params s.Require().Equal(params.MaxBundleSize, v25.AuctionParams.MaxBundleSize) s.Require().Equal(params.ReserveFee.Denom, v25.AuctionParams.ReserveFee.Denom) s.Require().Equal(params.ReserveFee.Amount.Int64(), v25.AuctionParams.ReserveFee.Amount.Int64()) @@ -62,6 +68,12 @@ func (s *UpgradeTestSuite) TestUpgrade() { s.Require().Equal(params.FrontRunningProtection, v25.AuctionParams.FrontRunningProtection) s.Require().Equal(params.ProposerFee, v25.AuctionParams.ProposerFee) + // Check consensus params after upgrade + consParamsPost, err := s.App.ConsensusParamsKeeper.Get(s.Ctx) + s.Require().NoError(err) + s.Require().Equal(consParamsPost.Evidence.MaxAgeDuration, v25.NewMaxAgeDuration) + s.Require().Equal(consParamsPost.Evidence.MaxAgeNumBlocks, v25.NewMaxAgeNumBlocks) + s.ExecuteSpreadRewardsMigrationTest(oldMigrationList, lastPoolPositionID, migratedPoolBeforeUpgradeSpreadRewards, nonMigratedPoolBeforeUpgradeSpreadRewards) s.executeMissedBlocksCounterTest(preMigrationSigningInfo) } From 5b971e5738bb8f2491d6d323ee7ac4ce0d339d75 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 30 Apr 2024 11:01:33 -0600 Subject: [PATCH 2/4] changelog --- CHANGELOG.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1ff5885112..9ab32b98579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,17 +44,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### State Breaking -* [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev. +* [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev * [#7876](https://github.com/osmosis-labs/osmosis/pull/7876) Migrate subset of spread reward accumulators -* [#7005](https://github.com/osmosis-labs/osmosis/pull/7005) Adding deactivated smart account module. +* [#7005](https://github.com/osmosis-labs/osmosis/pull/7005) Adding deactivated smart account module * [#8106](https://github.com/osmosis-labs/osmosis/pull/8106) Enable ProtoRev distro on epoch * [#8053](https://github.com/osmosis-labs/osmosis/pull/8053) Reset validator signing info missed blocks counter -* [#8073](https://github.com/osmosis-labs/osmosis/pull/8073) Speedup CL spread factor calculations, but mildly changes rounding behavior in the final decimal place. +* [#8073](https://github.com/osmosis-labs/osmosis/pull/8073) Speedup CL spread factor calculations, but mildly changes rounding behavior in the final decimal place * [#8125](https://github.com/osmosis-labs/osmosis/pull/8125) When using smart accounts, fees are deducted directly after the feePayer is authenticated. Regardless of the authentication of other signers * [#8136](https://github.com/osmosis-labs/osmosis/pull/8136) Don't allow gauge creation/addition with rewards that have no protorev route (i.e. no way to determine if rewards meet minimum epoch value distribution requirements) -* [#8144](https://github.com/osmosis-labs/osmosis/pull/8144) IBC wasm clients can now make stargate queries and support abort. -* [#8147](https://github.com/osmosis-labs/osmosis/pull/8147) Process unbonding locks once per minute, rather than every single block. -* [#8157](https://github.com/osmosis-labs/osmosis/pull/8157) Speedup protorev by not unmarshalling pools in cost-estimation phase. +* [#8144](https://github.com/osmosis-labs/osmosis/pull/8144) IBC wasm clients can now make stargate queries and support abort +* [#8147](https://github.com/osmosis-labs/osmosis/pull/8147) Process unbonding locks once per minute, rather than every single block +* [#8157](https://github.com/osmosis-labs/osmosis/pull/8157) Speedup protorev by not unmarshalling pools in cost-estimation phase +* [#8177](https://github.com/osmosis-labs/osmosis/pull/8177) Change consensus params to match unbonding period ### State Compatible @@ -65,7 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## v24.0.4 -* [#8142](https://github.com/osmosis-labs/osmosis/pull/8142) Add query for getting single authenticator and add stargate whitelist for the query. +* [#8142](https://github.com/osmosis-labs/osmosis/pull/8142) Add query for getting single authenticator and add stargate whitelist for the query * [#8149](https://github.com/osmosis-labs/osmosis/pull/8149) Default timeoutCommit to 1.5s ## v24.0.3 From 1fc83924edb524a56d62238bcc3589a4f66ffcf5 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 30 Apr 2024 11:10:27 -0600 Subject: [PATCH 3/4] err --- app/upgrades/v25/upgrades.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/upgrades/v25/upgrades.go b/app/upgrades/v25/upgrades.go index 27c1326008c..862bb9ac041 100644 --- a/app/upgrades/v25/upgrades.go +++ b/app/upgrades/v25/upgrades.go @@ -86,6 +86,9 @@ func CreateUpgradeHandler( // Update consensus params in order to safely enable comet consensusParams, err := keepers.ConsensusParamsKeeper.Get(ctx) + if err != nil { + return nil, err + } consensusParams.Evidence.MaxAgeNumBlocks = NewMaxAgeNumBlocks consensusParams.Evidence.MaxAgeDuration = NewMaxAgeDuration keepers.ConsensusParamsKeeper.Set(ctx, consensusParams) From 8783b0004e014cda086a05d910f35f7604578ee5 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Wed, 1 May 2024 10:44:04 -0500 Subject: [PATCH 4/4] Update upgrades.go --- app/upgrades/v25/upgrades.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/v25/upgrades.go b/app/upgrades/v25/upgrades.go index 01497f5d8df..60428a8970d 100644 --- a/app/upgrades/v25/upgrades.go +++ b/app/upgrades/v25/upgrades.go @@ -92,7 +92,7 @@ func CreateUpgradeHandler( authenticatorParams.IsSmartAccountActive = false keepers.SmartAccountKeeper.SetParams(ctx, authenticatorParams) - // Update consensus params in order to safely enable comet + // Update consensus params in order to safely enable comet pruning consensusParams, err := keepers.ConsensusParamsKeeper.Get(ctx) if err != nil { return nil, err