From 1a1c93980e26fe27ba9c5445a3db262ee2fbd1e2 Mon Sep 17 00:00:00 2001 From: roman Date: Sat, 7 Oct 2023 14:34:42 +0300 Subject: [PATCH 1/6] fix: genesis bug in pool incentives --- go.sum | 5 +- .../pool-incentives/v1beta1/genesis.proto | 14 +- .../pool-incentives/v1beta1/incentives.proto | 6 +- x/pool-incentives/keeper/genesis.go | 54 +++- 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, 473 insertions(+), 135 deletions(-) diff --git a/go.sum b/go.sum index baffe28aac4..6e45ff6c5d6 100644 --- a/go.sum +++ b/go.sum @@ -428,6 +428,7 @@ github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTM github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= @@ -797,6 +798,7 @@ github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5j github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -962,8 +964,6 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:YlmchqTmlwdWSmrRmXKR+PcU96ntOd8u10vTaTZdcNY= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230924192433-36cf2950dca4 h1:venI3u6DjxKcQbjiCO3V8s0ww/jx+cAZRkpwLHadms8= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230924192433-36cf2950dca4/go.mod h1:IlCTpM2uoi8SUAigc9r9kAaoz7K5H9O84u7CwaTLDdY= github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003135651-7418f98f1a04 h1:C8LtPGkhJxfJNj7Xtok1If5yAV53O6XG3USaOJSgeg4= github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003135651-7418f98f1a04/go.mod h1:jtOM+8RJMOn5e8YIaodzvO0b8kvBcHDgtCVCmWrx6wU= github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 h1:E5rwhxKEt6XOIfLkoLNiqCCFNCymJjiwMYIP+0ABMKM= @@ -1238,6 +1238,7 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= 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..7a2e5407f99 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,10 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { isCLPool := pool.GetType() == poolmanagertypes.Concentrated if isCLPool { - incParams := k.incentivesKeeper.GetEpochInfo(ctx) + // 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 +69,22 @@ 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 +95,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..2c68c88169d 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 for external gauges 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, 0x5d, 0xba, - 0x8a, 0xd2, 0xbe, 0x41, 0x9f, 0x40, 0x32, 0x49, 0x68, 0xa5, 0x60, 0x77, 0x19, 0xce, 0xef, 0xff, - 0x71, 0x0e, 0xb1, 0xc6, 0x20, 0x53, 0x90, 0x42, 0x92, 0x1c, 0x20, 0x19, 0x8b, 0x2c, 0x66, 0x99, - 0x12, 0x2b, 0x26, 0xc9, 0x6a, 0x12, 0x31, 0x45, 0x27, 0x84, 0xb3, 0x8c, 0x49, 0x21, 0x71, 0x5e, - 0x80, 0x02, 0x1b, 0xb5, 0x38, 0xae, 0xf1, 0x23, 0x8d, 0x5b, 0x7a, 0xf0, 0x90, 0x03, 0x07, 0x8d, - 0x92, 0xfa, 0xab, 0x51, 0x0d, 0x10, 0x07, 0xe0, 0x09, 0x23, 0xfa, 0x15, 0x95, 0x4b, 0xb2, 0x28, - 0x0b, 0xaa, 0x04, 0x64, 0xed, 0xfc, 0xc5, 0xa5, 0x12, 0x27, 0x49, 0x5a, 0xe1, 0xfd, 0xec, 0x59, - 0xb7, 0xf3, 0xa6, 0xd9, 0x7b, 0x45, 0x15, 0xb3, 0x67, 0xd6, 0x75, 0x4e, 0x0b, 0x9a, 0x4a, 0xc7, - 0x1c, 0x9a, 0xa3, 0x9b, 0xe9, 0x53, 0xfc, 0xff, 0xa6, 0xf8, 0x9d, 0xa6, 0xfd, 0xab, 0x4d, 0xe5, - 0x1a, 0x41, 0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, 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, 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, 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, } 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, 0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d9, 0x69, 0xe0, 0xe9, - 0xed, 0x92, 0xd3, 0x0d, 0xd9, 0x7d, 0x7b, 0x99, 0x9a, 0x8d, 0x92, 0xd3, 0x92, 0x4d, 0x1b, 0x6f, - 0x15, 0xeb, 0x6b, 0x6e, 0xb6, 0xd0, 0xfa, 0x07, 0x70, 0x5f, 0x3d, 0x00, 0x95, 0xba, 0x20, 0xe6, - 0x6b, 0xff, 0x33, 0x87, 0x30, 0xdc, 0x28, 0x99, 0xe7, 0xfa, 0x31, 0xfe, 0x4f, 0x9a, 0x14, 0x30, - 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, 0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3, 0x63, 0xd0, 0x01, 0xeb, 0xa1, 0x02, 0x3a, 0x85, 0x01, 0x5e, 0x47, 0xdb, 0x8b, 0x3b, + 0xda, 0x83, 0x4d, 0x2b, 0xb7, 0x68, 0x15, 0x16, 0xad, 0x82, 0xdb, 0xbc, 0x77, 0x91, 0x9a, 0x95, + 0x69, 0x6a, 0x6e, 0xe6, 0x06, 0xae, 0x8e, 0x20, 0x67, 0xdf, 0x4d, 0xe4, 0xdc, 0x0a, 0xff, 0x14, + 0x25, 0x9f, 0x11, 0x5e, 0x69, 0x05, 0x5c, 0x24, 0x52, 0xfe, 0x08, 0xaf, 0x0a, 0x10, 0x34, 0xec, + 0x9c, 0xb2, 0xc0, 0xef, 0x09, 0x15, 0xed, 0x51, 0x36, 0xfd, 0x5b, 0x6a, 0xae, 0x77, 0xe5, 0xcd, + 0x72, 0xef, 0xc4, 0x0a, 0xc0, 0x8e, 0xa8, 0xe8, 0x59, 0xed, 0x58, 0xcc, 0x72, 0x97, 0xa9, 0xc4, + 0xd1, 0x64, 0x79, 0x24, 0x2b, 0xfd, 0x15, 0x5e, 0x4a, 0x58, 0x17, 0x12, 0x8f, 0xd7, 0x17, 0x64, + 0x98, 0x5d, 0x6b, 0xfe, 0x96, 0x2c, 0x69, 0xca, 0x91, 0x9c, 0x66, 0x35, 0x33, 0xe0, 0x14, 0x13, + 0xc8, 0x07, 0xac, 0x95, 0x50, 0xdd, 0xc2, 0xcb, 0x3e, 0x1d, 0xf8, 0xac, 0x13, 0x78, 0xd2, 0x70, + 0xb5, 0xb9, 0x36, 0x4d, 0xcd, 0x1b, 0xb9, 0xa7, 0x02, 0x21, 0xce, 0x92, 0x3c, 0xb6, 0x3d, 0xfd, + 0x31, 0xae, 0xa9, 0x78, 0x0b, 0x32, 0xde, 0xdd, 0xb9, 0xf1, 0x1c, 0xd5, 0xdc, 0xa8, 0xfe, 0x3c, + 0x37, 0x11, 0xf9, 0x82, 0xb0, 0x76, 0x00, 0x10, 0xbe, 0x85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, + 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 From 7b01e241f80d498d1813687a1dd04884676cd318 Mon Sep 17 00:00:00 2001 From: roman Date: Sat, 7 Oct 2023 14:49:29 +0300 Subject: [PATCH 2/6] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf57c47dc5c..e34ab98a949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,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 From 486c299b7fb14a8e962dc400fa764bfd11efb369 Mon Sep 17 00:00:00 2001 From: roman Date: Sat, 7 Oct 2023 14:55:13 +0300 Subject: [PATCH 3/6] lint --- x/pool-incentives/keeper/genesis.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/x/pool-incentives/keeper/genesis.go b/x/pool-incentives/keeper/genesis.go index 7a2e5407f99..4ae820ea52c 100644 --- a/x/pool-incentives/keeper/genesis.go +++ b/x/pool-incentives/keeper/genesis.go @@ -57,7 +57,6 @@ 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) @@ -77,14 +76,12 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { 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) From 1184ff2d52d829f0fc5096a42ad515b9861b338c Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 7 Oct 2023 19:52:48 -0600 Subject: [PATCH 4/6] add clarifying comment --- x/pool-incentives/keeper/genesis_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/pool-incentives/keeper/genesis_test.go b/x/pool-incentives/keeper/genesis_test.go index 2c68c88169d..806be7f0dce 100644 --- a/x/pool-incentives/keeper/genesis_test.go +++ b/x/pool-incentives/keeper/genesis_test.go @@ -163,7 +163,7 @@ func (s *KeeperTestSuite) TestImportExportGenesis_ExternalNoLock() { // Validate that only one link for internal gauges is created s.Require().Equal(1, len(export.AnyPoolToInternalGauges.PoolToGauge)) - // Validate that 2 links for external gauges are created + // Validate that 2 links, one for external and one for internal gauge, are created s.Require().Equal(2, len(export.ConcentratedPoolToNoLockGauges.PoolToGauge)) // Reset state From a0ed7a080b37211e84eb55c662824a94ddfe9cb1 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 7 Oct 2023 19:58:40 -0600 Subject: [PATCH 5/6] merge main --- CHANGELOG.md | 1 + app/upgrades/v20/upgrades.go | 10 +- go.mod | 4 +- go.sum | 8 +- osmoutils/params_validation.go | 30 ++++ .../osmosis/poolmanager/v1beta1/genesis.proto | 10 ++ x/concentrated-liquidity/types/params.go | 29 +-- x/incentives/types/params.go | 24 +-- x/poolmanager/export_test.go | 4 + x/poolmanager/taker_fee.go | 7 + x/poolmanager/taker_fee_test.go | 105 +++++++++++ x/poolmanager/types/genesis.pb.go | 170 ++++++++++++------ x/poolmanager/types/params.go | 7 + 13 files changed, 305 insertions(+), 104 deletions(-) create mode 100644 osmoutils/params_validation.go create mode 100644 x/poolmanager/taker_fee_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index e34ab98a949..0ad5c2fe667 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#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 diff --git a/app/upgrades/v20/upgrades.go b/app/upgrades/v20/upgrades.go index f1f3cdf28db..d4447295d81 100644 --- a/app/upgrades/v20/upgrades.go +++ b/app/upgrades/v20/upgrades.go @@ -13,6 +13,7 @@ import ( incentivestypes "github.com/osmosis-labs/osmosis/v19/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v19/x/lockup/types" poolincenitvestypes "github.com/osmosis-labs/osmosis/v19/x/pool-incentives/types" + poolmanagertypes "github.com/osmosis-labs/osmosis/v19/x/poolmanager/types" ) type IncentivizedCFMMDirectWhenMigrationLinkPresentError struct { @@ -21,6 +22,8 @@ type IncentivizedCFMMDirectWhenMigrationLinkPresentError struct { CFMMGaugeID uint64 } +var emptySlice = []string{} + func (e IncentivizedCFMMDirectWhenMigrationLinkPresentError) Error() string { return fmt.Sprintf("CFMM gauge ID (%d) incentivized CFMM pool (%d) directly when migration link is present with concentrated pool (%d)", e.CFMMGaugeID, e.CFMMPoolID, e.ConcentratedPoolID) } @@ -40,11 +43,14 @@ func CreateUpgradeHandler( } // Initialize the newly created param - keepers.ConcentratedLiquidityKeeper.SetParam(ctx, cltypes.KeyUnrestrictedPoolCreatorWhitelist, []string{}) + keepers.ConcentratedLiquidityKeeper.SetParam(ctx, cltypes.KeyUnrestrictedPoolCreatorWhitelist, emptySlice) // Initialize the new params in incentives for group creation. keepers.IncentivesKeeper.SetParam(ctx, incentivestypes.KeyGroupCreationFee, incentivestypes.DefaultGroupCreationFee) - keepers.IncentivesKeeper.SetParam(ctx, incentivestypes.KeyCreatorWhitelist, []string{}) + keepers.IncentivesKeeper.SetParam(ctx, incentivestypes.KeyCreatorWhitelist, emptySlice) + + // Initialize new param in the poolmanager module with a whitelist allowing to bypass taker fees. + keepers.PoolManagerKeeper.SetParam(ctx, poolmanagertypes.KeyReducedTakerFeeByWhitelist, emptySlice) // Converts pool incentive distribution records from concentrated gauges to group gauges. err = createGroupsForIncentivePairs(ctx, keepers) diff --git a/go.mod b/go.mod index 0a7cabdb6af..79f18e8a287 100644 --- a/go.mod +++ b/go.mod @@ -22,8 +22,8 @@ require ( github.com/mattn/go-sqlite3 v1.14.17 github.com/ory/dockertest/v3 v3.10.0 github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 - github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003135651-7418f98f1a04 - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 + github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231007115900-2500631de18e + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231007115900-2500631de18e github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 6e45ff6c5d6..a5d361908df 100644 --- a/go.sum +++ b/go.sum @@ -964,10 +964,10 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:YlmchqTmlwdWSmrRmXKR+PcU96ntOd8u10vTaTZdcNY= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003135651-7418f98f1a04 h1:C8LtPGkhJxfJNj7Xtok1If5yAV53O6XG3USaOJSgeg4= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003135651-7418f98f1a04/go.mod h1:jtOM+8RJMOn5e8YIaodzvO0b8kvBcHDgtCVCmWrx6wU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 h1:E5rwhxKEt6XOIfLkoLNiqCCFNCymJjiwMYIP+0ABMKM= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231007115900-2500631de18e h1:jzLtdFKLMvdqq+k3FYwvwCU3y1tzczXAs+R6JD+sxlY= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231007115900-2500631de18e/go.mod h1:jtOM+8RJMOn5e8YIaodzvO0b8kvBcHDgtCVCmWrx6wU= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231007115900-2500631de18e h1:TyAleAgHjQeQCXH+2qAgtLix+OcBRqFizIdiJE+r2GU= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231007115900-2500631de18e/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf h1:8lkIsAj3L7zxvOZbqVLNJRpSdDxaYhYfAIG7XjPaJiU= github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf/go.mod h1:C0Uqe6X4N5ASA+1xZ6guaaJyUVKLcaVJIQa4Q4LG9Vk= github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf h1:ZEi+yJJPgpYtmNwZ1bMiP5cMBDQ83FK/YGgmTnWmoAI= diff --git a/osmoutils/params_validation.go b/osmoutils/params_validation.go new file mode 100644 index 00000000000..e5f2a0bd106 --- /dev/null +++ b/osmoutils/params_validation.go @@ -0,0 +1,30 @@ +package osmoutils + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// ValidateAddressList validates a slice of addresses. +// +// Parameters: +// - i: The parameter to validate. +// +// Returns: +// - An error if any of the strings are not addresses +func ValidateAddressList(i interface{}) error { + whitelist, ok := i.([]string) + + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + for _, a := range whitelist { + if _, err := sdk.AccAddressFromBech32(a); err != nil { + return fmt.Errorf("invalid address") + } + } + + return nil +} diff --git a/proto/osmosis/poolmanager/v1beta1/genesis.proto b/proto/osmosis/poolmanager/v1beta1/genesis.proto index b1cd5b72efa..e9bda1ffdf1 100644 --- a/proto/osmosis/poolmanager/v1beta1/genesis.proto +++ b/proto/osmosis/poolmanager/v1beta1/genesis.proto @@ -89,6 +89,16 @@ message TakerFeeParams { string community_pool_denom_to_swap_non_whitelisted_assets_to = 5 [ (gogoproto.moretags) = "yaml:\"community_pool_denom_to_swap_non_whitelisted_assets_to\"" ]; + + // reduced_fee_whitelist is a list of addresses that are + // allowed to pay a reduce taker fee when performing a swap + // (i.e. swap without paying the taker fee). + // It is intended to be used for integrators who meet qualifying factors + // that are approved by governance. + // Initially, the taker fee is allowed to be bypassed completely. However + // In the future, we will charge a reduced taker fee instead of no fee at all. + repeated string reduced_fee_whitelist = 6 + [ (gogoproto.moretags) = "yaml:\"reduced_fee_whitelist\"" ]; } // TakerFeeDistributionPercentage defines what percent of the taker fee category diff --git a/x/concentrated-liquidity/types/params.go b/x/concentrated-liquidity/types/params.go index c21e88f2f5c..1a2bd4540fd 100644 --- a/x/concentrated-liquidity/types/params.go +++ b/x/concentrated-liquidity/types/params.go @@ -8,6 +8,7 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/osmosis-labs/osmosis/osmomath" + "github.com/osmosis-labs/osmosis/osmoutils" ) // Parameter store keys. @@ -78,7 +79,7 @@ func (p Params) Validate() error { if err := validateAuthorizedUptimes(p.AuthorizedUptimes); err != nil { return err } - if err := validateUnrestrictedPoolCreatorWhitelist(p.UnrestrictedPoolCreatorWhitelist); err != nil { + if err := osmoutils.ValidateAddressList(p.UnrestrictedPoolCreatorWhitelist); err != nil { return err } return nil @@ -93,7 +94,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyIsPermisionlessPoolCreationEnabled, &p.IsPermissionlessPoolCreationEnabled, validateIsPermissionLessPoolCreationEnabled), paramtypes.NewParamSetPair(KeyDiscountRate, &p.BalancerSharesRewardDiscount, validateBalancerSharesDiscount), paramtypes.NewParamSetPair(KeyAuthorizedUptimes, &p.AuthorizedUptimes, validateAuthorizedUptimes), - paramtypes.NewParamSetPair(KeyUnrestrictedPoolCreatorWhitelist, &p.UnrestrictedPoolCreatorWhitelist, validateUnrestrictedPoolCreatorWhitelist), + paramtypes.NewParamSetPair(KeyUnrestrictedPoolCreatorWhitelist, &p.UnrestrictedPoolCreatorWhitelist, osmoutils.ValidateAddressList), } } @@ -242,27 +243,3 @@ func validateAuthorizedUptimes(i interface{}) error { return nil } - -// validateUnrestrictedPoolCreatorWhitelist validates a slice of addresses -// that are allowed to bypass the restrictions on permissionless pool creation -// -// Parameters: -// - i: The parameter to validate. -// -// Returns: -// - An error if any of the strings are not addresses -func validateUnrestrictedPoolCreatorWhitelist(i interface{}) error { - whitelist, ok := i.([]string) - - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - for _, a := range whitelist { - if _, err := sdk.AccAddressFromBech32(a); err != nil { - return fmt.Errorf("invalid address") - } - } - - return nil -} diff --git a/x/incentives/types/params.go b/x/incentives/types/params.go index 4029604024d..0759a758a7c 100644 --- a/x/incentives/types/params.go +++ b/x/incentives/types/params.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/osmoutils" epochtypes "github.com/osmosis-labs/osmosis/x/epochs/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -52,6 +53,11 @@ func (p Params) Validate() error { if err := ValidateGroupCreaionFee(p.GroupCreationFee); err != nil { return err } + + if err := osmoutils.ValidateAddressList(p.UnrestrictedCreatorWhitelist); err != nil { + return err + } + return nil } @@ -63,22 +69,6 @@ func ValidateGroupCreaionFee(i interface{}) error { return v.Validate() } -func ValidateCreatorWhitelist(i interface{}) error { - v, ok := i.([]string) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - // Validate that addresses are set correctly - for _, creator := range v { - if _, err := sdk.AccAddressFromBech32(creator); err != nil { - return err - } - } - - return nil -} - func ValidateGroupCreationFee(i interface{}) error { v, ok := i.(sdk.Coins) if !ok { @@ -92,6 +82,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(KeyDistrEpochIdentifier, &p.DistrEpochIdentifier, epochtypes.ValidateEpochIdentifierInterface), paramtypes.NewParamSetPair(KeyGroupCreationFee, &p.GroupCreationFee, ValidateGroupCreaionFee), - paramtypes.NewParamSetPair(KeyCreatorWhitelist, &p.UnrestrictedCreatorWhitelist, ValidateCreatorWhitelist), + paramtypes.NewParamSetPair(KeyCreatorWhitelist, &p.UnrestrictedCreatorWhitelist, osmoutils.ValidateAddressList), } } diff --git a/x/poolmanager/export_test.go b/x/poolmanager/export_test.go index 497779819e2..7727abc6cbc 100644 --- a/x/poolmanager/export_test.go +++ b/x/poolmanager/export_test.go @@ -56,3 +56,7 @@ func (k Keeper) CalcTakerFeeExactOut(tokenOut sdk.Coin, takerFee osmomath.Dec) ( func (k Keeper) TrackVolume(ctx sdk.Context, poolId uint64, volumeGenerated sdk.Coin) { k.trackVolume(ctx, poolId, volumeGenerated) } + +func (k Keeper) ChargeTakerFee(ctx sdk.Context, tokenIn sdk.Coin, tokenOutDenom string, sender sdk.AccAddress, exactIn bool) (sdk.Coin, error) { + return k.chargeTakerFee(ctx, tokenIn, tokenOutDenom, sender, exactIn) +} diff --git a/x/poolmanager/taker_fee.go b/x/poolmanager/taker_fee.go index 350fad2d48f..91aafa60b4c 100644 --- a/x/poolmanager/taker_fee.go +++ b/x/poolmanager/taker_fee.go @@ -79,12 +79,19 @@ func (k Keeper) GetTradingPairTakerFee(ctx sdk.Context, denom0, denom1 string) ( // chargeTakerFee extracts the taker fee from the given tokenIn and sends it to the appropriate // module account. It returns the tokenIn after the taker fee has been extracted. +// If the sender is in the taker fee reduced whitelisted, it returns the tokenIn without extracting the taker fee. +// In the future, we might charge a lower taker fee as opposed to no fee at all. func (k Keeper) chargeTakerFee(ctx sdk.Context, tokenIn sdk.Coin, tokenOutDenom string, sender sdk.AccAddress, exactIn bool) (sdk.Coin, error) { feeCollectorForStakingRewardsName := txfeestypes.FeeCollectorForStakingRewardsName feeCollectorForCommunityPoolName := txfeestypes.FeeCollectorForCommunityPoolName defaultTakerFeeDenom := appparams.BaseCoinUnit poolManagerParams := k.GetParams(ctx) + // Determine if eligible to bypass taker fee. + if osmoutils.Contains(poolManagerParams.TakerFeeParams.ReducedFeeWhitelist, sender.String()) { + return tokenIn, nil + } + takerFee, err := k.GetTradingPairTakerFee(ctx, tokenIn.Denom, tokenOutDenom) if err != nil { return sdk.Coin{}, err diff --git a/x/poolmanager/taker_fee_test.go b/x/poolmanager/taker_fee_test.go new file mode 100644 index 00000000000..072901e1b19 --- /dev/null +++ b/x/poolmanager/taker_fee_test.go @@ -0,0 +1,105 @@ +package poolmanager_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/osmosis-labs/osmosis/osmomath" + "github.com/osmosis-labs/osmosis/v19/app/apptesting" +) + +// validates that the pool manager keeper can charge taker fees correctly. +// If the sender is whitelisted, then the taker fee is not charged. +// Otherwise, the taker fee is charged. +func (s *KeeperTestSuite) TestChargeTakerFee() { + + const ( + whitelistedSenderIndex = iota + nonWhitelistedSenderIndex + ) + + var ( + defaultTakerFee = osmomath.MustNewDecFromStr("0.01") + defaultAmount = sdk.NewInt(100) + ) + + tests := map[string]struct { + shouldSetSenderWhitelist bool + tokenIn sdk.Coin + tokenOutDenom string + senderIndex int + exactIn bool + takerFee osmomath.Dec + + expectedResult sdk.Coin + expectError error + }{ + "fee charged on token in": { + takerFee: defaultTakerFee, + tokenIn: sdk.NewCoin(apptesting.ETH, defaultAmount), + tokenOutDenom: apptesting.USDC, + senderIndex: whitelistedSenderIndex, + exactIn: true, + + expectedResult: sdk.NewCoin(apptesting.ETH, defaultAmount.ToLegacyDec().Mul(osmomath.OneDec().Sub(defaultTakerFee)).TruncateInt()), + }, + "fee charged on token in due to different address being whitelisted": { + takerFee: defaultTakerFee, + tokenIn: sdk.NewCoin(apptesting.ETH, defaultAmount), + tokenOutDenom: apptesting.USDC, + senderIndex: nonWhitelistedSenderIndex, + exactIn: true, + shouldSetSenderWhitelist: true, + + expectedResult: sdk.NewCoin(apptesting.ETH, defaultAmount.ToLegacyDec().Mul(osmomath.OneDec().Sub(defaultTakerFee)).TruncateInt()), + }, + "fee bypassed due to sender being whitelisted": { + takerFee: defaultTakerFee, + tokenIn: sdk.NewCoin(apptesting.ETH, defaultAmount), + tokenOutDenom: apptesting.USDC, + senderIndex: whitelistedSenderIndex, + exactIn: true, + shouldSetSenderWhitelist: true, + + expectedResult: sdk.NewCoin(apptesting.ETH, defaultAmount), + }, + // TODO: under more test cases + // https://github.com/osmosis-labs/osmosis/issues/6633 + // - exactOut: false + // - sender does not have enough coins + } + + for name, tc := range tests { + s.Run(name, func() { + s.SetupTest() + poolManager := s.App.PoolManagerKeeper + + // Set whitelist. + if tc.shouldSetSenderWhitelist { + poolManagerParams := poolManager.GetParams(s.Ctx) + poolManagerParams.TakerFeeParams.ReducedFeeWhitelist = []string{s.TestAccs[whitelistedSenderIndex].String()} + poolManager.SetParams(s.Ctx, poolManagerParams) + } + + // Create pool. + s.PrepareConcentratedPool() + + // Set taker fee. + poolManager.SetDenomPairTakerFee(s.Ctx, tc.tokenIn.Denom, tc.tokenOutDenom, tc.takerFee) + + // Pre-fund owner. + s.FundAcc(s.TestAccs[tc.senderIndex], sdk.NewCoins(tc.tokenIn)) + + // System under test. + tokenInAfterTakerFee, err := poolManager.ChargeTakerFee(s.Ctx, tc.tokenIn, tc.tokenOutDenom, s.TestAccs[tc.senderIndex], tc.exactIn) + + if tc.expectError != nil { + s.Require().Error(err) + return + } + s.Require().NoError(err) + + // Validate results. + s.Require().Equal(tc.expectedResult.String(), tokenInAfterTakerFee.String()) + }) + } +} diff --git a/x/poolmanager/types/genesis.pb.go b/x/poolmanager/types/genesis.pb.go index ee7f9a88117..753b96e37e8 100644 --- a/x/poolmanager/types/genesis.pb.go +++ b/x/poolmanager/types/genesis.pb.go @@ -194,6 +194,14 @@ type TakerFeeParams struct { // non-whitelisted taker fees will be swapped to before being sent to // the community pool. CommunityPoolDenomToSwapNonWhitelistedAssetsTo string `protobuf:"bytes,5,opt,name=community_pool_denom_to_swap_non_whitelisted_assets_to,json=communityPoolDenomToSwapNonWhitelistedAssetsTo,proto3" json:"community_pool_denom_to_swap_non_whitelisted_assets_to,omitempty" yaml:"community_pool_denom_to_swap_non_whitelisted_assets_to"` + // reduced_fee_whitelist is a list of addresses that are + // allowed to pay a reduce taker fee when performing a swap + // (i.e. swap without paying the taker fee). + // It is intended to be used for integrators who meet qualifying factors + // that are approved by governance. + // Initially, the taker fee is allowed to be bypassed completely. However + // In the future, we will charge a reduced taker fee instead of no fee at all. + ReducedFeeWhitelist []string `protobuf:"bytes,6,rep,name=reduced_fee_whitelist,json=reducedFeeWhitelist,proto3" json:"reduced_fee_whitelist,omitempty" yaml:"reduced_fee_whitelist"` } func (m *TakerFeeParams) Reset() { *m = TakerFeeParams{} } @@ -257,6 +265,13 @@ func (m *TakerFeeParams) GetCommunityPoolDenomToSwapNonWhitelistedAssetsTo() str return "" } +func (m *TakerFeeParams) GetReducedFeeWhitelist() []string { + if m != nil { + return m.ReducedFeeWhitelist + } + return nil +} + // TakerFeeDistributionPercentage defines what percent of the taker fee category // gets distributed to the available categories. type TakerFeeDistributionPercentage struct { @@ -309,59 +324,61 @@ func init() { } var fileDescriptor_aa099d9fbdf68b35 = []byte{ - // 823 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x6f, 0xdb, 0x46, - 0x10, 0x35, 0x63, 0xc7, 0x80, 0xd7, 0xa9, 0xd4, 0x10, 0x4d, 0xc3, 0xd8, 0x00, 0x29, 0x30, 0x17, - 0x15, 0x45, 0x48, 0xd8, 0x05, 0x52, 0xf4, 0x23, 0x07, 0xcb, 0x46, 0x8a, 0x02, 0x69, 0xe2, 0x30, - 0x06, 0x0a, 0xe4, 0xb2, 0x58, 0x91, 0x63, 0x9a, 0xb0, 0xb8, 0xa3, 0x72, 0x97, 0x76, 0xd4, 0x5f, - 0x51, 0xa0, 0xd7, 0x9e, 0x7b, 0xe8, 0xad, 0x87, 0xfe, 0x83, 0x1e, 0x72, 0xcc, 0xb1, 0xe8, 0x41, - 0x2d, 0xe4, 0x73, 0x2f, 0xfa, 0x05, 0xc5, 0x7e, 0xc8, 0x36, 0xdd, 0x48, 0x30, 0x9a, 0x93, 0xc4, - 0x99, 0x79, 0x6f, 0xe6, 0xcd, 0xbe, 0x25, 0xc9, 0x47, 0x28, 0x4a, 0x14, 0x85, 0x88, 0x87, 0x88, - 0x83, 0x92, 0x71, 0x96, 0x43, 0x15, 0x9f, 0x6c, 0xf5, 0x41, 0xb2, 0xad, 0x38, 0x07, 0x0e, 0xa2, - 0x10, 0xd1, 0xb0, 0x42, 0x89, 0xee, 0xa6, 0x2d, 0x8d, 0x2e, 0x95, 0x46, 0xb6, 0x74, 0xe3, 0x83, - 0x1c, 0x73, 0xd4, 0x75, 0xb1, 0xfa, 0x67, 0x20, 0x1b, 0xf7, 0x72, 0xc4, 0x7c, 0x00, 0xb1, 0x7e, - 0xea, 0xd7, 0x87, 0x31, 0xe3, 0xa3, 0x59, 0x2a, 0xd5, 0x74, 0xd4, 0x60, 0xcc, 0x83, 0x4d, 0xf9, - 0x57, 0x51, 0x59, 0x5d, 0x31, 0x59, 0x20, 0x9f, 0xe5, 0x4d, 0x75, 0xdc, 0x67, 0x02, 0xce, 0x67, - 0x4d, 0xb1, 0x98, 0xe5, 0xa3, 0x45, 0x9a, 0x4a, 0xcc, 0xea, 0x01, 0xd0, 0x0a, 0x6b, 0x09, 0xa6, - 0x3e, 0x9c, 0xde, 0x20, 0xab, 0xfb, 0xac, 0x62, 0xa5, 0x70, 0x7f, 0x74, 0xc8, 0x6d, 0x85, 0xa2, - 0x69, 0x05, 0xba, 0x25, 0x3d, 0x04, 0xf0, 0x9c, 0xce, 0x72, 0x77, 0x7d, 0xfb, 0x5e, 0x64, 0xa7, - 0x54, 0x7d, 0x67, 0xc2, 0xa3, 0x5d, 0x2c, 0x78, 0xef, 0xc9, 0xeb, 0x71, 0xb0, 0x34, 0x1d, 0x07, - 0xde, 0x88, 0x95, 0x83, 0xcf, 0xc3, 0xff, 0x30, 0x84, 0xbf, 0xfc, 0x15, 0x74, 0xf3, 0x42, 0x1e, - 0xd5, 0xfd, 0x28, 0xc5, 0xd2, 0xca, 0xb5, 0x3f, 0x0f, 0x44, 0x76, 0x1c, 0xcb, 0xd1, 0x10, 0x84, - 0x26, 0x13, 0x49, 0x5b, 0xe1, 0x77, 0x2d, 0xfc, 0x31, 0x80, 0x7b, 0x42, 0xde, 0x97, 0xec, 0x18, - 0x2a, 0x45, 0x45, 0x87, 0x7a, 0x52, 0xef, 0x46, 0xc7, 0xe9, 0xae, 0x6f, 0x7f, 0x1c, 0x2d, 0x38, - 0x94, 0xe8, 0x40, 0x81, 0x1e, 0x03, 0x18, 0x71, 0xbd, 0xc0, 0x4e, 0x79, 0xd7, 0x4c, 0x79, 0x95, - 0x32, 0x4c, 0x5a, 0xb2, 0x01, 0x70, 0x5f, 0x92, 0xbb, 0xac, 0x96, 0x47, 0x58, 0x15, 0xdf, 0x43, - 0x46, 0xbf, 0xab, 0x51, 0x02, 0xcd, 0x80, 0x63, 0x29, 0xbc, 0xe5, 0xce, 0x72, 0x77, 0xad, 0x17, - 0x4e, 0xc7, 0x81, 0x6f, 0xd8, 0xe6, 0x14, 0x86, 0xc9, 0x9d, 0x8b, 0xcc, 0x73, 0x95, 0xd8, 0x33, - 0xf1, 0xdf, 0x1d, 0x72, 0xeb, 0x2b, 0xe3, 0xaf, 0x17, 0x92, 0x49, 0x70, 0x3b, 0xe4, 0x16, 0x87, - 0x57, 0x92, 0xea, 0xe5, 0x15, 0x99, 0xe7, 0x74, 0x9c, 0xee, 0x4a, 0x42, 0x54, 0x6c, 0x1f, 0x71, - 0xf0, 0x75, 0xe6, 0xee, 0x90, 0xd5, 0x86, 0xf8, 0xfb, 0x0b, 0xc5, 0x5b, 0xd1, 0x2b, 0x4a, 0x74, - 0x62, 0x81, 0xee, 0x33, 0xb2, 0xae, 0xf9, 0xf5, 0xf1, 0x1b, 0x15, 0xeb, 0xdb, 0xdd, 0x85, 0x3c, - 0xdf, 0x68, 0xc3, 0x24, 0x0a, 0x60, 0xc9, 0x88, 0x2a, 0xd3, 0x01, 0x11, 0xfe, 0x76, 0x93, 0xb4, - 0x9a, 0x6b, 0x76, 0xfb, 0xe4, 0x76, 0x06, 0x87, 0xac, 0x1e, 0x48, 0x7a, 0xbe, 0x62, 0xad, 0x66, - 0xad, 0xf7, 0x50, 0xe1, 0xff, 0x1c, 0x07, 0x9b, 0xe6, 0xe4, 0x45, 0x76, 0x1c, 0x15, 0x18, 0x97, - 0x4c, 0x1e, 0x45, 0x4f, 0x20, 0x67, 0xe9, 0x68, 0x0f, 0xd2, 0xc9, 0x38, 0x68, 0xef, 0x19, 0xfc, - 0x8c, 0x38, 0x69, 0x67, 0xcd, 0x80, 0xfb, 0x93, 0x43, 0xf4, 0x75, 0xbc, 0xe8, 0x40, 0xb3, 0x42, - 0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0, 0x39, 0xad, 0xe0, 0x94, 0x55, 0x99, 0xb0, 0x2e, 0x7e, 0x74, - 0x0d, 0x17, 0x5f, 0xac, 0xef, 0x0a, 0x47, 0x98, 0xb4, 0x6c, 0x24, 0x31, 0x01, 0x37, 0x25, 0xad, - 0xa6, 0x6a, 0xed, 0xde, 0xb5, 0xde, 0x97, 0xd7, 0x6b, 0x73, 0xe7, 0x6d, 0x8b, 0x0b, 0x93, 0xf7, - 0x1a, 0x0b, 0xe9, 0x3d, 0x7f, 0x3d, 0xf1, 0x9d, 0x37, 0x13, 0xdf, 0xf9, 0x7b, 0xe2, 0x3b, 0x3f, - 0x9c, 0xf9, 0x4b, 0x6f, 0xce, 0xfc, 0xa5, 0x3f, 0xce, 0xfc, 0xa5, 0x97, 0x9f, 0x5e, 0x7a, 0x2f, - 0x5b, 0x2f, 0x3e, 0x18, 0xb0, 0xbe, 0x98, 0x3d, 0xc4, 0x27, 0x5b, 0x9f, 0xc5, 0xaf, 0x1a, 0xdf, - 0x12, 0xfd, 0xb2, 0xee, 0xaf, 0xea, 0xaf, 0xc7, 0x27, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xa7, - 0x24, 0x16, 0xe1, 0x43, 0x07, 0x00, 0x00, + // 856 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xaf, 0xb7, 0x25, 0x52, 0xa7, 0x4b, 0xc2, 0x1a, 0xca, 0x7a, 0x5b, 0x64, 0x47, 0xde, 0x4b, + 0x10, 0x5a, 0x5b, 0x2d, 0xd2, 0x22, 0xfe, 0xec, 0xa1, 0x69, 0x55, 0x84, 0xb4, 0xec, 0x76, 0xbd, + 0x95, 0x90, 0xf6, 0x32, 0x9a, 0x78, 0x5e, 0x5d, 0xab, 0xb1, 0x5f, 0xf0, 0x8c, 0xdb, 0x0d, 0x5f, + 0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d, 0x8f, 0x5c, 0xeb, 0xaf, 0x91, 0x6b, + 0xfd, 0x70, 0xe1, 0x2e, 0x9d, 0x5f, 0xb8, 0x4b, 0xbf, 0x5f, 0xb8, 0x4b, 0xaf, 0x3e, 0xb9, 0xf2, + 0xb5, 0x37, 0x13, 0xfe, 0xa8, 0xcf, 0x7a, 0x62, 0x72, 0x08, 0x4f, 0xb7, 0x3e, 0x0d, 0x5f, 0xcf, + 0xbc, 0x50, 0xea, 0x09, 0xe8, 0x35, 0xd4, 0x9b, 0xf4, 0xf1, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xe3, 0x27, 0x4c, 0x26, 0x99, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -492,6 +509,15 @@ func (m *TakerFeeParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ReducedFeeWhitelist) > 0 { + for iNdEx := len(m.ReducedFeeWhitelist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ReducedFeeWhitelist[iNdEx]) + copy(dAtA[i:], m.ReducedFeeWhitelist[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ReducedFeeWhitelist[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } if len(m.CommunityPoolDenomToSwapNonWhitelistedAssetsTo) > 0 { i -= len(m.CommunityPoolDenomToSwapNonWhitelistedAssetsTo) copy(dAtA[i:], m.CommunityPoolDenomToSwapNonWhitelistedAssetsTo) @@ -660,6 +686,12 @@ func (m *TakerFeeParams) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } + if len(m.ReducedFeeWhitelist) > 0 { + for _, s := range m.ReducedFeeWhitelist { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -1160,6 +1192,38 @@ func (m *TakerFeeParams) Unmarshal(dAtA []byte) error { } m.CommunityPoolDenomToSwapNonWhitelistedAssetsTo = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReducedFeeWhitelist", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReducedFeeWhitelist = append(m.ReducedFeeWhitelist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/poolmanager/types/params.go b/x/poolmanager/types/params.go index 1ca486a1f33..dd667efe868 100644 --- a/x/poolmanager/types/params.go +++ b/x/poolmanager/types/params.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/osmosis-labs/osmosis/osmomath" + "github.com/osmosis-labs/osmosis/osmoutils" appparams "github.com/osmosis-labs/osmosis/v19/app/params" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,6 +20,7 @@ var ( KeyAdminAddresses = []byte("AdminAddresses") KeyCommunityPoolDenomToSwapNonWhitelistedAssetsTo = []byte("CommunityPoolDenomToSwapNonWhitelistedAssetsTo") KeyAuthorizedQuoteDenoms = []byte("AuthorizedQuoteDenoms") + KeyReducedTakerFeeByWhitelist = []byte("ReducedTakerFeeByWhitelist") ) // ParamTable for gamm module. @@ -60,6 +62,7 @@ func DefaultParams() Params { }, AdminAddresses: []string{}, CommunityPoolDenomToSwapNonWhitelistedAssetsTo: "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", // USDC + ReducedFeeWhitelist: []string{}, }, AuthorizedQuoteDenoms: []string{ "uosmo", @@ -90,6 +93,9 @@ func (p Params) Validate() error { if err := validateCommunityPoolDenomToSwapNonWhitelistedAssetsTo(p.TakerFeeParams.CommunityPoolDenomToSwapNonWhitelistedAssetsTo); err != nil { return err } + if err := osmoutils.ValidateAddressList(p.TakerFeeParams.ReducedFeeWhitelist); err != nil { + return err + } if err := validateAuthorizedQuoteDenoms(p.AuthorizedQuoteDenoms); err != nil { return err } @@ -107,6 +113,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyAdminAddresses, &p.TakerFeeParams.AdminAddresses, validateAdminAddresses), paramtypes.NewParamSetPair(KeyCommunityPoolDenomToSwapNonWhitelistedAssetsTo, &p.TakerFeeParams.CommunityPoolDenomToSwapNonWhitelistedAssetsTo, validateCommunityPoolDenomToSwapNonWhitelistedAssetsTo), paramtypes.NewParamSetPair(KeyAuthorizedQuoteDenoms, &p.AuthorizedQuoteDenoms, validateAuthorizedQuoteDenoms), + paramtypes.NewParamSetPair(KeyReducedTakerFeeByWhitelist, &p.TakerFeeParams.ReducedFeeWhitelist, osmoutils.ValidateAddressList), } } From e6cb9b6d759b1f742c1c69804caa6b787c0c20cf Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 7 Oct 2023 20:01:00 -0600 Subject: [PATCH 6/6] Revert "merge main" This reverts commit a0ed7a080b37211e84eb55c662824a94ddfe9cb1. --- CHANGELOG.md | 1 - app/upgrades/v20/upgrades.go | 10 +- go.mod | 4 +- go.sum | 8 +- osmoutils/params_validation.go | 30 ---- .../osmosis/poolmanager/v1beta1/genesis.proto | 10 -- x/concentrated-liquidity/types/params.go | 29 ++- x/incentives/types/params.go | 24 ++- x/poolmanager/export_test.go | 4 - x/poolmanager/taker_fee.go | 7 - x/poolmanager/taker_fee_test.go | 105 ----------- x/poolmanager/types/genesis.pb.go | 170 ++++++------------ x/poolmanager/types/params.go | 7 - 13 files changed, 104 insertions(+), 305 deletions(-) delete mode 100644 osmoutils/params_validation.go delete mode 100644 x/poolmanager/taker_fee_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ad5c2fe667..e34ab98a949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#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 diff --git a/app/upgrades/v20/upgrades.go b/app/upgrades/v20/upgrades.go index d4447295d81..f1f3cdf28db 100644 --- a/app/upgrades/v20/upgrades.go +++ b/app/upgrades/v20/upgrades.go @@ -13,7 +13,6 @@ import ( incentivestypes "github.com/osmosis-labs/osmosis/v19/x/incentives/types" lockuptypes "github.com/osmosis-labs/osmosis/v19/x/lockup/types" poolincenitvestypes "github.com/osmosis-labs/osmosis/v19/x/pool-incentives/types" - poolmanagertypes "github.com/osmosis-labs/osmosis/v19/x/poolmanager/types" ) type IncentivizedCFMMDirectWhenMigrationLinkPresentError struct { @@ -22,8 +21,6 @@ type IncentivizedCFMMDirectWhenMigrationLinkPresentError struct { CFMMGaugeID uint64 } -var emptySlice = []string{} - func (e IncentivizedCFMMDirectWhenMigrationLinkPresentError) Error() string { return fmt.Sprintf("CFMM gauge ID (%d) incentivized CFMM pool (%d) directly when migration link is present with concentrated pool (%d)", e.CFMMGaugeID, e.CFMMPoolID, e.ConcentratedPoolID) } @@ -43,14 +40,11 @@ func CreateUpgradeHandler( } // Initialize the newly created param - keepers.ConcentratedLiquidityKeeper.SetParam(ctx, cltypes.KeyUnrestrictedPoolCreatorWhitelist, emptySlice) + keepers.ConcentratedLiquidityKeeper.SetParam(ctx, cltypes.KeyUnrestrictedPoolCreatorWhitelist, []string{}) // Initialize the new params in incentives for group creation. keepers.IncentivesKeeper.SetParam(ctx, incentivestypes.KeyGroupCreationFee, incentivestypes.DefaultGroupCreationFee) - keepers.IncentivesKeeper.SetParam(ctx, incentivestypes.KeyCreatorWhitelist, emptySlice) - - // Initialize new param in the poolmanager module with a whitelist allowing to bypass taker fees. - keepers.PoolManagerKeeper.SetParam(ctx, poolmanagertypes.KeyReducedTakerFeeByWhitelist, emptySlice) + keepers.IncentivesKeeper.SetParam(ctx, incentivestypes.KeyCreatorWhitelist, []string{}) // Converts pool incentive distribution records from concentrated gauges to group gauges. err = createGroupsForIncentivePairs(ctx, keepers) diff --git a/go.mod b/go.mod index 79f18e8a287..0a7cabdb6af 100644 --- a/go.mod +++ b/go.mod @@ -22,8 +22,8 @@ require ( github.com/mattn/go-sqlite3 v1.14.17 github.com/ory/dockertest/v3 v3.10.0 github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 - github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231007115900-2500631de18e - github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231007115900-2500631de18e + github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003135651-7418f98f1a04 + github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index a5d361908df..6e45ff6c5d6 100644 --- a/go.sum +++ b/go.sum @@ -964,10 +964,10 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785 h1: github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230922030206-734f99fba785/go.mod h1:toI9Pf+e5C4TuWAFpXfkxnkpr1RVFMK2qr7QMdkFrY8= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:YlmchqTmlwdWSmrRmXKR+PcU96ntOd8u10vTaTZdcNY= github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231007115900-2500631de18e h1:jzLtdFKLMvdqq+k3FYwvwCU3y1tzczXAs+R6JD+sxlY= -github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231007115900-2500631de18e/go.mod h1:jtOM+8RJMOn5e8YIaodzvO0b8kvBcHDgtCVCmWrx6wU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231007115900-2500631de18e h1:TyAleAgHjQeQCXH+2qAgtLix+OcBRqFizIdiJE+r2GU= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231007115900-2500631de18e/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003135651-7418f98f1a04 h1:C8LtPGkhJxfJNj7Xtok1If5yAV53O6XG3USaOJSgeg4= +github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231003135651-7418f98f1a04/go.mod h1:jtOM+8RJMOn5e8YIaodzvO0b8kvBcHDgtCVCmWrx6wU= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7 h1:E5rwhxKEt6XOIfLkoLNiqCCFNCymJjiwMYIP+0ABMKM= +github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230929193736-aae32321cac7/go.mod h1:YT53hlXr54D4MVKp3eoBxigiiYvy3F+h+xTZuGPW5R8= github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf h1:8lkIsAj3L7zxvOZbqVLNJRpSdDxaYhYfAIG7XjPaJiU= github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230911120014-b14342e08daf/go.mod h1:C0Uqe6X4N5ASA+1xZ6guaaJyUVKLcaVJIQa4Q4LG9Vk= github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230911120014-b14342e08daf h1:ZEi+yJJPgpYtmNwZ1bMiP5cMBDQ83FK/YGgmTnWmoAI= diff --git a/osmoutils/params_validation.go b/osmoutils/params_validation.go deleted file mode 100644 index e5f2a0bd106..00000000000 --- a/osmoutils/params_validation.go +++ /dev/null @@ -1,30 +0,0 @@ -package osmoutils - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// ValidateAddressList validates a slice of addresses. -// -// Parameters: -// - i: The parameter to validate. -// -// Returns: -// - An error if any of the strings are not addresses -func ValidateAddressList(i interface{}) error { - whitelist, ok := i.([]string) - - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - for _, a := range whitelist { - if _, err := sdk.AccAddressFromBech32(a); err != nil { - return fmt.Errorf("invalid address") - } - } - - return nil -} diff --git a/proto/osmosis/poolmanager/v1beta1/genesis.proto b/proto/osmosis/poolmanager/v1beta1/genesis.proto index e9bda1ffdf1..b1cd5b72efa 100644 --- a/proto/osmosis/poolmanager/v1beta1/genesis.proto +++ b/proto/osmosis/poolmanager/v1beta1/genesis.proto @@ -89,16 +89,6 @@ message TakerFeeParams { string community_pool_denom_to_swap_non_whitelisted_assets_to = 5 [ (gogoproto.moretags) = "yaml:\"community_pool_denom_to_swap_non_whitelisted_assets_to\"" ]; - - // reduced_fee_whitelist is a list of addresses that are - // allowed to pay a reduce taker fee when performing a swap - // (i.e. swap without paying the taker fee). - // It is intended to be used for integrators who meet qualifying factors - // that are approved by governance. - // Initially, the taker fee is allowed to be bypassed completely. However - // In the future, we will charge a reduced taker fee instead of no fee at all. - repeated string reduced_fee_whitelist = 6 - [ (gogoproto.moretags) = "yaml:\"reduced_fee_whitelist\"" ]; } // TakerFeeDistributionPercentage defines what percent of the taker fee category diff --git a/x/concentrated-liquidity/types/params.go b/x/concentrated-liquidity/types/params.go index 1a2bd4540fd..c21e88f2f5c 100644 --- a/x/concentrated-liquidity/types/params.go +++ b/x/concentrated-liquidity/types/params.go @@ -8,7 +8,6 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/osmosis-labs/osmosis/osmomath" - "github.com/osmosis-labs/osmosis/osmoutils" ) // Parameter store keys. @@ -79,7 +78,7 @@ func (p Params) Validate() error { if err := validateAuthorizedUptimes(p.AuthorizedUptimes); err != nil { return err } - if err := osmoutils.ValidateAddressList(p.UnrestrictedPoolCreatorWhitelist); err != nil { + if err := validateUnrestrictedPoolCreatorWhitelist(p.UnrestrictedPoolCreatorWhitelist); err != nil { return err } return nil @@ -94,7 +93,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyIsPermisionlessPoolCreationEnabled, &p.IsPermissionlessPoolCreationEnabled, validateIsPermissionLessPoolCreationEnabled), paramtypes.NewParamSetPair(KeyDiscountRate, &p.BalancerSharesRewardDiscount, validateBalancerSharesDiscount), paramtypes.NewParamSetPair(KeyAuthorizedUptimes, &p.AuthorizedUptimes, validateAuthorizedUptimes), - paramtypes.NewParamSetPair(KeyUnrestrictedPoolCreatorWhitelist, &p.UnrestrictedPoolCreatorWhitelist, osmoutils.ValidateAddressList), + paramtypes.NewParamSetPair(KeyUnrestrictedPoolCreatorWhitelist, &p.UnrestrictedPoolCreatorWhitelist, validateUnrestrictedPoolCreatorWhitelist), } } @@ -243,3 +242,27 @@ func validateAuthorizedUptimes(i interface{}) error { return nil } + +// validateUnrestrictedPoolCreatorWhitelist validates a slice of addresses +// that are allowed to bypass the restrictions on permissionless pool creation +// +// Parameters: +// - i: The parameter to validate. +// +// Returns: +// - An error if any of the strings are not addresses +func validateUnrestrictedPoolCreatorWhitelist(i interface{}) error { + whitelist, ok := i.([]string) + + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + for _, a := range whitelist { + if _, err := sdk.AccAddressFromBech32(a); err != nil { + return fmt.Errorf("invalid address") + } + } + + return nil +} diff --git a/x/incentives/types/params.go b/x/incentives/types/params.go index 0759a758a7c..4029604024d 100644 --- a/x/incentives/types/params.go +++ b/x/incentives/types/params.go @@ -5,7 +5,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/osmosis-labs/osmosis/osmoutils" epochtypes "github.com/osmosis-labs/osmosis/x/epochs/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -53,11 +52,6 @@ func (p Params) Validate() error { if err := ValidateGroupCreaionFee(p.GroupCreationFee); err != nil { return err } - - if err := osmoutils.ValidateAddressList(p.UnrestrictedCreatorWhitelist); err != nil { - return err - } - return nil } @@ -69,6 +63,22 @@ func ValidateGroupCreaionFee(i interface{}) error { return v.Validate() } +func ValidateCreatorWhitelist(i interface{}) error { + v, ok := i.([]string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + // Validate that addresses are set correctly + for _, creator := range v { + if _, err := sdk.AccAddressFromBech32(creator); err != nil { + return err + } + } + + return nil +} + func ValidateGroupCreationFee(i interface{}) error { v, ok := i.(sdk.Coins) if !ok { @@ -82,6 +92,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(KeyDistrEpochIdentifier, &p.DistrEpochIdentifier, epochtypes.ValidateEpochIdentifierInterface), paramtypes.NewParamSetPair(KeyGroupCreationFee, &p.GroupCreationFee, ValidateGroupCreaionFee), - paramtypes.NewParamSetPair(KeyCreatorWhitelist, &p.UnrestrictedCreatorWhitelist, osmoutils.ValidateAddressList), + paramtypes.NewParamSetPair(KeyCreatorWhitelist, &p.UnrestrictedCreatorWhitelist, ValidateCreatorWhitelist), } } diff --git a/x/poolmanager/export_test.go b/x/poolmanager/export_test.go index 7727abc6cbc..497779819e2 100644 --- a/x/poolmanager/export_test.go +++ b/x/poolmanager/export_test.go @@ -56,7 +56,3 @@ func (k Keeper) CalcTakerFeeExactOut(tokenOut sdk.Coin, takerFee osmomath.Dec) ( func (k Keeper) TrackVolume(ctx sdk.Context, poolId uint64, volumeGenerated sdk.Coin) { k.trackVolume(ctx, poolId, volumeGenerated) } - -func (k Keeper) ChargeTakerFee(ctx sdk.Context, tokenIn sdk.Coin, tokenOutDenom string, sender sdk.AccAddress, exactIn bool) (sdk.Coin, error) { - return k.chargeTakerFee(ctx, tokenIn, tokenOutDenom, sender, exactIn) -} diff --git a/x/poolmanager/taker_fee.go b/x/poolmanager/taker_fee.go index 91aafa60b4c..350fad2d48f 100644 --- a/x/poolmanager/taker_fee.go +++ b/x/poolmanager/taker_fee.go @@ -79,19 +79,12 @@ func (k Keeper) GetTradingPairTakerFee(ctx sdk.Context, denom0, denom1 string) ( // chargeTakerFee extracts the taker fee from the given tokenIn and sends it to the appropriate // module account. It returns the tokenIn after the taker fee has been extracted. -// If the sender is in the taker fee reduced whitelisted, it returns the tokenIn without extracting the taker fee. -// In the future, we might charge a lower taker fee as opposed to no fee at all. func (k Keeper) chargeTakerFee(ctx sdk.Context, tokenIn sdk.Coin, tokenOutDenom string, sender sdk.AccAddress, exactIn bool) (sdk.Coin, error) { feeCollectorForStakingRewardsName := txfeestypes.FeeCollectorForStakingRewardsName feeCollectorForCommunityPoolName := txfeestypes.FeeCollectorForCommunityPoolName defaultTakerFeeDenom := appparams.BaseCoinUnit poolManagerParams := k.GetParams(ctx) - // Determine if eligible to bypass taker fee. - if osmoutils.Contains(poolManagerParams.TakerFeeParams.ReducedFeeWhitelist, sender.String()) { - return tokenIn, nil - } - takerFee, err := k.GetTradingPairTakerFee(ctx, tokenIn.Denom, tokenOutDenom) if err != nil { return sdk.Coin{}, err diff --git a/x/poolmanager/taker_fee_test.go b/x/poolmanager/taker_fee_test.go deleted file mode 100644 index 072901e1b19..00000000000 --- a/x/poolmanager/taker_fee_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package poolmanager_test - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/osmosis-labs/osmosis/osmomath" - "github.com/osmosis-labs/osmosis/v19/app/apptesting" -) - -// validates that the pool manager keeper can charge taker fees correctly. -// If the sender is whitelisted, then the taker fee is not charged. -// Otherwise, the taker fee is charged. -func (s *KeeperTestSuite) TestChargeTakerFee() { - - const ( - whitelistedSenderIndex = iota - nonWhitelistedSenderIndex - ) - - var ( - defaultTakerFee = osmomath.MustNewDecFromStr("0.01") - defaultAmount = sdk.NewInt(100) - ) - - tests := map[string]struct { - shouldSetSenderWhitelist bool - tokenIn sdk.Coin - tokenOutDenom string - senderIndex int - exactIn bool - takerFee osmomath.Dec - - expectedResult sdk.Coin - expectError error - }{ - "fee charged on token in": { - takerFee: defaultTakerFee, - tokenIn: sdk.NewCoin(apptesting.ETH, defaultAmount), - tokenOutDenom: apptesting.USDC, - senderIndex: whitelistedSenderIndex, - exactIn: true, - - expectedResult: sdk.NewCoin(apptesting.ETH, defaultAmount.ToLegacyDec().Mul(osmomath.OneDec().Sub(defaultTakerFee)).TruncateInt()), - }, - "fee charged on token in due to different address being whitelisted": { - takerFee: defaultTakerFee, - tokenIn: sdk.NewCoin(apptesting.ETH, defaultAmount), - tokenOutDenom: apptesting.USDC, - senderIndex: nonWhitelistedSenderIndex, - exactIn: true, - shouldSetSenderWhitelist: true, - - expectedResult: sdk.NewCoin(apptesting.ETH, defaultAmount.ToLegacyDec().Mul(osmomath.OneDec().Sub(defaultTakerFee)).TruncateInt()), - }, - "fee bypassed due to sender being whitelisted": { - takerFee: defaultTakerFee, - tokenIn: sdk.NewCoin(apptesting.ETH, defaultAmount), - tokenOutDenom: apptesting.USDC, - senderIndex: whitelistedSenderIndex, - exactIn: true, - shouldSetSenderWhitelist: true, - - expectedResult: sdk.NewCoin(apptesting.ETH, defaultAmount), - }, - // TODO: under more test cases - // https://github.com/osmosis-labs/osmosis/issues/6633 - // - exactOut: false - // - sender does not have enough coins - } - - for name, tc := range tests { - s.Run(name, func() { - s.SetupTest() - poolManager := s.App.PoolManagerKeeper - - // Set whitelist. - if tc.shouldSetSenderWhitelist { - poolManagerParams := poolManager.GetParams(s.Ctx) - poolManagerParams.TakerFeeParams.ReducedFeeWhitelist = []string{s.TestAccs[whitelistedSenderIndex].String()} - poolManager.SetParams(s.Ctx, poolManagerParams) - } - - // Create pool. - s.PrepareConcentratedPool() - - // Set taker fee. - poolManager.SetDenomPairTakerFee(s.Ctx, tc.tokenIn.Denom, tc.tokenOutDenom, tc.takerFee) - - // Pre-fund owner. - s.FundAcc(s.TestAccs[tc.senderIndex], sdk.NewCoins(tc.tokenIn)) - - // System under test. - tokenInAfterTakerFee, err := poolManager.ChargeTakerFee(s.Ctx, tc.tokenIn, tc.tokenOutDenom, s.TestAccs[tc.senderIndex], tc.exactIn) - - if tc.expectError != nil { - s.Require().Error(err) - return - } - s.Require().NoError(err) - - // Validate results. - s.Require().Equal(tc.expectedResult.String(), tokenInAfterTakerFee.String()) - }) - } -} diff --git a/x/poolmanager/types/genesis.pb.go b/x/poolmanager/types/genesis.pb.go index 753b96e37e8..ee7f9a88117 100644 --- a/x/poolmanager/types/genesis.pb.go +++ b/x/poolmanager/types/genesis.pb.go @@ -194,14 +194,6 @@ type TakerFeeParams struct { // non-whitelisted taker fees will be swapped to before being sent to // the community pool. CommunityPoolDenomToSwapNonWhitelistedAssetsTo string `protobuf:"bytes,5,opt,name=community_pool_denom_to_swap_non_whitelisted_assets_to,json=communityPoolDenomToSwapNonWhitelistedAssetsTo,proto3" json:"community_pool_denom_to_swap_non_whitelisted_assets_to,omitempty" yaml:"community_pool_denom_to_swap_non_whitelisted_assets_to"` - // reduced_fee_whitelist is a list of addresses that are - // allowed to pay a reduce taker fee when performing a swap - // (i.e. swap without paying the taker fee). - // It is intended to be used for integrators who meet qualifying factors - // that are approved by governance. - // Initially, the taker fee is allowed to be bypassed completely. However - // In the future, we will charge a reduced taker fee instead of no fee at all. - ReducedFeeWhitelist []string `protobuf:"bytes,6,rep,name=reduced_fee_whitelist,json=reducedFeeWhitelist,proto3" json:"reduced_fee_whitelist,omitempty" yaml:"reduced_fee_whitelist"` } func (m *TakerFeeParams) Reset() { *m = TakerFeeParams{} } @@ -265,13 +257,6 @@ func (m *TakerFeeParams) GetCommunityPoolDenomToSwapNonWhitelistedAssetsTo() str return "" } -func (m *TakerFeeParams) GetReducedFeeWhitelist() []string { - if m != nil { - return m.ReducedFeeWhitelist - } - return nil -} - // TakerFeeDistributionPercentage defines what percent of the taker fee category // gets distributed to the available categories. type TakerFeeDistributionPercentage struct { @@ -324,61 +309,59 @@ func init() { } var fileDescriptor_aa099d9fbdf68b35 = []byte{ - // 856 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0xaf, 0xb7, 0x25, 0x52, 0xa7, 0x4b, 0xc2, 0x1a, 0xca, 0x7a, 0x5b, 0x64, 0x47, 0xde, 0x4b, - 0x10, 0x5a, 0x5b, 0x2d, 0xd2, 0x22, 0xfe, 0xec, 0xa1, 0x69, 0x55, 0x84, 0xb4, 0xec, 0x76, 0xbd, - 0x95, 0x90, 0xf6, 0x32, 0x9a, 0x78, 0x5e, 0x5d, 0xab, 0xb1, 0x5f, 0xf0, 0x8c, 0xdb, 0x0d, 0x5f, - 0x81, 0x0b, 0x12, 0x57, 0xce, 0x1c, 0xb8, 0xf1, 0x1d, 0x38, 0xec, 0xb1, 0x47, 0xc4, 0xc1, 0xa0, - 0xf4, 0xcc, 0x25, 0x9f, 0x00, 0x79, 0x66, 0x92, 0x36, 0xa5, 0x89, 0x2a, 0x38,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xa8, 0xcf, 0x7a, 0x62, 0x72, 0x08, 0x4f, 0xb7, 0x3e, 0x0d, 0x5f, 0xcf, - 0xbc, 0x50, 0xea, 0x09, 0xe8, 0x35, 0xd4, 0x9b, 0xf4, 0xf1, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xe3, 0x27, 0x4c, 0x26, 0x99, 0x07, 0x00, 0x00, + // 823 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x6f, 0xdb, 0x46, + 0x10, 0x35, 0x63, 0xc7, 0x80, 0xd7, 0xa9, 0xd4, 0x10, 0x4d, 0xc3, 0xd8, 0x00, 0x29, 0x30, 0x17, + 0x15, 0x45, 0x48, 0xd8, 0x05, 0x52, 0xf4, 0x23, 0x07, 0xcb, 0x46, 0x8a, 0x02, 0x69, 0xe2, 0x30, + 0x06, 0x0a, 0xe4, 0xb2, 0x58, 0x91, 0x63, 0x9a, 0xb0, 0xb8, 0xa3, 0x72, 0x97, 0x76, 0xd4, 0x5f, + 0x51, 0xa0, 0xd7, 0x9e, 0x7b, 0xe8, 0xad, 0x87, 0xfe, 0x83, 0x1e, 0x72, 0xcc, 0xb1, 0xe8, 0x41, + 0x2d, 0xe4, 0x73, 0x2f, 0xfa, 0x05, 0xc5, 0x7e, 0xc8, 0x36, 0xdd, 0x48, 0x30, 0x9a, 0x93, 0xc4, + 0x99, 0x79, 0x6f, 0xe6, 0xcd, 0xbe, 0x25, 0xc9, 0x47, 0x28, 0x4a, 0x14, 0x85, 0x88, 0x87, 0x88, + 0x83, 0x92, 0x71, 0x96, 0x43, 0x15, 0x9f, 0x6c, 0xf5, 0x41, 0xb2, 0xad, 0x38, 0x07, 0x0e, 0xa2, + 0x10, 0xd1, 0xb0, 0x42, 0x89, 0xee, 0xa6, 0x2d, 0x8d, 0x2e, 0x95, 0x46, 0xb6, 0x74, 0xe3, 0x83, + 0x1c, 0x73, 0xd4, 0x75, 0xb1, 0xfa, 0x67, 0x20, 0x1b, 0xf7, 0x72, 0xc4, 0x7c, 0x00, 0xb1, 0x7e, + 0xea, 0xd7, 0x87, 0x31, 0xe3, 0xa3, 0x59, 0x2a, 0xd5, 0x74, 0xd4, 0x60, 0xcc, 0x83, 0x4d, 0xf9, + 0x57, 0x51, 0x59, 0x5d, 0x31, 0x59, 0x20, 0x9f, 0xe5, 0x4d, 0x75, 0xdc, 0x67, 0x02, 0xce, 0x67, + 0x4d, 0xb1, 0x98, 0xe5, 0xa3, 0x45, 0x9a, 0x4a, 0xcc, 0xea, 0x01, 0xd0, 0x0a, 0x6b, 0x09, 0xa6, + 0x3e, 0x9c, 0xde, 0x20, 0xab, 0xfb, 0xac, 0x62, 0xa5, 0x70, 0x7f, 0x74, 0xc8, 0x6d, 0x85, 0xa2, + 0x69, 0x05, 0xba, 0x25, 0x3d, 0x04, 0xf0, 0x9c, 0xce, 0x72, 0x77, 0x7d, 0xfb, 0x5e, 0x64, 0xa7, + 0x54, 0x7d, 0x67, 0xc2, 0xa3, 0x5d, 0x2c, 0x78, 0xef, 0xc9, 0xeb, 0x71, 0xb0, 0x34, 0x1d, 0x07, + 0xde, 0x88, 0x95, 0x83, 0xcf, 0xc3, 0xff, 0x30, 0x84, 0xbf, 0xfc, 0x15, 0x74, 0xf3, 0x42, 0x1e, + 0xd5, 0xfd, 0x28, 0xc5, 0xd2, 0xca, 0xb5, 0x3f, 0x0f, 0x44, 0x76, 0x1c, 0xcb, 0xd1, 0x10, 0x84, + 0x26, 0x13, 0x49, 0x5b, 0xe1, 0x77, 0x2d, 0xfc, 0x31, 0x80, 0x7b, 0x42, 0xde, 0x97, 0xec, 0x18, + 0x2a, 0x45, 0x45, 0x87, 0x7a, 0x52, 0xef, 0x46, 0xc7, 0xe9, 0xae, 0x6f, 0x7f, 0x1c, 0x2d, 0x38, + 0x94, 0xe8, 0x40, 0x81, 0x1e, 0x03, 0x18, 0x71, 0xbd, 0xc0, 0x4e, 0x79, 0xd7, 0x4c, 0x79, 0x95, + 0x32, 0x4c, 0x5a, 0xb2, 0x01, 0x70, 0x5f, 0x92, 0xbb, 0xac, 0x96, 0x47, 0x58, 0x15, 0xdf, 0x43, + 0x46, 0xbf, 0xab, 0x51, 0x02, 0xcd, 0x80, 0x63, 0x29, 0xbc, 0xe5, 0xce, 0x72, 0x77, 0xad, 0x17, + 0x4e, 0xc7, 0x81, 0x6f, 0xd8, 0xe6, 0x14, 0x86, 0xc9, 0x9d, 0x8b, 0xcc, 0x73, 0x95, 0xd8, 0x33, + 0xf1, 0xdf, 0x1d, 0x72, 0xeb, 0x2b, 0xe3, 0xaf, 0x17, 0x92, 0x49, 0x70, 0x3b, 0xe4, 0x16, 0x87, + 0x57, 0x92, 0xea, 0xe5, 0x15, 0x99, 0xe7, 0x74, 0x9c, 0xee, 0x4a, 0x42, 0x54, 0x6c, 0x1f, 0x71, + 0xf0, 0x75, 0xe6, 0xee, 0x90, 0xd5, 0x86, 0xf8, 0xfb, 0x0b, 0xc5, 0x5b, 0xd1, 0x2b, 0x4a, 0x74, + 0x62, 0x81, 0xee, 0x33, 0xb2, 0xae, 0xf9, 0xf5, 0xf1, 0x1b, 0x15, 0xeb, 0xdb, 0xdd, 0x85, 0x3c, + 0xdf, 0x68, 0xc3, 0x24, 0x0a, 0x60, 0xc9, 0x88, 0x2a, 0xd3, 0x01, 0x11, 0xfe, 0x76, 0x93, 0xb4, + 0x9a, 0x6b, 0x76, 0xfb, 0xe4, 0x76, 0x06, 0x87, 0xac, 0x1e, 0x48, 0x7a, 0xbe, 0x62, 0xad, 0x66, + 0xad, 0xf7, 0x50, 0xe1, 0xff, 0x1c, 0x07, 0x9b, 0xe6, 0xe4, 0x45, 0x76, 0x1c, 0x15, 0x18, 0x97, + 0x4c, 0x1e, 0x45, 0x4f, 0x20, 0x67, 0xe9, 0x68, 0x0f, 0xd2, 0xc9, 0x38, 0x68, 0xef, 0x19, 0xfc, + 0x8c, 0x38,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 0xf0, 0x1f, 0x87, 0xf8, 0x8b, 0xb7, 0xeb, 0x1e, + 0x92, 0xb6, 0x90, 0xec, 0xb8, 0xe0, 0x39, 0xad, 0xe0, 0x94, 0x55, 0x99, 0xb0, 0x2e, 0x7e, 0x74, + 0x0d, 0x17, 0x5f, 0xac, 0xef, 0x0a, 0x47, 0x98, 0xb4, 0x6c, 0x24, 0x31, 0x01, 0x37, 0x25, 0xad, + 0xa6, 0x6a, 0xed, 0xde, 0xb5, 0xde, 0x97, 0xd7, 0x6b, 0x73, 0xe7, 0x6d, 0x8b, 0x0b, 0x93, 0xf7, + 0x1a, 0x0b, 0xe9, 0x3d, 0x7f, 0x3d, 0xf1, 0x9d, 0x37, 0x13, 0xdf, 0xf9, 0x7b, 0xe2, 0x3b, 0x3f, + 0x9c, 0xf9, 0x4b, 0x6f, 0xce, 0xfc, 0xa5, 0x3f, 0xce, 0xfc, 0xa5, 0x97, 0x9f, 0x5e, 0x7a, 0x2f, + 0x5b, 0x2f, 0x3e, 0x18, 0xb0, 0xbe, 0x98, 0x3d, 0xc4, 0x27, 0x5b, 0x9f, 0xc5, 0xaf, 0x1a, 0xdf, + 0x12, 0xfd, 0xb2, 0xee, 0xaf, 0xea, 0xaf, 0xc7, 0x27, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xa7, + 0x24, 0x16, 0xe1, 0x43, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -509,15 +492,6 @@ func (m *TakerFeeParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.ReducedFeeWhitelist) > 0 { - for iNdEx := len(m.ReducedFeeWhitelist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ReducedFeeWhitelist[iNdEx]) - copy(dAtA[i:], m.ReducedFeeWhitelist[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ReducedFeeWhitelist[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } if len(m.CommunityPoolDenomToSwapNonWhitelistedAssetsTo) > 0 { i -= len(m.CommunityPoolDenomToSwapNonWhitelistedAssetsTo) copy(dAtA[i:], m.CommunityPoolDenomToSwapNonWhitelistedAssetsTo) @@ -686,12 +660,6 @@ func (m *TakerFeeParams) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - if len(m.ReducedFeeWhitelist) > 0 { - for _, s := range m.ReducedFeeWhitelist { - l = len(s) - n += 1 + l + sovGenesis(uint64(l)) - } - } return n } @@ -1192,38 +1160,6 @@ func (m *TakerFeeParams) Unmarshal(dAtA []byte) error { } m.CommunityPoolDenomToSwapNonWhitelistedAssetsTo = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ReducedFeeWhitelist", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ReducedFeeWhitelist = append(m.ReducedFeeWhitelist, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/poolmanager/types/params.go b/x/poolmanager/types/params.go index dd667efe868..1ca486a1f33 100644 --- a/x/poolmanager/types/params.go +++ b/x/poolmanager/types/params.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/osmosis-labs/osmosis/osmomath" - "github.com/osmosis-labs/osmosis/osmoutils" appparams "github.com/osmosis-labs/osmosis/v19/app/params" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,7 +19,6 @@ var ( KeyAdminAddresses = []byte("AdminAddresses") KeyCommunityPoolDenomToSwapNonWhitelistedAssetsTo = []byte("CommunityPoolDenomToSwapNonWhitelistedAssetsTo") KeyAuthorizedQuoteDenoms = []byte("AuthorizedQuoteDenoms") - KeyReducedTakerFeeByWhitelist = []byte("ReducedTakerFeeByWhitelist") ) // ParamTable for gamm module. @@ -62,7 +60,6 @@ func DefaultParams() Params { }, AdminAddresses: []string{}, CommunityPoolDenomToSwapNonWhitelistedAssetsTo: "ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858", // USDC - ReducedFeeWhitelist: []string{}, }, AuthorizedQuoteDenoms: []string{ "uosmo", @@ -93,9 +90,6 @@ func (p Params) Validate() error { if err := validateCommunityPoolDenomToSwapNonWhitelistedAssetsTo(p.TakerFeeParams.CommunityPoolDenomToSwapNonWhitelistedAssetsTo); err != nil { return err } - if err := osmoutils.ValidateAddressList(p.TakerFeeParams.ReducedFeeWhitelist); err != nil { - return err - } if err := validateAuthorizedQuoteDenoms(p.AuthorizedQuoteDenoms); err != nil { return err } @@ -113,7 +107,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyAdminAddresses, &p.TakerFeeParams.AdminAddresses, validateAdminAddresses), paramtypes.NewParamSetPair(KeyCommunityPoolDenomToSwapNonWhitelistedAssetsTo, &p.TakerFeeParams.CommunityPoolDenomToSwapNonWhitelistedAssetsTo, validateCommunityPoolDenomToSwapNonWhitelistedAssetsTo), paramtypes.NewParamSetPair(KeyAuthorizedQuoteDenoms, &p.AuthorizedQuoteDenoms, validateAuthorizedQuoteDenoms), - paramtypes.NewParamSetPair(KeyReducedTakerFeeByWhitelist, &p.TakerFeeParams.ReducedFeeWhitelist, osmoutils.ValidateAddressList), } }