Skip to content

Commit

Permalink
Add maximum pool ID (#7203)
Browse files Browse the repository at this point in the history
* Add maximum pool ID

* Update changelog
  • Loading branch information
ValarDragon authored Dec 28, 2023
1 parent cb9cb4e commit 7bfcb0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Misc Improvements
* [#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/7093) Lower CPU overheads of the Osmosis epoch.
* [#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.

## v21.0.0

Expand Down
3 changes: 3 additions & 0 deletions x/poolmanager/create_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func (k Keeper) createPoolZeroLiquidityNoCreationFee(ctx sdk.Context, msg types.

// Get the next pool ID and increment the pool ID counter.
poolId := k.getNextPoolIdAndIncrement(ctx)
if poolId >= types.MaxPoolId {
return nil, fmt.Errorf("next pool ID %d is greater than max pool ID %d", poolId, types.MaxPoolId)
}

poolType := msg.GetPoolType()

Expand Down
2 changes: 2 additions & 0 deletions x/poolmanager/types/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/osmosis-labs/osmosis/osmoutils"
)

var MaxPoolId uint64 = 99_999_999_999

// PoolI defines an interface for pools that hold tokens.
type PoolI interface {
proto.Message
Expand Down

0 comments on commit 7bfcb0d

Please sign in to comment.