Skip to content

Commit

Permalink
fix: register consensus params (#7220)
Browse files Browse the repository at this point in the history
* register consensus params

* fix upgrade blocks and register

* add changelog

* code comment previous values
  • Loading branch information
czarcas7ic authored Jan 9, 2024
1 parent ae036e8 commit 5742333
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,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.
* [#7249](https://github.com/osmosis-labs/osmosis/pull/7249) Double auth tx size cost per byte from 10 to 20
* [#7259](https://github.com/osmosis-labs/osmosis/pull/7259) Lower gas and CPU overhead of chargeTakerFee (in every swap)
* [#7253](https://github.com/osmosis-labs/osmosis/pull/7253) Extended app hash logs (includes module hashes for easier debugging)
Expand Down
2 changes: 2 additions & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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),
Expand Down
9 changes: 9 additions & 0 deletions app/upgrades/v22/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"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"
)
Expand All @@ -23,6 +25,13 @@ func CreateUpgradeHandler(
return nil, err
}

// Properly register consensus params. In the process, change params as per:
// https://www.mintscan.io/osmosis/proposals/705
defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto()
defaultConsensusParams.Block.MaxBytes = 5000000 // previously 10485760
defaultConsensusParams.Block.MaxGas = 300000000 // previously 120000000
keepers.ConsensusParamsKeeper.Set(ctx, &defaultConsensusParams)

// Increase the tx size cost per byte to 20 to reduce the exploitability of bandwidth amplification problems.
accountParams := keepers.AccountKeeper.GetParams(ctx)
accountParams.TxSizeCostPerByte = 20 // Double from the default value of 10
Expand Down

0 comments on commit 5742333

Please sign in to comment.