Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: double auth tx size cost per byte from 10 to 20 #7249

Merged
merged 5 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

### Bug Fixes

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
}
}
4 changes: 2 additions & 2 deletions tests/e2e/configurer/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func New(t *testing.T, containerManager *containers.Manager, id string, initVali
Id: id,
},
ValidatorInitConfigs: initValidatorConfigs,
VotingPeriod: numVal*config.PropVoteBlocks + config.PropBufferBlocks,
ExpeditedVotingPeriod: numVal*config.PropVoteBlocks + config.PropBufferBlocks - 3,
VotingPeriod: numVal*config.PropVoteBlocks + config.PropBufferBlocksVotePeriod,
ExpeditedVotingPeriod: numVal*config.PropVoteBlocks + config.PropBufferBlocksVotePeriod - 3,
t: t,
containerManager: containerManager,
}
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/configurer/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ 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
// number of blocks used as a calculation buffer (used to set actual voting period)
PropBufferBlocksVotePeriod float32 = 8
// max retries for json unmarshalling
MaxRetries = 60
)
Expand Down