From ce2f13cd571e4ba973b37f5203197fbd1c453ade Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 31 Dec 2023 15:35:59 -0700 Subject: [PATCH 1/4] register consensus params --- app/upgrades/v22/upgrades.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/upgrades/v22/upgrades.go b/app/upgrades/v22/upgrades.go index c253064b547..0092dc66b7a 100644 --- a/app/upgrades/v22/upgrades.go +++ b/app/upgrades/v22/upgrades.go @@ -1,6 +1,7 @@ package v22 import ( + tmtypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" @@ -23,6 +24,13 @@ func CreateUpgradeHandler( return nil, err } + // Properly register consensus params. In the process, change params as per: + // https://forum.osmosis.zone/t/raise-maximum-gas-to-300m-and-lower-max-bytes-to-5mb/1116 + defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto() + defaultConsensusParams.Block.MaxBytes = 5000000 + defaultConsensusParams.Block.MaxGas = 300000000 + keepers.ConsensusParamsKeeper.Set(ctx, &defaultConsensusParams) + return migrations, nil } } From 206880b539f4706a2de92cfe91cd88d784720e5e Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sun, 31 Dec 2023 21:57:03 -0700 Subject: [PATCH 2/4] fix upgrade blocks and register --- app/modules.go | 2 ++ app/upgrades/v22/upgrades.go | 3 ++- tests/e2e/configurer/config/constants.go | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/modules.go b/app/modules.go index 6680dde87d4..43f61104f51 100644 --- a/app/modules.go +++ b/app/modules.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" icq "github.com/cosmos/ibc-apps/modules/async-icq/v7" @@ -161,6 +162,7 @@ func appModules( ibc.NewAppModule(app.IBCKeeper), ica.NewAppModule(nil, app.ICAHostKeeper), params.NewAppModule(*app.ParamsKeeper), + consensus.NewAppModule(appCodec, *app.AppKeepers.ConsensusParamsKeeper), app.RawIcs20TransferAppModule, gamm.NewAppModule(appCodec, *app.GAMMKeeper, app.AccountKeeper, app.BankKeeper), poolmanager.NewAppModule(*app.PoolManagerKeeper, app.GAMMKeeper), diff --git a/app/upgrades/v22/upgrades.go b/app/upgrades/v22/upgrades.go index 0092dc66b7a..6a8026448b3 100644 --- a/app/upgrades/v22/upgrades.go +++ b/app/upgrades/v22/upgrades.go @@ -1,11 +1,12 @@ package v22 import ( - tmtypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/osmosis-labs/osmosis/v21/app/keepers" "github.com/osmosis-labs/osmosis/v21/app/upgrades" ) diff --git a/tests/e2e/configurer/config/constants.go b/tests/e2e/configurer/config/constants.go index 8b6429594af..2a21dabd28a 100644 --- a/tests/e2e/configurer/config/constants.go +++ b/tests/e2e/configurer/config/constants.go @@ -14,7 +14,7 @@ const ( // number of blocks it takes to vote for a single validator to vote for a proposal PropVoteBlocks float32 = 1 // number of blocks used as a calculation buffer - PropBufferBlocks float32 = 8 + PropBufferBlocks float32 = 30 // max retries for json unmarshalling MaxRetries = 60 ) From 0797c85cd43533bb2bbc13dac1d40bc1fe820326 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Mon, 1 Jan 2024 18:43:36 -0700 Subject: [PATCH 3/4] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3bb8655f3c..8a368b2372d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#7106](https://github.com/osmosis-labs/osmosis/pull/7106) Halve the time of log2 calculation (speeds up TWAP code) * [#7093](https://github.com/osmosis-labs/osmosis/pull/7093),[#7100](https://github.com/osmosis-labs/osmosis/pull/7100),[#7172](https://github.com/osmosis-labs/osmosis/pull/7172) Lower CPU overheads of the Osmosis epoch. * [#7203](https://github.com/osmosis-labs/osmosis/pull/7203) Make a maximum number of pools of 100 billion. +* [#7220](https://github.com/osmosis-labs/osmosis/pull/7220) Register consensus params; Set MaxGas to 300m and MaxBytes to 5mb. ## v21.1.5 From cb054741ed023818ddc8e0d98a3333a293c0b998 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 2 Jan 2024 23:18:09 -0700 Subject: [PATCH 4/4] code comment previous values --- app/upgrades/v22/upgrades.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v22/upgrades.go b/app/upgrades/v22/upgrades.go index 6a8026448b3..454e430ef87 100644 --- a/app/upgrades/v22/upgrades.go +++ b/app/upgrades/v22/upgrades.go @@ -28,8 +28,8 @@ func CreateUpgradeHandler( // Properly register consensus params. In the process, change params as per: // https://forum.osmosis.zone/t/raise-maximum-gas-to-300m-and-lower-max-bytes-to-5mb/1116 defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto() - defaultConsensusParams.Block.MaxBytes = 5000000 - defaultConsensusParams.Block.MaxGas = 300000000 + defaultConsensusParams.Block.MaxBytes = 5000000 // previously 10485760 + defaultConsensusParams.Block.MaxGas = 300000000 // previously 120000000 keepers.ConsensusParamsKeeper.Set(ctx, &defaultConsensusParams) return migrations, nil