From ab93bb2552adfbf64c3613eb6fbec7b198c2d59b 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 --- CHANGELOG.md | 3 + .../pool-incentives/v1beta1/genesis.proto | 14 +- .../pool-incentives/v1beta1/incentives.proto | 6 +- x/pool-incentives/keeper/genesis.go | 51 ++- x/pool-incentives/keeper/genesis_test.go | 81 ++++- x/pool-incentives/types/genesis.pb.go | 145 ++++++--- x/pool-incentives/types/incentives.pb.go | 303 ++++++++++++++---- 7 files changed, 470 insertions(+), 133 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6e2f935473..0ad5c2fe667 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#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 diff --git a/proto/osmosis/pool-incentives/v1beta1/genesis.proto b/proto/osmosis/pool-incentives/v1beta1/genesis.proto index 3a7d4a3545b..2505b664c00 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 d7064d2261d..654d461e6c3 100644 --- a/proto/osmosis/pool-incentives/v1beta1/incentives.proto +++ b/proto/osmosis/pool-incentives/v1beta1/incentives.proto @@ -55,6 +55,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 9e22b1418e9..4ae820ea52c 100644 --- a/x/pool-incentives/keeper/genesis.go +++ b/x/pool-incentives/keeper/genesis.go @@ -19,24 +19,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 { @@ -53,8 +57,9 @@ 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 { panic(err) @@ -63,7 +68,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) @@ -74,15 +92,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 895bf6d0abc..806be7f0dce 100644 --- a/x/pool-incentives/keeper/genesis_test.go +++ b/x/pool-incentives/keeper/genesis_test.go @@ -9,10 +9,9 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/osmosis-labs/osmosis/osmomath" - pool_incentives "github.com/osmosis-labs/osmosis/v19/x/pool-incentives" - 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" ) @@ -36,7 +35,7 @@ var ( }, }, }, - PoolToGauges: &types.PoolToGauges{ + AnyPoolToInternalGauges: &types.AnyPoolToInternalGauges{ PoolToGauge: []types.PoolToGauge{ { PoolId: 1, @@ -48,18 +47,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 +119,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 +134,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 73ed8efb547..480524b579c 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,32 +120,37 @@ func init() { } var fileDescriptor_cc1f078212600632 = []byte{ - // 392 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, - 0x82, 0x9d, 0xb1, 0x75, 0xa5, 0xee, 0x42, 0xa1, 0xb8, 0x93, 0xa8, 0x1b, 0x37, 0x61, 0x92, 0x4e, - 0xc7, 0xc1, 0x24, 0x27, 0x66, 0x26, 0xc5, 0xbe, 0x85, 0x4b, 0x37, 0xbe, 0x4f, 0x97, 0x5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x84, 0xd2, 0x8e, 0x2d, 0x6b, 0x21, 0xa4, 0x2a, 0x42, 0x91, 0x2d, - 0xc1, 0xe9, 0xe9, 0xea, 0xcf, 0x2e, 0x55, 0x9f, 0xd5, 0x8a, 0xb7, 0xd9, 0x12, 0xfc, 0xfe, 0xa6, - 0x72, 0xcd, 0x43, 0xe5, 0xde, 0x35, 0xc1, 0x47, 0x2b, 0x2f, 0xb8, 0xbf, 0xe8, 0x28, 0xfb, 0xab, - 0xf5, 0xa0, 0x76, 0x0a, 0x15, 0x84, 0x9c, 0x96, 0x9c, 0x49, 0xe7, 0x4a, 0x07, 0x3d, 0xbf, 0x78, - 0x23, 0x80, 0xe4, 0x03, 0xcc, 0xb5, 0xc6, 0x7f, 0xdc, 0x66, 0x3d, 0x6a, 0xb2, 0xfe, 0x75, 0xf4, - 0x82, 0xdb, 0xfc, 0x14, 0xfe, 0xb8, 0xd9, 0x21, 0x73, 0xbb, 0x43, 0xe6, 0x9f, 0x1d, 0x32, 0xbf, - 0xef, 0x91, 0xb1, 0xdd, 0x23, 0xe3, 0xd7, 0x1e, 0x19, 0x9f, 0xde, 0x70, 0xa1, 0x3e, 0x97, 0x11, - 0x8e, 0x21, 0x25, 0x6d, 0xfc, 0x38, 0xa1, 0x91, 0xec, 0x1e, 0x64, 0x35, 0x79, 0x45, 0xbe, 0x9d, - 0xfd, 0x09, 0x6a, 0x9d, 0x33, 0x19, 0x5d, 0xeb, 0xdb, 0xbf, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, - 0xba, 0xa9, 0x3b, 0xfc, 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, 0x2d, 0xbf, 0x54, 0x13, + 0xa7, 0xde, 0xbb, 0x5b, 0x40, 0x01, 0x46, 0x4a, 0xeb, 0x2f, 0xeb, 0xda, 0xc3, 0x05, 0x40, 0x51, + 0x72, 0x6a, 0x5e, 0xd9, 0x64, 0x48, 0x07, 0x93, 0x8a, 0x69, 0x01, 0xd2, 0xcd, 0x9f, 0xac, 0x83, + 0xb8, 0xd2, 0x64, 0x1c, 0xf1, 0xd7, 0xad, 0xe0, 0xce, 0x91, 0x25, 0x7b, 0xaf, 0x99, 0xe6, 0x61, + 0x3f, 0xd8, 0x1e, 0xb3, 0x8a, 0x8d, 0x54, 0x13, 0xed, 0xa3, 0xc3, 0x9d, 0xee, 0x01, 0xb9, 0x99, + 0x94, 0x9c, 0x18, 0x75, 0x6f, 0x73, 0xbe, 0x88, 0x1a, 0x89, 0xf3, 0x86, 0x10, 0x84, 0x25, 0xe4, + 0xa7, 0x2c, 0x2b, 0x79, 0xea, 0x19, 0x55, 0x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0, 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, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -154,9 +173,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 +263,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 +414,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 +477,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 0d63eff3de2..6fa1f4425a1 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,43 +372,45 @@ func init() { } var fileDescriptor_a8153bad03e553d1 = []byte{ - // 562 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0xcd, 0xb4, 0x51, 0xd2, 0x8e, 0xf3, 0x7d, 0x80, 0x4b, 0x45, 0x5a, 0x84, 0x1d, 0x8d, 0x84, - 0x54, 0x29, 0xea, 0x98, 0xf0, 0xb3, 0x20, 0xec, 0xa2, 0x48, 0x28, 0xc0, 0xa2, 0xb2, 0xa8, 0x2a, - 0xb1, 0x89, 0xec, 0x78, 0xea, 0x58, 0xb5, 0x7d, 0x23, 0xcf, 0x24, 0x50, 0x9e, 0x80, 0x25, 0xcb, - 0x2e, 0xfb, 0x0a, 0xac, 0x79, 0x81, 0x2e, 0xbb, 0x44, 0x2c, 0x0c, 0x4a, 0x36, 0xac, 0xf3, 0x04, - 0xc8, 0xe3, 0x31, 0xb1, 0xa8, 0x14, 0xb1, 0x9b, 0x3b, 0xe7, 0x9e, 0x7b, 0xce, 0xf1, 0x1d, 0xe3, - 0x47, 0xc0, 0x23, 0xe0, 0x01, 0xb7, 0x26, 0x00, 0xe1, 0x61, 0x10, 0x8f, 0x58, 0x2c, 0x82, 0x19, - 0xe3, 0xd6, 0xac, 0xe3, 0x32, 0xe1, 0x74, 0xac, 0xd5, 0x15, 0x9d, 0x24, 0x20, 0x40, 0x37, 0x14, - 0x83, 0x66, 0x8c, 0x12, 0xaa, 0x08, 0xfb, 0x77, 0x7d, 0xf0, 0x41, 0xb6, 0x5a, 0xd9, 0x29, 0x67, - 0xed, 0x1b, 0x3e, 0x80, 0x1f, 0x32, 0x4b, 0x56, 0xee, 0xf4, 0xd4, 0xf2, 0xa6, 0x89, 0x23, 0x02, - 0x88, 0x73, 0x9c, 0xbc, 0xc2, 0xb5, 0x23, 0x27, 0x71, 0x22, 0xae, 0x77, 0x71, 0x23, 0x0a, 0x62, - 0xc1, 0xbc, 0xa1, 0xc7, 0x62, 0x88, 0x9a, 0xa8, 0x85, 0x0e, 0xb6, 0x7b, 0xf7, 0x96, 0xa9, 0xb9, - 0x73, 0xee, 0x44, 0x61, 0x97, 0x94, 0x51, 0x62, 0x6b, 0x79, 0xd9, 0xcf, 0xaa, 0x6e, 0xf5, 0xe2, - 0xd2, 0xac, 0x90, 0x4f, 0x08, 0xef, 0xbe, 0x81, 0xd1, 0x99, 0xe3, 0x86, 0xac, 0xaf, 0x64, 0xf8, - 0x20, 0x3e, 0x05, 0x1d, 0xb0, 0x1e, 0x2a, 0x60, 0x58, 0x18, 0xe0, 0x4d, 0xd4, 0xda, 0x3c, 0xd0, - 0x1e, 0xef, 0xd1, 0xdc, 0x22, 0x2d, 0x2c, 0xd2, 0x82, 0xdb, 0x7b, 0x78, 0x95, 0x9a, 0x95, 0x65, - 0x6a, 0xee, 0xe5, 0x06, 0x6e, 0x8e, 0x20, 0x17, 0x3f, 0x4c, 0x64, 0xdf, 0x09, 0xff, 0x16, 0x25, - 0x5f, 0x10, 0xde, 0xee, 0x07, 0x5c, 0x24, 0x52, 0xfe, 0x04, 0x37, 0x04, 0x08, 0x27, 0x1c, 0xbe, - 0x67, 0x81, 0x3f, 0x16, 0x2a, 0xda, 0xd3, 0x6c, 0xfa, 0xf7, 0x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 0x94, 0xb2, 0xff, 0xba, 0x9c, 0xd2, 0x10, 0xb5, 0x1c, 0x6d, 0x52, 0xba, 0x3a, 0xbe, 0x9a, 0x1b, - 0xe8, 0x7a, 0x6e, 0xa0, 0x9f, 0x73, 0x03, 0x7d, 0x5e, 0x18, 0x95, 0xeb, 0x85, 0x51, 0xf9, 0xb6, - 0x30, 0x2a, 0xef, 0x5e, 0xf8, 0x81, 0x18, 0x4f, 0x5d, 0x3a, 0x82, 0xc8, 0x52, 0x1a, 0x87, 0xa1, - 0xe3, 0xf2, 0xa2, 0xb0, 0x66, 0x9d, 0xe7, 0xd6, 0x87, 0x1b, 0xff, 0xba, 0x38, 0x9f, 0x30, 0xee, - 0xd6, 0x64, 0xee, 0x27, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3d, 0xc7, 0x20, 0x7a, 0x13, 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, + 0x7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x00, 0x95, 0xba, + 0x20, 0xe6, 0x6b, 0xff, 0x3d, 0x87, 0xf4, 0xf1, 0xc6, 0xb3, 0x78, 0x94, 0xfb, 0x6f, 0xc7, 0x82, + 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, } func (this *DistrRecord) Equal(that interface{}) bool { @@ -584,7 +631,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 +641,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 +668,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 +792,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 +1336,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 +1359,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 +1420,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