Skip to content

Commit

Permalink
feat: double auth tx size cost per byte from 10 to 20 (#7249)
Browse files Browse the repository at this point in the history
Closes: #XXX

## What is the purpose of the change

Doubles auth tx size cost per byte from 10 to 20.
  • Loading branch information
czarcas7ic authored Jan 8, 2024
1 parent 2946424 commit d545306
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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.
* [#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)
* [#7258](https://github.com/osmosis-labs/osmosis/pull/7258) Remove an iterator call in CL swaps and spot price calls.

Expand Down
8 changes: 8 additions & 0 deletions app/upgrades/v22/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ func CreateUpgradeHandler(
return nil, err
}

// 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
err = keepers.AccountKeeper.SetParams(ctx, accountParams)
if err != nil {
return nil, err
}

return migrations, nil
}
}

0 comments on commit d545306

Please sign in to comment.