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

chore: consensus param change #8177

Merged
merged 5 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 8 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### State Breaking

* [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev.
* [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev
* [#7876](https://github.com/osmosis-labs/osmosis/pull/7876) Migrate subset of spread reward accumulators
* [#7005](https://github.com/osmosis-labs/osmosis/pull/7005) Adding deactivated smart account module.
* [#7005](https://github.com/osmosis-labs/osmosis/pull/7005) Adding deactivated smart account module
* [#8106](https://github.com/osmosis-labs/osmosis/pull/8106) Enable ProtoRev distro on epoch
* [#8053](https://github.com/osmosis-labs/osmosis/pull/8053) Reset validator signing info missed blocks counter
* [#8073](https://github.com/osmosis-labs/osmosis/pull/8073) Speedup CL spread factor calculations, but mildly changes rounding behavior in the final decimal place.
* [#8073](https://github.com/osmosis-labs/osmosis/pull/8073) Speedup CL spread factor calculations, but mildly changes rounding behavior in the final decimal place
* [#8125](https://github.com/osmosis-labs/osmosis/pull/8125) When using smart accounts, fees are deducted directly after the feePayer is authenticated. Regardless of the authentication of other signers
* [#8136](https://github.com/osmosis-labs/osmosis/pull/8136) Don't allow gauge creation/addition with rewards that have no protorev route (i.e. no way to determine if rewards meet minimum epoch value distribution requirements)
* [#8144](https://github.com/osmosis-labs/osmosis/pull/8144) IBC wasm clients can now make stargate queries and support abort.
* [#8147](https://github.com/osmosis-labs/osmosis/pull/8147) Process unbonding locks once per minute, rather than every single block.
* [#8157](https://github.com/osmosis-labs/osmosis/pull/8157) Speedup protorev by not unmarshalling pools in cost-estimation phase.
* [#8144](https://github.com/osmosis-labs/osmosis/pull/8144) IBC wasm clients can now make stargate queries and support abort
* [#8147](https://github.com/osmosis-labs/osmosis/pull/8147) Process unbonding locks once per minute, rather than every single block
* [#8157](https://github.com/osmosis-labs/osmosis/pull/8157) Speedup protorev by not unmarshalling pools in cost-estimation phase
* [#8177](https://github.com/osmosis-labs/osmosis/pull/8177) Change consensus params to match unbonding period


### State Compatible
Expand All @@ -65,7 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## v24.0.4

* [#8142](https://github.com/osmosis-labs/osmosis/pull/8142) Add query for getting single authenticator and add stargate whitelist for the query.
* [#8142](https://github.com/osmosis-labs/osmosis/pull/8142) Add query for getting single authenticator and add stargate whitelist for the query
* [#8149](https://github.com/osmosis-labs/osmosis/pull/8149) Default timeoutCommit to 1.5s

## v24.0.3
Expand Down
5 changes: 5 additions & 0 deletions app/upgrades/v25/constants.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package v25

import (
"time"

"github.com/osmosis-labs/osmosis/osmomath"
"github.com/osmosis-labs/osmosis/v25/app/upgrades"

Expand All @@ -17,6 +19,9 @@ const (

// Noble USDC is used as the auction denom
AuctionUSDCDenom = "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4"

NewMaxAgeNumBlocks = int64(1_000_000) // 1.5s blocks * 1_000_000 = 1.5M seconds > 2 weeks
NewMaxAgeDuration = time.Second * 1209600 // 2 weeks
)

var Upgrade = upgrades.Upgrade{
Expand Down
9 changes: 9 additions & 0 deletions app/upgrades/v25/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ func CreateUpgradeHandler(
authenticatorParams.IsSmartAccountActive = false
keepers.SmartAccountKeeper.SetParams(ctx, authenticatorParams)

// Update consensus params in order to safely enable comet pruning
consensusParams, err := keepers.ConsensusParamsKeeper.Get(ctx)
if err != nil {
return nil, err
}
consensusParams.Evidence.MaxAgeNumBlocks = NewMaxAgeNumBlocks
consensusParams.Evidence.MaxAgeDuration = NewMaxAgeDuration
keepers.ConsensusParamsKeeper.Set(ctx, consensusParams)

return migrations, nil
}
}
Expand Down
19 changes: 16 additions & 3 deletions app/upgrades/v25/upgrades_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package v25_test

import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
auctiontypes "github.com/skip-mev/block-sdk/x/auction/types"
"testing"
"time"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
auctiontypes "github.com/skip-mev/block-sdk/x/auction/types"

"github.com/stretchr/testify/suite"

abci "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -44,6 +45,12 @@ func (s *UpgradeTestSuite) TestUpgrade() {
oldMigrationList, lastPoolPositionID, migratedPoolBeforeUpgradeSpreadRewards, nonMigratedPoolBeforeUpgradeSpreadRewards := s.PrepareSpreadRewardsMigrationTestEnv()
preMigrationSigningInfo := s.prepareMissedBlocksCounterTest()

// Check consensus params before upgrade
consParamsPre, err := s.App.ConsensusParamsKeeper.Get(s.Ctx)
s.Require().NoError(err)
s.Require().NotEqual(consParamsPre.Evidence.MaxAgeDuration, v25.NewMaxAgeDuration)
s.Require().NotEqual(consParamsPre.Evidence.MaxAgeNumBlocks, v25.NewMaxAgeNumBlocks)

// Run the upgrade
dummyUpgrade(s)
s.Require().NotPanics(func() {
Expand All @@ -60,7 +67,7 @@ func (s *UpgradeTestSuite) TestUpgrade() {
params, err := s.App.AuctionKeeper.GetParams(s.Ctx)
s.Require().NoError(err)

// check auction params
// Check auction params
s.Require().Equal(params.MaxBundleSize, v25.AuctionParams.MaxBundleSize)
s.Require().Equal(params.ReserveFee.Denom, v25.AuctionParams.ReserveFee.Denom)
s.Require().Equal(params.ReserveFee.Amount.Int64(), v25.AuctionParams.ReserveFee.Amount.Int64())
Expand All @@ -70,6 +77,12 @@ func (s *UpgradeTestSuite) TestUpgrade() {
s.Require().Equal(params.FrontRunningProtection, v25.AuctionParams.FrontRunningProtection)
s.Require().Equal(params.ProposerFee, v25.AuctionParams.ProposerFee)

// Check consensus params after upgrade
consParamsPost, err := s.App.ConsensusParamsKeeper.Get(s.Ctx)
s.Require().NoError(err)
s.Require().Equal(consParamsPost.Evidence.MaxAgeDuration, v25.NewMaxAgeDuration)
s.Require().Equal(consParamsPost.Evidence.MaxAgeNumBlocks, v25.NewMaxAgeNumBlocks)

s.ExecuteSpreadRewardsMigrationTest(oldMigrationList, lastPoolPositionID, migratedPoolBeforeUpgradeSpreadRewards, nonMigratedPoolBeforeUpgradeSpreadRewards)
s.executeMissedBlocksCounterTest(preMigrationSigningInfo)
}
Expand Down