From 0ebc050cc8381bb0d0a48747dc3ea01f1220f4e9 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 21 Feb 2024 17:31:35 +0100 Subject: [PATCH 01/15] add draft commission --- tests/integration/distribution.go | 11 ++- testutil/integration/interfaces.go | 1 + testutil/keeper/mocks.go | 128 -------------------------- x/ccv/provider/ibc_middleware.go | 2 +- x/ccv/provider/keeper/distribution.go | 13 ++- 5 files changed, 19 insertions(+), 136 deletions(-) diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index f06c6f9482..3eb4de90c3 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -736,11 +736,18 @@ func (s *CCVTestSuite) TestAllocateTokens() { // verify the validator tokens allocation // note all validators have the same voting power to keep things simple for _, val := range s.providerChain.Vals.Validators { - valReward := distributionKeeper.GetValidatorOutstandingRewards(s.providerCtx(), sdk.ValAddress(val.Address)) + valRewards := distributionKeeper.GetValidatorOutstandingRewards(s.providerCtx(), sdk.ValAddress(val.Address)) s.Require().Equal( - valReward.Rewards, + valRewards.Rewards, lastValOutRewards[sdk.ValAddress(val.Address).String()].Add(perValExpReward...), ) + + // withdraw validator rewards + withdrawnCoins, err := distributionKeeper.WithdrawValidatorCommission(s.providerCtx(), sdk.ValAddress(val.Address)) + s.Require().NoError(err) + + valRewardsTrunc, _ := valRewards.Rewards.TruncateDecimal() + s.Require().Equal(withdrawnCoins, valRewardsTrunc) } commPoolExpRewards := sdk.NewDecCoinsFromCoins(totalRewards...).Sub(validatorsExpRewards) diff --git a/testutil/integration/interfaces.go b/testutil/integration/interfaces.go index 89d59904df..fe3382b524 100644 --- a/testutil/integration/interfaces.go +++ b/testutil/integration/interfaces.go @@ -142,6 +142,7 @@ type TestDistributionKeeper interface { GetValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress) (rewards distributiontypes.ValidatorOutstandingRewards) GetCommunityTax(ctx sdk.Context) (percent sdk.Dec) + WithdrawValidatorCommission(ctx sdk.Context, valAddr sdk.ValAddress) (sdk.Coins, error) } type TestMintKeeper interface { diff --git a/testutil/keeper/mocks.go b/testutil/keeper/mocks.go index a192765ec9..78c0fbedc9 100644 --- a/testutil/keeper/mocks.go +++ b/testutil/keeper/mocks.go @@ -1114,134 +1114,6 @@ func (m *MockIBCTransferKeeper) EXPECT() *MockIBCTransferKeeperMockRecorder { return m.recorder } -// OnAcknowledgementPacket mocks base method. -func (m *MockIBCTransferKeeper) OnAcknowledgementPacket(ctx types0.Context, packet types9.Packet, acknowledgement []byte, relayer types0.AccAddress) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnAcknowledgementPacket", ctx, packet, acknowledgement, relayer) - ret0, _ := ret[0].(error) - return ret0 -} - -// OnAcknowledgementPacket indicates an expected call of OnAcknowledgementPacket. -func (mr *MockIBCTransferKeeperMockRecorder) OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnAcknowledgementPacket", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnAcknowledgementPacket), ctx, packet, acknowledgement, relayer) -} - -// OnChanCloseConfirm mocks base method. -func (m *MockIBCTransferKeeper) OnChanCloseConfirm(ctx types0.Context, portID, channelID string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnChanCloseConfirm", ctx, portID, channelID) - ret0, _ := ret[0].(error) - return ret0 -} - -// OnChanCloseConfirm indicates an expected call of OnChanCloseConfirm. -func (mr *MockIBCTransferKeeperMockRecorder) OnChanCloseConfirm(ctx, portID, channelID interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanCloseConfirm", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnChanCloseConfirm), ctx, portID, channelID) -} - -// OnChanCloseInit mocks base method. -func (m *MockIBCTransferKeeper) OnChanCloseInit(ctx types0.Context, portID, channelID string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnChanCloseInit", ctx, portID, channelID) - ret0, _ := ret[0].(error) - return ret0 -} - -// OnChanCloseInit indicates an expected call of OnChanCloseInit. -func (mr *MockIBCTransferKeeperMockRecorder) OnChanCloseInit(ctx, portID, channelID interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanCloseInit", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnChanCloseInit), ctx, portID, channelID) -} - -// OnChanOpenAck mocks base method. -func (m *MockIBCTransferKeeper) OnChanOpenAck(ctx types0.Context, portID, channelID, counterpartyChannelID, counterpartyVersion string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnChanOpenAck", ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) - ret0, _ := ret[0].(error) - return ret0 -} - -// OnChanOpenAck indicates an expected call of OnChanOpenAck. -func (mr *MockIBCTransferKeeperMockRecorder) OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenAck", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnChanOpenAck), ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) -} - -// OnChanOpenConfirm mocks base method. -func (m *MockIBCTransferKeeper) OnChanOpenConfirm(ctx types0.Context, portID, channelID string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnChanOpenConfirm", ctx, portID, channelID) - ret0, _ := ret[0].(error) - return ret0 -} - -// OnChanOpenConfirm indicates an expected call of OnChanOpenConfirm. -func (mr *MockIBCTransferKeeperMockRecorder) OnChanOpenConfirm(ctx, portID, channelID interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenConfirm", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnChanOpenConfirm), ctx, portID, channelID) -} - -// OnChanOpenInit mocks base method. -func (m *MockIBCTransferKeeper) OnChanOpenInit(ctx types0.Context, order types9.Order, connectionHops []string, portID, channelID string, channelCap *types2.Capability, counterparty types9.Counterparty, version string) (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnChanOpenInit", ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// OnChanOpenInit indicates an expected call of OnChanOpenInit. -func (mr *MockIBCTransferKeeperMockRecorder) OnChanOpenInit(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenInit", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnChanOpenInit), ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) -} - -// OnChanOpenTry mocks base method. -func (m *MockIBCTransferKeeper) OnChanOpenTry(ctx types0.Context, order types9.Order, connectionHops []string, portID, channelID string, channelCap *types2.Capability, counterparty types9.Counterparty, counterpartyVersion string) (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnChanOpenTry", ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// OnChanOpenTry indicates an expected call of OnChanOpenTry. -func (mr *MockIBCTransferKeeperMockRecorder) OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenTry", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnChanOpenTry), ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) -} - -// OnRecvPacket mocks base method. -func (m *MockIBCTransferKeeper) OnRecvPacket(ctx types0.Context, packet types9.Packet, relayer types0.AccAddress) exported.Acknowledgement { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnRecvPacket", ctx, packet, relayer) - ret0, _ := ret[0].(exported.Acknowledgement) - return ret0 -} - -// OnRecvPacket indicates an expected call of OnRecvPacket. -func (mr *MockIBCTransferKeeperMockRecorder) OnRecvPacket(ctx, packet, relayer interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnRecvPacket", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnRecvPacket), ctx, packet, relayer) -} - -// OnTimeoutPacket mocks base method. -func (m *MockIBCTransferKeeper) OnTimeoutPacket(ctx types0.Context, packet types9.Packet, relayer types0.AccAddress) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnTimeoutPacket", ctx, packet, relayer) - ret0, _ := ret[0].(error) - return ret0 -} - -// OnTimeoutPacket indicates an expected call of OnTimeoutPacket. -func (mr *MockIBCTransferKeeperMockRecorder) OnTimeoutPacket(ctx, packet, relayer interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnTimeoutPacket", reflect.TypeOf((*MockIBCTransferKeeper)(nil).OnTimeoutPacket), ctx, packet, relayer) -} - // Transfer mocks base method. func (m *MockIBCTransferKeeper) Transfer(arg0 context.Context, arg1 *types6.MsgTransfer) (*types6.MsgTransferResponse, error) { m.ctrl.T.Helper() diff --git a/x/ccv/provider/ibc_middleware.go b/x/ccv/provider/ibc_middleware.go index 1c1b1ce824..3b14d07202 100644 --- a/x/ccv/provider/ibc_middleware.go +++ b/x/ccv/provider/ibc_middleware.go @@ -129,7 +129,7 @@ func (im IBCMiddleware) OnRecvPacket( var data ibctransfertypes.FungibleTokenPacketData _ = types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data) - // check if the recipient is the consumer reward's pool address + // check that the recipient is the consumer reward's pool address receiver, _ := sdk.AccAddressFromBech32(data.Receiver) if receiver.String() != im.keeper.GetConsumerRewardsPoolAddressStr(ctx) { return ack diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index 45af3eb262..3467ec6f4c 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -5,9 +5,9 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" ) @@ -157,9 +157,12 @@ func (k Keeper) AllocateTokensToConsumerValidators( powerFraction := math.LegacyNewDec(vote.Validator.Power).QuoTruncate(math.LegacyNewDec(totalPower)) tokensFraction := tokens.MulDecTruncate(powerFraction) + val := k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr).(stakingtypes.Validator) + val.Commission.Rate = math.LegacyOneDec() + k.distributionKeeper.AllocateTokensToValidator( ctx, - k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr), + val, tokensFraction, ) totalReward = totalReward.Add(tokensFraction...) @@ -168,8 +171,8 @@ func (k Keeper) AllocateTokensToConsumerValidators( return totalReward } -// TransferConsumerRewardsToDistributionModule transfers the collected rewards of the given consumer chain -// from the consumer rewards pool module account to a the distribution module +// TransferConsumerRewardsToDistributionModule transfers the rewards allocation of the given consumer chain +// from the consumer rewards pool to a the distribution module func (k Keeper) TransferConsumerRewardsToDistributionModule( ctx sdk.Context, chainID string, From 429d5aeb4f4f7f86af586812957058234663e145 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 22 Feb 2024 15:40:58 +0100 Subject: [PATCH 02/15] implement consumer commission draft --- tests/integration/distribution.go | 121 ++++++++++++------ x/ccv/provider/keeper/distribution.go | 30 ++++- x/ccv/provider/keeper/distribution_test.go | 2 + x/ccv/provider/keeper/keeper.go | 32 +++-- x/ccv/provider/keeper/keeper_test.go | 8 +- x/ccv/provider/keeper/partial_set_security.go | 5 + .../keeper/partial_set_security_test.go | 6 +- 7 files changed, 146 insertions(+), 58 deletions(-) diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 3eb4de90c3..76b0f8b28f 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/bytes" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" @@ -575,7 +575,7 @@ func (s *CCVTestSuite) TestIBCTransferMiddleware() { bankKeeper := s.providerApp.GetTestBankKeeper() amount := sdk.NewInt(100) - data = types.NewFungibleTokenPacketData( // can be explicitly changed in setup + data = transfertypes.NewFungibleTokenPacketData( // can be explicitly changed in setup sdk.DefaultBondDenom, amount.String(), authtypes.NewModuleAddress(consumertypes.ConsumerToSendToProviderName).String(), @@ -734,20 +734,13 @@ func (s *CCVTestSuite) TestAllocateTokens() { perValExpReward := validatorsExpRewards.QuoDec(sdk.NewDec(int64(valNum))) // verify the validator tokens allocation - // note all validators have the same voting power to keep things simple + // note that the validators have the same voting power to keep things simple for _, val := range s.providerChain.Vals.Validators { valRewards := distributionKeeper.GetValidatorOutstandingRewards(s.providerCtx(), sdk.ValAddress(val.Address)) s.Require().Equal( valRewards.Rewards, lastValOutRewards[sdk.ValAddress(val.Address).String()].Add(perValExpReward...), ) - - // withdraw validator rewards - withdrawnCoins, err := distributionKeeper.WithdrawValidatorCommission(s.providerCtx(), sdk.ValAddress(val.Address)) - s.Require().NoError(err) - - valRewardsTrunc, _ := valRewards.Rewards.TruncateDecimal() - s.Require().Equal(withdrawnCoins, valRewardsTrunc) } commPoolExpRewards := sdk.NewDecCoinsFromCoins(totalRewards...).Sub(validatorsExpRewards) @@ -909,80 +902,130 @@ func (s *CCVTestSuite) prepareRewardDist() { } func (s *CCVTestSuite) TestAllocateTokensToValidator() { - - providerkeepr := s.providerApp.GetProviderKeeper() + providerKeeper := s.providerApp.GetProviderKeeper() + distributionKeeper := s.providerApp.GetTestDistributionKeeper() + bankKeeper := s.providerApp.GetTestBankKeeper() chainID := "consumer" - validators := []bytes.HexBytes{ s.providerChain.Vals.Validators[0].Address, s.providerChain.Vals.Validators[1].Address, } - votes := []abci.VoteInfo{ {Validator: abci.Validator{Address: validators[0], Power: 1}}, {Validator: abci.Validator{Address: validators[1], Power: 1}}, } testCases := []struct { - name string - votes []abci.VoteInfo - tokens sdk.DecCoins - expCoinTransferred sdk.DecCoins + name string + votes []abci.VoteInfo + tokens sdk.DecCoins + expAllocated sdk.DecCoins }{ { - name: "reward tokens are empty", + name: "tokens are empty", }, { - name: "total voting power is zero", - tokens: sdk.DecCoins{sdk.NewDecCoin("uatom", math.NewInt(100_000))}, + name: "total voting power is zero", + tokens: sdk.DecCoins{sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(100_000))}, + expAllocated: nil, }, { - name: "expect all tokens to be allocated to a single validator", - votes: []abci.VoteInfo{votes[0]}, - tokens: sdk.DecCoins{sdk.NewDecCoin("uatom", math.NewInt(100_000))}, - expCoinTransferred: sdk.DecCoins{sdk.NewDecCoin("uatom", math.NewInt(100_000))}, + name: "expect all tokens to be allocated to a single validator", + votes: []abci.VoteInfo{votes[0]}, + tokens: sdk.DecCoins{sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(999))}, + expAllocated: sdk.DecCoins{sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(999))}, }, { - name: "expect tokens to be allocated evenly between validators", - votes: []abci.VoteInfo{votes[0], votes[1]}, - tokens: sdk.DecCoins{sdk.NewDecCoin("uatom", math.NewInt(555_555))}, - expCoinTransferred: sdk.DecCoins{sdk.NewDecCoin("uatom", math.NewInt(555_555))}, + name: "expect tokens to be allocated evenly between validators", + votes: []abci.VoteInfo{votes[0], votes[1]}, + tokens: sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 3))}, + expAllocated: sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 3))}, }, } + // opt the validators in to verify that they charge + // to their delegators the custom commission for the consumer chain + for _, val := range s.providerChain.Vals.Validators { + consAddr := sdk.ConsAddress(val.Address) + provAddr := providertypes.NewProviderConsAddress(consAddr) + + val, found := s.providerApp.GetTestStakingKeeper().GetValidatorByConsAddr(s.providerCtx(), consAddr) + s.Require().True(found) + + // check that no commission is set for the validator + s.Require().Equal(val.Commission.Rate, math.LegacyZeroDec()) + + // opt the validators in consumer with a custom commission of 100% + providerKeeper.SetOptedIn( + s.providerCtx(), + chainID, + provAddr, + uint64(s.providerCtx().BlockHeight()), + math.LegacyOneDec(), + ) + + } + for _, tc := range testCases { s.Run(tc.name, func() { // TODO: opt validators in and verify - // that rewards are solely allocated to them - + // that rewards are only allocated to them ctx, _ := s.providerCtx().CacheContext() // allocate tokens - res := providerkeepr.AllocateTokensToConsumerValidators( + res := providerKeeper.AllocateTokensToConsumerValidators( ctx, chainID, tc.votes, tc.tokens, ) - // check that the expect result is returned - s.Require().Equal(tc.expCoinTransferred, res) + // check that the expected result is returned + s.Require().Equal(tc.expAllocated, res) - if !tc.expCoinTransferred.Empty() { + if !tc.expAllocated.Empty() { // rewards are expected to be allocated evenly between validators - rewardsPerVal := tc.expCoinTransferred.QuoDec(sdk.NewDec(int64(len(tc.votes)))) + rewardsPerVal := tc.expAllocated.QuoDec(sdk.NewDec(int64(len(tc.votes)))) - // check that the rewards are allocated to validators as expected + // check that the rewards are allocated to validators for _, v := range tc.votes { + valAddr := sdk.ValAddress(v.Validator.Address) rewards := s.providerApp.GetTestDistributionKeeper().GetValidatorOutstandingRewards( ctx, - sdk.ValAddress(v.Validator.Address), + valAddr, ) s.Require().Equal(rewardsPerVal, rewards.Rewards) + + // send tokens to the distribution module to allow the rewards withdrawing + valRewardsTrunc, _ := rewards.Rewards.TruncateDecimal() + err := bankKeeper.SendCoinsFromAccountToModule( + ctx, + s.providerChain.SenderAccount.GetAddress(), + distrtypes.ModuleName, + valRewardsTrunc) + s.Require().NoError(err) + + // check that validators can withdraw their rewards + withdrawnCoins, err := distributionKeeper.WithdrawValidatorCommission( + ctx, + valAddr, + ) + s.Require().NoError(err) + + // check that the withdrawn coins is equal to the entire reward amount + s.Require().Equal(withdrawnCoins, valRewardsTrunc) + } + } else { + for _, v := range tc.votes { + valAddr := sdk.ValAddress(v.Validator.Address) + rewards := s.providerApp.GetTestDistributionKeeper().GetValidatorOutstandingRewards( + ctx, + valAddr, + ) + s.Require().Zero(rewards.Rewards) } } - }) } } diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index 3467ec6f4c..860138b265 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -138,16 +138,25 @@ func (k Keeper) AllocateTokensToConsumerValidators( chainID string, bondedVotes []abci.VoteInfo, tokens sdk.DecCoins, -) (totalReward sdk.DecCoins) { +) (allocated sdk.DecCoins) { + // return early if the tokens are empty if tokens.Empty() { - return totalReward + return allocated } // get the consumer total voting power from the votes totalPower := k.ComputeConsumerTotalVotingPower(ctx, chainID, bondedVotes) if totalPower == 0 { - return totalReward + return allocated + } + + // get opted-in validator commission rates for the consumer chain + valCommissions := map[string]math.LegacyDec{} + for _, v := range k.GetOptedIn(ctx, chainID) { + if !v.CommissionRate.IsZero() { + valCommissions[v.ProviderAddr.ToSdkConsAddr().String()] = v.CommissionRate + } } for _, vote := range bondedVotes { @@ -157,18 +166,27 @@ func (k Keeper) AllocateTokensToConsumerValidators( powerFraction := math.LegacyNewDec(vote.Validator.Power).QuoTruncate(math.LegacyNewDec(totalPower)) tokensFraction := tokens.MulDecTruncate(powerFraction) + // get the validator type struct for the consensus address val := k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr).(stakingtypes.Validator) - val.Commission.Rate = math.LegacyOneDec() + // check if the validator set a custom commission rate for the consumer chain + if cr, ok := valCommissions[consAddr.String()]; ok { + // set the validator commission rate + val.Commission.CommissionRates.Rate = cr + } + + // allocate the consumer reward tokens to the validator k.distributionKeeper.AllocateTokensToValidator( ctx, val, tokensFraction, ) - totalReward = totalReward.Add(tokensFraction...) + + // sum the tokens allocated + allocated = allocated.Add(tokensFraction...) } - return totalReward + return allocated } // TransferConsumerRewardsToDistributionModule transfers the rewards allocation of the given consumer chain diff --git a/x/ccv/provider/keeper/distribution_test.go b/x/ccv/provider/keeper/distribution_test.go index b8883177b1..79bee5d42c 100644 --- a/x/ccv/provider/keeper/distribution_test.go +++ b/x/ccv/provider/keeper/distribution_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" tmtypes "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -40,6 +41,7 @@ func TestComputeConsumerTotalVotingPower(t *testing.T) { chainID, types.NewProviderConsAddress(sdk.ConsAddress(val.Address)), 0, + math.LegacyZeroDec(), ) validatorsVotes = append( diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 42bcb12ace..fc25f4e052 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "encoding/binary" + "encoding/json" "fmt" "reflect" "time" @@ -14,6 +15,7 @@ import ( ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -1191,14 +1193,23 @@ func (k Keeper) SetOptedIn( chainID string, providerAddr types.ProviderConsAddress, blockHeight uint64, + commissionRate math.LegacyDec, ) { store := ctx.KVStore(k.storeKey) - // validator is considered opted in - blockHeightBytes := make([]byte, 8) - binary.BigEndian.PutUint64(blockHeightBytes, blockHeight) + // TODO: use proto message + v := OptedInValidator{ + ProviderAddr: providerAddr, + BlockHeight: blockHeight, + CommissionRate: commissionRate, + } - store.Set(types.OptedInKey(chainID, providerAddr), blockHeightBytes) + bz, err := json.Marshal(v) + if err != nil { + panic(err) + } + + store.Set(types.OptedInKey(chainID, providerAddr), bz) } func (k Keeper) DeleteOptedIn( @@ -1228,10 +1239,15 @@ func (k Keeper) GetOptedIn( defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - optedInValidators = append(optedInValidators, OptedInValidator{ - ProviderAddr: types.NewProviderConsAddress(iterator.Key()[len(key):]), - BlockHeight: binary.BigEndian.Uint64(iterator.Value()), - }) + val := &OptedInValidator{} + + // TODO: use a proto message instead of json + err := json.Unmarshal(iterator.Value(), val) + if err != nil { + panic(err) + } + + optedInValidators = append(optedInValidators, *val) } return optedInValidators diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 35380a67aa..4a1651bc76 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -3,11 +3,13 @@ package keeper_test import ( "bytes" "fmt" - "github.com/cosmos/interchain-security/v4/x/ccv/provider/keeper" "sort" "testing" "time" + "cosmossdk.io/math" + "github.com/cosmos/interchain-security/v4/x/ccv/provider/keeper" + ibctesting "github.com/cosmos/ibc-go/v7/testing" "github.com/stretchr/testify/require" @@ -683,7 +685,7 @@ func TestGetOptedIn(t *testing.T) { for _, expectedOptedInValidator := range expectedOptedInValidators { providerKeeper.SetOptedIn(ctx, "chainID", - expectedOptedInValidator.ProviderAddr, expectedOptedInValidator.BlockHeight) + expectedOptedInValidator.ProviderAddr, expectedOptedInValidator.BlockHeight, math.LegacyZeroDec()) } actualOptedInValidators := providerKeeper.GetOptedIn(ctx, "chainID") @@ -713,7 +715,7 @@ func TestOptedIn(t *testing.T) { } require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator.ProviderAddr)) - providerKeeper.SetOptedIn(ctx, "chainID", optedInValidator.ProviderAddr, optedInValidator.BlockHeight) + providerKeeper.SetOptedIn(ctx, "chainID", optedInValidator.ProviderAddr, optedInValidator.BlockHeight, math.LegacyZeroDec()) require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator.ProviderAddr)) providerKeeper.DeleteOptedIn(ctx, "chainID", optedInValidator.ProviderAddr) require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator.ProviderAddr)) diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index e1bf9cc14f..758776beaf 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -2,15 +2,20 @@ package keeper import ( errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" ) +// TODO: move to a proto message definition type OptedInValidator struct { ProviderAddr types.ProviderConsAddress // block height the validator opted in at BlockHeight uint64 + // custom commission rate the validator charges + // to delegator on the consumers, as a fraction + CommissionRate math.LegacyDec } func (k Keeper) HandleOptIn(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, consumerKey *string) error { diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index 4831723bec..58646939a3 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -1,6 +1,9 @@ package keeper_test import ( + "testing" + + "cosmossdk.io/math" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" @@ -10,7 +13,6 @@ import ( ccvtypes "github.com/cosmos/interchain-security/v4/x/ccv/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "testing" ) func TestHandleOptIn(t *testing.T) { @@ -32,7 +34,7 @@ func TestHandleOptIn(t *testing.T) { require.False(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) // if validator (`providerAddr`) is already opted in, then the validator cannot be opted in - providerKeeper.SetOptedIn(ctx, "chainID", providerAddr, 1) + providerKeeper.SetOptedIn(ctx, "chainID", providerAddr, 1, math.LegacyZeroDec()) providerKeeper.HandleOptIn(ctx, "chainID", providerAddr, nil) require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) } From 638d4e20227e29dc25736310c2d3a29c1c66df0c Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 26 Feb 2024 12:18:53 +0100 Subject: [PATCH 03/15] formatting --- .../v4/x/ccv/consumer/types/consumer.pb.go | 701 ------------------ .../ccv/provider/v1/provider.proto | 6 +- tests/integration/distribution.go | 14 +- x/ccv/provider/keeper/distribution.go | 10 +- x/ccv/provider/keeper/keeper.go | 43 ++ x/ccv/provider/keeper/keeper_test.go | 16 +- x/ccv/provider/keeper/partial_set_security.go | 43 ++ x/ccv/provider/types/errors.go | 1 + x/ccv/provider/types/keys.go | 9 + x/ccv/provider/types/keys_test.go | 1 + x/ccv/provider/types/provider.pb.go | 289 +++----- 11 files changed, 229 insertions(+), 904 deletions(-) delete mode 100644 github.com/cosmos/interchain-security/v4/x/ccv/consumer/types/consumer.pb.go diff --git a/github.com/cosmos/interchain-security/v4/x/ccv/consumer/types/consumer.pb.go b/github.com/cosmos/interchain-security/v4/x/ccv/consumer/types/consumer.pb.go deleted file mode 100644 index ab52b3a8a7..0000000000 --- a/github.com/cosmos/interchain-security/v4/x/ccv/consumer/types/consumer.pb.go +++ /dev/null @@ -1,701 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: interchain_security/ccv/consumer/v1/consumer.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// CrossChainValidator defines the type used to store validator information -// internal to the consumer CCV module. Note one cross chain validator entry is -// persisted for each consumer validator, where incoming VSC packets update this -// data, which is eventually forwarded to comet for consumer chain consensus. -// -// Note this type is only used internally to the consumer CCV module. -type CrossChainValidator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` - // pubkey is the consensus public key of the validator, as a Protobuf Any. - Pubkey *types.Any `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty" yaml:"consensus_pubkey"` - OptedOut bool `protobuf:"varint,4,opt,name=opted_out,json=optedOut,proto3" json:"opted_out,omitempty"` -} - -func (m *CrossChainValidator) Reset() { *m = CrossChainValidator{} } -func (m *CrossChainValidator) String() string { return proto.CompactTextString(m) } -func (*CrossChainValidator) ProtoMessage() {} -func (*CrossChainValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_5b27a82b276e7f93, []int{0} -} -func (m *CrossChainValidator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CrossChainValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CrossChainValidator.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 *CrossChainValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_CrossChainValidator.Merge(m, src) -} -func (m *CrossChainValidator) XXX_Size() int { - return m.Size() -} -func (m *CrossChainValidator) XXX_DiscardUnknown() { - xxx_messageInfo_CrossChainValidator.DiscardUnknown(m) -} - -var xxx_messageInfo_CrossChainValidator proto.InternalMessageInfo - -func (m *CrossChainValidator) GetAddress() []byte { - if m != nil { - return m.Address - } - return nil -} - -func (m *CrossChainValidator) GetPower() int64 { - if m != nil { - return m.Power - } - return 0 -} - -func (m *CrossChainValidator) GetPubkey() *types.Any { - if m != nil { - return m.Pubkey - } - return nil -} - -func (m *CrossChainValidator) GetOptedOut() bool { - if m != nil { - return m.OptedOut - } - return false -} - -// A record storing the state of a slash packet sent to the provider chain -// which may bounce back and forth until handled by the provider. -// -// Note this type is only used internally to the consumer CCV module. -type SlashRecord struct { - WaitingOnReply bool `protobuf:"varint,1,opt,name=waiting_on_reply,json=waitingOnReply,proto3" json:"waiting_on_reply,omitempty"` - SendTime time.Time `protobuf:"bytes,2,opt,name=send_time,json=sendTime,proto3,stdtime" json:"send_time"` -} - -func (m *SlashRecord) Reset() { *m = SlashRecord{} } -func (m *SlashRecord) String() string { return proto.CompactTextString(m) } -func (*SlashRecord) ProtoMessage() {} -func (*SlashRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_5b27a82b276e7f93, []int{1} -} -func (m *SlashRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SlashRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SlashRecord.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 *SlashRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_SlashRecord.Merge(m, src) -} -func (m *SlashRecord) XXX_Size() int { - return m.Size() -} -func (m *SlashRecord) XXX_DiscardUnknown() { - xxx_messageInfo_SlashRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_SlashRecord proto.InternalMessageInfo - -func (m *SlashRecord) GetWaitingOnReply() bool { - if m != nil { - return m.WaitingOnReply - } - return false -} - -func (m *SlashRecord) GetSendTime() time.Time { - if m != nil { - return m.SendTime - } - return time.Time{} -} - -func init() { - proto.RegisterType((*CrossChainValidator)(nil), "interchain_security.ccv.consumer.v1.CrossChainValidator") - proto.RegisterType((*SlashRecord)(nil), "interchain_security.ccv.consumer.v1.SlashRecord") -} - -func init() { - proto.RegisterFile("interchain_security/ccv/consumer/v1/consumer.proto", fileDescriptor_5b27a82b276e7f93) -} - -var fileDescriptor_5b27a82b276e7f93 = []byte{ - // 434 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xce, 0x52, 0x28, 0xee, 0x06, 0x21, 0x64, 0x22, 0xe1, 0x06, 0xc9, 0x89, 0xcc, 0xc5, 0x97, - 0xda, 0x6a, 0xca, 0x09, 0x89, 0x43, 0xd3, 0x23, 0x87, 0x22, 0x83, 0x40, 0xe2, 0x62, 0xad, 0xd7, - 0x8b, 0x63, 0x61, 0xef, 0xac, 0xf6, 0xc7, 0x65, 0x79, 0x8a, 0x3e, 0x0c, 0xaf, 0x80, 0x54, 0x71, - 0xea, 0x91, 0x53, 0x41, 0xc9, 0x1b, 0xf0, 0x04, 0xc8, 0x3f, 0x09, 0xe2, 0xe7, 0x36, 0xf3, 0xcd, - 0x7e, 0x33, 0xdf, 0xcc, 0x7e, 0x78, 0x51, 0x72, 0xcd, 0x24, 0x5d, 0x91, 0x92, 0xa7, 0x8a, 0x51, - 0x23, 0x4b, 0x6d, 0x63, 0x4a, 0x9b, 0x98, 0x02, 0x57, 0xa6, 0x66, 0x32, 0x6e, 0x8e, 0x77, 0x71, - 0x24, 0x24, 0x68, 0x70, 0x9f, 0xfc, 0x87, 0x13, 0x51, 0xda, 0x44, 0xbb, 0x77, 0xcd, 0xf1, 0xf4, - 0xb0, 0x00, 0x28, 0x2a, 0x16, 0x77, 0x94, 0xcc, 0xbc, 0x8f, 0x09, 0xb7, 0x3d, 0x7f, 0x3a, 0x29, - 0xa0, 0x80, 0x2e, 0x8c, 0xdb, 0x68, 0x40, 0x0f, 0x29, 0xa8, 0x1a, 0x54, 0xda, 0x17, 0xfa, 0x64, - 0x28, 0xcd, 0xfe, 0xee, 0xa5, 0xcb, 0x9a, 0x29, 0x4d, 0x6a, 0xd1, 0x3f, 0x08, 0xbe, 0x20, 0xfc, - 0xf0, 0x4c, 0x82, 0x52, 0x67, 0xad, 0xa8, 0x37, 0xa4, 0x2a, 0x73, 0xa2, 0x41, 0xba, 0x1e, 0xbe, - 0x4b, 0xf2, 0x5c, 0x32, 0xa5, 0x3c, 0x34, 0x47, 0xe1, 0xbd, 0x64, 0x9b, 0xba, 0x13, 0x7c, 0x47, - 0xc0, 0x05, 0x93, 0xde, 0xad, 0x39, 0x0a, 0xf7, 0x92, 0x3e, 0x71, 0x09, 0xde, 0x17, 0x26, 0xfb, - 0xc0, 0xac, 0xb7, 0x37, 0x47, 0xe1, 0x78, 0x31, 0x89, 0xfa, 0xc9, 0xd1, 0x76, 0x72, 0x74, 0xca, - 0xed, 0xf2, 0xe4, 0xe7, 0xcd, 0xec, 0x91, 0x25, 0x75, 0xf5, 0x2c, 0x68, 0x37, 0x66, 0x5c, 0x19, - 0x95, 0xf6, 0xbc, 0xe0, 0xeb, 0xe7, 0xa3, 0xc9, 0xa0, 0x9d, 0x4a, 0x2b, 0x34, 0x44, 0x2f, 0x4d, - 0xf6, 0x82, 0xd9, 0x64, 0x68, 0xec, 0x3e, 0xc6, 0x07, 0x20, 0x34, 0xcb, 0x53, 0x30, 0xda, 0xbb, - 0x3d, 0x47, 0xa1, 0x93, 0x38, 0x1d, 0x70, 0x6e, 0x74, 0xf0, 0x09, 0x8f, 0x5f, 0x55, 0x44, 0xad, - 0x12, 0x46, 0x41, 0xe6, 0x6e, 0x88, 0x1f, 0x5c, 0x90, 0x52, 0x97, 0xbc, 0x48, 0x81, 0xa7, 0x92, - 0x89, 0xca, 0x76, 0x7b, 0x38, 0xc9, 0xfd, 0x01, 0x3f, 0xe7, 0x49, 0x8b, 0xba, 0xa7, 0xf8, 0x40, - 0x31, 0x9e, 0xa7, 0xed, 0x61, 0xba, 0x95, 0xc6, 0x8b, 0xe9, 0x3f, 0xda, 0x5f, 0x6f, 0xaf, 0xb6, - 0x74, 0xae, 0x6e, 0x66, 0xa3, 0xcb, 0xef, 0x33, 0x94, 0x38, 0x2d, 0xad, 0x2d, 0x2c, 0xdf, 0x5e, - 0xad, 0x7d, 0x74, 0xbd, 0xf6, 0xd1, 0x8f, 0xb5, 0x8f, 0x2e, 0x37, 0xfe, 0xe8, 0x7a, 0xe3, 0x8f, - 0xbe, 0x6d, 0xfc, 0xd1, 0xbb, 0xe7, 0x45, 0xa9, 0x57, 0x26, 0x8b, 0x28, 0xd4, 0xc3, 0xbf, 0xc4, - 0xbf, 0x1d, 0x70, 0xb4, 0x73, 0x4d, 0xf3, 0x34, 0xfe, 0xf8, 0xa7, 0x75, 0xb4, 0x15, 0x4c, 0x65, - 0xfb, 0x9d, 0x80, 0x93, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x20, 0xf1, 0xa5, 0x1e, 0x6b, 0x02, - 0x00, 0x00, -} - -func (m *CrossChainValidator) 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 *CrossChainValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CrossChainValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.OptedOut { - i-- - if m.OptedOut { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Pubkey != nil { - { - size, err := m.Pubkey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConsumer(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Power != 0 { - i = encodeVarintConsumer(dAtA, i, uint64(m.Power)) - i-- - dAtA[i] = 0x10 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintConsumer(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SlashRecord) 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 *SlashRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SlashRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SendTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SendTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintConsumer(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x12 - if m.WaitingOnReply { - i-- - if m.WaitingOnReply { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintConsumer(dAtA []byte, offset int, v uint64) int { - offset -= sovConsumer(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CrossChainValidator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovConsumer(uint64(l)) - } - if m.Power != 0 { - n += 1 + sovConsumer(uint64(m.Power)) - } - if m.Pubkey != nil { - l = m.Pubkey.Size() - n += 1 + l + sovConsumer(uint64(l)) - } - if m.OptedOut { - n += 2 - } - return n -} - -func (m *SlashRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.WaitingOnReply { - n += 2 - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SendTime) - n += 1 + l + sovConsumer(uint64(l)) - return n -} - -func sovConsumer(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozConsumer(x uint64) (n int) { - return sovConsumer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *CrossChainValidator) 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 ErrIntOverflowConsumer - } - 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: CrossChainValidator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CrossChainValidator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsumer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConsumer - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConsumer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) - if m.Address == nil { - m.Address = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Power", wireType) - } - m.Power = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsumer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Power |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsumer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConsumer - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConsumer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pubkey == nil { - m.Pubkey = &types.Any{} - } - if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OptedOut", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsumer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.OptedOut = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipConsumer(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConsumer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SlashRecord) 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 ErrIntOverflowConsumer - } - 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: SlashRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SlashRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WaitingOnReply", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsumer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.WaitingOnReply = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SendTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsumer - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConsumer - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConsumer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SendTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConsumer(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConsumer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipConsumer(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConsumer - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConsumer - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConsumer - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthConsumer - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupConsumer - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthConsumer - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthConsumer = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowConsumer = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupConsumer = fmt.Errorf("proto: unexpected end of group") -) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index dbeac0d2de..40c5258880 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -325,8 +325,4 @@ message OptedInValidator { int64 power = 3; // public key used by the validator on the consumer bytes public_key = 4; - // custom commission rate the validator charges - // to delegator on the consumers, as a fraction - string commission_rate = 5; -} - +} \ No newline at end of file diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index fd0474d584..65bbf709f5 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -19,7 +19,6 @@ import ( consumerkeeper "github.com/cosmos/interchain-security/v4/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/v4/x/ccv/consumer/types" providerkeeper "github.com/cosmos/interchain-security/v4/x/ccv/provider/keeper" - "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" providertypes "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v4/x/ccv/types" ) @@ -957,17 +956,14 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { // check that no commission is set for the validator s.Require().Equal(val.Commission.Rate, math.LegacyZeroDec()) - // opt the validators in consumer with a custom commission of 100% - providerKeeper.SetOptedIn( + // set a custom commission of 100% + providerKeeper.SetConsumerCommissionRate( s.providerCtx(), chainID, - types.OptedInValidator{ - ProviderAddr: provAddr.Address, - BlockHeight: s.providerCtx().BlockHeight(), - PublicKey: v.PubKey.Bytes(), - CommissionRate: "1", - }, + provAddr, + sdk.OneDec(), ) + } for _, tc := range testCases { diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index 85fa570997..ed92101e32 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -151,14 +151,6 @@ func (k Keeper) AllocateTokensToConsumerValidators( return allocated } - // get opted-in validator commission rates for the consumer chain - valCommissions := map[string]math.LegacyDec{} - for _, v := range k.GetAllOptedIn(ctx, chainID) { - if v.CommissionRate != "" { - valCommissions[sdk.ConsAddress(v.ProviderAddr).String()] = math.LegacyMustNewDecFromStr(v.CommissionRate) - } - } - for _, vote := range bondedVotes { // TODO: should check if validator IsOptIn or continue here consAddr := sdk.ConsAddress(vote.Validator.Address) @@ -170,7 +162,7 @@ func (k Keeper) AllocateTokensToConsumerValidators( val := k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr).(stakingtypes.Validator) // check if the validator set a custom commission rate for the consumer chain - if cr, ok := valCommissions[consAddr.String()]; ok { + if cr, found := k.GetConsumerCommissionRate(ctx, chainID, types.NewProviderConsAddress(consAddr)); found { // set the validator commission rate val.Commission.CommissionRates.Rate = cr } diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index e6b1c589aa..c3f8a884dd 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1248,6 +1248,49 @@ func (k Keeper) SetToBeOptedIn( store.Set(types.ToBeOptedInKey(chainID, providerAddr), []byte{}) } +func (k Keeper) SetConsumerCommissionRate( + ctx sdk.Context, + chainID string, + providerAddr types.ProviderConsAddress, + commissionRate sdk.Dec, +) { + store := ctx.KVStore(k.storeKey) + bz, err := commissionRate.Marshal() + if err != nil { + panic(fmt.Errorf("consumer commission rate marshalling failed:%s", err)) + } + + store.Set(types.ConsumerCommissionRateKey(chainID, providerAddr), bz) +} + +func (k Keeper) GetConsumerCommissionRate( + ctx sdk.Context, + chainID string, + providerAddr types.ProviderConsAddress, +) (sdk.Dec, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ConsumerCommissionRateKey(chainID, providerAddr)) + if bz == nil { + return sdk.ZeroDec(), false + } + + cr := sdk.Dec{} + if err := cr.Unmarshal(bz); err != nil { + panic(fmt.Errorf("consumer commission rate unmarshalling failed:%s", err)) + } + + return cr, true +} + +func (k Keeper) DeleteConsumerCommissionRate( + ctx sdk.Context, + chainID string, + providerAddr types.ProviderConsAddress, +) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerCommissionRateKey(chainID, providerAddr)) +} + func (k Keeper) DeleteToBeOptedIn( ctx sdk.Context, chainID string, diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index f4398ac132..ed84cf4e14 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -689,11 +689,10 @@ func TestGetAllOptedIn(t *testing.T) { for _, expectedOptedInValidator := range expectedOptedInValidators { providerKeeper.SetOptedIn(ctx, "chainID", types.OptedInValidator{ - ProviderAddr: expectedOptedInValidator.ProviderAddr, - BlockHeight: expectedOptedInValidator.BlockHeight, - Power: expectedOptedInValidator.Power, - PublicKey: expectedOptedInValidator.PublicKey, - CommissionRate: "0.5", + ProviderAddr: expectedOptedInValidator.ProviderAddr, + BlockHeight: expectedOptedInValidator.BlockHeight, + Power: expectedOptedInValidator.Power, + PublicKey: expectedOptedInValidator.PublicKey, }) } @@ -719,10 +718,9 @@ func TestOptedIn(t *testing.T) { defer ctrl.Finish() optedInValidator := types.OptedInValidator{ProviderAddr: []byte("providerAddr"), - BlockHeight: 1, - Power: 2, - PublicKey: []byte{3}, - CommissionRate: "0.5", + BlockHeight: 1, + Power: 2, + PublicKey: []byte{3}, } require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderAddr))) diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index bf76e7d7c8..5322d98b58 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -1,7 +1,10 @@ package keeper import ( + "fmt" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" @@ -61,3 +64,43 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types return nil } + +func (k Keeper) HandleConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { + if !k.IsConsumerProposedOrRegistered(ctx, chainID) { + return errorsmod.Wrapf( + types.ErrUnknownConsumerChainId, + "unknown consumer chain, with id: %s", chainID) + } + + consAddr := providerAddr.ToSdkConsAddr() + if _, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerAddr.ToSdkConsAddr()); !found { + return errorsmod.Wrapf( + types.ErrNoValidatorProviderAddress, + "unknown validator with address %s", consAddr.String()) + } + + if !k.IsToBeOptedIn(ctx, chainID, providerAddr) && !k.IsOptedIn(ctx, chainID, providerAddr) { + return fmt.Errorf( + "validator with address: %s isn't opted-in for the consumer chain:%s", + consAddr.String(), + chainID, + ) + } + + // validate that the commission rate is in the range [0, 1] + if commissionRate.IsNegative() || commissionRate.GT(math.LegacyOneDec()) { + return errorsmod.Wrapf( + types.ErrInvalidConsumerCommissionRate, + "commission commission rate should be in the range [0, 1]", + ) + } + + k.SetConsumerCommissionRate( + ctx, + chainID, + providerAddr, + commissionRate, + ) + + return nil +} diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 6c19a7b396..271ea90329 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -24,4 +24,5 @@ var ( ErrInvalidConsumerClient = errorsmod.Register(ModuleName, 16, "ccv channel is not built on correct client") ErrDuplicateConsumerChain = errorsmod.Register(ModuleName, 17, "consumer chain already exists") ErrConsumerChainNotFound = errorsmod.Register(ModuleName, 18, "consumer chain not found") + ErrInvalidConsumerCommissionRate = errorsmod.Register(ModuleName, 19, "consumer commission rate is invalid") ) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 9fb9fc9caf..8439c4a3d8 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -164,6 +164,9 @@ const ( // it allocated to the consumer rewards pool ConsumerRewardsAllocationBytePrefix + // ConsumerCommissionRatePrefix is the byte prefix used when store a validator commission rate + ConsumerCommissionRatePrefix + // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO getAllKeyPrefixes() IN keys_test.go ) @@ -564,6 +567,12 @@ func ConsumerRewardsAllocationKey(chainID string) []byte { return append([]byte{ConsumerRewardsAllocationBytePrefix}, []byte(chainID)...) } +// ConsumerCommissionRateKey returns the key of consumer chain `chainID` and validator with `providerAddr` +func ConsumerCommissionRateKey(chainID string, providerAddr ProviderConsAddress) []byte { + prefix := ChainIdWithLenKey(ConsumerCommissionRatePrefix, chainID) + return append(prefix, providerAddr.ToSdkConsAddr().Bytes()...) +} + // // End of generic helpers section // diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 9d797011b6..6bd05f2759 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -61,6 +61,7 @@ func getAllKeyPrefixes() []byte { providertypes.ToBeOptedInBytePrefix, providertypes.ToBeOptedOutBytePrefix, providertypes.ConsumerRewardsAllocationBytePrefix, + providertypes.ConsumerCommissionRatePrefix, } } diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 600a035cb3..ba54bfafe4 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -6,6 +6,7 @@ package types import ( fmt "fmt" crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types2 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -1450,9 +1451,6 @@ type OptedInValidator struct { Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` // public key used by the validator on the consumer PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // custom commission rate the validator charges - // to delegator on the consumers, as a fraction - CommissionRate string `protobuf:"bytes,5,opt,name=commission_rate,json=commissionRate,proto3" json:"commission_rate,omitempty"` } func (m *OptedInValidator) Reset() { *m = OptedInValidator{} } @@ -1516,13 +1514,6 @@ func (m *OptedInValidator) GetPublicKey() []byte { return nil } -func (m *OptedInValidator) GetCommissionRate() string { - if m != nil { - return m.CommissionRate - } - return "" -} - func init() { proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") @@ -1555,124 +1546,123 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1858 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4d, 0x73, 0xdc, 0xc6, - 0xd1, 0x26, 0xb8, 0xcb, 0x8f, 0xed, 0xe5, 0x27, 0x48, 0x5b, 0x4b, 0xbd, 0x7c, 0x97, 0x14, 0x1c, - 0xdb, 0x4c, 0x54, 0x02, 0x42, 0x3a, 0xa9, 0x52, 0xa9, 0xe2, 0x72, 0x91, 0x4b, 0xd9, 0xa2, 0x18, - 0x4b, 0x34, 0xc8, 0x50, 0x95, 0xe4, 0x80, 0x9a, 0x1d, 0x8c, 0x76, 0xa7, 0x08, 0x60, 0xa0, 0x99, - 0x59, 0xc8, 0x7b, 0xc9, 0x39, 0x97, 0x54, 0x39, 0x37, 0x57, 0x2e, 0x71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3f, 0xfc, 0xe3, 0xcf, 0xdf, 0x33, 0xdc, 0xdc, 0x8d, 0xf5, 0x17, 0x03, 0x56, 0x1e, - 0xc7, 0x92, 0xf8, 0x47, 0x51, 0x51, 0xbb, 0xc9, 0x9a, 0xfb, 0x16, 0x2c, 0xe8, 0x8f, 0xb7, 0xfc, - 0x27, 0x80, 0x69, 0xdd, 0xa7, 0x4d, 0x2d, 0xcb, 0x3e, 0xef, 0xaf, 0xec, 0x61, 0x35, 0x3f, 0x62, - 0xdd, 0x40, 0xba, 0xcb, 0xd2, 0x8b, 0x67, 0x23, 0xce, 0x5b, 0xca, 0x7c, 0x17, 0x96, 0x31, 0x0b, - 0xf3, 0x2f, 0x36, 0x8e, 0x24, 0xd1, 0x17, 0xa5, 0x86, 0xbb, 0x54, 0x8a, 0x5d, 0x24, 0xc9, 0xc1, - 0x93, 0x2f, 0x5f, 0xb4, 0x8d, 0xaf, 0x5e, 0xb4, 0x8d, 0xbf, 0xbf, 0x68, 0x1b, 0x9f, 0xbd, 0x6c, - 0x4f, 0x7d, 0xf5, 0xb2, 0x3d, 0xf5, 0xb7, 0x97, 0xed, 0xa9, 0x9f, 0xbd, 0x7f, 0x39, 0x1f, 0x65, - 0xd9, 0xee, 0x14, 0x3f, 0x35, 0x25, 0x3f, 0x70, 0x3e, 0x1d, 0xfd, 0x21, 0x4b, 0xa7, 0xaa, 0x3b, - 0xab, 0x09, 0xf6, 0xbd, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0xee, 0xa2, 0xc2, 0xb4, 0xf9, 0x12, - 0x00, 0x00, + // 1844 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x73, 0x1c, 0x47, + 0x15, 0xd7, 0x68, 0x57, 0x1f, 0xfb, 0x56, 0x9f, 0x23, 0x25, 0x5e, 0x19, 0xb1, 0x92, 0x27, 0x24, + 0x08, 0x5c,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0xec, 0x09, 0xe2, 0xa8, 0x2f, 0xec, 0x33, 0x58, 0x96, 0xa4, 0x1f, 0x87, 0x48, + 0x12, 0x3f, 0x65, 0x78, 0xb3, 0xd3, 0xdb, 0x9a, 0xf9, 0xcb, 0x73, 0xd4, 0x2d, 0x4d, 0xce, 0x64, + 0xd7, 0x6d, 0x6b, 0xe9, 0xa9, 0x44, 0x92, 0x78, 0x4b, 0x19, 0x46, 0x2a, 0xb4, 0xef, 0x42, 0x43, + 0xf2, 0x81, 0x90, 0x05, 0xf7, 0x16, 0xa4, 0x93, 0xd6, 0xf2, 0xcd, 0x6c, 0x3d, 0xa5, 0xab, 0x9c, + 0x6c, 0xae, 0xa6, 0xd9, 0xca, 0x37, 0xa1, 0xd9, 0x53, 0x58, 0x53, 0x33, 0x6a, 0x1c, 0xb3, 0x3a, + 0x39, 0xe6, 0xaa, 0xb2, 0x1f, 0x05, 0xfd, 0x18, 0xec, 0x44, 0xe0, 0x71, 0xcc, 0x99, 0xd7, 0x88, + 0x33, 0x11, 0x78, 0x14, 0x32, 0x80, 0x4d, 0xa1, 0x9a, 0xcf, 0xef, 0x13, 0xa9, 0x49, 0x3b, 0x0e, + 0x49, 0x44, 0x45, 0x2f, 0x03, 0x9f, 0x9d, 0x1c, 0x7c, 0x43, 0x03, 0x7d, 0xa4, 0x70, 0xbc, 0x0c, + 0xc6, 0x78, 0x69, 0x43, 0xf3, 0x6a, 0x2f, 0x79, 0x81, 0xe6, 0x74, 0x81, 0xbe, 0x75, 0x05, 0x44, + 0x5e, 0x25, 0x01, 0xef, 0x94, 0x86, 0x8b, 0x3a, 0xd5, 0xbe, 0x3e, 0x50, 0x3e, 0x27, 0x5d, 0xc5, + 0xc0, 0x28, 0x9d, 0x33, 0x84, 0xe4, 0x03, 0xd2, 0xb0, 0x87, 0xba, 0x1d, 0xe5, 0xcc, 0xd1, 0x66, + 0x34, 0x32, 0xb7, 0x08, 0xa7, 0x98, 0x41, 0x39, 0x47, 0x78, 0x25, 0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x3d, 0xd8, 0x28, 0x80, 0x46, 0xc9, 0x35, 0x45, 0xac, 0x79, 0x37, 0x72, 0x85, 0x11, 0x7e, + 0x15, 0xce, 0x63, 0x58, 0x3f, 0x2a, 0x8e, 0x72, 0x4e, 0xdd, 0x23, 0x3b, 0xb4, 0x46, 0x67, 0xf4, + 0x26, 0xd4, 0xf2, 0x9f, 0x28, 0x7a, 0xf7, 0x55, 0xaf, 0x10, 0x38, 0x7d, 0x58, 0x39, 0x17, 0xf8, + 0x94, 0x44, 0x41, 0x01, 0x76, 0x4d, 0x02, 0x0e, 0xc6, 0x81, 0x26, 0xbe, 0xd4, 0x16, 0xee, 0x18, + 0x6c, 0x9c, 0xa3, 0x90, 0x06, 0x48, 0x32, 0x7e, 0x4a, 0x64, 0x3a, 0x56, 0x4f, 0x10, 0xbe, 0x20, + 0x52, 0xd8, 0x1e, 0x54, 0x43, 0x2a, 0xa4, 0xe9, 0xac, 0xbb, 0xd7, 0x76, 0x56, 0xb2, 0xeb, 0x5e, + 0x07, 0x72, 0x88, 0x24, 0x32, 0x27, 0x52, 0x63, 0x39, 0xdf, 0x85, 0xb5, 0x8f, 0x90, 0x1c, 0x70, + 0x12, 0x8c, 0xd4, 0x78, 0x05, 0x2a, 0xaa, 0x7e, 0x96, 0xae, 0x9f, 0x7a, 0x54, 0x53, 0xbe, 0x71, + 0xff, 0x93, 0x98, 0x71, 0x49, 0x82, 0x4b, 0x19, 0x79, 0x45, 0x7a, 0x2f, 0x60, 0x4d, 0x25, 0x4b, + 0x90, 0x28, 0xf0, 0xf3, 0x7d, 0xa6, 0x75, 0xac, 0xef, 0xfd, 0x68, 0xa2, 0xd3, 0x31, 0xee, 0xce, + 0x6c, 0x60, 0x35, 0x19, 0x93, 0x0b, 0xe7, 0xb7, 0x16, 0x34, 0x8e, 0xc9, 0x70, 0x5f, 0x08, 0xda, + 0x8d, 0xfa, 0x24, 0x92, 0x8a, 0xd9, 0x10, 0x26, 0xea, 0xd1, 0x7e, 0x0b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x72, 0xf3, 0xca, 0x51, 0x78, 0x48, 0xb0, 0x9e, 0x86, 0x77, 0x55, 0xeb, 0xfe, 0xf9, 0xeb, + 0xad, 0xdb, 0x5d, 0x2a, 0x7b, 0x83, 0x8e, 0x8b, 0x59, 0xdf, 0x7c, 0x2b, 0x30, 0xff, 0xee, 0x88, + 0xe0, 0xa2, 0x25, 0x87, 0x31, 0x11, 0x99, 0x8d, 0xf8, 0xd3, 0x3f, 0xff, 0xfa, 0x7d, 0xcb, 0xcb, + 0xdc, 0x38, 0xbf, 0xb1, 0x60, 0xe5, 0x71, 0x2c, 0x49, 0x70, 0x14, 0xe5, 0xb5, 0x9b, 0xac, 0xb9, + 0x6f, 0xc1, 0x82, 0xfe, 0xf1, 0x96, 0x7d, 0x02, 0x98, 0xd6, 0x7d, 0x5a, 0xd7, 0x32, 0xf3, 0xf3, + 0xfe, 0xca, 0x1e, 0x56, 0xf3, 0x23, 0xd6, 0x0d, 0xa4, 0xbb, 0x2c, 0xbd, 0x78, 0xd6, 0xe2, 0xac, + 0xa5, 0x0e, 0x9e, 0x7c, 0xf1, 0xa2, 0x69, 0x7d, 0xf9, 0xa2, 0x69, 0xfd, 0xe3, 0x45, 0xd3, 0xfa, + 0xf4, 0x65, 0x73, 0xea, 0xcb, 0x97, 0xcd, 0xa9, 0xbf, 0xbf, 0x6c, 0x4e, 0xfd, 0xfc, 0xbd, 0xcb, + 0xdb, 0x2c, 0xaa, 0x71, 0x27, 0xff, 0xb8, 0x94, 0xfc, 0xb0, 0xf5, 0xc9, 0xe8, 0xa7, 0x2b, 0x9d, + 0x81, 0xce, 0xac, 0xe6, 0xcd, 0x77, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x0a, 0x98, 0x10, + 0xeb, 0x12, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -2798,13 +2788,6 @@ func (m *OptedInValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.CommissionRate) > 0 { - i -= len(m.CommissionRate) - copy(dAtA[i:], m.CommissionRate) - i = encodeVarintProvider(dAtA, i, uint64(len(m.CommissionRate))) - i-- - dAtA[i] = 0x2a - } if len(m.PublicKey) > 0 { i -= len(m.PublicKey) copy(dAtA[i:], m.PublicKey) @@ -3338,10 +3321,6 @@ func (m *OptedInValidator) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } - l = len(m.CommissionRate) - if l > 0 { - n += 1 + l + sovProvider(uint64(l)) - } return n } @@ -6857,38 +6836,6 @@ func (m *OptedInValidator) Unmarshal(dAtA []byte) error { m.PublicKey = []byte{} } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommissionRate", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - 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 ErrInvalidLengthProvider - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProvider - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CommissionRate = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipProvider(dAtA[iNdEx:]) From 4e5f44b9708b5e9db15676d35aec58bdb41bcabd Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 27 Feb 2024 10:12:07 +0100 Subject: [PATCH 04/15] add msg handling --- .../ccv/provider/v1/tx.proto | 23 +- x/ccv/provider/ibc_middleware.go | 2 +- x/ccv/provider/keeper/keeper.go | 4 + x/ccv/provider/keeper/msg_server.go | 27 + x/ccv/provider/keeper/partial_set_security.go | 28 +- .../keeper/partial_set_security_test.go | 25 + x/ccv/provider/types/msg.go | 44 ++ x/ccv/provider/types/provider.pb.go | 228 +++++---- x/ccv/provider/types/tx.pb.go | 472 ++++++++++++++++-- 9 files changed, 665 insertions(+), 188 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 51003bdf05..a1ffdd59e4 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -17,6 +17,7 @@ service Msg { rpc SubmitConsumerDoubleVoting(MsgSubmitConsumerDoubleVoting) returns (MsgSubmitConsumerDoubleVotingResponse); rpc OptIn(MsgOptIn) returns (MsgOptInResponse); rpc OptOut(MsgOptOut) returns (MsgOptOutResponse); + rpc SetConsumerCommissionRate(MsgSetConsumerCommissionRate) returns (MsgSetConsumerCommissionRateResponse); } message MsgAssignConsumerKey { @@ -88,4 +89,24 @@ message MsgOptOut { string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; } -message MsgOptOutResponse {} \ No newline at end of file +message MsgOptOutResponse {} + +// MsgSetConsumerCommissionRate allows validators to set +// a per-consumer chain commission rate +message MsgSetConsumerCommissionRate { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + // The chain id of the consumer chain to assign a consensus public key to + string chain_id = 1; + // The validator on the provider + string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + // The rate to charge delegators on the consumer chain + string rate = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + + +message MsgSetConsumerCommissionRateResponse {} \ No newline at end of file diff --git a/x/ccv/provider/ibc_middleware.go b/x/ccv/provider/ibc_middleware.go index 3b14d07202..1c1b1ce824 100644 --- a/x/ccv/provider/ibc_middleware.go +++ b/x/ccv/provider/ibc_middleware.go @@ -129,7 +129,7 @@ func (im IBCMiddleware) OnRecvPacket( var data ibctransfertypes.FungibleTokenPacketData _ = types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data) - // check that the recipient is the consumer reward's pool address + // check if the recipient is the consumer reward's pool address receiver, _ := sdk.AccAddressFromBech32(data.Receiver) if receiver.String() != im.keeper.GetConsumerRewardsPoolAddressStr(ctx) { return ack diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index c3f8a884dd..219cb87ba6 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1248,6 +1248,8 @@ func (k Keeper) SetToBeOptedIn( store.Set(types.ToBeOptedInKey(chainID, providerAddr), []byte{}) } +// SetConsumerCommissionRate sets a commission rate for the given +// consumer chain and validator address func (k Keeper) SetConsumerCommissionRate( ctx sdk.Context, chainID string, @@ -1263,6 +1265,8 @@ func (k Keeper) SetConsumerCommissionRate( store.Set(types.ConsumerCommissionRateKey(chainID, providerAddr), bz) } +// GetConsumerCommissionRate returns the per-consumer commission rate set +// for the given validator address func (k Keeper) GetConsumerCommissionRate( ctx sdk.Context, chainID string, diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 4863cd0d66..836abe89cb 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + errorsmod "cosmossdk.io/errors" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -195,3 +196,29 @@ func (k msgServer) OptOut(goCtx context.Context, msg *types.MsgOptOut) (*types.M return &types.MsgOptOutResponse{}, nil } + +func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.MsgSetConsumerCommissionRate) (*types.MsgSetConsumerCommissionRateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + providerValidatorAddr, err := sdk.ValAddressFromBech32(msg.ProviderAddr) + if err != nil { + return nil, err + } + + // validator must already be registered + validator, found := k.stakingKeeper.GetValidator(ctx, providerValidatorAddr) + if !found { + return nil, stakingtypes.ErrNoValidatorFound + } + + consAddr, err := validator.GetConsAddr() + if err != nil { + return nil, err + } + + if err := k.HandleSetConsumerCommissionRate(ctx, msg.ChainId, types.NewProviderConsAddress(consAddr), msg.Rate); err != nil { + return nil, err + } + + return &types.MsgSetConsumerCommissionRateResponse{}, nil +} diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 5322d98b58..3ab78836c6 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -1,10 +1,7 @@ package keeper import ( - "fmt" - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" @@ -65,36 +62,13 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types return nil } -func (k Keeper) HandleConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { +func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { if !k.IsConsumerProposedOrRegistered(ctx, chainID) { return errorsmod.Wrapf( types.ErrUnknownConsumerChainId, "unknown consumer chain, with id: %s", chainID) } - consAddr := providerAddr.ToSdkConsAddr() - if _, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerAddr.ToSdkConsAddr()); !found { - return errorsmod.Wrapf( - types.ErrNoValidatorProviderAddress, - "unknown validator with address %s", consAddr.String()) - } - - if !k.IsToBeOptedIn(ctx, chainID, providerAddr) && !k.IsOptedIn(ctx, chainID, providerAddr) { - return fmt.Errorf( - "validator with address: %s isn't opted-in for the consumer chain:%s", - consAddr.String(), - chainID, - ) - } - - // validate that the commission rate is in the range [0, 1] - if commissionRate.IsNegative() || commissionRate.GT(math.LegacyOneDec()) { - return errorsmod.Wrapf( - types.ErrInvalidConsumerCommissionRate, - "commission commission rate should be in the range [0, 1]", - ) - } - k.SetConsumerCommissionRate( ctx, chainID, diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index 1af5f58c7c..a6b2ec45e7 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -112,3 +112,28 @@ func TestHandleOptOut(t *testing.T) { require.NoError(t, err) require.False(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) } + +func TestHandleSetConsumerCommissionRate(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) + + // trying to set a commission rate to a unknown consumer chain + require.Error(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, "unknownChainID", providerAddr, sdk.ZeroDec())) + + // setup a pending consumer chain + chainID := "pendingChainID" + providerKeeper.SetPendingConsumerAdditionProp(ctx, &types.ConsumerAdditionProposal{ChainId: chainID}) + + // check that there's no commission rate set for the validator yet + _, found := providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) + require.False(t, found) + + require.NoError(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, chainID, providerAddr, sdk.OneDec())) + + // check that the commission rate is now set + cr, found := providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) + require.Equal(t, sdk.OneDec(), cr) + require.True(t, found) +} diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 20aae43f6c..1a8d6fa145 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -24,6 +24,7 @@ const ( TypeMsgSubmitConsumerDoubleVoting = "submit_consumer_double_vote" TypeMsgOptIn = "opt_in" TypeMsgOptOut = "opt_out" + TypeMsgSetConsumerCommissionRate = "set_consumer_commission_rate" ) var ( @@ -32,6 +33,7 @@ var ( _ sdk.Msg = &MsgSubmitConsumerDoubleVoting{} _ sdk.Msg = &MsgOptIn{} _ sdk.Msg = &MsgOptOut{} + _ sdk.Msg = &MsgSetConsumerCommissionRate{} ) // NewMsgAssignConsumerKey creates a new MsgAssignConsumerKey instance. @@ -316,3 +318,45 @@ func (msg MsgOptOut) ValidateBasic() error { func (msg MsgOptOut) Type() string { return TypeMsgOptOut } + +func (msg MsgSetConsumerCommissionRate) Route() string { + return RouterKey +} + +func (msg MsgSetConsumerCommissionRate) Type() string { + return TypeMsgSetConsumerCommissionRate +} + +func (msg MsgSetConsumerCommissionRate) ValidateBasic() error { + if strings.TrimSpace(msg.ChainId) == "" { + return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot be blank") + } + + if 128 < len(msg.ChainId) { + return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot exceed 128 length") + } + _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) + if err != nil { + return ErrInvalidProviderAddress + } + + if msg.Rate.IsNegative() || msg.Rate.GT(sdk.OneDec()) { + return errorsmod.Wrapf(ErrInvalidConsumerCommissionRate, "consumer commission rate should be in the range [0, 1]") + } + + return nil +} + +func (msg MsgSetConsumerCommissionRate) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.ProviderAddr) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } + return []sdk.AccAddress{valAddr.Bytes()} +} + +func (msg MsgSetConsumerCommissionRate) GetSignBytes() []byte { + bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index ba54bfafe4..6e1a361df9 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -6,7 +6,6 @@ package types import ( fmt "fmt" crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types2 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -1546,123 +1545,122 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1844 bytes of a gzipped FileDescriptorProto + // 1833 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x73, 0x1c, 0x47, - 0x15, 0xd7, 0x68, 0x57, 0x1f, 0xfb, 0x56, 0x9f, 0x23, 0x25, 0x5e, 0x19, 0xb1, 0x92, 0x27, 0x24, - 0x08, 0x5c, 0x9e, 0x45, 0x0a, 0x54, 0xb9, 0x5c, 0xa4, 0x52, 0xd2, 0xca, 0x89, 0x65, 0x11, 0x5b, + 0x15, 0xd7, 0x68, 0x57, 0x1f, 0xfb, 0x56, 0x9f, 0x23, 0x25, 0x1e, 0x19, 0xb1, 0x92, 0x27, 0x24, + 0x08, 0x5c, 0x9e, 0x41, 0x0a, 0x54, 0xb9, 0x5c, 0xa4, 0x52, 0xd2, 0xca, 0x89, 0x65, 0x11, 0x5b, 0x19, 0x09, 0xb9, 0x80, 0xc3, 0x54, 0x6f, 0x4f, 0x7b, 0xb7, 0x4b, 0xb3, 0xd3, 0xe3, 0xee, 0xde, 0x71, 0xf6, 0xc2, 0x99, 0x0b, 0x45, 0xb8, 0xa5, 0xb8, 0x10, 0x38, 0x51, 0x5c, 0xe0, 0xca, 0x7f, - 0x90, 0x63, 0x8e, 0x9c, 0x12, 0xca, 0x3e, 0x70, 0xe0, 0xca, 0x1f, 0x40, 0x75, 0x4f, 0xcf, 0xc7, - 0xae, 0x24, 0xb3, 0xae, 0xc0, 0x45, 0x9a, 0x79, 0xfd, 0xde, 0xef, 0xbd, 0x7e, 0xef, 0xf5, 0xef, - 0xf5, 0x0e, 0xec, 0xd1, 0x48, 0x12, 0x8e, 0x7b, 0x88, 0x46, 0xbe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76, 0x56, 0xb2, 0xeb, 0x5e, - 0x07, 0x72, 0x88, 0x24, 0x32, 0x27, 0x52, 0x63, 0x39, 0xdf, 0x85, 0xb5, 0x8f, 0x90, 0x1c, 0x70, - 0x12, 0x8c, 0xd4, 0x78, 0x05, 0x2a, 0xaa, 0x7e, 0x96, 0xae, 0x9f, 0x7a, 0x54, 0x53, 0xbe, 0x71, - 0xff, 0x93, 0x98, 0x71, 0x49, 0x82, 0x4b, 0x19, 0x79, 0x45, 0x7a, 0x2f, 0x60, 0x4d, 0x25, 0x4b, - 0x90, 0x28, 0xf0, 0xf3, 0x7d, 0xa6, 0x75, 0xac, 0xef, 0xfd, 0x68, 0xa2, 0xd3, 0x31, 0xee, 0xce, - 0x6c, 0x60, 0x35, 0x19, 0x93, 0x0b, 0xe7, 0xb7, 0x16, 0x34, 0x8e, 0xc9, 0x70, 0x5f, 0x08, 0xda, - 0x8d, 0xfa, 0x24, 0x92, 0x8a, 0xd9, 0x10, 0x26, 0xea, 0xd1, 0x7e, 0x0b, 0x16, 0xf3, 0x49, 0xaa, - 0x07, 0xa8, 0xa5, 0x07, 0xe8, 0x42, 0x26, 0x54, 0x07, 0xcc, 0xbe, 0x07, 0x10, 0x73, 0x92, 0xf8, - 0xd8, 0xbf, 0x20, 0x43, 0x53, 0xc5, 0xcd, 0xf2, 0x60, 0x4c, 0x7f, 0x40, 0xba, 0x27, 0x83, 0x4e, - 0x48, 0xf1, 0x31, 0x19, 0x7a, 0xf3, 0x4a, 0xbf, 0x7d, 0x4c, 0x86, 0xea, 0xa6, 0x13, 0xb3, 0xe7, - 0x84, 0xeb, 0x69, 0x56, 0xf1, 0xd2, 0x17, 0xe7, 0x77, 0x16, 0xdc, 0xc8, 0xcb, 0x91, 0xb5, 0xeb, - 0xc9, 0xa0, 0xa3, 0x2c, 0x5e, 0x91, 0xb7, 0x4b, 0xd1, 0x4e, 0x5f, 0x11, 0xed, 0xfb, 0xb0, 0x90, - 0x1f, 0x10, 0x15, 0x6f,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0x49, 0xfb, 0x44, 0x48, 0xd4, + 0x8f, 0x33, 0x86, 0xd6, 0x38, 0x43, 0x30, 0xe0, 0x48, 0x52, 0x16, 0xe5, 0x00, 0xb4, 0x83, 0x5d, + 0xcc, 0x38, 0x71, 0x71, 0x48, 0x49, 0x24, 0x95, 0xd6, 0xf4, 0x29, 0x63, 0x70, 0x15, 0x43, 0x48, + 0xbb, 0x3d, 0x99, 0x92, 0x85, 0x2b, 0x49, 0x14, 0x10, 0xde, 0xa7, 0x29, 0x73, 0xf9, 0x96, 0x09, + 0x6c, 0x56, 0xce, 0x31, 0x1f, 0xc6, 0x92, 0xb9, 0x17, 0x64, 0x28, 0xb2, 0xd3, 0x77, 0x30, 0x13, + 0x7d, 0x26, 0x5c, 0xa2, 0xfc, 0x8f, 0x30, 0x71, 0x93, 0xdd, 0x0e, 0x91, 0x68, 0xb7, 0x20, 0xe4, + 0x76, 0x67, 0x7c, 0x1d, 0x24, 0x4a, 0x1e, 0xcc, 0x68, 0x6e, 0xf7, 0x2a, 0xea, 0xd3, 0x88, 0xb9, + 0xfa, 0x6f, 0x4a, 0xb2, 0xff, 0x3d, 0x0b, 0x56, 0x9b, 0x45, 0x62, 0xd0, 0x27, 0x7c, 0x3f, 0x08, + 0xa8, 0xf2, 0xf2, 0x84, 0xb3, 0x98, 0x09, 0x14, 0x9a, 0xeb, 0x30, 0x23, 0xa9, 0x0c, 0x89, 0x65, + 0x6c, 0x1b, 0x3b, 0x0d, 0x2f, 0x7d, 0x31, 0xb7, 0xa1, 0x19, 0x10, 0x81, 0x39, 0x8d, 0x15, 0xb3, + 0x35, 0xad, 0xcf, 0xaa, 0x24, 0x73, 0x03, 0xe6, 0xd3, 0xd4, 0xd0, 0xc0, 0xaa, 0xe9, 0xe3, 0x39, + 0xfd, 0x7e, 0x14, 0x98, 0x1f, 0xc2, 0x12, 0x8d, 0xa8, 0xa4, 0x28, 0xf4, 0x7b, 0x44, 0x05, 0xc8, + 0xaa, 0x6f, 0x1b, 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ad, 0x01, 0xd6, 0x31, 0x19, + 0xee, 0x0b, 0x41, 0xbb, 0x51, 0x9f, 0x44, 0x52, 0x4d, 0x36, 0x84, 0x89, 0x7a, 0x34, 0xdf, 0x82, + 0xc5, 0x62, 0x93, 0xea, 0x05, 0x6a, 0xe8, 0x05, 0xba, 0x90, 0x13, 0x55, 0x83, 0x99, 0xf7, 0x00, + 0x62, 0x4e, 0x12, 0x1f, 0xfb, 0x17, 0x64, 0x98, 0x65, 0x71, 0xb3, 0xba, 0x18, 0xd3, 0x5f, 0x89, + 0xce, 0xc9, 0xa0, 0x13, 0x52, 0x7c, 0x4c, 0x86, 0xde, 0xbc, 0xe2, 0x6f, 0x1f, 0x93, 0xa1, 0xba, + 0xe9, 0xc4, 0xec, 0x39, 0xe1, 0x7a, 0x9b, 0xd5, 0xbc, 0xf4, 0xc5, 0xfe, 0x9d, 0x01, 0x37, 0x8a, + 0x74, 0xe4, 0xe5, 0x7a, 0x32, 0xe8, 0x28, 0x89, 0x57, 0xc4, 0xed, 0x92, 0xb5, 0xd3, 0x57, 0x58, + 0xfb, 0x3e, 0x2c, 0x14, 0x0d, 0xa2, 0xec, 0xad, 0x4d, 0x60, 0x6f, 0x33, 0x97, 0x38, 0x26, 0x43, + 0xfb, 0x97, 0x15, 0xdb, 0x0e, 0x86, 0x95, 0xd9, 0xc7, 0xff, 0x8b, 0x6d, 0x85, 0xda, 0xaa, 0x6d, + 0xb8, 0x2a, 0x7f, 0xc9, 0x81, 0xda, 0x65, 0x07, 0xec, 0x3f, 0x18, 0xb0, 0x5e, 0xd5, 0x2a, 0xce, + 0xd8, 0x09, 0x1f, 0x44, 0xe4, 0x55, 0xda, 0xcb, 0xf6, 0x9b, 0xae, 0xb6, 0xdf, 0x13, 0x58, 0x1a, + 0x31, 0x4a, 0x64, 0xd1, 0xf8, 0xc1, 0x44, 0x35, 0x56, 0x99, 0xae, 0xde, 0x62, 0xd5, 0x0f, 0x61, + 0xff, 0xda, 0x28, 0xd7, 0x4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*ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 647f5f49dc..9c4cf5c7a6 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -9,6 +9,7 @@ import ( types "github.com/cometbft/cometbft/proto/tendermint/types" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/codec/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -426,6 +427,86 @@ func (m *MsgOptOutResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgOptOutResponse proto.InternalMessageInfo +// MsgSetConsumerCommissionRate allows validators to set +// a per-consumer chain commission rate +type MsgSetConsumerCommissionRate struct { + // The chain id of the consumer chain to assign a consensus public key to + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The validator address on the provider + ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` + // The rate to charge delegators on the consumer chain + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` +} + +func (m *MsgSetConsumerCommissionRate) Reset() { *m = MsgSetConsumerCommissionRate{} } +func (m *MsgSetConsumerCommissionRate) String() string { return proto.CompactTextString(m) } +func (*MsgSetConsumerCommissionRate) ProtoMessage() {} +func (*MsgSetConsumerCommissionRate) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{10} +} +func (m *MsgSetConsumerCommissionRate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetConsumerCommissionRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetConsumerCommissionRate.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 *MsgSetConsumerCommissionRate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetConsumerCommissionRate.Merge(m, src) +} +func (m *MsgSetConsumerCommissionRate) XXX_Size() int { + return m.Size() +} +func (m *MsgSetConsumerCommissionRate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetConsumerCommissionRate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetConsumerCommissionRate proto.InternalMessageInfo + +type MsgSetConsumerCommissionRateResponse struct { +} + +func (m *MsgSetConsumerCommissionRateResponse) Reset() { *m = MsgSetConsumerCommissionRateResponse{} } +func (m *MsgSetConsumerCommissionRateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetConsumerCommissionRateResponse) ProtoMessage() {} +func (*MsgSetConsumerCommissionRateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{11} +} +func (m *MsgSetConsumerCommissionRateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetConsumerCommissionRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetConsumerCommissionRateResponse.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 *MsgSetConsumerCommissionRateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetConsumerCommissionRateResponse.Merge(m, src) +} +func (m *MsgSetConsumerCommissionRateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetConsumerCommissionRateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetConsumerCommissionRateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetConsumerCommissionRateResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") proto.RegisterType((*MsgAssignConsumerKeyResponse)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKeyResponse") @@ -437,6 +518,8 @@ func init() { proto.RegisterType((*MsgOptInResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptInResponse") proto.RegisterType((*MsgOptOut)(nil), "interchain_security.ccv.provider.v1.MsgOptOut") proto.RegisterType((*MsgOptOutResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptOutResponse") + proto.RegisterType((*MsgSetConsumerCommissionRate)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRate") + proto.RegisterType((*MsgSetConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRateResponse") } func init() { @@ -444,50 +527,55 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 683 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4d, 0x4f, 0xd4, 0x40, - 0x18, 0xde, 0x42, 0x40, 0x18, 0xd0, 0x48, 0x85, 0x00, 0x1b, 0xec, 0xea, 0x1a, 0xc5, 0x03, 0xcc, - 0x04, 0xfc, 0x8a, 0x24, 0x1e, 0x58, 0x31, 0x11, 0xcd, 0x06, 0xb3, 0x26, 0x98, 0x78, 0xb0, 0x69, - 0xa7, 0x43, 0x77, 0x42, 0x3b, 0xd3, 0xcc, 0x4c, 0x1b, 0xf6, 0x1f, 0x90, 0x78, 0xd1, 0x93, 0xf1, - 0xc6, 0x0f, 0xf0, 0x87, 0x78, 0xe4, 0xc8, 0xc9, 0x18, 0xb8, 0x78, 0xf6, 0x17, 0x98, 0x9d, 0x7e, - 0x6c, 0x89, 0x2b, 0x5f, 0xc6, 0x78, 0xeb, 0xbc, 0xef,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0xc8, 0xaa, 0xbc, 0x7d, 0xe2, - 0x53, 0xd5, 0x8e, 0x5d, 0x88, 0x79, 0x98, 0xbd, 0xa7, 0xa8, 0x27, 0xb1, 0x58, 0x3c, 0xe6, 0xc9, - 0x7d, 0xb4, 0x73, 0xfc, 0x45, 0xd7, 0xb7, 0xa2, 0x3b, 0xac, 0xdf, 0xc3, 0x7b, 0xbf, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x3b, 0x47, 0x43, 0x85, 0x02, 0x08, 0x00, 0x00, + // 763 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x4e, 0x14, 0x4b, + 0x14, 0x9e, 0x86, 0x0b, 0x17, 0x0a, 0xee, 0xcd, 0xa5, 0x2f, 0x04, 0x98, 0xe0, 0x8c, 0x8e, 0x0a, + 0x2e, 0x98, 0xee, 0x80, 0x7f, 0x91, 0xe8, 0x82, 0x01, 0x13, 0xd1, 0x4c, 0x20, 0x4d, 0x82, 0x89, + 0x0b, 0x3b, 0xdd, 0xd5, 0x87, 0x9e, 0x0a, 0xd3, 0x55, 0x93, 0xae, 0xea, 0x0e, 0xf3, 0x06, 0x24, + 0x6e, 0x74, 0x65, 0xdc, 0xf1, 0x00, 0x2e, 0x7d, 0x08, 0x56, 0x86, 0xb8, 0x22, 0x2e, 0x88, 0x81, + 0x8d, 0x6b, 0x9f, 0xc0, 0x4c, 0xf5, 0xcf, 0x34, 0x61, 0x1c, 0x7e, 0x0c, 0x71, 0x35, 0x53, 0xe7, + 0x7c, 0x75, 0xbe, 0xef, 0x3b, 0x5d, 0x75, 0x52, 0x68, 0x96, 0x50, 0x01, 0x3e, 0xae, 0x59, 0x84, + 0x9a, 0x1c, 0x70, 0xe0, 0x13, 0xd1, 0xd4, 0x31, 0x0e, 0xf5, 0x86, 0xcf, 0x42, 0xe2, 0x80, 0xaf, + 0x87, 0x73, 0xba, 0xd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, 0x98, 0xfb, 0xbe, 0x5b, 0xcc, 0x95, 0x0a, + 0x68, 0xaa, 0x93, 0x30, 0x03, 0x78, 0x83, 0x51, 0x0e, 0xa5, 0x0f, 0x0a, 0xba, 0x56, 0xe5, 0xee, + 0x7a, 0x60, 0x7b, 0x44, 0x24, 0x80, 0x2a, 0xe1, 0x36, 0xd4, 0xac, 0x90, 0xb0, 0xc0, 0x57, 0xa7, + 0xd0, 0x20, 0x97, 0x59, 0x01, 0x7e, 0xec, 0xa1, 0x1d, 0x50, 0xd7, 0xd0, 0xb0, 0x97, 0x41, 0x4b, + 0x13, 0x43, 0xf3, 0xb3, 0x1a, 0xb1, 0xb1, 0x96, 0x6d, 0xb1, 0x96, 0x69, 0x6a, 0x38, 0xa7, 0x65, + 0x19, 0x8c, 0x13, 0x15, 0x32, 0xda, 0x67, 0xd0, 0xed, 0xae, 0xd2, 0x52, 0x13, 0x3b, 0x3d, 0x1d, + 0x4c, 0x2c, 0xb3, 0xc0, 0xae, 0xc3, 0x06, 0x13, 0x84, 0xba, 0x67, 0x98, 0x30, 0xd1, 0xb8, 0x13, + 0x34, 0xea, 0x04, 0x5b, 0x02, 0xcc, 0x90, 0x09, 0x30, 0x93, 0xef, 0x1b, 0xfb, 0x99, 0xc9, 0xca, + 0x97, 0x27, 0x40, 0x5b, 0x4e, 0x36, 0x6c, 0x30, 0x01, 0x4f, 0x63, 0xb8, 0x31, 0xe6, 0x74, 0x0a, + 0xab, 0xaf, 0xd1, 0x38, 0xa1, 0x9b, 0xbe, 0x85, 0x05, 0x61, 0xd4, 0xb4, 0xeb, 0x0c, 0x6f, 0x99, + 0x35, 0xb0, 0x1c, 0xf0, 0xe5, 0xd7, 0x1b, 0x9a, 0x9f, 0x3e, 0xab, 0x61, 0xcf, 0x24, 0xda, 0x18, + 0x6b, 0x97, 0xa9, 0xb4, 0xaa, 0x44, 0xe1, 0x33, 0x7a, 0x96, 0xed, 0x44, 0xda, 0xb3, 0x37, 0x0a, + 0x1a, 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 0x9e, 0xd2, 0x35, 0x50, 0x7f, 0x7c, 0xbd, + 0xb5, 0x0b, 0x14, 0x58, 0x0d, 0x44, 0xfe, 0xc1, 0xc5, 0xf0, 0x09, 0x63, 0xe5, 0xe5, 0xde, 0x51, + 0x41, 0xd9, 0x3f, 0x2a, 0x28, 0xdf, 0x8e, 0x0a, 0xca, 0xdb, 0xe3, 0x42, 0x6e, 0xff, 0xb8, 0x90, + 0x3b, 0x38, 0x2e, 0xe4, 0x5e, 0x3d, 0x39, 0x7d, 0xc5, 0xda, 0x14, 0xe5, 0xf4, 0x15, 0x13, 0xde, + 0xd3, 0xb7, 0x4f, 0x3e, 0x65, 0xe4, 0xed, 0xb3, 0xfb, 0xe5, 0x43, 0xe0, 0xee, 0xcf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x29, 0x8c, 0x94, 0x31, 0xfb, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1050,6 +1138,76 @@ func (m *MsgOptOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSetConsumerCommissionRate) 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 *MsgSetConsumerCommissionRate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Rate.Size() + i -= size + if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetConsumerCommissionRateResponse) 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 *MsgSetConsumerCommissionRateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetConsumerCommissionRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1203,6 +1361,34 @@ func (m *MsgOptOutResponse) Size() (n int) { return n } +func (m *MsgSetConsumerCommissionRate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Rate.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgSetConsumerCommissionRateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2137,6 +2323,204 @@ func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetConsumerCommissionRate) 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 ErrIntOverflowTx + } + 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: MsgSetConsumerCommissionRate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetConsumerCommissionRate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetConsumerCommissionRateResponse) 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 ErrIntOverflowTx + } + 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: MsgSetConsumerCommissionRateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 98ce2b177b53877e84a242d0aededac7ba002447 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 27 Feb 2024 10:55:55 +0100 Subject: [PATCH 05/15] improve UT --- proto/interchain_security/ccv/provider/v1/tx.proto | 2 +- tests/integration/distribution.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index a1ffdd59e4..842fa21c7d 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -96,7 +96,7 @@ message MsgOptOutResponse {} message MsgSetConsumerCommissionRate { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // The chain id of the consumer chain to assign a consensus public key to + // The chain id of the consumer chain to set a commission rate string chain_id = 1; // The validator on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 65bbf709f5..1fc325821c 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -939,8 +939,8 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { { name: "expect tokens to be allocated evenly between validators", votes: []abci.VoteInfo{votes[0], votes[1]}, - tokens: sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 3))}, - expAllocated: sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 3))}, + tokens: sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 2))}, + expAllocated: sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 2))}, }, } @@ -996,7 +996,7 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { ) s.Require().Equal(rewardsPerVal, rewards.Rewards) - // send tokens to the distribution module to allow the rewards withdrawing + // send rewards to the distribution module valRewardsTrunc, _ := rewards.Rewards.TruncateDecimal() err := bankKeeper.SendCoinsFromAccountToModule( ctx, @@ -1014,6 +1014,9 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { // check that the withdrawn coins is equal to the entire reward amount s.Require().Equal(withdrawnCoins, valRewardsTrunc) + + // check that validators get rewards in their balance + s.Require().Equal(withdrawnCoins, bankKeeper.GetAllBalances(ctx, sdk.AccAddress(valAddr))) } } else { for _, v := range tc.votes { From 203925866ac4d077f7b4b76987f472d7b07f6b3d Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 27 Feb 2024 11:01:20 +0100 Subject: [PATCH 06/15] nits --- proto/interchain_security/ccv/provider/v1/tx.proto | 2 +- tests/integration/distribution.go | 7 +++---- x/ccv/provider/keeper/keeper.go | 6 ++++-- x/ccv/provider/keeper/keeper_test.go | 4 ---- x/ccv/provider/keeper/msg_server.go | 5 +---- x/ccv/provider/keeper/partial_set_security.go | 3 ++- x/ccv/provider/types/keys.go | 3 ++- 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 842fa21c7d..e0d0fceaf7 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -100,7 +100,7 @@ message MsgSetConsumerCommissionRate { string chain_id = 1; // The validator on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - // The rate to charge delegators on the consumer chain + // The rate to charge delegators on the consumer chain, as a fraction string rate = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 1fc325821c..4a9df7b46d 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -945,7 +945,7 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { } // opt the validators in to verify that they charge - // to their delegators the custom commission for the consumer chain + // a custom commission rate on the consumer chain for _, v := range s.providerChain.Vals.Validators { consAddr := sdk.ConsAddress(v.Address) provAddr := providertypes.NewProviderConsAddress(consAddr) @@ -953,17 +953,16 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { val, found := s.providerApp.GetTestStakingKeeper().GetValidatorByConsAddr(s.providerCtx(), consAddr) s.Require().True(found) - // check that no commission is set for the validator + // check that no commission rate is set for the validator s.Require().Equal(val.Commission.Rate, math.LegacyZeroDec()) - // set a custom commission of 100% + // set a custom commission rate of 100% providerKeeper.SetConsumerCommissionRate( s.providerCtx(), chainID, provAddr, sdk.OneDec(), ) - } for _, tc := range testCases { diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 219cb87ba6..4200b95f56 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1248,8 +1248,8 @@ func (k Keeper) SetToBeOptedIn( store.Set(types.ToBeOptedInKey(chainID, providerAddr), []byte{}) } -// SetConsumerCommissionRate sets a commission rate for the given -// consumer chain and validator address +// SetConsumerCommissionRate sets a per-consumer chain commission rate +// for the given validator address func (k Keeper) SetConsumerCommissionRate( ctx sdk.Context, chainID string, @@ -1286,6 +1286,8 @@ func (k Keeper) GetConsumerCommissionRate( return cr, true } +// DeleteConsumerCommissionRate the per-consumer chain commission rate +// associated to the given validator address func (k Keeper) DeleteConsumerCommissionRate( ctx sdk.Context, chainID string, diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index ed84cf4e14..d66689b264 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -724,11 +724,7 @@ func TestOptedIn(t *testing.T) { } require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderAddr))) - providerKeeper.SetOptedIn(ctx, "chainID", optedInValidator) - optedInVals := providerKeeper.GetAllOptedIn(ctx, "chainID") - require.Len(t, optedInVals, 1) - require.Equal(t, optedInValidator, optedInVals[0]) require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderAddr))) providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderAddr)) require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderAddr))) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 836abe89cb..42b59fc737 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -4,13 +4,10 @@ import ( "context" errorsmod "cosmossdk.io/errors" - + tmtypes "github.com/cometbft/cometbft/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v4/x/ccv/types" ) diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 3ab78836c6..97c9107270 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -63,12 +63,13 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types } func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { + // check that the consumer chain exists if !k.IsConsumerProposedOrRegistered(ctx, chainID) { return errorsmod.Wrapf( types.ErrUnknownConsumerChainId, "unknown consumer chain, with id: %s", chainID) } - + // set per-consumer chain commission rate for the validator address k.SetConsumerCommissionRate( ctx, chainID, diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 8439c4a3d8..7deb1f401f 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -164,7 +164,8 @@ const ( // it allocated to the consumer rewards pool ConsumerRewardsAllocationBytePrefix - // ConsumerCommissionRatePrefix is the byte prefix used when store a validator commission rate + // ConsumerCommissionRatePrefix is the byte prefix used when storing a validator a per-consumer chain commission rate + // for a validator address ConsumerCommissionRatePrefix // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO getAllKeyPrefixes() IN keys_test.go From 8361601d124efc7fdff69614d4c1d36a6b6a8276 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 28 Feb 2024 12:46:54 +0100 Subject: [PATCH 07/15] Update x/ccv/provider/keeper/keeper.go Co-authored-by: insumity --- x/ccv/provider/keeper/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 4200b95f56..6be4145904 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1259,7 +1259,7 @@ func (k Keeper) SetConsumerCommissionRate( store := ctx.KVStore(k.storeKey) bz, err := commissionRate.Marshal() if err != nil { - panic(fmt.Errorf("consumer commission rate marshalling failed:%s", err)) + panic(fmt.Errorf("consumer commission rate marshalling failed: %s", err)) } store.Set(types.ConsumerCommissionRateKey(chainID, providerAddr), bz) From 0cacd79cb0eab5669619cd930cb3cc61722c0aed Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 28 Feb 2024 12:47:16 +0100 Subject: [PATCH 08/15] Update proto/interchain_security/ccv/provider/v1/tx.proto Co-authored-by: Marius Poke --- proto/interchain_security/ccv/provider/v1/tx.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index e0d0fceaf7..a7e4ee0a48 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -98,7 +98,7 @@ message MsgSetConsumerCommissionRate { option (gogoproto.goproto_getters) = false; // The chain id of the consumer chain to set a commission rate string chain_id = 1; - // The validator on the provider + // The validator address on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // The rate to charge delegators on the consumer chain, as a fraction string rate = 3 [ From 75ebf4aa9928c646b2ef3d05e2d2230dc2bdd0cc Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 29 Feb 2024 08:37:58 +0100 Subject: [PATCH 09/15] optimize keys --- x/ccv/provider/types/keys.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 7deb1f401f..c7b4a01d14 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -570,8 +570,11 @@ func ConsumerRewardsAllocationKey(chainID string) []byte { // ConsumerCommissionRateKey returns the key of consumer chain `chainID` and validator with `providerAddr` func ConsumerCommissionRateKey(chainID string, providerAddr ProviderConsAddress) []byte { - prefix := ChainIdWithLenKey(ConsumerCommissionRatePrefix, chainID) - return append(prefix, providerAddr.ToSdkConsAddr().Bytes()...) + return ChainIdAndConsAddrKey( + ConsumerCommissionRatePrefix, + chainID, + providerAddr.ToSdkConsAddr(), + ) } // From a4c57542a8a76856c35abf9baef433e706e6ba2f Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 29 Feb 2024 08:38:23 +0100 Subject: [PATCH 10/15] Update x/ccv/provider/keeper/keeper.go Co-authored-by: insumity --- x/ccv/provider/keeper/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 6be4145904..9b0ab37870 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1286,7 +1286,7 @@ func (k Keeper) GetConsumerCommissionRate( return cr, true } -// DeleteConsumerCommissionRate the per-consumer chain commission rate +// DeleteConsumerCommissionRate deletes the per-consumer chain commission rate // associated to the given validator address func (k Keeper) DeleteConsumerCommissionRate( ctx sdk.Context, From f2e44c659cdcc79ff9e47407b21a4edd14c05d7a Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 29 Feb 2024 09:44:51 +0100 Subject: [PATCH 11/15] address comments --- tests/integration/distribution.go | 46 ++++++++++++++------------ testutil/keeper/unit_test_helpers.go | 5 +++ x/ccv/provider/keeper/keeper.go | 26 ++++++++++++++- x/ccv/provider/keeper/keeper_test.go | 38 +++++++++++++++++++++ x/ccv/provider/keeper/proposal.go | 6 ++++ x/ccv/provider/keeper/proposal_test.go | 4 --- 6 files changed, 98 insertions(+), 27 deletions(-) diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 4a9df7b46d..d63f36997a 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -920,53 +920,52 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { name string votes []abci.VoteInfo tokens sdk.DecCoins + rate sdk.Dec expAllocated sdk.DecCoins }{ { - name: "tokens are empty", + name: "tokens are empty", + tokens: sdk.DecCoins{}, + rate: sdk.ZeroDec(), + expAllocated: nil, }, { name: "total voting power is zero", tokens: sdk.DecCoins{sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(100_000))}, + rate: sdk.ZeroDec(), expAllocated: nil, }, { name: "expect all tokens to be allocated to a single validator", votes: []abci.VoteInfo{votes[0]}, tokens: sdk.DecCoins{sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(999))}, + rate: sdk.NewDecWithPrec(5, 1), expAllocated: sdk.DecCoins{sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(999))}, }, { name: "expect tokens to be allocated evenly between validators", votes: []abci.VoteInfo{votes[0], votes[1]}, tokens: sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 2))}, + rate: sdk.OneDec(), expAllocated: sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 2))}, }, } - // opt the validators in to verify that they charge - // a custom commission rate on the consumer chain - for _, v := range s.providerChain.Vals.Validators { - consAddr := sdk.ConsAddress(v.Address) - provAddr := providertypes.NewProviderConsAddress(consAddr) - - val, found := s.providerApp.GetTestStakingKeeper().GetValidatorByConsAddr(s.providerCtx(), consAddr) - s.Require().True(found) + for _, tc := range testCases { + s.Run(tc.name, func() { - // check that no commission rate is set for the validator - s.Require().Equal(val.Commission.Rate, math.LegacyZeroDec()) + // set the same consumer commission rate for all validators + for _, v := range s.providerChain.Vals.Validators { + provAddr := providertypes.NewProviderConsAddress(sdk.ConsAddress(v.Address)) - // set a custom commission rate of 100% - providerKeeper.SetConsumerCommissionRate( - s.providerCtx(), - chainID, - provAddr, - sdk.OneDec(), - ) - } + providerKeeper.SetConsumerCommissionRate( + s.providerCtx(), + chainID, + provAddr, + tc.rate, + ) + } - for _, tc := range testCases { - s.Run(tc.name, func() { // TODO: opt validators in and verify // that rewards are only allocated to them ctx, _ := s.providerCtx().CacheContext() @@ -1012,7 +1011,10 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { s.Require().NoError(err) // check that the withdrawn coins is equal to the entire reward amount - s.Require().Equal(withdrawnCoins, valRewardsTrunc) + // times the set consumer commission + commission := rewards.Rewards.MulDec(tc.rate) + c, _ := commission.TruncateDecimal() + s.Require().Equal(withdrawnCoins, c) // check that validators get rewards in their balance s.Require().Equal(withdrawnCoins, bankKeeper.GetAllBalances(ctx, sdk.AccAddress(valAddr))) diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index 468b0cb5e9..d17433ca66 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -249,11 +249,16 @@ func TestProviderStateIsCleanedAfterConsumerChainIsStopped(t *testing.T, ctx sdk require.Empty(t, providerKeeper.GetAllVscSendTimestamps(ctx, expectedChainID)) + // in case the chain was successfully stopped, it should not contain a Top N associated to it + _, found = providerKeeper.GetTopN(ctx, expectedChainID) + require.False(t, found) + // test key assignment state is cleaned require.Empty(t, providerKeeper.GetAllValidatorConsumerPubKeys(ctx, &expectedChainID)) require.Empty(t, providerKeeper.GetAllValidatorsByConsumerAddr(ctx, &expectedChainID)) require.Empty(t, providerKeeper.GetAllKeyAssignmentReplacements(ctx, expectedChainID)) require.Empty(t, providerKeeper.GetAllConsumerAddrsToPrune(ctx, expectedChainID)) + require.Empty(t, providerKeeper.GetAllCommissionRateValidators(ctx, expectedChainID)) } func GetTestConsumerAdditionProp() *providertypes.ConsumerAdditionProposal { diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 9b0ab37870..e2899d4962 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1280,13 +1280,37 @@ func (k Keeper) GetConsumerCommissionRate( cr := sdk.Dec{} if err := cr.Unmarshal(bz); err != nil { - panic(fmt.Errorf("consumer commission rate unmarshalling failed:%s", err)) + k.Logger(ctx).Error("consumer commission rate unmarshalling failed: %s", err) + return sdk.ZeroDec(), false } return cr, true } +<<<<<<< Updated upstream // DeleteConsumerCommissionRate deletes the per-consumer chain commission rate +======= +// GetAllCommissionRateValidators returns all the validator address +// that set a commission rate for the given chain ID +func (k Keeper) GetAllCommissionRateValidators( + ctx sdk.Context, + chainID string) (addresses []types.ProviderConsAddress) { + + store := ctx.KVStore(k.storeKey) + key := types.ChainIdWithLenKey(types.ConsumerCommissionRatePrefix, chainID) + iterator := sdk.KVStorePrefixIterator(store, key) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + providerAddr := types.NewProviderConsAddress(iterator.Key()[len(key):]) + addresses = append(addresses, providerAddr) + } + + return addresses +} + +// DeleteConsumerCommissionRate the per-consumer chain commission rate +>>>>>>> Stashed changes // associated to the given validator address func (k Keeper) DeleteConsumerCommissionRate( ctx sdk.Context, diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index d66689b264..595e01100a 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -15,6 +15,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + sdk "github.com/cosmos/cosmos-sdk/types" cryptotestutil "github.com/cosmos/interchain-security/v4/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v4/testutil/keeper" "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" @@ -859,3 +860,40 @@ func TestToBeOptedOut(t *testing.T) { providerKeeper.DeleteToBeOptedOut(ctx, "chainID", providerAddr) require.False(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) } + +// TestToBeOptedOut tests the `SetConsumerCommissionRate`, `GetConsumerCommissionRate`, and `DeleteConsumerCommissionRate` methods +func TestConsumerCommissionRate(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + providerAddr1 := types.NewProviderConsAddress([]byte("providerAddr1")) + providerAddr2 := types.NewProviderConsAddress([]byte("providerAddr2")) + + cr, found := providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr1) + require.False(t, found) + require.Equal(t, sdk.ZeroDec(), cr) + + providerKeeper.SetConsumerCommissionRate(ctx, "chainID", providerAddr1, sdk.OneDec()) + cr, found = providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr1) + require.True(t, found) + require.Equal(t, sdk.OneDec(), cr) + + providerKeeper.SetConsumerCommissionRate(ctx, "chainID", providerAddr2, sdk.ZeroDec()) + cr, found = providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr2) + require.True(t, found) + require.Equal(t, sdk.ZeroDec(), cr) + + provAddrs := providerKeeper.GetAllCommissionRateValidators(ctx, "chainID") + require.Len(t, provAddrs, 2) + + for _, addr := range provAddrs { + providerKeeper.DeleteConsumerCommissionRate(ctx, "chainID", addr) + } + + _, found = providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr1) + require.False(t, found) + + _, found = providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr2) + require.False(t, found) + +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 50dc69d080..0b7209e710 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -188,6 +188,12 @@ func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, closeChan boo // delete VSC send timestamps k.DeleteVscSendTimestampsForConsumer(ctx, chainID) + + // delete consumer commission rate + provAddrs := k.GetAllCommissionRateValidators(ctx, "chainID") + for _, addr := range provAddrs { + k.DeleteConsumerCommissionRate(ctx, "chainID", addr) + } } k.DeleteInitChainHeight(ctx, chainID) diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index dacc456d2f..a979301521 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -554,10 +554,6 @@ func TestStopConsumerChain(t *testing.T) { require.Error(t, err) } else { require.NoError(t, err) - - // in case the chain was successfully stopped, it should not contain a Top N associated to it - _, found := providerKeeper.GetTopN(ctx, "chainID") - require.False(t, found) } testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, "chainID", "channelID") From 8e2111a3e18001757422c7288ff26cc1536edd7a Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 29 Feb 2024 10:27:59 +0100 Subject: [PATCH 12/15] address comments --- .../ccv/provider/v1/tx.proto | 10 +- tests/integration/distribution.go | 2 +- x/ccv/provider/keeper/distribution.go | 20 +++ x/ccv/provider/keeper/keeper.go | 4 - x/ccv/provider/keeper/msg_server.go | 9 + x/ccv/provider/keeper/partial_set_security.go | 18 -- x/ccv/provider/types/events.go | 3 + x/ccv/provider/types/tx.pb.go | 170 +++++++++++------- 8 files changed, 142 insertions(+), 94 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index a7e4ee0a48..96844c2e72 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -96,12 +96,12 @@ message MsgOptOutResponse {} message MsgSetConsumerCommissionRate { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // The chain id of the consumer chain to set a commission rate - string chain_id = 1; // The validator address on the provider - string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - // The rate to charge delegators on the consumer chain, as a fraction - string rate = 3 [ + string provider_addr = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + // The chain id of the consumer chain to set a commission rate + string chain_id = 2; + // The rate to charge delegators on the consumer chain, as a fraction + string rate = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index d63f36997a..65473d3bcf 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -1011,7 +1011,7 @@ func (s *CCVTestSuite) TestAllocateTokensToValidator() { s.Require().NoError(err) // check that the withdrawn coins is equal to the entire reward amount - // times the set consumer commission + // times the set consumer commission rate commission := rewards.Rewards.MulDec(tc.rate) c, _ := commission.TruncateDecimal() s.Require().Equal(withdrawnCoins, c) diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index ed92101e32..16511f8bde 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -280,3 +280,23 @@ func (k Keeper) IdentifyConsumerChainIDFromIBCPacket(ctx sdk.Context, packet cha return chainID, nil } + +// HandleSetConsumerCommissionRate sets a per-consumer chain commission rate for the given provider address +// on the condition that the given consumer chain exists. +func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { + // check that the consumer chain exists + if !k.IsConsumerProposedOrRegistered(ctx, chainID) { + return errorsmod.Wrapf( + types.ErrUnknownConsumerChainId, + "unknown consumer chain, with id: %s", chainID) + } + // set per-consumer chain commission rate for the validator address + k.SetConsumerCommissionRate( + ctx, + chainID, + providerAddr, + commissionRate, + ) + + return nil +} diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index e2899d4962..ec73d85383 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1287,9 +1287,6 @@ func (k Keeper) GetConsumerCommissionRate( return cr, true } -<<<<<<< Updated upstream -// DeleteConsumerCommissionRate deletes the per-consumer chain commission rate -======= // GetAllCommissionRateValidators returns all the validator address // that set a commission rate for the given chain ID func (k Keeper) GetAllCommissionRateValidators( @@ -1310,7 +1307,6 @@ func (k Keeper) GetAllCommissionRateValidators( } // DeleteConsumerCommissionRate the per-consumer chain commission rate ->>>>>>> Stashed changes // associated to the given validator address func (k Keeper) DeleteConsumerCommissionRate( ctx sdk.Context, diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 42b59fc737..9e019bcb22 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -217,5 +217,14 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M return nil, err } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeSetConsumerCommissionRate, + sdk.NewAttribute(types.AttributeConsumerChainID, msg.ChainId), + sdk.NewAttribute(types.AttributeProviderValidatorAddress, msg.ProviderAddr), + sdk.NewAttribute(types.AttributeConsumerCommissionRate, msg.Rate.String()), + ), + }) + return &types.MsgSetConsumerCommissionRateResponse{}, nil } diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 97c9107270..bf76e7d7c8 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -61,21 +61,3 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types return nil } - -func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { - // check that the consumer chain exists - if !k.IsConsumerProposedOrRegistered(ctx, chainID) { - return errorsmod.Wrapf( - types.ErrUnknownConsumerChainId, - "unknown consumer chain, with id: %s", chainID) - } - // set per-consumer chain commission rate for the validator address - k.SetConsumerCommissionRate( - ctx, - chainID, - providerAddr, - commissionRate, - ) - - return nil -} diff --git a/x/ccv/provider/types/events.go b/x/ccv/provider/types/events.go index 58d686020f..4838c1ba43 100644 --- a/x/ccv/provider/types/events.go +++ b/x/ccv/provider/types/events.go @@ -7,6 +7,7 @@ const ( EventTypeAddConsumerRewardDenom = "add_consumer_reward_denom" EventTypeRemoveConsumerRewardDenom = "remove_consumer_reward_denom" EventTypeExecuteConsumerChainSlash = "execute_consumer_chain_slash" + EventTypeSetConsumerCommissionRate = "set_consumer_commission_rate" AttributeInfractionHeight = "infraction_height" AttributeInitialHeight = "initial_height" AttributeInitializationTimeout = "initialization_timeout" @@ -15,4 +16,6 @@ const ( AttributeProviderValidatorAddress = "provider_validator_address" AttributeConsumerConsensusPubKey = "consumer_consensus_pub_key" AttributeConsumerRewardDenom = "consumer_reward_denom" + AttributeConsumerCommissionRate = "consumer_commission_rate" + AttributeConsumerChainID = "consumer_chain_id" ) diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 9c4cf5c7a6..7330433f5b 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -430,11 +430,11 @@ var xxx_messageInfo_MsgOptOutResponse proto.InternalMessageInfo // MsgSetConsumerCommissionRate allows validators to set // a per-consumer chain commission rate type MsgSetConsumerCommissionRate struct { - // The chain id of the consumer chain to assign a consensus public key to - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // The validator address on the provider - ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` - // The rate to charge delegators on the consumer chain + ProviderAddr string `protobuf:"bytes,1,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` + // The chain id of the consumer chain to set a commission rate + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The rate to charge delegators on the consumer chain, as a fraction Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` } @@ -527,55 +527,57 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 763 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x4e, 0x14, 0x4b, - 0x14, 0x9e, 0x86, 0x0b, 0x17, 0x0a, 0xee, 0xcd, 0xa5, 0x2f, 0x04, 0x98, 0xe0, 0x8c, 0x8e, 0x0a, - 0x2e, 0x98, 0xee, 0x80, 0x7f, 0x91, 0xe8, 0x82, 0x01, 0x13, 0xd1, 0x4c, 0x20, 0x4d, 0x82, 0x89, - 0x0b, 0x3b, 0xdd, 0xd5, 0x87, 0x9e, 0x0a, 0xd3, 0x55, 0x93, 0xae, 0xea, 0x0e, 0xf3, 0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x31, 0xe2, 0x4c, 0x28, 0xd7, 0x95, 0x3b, 0x83, 0xc6, 0xdf, 0x72, 0xbd, - 0xe2, 0xa8, 0x0f, 0xd1, 0x3f, 0x89, 0x41, 0xd3, 0x72, 0x1c, 0x7f, 0xa2, 0xa7, 0x95, 0xaf, 0xa8, - 0x3f, 0x0e, 0x8b, 0xff, 0x36, 0x2d, 0xaf, 0xbe, 0x50, 0x6a, 0x45, 0x81, 0xf3, 0x92, 0x31, 0x9c, - 0x00, 0x17, 0x1d, 0xc7, 0x57, 0x6f, 0xa0, 0x61, 0x1c, 0x53, 0x98, 0x5b, 0xd0, 0x9c, 0xe8, 0x95, - 0x75, 0x87, 0x70, 0x9b, 0x76, 0x61, 0x60, 0x67, 0xb7, 0x98, 0xfb, 0xbe, 0x5b, 0xcc, 0x95, 0x0a, - 0x68, 0xaa, 0x93, 0x30, 0x03, 0x78, 0x83, 0x51, 0x0e, 0xa5, 0x0f, 0x0a, 0xba, 0x56, 0xe5, 0xee, - 0x7a, 0x60, 0x7b, 0x44, 0x24, 0x80, 0x2a, 0xe1, 0x36, 0xd4, 0xac, 0x90, 0xb0, 0xc0, 0x57, 0xa7, - 0xd0, 0x20, 0x97, 0x59, 0x01, 0x7e, 0xec, 0xa1, 0x1d, 0x50, 0xd7, 0xd0, 0xb0, 0x97, 0x41, 0x4b, - 0x13, 0x43, 0xf3, 0xb3, 0x1a, 0xb1, 0xb1, 0x96, 0x6d, 0xb1, 0x96, 0x69, 0x6a, 0x38, 0xa7, 0x65, - 0x19, 0x8c, 0x13, 0x15, 0x32, 0xda, 0x67, 0xd0, 0xed, 0xae, 0xd2, 0x52, 0x13, 0x3b, 0x3d, 0x1d, - 0x4c, 0x2c, 0xb3, 0xc0, 0xae, 0xc3, 0x06, 0x13, 0x84, 0xba, 0x67, 0x98, 0x30, 0xd1, 0xb8, 0x13, - 0x34, 0xea, 0x04, 0x5b, 0x02, 0xcc, 0x90, 0x09, 0x30, 0x93, 0xef, 0x1b, 0xf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0xee, 0xaa, 0xef, 0x14, 0x34, 0x72, 0x7a, 0xa4, 0x3d, 0xd2, 0xce, 0x31, - 0xaf, 0xb5, 0x4e, 0x43, 0x27, 0xbf, 0x78, 0xe9, 0xad, 0x89, 0x36, 0xf5, 0xa3, 0x82, 0xf2, 0x5d, - 0x86, 0x55, 0xe5, 0xbc, 0x0c, 0xbf, 0xae, 0x91, 0x7f, 0xfe, 0xfb, 0x35, 0xba, 0xc8, 0x3d, 0x31, - 0x96, 0x2e, 0x29, 0x37, 0x5b, 0xe3, 0xb2, 0x72, 0x3b, 0x0d, 0x05, 0xd5, 0x43, 0x7d, 0xd1, 0x40, - 0x28, 0x9f, 0xb7, 0xa8, 0x84, 0xe7, 0xef, 0x5f, 0x08, 0x9e, 0xd2, 0x35, 0x50, 0x7f, 0x7c, 0xbd, - 0xb5, 0x0b, 0x14, 0x58, 0x0d, 0x44, 0xfe, 0xc1, 0xc5, 0xf0, 0x09, 0x63, 0xe5, 0xe5, 0xde, 0x51, - 0x41, 0xd9, 0x3f, 0x2a, 0x28, 0xdf, 0x8e, 0x0a, 0xca, 0xdb, 0xe3, 0x42, 0x6e, 0xff, 0xb8, 0x90, - 0x3b, 0x38, 0x2e, 0xe4, 0x5e, 0x3d, 0x39, 0x7d, 0xc5, 0xda, 0x14, 0xe5, 0xf4, 0x15, 0x13, 0xde, - 0xd3, 0xb7, 0x4f, 0x3e, 0x65, 0xe4, 0xed, 0xb3, 0xfb, 0xe5, 0x43, 0xe0, 0xee, 0xcf, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x29, 0x8c, 0x94, 0x31, 0xfb, 0x08, 0x00, 0x00, + // 787 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x4f, 0xd4, 0x4e, + 0x18, 0xde, 0xc2, 0xef, 0xc7, 0xc7, 0x80, 0x46, 0x2a, 0x04, 0x68, 0x70, 0x57, 0x57, 0x05, 0x0f, + 0x6c, 0x1b, 0xf0, 0x2b, 0x12, 0x3d, 0xb0, 0x60, 0x22, 0x9a, 0x0d, 0xa4, 0x24, 0x98, 0x78, 0xb0, + 0x69, 0xa7, 0x43, 0x77, 0xc2, 0x76, 0xa6, 0xe9, 0x4c, 0x1b, 0xf6, 0xee, 0x81, 0xc4, 0x8b, 0x9e, + 0x8c, 0x37, 0xae, 0x26, 0x1e, 0xfd, 0x23, 0x38, 0x19, 0xe2, 0xc9, 0x78, 0x20, 0x06, 0x2e, 0x9e, + 0xfd, 0x0b, 0xcc, 0x4e, 0x3f, 0xb6, 0x1b, 0x96, 0x65, 0x81, 0x18, 0x4f, 0xbb, 0x33, 0xef, 0x33, + 0xcf, 0xfb, 0x3c, 0x6f, 0xa7, 0x4f, 0x0a, 0x66, 0x31, 0xe1, 0xc8, 0x87, 0x55, 0x13, 0x13, 0x83, + 0x21, 0x18, 0xf8, 0x98, 0xd7, 0x35, 0x08, 0x43, 0xcd, 0xf3, 0x69, 0x88, 0x6d, 0xe4, 0x6b, 0xe1, + 0x9c, 0xc6, 0xb7, 0x55, 0xcf, 0xa7, 0x9c, 0xca, 0x37, 0xdb, 0xa0, 0x55, 0x08, 0x43, 0x35, 0x41, + 0xab, 0xe1, 0x9c, 0x32, 0xea, 0x50, 0x87, 0x0a, 0xbc, 0xd6, 0xf8, 0x17, 0x1d, 0x55, 0x26, 0x21, + 0x65, 0x2e, 0x65, 0x46, 0x54, 0x88, 0x16, 0x49, 0xc9, 0xa1, 0xd4, 0xa9, 0x21, 0x4d, 0xac, 0xac, + 0x60, 0x53, 0x33, 0x49, 0x3d, 0x2e, 0x69, 0xd8, 0x82, 0x5a, 0x0d, 0x3b, 0x55, 0x0e, 0x6b, 0x18, + 0x11, 0xce, 0x34, 0x8e, 0x88, 0x8d, 0x7c, 0x17, 0x13, 0x2e, 0x94, 0xa5, 0xab, 0xf8, 0x40, 0x21, + 0x53, 0xe7, 0x75, 0x0f, 0x31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, 0x7b, 0xda, 0x76, 0xeb, 0x67, 0x97, 0x48, 0x0a, + 0xab, 0x4f, 0x7c, 0xb4, 0xdc, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x76, 0xb7, 0xbf, 0x16, 0xa7, + 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -595,6 +597,7 @@ type MsgClient interface { SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) } type msgClient struct { @@ -650,6 +653,15 @@ func (c *msgClient) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.Call return out, nil } +func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) { + out := new(MsgSetConsumerCommissionRateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) @@ -657,6 +669,7 @@ type MsgServer interface { SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -678,6 +691,9 @@ func (*UnimplementedMsgServer) OptIn(ctx context.Context, req *MsgOptIn) (*MsgOp func (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*MsgOptOutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OptOut not implemented") } +func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -773,6 +789,24 @@ func _Msg_OptOut_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetConsumerCommissionRate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, req.(*MsgSetConsumerCommissionRate)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.provider.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -797,6 +831,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "OptOut", Handler: _Msg_OptOut_Handler, }, + { + MethodName: "SetConsumerCommissionRate", + Handler: _Msg_SetConsumerCommissionRate_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/tx.proto", @@ -1168,18 +1206,18 @@ func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, e } i-- dAtA[i] = 0x1a - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) - i-- - dAtA[i] = 0x12 - } if len(m.ChainId) > 0 { i -= len(m.ChainId) copy(dAtA[i:], m.ChainId) i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- + dAtA[i] = 0x12 + } + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -1367,11 +1405,11 @@ func (m *MsgSetConsumerCommissionRate) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ProviderAddr) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ProviderAddr) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -2354,7 +2392,7 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2382,11 +2420,11 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2414,7 +2452,7 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { From 2951e9bace04f6436d6ad1e4a11efcedd0be8cb1 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 5 Mar 2024 09:01:42 +0100 Subject: [PATCH 13/15] remove unnecessary check --- x/ccv/provider/keeper/distribution.go | 11 +---------- x/ccv/provider/keeper/msg_server.go | 4 +--- x/ccv/provider/keeper/partial_set_security_test.go | 6 +----- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index 16511f8bde..bdf3b4f42f 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -282,14 +282,7 @@ func (k Keeper) IdentifyConsumerChainIDFromIBCPacket(ctx sdk.Context, packet cha } // HandleSetConsumerCommissionRate sets a per-consumer chain commission rate for the given provider address -// on the condition that the given consumer chain exists. -func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { - // check that the consumer chain exists - if !k.IsConsumerProposedOrRegistered(ctx, chainID) { - return errorsmod.Wrapf( - types.ErrUnknownConsumerChainId, - "unknown consumer chain, with id: %s", chainID) - } +func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) { // set per-consumer chain commission rate for the validator address k.SetConsumerCommissionRate( ctx, @@ -297,6 +290,4 @@ func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr, commissionRate, ) - - return nil } diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 9e019bcb22..0d9e32a92f 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -213,9 +213,7 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M return nil, err } - if err := k.HandleSetConsumerCommissionRate(ctx, msg.ChainId, types.NewProviderConsAddress(consAddr), msg.Rate); err != nil { - return nil, err - } + k.HandleSetConsumerCommissionRate(ctx, msg.ChainId, types.NewProviderConsAddress(consAddr), msg.Rate) ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index a6b2ec45e7..7d74853acc 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -119,18 +119,14 @@ func TestHandleSetConsumerCommissionRate(t *testing.T) { providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) - // trying to set a commission rate to a unknown consumer chain - require.Error(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, "unknownChainID", providerAddr, sdk.ZeroDec())) - // setup a pending consumer chain chainID := "pendingChainID" - providerKeeper.SetPendingConsumerAdditionProp(ctx, &types.ConsumerAdditionProposal{ChainId: chainID}) // check that there's no commission rate set for the validator yet _, found := providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) require.False(t, found) - require.NoError(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, chainID, providerAddr, sdk.OneDec())) + providerKeeper.HandleSetConsumerCommissionRate(ctx, chainID, providerAddr, sdk.OneDec()) // check that the commission rate is now set cr, found := providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) From d8ecbb7156b37e5b97ec251d72cd202a8dfa113a Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 8 Mar 2024 09:08:14 +0100 Subject: [PATCH 14/15] Revert "remove unnecessary check" This reverts commit 2951e9bace04f6436d6ad1e4a11efcedd0be8cb1. --- x/ccv/provider/keeper/distribution.go | 11 ++++++++++- x/ccv/provider/keeper/msg_server.go | 4 +++- x/ccv/provider/keeper/partial_set_security_test.go | 6 +++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index bdf3b4f42f..16511f8bde 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -282,7 +282,14 @@ func (k Keeper) IdentifyConsumerChainIDFromIBCPacket(ctx sdk.Context, packet cha } // HandleSetConsumerCommissionRate sets a per-consumer chain commission rate for the given provider address -func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) { +// on the condition that the given consumer chain exists. +func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate sdk.Dec) error { + // check that the consumer chain exists + if !k.IsConsumerProposedOrRegistered(ctx, chainID) { + return errorsmod.Wrapf( + types.ErrUnknownConsumerChainId, + "unknown consumer chain, with id: %s", chainID) + } // set per-consumer chain commission rate for the validator address k.SetConsumerCommissionRate( ctx, @@ -290,4 +297,6 @@ func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr, commissionRate, ) + + return nil } diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 0d9e32a92f..9e019bcb22 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -213,7 +213,9 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M return nil, err } - k.HandleSetConsumerCommissionRate(ctx, msg.ChainId, types.NewProviderConsAddress(consAddr), msg.Rate) + if err := k.HandleSetConsumerCommissionRate(ctx, msg.ChainId, types.NewProviderConsAddress(consAddr), msg.Rate); err != nil { + return nil, err + } ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index 7d74853acc..a6b2ec45e7 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -119,14 +119,18 @@ func TestHandleSetConsumerCommissionRate(t *testing.T) { providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) + // trying to set a commission rate to a unknown consumer chain + require.Error(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, "unknownChainID", providerAddr, sdk.ZeroDec())) + // setup a pending consumer chain chainID := "pendingChainID" + providerKeeper.SetPendingConsumerAdditionProp(ctx, &types.ConsumerAdditionProposal{ChainId: chainID}) // check that there's no commission rate set for the validator yet _, found := providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) require.False(t, found) - providerKeeper.HandleSetConsumerCommissionRate(ctx, chainID, providerAddr, sdk.OneDec()) + require.NoError(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, chainID, providerAddr, sdk.OneDec())) // check that the commission rate is now set cr, found := providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) From dd98446c93ea3b6faaf6c71fe56e4698fdd4031e Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 8 Mar 2024 09:10:15 +0100 Subject: [PATCH 15/15] fix minor bug in StopConsumerChain --- x/ccv/provider/keeper/proposal.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 0b7209e710..399989354c 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -188,12 +188,12 @@ func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, closeChan boo // delete VSC send timestamps k.DeleteVscSendTimestampsForConsumer(ctx, chainID) + } - // delete consumer commission rate - provAddrs := k.GetAllCommissionRateValidators(ctx, "chainID") - for _, addr := range provAddrs { - k.DeleteConsumerCommissionRate(ctx, "chainID", addr) - } + // delete consumer commission rate + provAddrs := k.GetAllCommissionRateValidators(ctx, chainID) + for _, addr := range provAddrs { + k.DeleteConsumerCommissionRate(ctx, chainID, addr) } k.DeleteInitChainHeight(ctx, chainID)