From 9e7103ea17b4071d3096892bdd965c0b52b2035c Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 8 Oct 2023 05:15:21 +0300 Subject: [PATCH] fix: genesis bug in pool incentives linking NoLock gauges and PoolIDs (#6644) * fix: genesis bug in pool incentives * changelog * lint * add clarifying comment * merge main * Revert "merge main" This reverts commit a0ed7a080b37211e84eb55c662824a94ddfe9cb1. --------- Co-authored-by: Adam Tucker Co-authored-by: Adam Tucker (cherry picked from commit ab93bb2552adfbf64c3613eb6fbec7b198c2d59b) # Conflicts: # CHANGELOG.md # x/pool-incentives/keeper/genesis_test.go # x/pool-incentives/types/genesis.pb.go # x/pool-incentives/types/incentives.pb.go --- CHANGELOG.md | 67 +++++ .../pool-incentives/v1beta1/genesis.proto | 14 +- .../pool-incentives/v1beta1/incentives.proto | 6 +- x/pool-incentives/keeper/genesis.go | 50 +++- x/pool-incentives/keeper/genesis_test.go | 84 +++++- x/pool-incentives/types/genesis.pb.go | 122 +++++++- x/pool-incentives/types/incentives.pb.go | 269 ++++++++++++++++-- 7 files changed, 546 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fe254233de..63149354f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,73 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +<<<<<<< HEAD +======= +### Features + +* [#6468](https://github.com/osmosis-labs/osmosis/pull/6468) feat: remove osmo multihop discount +* [#6420](https://github.com/osmosis-labs/osmosis/pull/6420) feat[CL]: Creates a governance set whitelist of addresses that can bypass the normal pool creation restrictions on concentrated liquidity pools +* [#6632](https://github.com/osmosis-labs/osmosis/pull/6632) Taker fee bypass whitelist + +### State Breaking + +* [#6344](https://github.com/osmosis-labs/osmosis/pull/6344) fix: set name, display and symbol of denom metadata in tokenfactory's CreateDenom +* [#6279](https://github.com/osmosis-labs/osmosis/pull/6279) fix prop-597 introduced issue +* [#6282](https://github.com/osmosis-labs/osmosis/pull/6282) Fix CreateCanonicalConcentratedLiquidityPoolAndMigrationLink overriding migration records +* [#6309](https://github.com/osmosis-labs/osmosis/pull/6309) Add Cosmwasm Pool Queries to Stargate Query +* [#6493](https://github.com/osmosis-labs/osmosis/pull/6493) Add PoolManager Params query to Stargate Whitelist +* [#6421](https://github.com/osmosis-labs/osmosis/pull/6421) Moves ValidatePermissionlessPoolCreationEnabled out of poolmanager module +* [#6627](https://github.com/osmosis-labs/osmosis/pull/6627) Limit pow iterations in osmomath. +* [#6586](https://github.com/osmosis-labs/osmosis/pull/6586) add auth.moduleaccounts to the stargate whitelist + +### Bug Fixes +* [#6644](https://github.com/osmosis-labs/osmosis/pull/6644) fix: genesis bug in pool incentives linking NoLock gauges and PoolIDs + +## v19.2.0 + +### Misc Improvements + +* [#6476](https://github.com/osmosis-labs/osmosis/pull/6476) band-aid state export fix for cwpool gauges +* [#6492](https://github.com/osmosis-labs/osmosis/pull/6492) bump IAVL version to v0.19.7 + + +### Features + +* [#6427](https://github.com/osmosis-labs/osmosis/pull/6427) sdk.Coins Mul and Quo helpers in osmoutils +* [#6437](https://github.com/osmosis-labs/osmosis/pull/6437) mutative version for QuoRoundUp +* [#6261](https://github.com/osmosis-labs/osmosis/pull/6261) mutative and efficient BigDec truncations with arbitrary decimals +* [#6416](https://github.com/osmosis-labs/osmosis/pull/6416) feat[CL]: add num initialized ticks query +* [#6488](https://github.com/osmosis-labs/osmosis/pull/6488) v2 SpotPrice CLI and GRPC query with 36 decimals in poolmanager + +### API Breaks + +* [#6487](https://github.com/osmosis-labs/osmosis/pull/6487) make PoolModuleI CalculateSpotPrice API return BigDec +* [#6511](https://github.com/osmosis-labs/osmosis/pull/6511) remove redundant param from CreateGaugeRefKeys in incentives +* [#6510](https://github.com/osmosis-labs/osmosis/pull/6510) remove redundant ctx param from DeleteAllKeysFromPrefix in osmoutils + + +## v19.1.0 + +### Features + +* [#6427](https://github.com/osmosis-labs/osmosis/pull/6427) sdk.Coins Mul and Quo helpers in osmoutils +* [#6428](https://github.com/osmosis-labs/osmosis/pull/6428) osmomath: QuoTruncateMut +* [#6437](https://github.com/osmosis-labs/osmosis/pull/6437) mutative version for QuoRoundUp +* [#6261](https://github.com/osmosis-labs/osmosis/pull/6261) mutative and efficient BigDec truncations with arbitrary decimals +* [#6416](https://github.com/osmosis-labs/osmosis/pull/6416) feat[CL]: add num initialized ticks query + +### Misc Improvements + +* [#6392](https://github.com/osmosis-labs/osmosis/pull/6392) Speedup fractional exponentiation + +### Bug Fixes + +* [#6334](https://github.com/osmosis-labs/osmosis/pull/6334) fix: enable taker fee cli +* [#6352](https://github.com/osmosis-labs/osmosis/pull/6352) Reduce error blow-up in CalcAmount0Delta by changing the order of math operations. +* [#6368](https://github.com/osmosis-labs/osmosis/pull/6368) Stricter rounding behavior in CL math's CalcAmount0Delta and GetNextSqrtPriceFromAmount0InRoundingUp +* [#6409](https://github.com/osmosis-labs/osmosis/pull/6409) CL math: Convert Int to BigDec + +>>>>>>> ab93bb25 (fix: genesis bug in pool incentives linking NoLock gauges and PoolIDs (#6644)) ### API Breaks * [#6256](https://github.com/osmosis-labs/osmosis/pull/6256) Refactor CalcPriceToTick to operate on BigDec price to support new price range. diff --git a/proto/osmosis/pool-incentives/v1beta1/genesis.proto b/proto/osmosis/pool-incentives/v1beta1/genesis.proto index a7834c62d4a..e9632ecfc4a 100644 --- a/proto/osmosis/pool-incentives/v1beta1/genesis.proto +++ b/proto/osmosis/pool-incentives/v1beta1/genesis.proto @@ -20,8 +20,18 @@ message GenesisState { (gogoproto.nullable) = true, (gogoproto.moretags) = "yaml:\"distr_info\"" ]; - PoolToGauges pool_to_gauges = 4 [ + // any_pool_to_internal_gauges defines the gauges for any pool to internal + // pool. For every pool type (e.g. LP, Concentrated, etc), there is one such + // link + AnyPoolToInternalGauges any_pool_to_internal_gauges = 4 [ (gogoproto.nullable) = true, - (gogoproto.moretags) = "yaml:\"pool_to_gauges\"" + (gogoproto.moretags) = "yaml:\"internal_pool_to_gauges\"" + ]; + // concentrated_pool_to_no_lock_gauges defines the no lock gauges for + // concentrated pool. This only exists between concentrated pool and no lock + // gauges. Both external and internal gauges are included. + ConcentratedPoolToNoLockGauges concentrated_pool_to_no_lock_gauges = 5 [ + (gogoproto.nullable) = true, + (gogoproto.moretags) = "yaml:\"concentrated_pool_to_no_lock_gauges\"" ]; } diff --git a/proto/osmosis/pool-incentives/v1beta1/incentives.proto b/proto/osmosis/pool-incentives/v1beta1/incentives.proto index f895745ecc4..2dcc99c9155 100644 --- a/proto/osmosis/pool-incentives/v1beta1/incentives.proto +++ b/proto/osmosis/pool-incentives/v1beta1/incentives.proto @@ -53,6 +53,10 @@ message PoolToGauge { ]; } -message PoolToGauges { +message AnyPoolToInternalGauges { repeated PoolToGauge pool_to_gauge = 2 [ (gogoproto.nullable) = false ]; +} + +message ConcentratedPoolToNoLockGauges { + repeated PoolToGauge pool_to_gauge = 1 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/x/pool-incentives/keeper/genesis.go b/x/pool-incentives/keeper/genesis.go index 25f0b13073e..e5e464268dc 100644 --- a/x/pool-incentives/keeper/genesis.go +++ b/x/pool-incentives/keeper/genesis.go @@ -18,24 +18,28 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) { } else { k.SetDistrInfo(ctx, *genState.DistrInfo) } - if genState.PoolToGauges != nil { - for _, record := range genState.PoolToGauges.PoolToGauge { - if record.Duration == 0 { - k.SetPoolGaugeIdNoLock(ctx, record.PoolId, record.GaugeId) - } else { - if err := k.SetPoolGaugeIdInternalIncentive(ctx, record.PoolId, record.Duration, record.GaugeId); err != nil { - panic(err) - } + if genState.AnyPoolToInternalGauges != nil { + for _, record := range genState.AnyPoolToInternalGauges.PoolToGauge { + if err := k.SetPoolGaugeIdInternalIncentive(ctx, record.PoolId, record.Duration, record.GaugeId); err != nil { + panic(err) } } } + if genState.ConcentratedPoolToNoLockGauges != nil { + for _, record := range genState.ConcentratedPoolToNoLockGauges.PoolToGauge { + k.SetPoolGaugeIdNoLock(ctx, record.PoolId, record.GaugeId) + } + } } func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { distrInfo := k.GetDistrInfo(ctx) lastPoolId := k.poolmanagerKeeper.GetNextPoolId(ctx) lockableDurations := k.GetLockableDurations(ctx) - var poolToGauges types.PoolToGauges + var ( + anyPoolToInternalGauges types.AnyPoolToInternalGauges + concentratedPoolToNoLockGauges types.ConcentratedPoolToNoLockGauges + ) for poolId := 1; poolId < int(lastPoolId); poolId++ { pool, err := k.poolmanagerKeeper.GetPool(ctx, uint64(poolId)) if err != nil { @@ -43,6 +47,8 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { } isCLPool := pool.GetType() == poolmanagertypes.Concentrated if isCLPool { + // This creates a link for the internal pool gauge. + // Every CL pool has one such gauge. incParams := k.incentivesKeeper.GetEpochInfo(ctx) gaugeID, err := k.GetPoolGaugeId(ctx, uint64(poolId), incParams.Duration) if err != nil { @@ -52,7 +58,20 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { poolToGauge.Duration = incParams.Duration poolToGauge.GaugeId = gaugeID poolToGauge.PoolId = uint64(poolId) - poolToGauges.PoolToGauge = append(poolToGauges.PoolToGauge, poolToGauge) + anyPoolToInternalGauges.PoolToGauge = append(anyPoolToInternalGauges.PoolToGauge, poolToGauge) + + // All concentrated pools need an additional link for the no-lock gauge. + gaugeIDs, err := k.GetNoLockGaugeIdsFromPool(ctx, uint64(poolId)) + if err != nil { + panic(err) + } + for _, gaugeID := range gaugeIDs { + poolToGauge := types.PoolToGauge{ + GaugeId: gaugeID, + PoolId: uint64(poolId), + } + concentratedPoolToNoLockGauges.PoolToGauge = append(concentratedPoolToNoLockGauges.PoolToGauge, poolToGauge) + } } else { for _, duration := range lockableDurations { gaugeID, err := k.GetPoolGaugeId(ctx, uint64(poolId), duration) @@ -63,15 +82,16 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { poolToGauge.Duration = duration poolToGauge.GaugeId = gaugeID poolToGauge.PoolId = uint64(poolId) - poolToGauges.PoolToGauge = append(poolToGauges.PoolToGauge, poolToGauge) + anyPoolToInternalGauges.PoolToGauge = append(anyPoolToInternalGauges.PoolToGauge, poolToGauge) } } } return &types.GenesisState{ - Params: k.GetParams(ctx), - LockableDurations: k.GetLockableDurations(ctx), - DistrInfo: &distrInfo, - PoolToGauges: &poolToGauges, + Params: k.GetParams(ctx), + LockableDurations: k.GetLockableDurations(ctx), + DistrInfo: &distrInfo, + AnyPoolToInternalGauges: &anyPoolToInternalGauges, + ConcentratedPoolToNoLockGauges: &concentratedPoolToNoLockGauges, } } diff --git a/x/pool-incentives/keeper/genesis_test.go b/x/pool-incentives/keeper/genesis_test.go index 6f9b1af2e11..777b4ce32a8 100644 --- a/x/pool-incentives/keeper/genesis_test.go +++ b/x/pool-incentives/keeper/genesis_test.go @@ -9,11 +9,19 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +<<<<<<< HEAD pool_incentives "github.com/osmosis-labs/osmosis/v18/x/pool-incentives" simapp "github.com/osmosis-labs/osmosis/v18/app" "github.com/osmosis-labs/osmosis/v18/x/pool-incentives/types" +======= + "github.com/osmosis-labs/osmosis/osmomath" + simapp "github.com/osmosis-labs/osmosis/v19/app" + lockuptypes "github.com/osmosis-labs/osmosis/v19/x/lockup/types" + pool_incentives "github.com/osmosis-labs/osmosis/v19/x/pool-incentives" + "github.com/osmosis-labs/osmosis/v19/x/pool-incentives/types" +>>>>>>> ab93bb25 (fix: genesis bug in pool incentives linking NoLock gauges and PoolIDs (#6644)) ) var ( @@ -36,7 +44,7 @@ var ( }, }, }, - PoolToGauges: &types.PoolToGauges{ + AnyPoolToInternalGauges: &types.AnyPoolToInternalGauges{ PoolToGauge: []types.PoolToGauge{ { PoolId: 1, @@ -48,18 +56,14 @@ var ( GaugeId: 2, Duration: time.Second, }, - // This duplication with zero duration - // can happen with "NoLock" gauges - // where the link containing the duration - // is used to signify that the gauge is internal - // while the link without the duration is used - // for general purpose. This redundancy is - // made for convinience of plugging in the - // later added "NoLock" gauge into the existing - // logic without having to change majority of the queries. + }, + }, + ConcentratedPoolToNoLockGauges: &types.ConcentratedPoolToNoLockGauges{ + PoolToGauge: []types.PoolToGauge{ { - PoolId: 2, - GaugeId: 2, + PoolId: 3, + GaugeId: 3, + Duration: 0, }, }, }, @@ -124,7 +128,7 @@ func (s *KeeperTestSuite) TestExportGenesis() { s.App.PoolIncentivesKeeper.SetLockableDurations(ctx, durations) savedDurations := s.App.PoolIncentivesKeeper.GetLockableDurations(ctx) s.Equal(savedDurations, durations) - var expectedPoolToGauges types.PoolToGauges + var expectedPoolToGauges types.AnyPoolToInternalGauges var gauge uint64 for _, duration := range durations { gauge++ @@ -139,5 +143,57 @@ func (s *KeeperTestSuite) TestExportGenesis() { s.Equal(genesisExported.Params, genesis.Params) s.Equal(genesisExported.LockableDurations, durations) s.Equal(genesisExported.DistrInfo, genesis.DistrInfo) - s.Equal(genesisExported.PoolToGauges, &expectedPoolToGauges) + s.Equal(genesisExported.AnyPoolToInternalGauges, &expectedPoolToGauges) +} + +// This test validates that all store indexes are set correctly +// for NoLock gauges after exporting and then reimporting genesis. +func (s *KeeperTestSuite) TestImportExportGenesis_ExternalNoLock() { + s.SetupTest() + + // Prepare concentrated pool + clPool := s.PrepareConcentratedPool() + + // Fund account to create gauge + s.FundAcc(s.TestAccs[0], defaultCoins.Add(defaultCoins...)) + + // Create external non-perpetual gauge + externalGaugeID, err := s.App.IncentivesKeeper.CreateGauge(s.Ctx, false, s.TestAccs[0], defaultCoins.Add(defaultCoins...), lockuptypes.QueryCondition{ + LockQueryType: lockuptypes.NoLock, + }, s.Ctx.BlockTime(), 2, clPool.GetId()) + s.Require().NoError(err) + + // We expect internal gauge to be created first + internalGaugeID := externalGaugeID - 1 + + // Export genesis + export := s.App.PoolIncentivesKeeper.ExportGenesis(s.Ctx) + + // Validate that only one link for internal gauges is created + s.Require().Equal(1, len(export.AnyPoolToInternalGauges.PoolToGauge)) + + // Validate that 2 links, one for external and one for internal gauge, are created + s.Require().Equal(2, len(export.ConcentratedPoolToNoLockGauges.PoolToGauge)) + + // Reset state + s.SetupTest() + + // Import genesis + s.App.PoolIncentivesKeeper.InitGenesis(s.Ctx, export) + + // Get the general link between external gauge ID and pool + poolID, err := s.App.PoolIncentivesKeeper.GetPoolIdFromGaugeId(s.Ctx, externalGaugeID, 0) + s.Require().NoError(err) + s.Require().Equal(clPool.GetId(), poolID) + + // Get the general link between internal gauge ID and pool + poolID, err = s.App.PoolIncentivesKeeper.GetPoolIdFromGaugeId(s.Ctx, internalGaugeID, 0) + s.Require().NoError(err) + s.Require().Equal(clPool.GetId(), poolID) + + // Get the internal gauge + incentivesEpochDuration := s.App.IncentivesKeeper.GetEpochInfo(s.Ctx).Duration + internalGaugeIDAfterImport, err := s.App.PoolIncentivesKeeper.GetPoolGaugeId(s.Ctx, poolID, incentivesEpochDuration) + s.Require().NoError(err) + s.Require().Equal(internalGaugeID, internalGaugeIDAfterImport) } diff --git a/x/pool-incentives/types/genesis.pb.go b/x/pool-incentives/types/genesis.pb.go index 672a93903e0..b1043de53c8 100644 --- a/x/pool-incentives/types/genesis.pb.go +++ b/x/pool-incentives/types/genesis.pb.go @@ -33,7 +33,14 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` LockableDurations []time.Duration `protobuf:"bytes,2,rep,name=lockable_durations,json=lockableDurations,proto3,stdduration" json:"lockable_durations" yaml:"lockable_durations"` DistrInfo *DistrInfo `protobuf:"bytes,3,opt,name=distr_info,json=distrInfo,proto3" json:"distr_info,omitempty" yaml:"distr_info"` - PoolToGauges *PoolToGauges `protobuf:"bytes,4,opt,name=pool_to_gauges,json=poolToGauges,proto3" json:"pool_to_gauges,omitempty" yaml:"pool_to_gauges"` + // any_pool_to_internal_gauges defines the gauges for any pool to internal + // pool. For every pool type (e.g. LP, Concentrated, etc), there is one such + // link + AnyPoolToInternalGauges *AnyPoolToInternalGauges `protobuf:"bytes,4,opt,name=any_pool_to_internal_gauges,json=anyPoolToInternalGauges,proto3" json:"any_pool_to_internal_gauges,omitempty" yaml:"internal_pool_to_gauges"` + // concentrated_pool_to_no_lock_gauges defines the no lock gauges for + // concentrated pool. This only exists between concentrated pool and no lock + // gauges. Both external and internal gauges are included. + ConcentratedPoolToNoLockGauges *ConcentratedPoolToNoLockGauges `protobuf:"bytes,5,opt,name=concentrated_pool_to_no_lock_gauges,json=concentratedPoolToNoLockGauges,proto3" json:"concentrated_pool_to_no_lock_gauges,omitempty" yaml:"concentrated_pool_to_no_lock_gauges"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -90,9 +97,16 @@ func (m *GenesisState) GetDistrInfo() *DistrInfo { return nil } -func (m *GenesisState) GetPoolToGauges() *PoolToGauges { +func (m *GenesisState) GetAnyPoolToInternalGauges() *AnyPoolToInternalGauges { if m != nil { - return m.PoolToGauges + return m.AnyPoolToInternalGauges + } + return nil +} + +func (m *GenesisState) GetConcentratedPoolToNoLockGauges() *ConcentratedPoolToNoLockGauges { + if m != nil { + return m.ConcentratedPoolToNoLockGauges } return nil } @@ -106,6 +120,7 @@ func init() { } var fileDescriptor_cc1f078212600632 = []byte{ +<<<<<<< HEAD // 393 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0xaa, 0xd3, 0x40, 0x14, 0xc7, 0x13, 0x7b, 0xb9, 0x60, 0xee, 0x45, 0xb8, 0x41, 0x21, 0x2d, 0x38, 0x29, 0x01, 0xa5, @@ -132,6 +147,39 @@ var fileDescriptor_cc1f078212600632 = []byte{ 0x38, 0x86, 0x94, 0xb4, 0xf1, 0xe3, 0x84, 0x46, 0xb2, 0x7b, 0x90, 0xd5, 0xe4, 0x15, 0xf9, 0x76, 0xf6, 0x27, 0xa8, 0x75, 0xce, 0x64, 0x74, 0xad, 0x6f, 0xff, 0xf2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0x39, 0xc9, 0xca, 0xb6, 0x02, 0x00, 0x00, +======= + // 468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4d, 0x6b, 0x13, 0x41, + 0x18, 0xc7, 0x33, 0xf6, 0x05, 0xdc, 0x7a, 0xe9, 0x22, 0x98, 0x54, 0x98, 0x2d, 0x2b, 0x96, 0x2a, + 0x64, 0xc6, 0xc4, 0x83, 0xa8, 0x20, 0x18, 0x03, 0xa5, 0x20, 0x52, 0x56, 0xbd, 0x78, 0x59, 0x66, + 0x37, 0x93, 0x75, 0xe8, 0x66, 0x9e, 0xb0, 0x33, 0x09, 0xe6, 0x3b, 0x78, 0xf0, 0xe8, 0xc5, 0xcf, + 0xe2, 0x35, 0xc7, 0x1e, 0x3d, 0x45, 0x49, 0xbe, 0x41, 0x3f, 0x81, 0xec, 0xbc, 0xb4, 0x85, 0x4a, + 0xe3, 0x6d, 0x87, 0xe7, 0xff, 0xf2, 0x7b, 0x96, 0x27, 0x68, 0x83, 0x1a, 0x81, 0x12, 0x8a, 0x8e, + 0x01, 0xca, 0xb6, 0x90, 0x39, 0x97, 0x5a, 0x4c, 0xb9, 0xa2, 0xd3, 0x4e, 0xc6, 0x35, 0xeb, 0xd0, + 0x82, 0x4b, 0xae, 0x84, 0x22, 0xe3, 0x0a, 0x34, 0x84, 0xd8, 0xc9, 0x49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, 0xa4, 0xe6, 0x95, 0x64, 0x65, 0x5a, 0xb0, 0x49, 0xc1, 0x55, 0x73, 0xd3, 0xd4, 0x3e, + 0x5b, 0x57, 0xfb, 0x5a, 0xce, 0x4e, 0x00, 0xca, 0x0f, 0x70, 0xec, 0xfc, 0x47, 0xc6, 0xde, 0x3b, + 0x70, 0x10, 0xd8, 0x42, 0x5c, 0xa4, 0xfb, 0x3a, 0xdb, 0x12, 0x27, 0xf7, 0xd8, 0xbf, 0x03, 0xc2, + 0x9f, 0x28, 0x78, 0x90, 0x83, 0x29, 0xac, 0x98, 0xe6, 0x83, 0x0b, 0xa7, 0x84, 0xb4, 0xfe, 0x65, + 0x9e, 0x73, 0xcb, 0x70, 0xbe, 0x5a, 0xc7, 0xf9, 0xe6, 0x4a, 0x94, 0xed, 0x7b, 0x07, 0x6f, 0x21, + 0x3f, 0x75, 0xb8, 0x5d, 0x87, 0xfb, 0xd8, 0xe2, 0xfe, 0x47, 0x71, 0x9c, 0xe0, 0xfc, 0xe6, 0xcc, + 0x8f, 0xf3, 0x25, 0x46, 0x67, 0x4b, 0x8c, 0xfe, 0x2c, 0x31, 0xfa, 0xb6, 0xc2, 0x8d, 0xb3, 0x15, + 0x6e, 0xfc, 0x5a, 0xe1, 0xc6, 0xa7, 0x97, 0x85, 0xd0, 0x9f, 0x27, 0x19, 0xc9, 0x61, 0x44, 0x1d, + 0x77, 0xbb, 0x64, 0x99, 0xf2, 0x0f, 0x3a, 0xed, 0x3c, 0xa7, 0x5f, 0xae, 0x1d, 0xbe, 0x9e, 0x8d, + 0xb9, 0xca, 0xb6, 0xcd, 0xa9, 0x3d, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x70, 0xe9, 0x75, 0xc1, + 0xa5, 0x03, 0x00, 0x00, +>>>>>>> ab93bb25 (fix: genesis bug in pool incentives linking NoLock gauges and PoolIDs (#6644)) } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -154,9 +202,21 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.PoolToGauges != nil { + if m.ConcentratedPoolToNoLockGauges != nil { + { + size, err := m.ConcentratedPoolToNoLockGauges.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.AnyPoolToInternalGauges != nil { { - size, err := m.PoolToGauges.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AnyPoolToInternalGauges.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -232,8 +292,12 @@ func (m *GenesisState) Size() (n int) { l = m.DistrInfo.Size() n += 1 + l + sovGenesis(uint64(l)) } - if m.PoolToGauges != nil { - l = m.PoolToGauges.Size() + if m.AnyPoolToInternalGauges != nil { + l = m.AnyPoolToInternalGauges.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.ConcentratedPoolToNoLockGauges != nil { + l = m.ConcentratedPoolToNoLockGauges.Size() n += 1 + l + sovGenesis(uint64(l)) } return n @@ -379,7 +443,43 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolToGauges", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AnyPoolToInternalGauges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AnyPoolToInternalGauges == nil { + m.AnyPoolToInternalGauges = &AnyPoolToInternalGauges{} + } + if err := m.AnyPoolToInternalGauges.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConcentratedPoolToNoLockGauges", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -406,10 +506,10 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PoolToGauges == nil { - m.PoolToGauges = &PoolToGauges{} + if m.ConcentratedPoolToNoLockGauges == nil { + m.ConcentratedPoolToNoLockGauges = &ConcentratedPoolToNoLockGauges{} } - if err := m.PoolToGauges.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ConcentratedPoolToNoLockGauges.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/pool-incentives/types/incentives.pb.go b/x/pool-incentives/types/incentives.pb.go index 633751125c4..67cccbc9288 100644 --- a/x/pool-incentives/types/incentives.pb.go +++ b/x/pool-incentives/types/incentives.pb.go @@ -269,22 +269,22 @@ func (m *PoolToGauge) GetDuration() time.Duration { return 0 } -type PoolToGauges struct { +type AnyPoolToInternalGauges struct { PoolToGauge []PoolToGauge `protobuf:"bytes,2,rep,name=pool_to_gauge,json=poolToGauge,proto3" json:"pool_to_gauge"` } -func (m *PoolToGauges) Reset() { *m = PoolToGauges{} } -func (m *PoolToGauges) String() string { return proto.CompactTextString(m) } -func (*PoolToGauges) ProtoMessage() {} -func (*PoolToGauges) Descriptor() ([]byte, []int) { +func (m *AnyPoolToInternalGauges) Reset() { *m = AnyPoolToInternalGauges{} } +func (m *AnyPoolToInternalGauges) String() string { return proto.CompactTextString(m) } +func (*AnyPoolToInternalGauges) ProtoMessage() {} +func (*AnyPoolToInternalGauges) Descriptor() ([]byte, []int) { return fileDescriptor_a8153bad03e553d1, []int{5} } -func (m *PoolToGauges) XXX_Unmarshal(b []byte) error { +func (m *AnyPoolToInternalGauges) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PoolToGauges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AnyPoolToInternalGauges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PoolToGauges.Marshal(b, m, deterministic) + return xxx_messageInfo_AnyPoolToInternalGauges.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -294,19 +294,63 @@ func (m *PoolToGauges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *PoolToGauges) XXX_Merge(src proto.Message) { - xxx_messageInfo_PoolToGauges.Merge(m, src) +func (m *AnyPoolToInternalGauges) XXX_Merge(src proto.Message) { + xxx_messageInfo_AnyPoolToInternalGauges.Merge(m, src) } -func (m *PoolToGauges) XXX_Size() int { +func (m *AnyPoolToInternalGauges) XXX_Size() int { return m.Size() } -func (m *PoolToGauges) XXX_DiscardUnknown() { - xxx_messageInfo_PoolToGauges.DiscardUnknown(m) +func (m *AnyPoolToInternalGauges) XXX_DiscardUnknown() { + xxx_messageInfo_AnyPoolToInternalGauges.DiscardUnknown(m) } -var xxx_messageInfo_PoolToGauges proto.InternalMessageInfo +var xxx_messageInfo_AnyPoolToInternalGauges proto.InternalMessageInfo -func (m *PoolToGauges) GetPoolToGauge() []PoolToGauge { +func (m *AnyPoolToInternalGauges) GetPoolToGauge() []PoolToGauge { + if m != nil { + return m.PoolToGauge + } + return nil +} + +type ConcentratedPoolToNoLockGauges struct { + PoolToGauge []PoolToGauge `protobuf:"bytes,1,rep,name=pool_to_gauge,json=poolToGauge,proto3" json:"pool_to_gauge"` +} + +func (m *ConcentratedPoolToNoLockGauges) Reset() { *m = ConcentratedPoolToNoLockGauges{} } +func (m *ConcentratedPoolToNoLockGauges) String() string { return proto.CompactTextString(m) } +func (*ConcentratedPoolToNoLockGauges) ProtoMessage() {} +func (*ConcentratedPoolToNoLockGauges) Descriptor() ([]byte, []int) { + return fileDescriptor_a8153bad03e553d1, []int{6} +} +func (m *ConcentratedPoolToNoLockGauges) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConcentratedPoolToNoLockGauges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConcentratedPoolToNoLockGauges.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConcentratedPoolToNoLockGauges) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConcentratedPoolToNoLockGauges.Merge(m, src) +} +func (m *ConcentratedPoolToNoLockGauges) XXX_Size() int { + return m.Size() +} +func (m *ConcentratedPoolToNoLockGauges) XXX_DiscardUnknown() { + xxx_messageInfo_ConcentratedPoolToNoLockGauges.DiscardUnknown(m) +} + +var xxx_messageInfo_ConcentratedPoolToNoLockGauges proto.InternalMessageInfo + +func (m *ConcentratedPoolToNoLockGauges) GetPoolToGauge() []PoolToGauge { if m != nil { return m.PoolToGauge } @@ -319,7 +363,8 @@ func init() { proto.RegisterType((*DistrInfo)(nil), "osmosis.poolincentives.v1beta1.DistrInfo") proto.RegisterType((*DistrRecord)(nil), "osmosis.poolincentives.v1beta1.DistrRecord") proto.RegisterType((*PoolToGauge)(nil), "osmosis.poolincentives.v1beta1.PoolToGauge") - proto.RegisterType((*PoolToGauges)(nil), "osmosis.poolincentives.v1beta1.PoolToGauges") + proto.RegisterType((*AnyPoolToInternalGauges)(nil), "osmosis.poolincentives.v1beta1.AnyPoolToInternalGauges") + proto.RegisterType((*ConcentratedPoolToNoLockGauges)(nil), "osmosis.poolincentives.v1beta1.ConcentratedPoolToNoLockGauges") } func init() { @@ -327,6 +372,7 @@ func init() { } var fileDescriptor_a8153bad03e553d1 = []byte{ +<<<<<<< HEAD // 565 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xbf, 0x6f, 0xd3, 0x40, 0x14, 0xc7, 0x73, 0x6d, 0x94, 0xb4, 0xe7, 0xf0, 0xcb, 0x05, 0x91, 0x16, 0xc9, 0x8e, 0x4e, 0x02, @@ -364,6 +410,47 @@ var fileDescriptor_a8153bad03e553d1 = []byte{ 0x43, 0x97, 0x3d, 0x3a, 0x91, 0xeb, 0xb1, 0x32, 0xb0, 0xe7, 0xdd, 0x27, 0xf6, 0x87, 0x4b, 0x7f, 0x07, 0x62, 0x1b, 0x5e, 0x4d, 0xf8, 0x7e, 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x08, 0x43, 0xba, 0x36, 0x04, 0x00, 0x00, +======= + // 597 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0xcd, 0xb4, 0x51, 0xda, 0x8e, 0xcb, 0xcb, 0xa5, 0x6a, 0x5a, 0x84, 0x5d, 0x8d, 0x84, 0x54, + 0xa9, 0xaa, 0x4d, 0x79, 0x2c, 0x08, 0x2b, 0x42, 0x24, 0x14, 0x40, 0xa8, 0xb2, 0xa8, 0x2a, 0xb1, + 0x89, 0xc6, 0xf1, 0xd4, 0xb1, 0x6a, 0xfb, 0x46, 0x9e, 0x49, 0x4a, 0xf8, 0x02, 0x96, 0x2c, 0xbb, + 0xec, 0x2f, 0xb0, 0xe6, 0x07, 0xba, 0xec, 0x12, 0xb1, 0x30, 0x28, 0xd9, 0xb0, 0xce, 0x17, 0x20, + 0x8f, 0xc7, 0xc4, 0xa2, 0x22, 0x62, 0xc1, 0x6e, 0xae, 0xcf, 0x3d, 0xf7, 0x9c, 0x33, 0x77, 0x64, + 0x7c, 0x1f, 0x78, 0x04, 0x3c, 0xe0, 0x76, 0x1f, 0x20, 0xdc, 0x0b, 0xe2, 0x2e, 0x8b, 0x45, 0x30, + 0x64, 0xdc, 0x1e, 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 0x25, 0x31, 0x0d, 0x65, 0x0e, 0xae, 0x1f, 0xe2, 0x6b, 0xd2, 0xaf, 0x80, 0x8e, 0x74, 0xf0, 0xaf, + 0x7b, 0x2a, 0x5d, 0x86, 0xda, 0x93, 0xd6, 0x9f, 0x7d, 0x22, 0xa7, 0xd8, 0x78, 0x0e, 0x92, 0x95, + 0x50, 0xc1, 0xbc, 0xbc, 0xfb, 0x0d, 0x64, 0xaf, 0xff, 0x6f, 0xc2, 0xe8, 0x7f, 0x08, 0x37, 0x0f, + 0x2f, 0xc6, 0x06, 0xba, 0x1c, 0x1b, 0xe8, 0xc7, 0xd8, 0x40, 0x9f, 0x26, 0x46, 0xe5, 0x72, 0x62, + 0x54, 0xbe, 0x4e, 0x8c, 0xca, 0xbb, 0xa7, 0x7e, 0x20, 0x7a, 0x03, 0xd7, 0xea, 0x42, 0x64, 0x2b, + 0x8d, 0xbd, 0x90, 0xba, 0xbc, 0x28, 0xec, 0xe1, 0xfe, 0x13, 0xfb, 0xfd, 0x95, 0xff, 0x8d, 0x18, + 0xf5, 0x19, 0x77, 0x6b, 0xf2, 0xee, 0x1f, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x30, 0x94, 0x1b, + 0x1e, 0x97, 0x04, 0x00, 0x00, +>>>>>>> ab93bb25 (fix: genesis bug in pool incentives linking NoLock gauges and PoolIDs (#6644)) } func (this *DistrRecord) Equal(that interface{}) bool { @@ -584,7 +671,7 @@ func (m *PoolToGauge) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PoolToGauges) Marshal() (dAtA []byte, err error) { +func (m *AnyPoolToInternalGauges) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -594,12 +681,12 @@ func (m *PoolToGauges) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PoolToGauges) MarshalTo(dAtA []byte) (int, error) { +func (m *AnyPoolToInternalGauges) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PoolToGauges) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AnyPoolToInternalGauges) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -621,6 +708,43 @@ func (m *PoolToGauges) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ConcentratedPoolToNoLockGauges) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConcentratedPoolToNoLockGauges) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConcentratedPoolToNoLockGauges) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PoolToGauge) > 0 { + for iNdEx := len(m.PoolToGauge) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolToGauge[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIncentives(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintIncentives(dAtA []byte, offset int, v uint64) int { offset -= sovIncentives(v) base := offset @@ -708,7 +832,22 @@ func (m *PoolToGauge) Size() (n int) { return n } -func (m *PoolToGauges) Size() (n int) { +func (m *AnyPoolToInternalGauges) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PoolToGauge) > 0 { + for _, e := range m.PoolToGauge { + l = e.Size() + n += 1 + l + sovIncentives(uint64(l)) + } + } + return n +} + +func (m *ConcentratedPoolToNoLockGauges) Size() (n int) { if m == nil { return 0 } @@ -1237,7 +1376,7 @@ func (m *PoolToGauge) Unmarshal(dAtA []byte) error { } return nil } -func (m *PoolToGauges) Unmarshal(dAtA []byte) error { +func (m *AnyPoolToInternalGauges) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1260,10 +1399,10 @@ func (m *PoolToGauges) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PoolToGauges: wiretype end group for non-group") + return fmt.Errorf("proto: AnyPoolToInternalGauges: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PoolToGauges: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AnyPoolToInternalGauges: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 2: @@ -1321,6 +1460,90 @@ func (m *PoolToGauges) Unmarshal(dAtA []byte) error { } return nil } +func (m *ConcentratedPoolToNoLockGauges) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIncentives + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConcentratedPoolToNoLockGauges: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConcentratedPoolToNoLockGauges: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolToGauge", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIncentives + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIncentives + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIncentives + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolToGauge = append(m.PoolToGauge, PoolToGauge{}) + if err := m.PoolToGauge[len(m.PoolToGauge)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIncentives(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIncentives + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipIncentives(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0