Skip to content

Commit 8d5076a

Browse files
chore: add back scaling factor choice (backport #7951) (#7958)
* chore: add back scaling factor choice (#7951) * chore: add back scaling factor choice * chore: add more pools and test * chore: add changelog * chore: fix typo and test * chore: remove old changelog entry (cherry picked from commit f110508) # Conflicts: # CHANGELOG.md * chore: fix CHANGELOG.md --------- Co-authored-by: PaddyMc <paddymchale@hotmail.com>
1 parent 1d4a21e commit 8d5076a

File tree

11 files changed

+159
-844
lines changed

11 files changed

+159
-844
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7575
* [#7768](https://github.com/osmosis-labs/osmosis/pull/7768) Allow governance module account to transfer any CL position
7676
* [#7746](https://github.com/osmosis-labs/osmosis/pull/7746) Make forfeited incentives redeposit into the pool instead of sending to community pool
7777
* [#7785](https://github.com/osmosis-labs/osmosis/pull/7785) Remove reward claiming during position transfers
78-
* [#7805](https://github.com/osmosis-labs/osmosis/pull/7805) Migrate remaining cl incentive accumulators
79-
* [#7833](https://github.com/osmosis-labs/osmosis/pull/7883) Bump max gas wanted per tx to 6 mil
78+
* [#7833](https://github.com/osmosis-labs/osmosis/pull/7833) Bump max gas wanted per tx to 60 mil
8079
* [#7839](https://github.com/osmosis-labs/osmosis/pull/7839) Add ICA controller
8180
* [#7527](https://github.com/osmosis-labs/osmosis/pull/7527) Add 30M gas limit to CW pool contract calls
8281
* [#7855](https://github.com/osmosis-labs/osmosis/pull/7855) Whitelist address parameter for setting fee tokens
8382
* [#7857](https://github.com/osmosis-labs/osmosis/pull/7857) SuperfluidDelegationsByValidatorDenom query now returns equivalent staked amount
8483
* [#7912](https://github.com/osmosis-labs/osmosis/pull/7912) Default timeoutCommit to 2s
84+
* [#7951](https://github.com/osmosis-labs/osmosis/pull/7951) Only migrate selected cl incentives
8585
* [#7938](https://github.com/osmosis-labs/osmosis/pull/7938) Add missing swap events for missing swap event for cw pools.
8686

8787
### SDK

app/upgrades/v23/constants.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,3 @@ var Upgrade = upgrades.Upgrade{
1717
Deleted: []string{},
1818
},
1919
}
20-
21-
var MigratedIncentiveAccumulatorPoolIDs = map[uint64]struct{}{
22-
1423: {},
23-
1213: {},
24-
1298: {},
25-
1297: {},
26-
1292: {},
27-
1431: {},
28-
}

app/upgrades/v23/upgrades.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/osmosis-labs/osmosis/v24/app/keepers"
1515
"github.com/osmosis-labs/osmosis/v24/app/upgrades"
1616
concentratedliquidity "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity"
17+
concentratedtypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types"
1718
)
1819

1920
const (
@@ -81,8 +82,8 @@ func CreateUpgradeHandler(
8182

8283
// migrateMainnetPools migrates the specified mainnet pools to the new accumulator scaling factor.
8384
func migrateMainnetPools(ctx sdk.Context, concentratedKeeper concentratedliquidity.Keeper) error {
84-
poolIDsToMigrate := make([]uint64, 0, len(MigratedIncentiveAccumulatorPoolIDs))
85-
for poolID := range MigratedIncentiveAccumulatorPoolIDs {
85+
poolIDsToMigrate := make([]uint64, 0, len(concentratedtypes.MigratedIncentiveAccumulatorPoolIDs))
86+
for poolID := range concentratedtypes.MigratedIncentiveAccumulatorPoolIDs {
8687
poolIDsToMigrate = append(poolIDsToMigrate, poolID)
8788
}
8889

app/upgrades/v23/upgrades_test.go

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"github.com/osmosis-labs/osmosis/osmomath"
1515
"github.com/osmosis-labs/osmosis/v24/app/apptesting"
1616

17-
v23 "github.com/osmosis-labs/osmosis/v24/app/upgrades/v23"
1817
concentratedtypes "github.com/osmosis-labs/osmosis/v24/x/concentrated-liquidity/types"
1918
)
2019

@@ -88,29 +87,27 @@ func (s *UpgradeTestSuite) TestUpgrade() {
8887
s.Require().NotEmpty(nonMigratedPoolBeforeUpgradeIncentives)
8988

9089
// Overwrite the migration list with the desired pool ID.
91-
oldMigrationList := v23.MigratedIncentiveAccumulatorPoolIDs
92-
v23.MigratedIncentiveAccumulatorPoolIDs = map[uint64]struct{}{}
93-
v23.MigratedIncentiveAccumulatorPoolIDs[lastPoolID] = struct{}{}
90+
oldMigrationList := concentratedtypes.MigratedIncentiveAccumulatorPoolIDs
91+
concentratedtypes.MigratedIncentiveAccumulatorPoolIDs = map[uint64]struct{}{}
92+
concentratedtypes.MigratedIncentiveAccumulatorPoolIDs[lastPoolID] = struct{}{}
9493

9594
dummyUpgrade(s)
9695
s.Require().NotPanics(func() {
9796
s.App.BeginBlocker(s.Ctx, abci.RequestBeginBlock{})
9897
})
9998

100-
// NOTE: these no longer work as expected in versions later than v23, in v23 we decide between the old and new scaling factor.
101-
// Since we're removing this choice, these test are not worrking as expected
10299
// Migrated pool: ensure that the claimable incentives are the same before and after migration
103-
//migratedPoolAfterUpgradeIncentives, _, err := s.App.ConcentratedLiquidityKeeper.GetClaimableIncentives(s.Ctx, lastPoolPositionID)
104-
//s.Require().NoError(err)
105-
//s.Require().Equal(migratedPoolBeforeUpgradeIncentives.String(), migratedPoolAfterUpgradeIncentives.String())
100+
migratedPoolAfterUpgradeIncentives, _, err := s.App.ConcentratedLiquidityKeeper.GetClaimableIncentives(s.Ctx, lastPoolPositionID)
101+
s.Require().NoError(err)
102+
s.Require().Equal(migratedPoolBeforeUpgradeIncentives.String(), migratedPoolAfterUpgradeIncentives.String())
106103

107-
//// Non-migrated pool: ensure that the claimable incentives are the same before and after migration
108-
//nonMigratedPoolAfterUpgradeIncentives, _, err := s.App.ConcentratedLiquidityKeeper.GetClaimableIncentives(s.Ctx, lastPoolPositionID-1)
109-
//s.Require().NoError(err)
110-
//s.Require().Equal(nonMigratedPoolBeforeUpgradeIncentives.String(), nonMigratedPoolAfterUpgradeIncentives.String())
104+
// Non-migrated pool: ensure that the claimable incentives are the same before and after migration
105+
nonMigratedPoolAfterUpgradeIncentives, _, err := s.App.ConcentratedLiquidityKeeper.GetClaimableIncentives(s.Ctx, lastPoolPositionID-1)
106+
s.Require().NoError(err)
107+
s.Require().Equal(nonMigratedPoolBeforeUpgradeIncentives.String(), nonMigratedPoolAfterUpgradeIncentives.String())
111108

112109
// Restore the migration list for use by other tests
113-
v23.MigratedIncentiveAccumulatorPoolIDs = oldMigrationList
110+
concentratedtypes.MigratedIncentiveAccumulatorPoolIDs = oldMigrationList
114111
}
115112

116113
func dummyUpgrade(s *UpgradeTestSuite) {

0 commit comments

Comments
 (0)