From b0d4cf94671aa8d10b3c6db0ae38b93ba8bcfe58 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 13 Mar 2024 12:22:48 +0100 Subject: [PATCH 01/36] init commit --- .../ccv/provider/v1/provider.proto | 13 - x/ccv/provider/keeper/distribution_test.go | 9 +- x/ccv/provider/keeper/keeper.go | 22 +- x/ccv/provider/keeper/keeper_test.go | 68 ++- .../keeper/partial_set_security_test.go | 8 +- x/ccv/provider/keeper/relay.go | 15 +- x/ccv/provider/keeper/validator_set_update.go | 110 ++++ .../keeper/validator_set_update_test.go | 81 ++- x/ccv/provider/types/keys.go | 9 - x/ccv/provider/types/provider.pb.go | 538 ++++-------------- 10 files changed, 381 insertions(+), 492 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 8c70c9e428..1b5f7a515f 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -326,16 +326,3 @@ message ConsumerRewardsAllocation { (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" ]; } - -// OptedInValidator is used to store a opted-in validator -// to a consumer chain with the following mapping: (chainID, providerAddr) -> optedInValidator -message OptedInValidator { - // validator address - bytes provider_addr = 1; - // block height at which the validator opted-in - int64 block_height = 2; - // validator voting power at the block it opted-in - int64 power = 3; - // public key used by the validator on the consumer - bytes public_key = 4; -} \ No newline at end of file diff --git a/x/ccv/provider/keeper/distribution_test.go b/x/ccv/provider/keeper/distribution_test.go index 52ac0e0a82..64359e4fe4 100644 --- a/x/ccv/provider/keeper/distribution_test.go +++ b/x/ccv/provider/keeper/distribution_test.go @@ -38,11 +38,10 @@ func TestComputeConsumerTotalVotingPower(t *testing.T) { keeper.SetOptedIn( ctx, chainID, - types.OptedInValidator{ - ProviderAddr: val.Address, - BlockHeight: ctx.BlockHeight(), - Power: val.VotingPower, - PublicKey: val.PubKey.Bytes(), + types.ConsumerValidator{ + ProviderConsAddr: val.Address, + Power: val.VotingPower, + //ConsumerPublicKey: val., FIXME }, ) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index ec73d85383..154307dfef 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1189,7 +1189,7 @@ func (k Keeper) IsOptIn(ctx sdk.Context, chainID string) bool { func (k Keeper) SetOptedIn( ctx sdk.Context, chainID string, - validator types.OptedInValidator, + validator types.ConsumerValidator, ) { store := ctx.KVStore(k.storeKey) bz, err := validator.Marshal() @@ -1197,7 +1197,7 @@ func (k Keeper) SetOptedIn( panic(fmt.Errorf("failed to marshal OptedInValidator: %w", err)) } - store.Set(types.OptedInKey(chainID, validator.ProviderAddr), bz) + store.Set(types.ConsumerValidatorKey(chainID, validator.ProviderConsAddr), bz) } func (k Keeper) DeleteOptedIn( @@ -1206,7 +1206,7 @@ func (k Keeper) DeleteOptedIn( providerAddr types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.OptedInKey(chainID, providerAddr.ToSdkConsAddr())) + store.Delete(types.ConsumerValidatorKey(chainID, providerAddr.ToSdkConsAddr())) } func (k Keeper) IsOptedIn( @@ -1215,28 +1215,28 @@ func (k Keeper) IsOptedIn( providerAddr types.ProviderConsAddress, ) bool { store := ctx.KVStore(k.storeKey) - return store.Get(types.OptedInKey(chainID, providerAddr.ToSdkConsAddr())) != nil + return store.Get(types.ConsumerValidatorKey(chainID, providerAddr.ToSdkConsAddr())) != nil } // GetAllOptedIn returns all the opted-in validators on chain `chainID` func (k Keeper) GetAllOptedIn( ctx sdk.Context, - chainID string) (optedInValidators []types.OptedInValidator) { + chainID string) (consumerValidators []types.ConsumerValidator) { store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.OptedInBytePrefix, chainID) + key := types.ChainIdWithLenKey(types.ConsumerValidatorBytePrefix, chainID) iterator := sdk.KVStorePrefixIterator(store, key) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { iterator.Value() - var optedInValidator types.OptedInValidator - if err := optedInValidator.Unmarshal(iterator.Value()); err != nil { - panic(fmt.Errorf("failed to unmarshal OptedInValidator: %w", err)) + var consumerValidator types.ConsumerValidator + if err := consumerValidator.Unmarshal(iterator.Value()); err != nil { + panic(fmt.Errorf("failed to unmarshal ConsumerValidator: %w", err)) } - optedInValidators = append(optedInValidators, optedInValidator) + consumerValidators = append(consumerValidators, consumerValidator) } - return optedInValidators + return consumerValidators } func (k Keeper) SetToBeOptedIn( diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 595e01100a..8525f4ed74 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -666,46 +666,53 @@ func TestGetAllOptedIn(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - expectedOptedInValidators := []types.OptedInValidator{ + expectedOptedInValidators := []types.ConsumerValidator{ { - ProviderAddr: []byte("providerAddr1"), - BlockHeight: 1, - Power: 2, - PublicKey: []byte{3}, + ProviderConsAddr: []byte("providerAddr1"), + Power: 2, + ConsumerPublicKey: &tmprotocrypto.PublicKey{ + Sum: &tmprotocrypto.PublicKey_Ed25519{ + Ed25519: []byte{3}, + }, + }, }, { - ProviderAddr: []byte("providerAddr2"), - BlockHeight: 2, - Power: 3, - PublicKey: []byte{4}, + ProviderConsAddr: []byte("providerAddr2"), + Power: 3, + ConsumerPublicKey: &tmprotocrypto.PublicKey{ + Sum: &tmprotocrypto.PublicKey_Ed25519{ + Ed25519: []byte{4}, + }, + }, }, { - ProviderAddr: []byte("providerAddr3"), - BlockHeight: 3, - Power: 4, - PublicKey: []byte{5}, + ProviderConsAddr: []byte("providerAddr3"), + Power: 4, + ConsumerPublicKey: &tmprotocrypto.PublicKey{ + Sum: &tmprotocrypto.PublicKey_Ed25519{ + Ed25519: []byte{5}, + }, + }, }, } for _, expectedOptedInValidator := range expectedOptedInValidators { providerKeeper.SetOptedIn(ctx, "chainID", - types.OptedInValidator{ - ProviderAddr: expectedOptedInValidator.ProviderAddr, - BlockHeight: expectedOptedInValidator.BlockHeight, - Power: expectedOptedInValidator.Power, - PublicKey: expectedOptedInValidator.PublicKey, + types.ConsumerValidator{ + ProviderConsAddr: expectedOptedInValidator.ProviderConsAddr, + Power: expectedOptedInValidator.Power, + ConsumerPublicKey: expectedOptedInValidator.ConsumerPublicKey, }) } actualOptedInValidators := providerKeeper.GetAllOptedIn(ctx, "chainID") // sort validators first to be able to compare - sortOptedInValidators := func(optedInValidators []types.OptedInValidator) { + sortOptedInValidators := func(optedInValidators []types.ConsumerValidator) { sort.Slice(optedInValidators, func(i int, j int) bool { a := optedInValidators[i] b := optedInValidators[j] - return a.BlockHeight < b.BlockHeight || - (a.BlockHeight == b.BlockHeight && bytes.Compare(a.ProviderAddr, b.ProviderAddr) < 0) + return bytes.Compare(a.ProviderConsAddr, b.ProviderConsAddr) < 0 }) } sortOptedInValidators(expectedOptedInValidators) @@ -718,17 +725,20 @@ func TestOptedIn(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - optedInValidator := types.OptedInValidator{ProviderAddr: []byte("providerAddr"), - BlockHeight: 1, - Power: 2, - PublicKey: []byte{3}, + optedInValidator := types.ConsumerValidator{ProviderConsAddr: []byte("providerAddr"), + Power: 2, + ConsumerPublicKey: &tmprotocrypto.PublicKey{ + Sum: &tmprotocrypto.PublicKey_Ed25519{ + Ed25519: []byte{3}, + }, + }, } - require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderAddr))) + require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderConsAddr))) providerKeeper.SetOptedIn(ctx, "chainID", optedInValidator) - 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))) + require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderConsAddr))) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderConsAddr)) + require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderConsAddr))) } func TestGetAllToBeOptedIn(t *testing.T) { diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index a6b2ec45e7..82a987018b 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "github.com/cometbft/cometbft/proto/tendermint/crypto" "testing" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -33,9 +34,12 @@ 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", - types.OptedInValidator{ProviderAddr: providerAddr.ToSdkConsAddr(), BlockHeight: 1, Power: 1, PublicKey: []byte{1}}) + types.ConsumerValidator{ProviderConsAddr: providerAddr.ToSdkConsAddr(), Power: 1, ConsumerPublicKey: &crypto.PublicKey{ + Sum: &crypto.PublicKey_Ed25519{ + Ed25519: []byte{1}, + }, + }}) providerKeeper.HandleOptIn(ctx, "chainID", providerAddr, nil) require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) } diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 939f6d3995..14c4e9c712 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -222,7 +222,20 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { for _, chain := range k.GetAllConsumerChains(ctx) { currentValidators := k.GetConsumerValSet(ctx, chain.ChainId) - nextValidators := k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators) + + var nextValidators []providertypes.ConsumerValidator + + if k.IsTopN(ctx, chain.ChainId) { + topN, _ := k.GetTopN(ctx, chain.ChainId) + threshold := sdk.NewDec(int64(topN)).QuoInt64(100) + k.OptInValidators(ctx, chain.ChainId, threshold, bondedValidators) + } + + if k.IsOptIn(ctx, chain.ChainId) || k.IsTopN(ctx, chain.ChainId) { + //nextValidators = k.ComputeNextEpochOptedInConsumerValSet(ctx, chain.ChainId) + } else { + nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators) + } valUpdates := DiffValidators(currentValidators, nextValidators) k.SetConsumerValSet(ctx, chain.ChainId, nextValidators) diff --git a/x/ccv/provider/keeper/validator_set_update.go b/x/ccv/provider/keeper/validator_set_update.go index 71238d210d..ae6d6fbf5d 100644 --- a/x/ccv/provider/keeper/validator_set_update.go +++ b/x/ccv/provider/keeper/validator_set_update.go @@ -1,11 +1,13 @@ package keeper import ( + "cosmossdk.io/math" "fmt" abci "github.com/cometbft/cometbft/abci/types" 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" + "sort" ) // SetConsumerValidator sets provided consumer `validator` on the consumer chain with `chainID` @@ -176,3 +178,111 @@ func (k Keeper) SetConsumerValSet(ctx sdk.Context, chainID string, nextValidator k.SetConsumerValidator(ctx, chainID, val) } } + +// ComputeNextEpochOptedInConsumerValSet returns the next validator set that is responsible for validating consumer +// chain `chainID`, based on the bonded validators. +func (k Keeper) ComputeNextEpochOptedInConsumerValSet( + ctx sdk.Context, + chainID string, +) []types.ConsumerValidator { + var nextValidators []types.ConsumerValidator + for _, val := range k.GetAllOptedIn(ctx, chainID) { + // get next voting power and the next consumer public key + providerAddress := types.ProviderConsAddress{Address: val.ProviderConsAddr} + stakingValidator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerAddress.ToSdkConsAddr()) + if !found { + // this should never happen but is recoverable if we exclude this validator from the `nextValidators` + k.Logger(ctx).Error("could not get consensus address of validator", + "validator", stakingValidator.GetOperator().String()) + + fmt.Println("..") + } + nextPower := k.stakingKeeper.GetLastValidatorPower(ctx, stakingValidator.GetOperator()) + nextConsumerPublicKey, foundConsumerPublicKey := k.GetValidatorConsumerPubKey(ctx, chainID, providerAddress) + if !foundConsumerPublicKey { + // if no consumer key assigned then use the validator's key itself + k.Logger(ctx).Info("could not retrieve public key for validator on consumer chain because"+ + " the validator did not assign a new consumer key", + "validator", stakingValidator.GetOperator().String(), + "chainID", chainID) + var err error + nextConsumerPublicKey, err = stakingValidator.TmConsPublicKey() + if err != nil { + // this should never happen and might not be recoverable because without the public key + // we cannot generate a validator update + panic(fmt.Errorf("could not retrieve validator's (%+v) public key: %w", val, err)) + } + } + + nextValidator := types.ConsumerValidator{ + ProviderConsAddr: val.ProviderConsAddr, + Power: nextPower, + ConsumerPublicKey: &nextConsumerPublicKey, + } + nextValidators = append(nextValidators, nextValidator) + } + + return nextValidators +} + +func (k Keeper) OptInValidators(ctx sdk.Context, chainID string, threshold math.LegacyDec, bondedValidators []stakingtypes.Validator) { + powerStop := k.ComputePowerThreshold(ctx, bondedValidators, threshold) + + for _, val := range bondedValidators { + power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) + if power >= powerStop { + consAddr, err := val.GetConsAddr() + _ = err // fIXME + nextConsumerPublicKey, foundConsumerPublicKey := k.GetValidatorConsumerPubKey(ctx, chainID, types.NewProviderConsAddress(consAddr)) + if !foundConsumerPublicKey { + // if no consumer key assigned then use the validator's key itself + k.Logger(ctx).Info("could not retrieve public key for validator on consumer chain because"+ + " the validator did not assign a new consumer key", + "validator", val.GetOperator().String(), + "chainID", chainID) + nextConsumerPublicKey, err = val.TmConsPublicKey() + if err != nil { + // this should never happen and might not be recoverable because without the public key + // we cannot generate a validator update + panic(fmt.Errorf("could not retrieve validator's (%+v) public key: %w", val, err)) + } + } + // if validator already exists it gets overwritten + k.SetOptedIn(ctx, chainID, types.ConsumerValidator{ + ProviderConsAddr: consAddr, + Power: power, + ConsumerPublicKey: &nextConsumerPublicKey, + }) + } else { + // validators that are not on the top N and habe opte din remain opted in, + } + } +} + +func (k Keeper) ComputePowerThreshold(ctx sdk.Context, + bondedValidators []stakingtypes.Validator, + threshold math.LegacyDec, +) int64 { + totalPower := int64(0) + var powers []int64 + for _, val := range bondedValidators { + power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) + powers = append(powers, power) + totalPower = totalPower + power + } + + // sort by powers ascending + sort.SliceStable(powers, func(i, j int) bool { + return powers[i] < powers[j] + }) + + powerSum := sdk.ZeroDec() + for _, power := range powers { + powerSum = powerSum.Add(sdk.NewDecFromInt(sdk.NewInt(power))) + if powerSum.Quo(sdk.NewDecFromInt(sdk.NewInt(totalPower))).GT(threshold) { + return power + } + } + + panic("UpdateSoftOptOutThresholdPower should not reach this point. Incorrect logic!") +} diff --git a/x/ccv/provider/keeper/validator_set_update_test.go b/x/ccv/provider/keeper/validator_set_update_test.go index 8505158816..40a22704fa 100644 --- a/x/ccv/provider/keeper/validator_set_update_test.go +++ b/x/ccv/provider/keeper/validator_set_update_test.go @@ -162,7 +162,7 @@ func TestComputeNextEpochConsumerValSet(t *testing.T) { }) bondedValidators := []stakingtypes.Validator{valA, valB} - actualValidators := providerKeeper.ComputeNextEpochConsumerValSet(ctx, "chainID", bondedValidators) + actualValidators := providerKeeper.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators) require.Equal(t, expectedValidators, actualValidators) } @@ -353,3 +353,82 @@ func TestSetConsumerValSet(t *testing.T) { sortValidators(nextCurrentValidators) require.Equal(t, nextValidators, nextCurrentValidators) } + +func TestComputeNextEpochOptedInConsumerValSet(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + chainID := "chainID" + + // helper function to generate a validator with the given power and with a provider address based on index + createStakingValidator := func(ctx sdk.Context, mocks testkeeper.MockedKeepers, index int, power int64) stakingtypes.Validator { + providerConsPubKey := ed25519.GenPrivKeyFromSecret([]byte{byte(index)}).PubKey() + consAddr := sdk.ConsAddress(providerConsPubKey.Address()) + providerAddr := types.NewProviderConsAddress(consAddr) + pk, _ := cryptocodec.FromTmPubKeyInterface(providerConsPubKey) + pkAny, _ := codectypes.NewAnyWithValue(pk) + + var providerValidatorAddr sdk.ValAddress + providerValidatorAddr = providerAddr.Address.Bytes() + + mocks.MockStakingKeeper.EXPECT(). + GetLastValidatorPower(ctx, providerValidatorAddr).Return(power).AnyTimes() + + stakingValidator := stakingtypes.Validator{ + OperatorAddress: providerValidatorAddr.String(), + ConsensusPubkey: pkAny, + } + + mocks.MockStakingKeeper.EXPECT(). + GetValidatorByConsAddr(ctx, consAddr).Return(stakingValidator, true).AnyTimes() + + return stakingValidator + } + + // no consumer validators returned if we have no opted-in validators + require.Empty(t, providerKeeper.ComputeNextEpochOptedInConsumerValSet(ctx, chainID)) + + var expectedValidators []types.ConsumerValidator + + // create a staking validator A that has not set a consumer public key + valA := createStakingValidator(ctx, mocks, 1, 1) + // because validator A has no consumer key set, the `ConsumerPublicKey` we expect is the key on the provider chain + valAConsAddr, _ := valA.GetConsAddr() + valAPublicKey, _ := valA.TmConsPublicKey() + expectedValAConsumerValidator := types.ConsumerValidator{ + ProviderConsAddr: types.NewProviderConsAddress(valAConsAddr).Address.Bytes(), + Power: 1, + ConsumerPublicKey: &valAPublicKey} + expectedValidators = append(expectedValidators, expectedValAConsumerValidator) + + // create a staking validator B that has set a consumer public key + valB := createStakingValidator(ctx, mocks, 2, 2) + // validator B has set a consumer key, the `ConsumerPublicKey` we expect is the key set by `SetValidatorConsumerPubKey` + valBConsumerKey := cryptotestutil.NewCryptoIdentityFromIntSeed(1).TMProtoCryptoPublicKey() + valBConsAddr, _ := valB.GetConsAddr() + providerKeeper.SetValidatorConsumerPubKey(ctx, chainID, types.NewProviderConsAddress(valBConsAddr), valBConsumerKey) + expectedValBConsumerValidator := types.ConsumerValidator{ + ProviderConsAddr: types.NewProviderConsAddress(valBConsAddr).Address.Bytes(), + Power: 2, + ConsumerPublicKey: &valBConsumerKey, + } + expectedValidators = append(expectedValidators, expectedValBConsumerValidator) + + // opt in validators A and B with 0 power and no consumer public keys + providerKeeper.SetOptedIn(ctx, chainID, types.ConsumerValidator{ProviderConsAddr: valAConsAddr, Power: 0, ConsumerPublicKey: nil}) + providerKeeper.SetOptedIn(ctx, chainID, types.ConsumerValidator{ProviderConsAddr: valBConsAddr, Power: 0, ConsumerPublicKey: nil}) + + // the expected actual validators are the opted-in validators but with the correct power and consumer public keys set + actualValidators := providerKeeper.ComputeNextEpochOptedInConsumerValSet(ctx, "chainID") + + // sort validators first to be able to compare + sortValidators := func(validators []types.ConsumerValidator) { + sort.Slice(validators, func(i, j int) bool { + return bytes.Compare(validators[i].ProviderConsAddr, validators[j].ProviderConsAddr) < 0 + }) + } + + sortValidators(actualValidators) + sortValidators(expectedValidators) + require.Equal(t, expectedValidators, actualValidators) +} diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 998608ef18..edc5c43c86 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -154,9 +154,6 @@ const ( // that corresponds to the N% of the top validators that have to validate this consumer chain TopNBytePrefix - // OptedInBytePrefix is the byte prefix used when storing for each consumer chain all the opted in validators - OptedInBytePrefix - // ToBeOptedInBytePrefix is the byte prefix used when storing for each consumer chain the validators that // are about to be opted in ToBeOptedInBytePrefix @@ -550,12 +547,6 @@ func TopNKey(chainID string) []byte { return ChainIdWithLenKey(TopNBytePrefix, chainID) } -// OptedInKey returns the key of consumer chain `chainID` and validator with `providerAddr` -func OptedInKey(chainID string, providerAddr []byte) []byte { - prefix := ChainIdWithLenKey(OptedInBytePrefix, chainID) - return append(prefix, providerAddr...) -} - // ToBeOptedInKey returns the key of consumer chain `chainID` and validator with `providerAddr` func ToBeOptedInKey(chainID string, providerAddr ProviderConsAddress) []byte { prefix := ChainIdWithLenKey(ToBeOptedInBytePrefix, chainID) diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index c2771de119..dee8a9520a 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -1513,80 +1513,6 @@ func (m *ConsumerRewardsAllocation) GetRewards() github_com_cosmos_cosmos_sdk_ty return nil } -// OptedInValidator is used to store a opted-in validator -// to a consumer chain with the following mapping: (chainID, providerAddr) -> optedInValidator -type OptedInValidator struct { - // validator address - ProviderAddr []byte `protobuf:"bytes,1,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty"` - // block height at which the validator opted-in - BlockHeight int64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - // validator voting power at the block it opted-in - 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"` -} - -func (m *OptedInValidator) Reset() { *m = OptedInValidator{} } -func (m *OptedInValidator) String() string { return proto.CompactTextString(m) } -func (*OptedInValidator) ProtoMessage() {} -func (*OptedInValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{24} -} -func (m *OptedInValidator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *OptedInValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_OptedInValidator.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 *OptedInValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_OptedInValidator.Merge(m, src) -} -func (m *OptedInValidator) XXX_Size() int { - return m.Size() -} -func (m *OptedInValidator) XXX_DiscardUnknown() { - xxx_messageInfo_OptedInValidator.DiscardUnknown(m) -} - -var xxx_messageInfo_OptedInValidator proto.InternalMessageInfo - -func (m *OptedInValidator) GetProviderAddr() []byte { - if m != nil { - return m.ProviderAddr - } - return nil -} - -func (m *OptedInValidator) GetBlockHeight() int64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *OptedInValidator) GetPower() int64 { - if m != nil { - return m.Power - } - return 0 -} - -func (m *OptedInValidator) GetPublicKey() []byte { - if m != nil { - return m.PublicKey - } - return nil -} - func init() { proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") @@ -1612,7 +1538,6 @@ func init() { proto.RegisterType((*ConsumerAddrsToPrune)(nil), "interchain_security.ccv.provider.v1.ConsumerAddrsToPrune") proto.RegisterType((*ConsumerValidator)(nil), "interchain_security.ccv.provider.v1.ConsumerValidator") proto.RegisterType((*ConsumerRewardsAllocation)(nil), "interchain_security.ccv.provider.v1.ConsumerRewardsAllocation") - proto.RegisterType((*OptedInValidator)(nil), "interchain_security.ccv.provider.v1.OptedInValidator") } func init() { @@ -1620,126 +1545,123 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1892 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, 0x1e, 0x19, 0xb1, 0x92, 0x27, 0x24, - 0x08, 0x82, 0x67, 0x90, 0x02, 0x55, 0x2e, 0x17, 0xa9, 0x94, 0xb4, 0x72, 0x62, 0x59, 0x89, 0xad, - 0x8c, 0x84, 0x5c, 0xc0, 0x61, 0xaa, 0xb7, 0xa7, 0xbd, 0xdb, 0xa5, 0xd9, 0xe9, 0x71, 0x77, 0xef, - 0x38, 0x7b, 0xe1, 0xcc, 0x85, 0x22, 0xdc, 0x52, 0x5c, 0x08, 0x54, 0x51, 0x45, 0x71, 0x81, 0x3f, - 0x23, 0xc7, 0x1c, 0x39, 0x25, 0x94, 0x7d, 0xe0, 0xc0, 0x95, 0x3f, 0x80, 0xea, 0x9e, 0xcf, 0x5d, - 0x49, 0x66, 0x5d, 0x81, 0x8b, 0x34, 0xf3, 0xfa, 0xbd, 0xdf, 0x7b, 0xfd, 0xbe, 0x77, 0x60, 0x8f, - 0x46, 0x92, 0x70, 0xdc, 0x43, 0x34, 0xf2, 0x05, 0xc1, 0x03, 0x4e, 0xe5, 0xd0, 0xc5, 0x38, 0x71, - 0x63, 0xce, 0x12, 0x1a, 0x10, 0xee, 0x26, 0xbb, 0xc5, 0xb3, 0x13, 0x73, 0x26, 0x99, 0xf9, 0xc6, - 0x15, 0x32, 0x0e, 0xc6, 0x89, 0x53, 0xf0, 0x25, 0xbb, 0x37, 0xdf, 0xbc, 0x0e, 0x38, 0xd9, 0x75, - 0x9f, 0x51, 0x4e, 0x52, 0xac, 0x9b, 0xeb, 0x5d, 0xd6, 0x65, 0xfa, 0xd1, 0x55, 0x4f, 0x19, 0x75, - 0xab, 0xcb, 0x58, 0x37, 0x24, 0xae, 0x7e, 0xeb, 0x0c, 0x9e, 0xb8, 0x92, 0xf6, 0x89, 0x90, 0xa8, - 0x1f, 0x67, 0x0c, 0xad, 0x71, 0x86, 0x60, 0xc0, 0x91, 0xa4, 0x2c, 0xca, 0x01, 0x68, 0x07, 0xbb, - 0x98, 0x71, 0x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 0x35, 0xe5, 0x2d, 0x66, 0x72, 0x29, - 0xd1, 0xbc, 0x05, 0x0b, 0x5d, 0x12, 0x11, 0x41, 0x85, 0xdf, 0x43, 0xa2, 0x67, 0xcd, 0x6c, 0x1b, - 0x3b, 0x0b, 0x5e, 0x33, 0xa3, 0xdd, 0x47, 0xa2, 0x67, 0x6e, 0x41, 0xb3, 0x43, 0x23, 0xc4, 0x87, - 0x29, 0xc7, 0xac, 0xe6, 0x80, 0x94, 0xa4, 0x19, 0xda, 0x00, 0x22, 0x46, 0xcf, 0x22, 0x5f, 0x25, - 0x80, 0x35, 0x97, 0x19, 0x92, 0x06, 0xdf, 0xc9, 0x83, 0xef, 0x9c, 0xe5, 0xd9, 0x71, 0x30, 0xaf, - 0x0c, 0xf9, 0xf4, 0xeb, 0x2d, 0xc3, 0x6b, 0x68, 0x39, 0x75, 0x62, 0x3e, 0x84, 0x95, 0x41, 0xd4, - 0x61, 0x51, 0x40, 0xa3, 0xae, 0x1f, 0x13, 0x4e, 0x59, 0x60, 0xcd, 0x6b, 0xa8, 0x8d, 0x4b, 0x50, - 0x87, 0x59, 0x1e, 0xa5, 0x48, 0x9f, 0x29, 0xa4, 0xe5, 0x42, 0xf8, 0x44, 0xcb, 0x9a, 0x1f, 0x83, - 0x89, 0x71, 0xa2, 0x4d, 0x62, 0x03, 0x99, 0x23, 0x36, 0x26, 0x47, 0x5c, 0xc1, 0x38, 0x39, 0x4b, - 0xa5, 0x33, 0xc8, 0x5f, 0xc0, 0x0d, 0xc9, 0x51, 0x24, 0x9e, 0x10, 0x3e, 0x8e, 0x0b, 0x93, 0xe3, - 0xbe, 0x96, 0x63, 0x8c, 0x82, 0xdf, 0x87, 0x6d, 0x9c, 0x25, 0x90, 0xcf, 0x49, 0x40, 0x85, 0xe4, - 0xb4, 0x33, 0x50, 0xb2, 0xfe, 0x13, 0x8e, 0xb0, 0xce, 0x91, 0xa6, 0x4e, 0x82, 0x56, 0xce, 0xe7, - 0x8d, 0xb0, 0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26, 0xc3, 0x7d, 0x21, 0x68, 0x37, 0xea, 0x93, 0x48, 0xaa, 0x1e, 0x88, 0x30, 0x51, 0x8f, - 0xe6, 0x1b, 0xb0, 0x58, 0xcc, 0x5c, 0x3d, 0x6a, 0x0d, 0x3d, 0x6a, 0x17, 0x72, 0xa2, 0x2a, 0x30, - 0xf3, 0x2e, 0x40, 0xcc, 0x49, 0xe2, 0x63, 0xff, 0x82, 0x0c, 0xb3, 0x28, 0x6e, 0x56, 0x47, 0x68, - 0xfa, 0x7b, 0xd2, 0x39, 0x19, 0x74, 0x42, 0x8a, 0x8f, 0xc9, 0xd0, 0x9b, 0x57, 0xfc, 0xed, 0x63, - 0x32, 0x54, 0x3b, 0x51, 0xcc, 0x9e, 0x11, 0xae, 0xe7, 0x5e, 0xcd, 0x4b, 0x5f, 0xec, 0xdf, 0x19, - 0x70, 0xa3, 0x08, 0x47, 0x9e, 0xae, 0x27, 0x83, 0x8e, 0x92, 0x78, 0x89, 0xdf, 0x2e, 0x59, 0x3b, - 0x7d, 0x85, 0xb5, 0xef, 0xc1, 0x42, 0x51, 0x20, 0xca, 0xde, 0xda, 0x04, 0xf6, 0x36, 0x73, 0x89, - 0x63, 0x32, 0xb4, 0x7f, 0x59, 0xb1, 0xed, 0x60, 0x58, 0xe9, 0x7d, 0xfc, 0xbf, 0xd8, 0x56, 0xa8, - 0xad, 0xda, 0x86, 0xab, 0xf2, 0x97, 0x2e, 0x50, 0xbb, 0x7c, 0x01, 0xfb, 0x0f, 0x06, 0xac, 0x57, - 0xb5, 0x8a, 0x33, 0x76, 0xc2, 0x07, 0x11, 0x79, 0x99, 0xf6, 0xb2, 0xfc, 0xa6, 0xab, 0xe5, 0xf7, - 0x18, 0x96, 0x46, 0x8c, 0x12, 0x99, 0x37, 0x7e, 0x38, 0x51, 0x8e, 0x55, 0xba, 0xab, 0xb7, 0x58, - 0xbd, 0x87, 0xb0, 0xff, 0x64, 0xc0, 0x6a, 0x6e, 0x63, 0xe1, 0x2c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0xf2, - 0x35, 0xcb, 0xac, 0xb9, 0x5d, 0x7c, 0x13, 0x4b, 0x7e, 0xe4, 0x7e, 0x32, 0xfa, 0xc5, 0x4d, 0x7b, - 0xa0, 0x33, 0xab, 0xfb, 0xfb, 0x3b, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x12, 0x76, 0xb8, - 0xa2, 0x13, 0x00, 0x00, + // 1852 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4d, 0x6f, 0x1c, 0xc7, + 0xd1, 0xe6, 0x70, 0x97, 0x1f, 0x5b, 0xcb, 0xcf, 0x21, 0x6d, 0x0d, 0xf5, 0xf2, 0x5d, 0x52, 0xe3, + 0xd8, 0x61, 0xa2, 0x68, 0x26, 0xa4, 0x13, 0x40, 0x10, 0x62, 0x18, 0xe4, 0x52, 0xb6, 0x28, 0xda, + 0x12, 0x3d, 0x64, 0x28, 0x24, 0x39, 0x0c, 0x7a, 0x7b, 0x5a, 0xbb, 0x0d, 0xce, 0x4e, 0x8f, 0xba, + 0x7b, 0x47, 0xde, 0x4b, 0xce, 0xb9, 0x04, 0x70, 0x6e, 0x46, 0x2e, 0x71, 0x02, 0x04, 0x08, 0x72, + 0x49, 0x7e, 0x86, 0x8f, 0x3e, 0xe6, 0x64, 0x07, 0xd2, 0x21, 0x87, 0x5c, 0xf3, 0x03, 0x82, 0xee, + 0xf9, 0xdc, 0x25, 0xa9, 0xac, 0xe0, 0xe4, 0x42, 0xce, 0x54, 0x57, 0x3d, 0x55, 0xdd, 0x55, 0xf5, + 0x54, 0xef, 0xc0, 0x1e, 0x8d, 0x24, 0xe1, 0xb8, 0x87, 0x68, 0xe4, 0x0b, 0x82, 0x07, 0x9c, 0xca, + 0xa1, 0x8b, 0x71, 0xe2, 0xc6, 0x9c, 0x25, 0x34, 0x20, 0xdc, 0x4d, 0x76, 0x8b, 0x67, 0x27,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0x78, 0xf2, 0xe5, 0x8b, 0x96, 0xf1, + 0xd5, 0x8b, 0x96, 0xf1, 0xf7, 0x17, 0x2d, 0xe3, 0xb3, 0x97, 0xad, 0xa9, 0xaf, 0x5e, 0xb6, 0xa6, + 0xfe, 0xf6, 0xb2, 0x35, 0xf5, 0xf3, 0xf7, 0x2e, 0x83, 0x96, 0x39, 0xba, 0x53, 0x7c, 0x81, 0x4a, + 0x7e, 0xe4, 0x7e, 0x3a, 0xfa, 0x7d, 0x4b, 0xfb, 0xeb, 0xcc, 0x6a, 0x36, 0x7d, 0xf7, 0xdf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x8f, 0xff, 0x87, 0xe4, 0x10, 0x13, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -2897,53 +2819,6 @@ func (m *ConsumerRewardsAllocation) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *OptedInValidator) 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 *OptedInValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OptedInValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintProvider(dAtA, i, uint64(len(m.PublicKey))) - i-- - dAtA[i] = 0x22 - } - if m.Power != 0 { - i = encodeVarintProvider(dAtA, i, uint64(m.Power)) - i-- - dAtA[i] = 0x18 - } - if m.BlockHeight != 0 { - i = encodeVarintProvider(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x10 - } - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintProvider(dAtA, i, uint64(len(m.ProviderAddr))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintProvider(dAtA []byte, offset int, v uint64) int { offset -= sovProvider(v) base := offset @@ -3453,29 +3328,6 @@ func (m *ConsumerRewardsAllocation) Size() (n int) { return n } -func (m *OptedInValidator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProviderAddr) - if l > 0 { - n += 1 + l + sovProvider(uint64(l)) - } - if m.BlockHeight != 0 { - n += 1 + sovProvider(uint64(m.BlockHeight)) - } - if m.Power != 0 { - n += 1 + sovProvider(uint64(m.Power)) - } - l = len(m.PublicKey) - if l > 0 { - n += 1 + l + sovProvider(uint64(l)) - } - return n -} - func sovProvider(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7011,162 +6863,6 @@ func (m *ConsumerRewardsAllocation) Unmarshal(dAtA []byte) error { } return nil } -func (m *OptedInValidator) 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 ErrIntOverflowProvider - } - 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: OptedInValidator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OptedInValidator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProvider - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProvider - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProviderAddr = append(m.ProviderAddr[:0], dAtA[iNdEx:postIndex]...) - if m.ProviderAddr == nil { - m.ProviderAddr = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) - } - m.BlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - 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 ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Power |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProvider - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProvider - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProvider(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProvider - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipProvider(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 016224219fc0a2f9453cc5c22e1ec0fc9a889b48 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 13 Mar 2024 12:58:34 +0100 Subject: [PATCH 02/36] nit change --- x/ccv/provider/keeper/relay.go | 8 +++----- x/ccv/provider/keeper/relay_test.go | 6 ++++++ x/ccv/provider/keeper/validator_set_update.go | 9 +++++---- x/ccv/provider/types/keys_test.go | 1 - 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 14c4e9c712..761c73614d 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -225,17 +225,15 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { var nextValidators []providertypes.ConsumerValidator + k.SetTopN(ctx, chain.ChainId, 100) if k.IsTopN(ctx, chain.ChainId) { topN, _ := k.GetTopN(ctx, chain.ChainId) threshold := sdk.NewDec(int64(topN)).QuoInt64(100) k.OptInValidators(ctx, chain.ChainId, threshold, bondedValidators) } - if k.IsOptIn(ctx, chain.ChainId) || k.IsTopN(ctx, chain.ChainId) { - //nextValidators = k.ComputeNextEpochOptedInConsumerValSet(ctx, chain.ChainId) - } else { - nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators) - } + nextValidators = k.ComputeNextEpochOptedInConsumerValSet(ctx, chain.ChainId) + // nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators) valUpdates := DiffValidators(currentValidators, nextValidators) k.SetConsumerValSet(ctx, chain.ChainId, nextValidators) diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index b7e89b3dc2..b193e76514 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -672,6 +672,12 @@ func TestEndBlockVSU(t *testing.T) { mocks.MockStakingKeeper.EXPECT().GetLastValidators(gomock.Any()).Return(lastValidators).AnyTimes() mocks.MockStakingKeeper.EXPECT().GetLastValidatorPower(gomock.Any(), gomock.Any()).Return(int64(2)).AnyTimes() + for _, val := range lastValidators { + consAddr, _ := val.GetConsAddr() + // FIXME: probably `consAddr` is not needed + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(gomock.Any(), consAddr).Return(val, true).AnyTimes() + } + // set a sample client for a consumer chain so that `GetAllConsumerChains` in `QueueVSCPackets` iterates at least once providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") diff --git a/x/ccv/provider/keeper/validator_set_update.go b/x/ccv/provider/keeper/validator_set_update.go index ae6d6fbf5d..47bcdd17ef 100644 --- a/x/ccv/provider/keeper/validator_set_update.go +++ b/x/ccv/provider/keeper/validator_set_update.go @@ -271,18 +271,19 @@ func (k Keeper) ComputePowerThreshold(ctx sdk.Context, totalPower = totalPower + power } - // sort by powers ascending + // sort by powers descending sort.SliceStable(powers, func(i, j int) bool { - return powers[i] < powers[j] + return powers[i] > powers[j] }) powerSum := sdk.ZeroDec() for _, power := range powers { powerSum = powerSum.Add(sdk.NewDecFromInt(sdk.NewInt(power))) - if powerSum.Quo(sdk.NewDecFromInt(sdk.NewInt(totalPower))).GT(threshold) { + // FIXME: problematic with equal power + if powerSum.Quo(sdk.NewDecFromInt(sdk.NewInt(totalPower))).GTE(threshold) { return power } } - panic("UpdateSoftOptOutThresholdPower should not reach this point. Incorrect logic!") + panic("...") } diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index f24c6ec476..d7cfd10fd4 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -58,7 +58,6 @@ func getAllKeyPrefixes() []byte { providertypes.ProposedConsumerChainByteKey, providertypes.ConsumerValidatorBytePrefix, providertypes.TopNBytePrefix, - providertypes.OptedInBytePrefix, providertypes.ToBeOptedInBytePrefix, providertypes.ToBeOptedOutBytePrefix, providertypes.ConsumerRewardsAllocationBytePrefix, From 7ad2993b731da7e5290be548b70dd1c9cd203d02 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 19 Mar 2024 13:50:04 +0100 Subject: [PATCH 03/36] cleaning up --- tests/mbt/driver/setup.go | 3 +- testutil/ibc_testing/generic_setup.go | 9 +- x/ccv/provider/keeper/keeper.go | 40 +++- x/ccv/provider/keeper/key_assignment_test.go | 5 +- x/ccv/provider/keeper/partial_set_security.go | 97 ++++++++ x/ccv/provider/keeper/proposal.go | 20 +- x/ccv/provider/keeper/relay.go | 23 +- x/ccv/provider/keeper/relay_test.go | 31 ++- x/ccv/provider/keeper/validator_set_update.go | 207 ++++-------------- .../keeper/validator_set_update_test.go | 186 +++++++++------- 10 files changed, 360 insertions(+), 261 deletions(-) diff --git a/tests/mbt/driver/setup.go b/tests/mbt/driver/setup.go index 6408f0e873..deeae01f6b 100644 --- a/tests/mbt/driver/setup.go +++ b/tests/mbt/driver/setup.go @@ -373,7 +373,8 @@ func (s *Driver) ConfigureNewPath(consumerChain, providerChain *ibctesting.TestC stakingValidators = append(stakingValidators, v) } - nextValidators := s.providerKeeper().ComputeNextEpochConsumerValSet(s.providerCtx(), string(consumerChainId), stakingValidators) + considerAll := func(validator stakingtypes.Validator) bool { return true } + nextValidators := s.providerKeeper().ComputeNextEpochConsumerValSet(s.providerCtx(), string(consumerChainId), stakingValidators, considerAll) s.providerKeeper().SetConsumerValSet(s.providerCtx(), string(consumerChainId), nextValidators) err = s.providerKeeper().SetConsumerGenesis( diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index da00d76b85..7a87e05ab1 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -140,6 +140,11 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( prop := testkeeper.GetTestConsumerAdditionProp() prop.ChainId = chainID prop.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient + + // set the consumer TopN here since the test suite setup only used the consumer addition prop + // to create the consumer genesis, see BeginBlockInit in /x/ccv/provider/keeper/proposal.go. + providerKeeper.SetTopN(providerChain.GetContext(), chainID, prop.Top_N) + // NOTE: the initial height passed to CreateConsumerClient // must be the height on the consumer when InitGenesis is called prop.InitialHeight = clienttypes.Height{RevisionNumber: 0, RevisionHeight: 3} @@ -149,10 +154,6 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( ) s.Require().NoError(err) - // set the consumer TopN here since the test suite setup only used the consumer addition prop - // to create the consumer genesis, see BeginBlockInit in /x/ccv/provider/keeper/proposal.go. - providerKeeper.SetTopN(providerChain.GetContext(), chainID, prop.Top_N) - // commit the state on the provider chain coordinator.CommitBlock(providerChain) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 154307dfef..a020082783 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1174,13 +1174,13 @@ func (k Keeper) GetTopN( return binary.BigEndian.Uint32(buf), true } -// IsTopN returns true if chain with `chainID` is a Top N chain (i.e., enforces at least one validator to validate chain `chainID`) +// IsTopN returns true if chain with `chainID` is a Top-N chain (i.e., enforces at least one validator to validate chain `chainID`) func (k Keeper) IsTopN(ctx sdk.Context, chainID string) bool { topN, found := k.GetTopN(ctx, chainID) return found && topN > 0 } -// IsOptIn returns true if chain with `chainID` is an Opt In chain (i.e., no validator is forced to validate chain `chainID`) +// IsOptIn returns true if chain with `chainID` is an Opt-In chain (i.e., no validator is forced to validate chain `chainID`) func (k Keeper) IsOptIn(ctx sdk.Context, chainID string) bool { topN, found := k.GetTopN(ctx, chainID) return !found || topN == 0 @@ -1326,6 +1326,24 @@ func (k Keeper) DeleteToBeOptedIn( store.Delete(types.ToBeOptedInKey(chainID, providerAddr)) } +// DeleteAllToBeOptedIn FIXME +func (k Keeper) DeleteAllToBeOptedIn( + ctx sdk.Context, + chainID string) { + store := ctx.KVStore(k.storeKey) + key := types.ChainIdWithLenKey(types.ToBeOptedInBytePrefix, chainID) + iterator := sdk.KVStorePrefixIterator(store, key) + + var keysToDel [][]byte + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + keysToDel = append(keysToDel, iterator.Key()) + } + for _, delKey := range keysToDel { + store.Delete(delKey) + } +} + func (k Keeper) IsToBeOptedIn( ctx sdk.Context, chainID string, @@ -1371,6 +1389,24 @@ func (k Keeper) DeleteToBeOptedOut( store.Delete(types.ToBeOptedOutKey(chainID, providerAddr)) } +// DeleteAllToBeOptedOut FIXME +func (k Keeper) DeleteAllToBeOptedOut( + ctx sdk.Context, + chainID string) { + store := ctx.KVStore(k.storeKey) + key := types.ChainIdWithLenKey(types.ToBeOptedOutBytePrefix, chainID) + iterator := sdk.KVStorePrefixIterator(store, key) + + var keysToDel [][]byte + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + keysToDel = append(keysToDel, iterator.Key()) + } + for _, delKey := range keysToDel { + store.Delete(delKey) + } +} + func (k Keeper) IsToBeOptedOut( ctx sdk.Context, chainID string, diff --git a/x/ccv/provider/keeper/key_assignment_test.go b/x/ccv/provider/keeper/key_assignment_test.go index 7cb222a3be..c603e6658b 100644 --- a/x/ccv/provider/keeper/key_assignment_test.go +++ b/x/ccv/provider/keeper/key_assignment_test.go @@ -766,7 +766,10 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { }) } - nextValidators := k.ComputeNextEpochConsumerValSet(ctx, CHAINID, bondedValidators) + nextValidators := k.ComputeNextEpochConsumerValSet(ctx, CHAINID, bondedValidators, + func(validator stakingtypes.Validator) bool { + return true + }) updates = providerkeeper.DiffValidators(k.GetConsumerValSet(ctx, CHAINID), nextValidators) k.SetConsumerValSet(ctx, CHAINID, nextValidators) diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index bf76e7d7c8..6b8fdf07f2 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -2,11 +2,15 @@ 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" + "sort" ) +// HandleOptIn prepares validator `providerAddr` to opt in to `chainID` with an optional `consumerKey` consumer public key. +// Note that the validator only opts in at the end of an epoch. func (k Keeper) HandleOptIn(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, consumerKey *string) error { if !k.IsConsumerProposedOrRegistered(ctx, chainID) { return errorsmod.Wrapf( @@ -42,6 +46,8 @@ func (k Keeper) HandleOptIn(ctx sdk.Context, chainID string, providerAddr types. return nil } +// HandleOptOut prepares validator `providerAddr` to opt out from running `chainID`. +// Note that the validator only opts out at the end of an epoch. func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress) error { if _, found := k.GetConsumerClientId(ctx, chainID); !found { // A validator can only opt out from a running chain. We check this by checking the consumer client id, because @@ -61,3 +67,94 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types return nil } + +// OptInToBeOptedInValidators opts in all the to-be-opted-in validators at the end of an epoch. +// Note that validators that are not currently active can still opt in but are filtered out at a later stage +// (e.g., `ComputeNextEpochConsumerValSet`) before we send the validator set to a consumer chain. +func (k Keeper) OptInToBeOptedInValidators(ctx sdk.Context, chainID string) { + for _, providerConsAddress := range k.GetAllToBeOptedIn(ctx, chainID) { + stakingValidator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerConsAddress.ToSdkConsAddr()) + if !found { + // this should never happen but is recoverable if we do not opt in this validator + k.Logger(ctx).Error("could not get validator by consensus address", + "consensus address", providerConsAddress.ToSdkConsAddr()) + continue + } + + consumerValidator, err := k.CreateConsumerValidator(ctx, chainID, stakingValidator) + if err != nil { + k.Logger(ctx).Error("could not create consumer validator", + "validator", stakingValidator.GetOperator().String(), + "error", err) + continue + } + + // if validator already exists it gets overwritten + k.SetOptedIn(ctx, chainID, consumerValidator) + } + + k.DeleteAllToBeOptedIn(ctx, chainID) +} + +// OptInToBeOptedInValidators opts out all the to-be-opted-out validators at the end of an epoch. +func (k Keeper) OptOutToBeOptedOutValidators(ctx sdk.Context, chainID string) { + for _, providerConsAddress := range k.GetAllToBeOptedOut(ctx, chainID) { + k.DeleteOptedIn(ctx, chainID, providerConsAddress) + } + + k.DeleteAllToBeOptedOut(ctx, chainID) +} + +// OptInTopNValidators opts in to `chainID` all the active validators that have power greater or equal to `powerThreshold` +func (k Keeper) OptInTopNValidators(ctx sdk.Context, chainID string, powerThreshold int64) { + for _, val := range k.stakingKeeper.GetLastValidators(ctx) { + power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) + if power >= powerThreshold { + consumerValidator, err := k.CreateConsumerValidator(ctx, chainID, val) + if err != nil { + k.Logger(ctx).Error("could not create consumer validator", + "validator", val.GetOperator().String(), + "error", err) + continue + } + // if validator already exists it gets overwritten + k.SetOptedIn(ctx, chainID, consumerValidator) + } else { + // validators that do not belong to the top N validators but were opted in, remain opted in + } + } +} + +// ComputePowerThreshold returns the Nth percentile based on the given `threshold` +func (k Keeper) ComputePowerThreshold(ctx sdk.Context, topN math.LegacyDec) int64 { + totalPower := sdk.ZeroDec() + var powers []int64 + + k.stakingKeeper.IterateLastValidatorPowers(ctx, func(addr sdk.ValAddress, power int64) (stop bool) { + powers = append(powers, power) + totalPower = totalPower.Add(sdk.NewDecFromInt(sdk.NewInt(power))) + return false + }) + + // sort by powers descending + sort.Slice(powers, func(i, j int) bool { + return powers[i] > powers[j] + }) + + powerSum := sdk.ZeroDec() + for _, power := range powers { + powerSum = powerSum.Add(sdk.NewDecFromInt(sdk.NewInt(power))) + if powerSum.Quo(totalPower).GTE(topN) { + return power + } + } + + // We should never reach this point because the topN can be up to 1.0 (100%) and in the above `for` loop we + // perform an equal comparison as well (`GTE`). In any case, we do not have to panic here because we can return + // the smallest possible power. + k.Logger(ctx).Error("should never reach this point", + "topN", topN, + "totalPower", totalPower, + "powerSum", powerSum) + return powers[len(powers)-1] +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index e8d50133ba..c89109b7be 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -289,7 +289,25 @@ func (k Keeper) MakeConsumerGenesis( bondedValidators = append(bondedValidators, val) } - nextValidators := k.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators) + var nextValidators []types.ConsumerValidator + + k.OptInToBeOptedInValidators(ctx, chainID) + + considerOnlyOptIn := func(validator stakingtypes.Validator) bool { + consAddr, err := validator.GetConsAddr() + if err != nil { + return false + } + return k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) + } + + if topN, found := k.GetTopN(ctx, chainID); found { + // in a Top-N chain, we automatically opt in all validators that belong to the top N + threshold := sdk.NewDec(int64(topN)).QuoInt64(100) + k.OptInTopNValidators(ctx, chainID, threshold) + } + + nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators, considerOnlyOptIn) k.SetConsumerValSet(ctx, chainID, nextValidators) // get the initial updates with the latest set consumer public keys diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 761c73614d..f1403ca21d 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -221,19 +221,28 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { bondedValidators := k.stakingKeeper.GetLastValidators(ctx) for _, chain := range k.GetAllConsumerChains(ctx) { - currentValidators := k.GetConsumerValSet(ctx, chain.ChainId) + // FIXME: add comment that this should take place before `OptInTopNValidators` + k.OptOutToBeOptedOutValidators(ctx, chain.ChainId) + k.OptInToBeOptedInValidators(ctx, chain.ChainId) + currentValidators := k.GetConsumerValSet(ctx, chain.ChainId) var nextValidators []providertypes.ConsumerValidator - k.SetTopN(ctx, chain.ChainId, 100) - if k.IsTopN(ctx, chain.ChainId) { - topN, _ := k.GetTopN(ctx, chain.ChainId) + considerOnlyOptIn := func(validator stakingtypes.Validator) bool { + consAddr, err := validator.GetConsAddr() + if err != nil { + return false + } + return k.IsOptedIn(ctx, chain.ChainId, providertypes.NewProviderConsAddress(consAddr)) + } + + if topN, found := k.GetTopN(ctx, chain.ChainId); found { + // in a Top-N chain, we automatically opt in all validators that belong to the top N threshold := sdk.NewDec(int64(topN)).QuoInt64(100) - k.OptInValidators(ctx, chain.ChainId, threshold, bondedValidators) + k.OptInTopNValidators(ctx, chain.ChainId, threshold) } - nextValidators = k.ComputeNextEpochOptedInConsumerValSet(ctx, chain.ChainId) - // nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators) + nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators, considerOnlyOptIn) valUpdates := DiffValidators(currentValidators, nextValidators) k.SetConsumerValSet(ctx, chain.ChainId, nextValidators) diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index b193e76514..c4f4423aff 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -659,6 +659,10 @@ func TestEndBlockVSU(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() + chainID := "chainID" + + providerKeeper.SetTopN(ctx, chainID, 100) + // 10 blocks constitute an epoch params := providertypes.DefaultParams() params.BlocksPerEpoch = 10 @@ -666,9 +670,24 @@ func TestEndBlockVSU(t *testing.T) { // create 4 sample lastValidators var lastValidators []stakingtypes.Validator + var valAddresses []sdk.ValAddress + var powers []int64 for i := 0; i < 4; i++ { - lastValidators = append(lastValidators, crypto.NewCryptoIdentityFromIntSeed(i).SDKStakingValidator()) + validator := crypto.NewCryptoIdentityFromIntSeed(i).SDKStakingValidator() + lastValidators = append(lastValidators, validator) + valAddresses = append(valAddresses, validator.GetOperator()) + powers = append(powers, int64(i+1)) } + + mocks.MockStakingKeeper.EXPECT().IterateLastValidatorPowers(gomock.Any(), gomock.Any()).DoAndReturn( + func(_ sdk.Context, cb func(addr sdk.ValAddress, power int64) (stop bool)) { + for i, addr := range valAddresses { + if cb(addr, powers[i]) { + break + } + } + }, + ).AnyTimes() mocks.MockStakingKeeper.EXPECT().GetLastValidators(gomock.Any()).Return(lastValidators).AnyTimes() mocks.MockStakingKeeper.EXPECT().GetLastValidatorPower(gomock.Any(), gomock.Any()).Return(int64(2)).AnyTimes() @@ -679,27 +698,27 @@ func TestEndBlockVSU(t *testing.T) { } // set a sample client for a consumer chain so that `GetAllConsumerChains` in `QueueVSCPackets` iterates at least once - providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") + providerKeeper.SetConsumerClientId(ctx, chainID, "clientID") // with block height of 1 we do not expect any queueing of VSC packets ctx = ctx.WithBlockHeight(1) providerKeeper.EndBlockVSU(ctx) - require.Equal(t, 0, len(providerKeeper.GetPendingVSCPackets(ctx, "chainID"))) + require.Equal(t, 0, len(providerKeeper.GetPendingVSCPackets(ctx, chainID))) // with block height of 5 we do not expect any queueing of VSC packets ctx = ctx.WithBlockHeight(5) providerKeeper.EndBlockVSU(ctx) - require.Equal(t, 0, len(providerKeeper.GetPendingVSCPackets(ctx, "chainID"))) + require.Equal(t, 0, len(providerKeeper.GetPendingVSCPackets(ctx, chainID))) // with block height of 10 we expect the queueing of one VSC packet ctx = ctx.WithBlockHeight(10) providerKeeper.EndBlockVSU(ctx) - require.Equal(t, 1, len(providerKeeper.GetPendingVSCPackets(ctx, "chainID"))) + require.Equal(t, 1, len(providerKeeper.GetPendingVSCPackets(ctx, chainID))) // With block height of 15 we expect no additional queueing of a VSC packet. // Note that the pending VSC packet is still there because `SendVSCPackets` does not send the packet. We // need to mock channels, etc. for this to work, and it's out of scope for this test. ctx = ctx.WithBlockHeight(15) providerKeeper.EndBlockVSU(ctx) - require.Equal(t, 1, len(providerKeeper.GetPendingVSCPackets(ctx, "chainID"))) + require.Equal(t, 1, len(providerKeeper.GetPendingVSCPackets(ctx, chainID))) } diff --git a/x/ccv/provider/keeper/validator_set_update.go b/x/ccv/provider/keeper/validator_set_update.go index 47bcdd17ef..aa04b4b4b3 100644 --- a/x/ccv/provider/keeper/validator_set_update.go +++ b/x/ccv/provider/keeper/validator_set_update.go @@ -1,13 +1,11 @@ package keeper import ( - "cosmossdk.io/math" "fmt" abci "github.com/cometbft/cometbft/abci/types" 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" - "sort" ) // SetConsumerValidator sets provided consumer `validator` on the consumer chain with `chainID` @@ -25,6 +23,15 @@ func (k Keeper) SetConsumerValidator( store.Set(types.ConsumerValidatorKey(chainID, validator.ProviderConsAddr), bz) } +// SetConsumerValSet resets the current consumer validators with the `nextValidators` computed by +// `ComputeNextEpochConsumerValSet` and hence this method should only be called after `ComputeNextEpochConsumerValSet` has completed. +func (k Keeper) SetConsumerValSet(ctx sdk.Context, chainID string, nextValidators []types.ConsumerValidator) { + k.DeleteConsumerValSet(ctx, chainID) + for _, val := range nextValidators { + k.SetConsumerValidator(ctx, chainID, val) + } +} + // DeleteConsumerValidator removes consumer validator with `providerAddr` address func (k Keeper) DeleteConsumerValidator( ctx sdk.Context, @@ -36,9 +43,7 @@ func (k Keeper) DeleteConsumerValidator( } // DeleteConsumerValSet deletes all the stored consumer validators for chain `chainID` -func (k Keeper) DeleteConsumerValSet( - ctx sdk.Context, - chainID string) { +func (k Keeper) DeleteConsumerValSet(ctx sdk.Context, chainID string) { store := ctx.KVStore(k.storeKey) key := types.ChainIdWithLenKey(types.ConsumerValidatorBytePrefix, chainID) iterator := sdk.KVStorePrefixIterator(store, key) @@ -55,19 +60,13 @@ func (k Keeper) DeleteConsumerValSet( // IsConsumerValidator returns `true` if the consumer validator with `providerAddr` exists for chain `chainID` // and `false` otherwise -func (k Keeper) IsConsumerValidator( - ctx sdk.Context, - chainID string, - providerAddr types.ProviderConsAddress, -) bool { +func (k Keeper) IsConsumerValidator(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress) bool { store := ctx.KVStore(k.storeKey) return store.Get(types.ConsumerValidatorKey(chainID, providerAddr.ToSdkConsAddr())) != nil } // GetConsumerValSet returns all the consumer validators for chain `chainID` -func (k Keeper) GetConsumerValSet( - ctx sdk.Context, - chainID string) (validators []types.ConsumerValidator) { +func (k Keeper) GetConsumerValSet(ctx sdk.Context, chainID string) (validators []types.ConsumerValidator) { store := ctx.KVStore(k.storeKey) key := types.ChainIdWithLenKey(types.ConsumerValidatorBytePrefix, chainID) iterator := sdk.KVStorePrefixIterator(store, key) @@ -85,51 +84,6 @@ func (k Keeper) GetConsumerValSet( return validators } -// ComputeNextEpochConsumerValSet returns the next validator set that is responsible for validating consumer -// chain `chainID`, based on the bonded validators. -func (k Keeper) ComputeNextEpochConsumerValSet( - ctx sdk.Context, - chainID string, - bondedValidators []stakingtypes.Validator, -) []types.ConsumerValidator { - var nextValidators []types.ConsumerValidator - for _, val := range bondedValidators { - // get next voting power and the next consumer public key - nextPower := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) - consAddr, err := val.GetConsAddr() - if err != nil { - // this should never happen but is recoverable if we exclude this validator from the `nextValidators` - k.Logger(ctx).Error("could not get consensus address of validator", - "validator", val.GetOperator().String(), - "error", err) - continue - } - nextConsumerPublicKey, foundConsumerPublicKey := k.GetValidatorConsumerPubKey(ctx, chainID, types.NewProviderConsAddress(consAddr)) - if !foundConsumerPublicKey { - // if no consumer key assigned then use the validator's key itself - k.Logger(ctx).Info("could not retrieve public key for validator on consumer chain because"+ - " the validator did not assign a new consumer key", - "validator", val.GetOperator().String(), - "chainID", chainID) - nextConsumerPublicKey, err = val.TmConsPublicKey() - if err != nil { - // this should never happen and might not be recoverable because without the public key - // we cannot generate a validator update - panic(fmt.Errorf("could not retrieve validator's (%+v) public key: %w", val, err)) - } - } - - nextValidator := types.ConsumerValidator{ - ProviderConsAddr: consAddr, - Power: nextPower, - ConsumerPublicKey: &nextConsumerPublicKey, - } - nextValidators = append(nextValidators, nextValidator) - } - - return nextValidators -} - // DiffValidators compares the current and the next epoch's consumer validators and returns the `ValidatorUpdate` diff // needed by CometBFT to update the validator set on a chain. func DiffValidators( @@ -170,120 +124,53 @@ func DiffValidators( return updates } -// SetConsumerValSet resets the current consumer validators with the `nextValidators` computed by -// `ComputeNextEpochConsumerValSet` and hence this method should only be called after `ComputeNextEpochConsumerValSet` has completed. -func (k Keeper) SetConsumerValSet(ctx sdk.Context, chainID string, nextValidators []types.ConsumerValidator) { - k.DeleteConsumerValSet(ctx, chainID) - for _, val := range nextValidators { - k.SetConsumerValidator(ctx, chainID, val) +// CreateConsumerValidator creates a consumer validator for `chainID` from the given staking `validator` +func (k Keeper) CreateConsumerValidator(ctx sdk.Context, chainID string, validator stakingtypes.Validator) (types.ConsumerValidator, error) { + power := k.stakingKeeper.GetLastValidatorPower(ctx, validator.GetOperator()) + consAddr, err := validator.GetConsAddr() + if err != nil { + return types.ConsumerValidator{}, fmt.Errorf("could not retrieve validator's (%+v) consensus address: %w", + validator, err) } -} - -// ComputeNextEpochOptedInConsumerValSet returns the next validator set that is responsible for validating consumer -// chain `chainID`, based on the bonded validators. -func (k Keeper) ComputeNextEpochOptedInConsumerValSet( - ctx sdk.Context, - chainID string, -) []types.ConsumerValidator { - var nextValidators []types.ConsumerValidator - for _, val := range k.GetAllOptedIn(ctx, chainID) { - // get next voting power and the next consumer public key - providerAddress := types.ProviderConsAddress{Address: val.ProviderConsAddr} - stakingValidator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerAddress.ToSdkConsAddr()) - if !found { - // this should never happen but is recoverable if we exclude this validator from the `nextValidators` - k.Logger(ctx).Error("could not get consensus address of validator", - "validator", stakingValidator.GetOperator().String()) - fmt.Println("..") - } - nextPower := k.stakingKeeper.GetLastValidatorPower(ctx, stakingValidator.GetOperator()) - nextConsumerPublicKey, foundConsumerPublicKey := k.GetValidatorConsumerPubKey(ctx, chainID, providerAddress) - if !foundConsumerPublicKey { - // if no consumer key assigned then use the validator's key itself - k.Logger(ctx).Info("could not retrieve public key for validator on consumer chain because"+ - " the validator did not assign a new consumer key", - "validator", stakingValidator.GetOperator().String(), - "chainID", chainID) - var err error - nextConsumerPublicKey, err = stakingValidator.TmConsPublicKey() - if err != nil { - // this should never happen and might not be recoverable because without the public key - // we cannot generate a validator update - panic(fmt.Errorf("could not retrieve validator's (%+v) public key: %w", val, err)) - } - } - - nextValidator := types.ConsumerValidator{ - ProviderConsAddr: val.ProviderConsAddr, - Power: nextPower, - ConsumerPublicKey: &nextConsumerPublicKey, + consumerPublicKey, foundConsumerPublicKey := k.GetValidatorConsumerPubKey(ctx, chainID, types.NewProviderConsAddress(consAddr)) + if !foundConsumerPublicKey { + consumerPublicKey, err = validator.TmConsPublicKey() + if err != nil { + return types.ConsumerValidator{}, fmt.Errorf("could not retrieve validator's (%+v) public key: %w", validator, err) } - nextValidators = append(nextValidators, nextValidator) } - return nextValidators + return types.ConsumerValidator{ + ProviderConsAddr: consAddr, + Power: power, + ConsumerPublicKey: &consumerPublicKey, + }, nil } -func (k Keeper) OptInValidators(ctx sdk.Context, chainID string, threshold math.LegacyDec, bondedValidators []stakingtypes.Validator) { - powerStop := k.ComputePowerThreshold(ctx, bondedValidators, threshold) - +// ComputeNextEpochConsumerValSet returns the next validator set that is responsible for validating consumer +// chain `chainID`. The next validator set corresponds to the `bondedValidator`s that `shouldConsider` evaluates to `true`. +func (k Keeper) ComputeNextEpochConsumerValSet( + ctx sdk.Context, + chainID string, + bondedValidators []stakingtypes.Validator, + shouldConsider func(validator stakingtypes.Validator) bool, +) []types.ConsumerValidator { + var nextValidators []types.ConsumerValidator for _, val := range bondedValidators { - power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) - if power >= powerStop { - consAddr, err := val.GetConsAddr() - _ = err // fIXME - nextConsumerPublicKey, foundConsumerPublicKey := k.GetValidatorConsumerPubKey(ctx, chainID, types.NewProviderConsAddress(consAddr)) - if !foundConsumerPublicKey { - // if no consumer key assigned then use the validator's key itself - k.Logger(ctx).Info("could not retrieve public key for validator on consumer chain because"+ - " the validator did not assign a new consumer key", + if shouldConsider(val) { + nextValidator, err := k.CreateConsumerValidator(ctx, chainID, val) + if err != nil { + // this should never happen but is recoverable if we exclude this validator from the next validator set + k.Logger(ctx).Error("could not create consumer validator", "validator", val.GetOperator().String(), - "chainID", chainID) - nextConsumerPublicKey, err = val.TmConsPublicKey() - if err != nil { - // this should never happen and might not be recoverable because without the public key - // we cannot generate a validator update - panic(fmt.Errorf("could not retrieve validator's (%+v) public key: %w", val, err)) - } + "error", err) + continue } - // if validator already exists it gets overwritten - k.SetOptedIn(ctx, chainID, types.ConsumerValidator{ - ProviderConsAddr: consAddr, - Power: power, - ConsumerPublicKey: &nextConsumerPublicKey, - }) - } else { - // validators that are not on the top N and habe opte din remain opted in, - } - } -} - -func (k Keeper) ComputePowerThreshold(ctx sdk.Context, - bondedValidators []stakingtypes.Validator, - threshold math.LegacyDec, -) int64 { - totalPower := int64(0) - var powers []int64 - for _, val := range bondedValidators { - power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) - powers = append(powers, power) - totalPower = totalPower + power - } - // sort by powers descending - sort.SliceStable(powers, func(i, j int) bool { - return powers[i] > powers[j] - }) - - powerSum := sdk.ZeroDec() - for _, power := range powers { - powerSum = powerSum.Add(sdk.NewDecFromInt(sdk.NewInt(power))) - // FIXME: problematic with equal power - if powerSum.Quo(sdk.NewDecFromInt(sdk.NewInt(totalPower))).GTE(threshold) { - return power + nextValidators = append(nextValidators, nextValidator) } } - panic("...") + return nextValidators } diff --git a/x/ccv/provider/keeper/validator_set_update_test.go b/x/ccv/provider/keeper/validator_set_update_test.go index 40a22704fa..7380d53f8d 100644 --- a/x/ccv/provider/keeper/validator_set_update_test.go +++ b/x/ccv/provider/keeper/validator_set_update_test.go @@ -107,65 +107,25 @@ func createConsumerValidator(index int, power int64, seed int) (types.ConsumerVa }, publicKey } -func TestComputeNextEpochConsumerValSet(t *testing.T) { - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - chainID := "chainID" - - // helper function to generate a validator with the given power and with a provider address based on index - createStakingValidator := func(ctx sdk.Context, mocks testkeeper.MockedKeepers, index int, power int64) stakingtypes.Validator { - providerConsPubKey := ed25519.GenPrivKeyFromSecret([]byte{byte(index)}).PubKey() - consAddr := sdk.ConsAddress(providerConsPubKey.Address()) - providerAddr := types.NewProviderConsAddress(consAddr) - pk, _ := cryptocodec.FromTmPubKeyInterface(providerConsPubKey) - pkAny, _ := codectypes.NewAnyWithValue(pk) - - var providerValidatorAddr sdk.ValAddress - providerValidatorAddr = providerAddr.Address.Bytes() - - mocks.MockStakingKeeper.EXPECT(). - GetLastValidatorPower(ctx, providerValidatorAddr).Return(power).AnyTimes() - - return stakingtypes.Validator{ - OperatorAddress: providerValidatorAddr.String(), - ConsensusPubkey: pkAny, - } +// createStakingValidator helper function to generate a validator with the given power and with a provider address based on index +func createStakingValidator(ctx sdk.Context, mocks testkeeper.MockedKeepers, index int, power int64) stakingtypes.Validator { + providerConsPubKey := ed25519.GenPrivKeyFromSecret([]byte{byte(index)}).PubKey() + consAddr := sdk.ConsAddress(providerConsPubKey.Address()) + providerAddr := types.NewProviderConsAddress(consAddr) + pk, _ := cryptocodec.FromTmPubKeyInterface(providerConsPubKey) + pkAny, _ := codectypes.NewAnyWithValue(pk) + + var providerValidatorAddr sdk.ValAddress + providerValidatorAddr = providerAddr.Address.Bytes() + + mocks.MockStakingKeeper.EXPECT(). + GetLastValidatorPower(ctx, providerValidatorAddr).Return(power).AnyTimes() + + return stakingtypes.Validator{ + OperatorAddress: providerValidatorAddr.String(), + ConsensusPubkey: pkAny, } - - // no consumer validators returned if we have no bonded validators - require.Empty(t, providerKeeper.ComputeNextEpochConsumerValSet(ctx, chainID, []stakingtypes.Validator{})) - - var expectedValidators []types.ConsumerValidator - - // create a staking validator A that has not set a consumer public key - valA := createStakingValidator(ctx, mocks, 1, 1) - // because validator A has no consumer key set, the `ConsumerPublicKey` we expect is the key on the provider chain - valAConsAddr, _ := valA.GetConsAddr() - valAPublicKey, _ := valA.TmConsPublicKey() - expectedValidators = append(expectedValidators, types.ConsumerValidator{ - ProviderConsAddr: types.NewProviderConsAddress(valAConsAddr).Address.Bytes(), - Power: 1, - ConsumerPublicKey: &valAPublicKey, - }) - - // create a staking validator B that has set a consumer public key - valB := createStakingValidator(ctx, mocks, 2, 2) - // validator B has set a consumer key, the `ConsumerPublicKey` we expect is the key set by `SetValidatorConsumerPubKey` - valBConsumerKey := cryptotestutil.NewCryptoIdentityFromIntSeed(1).TMProtoCryptoPublicKey() - valBConsAddr, _ := valB.GetConsAddr() - providerKeeper.SetValidatorConsumerPubKey(ctx, chainID, types.NewProviderConsAddress(valBConsAddr), valBConsumerKey) - expectedValidators = append(expectedValidators, types.ConsumerValidator{ - ProviderConsAddr: types.NewProviderConsAddress(valBConsAddr).Address.Bytes(), - Power: 2, - ConsumerPublicKey: &valBConsumerKey, - }) - - bondedValidators := []stakingtypes.Validator{valA, valB} - actualValidators := providerKeeper.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators) - require.Equal(t, expectedValidators, actualValidators) } - func TestDiff(t *testing.T) { // In what follows we create 6 validators: A, B, C, D, E, and F where currentValidators = {A, B, C, D, E} // and nextValidators = {B, C, D, E, F}. For the validators {B, C, D, E} in the intersection we have: @@ -354,39 +314,61 @@ func TestSetConsumerValSet(t *testing.T) { require.Equal(t, nextValidators, nextCurrentValidators) } -func TestComputeNextEpochOptedInConsumerValSet(t *testing.T) { +func TestComputeNextEpochConsumerValSetConsiderAll(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() chainID := "chainID" - // helper function to generate a validator with the given power and with a provider address based on index - createStakingValidator := func(ctx sdk.Context, mocks testkeeper.MockedKeepers, index int, power int64) stakingtypes.Validator { - providerConsPubKey := ed25519.GenPrivKeyFromSecret([]byte{byte(index)}).PubKey() - consAddr := sdk.ConsAddress(providerConsPubKey.Address()) - providerAddr := types.NewProviderConsAddress(consAddr) - pk, _ := cryptocodec.FromTmPubKeyInterface(providerConsPubKey) - pkAny, _ := codectypes.NewAnyWithValue(pk) + // no consumer validators returned if we have no bonded validators + considerAll := func(validator stakingtypes.Validator) bool { return true } + require.Empty(t, providerKeeper.ComputeNextEpochConsumerValSet(ctx, chainID, []stakingtypes.Validator{}, considerAll)) - var providerValidatorAddr sdk.ValAddress - providerValidatorAddr = providerAddr.Address.Bytes() + var expectedValidators []types.ConsumerValidator + + // create a staking validator A that has not set a consumer public key + valA := createStakingValidator(ctx, mocks, 1, 1) + // because validator A has no consumer key set, the `ConsumerPublicKey` we expect is the key on the provider chain + valAConsAddr, _ := valA.GetConsAddr() + valAPublicKey, _ := valA.TmConsPublicKey() + expectedValidators = append(expectedValidators, types.ConsumerValidator{ + ProviderConsAddr: types.NewProviderConsAddress(valAConsAddr).Address.Bytes(), + Power: 1, + ConsumerPublicKey: &valAPublicKey, + }) - mocks.MockStakingKeeper.EXPECT(). - GetLastValidatorPower(ctx, providerValidatorAddr).Return(power).AnyTimes() + // create a staking validator B that has set a consumer public key + valB := createStakingValidator(ctx, mocks, 2, 2) + // validator B has set a consumer key, the `ConsumerPublicKey` we expect is the key set by `SetValidatorConsumerPubKey` + valBConsumerKey := cryptotestutil.NewCryptoIdentityFromIntSeed(1).TMProtoCryptoPublicKey() + valBConsAddr, _ := valB.GetConsAddr() + providerKeeper.SetValidatorConsumerPubKey(ctx, chainID, types.NewProviderConsAddress(valBConsAddr), valBConsumerKey) + expectedValidators = append(expectedValidators, types.ConsumerValidator{ + ProviderConsAddr: types.NewProviderConsAddress(valBConsAddr).Address.Bytes(), + Power: 2, + ConsumerPublicKey: &valBConsumerKey, + }) - stakingValidator := stakingtypes.Validator{ - OperatorAddress: providerValidatorAddr.String(), - ConsensusPubkey: pkAny, - } + bondedValidators := []stakingtypes.Validator{valA, valB} + actualValidators := providerKeeper.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators, considerAll) + require.Equal(t, expectedValidators, actualValidators) +} - mocks.MockStakingKeeper.EXPECT(). - GetValidatorByConsAddr(ctx, consAddr).Return(stakingValidator, true).AnyTimes() +func TestComputeNextEpochConsumerValSetConsiderOnlyOptIn(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() - return stakingValidator - } + chainID := "chainID" // no consumer validators returned if we have no opted-in validators - require.Empty(t, providerKeeper.ComputeNextEpochOptedInConsumerValSet(ctx, chainID)) + considerOnlyOptIn := func(validator stakingtypes.Validator) bool { + consAddr, err := validator.GetConsAddr() + if err != nil { + return false + } + return providerKeeper.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) + } + require.Empty(t, providerKeeper.ComputeNextEpochConsumerValSet(ctx, chainID, []stakingtypes.Validator{}, considerOnlyOptIn)) var expectedValidators []types.ConsumerValidator @@ -419,7 +401,8 @@ func TestComputeNextEpochOptedInConsumerValSet(t *testing.T) { providerKeeper.SetOptedIn(ctx, chainID, types.ConsumerValidator{ProviderConsAddr: valBConsAddr, Power: 0, ConsumerPublicKey: nil}) // the expected actual validators are the opted-in validators but with the correct power and consumer public keys set - actualValidators := providerKeeper.ComputeNextEpochOptedInConsumerValSet(ctx, "chainID") + bondedValidators := []stakingtypes.Validator{valA, valB} + actualValidators := providerKeeper.ComputeNextEpochConsumerValSet(ctx, "chainID", bondedValidators, considerOnlyOptIn) // sort validators first to be able to compare sortValidators := func(validators []types.ConsumerValidator) { @@ -431,4 +414,49 @@ func TestComputeNextEpochOptedInConsumerValSet(t *testing.T) { sortValidators(actualValidators) sortValidators(expectedValidators) require.Equal(t, expectedValidators, actualValidators) + + // create a staking validator C that is not opted in, hence `expectedValidators` remains the same + valC := createStakingValidator(ctx, mocks, 3, 3) + bondedValidators = []stakingtypes.Validator{valA, valB, valC} + actualValidators = providerKeeper.ComputeNextEpochConsumerValSet(ctx, "chainID", bondedValidators, considerOnlyOptIn) + + sortValidators(actualValidators) + sortValidators(expectedValidators) + require.Equal(t, expectedValidators, actualValidators) +} + +func TestCreateConsumerValidator(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + chainID := "chainID" + + // create a validator which has set a consumer public key + valA := createStakingValidator(ctx, mocks, 0, 1) + valAConsumerKey := cryptotestutil.NewCryptoIdentityFromIntSeed(1).TMProtoCryptoPublicKey() + valAConsAddr, _ := valA.GetConsAddr() + valAProviderConsAddr := types.NewProviderConsAddress(valAConsAddr) + providerKeeper.SetValidatorConsumerPubKey(ctx, chainID, valAProviderConsAddr, valAConsumerKey) + actualConsumerValidatorA, err := providerKeeper.CreateConsumerValidator(ctx, chainID, valA) + expectedConsumerValidatorA := types.ConsumerValidator{ + ProviderConsAddr: valAProviderConsAddr.ToSdkConsAddr(), + Power: 1, + ConsumerPublicKey: &valAConsumerKey, + } + require.Equal(t, expectedConsumerValidatorA, actualConsumerValidatorA) + require.NoError(t, err) + + // create a validator which has not set a consumer public key + valB := createStakingValidator(ctx, mocks, 1, 2) + valBConsAddr, _ := valB.GetConsAddr() + valBProviderConsAddr := types.NewProviderConsAddress(valBConsAddr) + valBPublicKey, _ := valB.TmConsPublicKey() + actualConsumerValidatorB, err := providerKeeper.CreateConsumerValidator(ctx, chainID, valB) + expectedConsumerValidatorB := types.ConsumerValidator{ + ProviderConsAddr: valBProviderConsAddr.ToSdkConsAddr(), + Power: 2, + ConsumerPublicKey: &valBPublicKey, + } + require.Equal(t, expectedConsumerValidatorB, actualConsumerValidatorB) + require.NoError(t, err) } From 5cd5ba5b00e35abb1c6eb5fa4973fccda030a167 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 19 Mar 2024 15:43:33 +0100 Subject: [PATCH 04/36] clean up --- x/ccv/provider/keeper/distribution_test.go | 6 +- x/ccv/provider/keeper/hooks.go | 11 +- x/ccv/provider/keeper/hooks_test.go | 10 +- x/ccv/provider/keeper/keeper.go | 152 +------------- x/ccv/provider/keeper/keeper_test.go | 196 ++---------------- x/ccv/provider/keeper/partial_set_security.go | 86 ++------ .../keeper/partial_set_security_test.go | 131 +++++++++--- x/ccv/provider/keeper/proposal.go | 6 +- x/ccv/provider/keeper/relay.go | 8 +- .../keeper/validator_set_update_test.go | 4 +- x/ccv/provider/types/keys.go | 27 +-- x/ccv/provider/types/keys_test.go | 3 +- 12 files changed, 170 insertions(+), 470 deletions(-) diff --git a/x/ccv/provider/keeper/distribution_test.go b/x/ccv/provider/keeper/distribution_test.go index 64359e4fe4..c47dfd99e9 100644 --- a/x/ccv/provider/keeper/distribution_test.go +++ b/x/ccv/provider/keeper/distribution_test.go @@ -38,11 +38,7 @@ func TestComputeConsumerTotalVotingPower(t *testing.T) { keeper.SetOptedIn( ctx, chainID, - types.ConsumerValidator{ - ProviderConsAddr: val.Address, - Power: val.VotingPower, - //ConsumerPublicKey: val., FIXME - }, + types.NewProviderConsAddress(val.Address.Bytes()), ) validatorsVotes = append( diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index fcf8339187..bf5b718fe5 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -223,12 +223,13 @@ func (h Hooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr s return } - // in the validator is already to-be-opted in, the `SetToBeOptedIn` is a no-op - h.k.SetToBeOptedIn(ctx, chainID, providertypes.NewProviderConsAddress(consAddr)) + // in the validator is already opted in, the `SetOptedIn` is a no-op + h.k.SetOptedIn(ctx, chainID, providertypes.NewProviderConsAddress(consAddr)) } else { - // if vote is not a YES vote with 100% weight, we delete the validator from to-be-opted in - // if the validator is not to-be-opted in, the `DeleteToBeOptedIn` is a no-op - h.k.DeleteToBeOptedIn(ctx, chainID, providertypes.NewProviderConsAddress(consAddr)) + // If vote is not a YES vote with 100% weight, we opt out the validator. + // Note that a validator still gets opted out even if before it manually opted in with a `MsgOptIn` message. + // This is because if a validator wants to opt in, there's no reason to not vote YES with 100% weight. + h.k.DeleteOptedIn(ctx, chainID, providertypes.NewProviderConsAddress(consAddr)) } } diff --git a/x/ccv/provider/keeper/hooks_test.go b/x/ccv/provider/keeper/hooks_test.go index 140bb8a4ce..57a0113da7 100644 --- a/x/ccv/provider/keeper/hooks_test.go +++ b/x/ccv/provider/keeper/hooks_test.go @@ -249,9 +249,9 @@ func TestAfterProposalVoteWithYesVote(t *testing.T) { ), ) - require.False(t, k.IsToBeOptedIn(ctx, "chainID", providerAddr)) + require.False(t, k.IsOptedIn(ctx, "chainID", providerAddr)) k.Hooks().AfterProposalVote(ctx, 1, sdk.AccAddress{}) - require.True(t, k.IsToBeOptedIn(ctx, "chainID", providerAddr)) + require.True(t, k.IsOptedIn(ctx, "chainID", providerAddr)) } func TestAfterProposalVoteWithNoVote(t *testing.T) { @@ -304,10 +304,10 @@ func TestAfterProposalVoteWithNoVote(t *testing.T) { tc.setup(ctx, tc.options, mocks, pkAny) // set the validator to-be-opted in first to assert that a NO vote removes the validator from to-be-opted in - k.SetToBeOptedIn(ctx, "chainID", providerAddr) - require.True(t, k.IsToBeOptedIn(ctx, "chainID", providerAddr)) + k.SetOptedIn(ctx, "chainID", providerAddr) + require.True(t, k.IsOptedIn(ctx, "chainID", providerAddr)) k.Hooks().AfterProposalVote(ctx, 1, sdk.AccAddress{}) - require.False(t, k.IsToBeOptedIn(ctx, "chainID", providerAddr)) + require.False(t, k.IsOptedIn(ctx, "chainID", providerAddr)) }) } } diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index a020082783..789b20b7c1 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1189,15 +1189,10 @@ func (k Keeper) IsOptIn(ctx sdk.Context, chainID string) bool { func (k Keeper) SetOptedIn( ctx sdk.Context, chainID string, - validator types.ConsumerValidator, + providerConsAddress types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) - bz, err := validator.Marshal() - if err != nil { - panic(fmt.Errorf("failed to marshal OptedInValidator: %w", err)) - } - - store.Set(types.ConsumerValidatorKey(chainID, validator.ProviderConsAddr), bz) + store.Set(types.OptedInKey(chainID, providerConsAddress), []byte{}) } func (k Keeper) DeleteOptedIn( @@ -1206,7 +1201,7 @@ func (k Keeper) DeleteOptedIn( providerAddr types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerValidatorKey(chainID, providerAddr.ToSdkConsAddr())) + store.Delete(types.OptedInKey(chainID, providerAddr)) } func (k Keeper) IsOptedIn( @@ -1215,37 +1210,23 @@ func (k Keeper) IsOptedIn( providerAddr types.ProviderConsAddress, ) bool { store := ctx.KVStore(k.storeKey) - return store.Get(types.ConsumerValidatorKey(chainID, providerAddr.ToSdkConsAddr())) != nil + return store.Get(types.OptedInKey(chainID, providerAddr)) != nil } // GetAllOptedIn returns all the opted-in validators on chain `chainID` func (k Keeper) GetAllOptedIn( ctx sdk.Context, - chainID string) (consumerValidators []types.ConsumerValidator) { + chainID string) (providerConsAddresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.ConsumerValidatorBytePrefix, chainID) + key := types.ChainIdWithLenKey(types.OptedInBytePrefix, chainID) iterator := sdk.KVStorePrefixIterator(store, key) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - iterator.Value() - var consumerValidator types.ConsumerValidator - if err := consumerValidator.Unmarshal(iterator.Value()); err != nil { - panic(fmt.Errorf("failed to unmarshal ConsumerValidator: %w", err)) - } - consumerValidators = append(consumerValidators, consumerValidator) + providerConsAddresses = append(providerConsAddresses, types.NewProviderConsAddress(iterator.Key()[len(key):])) } - return consumerValidators -} - -func (k Keeper) SetToBeOptedIn( - ctx sdk.Context, - chainID string, - providerAddr types.ProviderConsAddress, -) { - store := ctx.KVStore(k.storeKey) - store.Set(types.ToBeOptedInKey(chainID, providerAddr), []byte{}) + return providerConsAddresses } // SetConsumerCommissionRate sets a per-consumer chain commission rate @@ -1316,120 +1297,3 @@ func (k Keeper) DeleteConsumerCommissionRate( store := ctx.KVStore(k.storeKey) store.Delete(types.ConsumerCommissionRateKey(chainID, providerAddr)) } - -func (k Keeper) DeleteToBeOptedIn( - ctx sdk.Context, - chainID string, - providerAddr types.ProviderConsAddress, -) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.ToBeOptedInKey(chainID, providerAddr)) -} - -// DeleteAllToBeOptedIn FIXME -func (k Keeper) DeleteAllToBeOptedIn( - ctx sdk.Context, - chainID string) { - store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.ToBeOptedInBytePrefix, chainID) - iterator := sdk.KVStorePrefixIterator(store, key) - - var keysToDel [][]byte - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - keysToDel = append(keysToDel, iterator.Key()) - } - for _, delKey := range keysToDel { - store.Delete(delKey) - } -} - -func (k Keeper) IsToBeOptedIn( - ctx sdk.Context, - chainID string, - providerAddr types.ProviderConsAddress, -) bool { - store := ctx.KVStore(k.storeKey) - return store.Get(types.ToBeOptedInKey(chainID, providerAddr)) != nil -} - -// GetAllToBeOptedIn returns all the to-be-opted-in validators on chain `chainID` -func (k Keeper) GetAllToBeOptedIn( - ctx sdk.Context, - chainID string) (addresses []types.ProviderConsAddress) { - - store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.ToBeOptedInBytePrefix, 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 -} - -func (k Keeper) SetToBeOptedOut( - ctx sdk.Context, - chainID string, - providerAddr types.ProviderConsAddress, -) { - store := ctx.KVStore(k.storeKey) - store.Set(types.ToBeOptedOutKey(chainID, providerAddr), []byte{}) -} - -func (k Keeper) DeleteToBeOptedOut( - ctx sdk.Context, - chainID string, - providerAddr types.ProviderConsAddress, -) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.ToBeOptedOutKey(chainID, providerAddr)) -} - -// DeleteAllToBeOptedOut FIXME -func (k Keeper) DeleteAllToBeOptedOut( - ctx sdk.Context, - chainID string) { - store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.ToBeOptedOutBytePrefix, chainID) - iterator := sdk.KVStorePrefixIterator(store, key) - - var keysToDel [][]byte - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - keysToDel = append(keysToDel, iterator.Key()) - } - for _, delKey := range keysToDel { - store.Delete(delKey) - } -} - -func (k Keeper) IsToBeOptedOut( - ctx sdk.Context, - chainID string, - providerAddr types.ProviderConsAddress, -) bool { - store := ctx.KVStore(k.storeKey) - return store.Get(types.ToBeOptedOutKey(chainID, providerAddr)) != nil -} - -// GetAllToBeOptedOut returns all the to-be-opted-out validators on chain `chainID` -func (k Keeper) GetAllToBeOptedOut( - ctx sdk.Context, - chainID string) (addresses []types.ProviderConsAddress) { - - store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.ToBeOptedOutBytePrefix, 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 -} diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 8525f4ed74..7cc777f287 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -666,53 +666,22 @@ func TestGetAllOptedIn(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - expectedOptedInValidators := []types.ConsumerValidator{ - { - ProviderConsAddr: []byte("providerAddr1"), - Power: 2, - ConsumerPublicKey: &tmprotocrypto.PublicKey{ - Sum: &tmprotocrypto.PublicKey_Ed25519{ - Ed25519: []byte{3}, - }, - }, - }, - { - ProviderConsAddr: []byte("providerAddr2"), - Power: 3, - ConsumerPublicKey: &tmprotocrypto.PublicKey{ - Sum: &tmprotocrypto.PublicKey_Ed25519{ - Ed25519: []byte{4}, - }, - }, - }, - { - ProviderConsAddr: []byte("providerAddr3"), - Power: 4, - ConsumerPublicKey: &tmprotocrypto.PublicKey{ - Sum: &tmprotocrypto.PublicKey_Ed25519{ - Ed25519: []byte{5}, - }, - }, - }, - } + expectedOptedInValidators := []types.ProviderConsAddress{ + types.NewProviderConsAddress([]byte("providerAddr1")), + types.NewProviderConsAddress([]byte("providerAddr2")), + types.NewProviderConsAddress([]byte("providerAddr3"))} for _, expectedOptedInValidator := range expectedOptedInValidators { - providerKeeper.SetOptedIn(ctx, "chainID", - types.ConsumerValidator{ - ProviderConsAddr: expectedOptedInValidator.ProviderConsAddr, - Power: expectedOptedInValidator.Power, - ConsumerPublicKey: expectedOptedInValidator.ConsumerPublicKey, - }) + providerKeeper.SetOptedIn(ctx, "chainID", expectedOptedInValidator) + } actualOptedInValidators := providerKeeper.GetAllOptedIn(ctx, "chainID") // sort validators first to be able to compare - sortOptedInValidators := func(optedInValidators []types.ConsumerValidator) { - sort.Slice(optedInValidators, func(i int, j int) bool { - a := optedInValidators[i] - b := optedInValidators[j] - return bytes.Compare(a.ProviderConsAddr, b.ProviderConsAddr) < 0 + sortOptedInValidators := func(addressess []types.ProviderConsAddress) { + sort.Slice(addressess, func(i int, j int) bool { + return bytes.Compare(addressess[i].ToSdkConsAddr(), addressess[j].ToSdkConsAddr()) < 0 }) } sortOptedInValidators(expectedOptedInValidators) @@ -725,150 +694,13 @@ func TestOptedIn(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - optedInValidator := types.ConsumerValidator{ProviderConsAddr: []byte("providerAddr"), - Power: 2, - ConsumerPublicKey: &tmprotocrypto.PublicKey{ - Sum: &tmprotocrypto.PublicKey_Ed25519{ - Ed25519: []byte{3}, - }, - }, - } + optedInValidator := types.NewProviderConsAddress([]byte("providerAddr")) - require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderConsAddr))) + require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator)) providerKeeper.SetOptedIn(ctx, "chainID", optedInValidator) - require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderConsAddr))) - providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderConsAddr)) - require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(optedInValidator.ProviderConsAddr))) -} - -func TestGetAllToBeOptedIn(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - expectedAddresses := []types.ProviderConsAddress{ - types.NewProviderConsAddress([]byte("providerAddr1")), - types.NewProviderConsAddress([]byte("providerAddr2")), - types.NewProviderConsAddress([]byte("providerAddr3"))} - - for _, addr := range expectedAddresses { - providerKeeper.SetToBeOptedIn(ctx, "chainID", addr) - } - - actualAddresses := providerKeeper.GetAllToBeOptedIn(ctx, "chainID") - - // sort addresses first to be able to compare - sortAddresses := func(addresses []types.ProviderConsAddress) { - sort.Slice(addresses, func(i int, j int) bool { - a := addresses[i] - b := addresses[j] - return bytes.Compare(a.Address.Bytes(), b.Address.Bytes()) < 0 - }) - } - sortAddresses(expectedAddresses) - sortAddresses(actualAddresses) - require.Equal(t, expectedAddresses, actualAddresses) - - for _, addr := range expectedAddresses { - require.True(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", addr)) - providerKeeper.DeleteToBeOptedIn(ctx, "chainID", addr) - require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", addr)) - } -} - -func TestBeOptedIn(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - expectedAddresses := []types.ProviderConsAddress{ - types.NewProviderConsAddress([]byte("providerAddr1")), - types.NewProviderConsAddress([]byte("providerAddr2")), - types.NewProviderConsAddress([]byte("providerAddr3"))} - - for _, addr := range expectedAddresses { - providerKeeper.SetToBeOptedIn(ctx, "chainID", addr) - } - - actualAddresses := providerKeeper.GetAllToBeOptedIn(ctx, "chainID") - - // sort addresses first to be able to compare - sortAddresses := func(addresses []types.ProviderConsAddress) { - sort.Slice(addresses, func(i int, j int) bool { - a := addresses[i] - b := addresses[j] - return bytes.Compare(a.Address.Bytes(), b.Address.Bytes()) < 0 - }) - } - sortAddresses(expectedAddresses) - sortAddresses(actualAddresses) - require.Equal(t, expectedAddresses, actualAddresses) - - for _, addr := range expectedAddresses { - require.True(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", addr)) - providerKeeper.DeleteToBeOptedIn(ctx, "chainID", addr) - require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", addr)) - } -} - -// TestToBeOptedIn tests the `SetToBeOptedIn`, `IsToBeOptedIn`, and `DeleteToBeOptedIn` methods -func TestToBeOptedIn(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - providerAddr := types.NewProviderConsAddress([]byte("providerAddr1")) - - require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) - providerKeeper.SetToBeOptedIn(ctx, "chainID", providerAddr) - require.True(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) - providerKeeper.DeleteToBeOptedIn(ctx, "chainID", providerAddr) - require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) -} - -func TestGetAllToBeOptedOut(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - expectedAddresses := []types.ProviderConsAddress{ - types.NewProviderConsAddress([]byte("providerAddr1")), - types.NewProviderConsAddress([]byte("providerAddr2")), - types.NewProviderConsAddress([]byte("providerAddr3"))} - - for _, addr := range expectedAddresses { - providerKeeper.SetToBeOptedOut(ctx, "chainID", addr) - } - - actualAddresses := providerKeeper.GetAllToBeOptedOut(ctx, "chainID") - - // sort addresses first to be able to compare - sortAddresses := func(addresses []types.ProviderConsAddress) { - sort.Slice(addresses, func(i int, j int) bool { - a := addresses[i] - b := addresses[j] - return bytes.Compare(a.Address.Bytes(), b.Address.Bytes()) < 0 - }) - } - sortAddresses(expectedAddresses) - sortAddresses(actualAddresses) - require.Equal(t, expectedAddresses, actualAddresses) - - for _, addr := range expectedAddresses { - require.True(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", addr)) - providerKeeper.DeleteToBeOptedOut(ctx, "chainID", addr) - require.False(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", addr)) - } -} - -// TestToBeOptedOut tests the `SetToBeOptedOut`, `IsToBeOptedOut`, and `DeleteToBeOptedOut` methods -func TestToBeOptedOut(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - providerAddr := types.NewProviderConsAddress([]byte("providerAddr1")) - - require.False(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) - providerKeeper.SetToBeOptedOut(ctx, "chainID", providerAddr) - require.True(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) - providerKeeper.DeleteToBeOptedOut(ctx, "chainID", providerAddr) - require.False(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) + require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator)) + providerKeeper.DeleteOptedIn(ctx, "chainID", optedInValidator) + require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator)) } // TestToBeOptedOut tests the `SetConsumerCommissionRate`, `GetConsumerCommissionRate`, and `DeleteConsumerCommissionRate` methods diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 6b8fdf07f2..4fe167d511 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -2,7 +2,6 @@ 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" @@ -18,13 +17,7 @@ func (k Keeper) HandleOptIn(ctx sdk.Context, chainID string, providerAddr types. "opting in to an unknown consumer chain, with id: %s", chainID) } - if k.IsToBeOptedOut(ctx, chainID, providerAddr) { - // a validator to be opted in cancels out with a validator to be opted out - k.DeleteToBeOptedOut(ctx, chainID, providerAddr) - } else if !k.IsToBeOptedIn(ctx, chainID, providerAddr) && !k.IsOptedIn(ctx, chainID, providerAddr) { - // a validator can only be set for opt in if it is not opted in and not already set for opt in - k.SetToBeOptedIn(ctx, chainID, providerAddr) - } + k.SetOptedIn(ctx, chainID, providerAddr) if consumerKey != nil { consumerTMPublicKey, err := k.ParseConsumerKey(*consumerKey) @@ -57,94 +50,53 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types "opting out of an unknown or not running consumer chain, with id: %s", chainID) } - if k.IsToBeOptedIn(ctx, chainID, providerAddr) { - // a validator to be opted out cancels out a validator to be opted in - k.DeleteToBeOptedIn(ctx, chainID, providerAddr) - } else if !k.IsToBeOptedOut(ctx, chainID, providerAddr) && k.IsOptedIn(ctx, chainID, providerAddr) { - // a validator can only be set for opt out if it is opted in and not already set for opt out - k.SetToBeOptedOut(ctx, chainID, providerAddr) - } - + k.DeleteOptedIn(ctx, chainID, providerAddr) return nil } -// OptInToBeOptedInValidators opts in all the to-be-opted-in validators at the end of an epoch. -// Note that validators that are not currently active can still opt in but are filtered out at a later stage -// (e.g., `ComputeNextEpochConsumerValSet`) before we send the validator set to a consumer chain. -func (k Keeper) OptInToBeOptedInValidators(ctx sdk.Context, chainID string) { - for _, providerConsAddress := range k.GetAllToBeOptedIn(ctx, chainID) { - stakingValidator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerConsAddress.ToSdkConsAddr()) - if !found { - // this should never happen but is recoverable if we do not opt in this validator - k.Logger(ctx).Error("could not get validator by consensus address", - "consensus address", providerConsAddress.ToSdkConsAddr()) - continue - } - - consumerValidator, err := k.CreateConsumerValidator(ctx, chainID, stakingValidator) - if err != nil { - k.Logger(ctx).Error("could not create consumer validator", - "validator", stakingValidator.GetOperator().String(), - "error", err) - continue - } - - // if validator already exists it gets overwritten - k.SetOptedIn(ctx, chainID, consumerValidator) - } - - k.DeleteAllToBeOptedIn(ctx, chainID) -} - -// OptInToBeOptedInValidators opts out all the to-be-opted-out validators at the end of an epoch. -func (k Keeper) OptOutToBeOptedOutValidators(ctx sdk.Context, chainID string) { - for _, providerConsAddress := range k.GetAllToBeOptedOut(ctx, chainID) { - k.DeleteOptedIn(ctx, chainID, providerConsAddress) - } - - k.DeleteAllToBeOptedOut(ctx, chainID) -} - -// OptInTopNValidators opts in to `chainID` all the active validators that have power greater or equal to `powerThreshold` -func (k Keeper) OptInTopNValidators(ctx sdk.Context, chainID string, powerThreshold int64) { - for _, val := range k.stakingKeeper.GetLastValidators(ctx) { +// OptInTopNValidators opts in to `chainID` all the `bondedValidators` that have at least `minPowerToOptIn` power +func (k Keeper) OptInTopNValidators(ctx sdk.Context, chainID string, bondedValidators []stakingtypes.Validator, minPowerToOptIn int64) { + for _, val := range bondedValidators { power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) - if power >= powerThreshold { - consumerValidator, err := k.CreateConsumerValidator(ctx, chainID, val) + if power >= minPowerToOptIn { + consAddr, err := val.GetConsAddr() if err != nil { - k.Logger(ctx).Error("could not create consumer validator", - "validator", val.GetOperator().String(), + k.Logger(ctx).Error("could not retrieve validators consensus address", + "validator", val, "error", err) continue } + // if validator already exists it gets overwritten - k.SetOptedIn(ctx, chainID, consumerValidator) + k.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) } else { // validators that do not belong to the top N validators but were opted in, remain opted in } } } -// ComputePowerThreshold returns the Nth percentile based on the given `threshold` -func (k Keeper) ComputePowerThreshold(ctx sdk.Context, topN math.LegacyDec) int64 { +// ComputeMinPowerToOptIn returns the minimum power needed for a validator (from the bonded validators) +// to belong to the `topN` validators +func (k Keeper) ComputeMinPowerToOptIn(ctx sdk.Context, bondedValidators []stakingtypes.Validator, topN uint32) int64 { totalPower := sdk.ZeroDec() var powers []int64 - k.stakingKeeper.IterateLastValidatorPowers(ctx, func(addr sdk.ValAddress, power int64) (stop bool) { + for _, val := range bondedValidators { + power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) powers = append(powers, power) totalPower = totalPower.Add(sdk.NewDecFromInt(sdk.NewInt(power))) - return false - }) + } // sort by powers descending sort.Slice(powers, func(i, j int) bool { return powers[i] > powers[j] }) + topNThreshold := sdk.NewDecFromInt(sdk.NewInt(int64(topN))).QuoInt64(int64(100)) powerSum := sdk.ZeroDec() for _, power := range powers { powerSum = powerSum.Add(sdk.NewDecFromInt(sdk.NewInt(power))) - if powerSum.Quo(totalPower).GTE(topN) { + if powerSum.Quo(totalPower).GTE(topNThreshold) { return power } } diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index 82a987018b..f0b3bf6a53 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -1,7 +1,8 @@ package keeper_test import ( - "github.com/cometbft/cometbft/proto/tendermint/crypto" + "bytes" + "sort" "testing" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -24,24 +25,10 @@ func TestHandleOptIn(t *testing.T) { // trying to opt in to a non-proposed and non-registered chain returns an error require.Error(t, providerKeeper.HandleOptIn(ctx, "unknownChainID", providerAddr, nil)) - // if validator (`providerAddr`) is to be opted out, then we cancel that the validator is about - // to be opted out and do not consider the validator to opt in - providerKeeper.SetToBeOptedOut(ctx, "chainID", providerAddr) providerKeeper.SetProposedConsumerChain(ctx, "chainID", 1) - require.True(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) + require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", providerAddr)) providerKeeper.HandleOptIn(ctx, "chainID", providerAddr, nil) - require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) - 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", - types.ConsumerValidator{ProviderConsAddr: providerAddr.ToSdkConsAddr(), Power: 1, ConsumerPublicKey: &crypto.PublicKey{ - Sum: &crypto.PublicKey_Ed25519{ - Ed25519: []byte{1}, - }, - }}) - providerKeeper.HandleOptIn(ctx, "chainID", providerAddr, nil) - require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) + require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", providerAddr)) } func TestHandleOptInWithConsumerKey(t *testing.T) { @@ -100,21 +87,14 @@ func TestHandleOptOut(t *testing.T) { // trying to opt out from a not running chain returns an error require.Error(t, providerKeeper.HandleOptOut(ctx, "unknownChainID", providerAddr)) - // if validator (`providerAddr`) is to be opted in, then we cancel that the validator is about - // to be opted out and do not consider the validator to opt out - providerKeeper.SetToBeOptedIn(ctx, "chainID", providerAddr) + // set a consumer client so that the chain is considered running providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") - require.True(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) - err := providerKeeper.HandleOptOut(ctx, "chainID", providerAddr) - require.NoError(t, err) - require.False(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) - require.False(t, providerKeeper.IsToBeOptedIn(ctx, "chainID", providerAddr)) - // if validator (`providerAddr`) is not opted in, then the validator cannot be opted out - providerKeeper.DeleteOptedIn(ctx, "chainID", providerAddr) - err = providerKeeper.HandleOptOut(ctx, "chainID", providerAddr) - require.NoError(t, err) - require.False(t, providerKeeper.IsToBeOptedOut(ctx, "chainID", providerAddr)) + // if validator (`providerAddr`) is already opted in, then an opt-out would remove this validator + providerKeeper.SetOptedIn(ctx, "chainID", providerAddr) + require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", providerAddr)) + providerKeeper.HandleOptOut(ctx, "chainID", providerAddr) + require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", providerAddr)) } func TestHandleSetConsumerCommissionRate(t *testing.T) { @@ -141,3 +121,94 @@ func TestHandleSetConsumerCommissionRate(t *testing.T) { require.Equal(t, sdk.OneDec(), cr) require.True(t, found) } + +func TestOptInTopNValidators(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + // create 3 validators with powers 1, 2, and 3 respectively + valA := createStakingValidator(ctx, mocks, 1, 1) + valAConsAddr, _ := valA.GetConsAddr() + valB := createStakingValidator(ctx, mocks, 2, 2) + valBConsAddr, _ := valB.GetConsAddr() + valC := createStakingValidator(ctx, mocks, 3, 3) + valCConsAddr, _ := valC.GetConsAddr() + + // opts in all validators with power >= 1 + providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC}, 1) + expectedOptedInValidators := []types.ProviderConsAddress{ + types.NewProviderConsAddress(valAConsAddr), + types.NewProviderConsAddress(valBConsAddr), + types.NewProviderConsAddress(valCConsAddr)} + actualOptedInValidators := providerKeeper.GetAllOptedIn(ctx, "chainID") + + // sort validators first to be able to compare + sortUpdates := func(addresses []types.ProviderConsAddress) { + sort.Slice(addresses, func(i, j int) bool { + return bytes.Compare(addresses[i].ToSdkConsAddr(), addresses[j].ToSdkConsAddr()) < 0 + }) + } + + sortUpdates(expectedOptedInValidators) + sortUpdates(actualOptedInValidators) + require.Equal(t, expectedOptedInValidators, actualOptedInValidators) + + // reset state for the upcoming checks + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valBConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valCConsAddr)) + + // opts in all validators with power >= 2 and hence we do not expect to opt in validator A + providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC}, 2) + expectedOptedInValidators = []types.ProviderConsAddress{ + types.NewProviderConsAddress(valBConsAddr), + types.NewProviderConsAddress(valCConsAddr)} + actualOptedInValidators = providerKeeper.GetAllOptedIn(ctx, "chainID") + + // sort validators first to be able to compare + sortUpdates(expectedOptedInValidators) + sortUpdates(actualOptedInValidators) + require.Equal(t, expectedOptedInValidators, actualOptedInValidators) + + // reset state for the upcoming checks + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valBConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valCConsAddr)) + + // opts in all validators with power >= 4 and hence we do not expect any opted-in validators + providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC}, 4) + require.Empty(t, providerKeeper.GetAllOptedIn(ctx, "chainID")) +} + +func TestComputeMinPowerToOptIn(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + // create 5 validators with powers 1, 3, 5, 6, 10 (not in that order) with total power of 25 (= 1 + 3 + 5 + 6 + 10) + // such that: + // validator power => cumulative share + // 10 => 40% + // 6 => 64% + // 5 => 84% + // 3 => 96% + // 1 => 100% + + bondedValidators := []stakingtypes.Validator{ + createStakingValidator(ctx, mocks, 1, 5), + createStakingValidator(ctx, mocks, 2, 10), + createStakingValidator(ctx, mocks, 3, 3), + createStakingValidator(ctx, mocks, 4, 1), + createStakingValidator(ctx, mocks, 5, 6), + } + + require.Equal(t, int64(1), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 100)) + require.Equal(t, int64(1), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 97)) + require.Equal(t, int64(3), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 96)) + require.Equal(t, int64(3), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 85)) + require.Equal(t, int64(5), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 84)) + require.Equal(t, int64(5), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 65)) + require.Equal(t, int64(6), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 64)) + require.Equal(t, int64(6), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 41)) + require.Equal(t, int64(10), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 40)) + require.Equal(t, int64(10), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 1)) +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index c89109b7be..31a2c02741 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -291,8 +291,6 @@ func (k Keeper) MakeConsumerGenesis( var nextValidators []types.ConsumerValidator - k.OptInToBeOptedInValidators(ctx, chainID) - considerOnlyOptIn := func(validator stakingtypes.Validator) bool { consAddr, err := validator.GetConsAddr() if err != nil { @@ -303,8 +301,8 @@ func (k Keeper) MakeConsumerGenesis( if topN, found := k.GetTopN(ctx, chainID); found { // in a Top-N chain, we automatically opt in all validators that belong to the top N - threshold := sdk.NewDec(int64(topN)).QuoInt64(100) - k.OptInTopNValidators(ctx, chainID, threshold) + minPower := k.ComputeMinPowerToOptIn(ctx, bondedValidators, topN) + k.OptInTopNValidators(ctx, chainID, bondedValidators, minPower) } nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators, considerOnlyOptIn) diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index f1403ca21d..bbefb035b5 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -221,10 +221,6 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { bondedValidators := k.stakingKeeper.GetLastValidators(ctx) for _, chain := range k.GetAllConsumerChains(ctx) { - // FIXME: add comment that this should take place before `OptInTopNValidators` - k.OptOutToBeOptedOutValidators(ctx, chain.ChainId) - k.OptInToBeOptedInValidators(ctx, chain.ChainId) - currentValidators := k.GetConsumerValSet(ctx, chain.ChainId) var nextValidators []providertypes.ConsumerValidator @@ -238,8 +234,8 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { if topN, found := k.GetTopN(ctx, chain.ChainId); found { // in a Top-N chain, we automatically opt in all validators that belong to the top N - threshold := sdk.NewDec(int64(topN)).QuoInt64(100) - k.OptInTopNValidators(ctx, chain.ChainId, threshold) + minPower := k.ComputeMinPowerToOptIn(ctx, bondedValidators, topN) + k.OptInTopNValidators(ctx, chain.ChainId, bondedValidators, minPower) } nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators, considerOnlyOptIn) diff --git a/x/ccv/provider/keeper/validator_set_update_test.go b/x/ccv/provider/keeper/validator_set_update_test.go index 7380d53f8d..968d4e0ced 100644 --- a/x/ccv/provider/keeper/validator_set_update_test.go +++ b/x/ccv/provider/keeper/validator_set_update_test.go @@ -397,8 +397,8 @@ func TestComputeNextEpochConsumerValSetConsiderOnlyOptIn(t *testing.T) { expectedValidators = append(expectedValidators, expectedValBConsumerValidator) // opt in validators A and B with 0 power and no consumer public keys - providerKeeper.SetOptedIn(ctx, chainID, types.ConsumerValidator{ProviderConsAddr: valAConsAddr, Power: 0, ConsumerPublicKey: nil}) - providerKeeper.SetOptedIn(ctx, chainID, types.ConsumerValidator{ProviderConsAddr: valBConsAddr, Power: 0, ConsumerPublicKey: nil}) + providerKeeper.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(valBConsAddr)) // the expected actual validators are the opted-in validators but with the correct power and consumer public keys set bondedValidators := []stakingtypes.Validator{valA, valB} diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index edc5c43c86..1e2516ba07 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -147,21 +147,18 @@ const ( // ProposedConsumerChainByteKey is the byte prefix storing the consumer chainId in consumerAddition gov proposal submitted before voting finishes ProposedConsumerChainByteKey - // ConsumerValidatorBytePrefix is the byte prefix used when storing for each consumer chain all the consumer validators in this epoch + // OptedInBytePrefix is the byte prefix used when storing for each consumer chain the validators that + // are opted in but not necessarily the ones that are validating. + OptedInBytePrefix + + // ConsumerValidatorBytePrefix is the byte prefix used when storing for each consumer chain all the consumer + // validators in this epoch that are validating the consumer chain ConsumerValidatorBytePrefix // TopNBytePrefix is the byte prefix storing the mapping from a consumer chain to the N value of this chain, // that corresponds to the N% of the top validators that have to validate this consumer chain TopNBytePrefix - // ToBeOptedInBytePrefix is the byte prefix used when storing for each consumer chain the validators that - // are about to be opted in - ToBeOptedInBytePrefix - - // ToBeOptedOutBytePrefix is the byte prefix used when storing for each consumer chain the validators that - // are about to be opted out - ToBeOptedOutBytePrefix - // ConsumerRewardsAllocationBytePrefix is the byte prefix used when storing for each consumer the rewards // it allocated to the consumer rewards pool ConsumerRewardsAllocationBytePrefix @@ -547,15 +544,9 @@ func TopNKey(chainID string) []byte { return ChainIdWithLenKey(TopNBytePrefix, chainID) } -// ToBeOptedInKey returns the key of consumer chain `chainID` and validator with `providerAddr` -func ToBeOptedInKey(chainID string, providerAddr ProviderConsAddress) []byte { - prefix := ChainIdWithLenKey(ToBeOptedInBytePrefix, chainID) - return append(prefix, providerAddr.ToSdkConsAddr().Bytes()...) -} - -// ToBeOptedOutKey returns the key of consumer chain `chainID` and validator with `providerAddr` -func ToBeOptedOutKey(chainID string, providerAddr ProviderConsAddress) []byte { - prefix := ChainIdWithLenKey(ToBeOptedOutBytePrefix, chainID) +// OptedInKey returns the key of consumer chain `chainID` and validator with `providerAddr` +func OptedInKey(chainID string, providerAddr ProviderConsAddress) []byte { + prefix := ChainIdWithLenKey(OptedInBytePrefix, chainID) return append(prefix, providerAddr.ToSdkConsAddr().Bytes()...) } diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index d7cfd10fd4..d37482e50e 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -56,10 +56,9 @@ func getAllKeyPrefixes() []byte { providertypes.VSCMaturedHandledThisBlockBytePrefix, providertypes.EquivocationEvidenceMinHeightBytePrefix, providertypes.ProposedConsumerChainByteKey, + providertypes.OptedInBytePrefix, providertypes.ConsumerValidatorBytePrefix, providertypes.TopNBytePrefix, - providertypes.ToBeOptedInBytePrefix, - providertypes.ToBeOptedOutBytePrefix, providertypes.ConsumerRewardsAllocationBytePrefix, providertypes.ConsumerCommissionRatePrefix, } From 03af237c800211642e81759b5f2e23bdcbad1113 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 19 Mar 2024 15:58:53 +0100 Subject: [PATCH 05/36] fix distribution test --- x/ccv/provider/keeper/distribution_test.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/x/ccv/provider/keeper/distribution_test.go b/x/ccv/provider/keeper/distribution_test.go index bd83eefcc9..1e37b1112e 100644 --- a/x/ccv/provider/keeper/distribution_test.go +++ b/x/ccv/provider/keeper/distribution_test.go @@ -44,16 +44,9 @@ func TestComputeConsumerTotalVotingPower(t *testing.T) { keeper.SetConsumerValidator( ctx, chainID, - types.NewProviderConsAddress(val.Address.Bytes()), - ) - - validatorsVotes = append( - validatorsVotes, - abci.VoteInfo{ - Validator: abci.Validator{ - Address: val.Address, - Power: val.VotingPower, - }, + types.ConsumerValidator{ + ProviderConsAddr: val.Address, + Power: val.VotingPower, }, ) From 07429fa79b0b378b102a6cf89042289196f8d19a Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 20 Mar 2024 10:05:18 +0100 Subject: [PATCH 06/36] Update x/ccv/provider/keeper/hooks.go Co-authored-by: Simon Noetzlin --- x/ccv/provider/keeper/hooks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index a793654a19..d9025a1f98 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -225,7 +225,7 @@ func (h Hooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr s return } - // in the validator is already opted in, the `SetOptedIn` is a no-op + // If the validator is already opted in, the `SetOptedIn` is a no-op h.k.SetOptedIn(ctx, chainID, providertypes.NewProviderConsAddress(consAddr)) } else { // If vote is not a YES vote with 100% weight, we opt out the validator. From 0ab0b32b795f1ba340175e597cd102ebf0ba7a83 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 20 Mar 2024 10:12:49 +0100 Subject: [PATCH 07/36] took into Simon's comments --- testutil/ibc_testing/generic_setup.go | 8 ++++---- x/ccv/provider/keeper/proposal.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index 7a87e05ab1..1c12485fc8 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -141,10 +141,6 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( prop.ChainId = chainID prop.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient - // set the consumer TopN here since the test suite setup only used the consumer addition prop - // to create the consumer genesis, see BeginBlockInit in /x/ccv/provider/keeper/proposal.go. - providerKeeper.SetTopN(providerChain.GetContext(), chainID, prop.Top_N) - // NOTE: the initial height passed to CreateConsumerClient // must be the height on the consumer when InitGenesis is called prop.InitialHeight = clienttypes.Height{RevisionNumber: 0, RevisionHeight: 3} @@ -154,6 +150,10 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( ) s.Require().NoError(err) + // set the consumer TopN here since the test suite setup only used the consumer addition prop + // to create the consumer genesis, see BeginBlockInit in /x/ccv/provider/keeper/proposal.go. + providerKeeper.SetTopN(providerChain.GetContext(), chainID, prop.Top_N) + // commit the state on the provider chain coordinator.CommitBlock(providerChain) diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 31a2c02741..42e3f889a9 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -299,9 +299,9 @@ func (k Keeper) MakeConsumerGenesis( return k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) } - if topN, found := k.GetTopN(ctx, chainID); found { + if prop.Top_N > 0 { // in a Top-N chain, we automatically opt in all validators that belong to the top N - minPower := k.ComputeMinPowerToOptIn(ctx, bondedValidators, topN) + minPower := k.ComputeMinPowerToOptIn(ctx, bondedValidators, prop.Top_N) k.OptInTopNValidators(ctx, chainID, bondedValidators, minPower) } From 1a0fa9e514b724e7e8b6dd1f811def91f614bf48 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 20 Mar 2024 11:29:13 +0100 Subject: [PATCH 08/36] took into rest of the comments --- x/ccv/provider/keeper/partial_set_security.go | 15 ++++-- .../keeper/partial_set_security_test.go | 48 +++++++++++++++---- x/ccv/provider/keeper/proposal.go | 15 ++---- x/ccv/provider/keeper/relay.go | 14 ++---- x/ccv/provider/keeper/relay_test.go | 19 +------- .../keeper/validator_set_update_test.go | 22 +++++---- 6 files changed, 73 insertions(+), 60 deletions(-) diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 01b61bc811..676cea8a81 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -104,11 +104,20 @@ func (k Keeper) ComputeMinPowerToOptIn(ctx sdk.Context, bondedValidators []staki } // We should never reach this point because the topN can be up to 1.0 (100%) and in the above `for` loop we - // perform an equal comparison as well (`GTE`). In any case, we do not have to panic here because we can return - // the smallest possible power. + // perform an equal comparison as well (`GTE`). In any case, we do not have to panic here because we can return 0 + // as the smallest possible power. k.Logger(ctx).Error("should never reach this point", "topN", topN, "totalPower", totalPower, "powerSum", powerSum) - return powers[len(powers)-1] + return 0 +} + +// ShouldConsiderOnlyOptIn returns true if `validator` is opted in, in `chainID. +func (k Keeper) ShouldConsiderOnlyOptIn(ctx sdk.Context, chainID string, validator stakingtypes.Validator) bool { + consAddr, err := validator.GetConsAddr() + if err != nil { + return false + } + return k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) } diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index ed1d311ee7..4598bc56d7 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -128,20 +128,23 @@ func TestOptInTopNValidators(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - // create 3 validators with powers 1, 2, and 3 respectively + // create 4 validators with powers 1, 2, 3, and 1 respectively valA := createStakingValidator(ctx, mocks, 1, 1) valAConsAddr, _ := valA.GetConsAddr() valB := createStakingValidator(ctx, mocks, 2, 2) valBConsAddr, _ := valB.GetConsAddr() valC := createStakingValidator(ctx, mocks, 3, 3) valCConsAddr, _ := valC.GetConsAddr() + valD := createStakingValidator(ctx, mocks, 4, 1) + valDConsAddr, _ := valD.GetConsAddr() - // opts in all validators with power >= 1 - providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC}, 1) + // Start Test 1: opt in all validators with power >= 0 + providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC, valD}, 0) expectedOptedInValidators := []types.ProviderConsAddress{ types.NewProviderConsAddress(valAConsAddr), types.NewProviderConsAddress(valBConsAddr), - types.NewProviderConsAddress(valCConsAddr)} + types.NewProviderConsAddress(valCConsAddr), + types.NewProviderConsAddress(valDConsAddr)} actualOptedInValidators := providerKeeper.GetAllOptedIn(ctx, "chainID") // sort validators first to be able to compare @@ -159,9 +162,23 @@ func TestOptInTopNValidators(t *testing.T) { providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valAConsAddr)) providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valBConsAddr)) providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valCConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valDConsAddr)) + + // Start Test 2: opt in all validators with power >= 1 + // We expect the same `expectedOptedInValidators` as when we opted in all validators with power >= 0 because the + // validators with the smallest power have power == 1 + providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC, valD}, 0) + actualOptedInValidators = providerKeeper.GetAllOptedIn(ctx, "chainID") + sortUpdates(actualOptedInValidators) + require.Equal(t, expectedOptedInValidators, actualOptedInValidators) + + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valBConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valCConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valDConsAddr)) - // opts in all validators with power >= 2 and hence we do not expect to opt in validator A - providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC}, 2) + // Start Test 3: opt in all validators with power >= 2 and hence we do not expect to opt in validator A + providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC, valD}, 2) expectedOptedInValidators = []types.ProviderConsAddress{ types.NewProviderConsAddress(valBConsAddr), types.NewProviderConsAddress(valCConsAddr)} @@ -176,9 +193,10 @@ func TestOptInTopNValidators(t *testing.T) { providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valAConsAddr)) providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valBConsAddr)) providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valCConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valDConsAddr)) - // opts in all validators with power >= 4 and hence we do not expect any opted-in validators - providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC}, 4) + // Start Test 4: opt in all validators with power >= 4 and hence we do not expect any opted-in validators + providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC, valD}, 4) require.Empty(t, providerKeeper.GetAllOptedIn(ctx, "chainID")) } @@ -214,3 +232,17 @@ func TestComputeMinPowerToOptIn(t *testing.T) { require.Equal(t, int64(10), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 40)) require.Equal(t, int64(10), providerKeeper.ComputeMinPowerToOptIn(ctx, bondedValidators, 1)) } + +// TestShouldConsiderOnlyOptIn returns true if `validator` is opted in, in `chainID. +func TestShouldConsiderOnlyOptIn(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + validator := createStakingValidator(ctx, mocks, 0, 1) + consAddr, _ := validator.GetConsAddr() + + require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(consAddr))) + providerKeeper.SetOptedIn(ctx, "chainID", types.NewProviderConsAddress(consAddr)) + require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", types.NewProviderConsAddress(consAddr))) + +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 42e3f889a9..bab1690f8b 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -289,23 +289,16 @@ func (k Keeper) MakeConsumerGenesis( bondedValidators = append(bondedValidators, val) } - var nextValidators []types.ConsumerValidator - - considerOnlyOptIn := func(validator stakingtypes.Validator) bool { - consAddr, err := validator.GetConsAddr() - if err != nil { - return false - } - return k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) - } - if prop.Top_N > 0 { // in a Top-N chain, we automatically opt in all validators that belong to the top N minPower := k.ComputeMinPowerToOptIn(ctx, bondedValidators, prop.Top_N) k.OptInTopNValidators(ctx, chainID, bondedValidators, minPower) } - nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators, considerOnlyOptIn) + nextValidators := k.ComputeNextEpochConsumerValSet(ctx, chainID, bondedValidators, + func(validator stakingtypes.Validator) bool { + return k.ShouldConsiderOnlyOptIn(ctx, chainID, validator) + }) k.SetConsumerValSet(ctx, chainID, nextValidators) // get the initial updates with the latest set consumer public keys diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index bbefb035b5..9728d7f59f 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -222,15 +222,6 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { for _, chain := range k.GetAllConsumerChains(ctx) { currentValidators := k.GetConsumerValSet(ctx, chain.ChainId) - var nextValidators []providertypes.ConsumerValidator - - considerOnlyOptIn := func(validator stakingtypes.Validator) bool { - consAddr, err := validator.GetConsAddr() - if err != nil { - return false - } - return k.IsOptedIn(ctx, chain.ChainId, providertypes.NewProviderConsAddress(consAddr)) - } if topN, found := k.GetTopN(ctx, chain.ChainId); found { // in a Top-N chain, we automatically opt in all validators that belong to the top N @@ -238,7 +229,10 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { k.OptInTopNValidators(ctx, chain.ChainId, bondedValidators, minPower) } - nextValidators = k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators, considerOnlyOptIn) + nextValidators := k.ComputeNextEpochConsumerValSet(ctx, chain.ChainId, bondedValidators, + func(validator stakingtypes.Validator) bool { + return k.ShouldConsiderOnlyOptIn(ctx, chain.ChainId, validator) + }) valUpdates := DiffValidators(currentValidators, nextValidators) k.SetConsumerValSet(ctx, chain.ChainId, nextValidators) diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index c235e917f2..a3c88a66ab 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -671,31 +671,14 @@ func TestEndBlockVSU(t *testing.T) { // create 4 sample lastValidators var lastValidators []stakingtypes.Validator var valAddresses []sdk.ValAddress - var powers []int64 for i := 0; i < 4; i++ { validator := crypto.NewCryptoIdentityFromIntSeed(i).SDKStakingValidator() lastValidators = append(lastValidators, validator) valAddresses = append(valAddresses, validator.GetOperator()) - powers = append(powers, int64(i+1)) + mocks.MockStakingKeeper.EXPECT().GetLastValidatorPower(gomock.Any(), validator.GetOperator()).Return(int64(i + 1)).AnyTimes() } - mocks.MockStakingKeeper.EXPECT().IterateLastValidatorPowers(gomock.Any(), gomock.Any()).DoAndReturn( - func(_ sdk.Context, cb func(addr sdk.ValAddress, power int64) (stop bool)) { - for i, addr := range valAddresses { - if cb(addr, powers[i]) { - break - } - } - }, - ).AnyTimes() mocks.MockStakingKeeper.EXPECT().GetLastValidators(gomock.Any()).Return(lastValidators).AnyTimes() - mocks.MockStakingKeeper.EXPECT().GetLastValidatorPower(gomock.Any(), gomock.Any()).Return(int64(2)).AnyTimes() - - for _, val := range lastValidators { - consAddr, _ := val.GetConsAddr() - // FIXME: probably `consAddr` is not needed - mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(gomock.Any(), consAddr).Return(val, true).AnyTimes() - } // set a sample client for a consumer chain so that `GetAllConsumerChains` in `QueueVSCPackets` iterates at least once providerKeeper.SetConsumerClientId(ctx, chainID, "clientID") diff --git a/x/ccv/provider/keeper/validator_set_update_test.go b/x/ccv/provider/keeper/validator_set_update_test.go index b549bb8b45..1de54fbbde 100644 --- a/x/ccv/provider/keeper/validator_set_update_test.go +++ b/x/ccv/provider/keeper/validator_set_update_test.go @@ -364,14 +364,10 @@ func TestComputeNextEpochConsumerValSetConsiderOnlyOptIn(t *testing.T) { chainID := "chainID" // no consumer validators returned if we have no opted-in validators - considerOnlyOptIn := func(validator stakingtypes.Validator) bool { - consAddr, err := validator.GetConsAddr() - if err != nil { - return false - } - return providerKeeper.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) - } - require.Empty(t, providerKeeper.ComputeNextEpochConsumerValSet(ctx, chainID, []stakingtypes.Validator{}, considerOnlyOptIn)) + require.Empty(t, providerKeeper.ComputeNextEpochConsumerValSet(ctx, chainID, []stakingtypes.Validator{}, + func(validator stakingtypes.Validator) bool { + return providerKeeper.ShouldConsiderOnlyOptIn(ctx, chainID, validator) + })) var expectedValidators []types.ConsumerValidator @@ -405,7 +401,10 @@ func TestComputeNextEpochConsumerValSetConsiderOnlyOptIn(t *testing.T) { // the expected actual validators are the opted-in validators but with the correct power and consumer public keys set bondedValidators := []stakingtypes.Validator{valA, valB} - actualValidators := providerKeeper.ComputeNextEpochConsumerValSet(ctx, "chainID", bondedValidators, considerOnlyOptIn) + actualValidators := providerKeeper.ComputeNextEpochConsumerValSet(ctx, "chainID", bondedValidators, + func(validator stakingtypes.Validator) bool { + return providerKeeper.ShouldConsiderOnlyOptIn(ctx, "chainID", validator) + }) // sort validators first to be able to compare sortValidators := func(validators []types.ConsumerValidator) { @@ -421,7 +420,10 @@ func TestComputeNextEpochConsumerValSetConsiderOnlyOptIn(t *testing.T) { // create a staking validator C that is not opted in, hence `expectedValidators` remains the same valC := createStakingValidator(ctx, mocks, 3, 3) bondedValidators = []stakingtypes.Validator{valA, valB, valC} - actualValidators = providerKeeper.ComputeNextEpochConsumerValSet(ctx, "chainID", bondedValidators, considerOnlyOptIn) + actualValidators = providerKeeper.ComputeNextEpochConsumerValSet(ctx, "chainID", bondedValidators, + func(validator stakingtypes.Validator) bool { + return providerKeeper.ShouldConsiderOnlyOptIn(ctx, "chainID", validator) + }) sortValidators(actualValidators) sortValidators(expectedValidators) From 56ca38d7563b14122a42ad07df8e5ca040b39e1c Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 20 Mar 2024 11:30:49 +0100 Subject: [PATCH 09/36] nit change --- testutil/ibc_testing/generic_setup.go | 1 - 1 file changed, 1 deletion(-) diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index 1c12485fc8..da00d76b85 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -140,7 +140,6 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( prop := testkeeper.GetTestConsumerAdditionProp() prop.ChainId = chainID prop.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient - // NOTE: the initial height passed to CreateConsumerClient // must be the height on the consumer when InitGenesis is called prop.InitialHeight = clienttypes.Height{RevisionNumber: 0, RevisionHeight: 3} From c614fd2a4bde1f32d1ddedd873b1758a0d5d85f5 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 20 Mar 2024 12:25:03 +0100 Subject: [PATCH 10/36] return an error if validator cannot opt out from a Top N chain --- x/ccv/provider/keeper/msg_server.go | 30 ++++++++--- x/ccv/provider/keeper/partial_set_security.go | 20 +++++++- .../keeper/partial_set_security_test.go | 50 +++++++++++++++++++ x/ccv/provider/types/errors.go | 1 + 4 files changed, 93 insertions(+), 8 deletions(-) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index a595b5fbc2..7bbf270ef9 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -140,19 +140,27 @@ func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types. func (k msgServer) OptIn(goCtx context.Context, msg *types.MsgOptIn) (*types.MsgOptInResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - valAddress, err := sdk.ConsAddressFromBech32(msg.ProviderAddr) + valAddress, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { return nil, err } - providerAddr := types.NewProviderConsAddress(valAddress) + + // validator must already be registered + validator, found := k.stakingKeeper.GetValidator(ctx, valAddress) + if !found { + return nil, stakingtypes.ErrNoValidatorFound + } + + consAddrTmp, err := validator.GetConsAddr() if err != nil { return nil, err } + providerConsAddr := types.NewProviderConsAddress(consAddrTmp) if msg.ConsumerKey != "" { - err = k.Keeper.HandleOptIn(ctx, msg.ChainId, providerAddr, &msg.ConsumerKey) + err = k.Keeper.HandleOptIn(ctx, msg.ChainId, providerConsAddr, &msg.ConsumerKey) } else { - err = k.Keeper.HandleOptIn(ctx, msg.ChainId, providerAddr, nil) + err = k.Keeper.HandleOptIn(ctx, msg.ChainId, providerConsAddr, nil) } if err != nil { @@ -173,16 +181,24 @@ func (k msgServer) OptIn(goCtx context.Context, msg *types.MsgOptIn) (*types.Msg func (k msgServer) OptOut(goCtx context.Context, msg *types.MsgOptOut) (*types.MsgOptOutResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - valAddress, err := sdk.ConsAddressFromBech32(msg.ProviderAddr) + valAddress, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { return nil, err } - providerAddr := types.NewProviderConsAddress(valAddress) + + // validator must already be registered + validator, found := k.stakingKeeper.GetValidator(ctx, valAddress) + if !found { + return nil, stakingtypes.ErrNoValidatorFound + } + + consAddrTmp, err := validator.GetConsAddr() if err != nil { return nil, err } + providerConsAddr := types.NewProviderConsAddress(consAddrTmp) - err = k.Keeper.HandleOptOut(ctx, msg.ChainId, providerAddr) + err = k.Keeper.HandleOptOut(ctx, msg.ChainId, providerConsAddr) if err != nil { return nil, err } diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 676cea8a81..754a782f48 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -2,7 +2,6 @@ package keeper import ( errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -52,6 +51,25 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types "opting out of an unknown or not running consumer chain, with id: %s", chainID) } + if topN, found := k.GetTopN(ctx, chainID); found { + // a validator cannot opt out from a Top N chain if the validator is in the Top N validators + validator, validatorFound := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerAddr.ToSdkConsAddr()) + if !validatorFound { + return errorsmod.Wrapf( + stakingtypes.ErrNoValidatorFound, + "validator with consensus address %s could not be found", providerAddr.ToSdkConsAddr()) + } + power := k.stakingKeeper.GetLastValidatorPower(ctx, validator.GetOperator()) + minPowerToOptIn := k.ComputeMinPowerToOptIn(ctx, k.stakingKeeper.GetLastValidators(ctx), topN) + + if power >= minPowerToOptIn { + return errorsmod.Wrapf( + types.ErrCannotOptOutFromTopN, + "validator with power (%d) cannot opt out from Top N chain because all validators"+ + "with at least %d power have to validate", power, minPowerToOptIn) + } + } + k.DeleteOptedIn(ctx, chainID, providerAddr) return nil } diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index 4598bc56d7..f17bd71a50 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -99,6 +99,56 @@ func TestHandleOptOut(t *testing.T) { require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", providerAddr)) } +func TestHandleOptOutFromTopNChain(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + chainID := "chainID" + + // set a consumer client so that the chain is considered running + providerKeeper.SetConsumerClientId(ctx, chainID, "clientID") + + // set the chain as Top 50 and create 4 validators with 10%, 20%, 30%, and 40% of the total voting power + // respectively + providerKeeper.SetTopN(ctx, "chainID", 50) + valA := createStakingValidator(ctx, mocks, 1, 1) // 10% of the total voting power (can opt out) + valAConsAddr, _ := valA.GetConsAddr() + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, valAConsAddr).Return(valA, true).AnyTimes() + valB := createStakingValidator(ctx, mocks, 2, 2) // 20% of the total voting power (can opt out) + valBConsAddr, _ := valB.GetConsAddr() + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, valBConsAddr).Return(valB, true).AnyTimes() + valC := createStakingValidator(ctx, mocks, 3, 3) // 30% of the total voting power (cannot opt out) + valCConsAddr, _ := valC.GetConsAddr() + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, valCConsAddr).Return(valC, true).AnyTimes() + valD := createStakingValidator(ctx, mocks, 4, 4) // 40% of the total voting power (cannot opt out) + valDConsAddr, _ := valD.GetConsAddr() + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, valDConsAddr).Return(valD, true).AnyTimes() + + mocks.MockStakingKeeper.EXPECT().GetLastValidators(ctx).Return([]stakingtypes.Validator{valA, valB, valC, valD}).AnyTimes() + + // opt in all validators + providerKeeper.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(valBConsAddr)) + providerKeeper.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(valCConsAddr)) + providerKeeper.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(valDConsAddr)) + + // validators A and B can opt out because they belong the bottom 30% of validators + require.NoError(t, providerKeeper.HandleOptOut(ctx, chainID, types.NewProviderConsAddress(valAConsAddr))) + require.NoError(t, providerKeeper.HandleOptOut(ctx, chainID, types.NewProviderConsAddress(valBConsAddr))) + + // validators C and D cannot opt out because C has 30% of the voting power and D has 40% of the voting power + // and hence both are needed to keep validating a Top 50 chain + require.Error(t, providerKeeper.HandleOptOut(ctx, chainID, types.NewProviderConsAddress(valCConsAddr))) + require.Error(t, providerKeeper.HandleOptOut(ctx, chainID, types.NewProviderConsAddress(valDConsAddr))) + + // opting out a validator that cannot be found from a Top N chain should also return an error + notFoundValidator := createStakingValidator(ctx, mocks, 5, 5) + notFoundValidatorConsAddr, _ := notFoundValidator.GetConsAddr() + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, notFoundValidatorConsAddr). + Return(stakingtypes.Validator{}, false) + require.Error(t, providerKeeper.HandleOptOut(ctx, chainID, types.NewProviderConsAddress(notFoundValidatorConsAddr))) +} + func TestHandleSetConsumerCommissionRate(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 271ea90329..1e7dd7dd3d 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -25,4 +25,5 @@ var ( 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") + ErrCannotOptOutFromTopN = errorsmod.Register(ModuleName, 20, "cannot opt out from a Top N chain") ) From 6503f9bbee9982852b8807f0a438e228ee5bfc87 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 20 Mar 2024 12:29:00 +0100 Subject: [PATCH 11/36] removed automatic opt-in for validators that vote Yes on proposals --- testutil/keeper/mocks.go | 29 ---------- x/ccv/provider/keeper/hooks.go | 57 ------------------ x/ccv/provider/keeper/hooks_test.go | 89 ----------------------------- x/ccv/types/expected_keepers.go | 2 - 4 files changed, 177 deletions(-) diff --git a/testutil/keeper/mocks.go b/testutil/keeper/mocks.go index 78c0fbedc9..e588f51e30 100644 --- a/testutil/keeper/mocks.go +++ b/testutil/keeper/mocks.go @@ -1270,32 +1270,3 @@ func (mr *MockGovKeeperMockRecorder) GetProposal(ctx, proposalID interface{}) *g mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposal", reflect.TypeOf((*MockGovKeeper)(nil).GetProposal), ctx, proposalID) } - -// GetProposals mocks base method. -func (m *MockGovKeeper) GetProposals(ctx types0.Context) v1.Proposals { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetProposals", ctx) - ret0, _ := ret[0].(v1.Proposals) - return ret0 -} - -// GetProposals indicates an expected call of GetProposals. -func (mr *MockGovKeeperMockRecorder) GetProposals(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposals", reflect.TypeOf((*MockGovKeeper)(nil).GetProposals), ctx) -} - -// GetVote mocks base method. -func (m *MockGovKeeper) GetVote(ctx types0.Context, proposalID uint64, voterAddr types0.AccAddress) (v1.Vote, bool) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetVote", ctx, proposalID, voterAddr) - ret0, _ := ret[0].(v1.Vote) - ret1, _ := ret[1].(bool) - return ret0, ret1 -} - -// GetVote indicates an expected call of GetVote. -func (mr *MockGovKeeperMockRecorder) GetVote(ctx, proposalID, voterAddr interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVote", reflect.TypeOf((*MockGovKeeper)(nil).GetVote), ctx, proposalID, voterAddr) -} diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index d9025a1f98..88590a9875 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -3,8 +3,6 @@ package keeper import ( "fmt" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" sdkgov "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -177,62 +175,7 @@ func (h Hooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID uint64 func (h Hooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) { } -// AfterProposalVote opts in validators that vote YES (with 100% weight) on a `ConsumerAdditionProposal`. If a -// validator votes multiple times, only the last vote would be considered on whether the validator is opted in or not. func (h Hooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) { - validator, found := h.k.stakingKeeper.GetValidator(ctx, voterAddr.Bytes()) - if !found { - return - } - - consAddr, err := validator.GetConsAddr() - if err != nil { - h.k.Logger(ctx).Error("could not extract validator's consensus address", - "error", err.Error(), - "validator acc addr", voterAddr, - ) - return - } - - chainID, found := h.k.GetProposedConsumerChain(ctx, proposalID) - if !found { - return - } - - vote, found := h.k.govKeeper.GetVote(ctx, proposalID, voterAddr) - if !found { - h.k.Logger(ctx).Error("could not find vote for validator", - "validator acc addr", voterAddr, - "proposalID", proposalID, - ) - return - } - - if len(vote.Options) == 1 && vote.Options[0].Option == v1.VoteOption_VOTE_OPTION_YES { - // only consider votes that vote YES with 100% weight - weight, err := sdk.NewDecFromStr(vote.Options[0].Weight) - if err != nil { - h.k.Logger(ctx).Error("could not extract decimal value from vote's weight", - "vote", vote, - "error", err.Error(), - ) - return - } - if !weight.Equal(math.LegacyNewDec(1)) { - h.k.Logger(ctx).Error("single vote does not have a weight of 1", - "vote", vote, - ) - return - } - - // If the validator is already opted in, the `SetOptedIn` is a no-op - h.k.SetOptedIn(ctx, chainID, providertypes.NewProviderConsAddress(consAddr)) - } else { - // If vote is not a YES vote with 100% weight, we opt out the validator. - // Note that a validator still gets opted out even if before it manually opted in with a `MsgOptIn` message. - // This is because if a validator wants to opt in, there's no reason to not vote YES with 100% weight. - h.k.DeleteOptedIn(ctx, chainID, providertypes.NewProviderConsAddress(consAddr)) - } } func (h Hooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64) { diff --git a/x/ccv/provider/keeper/hooks_test.go b/x/ccv/provider/keeper/hooks_test.go index 87589b52a1..a9cf69b350 100644 --- a/x/ccv/provider/keeper/hooks_test.go +++ b/x/ccv/provider/keeper/hooks_test.go @@ -9,19 +9,14 @@ import ( "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" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - cryptotestutil "github.com/cosmos/interchain-security/v4/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v4/testutil/keeper" providerkeeper "github.com/cosmos/interchain-security/v4/x/ccv/provider/keeper" - "github.com/cosmos/interchain-security/v4/x/ccv/provider/types" ) func TestValidatorConsensusKeyInUse(t *testing.T) { @@ -229,87 +224,3 @@ func TestGetConsumerAdditionLegacyPropFromProp(t *testing.T) { }) } } - -func TestAfterProposalVoteWithYesVote(t *testing.T) { - k, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - providerConsPubKey := ed25519.GenPrivKeyFromSecret([]byte{1}).PubKey() - pkAny, _ := codectypes.NewAnyWithValue(providerConsPubKey) - providerAddr := types.NewProviderConsAddress(providerConsPubKey.Address().Bytes()) - - options := []*v1.WeightedVoteOption{{Option: v1.OptionYes, Weight: "1"}} - k.SetProposedConsumerChain(ctx, "chainID", 1) - - gomock.InOrder( - mocks.MockStakingKeeper.EXPECT().GetValidator(ctx, gomock.Any()).Return( - stakingtypes.Validator{ConsensusPubkey: pkAny}, true), - mocks.MockGovKeeper.EXPECT().GetVote(ctx, gomock.Any(), gomock.Any()).Return( - v1.Vote{ProposalId: 1, Voter: "voter", Options: options}, true, - ), - ) - - require.False(t, k.IsOptedIn(ctx, "chainID", providerAddr)) - k.Hooks().AfterProposalVote(ctx, 1, sdk.AccAddress{}) - require.True(t, k.IsOptedIn(ctx, "chainID", providerAddr)) -} - -func TestAfterProposalVoteWithNoVote(t *testing.T) { - testCases := []struct { - name string - options []*v1.WeightedVoteOption - setup func(sdk.Context, []*v1.WeightedVoteOption, testkeeper.MockedKeepers, *codectypes.Any) - }{ - { - "Weighted vote with 100% NO", - []*v1.WeightedVoteOption{{Option: v1.OptionNo, Weight: "1"}}, - func(ctx sdk.Context, options []*v1.WeightedVoteOption, - mocks testkeeper.MockedKeepers, pubKey *codectypes.Any, - ) { - gomock.InOrder( - mocks.MockStakingKeeper.EXPECT().GetValidator(ctx, gomock.Any()).Return( - stakingtypes.Validator{ConsensusPubkey: pubKey}, true), - mocks.MockGovKeeper.EXPECT().GetVote(ctx, gomock.Any(), gomock.Any()).Return( - v1.Vote{ProposalId: 1, Voter: "voter", Options: options}, true, - ), - ) - }, - }, - { - "Weighted vote with 99.9% YES and 0.1% NO", - []*v1.WeightedVoteOption{{Option: v1.OptionYes, Weight: "0.999"}, {Option: v1.OptionNo, Weight: "0.001"}}, - func(ctx sdk.Context, options []*v1.WeightedVoteOption, - mocks testkeeper.MockedKeepers, pubKey *codectypes.Any, - ) { - gomock.InOrder( - mocks.MockStakingKeeper.EXPECT().GetValidator(ctx, gomock.Any()).Return( - stakingtypes.Validator{ConsensusPubkey: pubKey}, true), - mocks.MockGovKeeper.EXPECT().GetVote(ctx, gomock.Any(), gomock.Any()).Return( - v1.Vote{ProposalId: 1, Voter: "voter", Options: options}, true, - ), - ) - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - k, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - providerConsPubKey := ed25519.GenPrivKeyFromSecret([]byte{1}).PubKey() - pkAny, _ := codectypes.NewAnyWithValue(providerConsPubKey) - providerAddr := types.NewProviderConsAddress(providerConsPubKey.Address().Bytes()) - - k.SetProposedConsumerChain(ctx, "chainID", 1) - - tc.setup(ctx, tc.options, mocks, pkAny) - - // set the validator to-be-opted in first to assert that a NO vote removes the validator from to-be-opted in - k.SetOptedIn(ctx, "chainID", providerAddr) - require.True(t, k.IsOptedIn(ctx, "chainID", providerAddr)) - k.Hooks().AfterProposalVote(ctx, 1, sdk.AccAddress{}) - require.False(t, k.IsOptedIn(ctx, "chainID", providerAddr)) - }) - } -} diff --git a/x/ccv/types/expected_keepers.go b/x/ccv/types/expected_keepers.go index aaff34d878..73566926ec 100644 --- a/x/ccv/types/expected_keepers.go +++ b/x/ccv/types/expected_keepers.go @@ -156,6 +156,4 @@ type ScopedKeeper interface { type GovKeeper interface { GetProposal(ctx sdk.Context, proposalID uint64) (v1.Proposal, bool) - GetProposals(ctx sdk.Context) (proposals v1.Proposals) - GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (vote v1.Vote, found bool) } From 330c085024997377d6d01e2c3159f9562a0d913a Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 20 Mar 2024 13:58:06 +0100 Subject: [PATCH 12/36] tiny fix for E2E tests --- tests/e2e/actions.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 5fea89ec12..e49c37ae71 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -278,6 +278,7 @@ func (tr TestConfig) submitConsumerAdditionProposal( UnbondingPeriod: params.UnbondingPeriod, Deposit: fmt.Sprint(action.Deposit) + `stake`, DistributionTransmissionChannel: action.DistributionChannel, + TopN: 100, } bz, err := json.Marshal(prop) From 629cfd1a400d08ead396e4e6dc5050f18ef85665 Mon Sep 17 00:00:00 2001 From: insumity Date: Thu, 21 Mar 2024 13:36:12 +0100 Subject: [PATCH 13/36] nit change to remove unecessary else --- x/ccv/provider/keeper/partial_set_security.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 754a782f48..3e8d1c1a8c 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -89,9 +89,7 @@ func (k Keeper) OptInTopNValidators(ctx sdk.Context, chainID string, bondedValid // if validator already exists it gets overwritten k.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) - } else { - // validators that do not belong to the top N validators but were opted in, remain opted in - } + } // else validators that do not belong to the top N validators but were opted in, remain opted in } } From afd46520caca290371ed85dc2eb68644aa7b098f Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 25 Mar 2024 09:54:10 +0100 Subject: [PATCH 14/36] update consumer chains query to return topN --- .../ccv/provider/v1/query.proto | 1 + x/ccv/provider/keeper/keeper.go | 5 +- x/ccv/provider/keeper/keeper_test.go | 4 +- x/ccv/provider/types/query.pb.go | 214 ++++++++++-------- 4 files changed, 133 insertions(+), 91 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 56b06a42c3..1b684d8327 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -127,6 +127,7 @@ message QueryConsumerChainStopProposalsResponse { message Chain { string chain_id = 1; string client_id = 2; + uint32 top_N = 3; } message QueryValidatorConsumerAddrRequest { diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 7e79bf4f6c..625cfe4807 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -249,9 +249,12 @@ func (k Keeper) GetAllConsumerChains(ctx sdk.Context) (chains []types.Chain) { chainID := string(iterator.Key()[1:]) clientID := string(iterator.Value()) + topN, _ := k.GetTopN(ctx, chainID) + chains = append(chains, types.Chain{ ChainId: chainID, ClientId: clientID, + Top_N: topN, }) } @@ -1296,4 +1299,4 @@ func (k Keeper) DeleteConsumerCommissionRate( ) { store := ctx.KVStore(k.storeKey) store.Delete(types.ConsumerCommissionRateKey(chainID, providerAddr)) -} \ No newline at end of file +} diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index d1afd187d7..dfad00fcc2 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -402,8 +402,10 @@ func TestGetAllConsumerChains(t *testing.T) { expectedGetAllOrder := []types.Chain{} for i, chainID := range chainIDs { clientID := fmt.Sprintf("client-%d", len(chainIDs)-i) + topN := uint32(i) pk.SetConsumerClientId(ctx, chainID, clientID) - expectedGetAllOrder = append(expectedGetAllOrder, types.Chain{ChainId: chainID, ClientId: clientID}) + pk.SetTopN(ctx, chainID, topN) + expectedGetAllOrder = append(expectedGetAllOrder, types.Chain{ChainId: chainID, ClientId: clientID, Top_N: topN}) } // sorting by chainID sort.Slice(expectedGetAllOrder, func(i, j int) bool { diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 13f100c7ca..457a27bcaa 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -374,6 +374,7 @@ func (m *QueryConsumerChainStopProposalsResponse) GetProposals() *ConsumerRemova type Chain struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + Top_N uint32 `protobuf:"varint,3,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` } func (m *Chain) Reset() { *m = Chain{} } @@ -423,6 +424,13 @@ func (m *Chain) GetClientId() string { return "" } +func (m *Chain) GetTop_N() uint32 { + if m != nil { + return m.Top_N + } + return 0 +} + type QueryValidatorConsumerAddrRequest struct { // The id of the consumer chain ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` @@ -1186,95 +1194,96 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1403 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x73, 0x14, 0xc5, - 0x1b, 0xce, 0x24, 0x90, 0x5f, 0xd2, 0xe1, 0xdf, 0xaf, 0x89, 0x18, 0x86, 0xb8, 0x0b, 0x43, 0xa9, - 0x01, 0x74, 0x26, 0x59, 0xb4, 0xe4, 0x8f, 0x21, 0xec, 0x26, 0x80, 0x5b, 0x81, 0x22, 0x0e, 0x88, - 0x55, 0x6a, 0xb9, 0x74, 0x66, 0xda, 0xcd, 0x14, 0xb3, 0xd3, 0x43, 0x77, 0xef, 0xc2, 0x16, 0xe5, - 0x01, 0x0f, 0xca,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0xca, - 0x8d, 0x3c, 0x7f, 0x95, 0x1b, 0xf9, 0xf5, 0x55, 0x6e, 0xe4, 0xb3, 0xc5, 0xaa, 0xc3, 0x37, 0xea, - 0xeb, 0xba, 0x45, 0x6a, 0x86, 0x45, 0x58, 0x8d, 0xb0, 0x36, 0xd0, 0x77, 0x63, 0xd0, 0xc6, 0x7b, - 0xc6, 0xfd, 0x8e, 0x96, 0xd1, 0xf4, 0x31, 0x5b, 0x1f, 0x17, 0xdf, 0xa5, 0xa7, 0xff, 0x0b, 0x00, - 0x00, 0xff, 0xff, 0x67, 0x8a, 0xee, 0xb2, 0x49, 0x15, 0x00, 0x00, + // 1422 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x73, 0xdb, 0xc4, + 0x17, 0x8f, 0x92, 0x36, 0xdf, 0x64, 0xd3, 0x5f, 0xdf, 0x6d, 0x28, 0xa9, 0x1a, 0x9c, 0x56, 0x1d, + 0x20, 0x6d, 0x41, 0x4a, 0x5c, 0x18, 0xfa, 0x83, 0x34, 0xb5, 0x93, 0xb6, 0x78, 0xd2, 0x1f, 0x41, + 0x0d, 0x65, 0x06, 0x18, 0xd4, 0x8d, 0xb4, 0x38, 0x9a, 0xca, 0x5a, 0x75, 0x77, 0xed, 0xd6, 0xd3, + 0xe1, 0x50, 0x0e, 0xd0, 0x63, 0x67, 0x80, 0x7b, 0x2f, 0xfc, 0x03, 0xfc, 0x15, 0xbd, 0xb5, 0x4c, + 0x2f, 0x9c, 0x0a, 0x93, 0x72, 0x60, 0x38, 0x31, 0xdc, 0x99, 0x61, 0xb4, 0x5a, 0xd9, 0x96, 0xad, + 0xd8, 0xb2, 0x93, 0x5b, 0xbc, 0xfb, 0xde, 0xe7, 0xbd, 0xcf, 0xdb, 0xb7, 0x6f, 0x3f, 0x0a, 0x30, + 0x5c, 0x9f, 0x63, 0x6a, 0x6f, 0x20, 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 0xc8, 0xa8, 0x07, 0x98, 0xad, 0x8f, 0x8a, 0xef, 0xd2, 0xd3, + 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x4e, 0x3d, 0xac, 0x5e, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2014,6 +2023,11 @@ func (m *Chain) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Top_N != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Top_N)) + i-- + dAtA[i] = 0x18 + } if len(m.ClientId) > 0 { i -= len(m.ClientId) copy(dAtA[i:], m.ClientId) @@ -2668,6 +2682,9 @@ func (m *Chain) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.Top_N != 0 { + n += 1 + sovQuery(uint64(m.Top_N)) + } return n } @@ -3560,6 +3577,25 @@ func (m *Chain) Unmarshal(dAtA []byte) error { } m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) + } + m.Top_N = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Top_N |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) From 2e95f89754f90411582bd42707d80eb4713b780f Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 25 Mar 2024 10:02:40 +0100 Subject: [PATCH 15/36] update query consu chains proto --- .../ccv/provider/v1/query.proto | 5 +- x/ccv/provider/keeper/keeper.go | 1 + x/ccv/provider/types/query.pb.go | 227 +++++++++++------- 3 files changed, 141 insertions(+), 92 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 1b684d8327..15eee7c281 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -127,7 +127,10 @@ message QueryConsumerChainStopProposalsResponse { message Chain { string chain_id = 1; string client_id = 2; - uint32 top_N = 3; + // If the `chainID` is an Opt-In chain, i.e., no validator is forced to validate chain `chainID` + bool opt_In = 3; + // If chain with `chainID` is a Top-N chain, i.e., enforces at least one validator to validate chain `chainID` + uint32 top_N = 4; } message QueryValidatorConsumerAddrRequest { diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 625cfe4807..a9afa96c1d 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -255,6 +255,7 @@ func (k Keeper) GetAllConsumerChains(ctx sdk.Context) (chains []types.Chain) { ChainId: chainID, ClientId: clientID, Top_N: topN, + OptIn: }) } diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 457a27bcaa..563daf79e8 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -374,7 +374,10 @@ func (m *QueryConsumerChainStopProposalsResponse) GetProposals() *ConsumerRemova type Chain struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - Top_N uint32 `protobuf:"varint,3,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + // If the `chainID` is an Opt-In chain, i.e., no validator is forced to validate chain `chainID` + Opt_In bool `protobuf:"varint,3,opt,name=opt_In,json=optIn,proto3" json:"opt_In,omitempty"` + // If chain with `chainID` is a Top-N chain, i.e., enforces at least one validator to validate chain `chainID` + Top_N uint32 `protobuf:"varint,4,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` } func (m *Chain) Reset() { *m = Chain{} } @@ -424,6 +427,13 @@ func (m *Chain) GetClientId() string { return "" } +func (m *Chain) GetOpt_In() bool { + if m != nil { + return m.Opt_In + } + return false +} + func (m *Chain) GetTop_N() uint32 { if m != nil { return m.Top_N @@ -1194,96 +1204,98 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1422 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x73, 0xdb, 0xc4, - 0x17, 0x8f, 0x92, 0x36, 0xdf, 0x64, 0xd3, 0x5f, 0xdf, 0x6d, 0x28, 0xa9, 0x1a, 0x9c, 0x56, 0x1d, - 0x20, 0x6d, 0x41, 0x4a, 0x5c, 0x18, 0xfa, 0x83, 0x34, 0xb5, 0x93, 0xb6, 0x78, 0xd2, 0x1f, 0x41, - 0x0d, 0x65, 0x06, 0x18, 0xd4, 0x8d, 0xb4, 0x38, 0x9a, 0xca, 0x5a, 0x75, 0x77, 0xed, 0xd6, 0xd3, - 0xe1, 0x50, 0x0e, 0xd0, 0x63, 0x67, 0x80, 0x7b, 0x2f, 0xfc, 0x03, 0xfc, 0x15, 0xbd, 0xb5, 0x4c, - 0x2f, 0x9c, 0x0a, 0x93, 0x72, 0x60, 0x38, 0x31, 0xdc, 0x99, 0x61, 0xb4, 0x5a, 0xd9, 0x96, 0xad, - 0xd8, 0xb2, 0x93, 0x5b, 0xbc, 0xfb, 0xde, 0xe7, 0xbd, 0xcf, 0xdb, 0xb7, 0x6f, 0x3f, 0x0a, 0x30, - 0x5c, 0x9f, 0x63, 0x6a, 0x6f, 0x20, 0xd7, 0xb7, 0x18, 0xb6, 0xab, 0xd4, 0xe5, 0x75, 0xc3, 0xb6, - 0x6b, 0x46, 0x40, 0x49, 0xcd, 0x75, 0x30, 0x35, 0x6a, 0xf3, 0xc6, 0xdd, 0x2a, 0xa6, 0x75, 0x3d, - 0xa0, 0x84, 0x13, 0x78, 0x3c, 0xc5, 0x41, 0xb7, 0xed, 0x9a, 0x1e, 0x3b, 0x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xe8, - 0x6b, 0xf1, 0x63, 0x51, 0x1c, 0x0b, 0x07, 0xdb, 0xe3, 0xdf, 0x66, 0x14, 0xf3, 0x50, 0x88, 0x62, - 0xc6, 0x20, 0x4b, 0x31, 0x86, 0xf6, 0x0e, 0x38, 0x29, 0x28, 0x99, 0xb8, 0xec, 0x32, 0x8e, 0x29, - 0x76, 0x9a, 0x57, 0xe6, 0x1e, 0xa2, 0xce, 0x32, 0xf6, 0x49, 0xa5, 0x71, 0x67, 0x2f, 0x81, 0x53, - 0x99, 0xac, 0x65, 0x45, 0x0e, 0x81, 0x51, 0x47, 0xac, 0x88, 0x31, 0x38, 0x6e, 0xca, 0x5f, 0x5a, - 0x4e, 0x0e, 0xf6, 0xe8, 0x3a, 0x62, 0x47, 0x5c, 0xbf, 0xd2, 0x72, 0x23, 0xcc, 0x43, 0x05, 0xbc, - 0xb1, 0x85, 0x81, 0x44, 0xbe, 0x0d, 0xf6, 0x05, 0xad, 0x7b, 0xf1, 0xa0, 0xcd, 0x67, 0x9a, 0x0a, - 0x09, 0x58, 0x39, 0xfd, 0xdb, 0xf0, 0xb4, 0x12, 0xd8, 0x9b, 0x30, 0x83, 0x53, 0x40, 0xf6, 0xef, - 0x72, 0xb2, 0x9d, 0x97, 0x61, 0x0e, 0x80, 0x78, 0x9a, 0x94, 0x96, 0xc5, 0x61, 0xee, 0x32, 0x5b, - 0x56, 0xb4, 0xab, 0xc0, 0x10, 0x6c, 0x0a, 0x9e, 0xb7, 0x8a, 0x5c, 0xca, 0x6e, 0x21, 0x6f, 0x89, - 0xf8, 0x61, 0xcb, 0x15, 0x93, 0xc3, 0xaf, 0xb4, 0x9c, 0xe1, 0x55, 0xfc, 0x49, 0x01, 0x73, 0xd9, - 0xe1, 0x64, 0xbd, 0xee, 0x82, 0xff, 0x07, 0xc8, 0xa5, 0x56, 0x0d, 0x79, 0xe1, 0x23, 0x2f, 0xae, - 0x81, 0x2c, 0xd9, 0xe5, 0x6c, 0x25, 0x43, 0x2e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 0x30, 0xb3, 0x54, - 0x85, 0xa8, 0x5e, 0xdb, 0x21, 0x34, 0x49, 0xfa, 0x23, 0x41, 0xba, 0x08, 0x2f, 0xf6, 0x4b, 0x3a, - 0x14, 0xea, 0x94, 0x5b, 0x0d, 0xf1, 0x05, 0xff, 0x55, 0xc0, 0xeb, 0xe9, 0x2a, 0x90, 0xc1, 0x95, - 0x81, 0x93, 0xee, 0x94, 0x9b, 0xea, 0xd5, 0x9d, 0x01, 0x93, 0x05, 0xb8, 0x22, 0x0a, 0x50, 0x80, - 0x8b, 0x03, 0x14, 0x80, 0x04, 0x2d, 0xfc, 0xff, 0x8e, 0x35, 0x45, 0xaa, 0x3a, 0x83, 0x97, 0xb3, - 0x67, 0xdd, 0x4d, 0x67, 0xaa, 0x57, 0xb6, 0x8d, 0x23, 0x89, 0x17, 0x04, 0xf1, 0xf3, 0xf0, 0x6c, - 0x86, 0x8f, 0xe5, 0x18, 0xc8, 0x4a, 0x8c, 0xe8, 0x14, 0xca, 0xad, 0xaa, 0x6d, 0x20, 0xca, 0x29, - 0xfa, 0x73, 0x20, 0xca, 0x69, 0xf2, 0x71, 0x30, 0xca, 0x89, 0x47, 0x0d, 0x3e, 0x53, 0xe4, 0x3b, - 0x91, 0x50, 0x8e, 0xf0, 0x42, 0xf6, 0x14, 0xd3, 0x04, 0xa9, 0xba, 0x38, 0xb0, 0xbf, 0xa4, 0x76, - 0x46, 0x50, 0xcb, 0xc3, 0xb9, 0xde, 0xd4, 0xb8, 0x04, 0x88, 0x3e, 0xb5, 0xe1, 0x8f, 0xc3, 0xe0, - 0x78, 0x06, 0x29, 0x08, 0x6f, 0x64, 0x4f, 0x31, 0x93, 0x04, 0x55, 0x57, 0x77, 0x0e, 0x50, 0x16, - 0x61, 0x45, 0x14, 0xe1, 0x12, 0x5c, 0xea, 0x5d, 0x04, 0xda, 0x40, 0x6c, 0xf6, 0x34, 0x15, 0x98, - 0x56, 0x24, 0x6d, 0xe1, 0x5f, 0x1d, 0xd2, 0x35, 0xa9, 0xc8, 0x18, 0xec, 0xe3, 0x55, 0xdd, 0x42, - 0x1f, 0xab, 0xc5, 0xed, 0x40, 0x48, 0xd6, 0x45, 0xc1, 0xfa, 0x43, 0x78, 0xae, 0x37, 0xeb, 0x58, - 0x19, 0x5b, 0xed, 0x0f, 0xd8, 0x0f, 0xc3, 0xf2, 0xff, 0x0e, 0x19, 0xa4, 0x28, 0x5c, 0xcb, 0x9e, - 0x74, 0x76, 0xa1, 0xac, 0x7e, 0xb2, 0xc3, 0xa8, 0xb2, 0x3a, 0xe7, 0x45, 0x75, 0xde, 0x87, 0xa7, - 0xfb, 0x9e, 0xef, 0xae, 0x03, 0x7f, 0x56, 0xc0, 0x44, 0x8b, 0xfe, 0x83, 0x1f, 0xf4, 0x71, 0x5c, - 0xad, 0x3a, 0x52, 0x3d, 0xd3, 0xbf, 0xa3, 0xcc, 0x7f, 0x4e, 0xe4, 0x7f, 0x12, 0xce, 0x66, 0x38, - 0xdd, 0x48, 0x5f, 0x7e, 0xfa, 0x74, 0x33, 0xa7, 0x3c, 0xdf, 0xcc, 0x29, 0xbf, 0x6f, 0xe6, 0x94, - 0xc7, 0xaf, 0x72, 0x43, 0xcf, 0x5f, 0xe5, 0x86, 0x7e, 0x7d, 0x95, 0x1b, 0xfa, 0x6c, 0xa1, 0xec, - 0xf2, 0x8d, 0xea, 0xba, 0x6e, 0x93, 0x8a, 0x61, 0x13, 0x56, 0x21, 0xac, 0x05, 0xf4, 0xdd, 0x06, - 0x68, 0xed, 0x3d, 0xe3, 0x7e, 0xdb, 0xc8, 0xa8, 0x07, 0x98, 0xad, 0x8f, 0x8a, 0xef, 0xd2, 0xd3, - 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x4e, 0x3d, 0xac, 0x5e, 0x15, 0x00, 0x00, + // 1442 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58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0x95, 0x13, 0xe0, 0xad, 0xee, 0x14, + 0x37, 0x19, 0xa2, 0x6c, 0x9d, 0x12, 0x8f, 0xf8, 0xc8, 0x69, 0xb2, 0x79, 0x2c, 0x81, 0x7c, 0xff, + 0xb5, 0x82, 0xdb, 0xe7, 0x60, 0xda, 0x8b, 0x06, 0x45, 0xc5, 0x2e, 0xa4, 0xa3, 0x27, 0xc0, 0x8b, + 0x96, 0x65, 0x07, 0x47, 0xb8, 0x05, 0xdd, 0x02, 0x54, 0xf2, 0xe0, 0xcd, 0x24, 0x26, 0xc4, 0xeb, + 0x22, 0xfd, 0x8d, 0x94, 0x2c, 0x30, 0xb6, 0xb4, 0xb9, 0xd3, 0x5d, 0x9c, 0x97, 0x06, 0xe2, 0xac, + 0xe3, 0x2a, 0xa9, 0x23, 0x27, 0x91, 0xf2, 0x5d, 0x30, 0xc1, 0x53, 0xf7, 0x38, 0x8a, 0xf0, 0x28, + 0x98, 0x36, 0x1d, 0x1b, 0xbb, 0x2c, 0x98, 0x1b, 0xe5, 0x73, 0x53, 0xe1, 0x40, 0xd9, 0x82, 0x87, + 0xc0, 0x24, 0xf1, 0x98, 0x51, 0x76, 0x33, 0x63, 0xf3, 0x52, 0x7e, 0x4a, 0x9f, 0x20, 0x1e, 0x2b, + 0xbb, 0xf0, 0x20, 0x98, 0x60, 0xc4, 0x33, 0xae, 0x67, 0xc6, 0xe7, 0xa5, 0xfc, 0x5e, 0x7d, 0x9c, + 0x11, 0xef, 0xba, 0xf2, 0xad, 0x04, 0x8e, 0x71, 0xd5, 0xb7, 0x91, 0x63, 0x5b, 0x88, 0x11, 0xda, + 0x56, 0x56, 0xda, 0xff, 0x52, 0xc0, 0x25, 0x70, 0x20, 0x12, 0x68, 0x20, 0xcb, 0xa2, 0xd8, 0xf7, + 0x43, 0x42, 0x25, 0xf8, 0xf7, 0xab, 0xdc, 0xbe, 0x06, 0xaa, 0x3a, 0xe7, 0x14, 0x31, 0xa1, 0xe8, + 0xfb, 0xa3, 0xb5, 0xc5, 0x70, 0xe4, 0xdc, 0xd4, 0xe3, 0xa7, 0xb9, 0x91, 0x3f, 0x9e, 0xe6, 0x46, + 0x94, 0x1b, 0x40, 0xe9, 0x45, 0x44, 0x54, 0xfe, 0x04, 0x38, 0x10, 0x35, 0x85, 0x66, 0xba, 0x90, + 0xd1, 0x7e, 0xb3, 0x6d, 0x7d, 0x90, 0xac, 0x5b, 0xda, 0x7a, 0x5b, 0xf2, 0x74, 0xd2, 0xba, 0x72, + 0xf5, 0x90, 0xd6, 0x91, 0xbf, 0x97, 0xb4, 0x38, 0x91, 0x96, 0xb4, 0xae, 0x4a, 0x0a, 0x69, 0x1d, + 0x55, 0x53, 0x8e, 0x82, 0x23, 0x1c, 0xf0, 0xd6, 0x26, 0x25, 0x8c, 0x39, 0x98, 0xb7, 0x88, 0xe8, + 0x20, 0xff, 0x2c, 0x89, 0x56, 0xd1, 0x31, 0x2b, 0xd2, 0xe4, 0xc0, 0x8c, 0xef, 0x20, 0x7f, 0xd3, + 0xa8, 0x62, 0x86, 0x29, 0xcf, 0x30, 0xa6, 0x03, 0x3e, 0x74, 0x2d, 0x18, 0x81, 0x05, 0x70, 0xa8, + 0x6d, 0x81, 0x81, 0x1c, 0x87, 0xdc, 0x47, 0xae, 0x89, 0xb9, 0xf6, 0x31, 0xfd, 0x60, 0x6b, 0x69, + 0x31, 0x9a, 0x82, 0x5f, 0x80, 0x8c, 0x8b, 0x1f, 0x30, 0x83, 0x62, 0xcf, 0xc1, 0xae, 0xed, 0x6f, + 0x1a, 0x26, 0x72, 0xad, 0x40, 0x2c, 0xe6, 0x87, 0x70, 0xa6, 0x20, 0xab, 0xe1, 0x1b, 0xa2, 0x46, + 0x6f, 0x88, 0x7a, 0x2b, 0x7a, 0x43, 0x4a, 0x53, 0x41, 0xbf, 0x7b, 0xf2, 0x6b, 0x4e, 0xd2, 0x0f, + 0x07, 0x28, 0x7a, 0x04, 0xb2, 0x12, 0x61, 0x28, 0x6f, 0x83, 0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 0xc4, 0x55, 0x7f, 0x00, 0xcf, + 0xf5, 0x57, 0x1d, 0x39, 0x63, 0xa3, 0xf3, 0x01, 0xfb, 0x7e, 0x54, 0xfc, 0x3b, 0x22, 0x85, 0x15, + 0x85, 0xb7, 0xd2, 0x93, 0x4e, 0x6f, 0x94, 0xe5, 0x8f, 0x77, 0x19, 0x55, 0x54, 0xe7, 0x3c, 0xaf, + 0xce, 0x7b, 0xf0, 0xf4, 0xc0, 0xfd, 0xdd, 0xb6, 0xe0, 0x4f, 0x12, 0x98, 0x69, 0xf3, 0x7f, 0xf0, + 0xfd, 0x01, 0xb6, 0xab, 0xdd, 0x47, 0xca, 0x67, 0x06, 0x0f, 0x14, 0xfc, 0x17, 0x38, 0xff, 0x93, + 0x30, 0x9f, 0x62, 0x77, 0x43, 0x7f, 0xf9, 0xc9, 0xb3, 0xad, 0xac, 0xf4, 0x62, 0x2b, 0x2b, 0xfd, + 0xb6, 0x95, 0x95, 0x9e, 0xbc, 0xce, 0x8e, 0xbc, 0x78, 0x9d, 0x1d, 0xf9, 0xe5, 0x75, 0x76, 0xe4, + 0xd3, 0xa5, 0x8a, 0xcd, 0x36, 0x6b, 0x1b, 0xaa, 0x49, 0xaa, 0x9a, 0x49, 0xfc, 0x2a, 0xf1, 0xdb, + 0x40, 0xdf, 0x69, 0x82, 0xd6, 0xdf, 0xd5, 0x1e, 0x74, 0xb4, 0x8c, 0x86, 0x87, 0xfd, 0x8d, 0x49, + 0xfe, 0x5d, 0x7a, 0xfa, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xae, 0x5c, 0x18, 0x43, 0x75, 0x15, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2026,6 +2038,16 @@ func (m *Chain) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.Top_N != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Top_N)) i-- + dAtA[i] = 0x20 + } + if m.Opt_In { + i-- + if m.Opt_In { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- dAtA[i] = 0x18 } if len(m.ClientId) > 0 { @@ -2682,6 +2704,9 @@ func (m *Chain) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.Opt_In { + n += 2 + } if m.Top_N != 0 { n += 1 + sovQuery(uint64(m.Top_N)) } @@ -3578,6 +3603,26 @@ func (m *Chain) Unmarshal(dAtA []byte) error { m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Opt_In", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Opt_In = bool(v != 0) + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } From 1e3a8e751f38c292d80570b8aa9fa0903c185933 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 26 Mar 2024 08:48:28 +0100 Subject: [PATCH 16/36] add consumer chains per validator query --- .../ccv/provider/v1/query.proto | 36 + x/ccv/provider/keeper/grpc_query.go | 55 + x/ccv/provider/types/query.pb.go | 1082 ++++++++++++++--- x/ccv/provider/types/query.pb.gw.go | 166 +++ 4 files changed, 1195 insertions(+), 144 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 15eee7c281..3b1e6b20ee 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -99,6 +99,24 @@ service Query { option (google.api.http).get = "/interchain_security/ccv/provider/params"; } + + // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address + // that opted-in to the given consumer chain + rpc QueryOptedInValidatorsByConsumerChainID( + QueryOptedInValidatorsByConsumerChainIDRequest) + returns (QueryOptedInValidatorsByConsumerChainIDResponse) { + option (google.api.http).get = + "/interchain_security/ccv/provider/opted_in_validators"; + } + + // QueryConsumerChainsByValidatorAddress returns a list of consumer chains + // that a validator must validate + rpc QueryConsumerChainsByValidatorAddress( + QueryConsumerChainsByValidatorAddressRequest) + returns (QueryConsumerChainsByValidatorAddressResponse) { + option (google.api.http).get = + "/interchain_security/ccv/provider/consumer_chains_per_validator"; + } } message QueryConsumerGenesisRequest { string chain_id = 1; } @@ -216,3 +234,21 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } + +message QueryOptedInValidatorsByConsumerChainIDRequest { + string chain_id = 1; +} + +message QueryOptedInValidatorsByConsumerChainIDResponse { + repeated string validators_provider_address = 1; +} + + +message QueryConsumerChainsByValidatorAddressRequest { + // The consensus address of the validator on the provider chain + string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; +} + +message QueryConsumerChainsByValidatorAddressResponse { + repeated string validator_consumer_chains = 1; +} \ No newline at end of file diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index d190a5f8b0..6e4ed1c0ed 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -221,3 +221,58 @@ func (k Keeper) QueryParams(c context.Context, _ *types.QueryParamsRequest) (*ty return &types.QueryParamsResponse{Params: params}, nil } + +// QueryOptedInValidatorsByConsumerChainID returns all validators that opted-in to a given consumer chain +func (k Keeper) QueryOptedInValidatorsByConsumerChainID(goCtx context.Context, req *types.QueryOptedInValidatorsByConsumerChainIDRequest) (*types.QueryOptedInValidatorsByConsumerChainIDResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if req.ChainId == "" { + return nil, status.Error(codes.InvalidArgument, "empty chainId") + } + + optedVals := []string{} + + ctx := sdk.UnwrapSDKContext(goCtx) + + for _, v := range k.GetAllOptedIn(ctx, ctx.ChainID()) { + optedVals = append(optedVals, v.ToSdkConsAddr().String()) + } + + return &types.QueryOptedInValidatorsByConsumerChainIDResponse{ + ValidatorsProviderAddress: optedVals, + }, nil +} + +// QueryOptedInValidatorsByConsumerChainID returns all consumer chains a given validator has to validate +func (k Keeper) QueryConsumerChainsByValidatorAddress(goCtx context.Context, req *types.QueryConsumerChainsByValidatorAddressRequest) (*types.QueryConsumerChainsByValidatorAddressResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if req.ProviderAddress == "" { + return nil, status.Error(codes.InvalidArgument, "empty provider address") + } + + consAddr, err := sdk.ConsAddressFromBech32(req.ProviderAddress) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid provider address") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + // get all consumer chains + consumersToValidate := []string{} + // iterate over all consumer chains to see if the validator is opted in + for _, consumer := range k.GetAllConsumerChains(ctx) { + chainID := consumer.ChainId + if k.IsConsumerValidator(ctx, chainID, types.NewProviderConsAddress(consAddr)) { + consumersToValidate = append(consumersToValidate, chainID) + } + } + + return &types.QueryConsumerChainsByValidatorAddressResponse{ + ValidatorConsumerChains: consumersToValidate, + }, nil +} diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 563daf79e8..21647bb30c 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1171,6 +1171,199 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +type QueryOptedInValidatorsByConsumerChainIDRequest struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Reset() { + *m = QueryOptedInValidatorsByConsumerChainIDRequest{} +} +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryOptedInValidatorsByConsumerChainIDRequest) ProtoMessage() {} +func (*QueryOptedInValidatorsByConsumerChainIDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{25} +} +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDRequest.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 *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDRequest.Merge(m, src) +} +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDRequest proto.InternalMessageInfo + +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +type QueryOptedInValidatorsByConsumerChainIDResponse struct { + ValidatorsProviderAddress []string `protobuf:"bytes,1,rep,name=validators_provider_address,json=validatorsProviderAddress,proto3" json:"validators_provider_address,omitempty"` +} + +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Reset() { + *m = QueryOptedInValidatorsByConsumerChainIDResponse{} +} +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryOptedInValidatorsByConsumerChainIDResponse) ProtoMessage() {} +func (*QueryOptedInValidatorsByConsumerChainIDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{26} +} +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDResponse.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 *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDResponse.Merge(m, src) +} +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDResponse proto.InternalMessageInfo + +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) GetValidatorsProviderAddress() []string { + if m != nil { + return m.ValidatorsProviderAddress + } + return nil +} + +type QueryConsumerChainsByValidatorAddressRequest struct { + // The consensus address of the validator on the provider chain + ProviderAddress string `protobuf:"bytes,1,opt,name=provider_address,json=providerAddress,proto3" json:"provider_address,omitempty" yaml:"address"` +} + +func (m *QueryConsumerChainsByValidatorAddressRequest) Reset() { + *m = QueryConsumerChainsByValidatorAddressRequest{} +} +func (m *QueryConsumerChainsByValidatorAddressRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryConsumerChainsByValidatorAddressRequest) ProtoMessage() {} +func (*QueryConsumerChainsByValidatorAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{27} +} +func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConsumerChainsByValidatorAddressRequest.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 *QueryConsumerChainsByValidatorAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConsumerChainsByValidatorAddressRequest.Merge(m, src) +} +func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConsumerChainsByValidatorAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConsumerChainsByValidatorAddressRequest proto.InternalMessageInfo + +func (m *QueryConsumerChainsByValidatorAddressRequest) GetProviderAddress() string { + if m != nil { + return m.ProviderAddress + } + return "" +} + +type QueryConsumerChainsByValidatorAddressResponse struct { + ValidatorConsumerChains []string `protobuf:"bytes,1,rep,name=validator_consumer_chains,json=validatorConsumerChains,proto3" json:"validator_consumer_chains,omitempty"` +} + +func (m *QueryConsumerChainsByValidatorAddressResponse) Reset() { + *m = QueryConsumerChainsByValidatorAddressResponse{} +} +func (m *QueryConsumerChainsByValidatorAddressResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryConsumerChainsByValidatorAddressResponse) ProtoMessage() {} +func (*QueryConsumerChainsByValidatorAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{28} +} +func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConsumerChainsByValidatorAddressResponse.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 *QueryConsumerChainsByValidatorAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConsumerChainsByValidatorAddressResponse.Merge(m, src) +} +func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConsumerChainsByValidatorAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConsumerChainsByValidatorAddressResponse proto.InternalMessageInfo + +func (m *QueryConsumerChainsByValidatorAddressResponse) GetValidatorConsumerChains() []string { + if m != nil { + return m.ValidatorConsumerChains + } + return nil +} + func init() { proto.RegisterType((*QueryConsumerGenesisRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisRequest") proto.RegisterType((*QueryConsumerGenesisResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisResponse") @@ -1197,6 +1390,10 @@ func init() { proto.RegisterType((*PairValConAddrProviderAndConsumer)(nil), "interchain_security.ccv.provider.v1.PairValConAddrProviderAndConsumer") proto.RegisterType((*QueryParamsRequest)(nil), "interchain_security.ccv.provider.v1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "interchain_security.ccv.provider.v1.QueryParamsResponse") + proto.RegisterType((*QueryOptedInValidatorsByConsumerChainIDRequest)(nil), "interchain_security.ccv.provider.v1.QueryOptedInValidatorsByConsumerChainIDRequest") + proto.RegisterType((*QueryOptedInValidatorsByConsumerChainIDResponse)(nil), "interchain_security.ccv.provider.v1.QueryOptedInValidatorsByConsumerChainIDResponse") + proto.RegisterType((*QueryConsumerChainsByValidatorAddressRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainsByValidatorAddressRequest") + proto.RegisterType((*QueryConsumerChainsByValidatorAddressResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainsByValidatorAddressResponse") } func init() { @@ -1204,98 +1401,107 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1442 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x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xc5, 0x49, 0x51, 0x39, 0x88, 0x2e, 0x22, 0x95, 0x13, 0xe0, 0xad, 0xee, 0x14, - 0x37, 0x19, 0xa2, 0x6c, 0x9d, 0x12, 0x8f, 0xf8, 0xc8, 0x69, 0xb2, 0x79, 0x2c, 0x81, 0x7c, 0xff, - 0xb5, 0x82, 0xdb, 0xe7, 0x60, 0xda, 0x8b, 0x06, 0x45, 0xc5, 0x2e, 0xa4, 0xa3, 0x27, 0xc0, 0x8b, - 0x96, 0x65, 0x07, 0x47, 0xb8, 0x05, 0xdd, 0x02, 0x54, 0xf2, 0xe0, 0xcd, 0x24, 0x26, 0xc4, 0xeb, - 0x22, 0xfd, 0x8d, 0x94, 0x2c, 0x30, 0xb6, 0xb4, 0xb9, 0xd3, 0x5d, 0x9c, 0x97, 0x06, 0xe2, 0xac, - 0xe3, 0x2a, 0xa9, 0x23, 0x27, 0x91, 0xf2, 0x5d, 0x30, 0xc1, 0x53, 0xf7, 0x38, 0x8a, 0xf0, 0x28, - 0x98, 0x36, 0x1d, 0x1b, 0xbb, 0x2c, 0x98, 0x1b, 0xe5, 0x73, 0x53, 0xe1, 0x40, 0xd9, 0x82, 0x87, - 0xc0, 0x24, 0xf1, 0x98, 0x51, 0x76, 0x33, 0x63, 0xf3, 0x52, 0x7e, 0x4a, 0x9f, 0x20, 0x1e, 0x2b, - 0xbb, 0xf0, 0x20, 0x98, 0x60, 0xc4, 0x33, 0xae, 0x67, 0xc6, 0xe7, 0xa5, 0xfc, 0x5e, 0x7d, 0x9c, - 0x11, 0xef, 0xba, 0xf2, 0xad, 0x04, 0x8e, 0x71, 0xd5, 0xb7, 0x91, 0x63, 0x5b, 0x88, 0x11, 0xda, - 0x56, 0x56, 0xda, 0xff, 0x52, 0xc0, 0x25, 0x70, 0x20, 0x12, 0x68, 0x20, 0xcb, 0xa2, 0xd8, 0xf7, - 0x43, 0x42, 0x25, 0xf8, 0xf7, 0xab, 0xdc, 0xbe, 0x06, 0xaa, 0x3a, 0xe7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x63, 0xb9, 0xb4, 0x13, 0x08, 0xa1, 0xba, 0xc4, 0x55, 0x7f, 0x00, 0xcf, - 0xf5, 0x57, 0x1d, 0x39, 0x63, 0xa3, 0xf3, 0x01, 0xfb, 0x7e, 0x54, 0xfc, 0x3b, 0x22, 0x85, 0x15, - 0x85, 0xb7, 0xd2, 0x93, 0x4e, 0x6f, 0x94, 0xe5, 0x8f, 0x77, 0x19, 0x55, 0x54, 0xe7, 0x3c, 0xaf, - 0xce, 0x7b, 0xf0, 0xf4, 0xc0, 0xfd, 0xdd, 0xb6, 0xe0, 0x4f, 0x12, 0x98, 0x69, 0xf3, 0x7f, 0xf0, - 0xfd, 0x01, 0xb6, 0xab, 0xdd, 0x47, 0xca, 0x67, 0x06, 0x0f, 0x14, 0xfc, 0x17, 0x38, 0xff, 0x93, - 0x30, 0x9f, 0x62, 0x77, 0x43, 0x7f, 0xf9, 0xc9, 0xb3, 0xad, 0xac, 0xf4, 0x62, 0x2b, 0x2b, 0xfd, - 0xb6, 0x95, 0x95, 0x9e, 0xbc, 0xce, 0x8e, 0xbc, 0x78, 0x9d, 0x1d, 0xf9, 0xe5, 0x75, 0x76, 0xe4, - 0xd3, 0xa5, 0x8a, 0xcd, 0x36, 0x6b, 0x1b, 0xaa, 0x49, 0xaa, 0x9a, 0x49, 0xfc, 0x2a, 0xf1, 0xdb, - 0x40, 0xdf, 0x69, 0x82, 0xd6, 0xdf, 0xd5, 0x1e, 0x74, 0xb4, 0x8c, 0x86, 0x87, 0xfd, 0x8d, 0x49, - 0xfe, 0x5d, 0x7a, 0xfa, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xae, 0x5c, 0x18, 0x43, 0x75, 0x15, - 0x00, 0x00, + // 1595 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x73, 0xd4, 0xc6, + 0x12, 0xb7, 0xfc, 0xf5, 0xec,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0xf0, 0x42, 0xfb, 0x40, 0x60, 0x1f, 0x55, 0xb3, 0x1c, + 0x2d, 0x1e, 0x29, 0xe0, 0xb7, 0xbd, 0xe0, 0x64, 0xa6, 0xae, 0x1e, 0xde, 0xeb, 0xb6, 0x93, 0xdc, + 0x76, 0x20, 0x11, 0xd5, 0xdd, 0x84, 0xdc, 0x69, 0xe3, 0x42, 0x34, 0x17, 0x79, 0x71, 0x68, 0x8a, + 0x1f, 0xbe, 0xda, 0xca, 0x0b, 0xaf, 0xb7, 0xf2, 0xc2, 0x2f, 0x5b, 0x79, 0xe1, 0xf9, 0xbb, 0x7c, + 0xcf, 0xeb, 0x77, 0xf9, 0x9e, 0x9f, 0xde, 0xe5, 0x7b, 0x3e, 0x9a, 0x2d, 0x5b, 0x74, 0x6d, 0x73, + 0x55, 0x36, 0x70, 0x45, 0x31, 0x30, 0xa9, 0x60, 0x52, 0x67, 0xeb, 0x5c, 0x64, 0xab, 0xfa, 0x7f, + 0xe5, 0x71, 0xc3, 0x13, 0x53, 0x73, 0x11, 0x59, 0x1d, 0x64, 0xdf, 0x98, 0xce, 0xff, 0x13, 0x00, + 0x00, 0xff, 0xff, 0x8b, 0x1e, 0xc4, 0xbd, 0x41, 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1340,6 +1546,12 @@ type QueryClient interface { QueryAllPairsValConAddrByConsumerChainID(ctx context.Context, in *QueryAllPairsValConAddrByConsumerChainIDRequest, opts ...grpc.CallOption) (*QueryAllPairsValConAddrByConsumerChainIDResponse, error) // QueryParams returns all current values of provider parameters QueryParams(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address + // that opted-in to the given consumer chain + QueryOptedInValidatorsByConsumerChainID(ctx context.Context, in *QueryOptedInValidatorsByConsumerChainIDRequest, opts ...grpc.CallOption) (*QueryOptedInValidatorsByConsumerChainIDResponse, error) + // QueryConsumerChainsByValidatorAddress returns a list of consumer chains + // that a validator must validate + QueryConsumerChainsByValidatorAddress(ctx context.Context, in *QueryConsumerChainsByValidatorAddressRequest, opts ...grpc.CallOption) (*QueryConsumerChainsByValidatorAddressResponse, error) } type queryClient struct { @@ -1449,6 +1661,24 @@ func (c *queryClient) QueryParams(ctx context.Context, in *QueryParamsRequest, o return out, nil } +func (c *queryClient) QueryOptedInValidatorsByConsumerChainID(ctx context.Context, in *QueryOptedInValidatorsByConsumerChainIDRequest, opts ...grpc.CallOption) (*QueryOptedInValidatorsByConsumerChainIDResponse, error) { + out := new(QueryOptedInValidatorsByConsumerChainIDResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryOptedInValidatorsByConsumerChainID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryConsumerChainsByValidatorAddress(ctx context.Context, in *QueryConsumerChainsByValidatorAddressRequest, opts ...grpc.CallOption) (*QueryConsumerChainsByValidatorAddressResponse, error) { + out := new(QueryConsumerChainsByValidatorAddressResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryConsumerChainsByValidatorAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -1481,6 +1711,12 @@ type QueryServer interface { QueryAllPairsValConAddrByConsumerChainID(context.Context, *QueryAllPairsValConAddrByConsumerChainIDRequest) (*QueryAllPairsValConAddrByConsumerChainIDResponse, error) // QueryParams returns all current values of provider parameters QueryParams(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address + // that opted-in to the given consumer chain + QueryOptedInValidatorsByConsumerChainID(context.Context, *QueryOptedInValidatorsByConsumerChainIDRequest) (*QueryOptedInValidatorsByConsumerChainIDResponse, error) + // QueryConsumerChainsByValidatorAddress returns a list of consumer chains + // that a validator must validate + QueryConsumerChainsByValidatorAddress(context.Context, *QueryConsumerChainsByValidatorAddressRequest) (*QueryConsumerChainsByValidatorAddressResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1520,6 +1756,12 @@ func (*UnimplementedQueryServer) QueryAllPairsValConAddrByConsumerChainID(ctx co func (*UnimplementedQueryServer) QueryParams(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryParams not implemented") } +func (*UnimplementedQueryServer) QueryOptedInValidatorsByConsumerChainID(ctx context.Context, req *QueryOptedInValidatorsByConsumerChainIDRequest) (*QueryOptedInValidatorsByConsumerChainIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOptedInValidatorsByConsumerChainID not implemented") +} +func (*UnimplementedQueryServer) QueryConsumerChainsByValidatorAddress(ctx context.Context, req *QueryConsumerChainsByValidatorAddressRequest) (*QueryConsumerChainsByValidatorAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryConsumerChainsByValidatorAddress not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1723,6 +1965,42 @@ func _Query_QueryParams_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_QueryOptedInValidatorsByConsumerChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOptedInValidatorsByConsumerChainIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOptedInValidatorsByConsumerChainID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryOptedInValidatorsByConsumerChainID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOptedInValidatorsByConsumerChainID(ctx, req.(*QueryOptedInValidatorsByConsumerChainIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryConsumerChainsByValidatorAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryConsumerChainsByValidatorAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryConsumerChainsByValidatorAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryConsumerChainsByValidatorAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryConsumerChainsByValidatorAddress(ctx, req.(*QueryConsumerChainsByValidatorAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.provider.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1771,6 +2049,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryParams", Handler: _Query_QueryParams_Handler, }, + { + MethodName: "QueryOptedInValidatorsByConsumerChainID", + Handler: _Query_QueryOptedInValidatorsByConsumerChainID_Handler, + }, + { + MethodName: "QueryConsumerChainsByValidatorAddress", + Handler: _Query_QueryConsumerChainsByValidatorAddress_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/query.proto", @@ -2587,79 +2873,203 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryConsumerGenesisRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryConsumerGenesisResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - l = m.GenesisState.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return dAtA[:n], nil } -func (m *QueryConsumerChainsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryConsumerChainsResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Chains) > 0 { - for _, e := range m.Chains { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.ValidatorsProviderAddress) > 0 { + for iNdEx := len(m.ValidatorsProviderAddress) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ValidatorsProviderAddress[iNdEx]) + copy(dAtA[i:], m.ValidatorsProviderAddress[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorsProviderAddress[iNdEx]))) + i-- + dAtA[i] = 0xa } } - return n + return len(dAtA) - i, nil } -func (m *QueryConsumerChainStartProposalsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryConsumerChainsByValidatorAddressRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryConsumerChainStartProposalsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int +func (m *QueryConsumerChainsByValidatorAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConsumerChainsByValidatorAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProviderAddress) > 0 { + i -= len(m.ProviderAddress) + copy(dAtA[i:], m.ProviderAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProviderAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryConsumerChainsByValidatorAddressResponse) 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 *QueryConsumerChainsByValidatorAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConsumerChainsByValidatorAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorConsumerChains) > 0 { + for iNdEx := len(m.ValidatorConsumerChains) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ValidatorConsumerChains[iNdEx]) + copy(dAtA[i:], m.ValidatorConsumerChains[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorConsumerChains[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryConsumerGenesisRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryConsumerGenesisResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.GenesisState.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryConsumerChainsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryConsumerChainsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Chains) > 0 { + for _, e := range m.Chains { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryConsumerChainStartProposalsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryConsumerChainStartProposalsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int _ = l if m.Proposals != nil { l = m.Proposals.Size() @@ -2932,6 +3342,62 @@ func (m *QueryParamsResponse) Size() (n int) { return n } +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ValidatorsProviderAddress) > 0 { + for _, s := range m.ValidatorsProviderAddress { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryConsumerChainsByValidatorAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProviderAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryConsumerChainsByValidatorAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ValidatorConsumerChains) > 0 { + for _, s := range m.ValidatorConsumerChains { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5041,6 +5507,334 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryOptedInValidatorsByConsumerChainIDRequest) 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 ErrIntOverflowQuery + } + 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: QueryOptedInValidatorsByConsumerChainIDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOptedInValidatorsByConsumerChainIDRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryOptedInValidatorsByConsumerChainIDResponse) 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 ErrIntOverflowQuery + } + 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: QueryOptedInValidatorsByConsumerChainIDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOptedInValidatorsByConsumerChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsProviderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorsProviderAddress = append(m.ValidatorsProviderAddress, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryConsumerChainsByValidatorAddressRequest) 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 ErrIntOverflowQuery + } + 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: QueryConsumerChainsByValidatorAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConsumerChainsByValidatorAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryConsumerChainsByValidatorAddressResponse) 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 ErrIntOverflowQuery + } + 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: QueryConsumerChainsByValidatorAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConsumerChainsByValidatorAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorConsumerChains", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorConsumerChains = append(m.ValidatorConsumerChains, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/provider/types/query.pb.gw.go b/x/ccv/provider/types/query.pb.gw.go index bc37627c52..618772e54e 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -321,6 +321,78 @@ func local_request_Query_QueryParams_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_Query_QueryOptedInValidatorsByConsumerChainID_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryOptedInValidatorsByConsumerChainID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOptedInValidatorsByConsumerChainIDRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryOptedInValidatorsByConsumerChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryOptedInValidatorsByConsumerChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryOptedInValidatorsByConsumerChainID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOptedInValidatorsByConsumerChainIDRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryOptedInValidatorsByConsumerChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryOptedInValidatorsByConsumerChainID(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryConsumerChainsByValidatorAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryConsumerChainsByValidatorAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerChainsByValidatorAddressRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainsByValidatorAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryConsumerChainsByValidatorAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryConsumerChainsByValidatorAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerChainsByValidatorAddressRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainsByValidatorAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryConsumerChainsByValidatorAddress(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -580,6 +652,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryOptedInValidatorsByConsumerChainID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryOptedInValidatorsByConsumerChainID_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryOptedInValidatorsByConsumerChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryConsumerChainsByValidatorAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryConsumerChainsByValidatorAddress_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryConsumerChainsByValidatorAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -841,6 +959,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryOptedInValidatorsByConsumerChainID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryOptedInValidatorsByConsumerChainID_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryOptedInValidatorsByConsumerChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryConsumerChainsByValidatorAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryConsumerChainsByValidatorAddress_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryConsumerChainsByValidatorAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -866,6 +1024,10 @@ var ( pattern_Query_QueryAllPairsValConAddrByConsumerChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_chain_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryOptedInValidatorsByConsumerChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "opted_in_validators"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryConsumerChainsByValidatorAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_chains_per_validator"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -890,4 +1052,8 @@ var ( forward_Query_QueryAllPairsValConAddrByConsumerChainID_0 = runtime.ForwardResponseMessage forward_Query_QueryParams_0 = runtime.ForwardResponseMessage + + forward_Query_QueryOptedInValidatorsByConsumerChainID_0 = runtime.ForwardResponseMessage + + forward_Query_QueryConsumerChainsByValidatorAddress_0 = runtime.ForwardResponseMessage ) From 149ba7aa6aeb999c390b41b5a1fd5146938501f4 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 26 Mar 2024 09:04:37 +0100 Subject: [PATCH 17/36] Add PSS command to provider's cli --- x/ccv/provider/client/cli/query.go | 78 ++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index 10b33322c6..a868ded70b 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -35,6 +35,8 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand(CmdProposedConsumerChains()) cmd.AddCommand(CmdAllPairsValConAddrByConsumerChainID()) cmd.AddCommand(CmdProviderParameters()) + cmd.AddCommand(CmdOptedInValidatorsByConsumerChainID()) + cmd.AddCommand(CmdConsumerChainsByValidatorAddress()) return cmd } @@ -409,3 +411,79 @@ $ %s query provider params return cmd } + +// Command to query opted-in validators by consumer chain ID +func CmdOptedInValidatorsByConsumerChainID() *cobra.Command { + cmd := &cobra.Command{ + Use: "opted-in-validators", + Short: "Query opted-in validators for a given consumer chain", + Long: strings.TrimSpace( + fmt.Sprintf(`Query opted-in validators for a given consumer chain. +Example: +$ %s opted-in-validators foochain + `, version.AppName), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.QueryOptedInValidatorsByConsumerChainID(cmd.Context(), + &types.QueryOptedInValidatorsByConsumerChainIDRequest{ChainId: args[0]}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// Command to query the consumer chains list a given validator has to validate +func CmdConsumerChainsByValidatorAddress() *cobra.Command { + bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix() + cmd := &cobra.Command{ + Use: "has-to-validate", + Short: "Query the consumer chains list a given validator has to validate", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the consumer chains list a given validator has to validate. +Example: +$ %s has-to-validate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + `, version.AppName, bech32PrefixConsAddr), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + addr, err := sdk.ConsAddressFromBech32(args[0]) + if err != nil { + return err + } + + res, err := queryClient.QueryConsumerChainsByValidatorAddress(cmd.Context(), + &types.QueryConsumerChainsByValidatorAddressRequest{ + ProviderAddress: addr.String(), + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} From 24be8b2c87cb8a0768c101cf3f1e46ef7162e994 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 26 Mar 2024 09:20:38 +0100 Subject: [PATCH 18/36] nits --- x/ccv/provider/keeper/grpc_query.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 6e4ed1c0ed..8852245979 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -42,7 +43,6 @@ func (k Keeper) QueryConsumerChains(goCtx context.Context, req *types.QueryConsu ctx := sdk.UnwrapSDKContext(goCtx) - // convert to array of pointers chains := []*types.Chain{} for _, chain := range k.GetAllConsumerChains(ctx) { // prevent implicit memory aliasing @@ -228,20 +228,24 @@ func (k Keeper) QueryOptedInValidatorsByConsumerChainID(goCtx context.Context, r return nil, status.Error(codes.InvalidArgument, "empty request") } - if req.ChainId == "" { + consumerChainID := req.ChainId + if consumerChainID == "" { return nil, status.Error(codes.InvalidArgument, "empty chainId") } - optedVals := []string{} - + optedInVals := []string{} ctx := sdk.UnwrapSDKContext(goCtx) + if !k.IsConsumerProposedOrRegistered(ctx, consumerChainID) { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unknown consumer chain: %s", consumerChainID)) + } + for _, v := range k.GetAllOptedIn(ctx, ctx.ChainID()) { - optedVals = append(optedVals, v.ToSdkConsAddr().String()) + optedInVals = append(optedInVals, v.ToSdkConsAddr().String()) } return &types.QueryOptedInValidatorsByConsumerChainIDResponse{ - ValidatorsProviderAddress: optedVals, + ValidatorsProviderAddress: optedInVals, }, nil } @@ -264,7 +268,7 @@ func (k Keeper) QueryConsumerChainsByValidatorAddress(goCtx context.Context, req // get all consumer chains consumersToValidate := []string{} - // iterate over all consumer chains to see if the validator is opted in + // iterate over all consumer chains and check if the validator is opted-in for _, consumer := range k.GetAllConsumerChains(ctx) { chainID := consumer.ChainId if k.IsConsumerValidator(ctx, chainID, types.NewProviderConsAddress(consAddr)) { From b311f35c1465a619dd5344edcf1a1e5c7d8f5000 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 26 Mar 2024 14:31:03 +0100 Subject: [PATCH 19/36] add consumer commission rate query --- .../ccv/provider/v1/query.proto | 28 +- x/ccv/provider/client/cli/query.go | 49 +- x/ccv/provider/keeper/grpc_query.go | 39 ++ x/ccv/provider/types/query.pb.go | 648 +++++++++++++++--- x/ccv/provider/types/query.pb.gw.go | 83 +++ 5 files changed, 743 insertions(+), 104 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 3b1e6b20ee..d1c474b693 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -10,6 +10,7 @@ import "interchain_security/ccv/provider/v1/provider.proto"; import "interchain_security/ccv/v1/shared_consumer.proto"; import "interchain_security/ccv/v1/wire.proto"; import "tendermint/crypto/keys.proto"; +import "cosmos_proto/cosmos.proto"; service Query { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -117,6 +118,15 @@ service Query { option (google.api.http).get = "/interchain_security/ccv/provider/consumer_chains_per_validator"; } + + // QueryValidatorConsumerCommissionRate returns the commission rate a given + // validator charges on a given consumer chain + rpc QueryValidatorConsumerCommissionRate( + QueryValidatorConsumerCommissionRateRequest) + returns (QueryValidatorConsumerCommissionRateResponse) { + option (google.api.http).get = + "/interchain_security/ccv/provider/consumer_commission_rate"; + } } message QueryConsumerGenesisRequest { string chain_id = 1; } @@ -251,4 +261,20 @@ message QueryConsumerChainsByValidatorAddressRequest { message QueryConsumerChainsByValidatorAddressResponse { repeated string validator_consumer_chains = 1; -} \ No newline at end of file +} + +message QueryValidatorConsumerCommissionRateRequest { + string chain_id = 1; + // The consensus address of the validator on the provider chain + string provider_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; +} + +message QueryValidatorConsumerCommissionRateResponse { + // The rate to charge delegators on the consumer chain, as a fraction + string rate = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index a868ded70b..1e1b5feb8d 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -37,6 +37,7 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand(CmdProviderParameters()) cmd.AddCommand(CmdOptedInValidatorsByConsumerChainID()) cmd.AddCommand(CmdConsumerChainsByValidatorAddress()) + cmd.AddCommand(CmdValidatorConsumerCommissionRate()) return cmd } @@ -415,7 +416,7 @@ $ %s query provider params // Command to query opted-in validators by consumer chain ID func CmdOptedInValidatorsByConsumerChainID() *cobra.Command { cmd := &cobra.Command{ - Use: "opted-in-validators", + Use: "opted-in-validators [chainid]", Short: "Query opted-in validators for a given consumer chain", Long: strings.TrimSpace( fmt.Sprintf(`Query opted-in validators for a given consumer chain. @@ -450,7 +451,7 @@ $ %s opted-in-validators foochain func CmdConsumerChainsByValidatorAddress() *cobra.Command { bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix() cmd := &cobra.Command{ - Use: "has-to-validate", + Use: "has-to-validate [provider-validator-address]", Short: "Query the consumer chains list a given validator has to validate", Long: strings.TrimSpace( fmt.Sprintf(`Query the consumer chains list a given validator has to validate. @@ -487,3 +488,47 @@ $ %s has-to-validate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj return cmd } + +// Command to query the consumer commission rate a validator charges +// on a consumer chain +func CmdValidatorConsumerCommissionRate() *cobra.Command { + bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix() + cmd := &cobra.Command{ + Use: "validator-consumer-commission-rate [chainid] [provider-validator-address]", + Short: "Query the consumer commission rate a validator charges on a consumer chain", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the consumer commission rate a validator charges on a consumer chain. +Example: +$ %s validator-consumer-commission-rate foochain %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + `, version.AppName, bech32PrefixConsAddr), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + addr, err := sdk.ConsAddressFromBech32(args[1]) + if err != nil { + return err + } + + res, err := queryClient.QueryValidatorConsumerCommissionRate(cmd.Context(), + &types.QueryValidatorConsumerCommissionRateRequest{ + ChainId: args[0], + ProviderAddress: addr.String(), + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 8852245979..85d1107917 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -280,3 +280,42 @@ func (k Keeper) QueryConsumerChainsByValidatorAddress(goCtx context.Context, req ValidatorConsumerChains: consumersToValidate, }, nil } + +// QueryValidatorConsumerCommissionRate returns the commission rate a given +// validator charges on a given consumer chain +func (k Keeper) QueryValidatorConsumerCommissionRate(goCtx context.Context, req *types.QueryValidatorConsumerCommissionRateRequest) (*types.QueryValidatorConsumerCommissionRateResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + consumerChainID := req.ChainId + if consumerChainID == "" { + return nil, status.Error(codes.InvalidArgument, "empty chainId") + } + + consAddr, err := sdk.ConsAddressFromBech32(req.ProviderAddress) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid provider address") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + if !k.IsConsumerProposedOrRegistered(ctx, consumerChainID) { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unknown consumer chain: %s", consumerChainID)) + } + + res := &types.QueryValidatorConsumerCommissionRateResponse{} + + consumerRate, found := k.GetConsumerCommissionRate(ctx, consumerChainID, types.NewProviderConsAddress(consAddr)) + if found { + res.Rate = consumerRate + } else { + v, ok := k.stakingKeeper.GetValidatorByConsAddr(ctx, consAddr) + if !ok { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unknown validator: %s", consAddr.String())) + } + res.Rate = v.Commission.Rate + } + + return res, nil +} diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 21647bb30c..86ccfb7e19 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -7,6 +7,8 @@ import ( context "context" 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" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -1364,6 +1366,105 @@ func (m *QueryConsumerChainsByValidatorAddressResponse) GetValidatorConsumerChai return nil } +type QueryValidatorConsumerCommissionRateRequest struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The consensus address of the validator on the provider chain + ProviderAddress string `protobuf:"bytes,2,opt,name=provider_address,json=providerAddress,proto3" json:"provider_address,omitempty" yaml:"address"` +} + +func (m *QueryValidatorConsumerCommissionRateRequest) Reset() { + *m = QueryValidatorConsumerCommissionRateRequest{} +} +func (m *QueryValidatorConsumerCommissionRateRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryValidatorConsumerCommissionRateRequest) ProtoMessage() {} +func (*QueryValidatorConsumerCommissionRateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{29} +} +func (m *QueryValidatorConsumerCommissionRateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorConsumerCommissionRateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorConsumerCommissionRateRequest.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 *QueryValidatorConsumerCommissionRateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorConsumerCommissionRateRequest.Merge(m, src) +} +func (m *QueryValidatorConsumerCommissionRateRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorConsumerCommissionRateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorConsumerCommissionRateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorConsumerCommissionRateRequest proto.InternalMessageInfo + +func (m *QueryValidatorConsumerCommissionRateRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *QueryValidatorConsumerCommissionRateRequest) GetProviderAddress() string { + if m != nil { + return m.ProviderAddress + } + return "" +} + +type QueryValidatorConsumerCommissionRateResponse struct { + // The rate to charge delegators on the consumer chain, as a fraction + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` +} + +func (m *QueryValidatorConsumerCommissionRateResponse) Reset() { + *m = QueryValidatorConsumerCommissionRateResponse{} +} +func (m *QueryValidatorConsumerCommissionRateResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryValidatorConsumerCommissionRateResponse) ProtoMessage() {} +func (*QueryValidatorConsumerCommissionRateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{30} +} +func (m *QueryValidatorConsumerCommissionRateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorConsumerCommissionRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorConsumerCommissionRateResponse.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 *QueryValidatorConsumerCommissionRateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorConsumerCommissionRateResponse.Merge(m, src) +} +func (m *QueryValidatorConsumerCommissionRateResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorConsumerCommissionRateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorConsumerCommissionRateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorConsumerCommissionRateResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*QueryConsumerGenesisRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisRequest") proto.RegisterType((*QueryConsumerGenesisResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisResponse") @@ -1394,6 +1495,8 @@ func init() { proto.RegisterType((*QueryOptedInValidatorsByConsumerChainIDResponse)(nil), "interchain_security.ccv.provider.v1.QueryOptedInValidatorsByConsumerChainIDResponse") proto.RegisterType((*QueryConsumerChainsByValidatorAddressRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainsByValidatorAddressRequest") proto.RegisterType((*QueryConsumerChainsByValidatorAddressResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainsByValidatorAddressResponse") + proto.RegisterType((*QueryValidatorConsumerCommissionRateRequest)(nil), "interchain_security.ccv.provider.v1.QueryValidatorConsumerCommissionRateRequest") + proto.RegisterType((*QueryValidatorConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.QueryValidatorConsumerCommissionRateResponse") } func init() { @@ -1401,107 +1504,114 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1595 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x73, 0xd4, 0xc6, - 0x12, 0xb7, 0xfc, 0xf5, 0xec, 0x31, 0x5f, 0x6f, 0xf8, 0x5a, 0x64, 0xbf, 0xb5, 0x11, 0xc5, 0x7b, - 0xe6, 0x4b, 0xb2, 0x97, 0x47, 0x01, 0x26, 0xc6, 0x78, 0x6d, 0x20, 0x5b, 0xe6, 0xc3, 0x08, 0x87, - 0x54, 0x25, 0xa9, 0x08, 0x59, 0x9a, 0xac, 0x55, 0xd6, 0x6a, 0x64, 0xcd, 0x78, 0x61, 0x8b, 0xca, - 0x81, 0x1c, 0x12, 0x8e, 0x54, 0x91, 0x54, 0xae, 0x5c, 0xf2, 0x0f, 0xe4, 0xaf, 0xe0, 0x16, 0x52, - 0x5c, 0x72, 0x22, 0x29, 0x93, 0x43, 0x2a, 0xa7, 0x54, 0xee, 0xa9, 0xa4, 0x34, 0x1a, 0x49, 0xab, - 0x5d, 0x79, 0x57, 0xbb, 0xf6, 0x6d, 0x77, 0xa6, 0xfb, 0xd7, 0xfd, 0xeb, 0xe9, 0xe9, 0xe9, 0x16, - 0x50, 0x2c, 0x87, 0x22, 0xcf, 0x58, 0xd3, 0x2d, 0x47, 0x23, 0xc8, 0xd8, 0xf4, 0x2c, 0x5a, 0x53, - 0x0c, 0xa3, 0xaa, 0xb8, 0x1e, 0xae, 0x5a, 0x26, 0xf2, 0x94, 0xea, 0xb4, 0xb2, 0xb1, 0x89, 0xbc, - 0x9a, 0xec, 0x7a, 0x98, 0x62, 0x78, 0x22, 0x45, 0x41, 0x36, 0x8c, 0xaa, 0x1c, 0x2a, 0xc8, 0xd5, - 0x69, 0x71, 0xac, 0x8c, 0x71, 0xd9, 0x46, 0x8a, 0xee, 0x5a, 0x8a, 0xee, 0x38, 0x98, 0xea, 0xd4, - 0xc2, 0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 0xc9, 0x17, 0xbd, - 0xfc, 0x0b, 0x5a, 0xfb, 0x0e, 0x1d, 0xde, 0xcf, 0xee, 0x57, 0xe6, 0xe1, 0x41, 0x5c, 0xd9, 0x5d, - 0x50, 0x1e, 0x88, 0x59, 0x16, 0x88, 0x8b, 0xf0, 0x42, 0xfb, 0x40, 0x60, 0x1f, 0x55, 0xb3, 0x1c, - 0x2d, 0x1e, 0x29, 0xe0, 0xb7, 0xbd, 0xe0, 0x64, 0xa6, 0xae, 0x1e, 0xde, 0xeb, 0xb6, 0x93, 0xdc, - 0x76, 0x20, 0x11, 0xd5, 0xdd, 0x84, 0xdc, 0x69, 0xe3, 0x42, 0x34, 0x17, 0x79, 0x71, 0x68, 0x8a, - 0x1f, 0xbe, 0xda, 0xca, 0x0b, 0xaf, 0xb7, 0xf2, 0xc2, 0x2f, 0x5b, 0x79, 0xe1, 0xf9, 0xbb, 0x7c, - 0xcf, 0xeb, 0x77, 0xf9, 0x9e, 0x9f, 0xde, 0xe5, 0x7b, 0x3e, 0x9a, 0x2d, 0x5b, 0x74, 0x6d, 0x73, - 0x55, 0x36, 0x70, 0x45, 0x31, 0x30, 0xa9, 0x60, 0x52, 0x67, 0xeb, 0x5c, 0x64, 0xab, 0xfa, 0x7f, - 0xe5, 0x71, 0xc3, 0x13, 0x53, 0x73, 0x11, 0x59, 0x1d, 0x64, 0xdf, 0x98, 0xce, 0xff, 0x13, 0x00, - 0x00, 0xff, 0xff, 0x8b, 0x1e, 0xc4, 0xbd, 0x41, 0x19, 0x00, 0x00, + // 1710 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcb, 0x6f, 0xdc, 0xd4, + 0x17, 0x8e, 0x27, 0x8f, 0x5f, 0x72, 0xd3, 0xd7, 0xef, 0xf6, 0x95, 0x38, 0x61, 0x26, 0x75, 0x69, + 0x49, 0x1f, 0xb1, 0x93, 0x29, 0x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 0x79, 0x5b, 0xba, 0xdf, 0x70, 0xe9, 0x7a, 0x22, 0x70, 0xa9, 0x8f, 0x7e, 0x82, 0x3c, 0xf5, + 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x27, 0x16, 0x7e, 0xa7, 0x7b, 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1552,6 +1662,9 @@ type QueryClient interface { // QueryConsumerChainsByValidatorAddress returns a list of consumer chains // that a validator must validate QueryConsumerChainsByValidatorAddress(ctx context.Context, in *QueryConsumerChainsByValidatorAddressRequest, opts ...grpc.CallOption) (*QueryConsumerChainsByValidatorAddressResponse, error) + // QueryValidatorConsumerCommissionRate returns the commission rate a given + // validator charges on a given consumer chain + QueryValidatorConsumerCommissionRate(ctx context.Context, in *QueryValidatorConsumerCommissionRateRequest, opts ...grpc.CallOption) (*QueryValidatorConsumerCommissionRateResponse, error) } type queryClient struct { @@ -1679,6 +1792,15 @@ func (c *queryClient) QueryConsumerChainsByValidatorAddress(ctx context.Context, return out, nil } +func (c *queryClient) QueryValidatorConsumerCommissionRate(ctx context.Context, in *QueryValidatorConsumerCommissionRateRequest, opts ...grpc.CallOption) (*QueryValidatorConsumerCommissionRateResponse, error) { + out := new(QueryValidatorConsumerCommissionRateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryValidatorConsumerCommissionRate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -1717,6 +1839,9 @@ type QueryServer interface { // QueryConsumerChainsByValidatorAddress returns a list of consumer chains // that a validator must validate QueryConsumerChainsByValidatorAddress(context.Context, *QueryConsumerChainsByValidatorAddressRequest) (*QueryConsumerChainsByValidatorAddressResponse, error) + // QueryValidatorConsumerCommissionRate returns the commission rate a given + // validator charges on a given consumer chain + QueryValidatorConsumerCommissionRate(context.Context, *QueryValidatorConsumerCommissionRateRequest) (*QueryValidatorConsumerCommissionRateResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1762,6 +1887,9 @@ func (*UnimplementedQueryServer) QueryOptedInValidatorsByConsumerChainID(ctx con func (*UnimplementedQueryServer) QueryConsumerChainsByValidatorAddress(ctx context.Context, req *QueryConsumerChainsByValidatorAddressRequest) (*QueryConsumerChainsByValidatorAddressResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryConsumerChainsByValidatorAddress not implemented") } +func (*UnimplementedQueryServer) QueryValidatorConsumerCommissionRate(ctx context.Context, req *QueryValidatorConsumerCommissionRateRequest) (*QueryValidatorConsumerCommissionRateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryValidatorConsumerCommissionRate not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -2001,6 +2129,24 @@ func _Query_QueryConsumerChainsByValidatorAddress_Handler(srv interface{}, ctx c return interceptor(ctx, in, info, handler) } +func _Query_QueryValidatorConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorConsumerCommissionRateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryValidatorConsumerCommissionRate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryValidatorConsumerCommissionRate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryValidatorConsumerCommissionRate(ctx, req.(*QueryValidatorConsumerCommissionRateRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.provider.v1.Query", HandlerType: (*QueryServer)(nil), @@ -2057,6 +2203,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryConsumerChainsByValidatorAddress", Handler: _Query_QueryConsumerChainsByValidatorAddress_Handler, }, + { + MethodName: "QueryValidatorConsumerCommissionRate", + Handler: _Query_QueryValidatorConsumerCommissionRate_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/query.proto", @@ -2997,6 +3147,76 @@ func (m *QueryConsumerChainsByValidatorAddressResponse) MarshalToSizedBuffer(dAt return len(dAtA) - i, nil } +func (m *QueryValidatorConsumerCommissionRateRequest) 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 *QueryValidatorConsumerCommissionRateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorConsumerCommissionRateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProviderAddress) > 0 { + i -= len(m.ProviderAddress) + copy(dAtA[i:], m.ProviderAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProviderAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorConsumerCommissionRateResponse) 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 *QueryValidatorConsumerCommissionRateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorConsumerCommissionRateResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -3398,6 +3618,34 @@ func (m *QueryConsumerChainsByValidatorAddressResponse) Size() (n int) { return n } +func (m *QueryValidatorConsumerCommissionRateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ProviderAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorConsumerCommissionRateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Rate.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5835,6 +6083,204 @@ func (m *QueryConsumerChainsByValidatorAddressResponse) Unmarshal(dAtA []byte) e } return nil } +func (m *QueryValidatorConsumerCommissionRateRequest) 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 ErrIntOverflowQuery + } + 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: QueryValidatorConsumerCommissionRateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorConsumerCommissionRateRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + 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 ProviderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorConsumerCommissionRateResponse) 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 ErrIntOverflowQuery + } + 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: QueryValidatorConsumerCommissionRateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorConsumerCommissionRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + 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 := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/provider/types/query.pb.gw.go b/x/ccv/provider/types/query.pb.gw.go index 618772e54e..fb8a2f3bfa 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -393,6 +393,42 @@ func local_request_Query_QueryConsumerChainsByValidatorAddress_0(ctx context.Con } +var ( + filter_Query_QueryValidatorConsumerCommissionRate_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryValidatorConsumerCommissionRate_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorConsumerCommissionRateRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryValidatorConsumerCommissionRate_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryValidatorConsumerCommissionRate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryValidatorConsumerCommissionRate_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorConsumerCommissionRateRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryValidatorConsumerCommissionRate_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryValidatorConsumerCommissionRate(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -698,6 +734,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryValidatorConsumerCommissionRate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryValidatorConsumerCommissionRate_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryValidatorConsumerCommissionRate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -999,6 +1058,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryValidatorConsumerCommissionRate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryValidatorConsumerCommissionRate_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryValidatorConsumerCommissionRate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1028,6 +1107,8 @@ var ( pattern_Query_QueryOptedInValidatorsByConsumerChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "opted_in_validators"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryConsumerChainsByValidatorAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_chains_per_validator"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryValidatorConsumerCommissionRate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_commission_rate"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1056,4 +1137,6 @@ var ( forward_Query_QueryOptedInValidatorsByConsumerChainID_0 = runtime.ForwardResponseMessage forward_Query_QueryConsumerChainsByValidatorAddress_0 = runtime.ForwardResponseMessage + + forward_Query_QueryValidatorConsumerCommissionRate_0 = runtime.ForwardResponseMessage ) From 55091080ad4ea47b7517ba4b3c8889f88973492c Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 26 Mar 2024 17:20:05 +0100 Subject: [PATCH 20/36] nits --- proto/interchain_security/ccv/provider/v1/query.proto | 2 +- x/ccv/provider/keeper/grpc_query.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index d1c474b693..30f819e8be 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -111,7 +111,7 @@ service Query { } // QueryConsumerChainsByValidatorAddress returns a list of consumer chains - // that a validator must validate + // that a given validator must validate rpc QueryConsumerChainsByValidatorAddress( QueryConsumerChainsByValidatorAddressRequest) returns (QueryConsumerChainsByValidatorAddressResponse) { diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 85d1107917..6af96c7e15 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -266,9 +266,8 @@ func (k Keeper) QueryConsumerChainsByValidatorAddress(goCtx context.Context, req ctx := sdk.UnwrapSDKContext(goCtx) - // get all consumer chains + // get all the consumer chains for which the validator is opted-in consumersToValidate := []string{} - // iterate over all consumer chains and check if the validator is opted-in for _, consumer := range k.GetAllConsumerChains(ctx) { chainID := consumer.ChainId if k.IsConsumerValidator(ctx, chainID, types.NewProviderConsAddress(consAddr)) { From ad91b0e70075ff41f35de777e900a90124889e64 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 09:01:22 +0100 Subject: [PATCH 21/36] big renaming --- .../ccv/provider/v1/query.proto | 23 +- x/ccv/provider/client/cli/query.go | 20 +- x/ccv/provider/keeper/grpc_query.go | 14 +- x/ccv/provider/types/query.pb.go | 490 +++++++++--------- x/ccv/provider/types/query.pb.gw.go | 68 +-- 5 files changed, 307 insertions(+), 308 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 30f819e8be..dad578d079 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -103,18 +103,18 @@ service Query { // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address // that opted-in to the given consumer chain - rpc QueryOptedInValidatorsByConsumerChainID( - QueryOptedInValidatorsByConsumerChainIDRequest) - returns (QueryOptedInValidatorsByConsumerChainIDResponse) { + rpc QueryConsumerChainOptedInValidators( + QueryConsumerChainOptedInValidatorsRequest) + returns (QueryConsumerChainOptedInValidatorsResponse) { option (google.api.http).get = "/interchain_security/ccv/provider/opted_in_validators"; } // QueryConsumerChainsByValidatorAddress returns a list of consumer chains // that a given validator must validate - rpc QueryConsumerChainsByValidatorAddress( - QueryConsumerChainsByValidatorAddressRequest) - returns (QueryConsumerChainsByValidatorAddressResponse) { + rpc QueryConsumerChainsValidatorHasToValidate( + QueryConsumerChainsValidatorHasToValidateRequest) + returns (QueryConsumerChainsValidatorHasToValidateResponse) { option (google.api.http).get = "/interchain_security/ccv/provider/consumer_chains_per_validator"; } @@ -245,22 +245,22 @@ message QueryParamsResponse { } -message QueryOptedInValidatorsByConsumerChainIDRequest { +message QueryConsumerChainOptedInValidatorsRequest { string chain_id = 1; } -message QueryOptedInValidatorsByConsumerChainIDResponse { +message QueryConsumerChainOptedInValidatorsResponse { repeated string validators_provider_address = 1; } -message QueryConsumerChainsByValidatorAddressRequest { +message QueryConsumerChainsValidatorHasToValidateRequest { // The consensus address of the validator on the provider chain string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; } -message QueryConsumerChainsByValidatorAddressResponse { - repeated string validator_consumer_chains = 1; +message QueryConsumerChainsValidatorHasToValidateResponse { + repeated string consumer_chains = 1; } message QueryValidatorConsumerCommissionRateRequest { @@ -277,4 +277,3 @@ message QueryValidatorConsumerCommissionRateResponse { (gogoproto.nullable) = false ]; } - diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index 1e1b5feb8d..d7bf45740d 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -35,8 +35,8 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand(CmdProposedConsumerChains()) cmd.AddCommand(CmdAllPairsValConAddrByConsumerChainID()) cmd.AddCommand(CmdProviderParameters()) - cmd.AddCommand(CmdOptedInValidatorsByConsumerChainID()) - cmd.AddCommand(CmdConsumerChainsByValidatorAddress()) + cmd.AddCommand(CmdConsumerChainOptedInValidators()) + cmd.AddCommand(CmdConsumerChainsValidatorHasToValidate()) cmd.AddCommand(CmdValidatorConsumerCommissionRate()) return cmd } @@ -414,14 +414,14 @@ $ %s query provider params } // Command to query opted-in validators by consumer chain ID -func CmdOptedInValidatorsByConsumerChainID() *cobra.Command { +func CmdConsumerChainOptedInValidators() *cobra.Command { cmd := &cobra.Command{ - Use: "opted-in-validators [chainid]", + Use: "consumer-opted-in-validators [chainid]", Short: "Query opted-in validators for a given consumer chain", Long: strings.TrimSpace( fmt.Sprintf(`Query opted-in validators for a given consumer chain. Example: -$ %s opted-in-validators foochain +$ %s consumer-opted-in-validators foochain `, version.AppName), ), Args: cobra.ExactArgs(1), @@ -432,8 +432,8 @@ $ %s opted-in-validators foochain } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.QueryOptedInValidatorsByConsumerChainID(cmd.Context(), - &types.QueryOptedInValidatorsByConsumerChainIDRequest{ChainId: args[0]}) + res, err := queryClient.QueryConsumerChainOptedInValidators(cmd.Context(), + &types.QueryConsumerChainOptedInValidatorsRequest{ChainId: args[0]}) if err != nil { return err } @@ -448,7 +448,7 @@ $ %s opted-in-validators foochain } // Command to query the consumer chains list a given validator has to validate -func CmdConsumerChainsByValidatorAddress() *cobra.Command { +func CmdConsumerChainsValidatorHasToValidate() *cobra.Command { bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix() cmd := &cobra.Command{ Use: "has-to-validate [provider-validator-address]", @@ -472,8 +472,8 @@ $ %s has-to-validate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj return err } - res, err := queryClient.QueryConsumerChainsByValidatorAddress(cmd.Context(), - &types.QueryConsumerChainsByValidatorAddressRequest{ + res, err := queryClient.QueryConsumerChainsValidatorHasToValidate(cmd.Context(), + &types.QueryConsumerChainsValidatorHasToValidateRequest{ ProviderAddress: addr.String(), }) if err != nil { diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 6af96c7e15..8d4eb991de 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -222,8 +222,8 @@ func (k Keeper) QueryParams(c context.Context, _ *types.QueryParamsRequest) (*ty return &types.QueryParamsResponse{Params: params}, nil } -// QueryOptedInValidatorsByConsumerChainID returns all validators that opted-in to a given consumer chain -func (k Keeper) QueryOptedInValidatorsByConsumerChainID(goCtx context.Context, req *types.QueryOptedInValidatorsByConsumerChainIDRequest) (*types.QueryOptedInValidatorsByConsumerChainIDResponse, error) { +// QueryConsumerChainOptedInValidators returns all validators that opted-in to a given consumer chain +func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req *types.QueryConsumerChainOptedInValidatorsRequest) (*types.QueryConsumerChainOptedInValidatorsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -244,13 +244,13 @@ func (k Keeper) QueryOptedInValidatorsByConsumerChainID(goCtx context.Context, r optedInVals = append(optedInVals, v.ToSdkConsAddr().String()) } - return &types.QueryOptedInValidatorsByConsumerChainIDResponse{ + return &types.QueryConsumerChainOptedInValidatorsResponse{ ValidatorsProviderAddress: optedInVals, }, nil } -// QueryOptedInValidatorsByConsumerChainID returns all consumer chains a given validator has to validate -func (k Keeper) QueryConsumerChainsByValidatorAddress(goCtx context.Context, req *types.QueryConsumerChainsByValidatorAddressRequest) (*types.QueryConsumerChainsByValidatorAddressResponse, error) { +// QueryConsumerChainsValidatorHasToValidate returns all consumer chains a given validator has to validate +func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, req *types.QueryConsumerChainsValidatorHasToValidateRequest) (*types.QueryConsumerChainsValidatorHasToValidateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -275,8 +275,8 @@ func (k Keeper) QueryConsumerChainsByValidatorAddress(goCtx context.Context, req } } - return &types.QueryConsumerChainsByValidatorAddressResponse{ - ValidatorConsumerChains: consumersToValidate, + return &types.QueryConsumerChainsValidatorHasToValidateResponse{ + ConsumerChains: consumersToValidate, }, nil } diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 86ccfb7e19..1eaa120041 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1173,26 +1173,26 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -type QueryOptedInValidatorsByConsumerChainIDRequest struct { +type QueryConsumerChainOptedInValidatorsRequest struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Reset() { - *m = QueryOptedInValidatorsByConsumerChainIDRequest{} +func (m *QueryConsumerChainOptedInValidatorsRequest) Reset() { + *m = QueryConsumerChainOptedInValidatorsRequest{} } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) String() string { +func (m *QueryConsumerChainOptedInValidatorsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryOptedInValidatorsByConsumerChainIDRequest) ProtoMessage() {} -func (*QueryOptedInValidatorsByConsumerChainIDRequest) Descriptor() ([]byte, []int) { +func (*QueryConsumerChainOptedInValidatorsRequest) ProtoMessage() {} +func (*QueryConsumerChainOptedInValidatorsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_422512d7b7586cd7, []int{25} } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryConsumerChainOptedInValidatorsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryConsumerChainOptedInValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryConsumerChainOptedInValidatorsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1202,45 +1202,45 @@ func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Marshal(b []byte, d return b[:n], nil } } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDRequest.Merge(m, src) +func (m *QueryConsumerChainOptedInValidatorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConsumerChainOptedInValidatorsRequest.Merge(m, src) } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_Size() int { +func (m *QueryConsumerChainOptedInValidatorsRequest) XXX_Size() int { return m.Size() } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDRequest.DiscardUnknown(m) +func (m *QueryConsumerChainOptedInValidatorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConsumerChainOptedInValidatorsRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryConsumerChainOptedInValidatorsRequest proto.InternalMessageInfo -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) GetChainId() string { +func (m *QueryConsumerChainOptedInValidatorsRequest) GetChainId() string { if m != nil { return m.ChainId } return "" } -type QueryOptedInValidatorsByConsumerChainIDResponse struct { +type QueryConsumerChainOptedInValidatorsResponse struct { ValidatorsProviderAddress []string `protobuf:"bytes,1,rep,name=validators_provider_address,json=validatorsProviderAddress,proto3" json:"validators_provider_address,omitempty"` } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Reset() { - *m = QueryOptedInValidatorsByConsumerChainIDResponse{} +func (m *QueryConsumerChainOptedInValidatorsResponse) Reset() { + *m = QueryConsumerChainOptedInValidatorsResponse{} } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) String() string { +func (m *QueryConsumerChainOptedInValidatorsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryOptedInValidatorsByConsumerChainIDResponse) ProtoMessage() {} -func (*QueryOptedInValidatorsByConsumerChainIDResponse) Descriptor() ([]byte, []int) { +func (*QueryConsumerChainOptedInValidatorsResponse) ProtoMessage() {} +func (*QueryConsumerChainOptedInValidatorsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_422512d7b7586cd7, []int{26} } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryConsumerChainOptedInValidatorsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryConsumerChainOptedInValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryConsumerChainOptedInValidatorsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1250,46 +1250,46 @@ func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Marshal(b []byte, return b[:n], nil } } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDResponse.Merge(m, src) +func (m *QueryConsumerChainOptedInValidatorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConsumerChainOptedInValidatorsResponse.Merge(m, src) } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_Size() int { +func (m *QueryConsumerChainOptedInValidatorsResponse) XXX_Size() int { return m.Size() } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDResponse.DiscardUnknown(m) +func (m *QueryConsumerChainOptedInValidatorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConsumerChainOptedInValidatorsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryOptedInValidatorsByConsumerChainIDResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryConsumerChainOptedInValidatorsResponse proto.InternalMessageInfo -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) GetValidatorsProviderAddress() []string { +func (m *QueryConsumerChainOptedInValidatorsResponse) GetValidatorsProviderAddress() []string { if m != nil { return m.ValidatorsProviderAddress } return nil } -type QueryConsumerChainsByValidatorAddressRequest struct { +type QueryConsumerChainsValidatorHasToValidateRequest struct { // The consensus address of the validator on the provider chain ProviderAddress string `protobuf:"bytes,1,opt,name=provider_address,json=providerAddress,proto3" json:"provider_address,omitempty" yaml:"address"` } -func (m *QueryConsumerChainsByValidatorAddressRequest) Reset() { - *m = QueryConsumerChainsByValidatorAddressRequest{} +func (m *QueryConsumerChainsValidatorHasToValidateRequest) Reset() { + *m = QueryConsumerChainsValidatorHasToValidateRequest{} } -func (m *QueryConsumerChainsByValidatorAddressRequest) String() string { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) String() string { return proto.CompactTextString(m) } -func (*QueryConsumerChainsByValidatorAddressRequest) ProtoMessage() {} -func (*QueryConsumerChainsByValidatorAddressRequest) Descriptor() ([]byte, []int) { +func (*QueryConsumerChainsValidatorHasToValidateRequest) ProtoMessage() {} +func (*QueryConsumerChainsValidatorHasToValidateRequest) Descriptor() ([]byte, []int) { return fileDescriptor_422512d7b7586cd7, []int{27} } -func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryConsumerChainsByValidatorAddressRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1299,45 +1299,45 @@ func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_Marshal(b []byte, det return b[:n], nil } } -func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryConsumerChainsByValidatorAddressRequest.Merge(m, src) +func (m *QueryConsumerChainsValidatorHasToValidateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateRequest.Merge(m, src) } -func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_Size() int { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) XXX_Size() int { return m.Size() } -func (m *QueryConsumerChainsByValidatorAddressRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryConsumerChainsByValidatorAddressRequest.DiscardUnknown(m) +func (m *QueryConsumerChainsValidatorHasToValidateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryConsumerChainsByValidatorAddressRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateRequest proto.InternalMessageInfo -func (m *QueryConsumerChainsByValidatorAddressRequest) GetProviderAddress() string { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) GetProviderAddress() string { if m != nil { return m.ProviderAddress } return "" } -type QueryConsumerChainsByValidatorAddressResponse struct { - ValidatorConsumerChains []string `protobuf:"bytes,1,rep,name=validator_consumer_chains,json=validatorConsumerChains,proto3" json:"validator_consumer_chains,omitempty"` +type QueryConsumerChainsValidatorHasToValidateResponse struct { + ConsumerChains []string `protobuf:"bytes,1,rep,name=consumer_chains,json=consumerChains,proto3" json:"consumer_chains,omitempty"` } -func (m *QueryConsumerChainsByValidatorAddressResponse) Reset() { - *m = QueryConsumerChainsByValidatorAddressResponse{} +func (m *QueryConsumerChainsValidatorHasToValidateResponse) Reset() { + *m = QueryConsumerChainsValidatorHasToValidateResponse{} } -func (m *QueryConsumerChainsByValidatorAddressResponse) String() string { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) String() string { return proto.CompactTextString(m) } -func (*QueryConsumerChainsByValidatorAddressResponse) ProtoMessage() {} -func (*QueryConsumerChainsByValidatorAddressResponse) Descriptor() ([]byte, []int) { +func (*QueryConsumerChainsValidatorHasToValidateResponse) ProtoMessage() {} +func (*QueryConsumerChainsValidatorHasToValidateResponse) Descriptor() ([]byte, []int) { return fileDescriptor_422512d7b7586cd7, []int{28} } -func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryConsumerChainsByValidatorAddressResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1347,21 +1347,21 @@ func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_Marshal(b []byte, de return b[:n], nil } } -func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryConsumerChainsByValidatorAddressResponse.Merge(m, src) +func (m *QueryConsumerChainsValidatorHasToValidateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateResponse.Merge(m, src) } -func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_Size() int { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) XXX_Size() int { return m.Size() } -func (m *QueryConsumerChainsByValidatorAddressResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryConsumerChainsByValidatorAddressResponse.DiscardUnknown(m) +func (m *QueryConsumerChainsValidatorHasToValidateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryConsumerChainsByValidatorAddressResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateResponse proto.InternalMessageInfo -func (m *QueryConsumerChainsByValidatorAddressResponse) GetValidatorConsumerChains() []string { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) GetConsumerChains() []string { if m != nil { - return m.ValidatorConsumerChains + return m.ConsumerChains } return nil } @@ -1491,10 +1491,10 @@ func init() { proto.RegisterType((*PairValConAddrProviderAndConsumer)(nil), "interchain_security.ccv.provider.v1.PairValConAddrProviderAndConsumer") proto.RegisterType((*QueryParamsRequest)(nil), "interchain_security.ccv.provider.v1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "interchain_security.ccv.provider.v1.QueryParamsResponse") - proto.RegisterType((*QueryOptedInValidatorsByConsumerChainIDRequest)(nil), "interchain_security.ccv.provider.v1.QueryOptedInValidatorsByConsumerChainIDRequest") - proto.RegisterType((*QueryOptedInValidatorsByConsumerChainIDResponse)(nil), "interchain_security.ccv.provider.v1.QueryOptedInValidatorsByConsumerChainIDResponse") - proto.RegisterType((*QueryConsumerChainsByValidatorAddressRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainsByValidatorAddressRequest") - proto.RegisterType((*QueryConsumerChainsByValidatorAddressResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainsByValidatorAddressResponse") + proto.RegisterType((*QueryConsumerChainOptedInValidatorsRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainOptedInValidatorsRequest") + proto.RegisterType((*QueryConsumerChainOptedInValidatorsResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainOptedInValidatorsResponse") + proto.RegisterType((*QueryConsumerChainsValidatorHasToValidateRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainsValidatorHasToValidateRequest") + proto.RegisterType((*QueryConsumerChainsValidatorHasToValidateResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerChainsValidatorHasToValidateResponse") proto.RegisterType((*QueryValidatorConsumerCommissionRateRequest)(nil), "interchain_security.ccv.provider.v1.QueryValidatorConsumerCommissionRateRequest") proto.RegisterType((*QueryValidatorConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.QueryValidatorConsumerCommissionRateResponse") } @@ -1504,114 +1504,114 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1710 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcb, 0x6f, 0xdc, 0xd4, - 0x17, 0x8e, 0x27, 0x8f, 0x5f, 0x72, 0xd3, 0xd7, 0xef, 0xf6, 0x95, 0x38, 0x61, 0x26, 0x75, 0x69, - 0x49, 0x1f, 0xb1, 0x93, 0x29, 0x55, 0xdb, 0xb4, 0x69, 0x9a, 0xc9, 0xb4, 0x65, 0x94, 0x3e, 0xa6, - 0x6e, 0x28, 0x12, 0x20, 0x5c, 0xc7, 0xbe, 0x4c, 0xac, 0x78, 0x7c, 0x1d, 0xfb, 0x66, 0xda, 0x51, - 0x85, 0x44, 0x59, 0xd0, 0xee, 0x28, 0x2a, 0x88, 0x6d, 0x37, 0xfc, 0x03, 0x88, 0x3f, 0xa2, 0x3b, - 0x0a, 0xdd, 0x20, 0x16, 0x05, 0xa5, 0x2c, 0x10, 0x2b, 0xc4, 0x1e, 0x09, 0xf9, 0xfa, 0xda, 0x9e, - 0x87, 0x93, 0xf1, 0x4c, 0xc2, 0x2a, 0x99, 0xeb, 0x7b, 0xbe, 0x73, 0xbe, 0xe3, 0x73, 0xcf, 0x3d, - 0x9f, 0x81, 0x64, 0x58, 0x04, 0x39, 0xda, 0xb2, 0x6a, 0x58, 0x8a, 0x8b, 0xb4, 0x35, 0xc7, 0x20, - 0x55, 0x49, 0xd3, 0x2a, 0x92, 0xed, 0xe0, 0x8a, 0xa1, 0x23, 0x47, 0xaa, 0x4c, 0x49, 0xab, 0x6b, - 0xc8, 0xa9, 0x8a, 0xb6, 0x83, 0x09, 0x86, 0x87, 0x63, 0x0c, 0x44, 0x4d, 0xab, 0x88, 0x81, 0x81, - 0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79, 0x25, 0x97, 0xab, 0xef, 0x89, 0x85, - 0x7c, 0x82, 0xcb, 0xf2, 0x5b, 0x0e, 0x4c, 0x26, 0x87, 0x63, 0xf9, 0x5a, 0x05, 0xff, 0xb7, 0x55, - 0xc3, 0x51, 0x2a, 0xaa, 0xe9, 0x8d, 0x05, 0xf4, 0x18, 0xb0, 0x94, 0x5d, 0x49, 0x96, 0x32, 0xd5, - 0x70, 0x22, 0x47, 0xe1, 0x31, 0xb3, 0xa2, 0x02, 0xd8, 0x65, 0xd7, 0x6d, 0x11, 0xd6, 0x39, 0x70, - 0xa8, 0xa5, 0x55, 0x6c, 0x97, 0xe3, 0x12, 0x77, 0xb9, 0x2d, 0x76, 0x12, 0x38, 0x0b, 0x76, 0x84, - 0xe6, 0x2b, 0xa8, 0xca, 0x4e, 0xd4, 0xa8, 0x18, 0x8d, 0x40, 0xa2, 0x3f, 0x02, 0x89, 0xc5, 0xb5, - 0x25, 0xd3, 0xd0, 0x16, 0x50, 0x55, 0x1e, 0x0c, 0x2c, 0x16, 0x50, 0x55, 0xd8, 0x07, 0xa0, 0x5f, - 0xa8, 0xaa, 0xa3, 0x46, 0xc7, 0xe4, 0x2e, 0xd8, 0x5b, 0xb7, 0xca, 0x5e, 0x42, 0x01, 0xf4, 0xd9, - 0x74, 0x85, 0xdd, 0x6c, 0x27, 0x12, 0x66, 0xde, 0x33, 0x61, 0x55, 0xca, 0x00, 0x84, 0x05, 0x20, - 0x52, 0x0f, 0x37, 0x6d, 0x82, 0xf4, 0x82, 0x15, 0xf6, 0x3f, 0xb7, 0x93, 0x8a, 0x5a, 0x65, 0xf5, - 0x99, 0x04, 0x8c, 0x51, 0xb9, 0x08, 0x46, 0x2a, 0xe1, 0x36, 0x25, 0xe6, 0x0d, 0x7a, 0xc7, 0x7d, - 0x38, 0xda, 0x52, 0x6c, 0xe8, 0xb3, 0x65, 0x70, 0x32, 0x66, 0xac, 0xca, 0x45, 0x8d, 0x9c, 0x6d, - 0x0c, 0xa2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 0x08, 0x82, 0xc5, 0x2d, 0x8c, 0x1e, 0xb1, 0xca, 0x8e, 0xbf, - 0xb5, 0x8d, 0x88, 0xed, 0x77, 0xc3, 0x28, 0x2d, 0x21, 0x94, 0xe2, 0x69, 0xb2, 0xdc, 0x7b, 0xcf, - 0xd7, 0xd3, 0xdc, 0x8b, 0xf5, 0x34, 0xf7, 0xdb, 0x7a, 0x9a, 0x7b, 0xf2, 0x3a, 0xdd, 0xf5, 0xe2, - 0x75, 0xba, 0xeb, 0xe7, 0xd7, 0xe9, 0xae, 0xf7, 0x67, 0x9a, 0x95, 0x5e, 0xe4, 0x66, 0x22, 0x74, - 0x53, 0x79, 0x5b, 0xba, 0xdf, 0x70, 0xe9, 0x7a, 0x22, 0x70, 0xa9, 0x8f, 0x7e, 0x82, 0x3c, 0xf5, - 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x27, 0x16, 0x7e, 0xa7, 0x7b, 0x1b, 0x00, 0x00, + // 1706 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x6f, 0xdb, 0xc6, + 0x16, 0x36, 0xfd, 0xba, 0xf6, 0x38, 0x71, 0x72, 0x27, 0x8f, 0x6b, 0xd3, 0xbe, 0x92, 0xc3, 0xb4, + 0x89, 0xf3, 0x22, 0x6d, 0xa5, 0x41, 0x9e, 0x8e, 0x63, 0x59, 0x89, 0x23, 0x38, 0x0f, 0x85, 0x71, + 0x52, 0xa0, 0x0d, 0xca, 0xd0, 0xe4, 0x54, 0x26, 0x4c, 0x71, 0x68, 0x72, 0xac, 0x44, 0x08, 0x0a, + 0x34, 0x5d, 0x34, 0xd9, 0x35, 0x45, 0xdb, 0x7d, 0x80, 0xa2, 0x7f, 0xa0, 0xe8, 0x8f, 0xc8, 0xae, + 0x69, 0xb3, 0x29, 0xba, 0x48, 0x0b, 0xa7, 0x8b, 0xa2, 0xab, 0xa2, 0xfb, 0x02, 0x05, 0x87, 0x43, + 0x4a, 0x94, 0x68, 0x89, 0x92, 0xdd, 0x95, 0xcd, 0x99, 0x39, 0xdf, 0x39, 0xdf, 0x99, 0x33, 0x67, + 0xe6, 0x13, 0x90, 0x0c, 0x8b, 0x20, 0x47, 0x5b, 0x51, 0x0d, 0x4b, 0x71, 0x91, 0xb6, 0xee, 0x18, + 0xa4, 0x22, 0x69, 0x5a, 0x59, 0xb2, 0x1d, 0x5c, 0x36, 0x74, 0xe4, 0x48, 0xe5, 0x69, 0x69, 0x6d, + 0x1d, 0x39, 0x15, 0xd1, 0x76, 0x30, 0xc1, 0xf0, 0x60, 0x8c, 0x81, 0xa8, 0x69, 0x65, 0x31, 0x30, + 0x10, 0xcb, 0xd3, 0xfc, 0x78, 0x11, 0xe3, 0xa2, 0x89, 0x24, 0xd5, 0x36, 0x24, 0xd5, 0xb2, 0x30, + 0x51, 0x89, 0x81, 0x2d, 0xd7, 0x87, 0xe0, 0xf7, 0x16, 0x71, 0x11, 0xd3, 0x7f, 0x25, 0xef, 0x3f, + 0x36, 0x9a, 0x66, 0x36, 0xf4, 0x6b, 0x79, 0xfd, 0x43, 0x89, 0x18, 0x25, 0xe4, 0x12, 0xb5, 0x64, + 0xb3, 0x05, 0x99, 0x24, 0xa1, 0x86, 0x51, 0xf8, 0x36, 0x53, 0x9b, 0xd9, 0x94, 0xa7, 0x25, 0x77, + 0x45, 0x75, 0x90, 0xae, 0x68, 0xd8, 0x72, 0xd7, 0x4b, 0xa1, 0xc5, 0xdb, 0x4d, 0x2c, 0x1e, 0x18, + 0x0e, 0x62, 0xcb, 0xc6, 0x09, 0xb2, 0x74, 0xe4, 0x94, 0x0c, 0x8b, 0x48, 0x9a, 0x53, 0xb1, 0x09, + 0x96, 0x56, 0x51, 0x25, 0x60, 0x38, 0xaa, 0x61, 0xb7, 0x84, 0x5d, 0xc5, 0x27, 0xe9, 0x7f, 0xf8, + 0x53, 0xc2, 0x19, 0x30, 0x76,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5c, 0x9f, 0xb4, 0x73, 0xa0, 0x13, 0x49, 0xa6, 0x76, 0x0e, 0x74, 0x32, 0xe9, 0x24, 0xcc, + 0x50, 0xf2, 0xa7, 0xe1, 0xa9, 0xd6, 0xe4, 0xb1, 0x07, 0xa2, 0x18, 0x96, 0x52, 0x15, 0x52, 0xf0, + 0xeb, 0x6e, 0x70, 0x24, 0xb1, 0x8e, 0x81, 0x77, 0x3a, 0x7d, 0x41, 0x36, 0x95, 0x62, 0xfc, 0xdd, + 0xed, 0x86, 0xdd, 0xea, 0xc3, 0xc5, 0x55, 0x6c, 0xe4, 0x54, 0xd3, 0x04, 0x3f, 0xeb, 0x06, 0x6f, + 0x25, 0x11, 0x41, 0xb0, 0xb0, 0x85, 0xa7, 0x47, 0xac, 0xb2, 0xe3, 0x6f, 0x6d, 0x23, 0x62, 0xfb, + 0xdd, 0xb0, 0x9a, 0x96, 0x10, 0x4a, 0xf1, 0x34, 0x59, 0xf6, 0xdd, 0x17, 0x1b, 0x29, 0xee, 0xe5, + 0x46, 0x8a, 0xfb, 0x75, 0x23, 0xc5, 0x3d, 0x7b, 0x93, 0xea, 0x7a, 0xf9, 0x26, 0xd5, 0xf5, 0xd3, + 0x9b, 0x54, 0xd7, 0x7b, 0x33, 0x8d, 0x4a, 0xaf, 0xea, 0xe6, 0x44, 0xe8, 0xa6, 0xfc, 0x8e, 0xf4, + 0xb0, 0xee, 0xd2, 0xf5, 0x44, 0xe0, 0x72, 0x3f, 0xfd, 0xbd, 0xf1, 0xe4, 0x3f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x13, 0x22, 0x9c, 0x16, 0x68, 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1658,10 +1658,10 @@ type QueryClient interface { QueryParams(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address // that opted-in to the given consumer chain - QueryOptedInValidatorsByConsumerChainID(ctx context.Context, in *QueryOptedInValidatorsByConsumerChainIDRequest, opts ...grpc.CallOption) (*QueryOptedInValidatorsByConsumerChainIDResponse, error) + QueryConsumerChainOptedInValidators(ctx context.Context, in *QueryConsumerChainOptedInValidatorsRequest, opts ...grpc.CallOption) (*QueryConsumerChainOptedInValidatorsResponse, error) // QueryConsumerChainsByValidatorAddress returns a list of consumer chains - // that a validator must validate - QueryConsumerChainsByValidatorAddress(ctx context.Context, in *QueryConsumerChainsByValidatorAddressRequest, opts ...grpc.CallOption) (*QueryConsumerChainsByValidatorAddressResponse, error) + // that a given validator must validate + QueryConsumerChainsValidatorHasToValidate(ctx context.Context, in *QueryConsumerChainsValidatorHasToValidateRequest, opts ...grpc.CallOption) (*QueryConsumerChainsValidatorHasToValidateResponse, error) // QueryValidatorConsumerCommissionRate returns the commission rate a given // validator charges on a given consumer chain QueryValidatorConsumerCommissionRate(ctx context.Context, in *QueryValidatorConsumerCommissionRateRequest, opts ...grpc.CallOption) (*QueryValidatorConsumerCommissionRateResponse, error) @@ -1774,18 +1774,18 @@ func (c *queryClient) QueryParams(ctx context.Context, in *QueryParamsRequest, o return out, nil } -func (c *queryClient) QueryOptedInValidatorsByConsumerChainID(ctx context.Context, in *QueryOptedInValidatorsByConsumerChainIDRequest, opts ...grpc.CallOption) (*QueryOptedInValidatorsByConsumerChainIDResponse, error) { - out := new(QueryOptedInValidatorsByConsumerChainIDResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryOptedInValidatorsByConsumerChainID", in, out, opts...) +func (c *queryClient) QueryConsumerChainOptedInValidators(ctx context.Context, in *QueryConsumerChainOptedInValidatorsRequest, opts ...grpc.CallOption) (*QueryConsumerChainOptedInValidatorsResponse, error) { + out := new(QueryConsumerChainOptedInValidatorsResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryConsumerChainOptedInValidators", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) QueryConsumerChainsByValidatorAddress(ctx context.Context, in *QueryConsumerChainsByValidatorAddressRequest, opts ...grpc.CallOption) (*QueryConsumerChainsByValidatorAddressResponse, error) { - out := new(QueryConsumerChainsByValidatorAddressResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryConsumerChainsByValidatorAddress", in, out, opts...) +func (c *queryClient) QueryConsumerChainsValidatorHasToValidate(ctx context.Context, in *QueryConsumerChainsValidatorHasToValidateRequest, opts ...grpc.CallOption) (*QueryConsumerChainsValidatorHasToValidateResponse, error) { + out := new(QueryConsumerChainsValidatorHasToValidateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryConsumerChainsValidatorHasToValidate", in, out, opts...) if err != nil { return nil, err } @@ -1835,10 +1835,10 @@ type QueryServer interface { QueryParams(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address // that opted-in to the given consumer chain - QueryOptedInValidatorsByConsumerChainID(context.Context, *QueryOptedInValidatorsByConsumerChainIDRequest) (*QueryOptedInValidatorsByConsumerChainIDResponse, error) + QueryConsumerChainOptedInValidators(context.Context, *QueryConsumerChainOptedInValidatorsRequest) (*QueryConsumerChainOptedInValidatorsResponse, error) // QueryConsumerChainsByValidatorAddress returns a list of consumer chains - // that a validator must validate - QueryConsumerChainsByValidatorAddress(context.Context, *QueryConsumerChainsByValidatorAddressRequest) (*QueryConsumerChainsByValidatorAddressResponse, error) + // that a given validator must validate + QueryConsumerChainsValidatorHasToValidate(context.Context, *QueryConsumerChainsValidatorHasToValidateRequest) (*QueryConsumerChainsValidatorHasToValidateResponse, error) // QueryValidatorConsumerCommissionRate returns the commission rate a given // validator charges on a given consumer chain QueryValidatorConsumerCommissionRate(context.Context, *QueryValidatorConsumerCommissionRateRequest) (*QueryValidatorConsumerCommissionRateResponse, error) @@ -1881,11 +1881,11 @@ func (*UnimplementedQueryServer) QueryAllPairsValConAddrByConsumerChainID(ctx co func (*UnimplementedQueryServer) QueryParams(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryParams not implemented") } -func (*UnimplementedQueryServer) QueryOptedInValidatorsByConsumerChainID(ctx context.Context, req *QueryOptedInValidatorsByConsumerChainIDRequest) (*QueryOptedInValidatorsByConsumerChainIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryOptedInValidatorsByConsumerChainID not implemented") +func (*UnimplementedQueryServer) QueryConsumerChainOptedInValidators(ctx context.Context, req *QueryConsumerChainOptedInValidatorsRequest) (*QueryConsumerChainOptedInValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryConsumerChainOptedInValidators not implemented") } -func (*UnimplementedQueryServer) QueryConsumerChainsByValidatorAddress(ctx context.Context, req *QueryConsumerChainsByValidatorAddressRequest) (*QueryConsumerChainsByValidatorAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryConsumerChainsByValidatorAddress not implemented") +func (*UnimplementedQueryServer) QueryConsumerChainsValidatorHasToValidate(ctx context.Context, req *QueryConsumerChainsValidatorHasToValidateRequest) (*QueryConsumerChainsValidatorHasToValidateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryConsumerChainsValidatorHasToValidate not implemented") } func (*UnimplementedQueryServer) QueryValidatorConsumerCommissionRate(ctx context.Context, req *QueryValidatorConsumerCommissionRateRequest) (*QueryValidatorConsumerCommissionRateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryValidatorConsumerCommissionRate not implemented") @@ -2093,38 +2093,38 @@ func _Query_QueryParams_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Query_QueryOptedInValidatorsByConsumerChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryOptedInValidatorsByConsumerChainIDRequest) +func _Query_QueryConsumerChainOptedInValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryConsumerChainOptedInValidatorsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).QueryOptedInValidatorsByConsumerChainID(ctx, in) + return srv.(QueryServer).QueryConsumerChainOptedInValidators(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryOptedInValidatorsByConsumerChainID", + FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryConsumerChainOptedInValidators", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryOptedInValidatorsByConsumerChainID(ctx, req.(*QueryOptedInValidatorsByConsumerChainIDRequest)) + return srv.(QueryServer).QueryConsumerChainOptedInValidators(ctx, req.(*QueryConsumerChainOptedInValidatorsRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_QueryConsumerChainsByValidatorAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryConsumerChainsByValidatorAddressRequest) +func _Query_QueryConsumerChainsValidatorHasToValidate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryConsumerChainsValidatorHasToValidateRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).QueryConsumerChainsByValidatorAddress(ctx, in) + return srv.(QueryServer).QueryConsumerChainsValidatorHasToValidate(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryConsumerChainsByValidatorAddress", + FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryConsumerChainsValidatorHasToValidate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryConsumerChainsByValidatorAddress(ctx, req.(*QueryConsumerChainsByValidatorAddressRequest)) + return srv.(QueryServer).QueryConsumerChainsValidatorHasToValidate(ctx, req.(*QueryConsumerChainsValidatorHasToValidateRequest)) } return interceptor(ctx, in, info, handler) } @@ -2196,12 +2196,12 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_QueryParams_Handler, }, { - MethodName: "QueryOptedInValidatorsByConsumerChainID", - Handler: _Query_QueryOptedInValidatorsByConsumerChainID_Handler, + MethodName: "QueryConsumerChainOptedInValidators", + Handler: _Query_QueryConsumerChainOptedInValidators_Handler, }, { - MethodName: "QueryConsumerChainsByValidatorAddress", - Handler: _Query_QueryConsumerChainsByValidatorAddress_Handler, + MethodName: "QueryConsumerChainsValidatorHasToValidate", + Handler: _Query_QueryConsumerChainsValidatorHasToValidate_Handler, }, { MethodName: "QueryValidatorConsumerCommissionRate", @@ -3023,7 +3023,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryConsumerChainOptedInValidatorsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3033,12 +3033,12 @@ func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Marshal() (dAtA []byte, return dAtA[:n], nil } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryConsumerChainOptedInValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryConsumerChainOptedInValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3053,7 +3053,7 @@ func (m *QueryOptedInValidatorsByConsumerChainIDRequest) MarshalToSizedBuffer(dA return len(dAtA) - i, nil } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryConsumerChainOptedInValidatorsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3063,12 +3063,12 @@ func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Marshal() (dAtA []byte return dAtA[:n], nil } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryConsumerChainOptedInValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryConsumerChainOptedInValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3085,7 +3085,7 @@ func (m *QueryOptedInValidatorsByConsumerChainIDResponse) MarshalToSizedBuffer(d return len(dAtA) - i, nil } -func (m *QueryConsumerChainsByValidatorAddressRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3095,12 +3095,12 @@ func (m *QueryConsumerChainsByValidatorAddressRequest) Marshal() (dAtA []byte, e return dAtA[:n], nil } -func (m *QueryConsumerChainsByValidatorAddressRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryConsumerChainsByValidatorAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3115,7 +3115,7 @@ func (m *QueryConsumerChainsByValidatorAddressRequest) MarshalToSizedBuffer(dAtA return len(dAtA) - i, nil } -func (m *QueryConsumerChainsByValidatorAddressResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3125,21 +3125,21 @@ func (m *QueryConsumerChainsByValidatorAddressResponse) Marshal() (dAtA []byte, return dAtA[:n], nil } -func (m *QueryConsumerChainsByValidatorAddressResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryConsumerChainsByValidatorAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ValidatorConsumerChains) > 0 { - for iNdEx := len(m.ValidatorConsumerChains) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ValidatorConsumerChains[iNdEx]) - copy(dAtA[i:], m.ValidatorConsumerChains[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorConsumerChains[iNdEx]))) + if len(m.ConsumerChains) > 0 { + for iNdEx := len(m.ConsumerChains) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ConsumerChains[iNdEx]) + copy(dAtA[i:], m.ConsumerChains[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerChains[iNdEx]))) i-- dAtA[i] = 0xa } @@ -3562,7 +3562,7 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Size() (n int) { +func (m *QueryConsumerChainOptedInValidatorsRequest) Size() (n int) { if m == nil { return 0 } @@ -3575,7 +3575,7 @@ func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Size() (n int) { return n } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Size() (n int) { +func (m *QueryConsumerChainOptedInValidatorsResponse) Size() (n int) { if m == nil { return 0 } @@ -3590,7 +3590,7 @@ func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Size() (n int) { return n } -func (m *QueryConsumerChainsByValidatorAddressRequest) Size() (n int) { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) Size() (n int) { if m == nil { return 0 } @@ -3603,14 +3603,14 @@ func (m *QueryConsumerChainsByValidatorAddressRequest) Size() (n int) { return n } -func (m *QueryConsumerChainsByValidatorAddressResponse) Size() (n int) { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.ValidatorConsumerChains) > 0 { - for _, s := range m.ValidatorConsumerChains { + if len(m.ConsumerChains) > 0 { + for _, s := range m.ConsumerChains { l = len(s) n += 1 + l + sovQuery(uint64(l)) } @@ -5755,7 +5755,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Unmarshal(dAtA []byte) error { +func (m *QueryConsumerChainOptedInValidatorsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5778,10 +5778,10 @@ func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Unmarshal(dAtA []byte) fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOptedInValidatorsByConsumerChainIDRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryConsumerChainOptedInValidatorsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOptedInValidatorsByConsumerChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryConsumerChainOptedInValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5837,7 +5837,7 @@ func (m *QueryOptedInValidatorsByConsumerChainIDRequest) Unmarshal(dAtA []byte) } return nil } -func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Unmarshal(dAtA []byte) error { +func (m *QueryConsumerChainOptedInValidatorsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5860,10 +5860,10 @@ func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Unmarshal(dAtA []byte) fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOptedInValidatorsByConsumerChainIDResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryConsumerChainOptedInValidatorsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOptedInValidatorsByConsumerChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryConsumerChainOptedInValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5919,7 +5919,7 @@ func (m *QueryOptedInValidatorsByConsumerChainIDResponse) Unmarshal(dAtA []byte) } return nil } -func (m *QueryConsumerChainsByValidatorAddressRequest) Unmarshal(dAtA []byte) error { +func (m *QueryConsumerChainsValidatorHasToValidateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5942,10 +5942,10 @@ func (m *QueryConsumerChainsByValidatorAddressRequest) Unmarshal(dAtA []byte) er fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryConsumerChainsByValidatorAddressRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryConsumerChainsValidatorHasToValidateRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryConsumerChainsByValidatorAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryConsumerChainsValidatorHasToValidateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6001,7 +6001,7 @@ func (m *QueryConsumerChainsByValidatorAddressRequest) Unmarshal(dAtA []byte) er } return nil } -func (m *QueryConsumerChainsByValidatorAddressResponse) Unmarshal(dAtA []byte) error { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6024,15 +6024,15 @@ func (m *QueryConsumerChainsByValidatorAddressResponse) Unmarshal(dAtA []byte) e fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryConsumerChainsByValidatorAddressResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryConsumerChainsValidatorHasToValidateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryConsumerChainsByValidatorAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryConsumerChainsValidatorHasToValidateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorConsumerChains", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerChains", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6060,7 +6060,7 @@ func (m *QueryConsumerChainsByValidatorAddressResponse) Unmarshal(dAtA []byte) e if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorConsumerChains = append(m.ValidatorConsumerChains, string(dAtA[iNdEx:postIndex])) + m.ConsumerChains = append(m.ConsumerChains, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/ccv/provider/types/query.pb.gw.go b/x/ccv/provider/types/query.pb.gw.go index fb8a2f3bfa..9b13ca9999 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -322,73 +322,73 @@ func local_request_Query_QueryParams_0(ctx context.Context, marshaler runtime.Ma } var ( - filter_Query_QueryOptedInValidatorsByConsumerChainID_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_QueryConsumerChainOptedInValidators_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_QueryOptedInValidatorsByConsumerChainID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryOptedInValidatorsByConsumerChainIDRequest +func request_Query_QueryConsumerChainOptedInValidators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerChainOptedInValidatorsRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryOptedInValidatorsByConsumerChainID_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainOptedInValidators_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.QueryOptedInValidatorsByConsumerChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.QueryConsumerChainOptedInValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_QueryOptedInValidatorsByConsumerChainID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryOptedInValidatorsByConsumerChainIDRequest +func local_request_Query_QueryConsumerChainOptedInValidators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerChainOptedInValidatorsRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryOptedInValidatorsByConsumerChainID_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainOptedInValidators_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.QueryOptedInValidatorsByConsumerChainID(ctx, &protoReq) + msg, err := server.QueryConsumerChainOptedInValidators(ctx, &protoReq) return msg, metadata, err } var ( - filter_Query_QueryConsumerChainsByValidatorAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_QueryConsumerChainsValidatorHasToValidate_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_QueryConsumerChainsByValidatorAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryConsumerChainsByValidatorAddressRequest +func request_Query_QueryConsumerChainsValidatorHasToValidate_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerChainsValidatorHasToValidateRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainsByValidatorAddress_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainsValidatorHasToValidate_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.QueryConsumerChainsByValidatorAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.QueryConsumerChainsValidatorHasToValidate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_QueryConsumerChainsByValidatorAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryConsumerChainsByValidatorAddressRequest +func local_request_Query_QueryConsumerChainsValidatorHasToValidate_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerChainsValidatorHasToValidateRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainsByValidatorAddress_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainsValidatorHasToValidate_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.QueryConsumerChainsByValidatorAddress(ctx, &protoReq) + msg, err := server.QueryConsumerChainsValidatorHasToValidate(ctx, &protoReq) return msg, metadata, err } @@ -688,7 +688,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_QueryOptedInValidatorsByConsumerChainID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryConsumerChainOptedInValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -699,7 +699,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_QueryOptedInValidatorsByConsumerChainID_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_QueryConsumerChainOptedInValidators_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -707,11 +707,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_QueryOptedInValidatorsByConsumerChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryConsumerChainOptedInValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_QueryConsumerChainsByValidatorAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryConsumerChainsValidatorHasToValidate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -722,7 +722,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_QueryConsumerChainsByValidatorAddress_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_QueryConsumerChainsValidatorHasToValidate_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -730,7 +730,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_QueryConsumerChainsByValidatorAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryConsumerChainsValidatorHasToValidate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1018,7 +1018,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_QueryOptedInValidatorsByConsumerChainID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryConsumerChainOptedInValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -1027,18 +1027,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_QueryOptedInValidatorsByConsumerChainID_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_QueryConsumerChainOptedInValidators_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_QueryOptedInValidatorsByConsumerChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryConsumerChainOptedInValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_QueryConsumerChainsByValidatorAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryConsumerChainsValidatorHasToValidate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -1047,14 +1047,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_QueryConsumerChainsByValidatorAddress_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_QueryConsumerChainsValidatorHasToValidate_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_QueryConsumerChainsByValidatorAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryConsumerChainsValidatorHasToValidate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1104,9 +1104,9 @@ var ( pattern_Query_QueryParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryOptedInValidatorsByConsumerChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "opted_in_validators"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryConsumerChainOptedInValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "opted_in_validators"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryConsumerChainsByValidatorAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_chains_per_validator"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryConsumerChainsValidatorHasToValidate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_chains_per_validator"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryValidatorConsumerCommissionRate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_commission_rate"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -1134,9 +1134,9 @@ var ( forward_Query_QueryParams_0 = runtime.ForwardResponseMessage - forward_Query_QueryOptedInValidatorsByConsumerChainID_0 = runtime.ForwardResponseMessage + forward_Query_QueryConsumerChainOptedInValidators_0 = runtime.ForwardResponseMessage - forward_Query_QueryConsumerChainsByValidatorAddress_0 = runtime.ForwardResponseMessage + forward_Query_QueryConsumerChainsValidatorHasToValidate_0 = runtime.ForwardResponseMessage forward_Query_QueryValidatorConsumerCommissionRate_0 = runtime.ForwardResponseMessage ) From 559b28f85772dabf0128ff8857466c37e1194f67 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 09:02:38 +0100 Subject: [PATCH 22/36] fix doc --- proto/interchain_security/ccv/provider/v1/query.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index dad578d079..28662587eb 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -101,7 +101,7 @@ service Query { "/interchain_security/ccv/provider/params"; } - // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address + // QueryConsumerChainOptedInValidators returns a list of validators consensus address // that opted-in to the given consumer chain rpc QueryConsumerChainOptedInValidators( QueryConsumerChainOptedInValidatorsRequest) @@ -110,7 +110,7 @@ service Query { "/interchain_security/ccv/provider/opted_in_validators"; } - // QueryConsumerChainsByValidatorAddress returns a list of consumer chains + // QueryConsumerChainsValidatorHasToValidate returns a list of consumer chains // that a given validator must validate rpc QueryConsumerChainsValidatorHasToValidate( QueryConsumerChainsValidatorHasToValidateRequest) From 00e43a9fe81a60b5926f6e914e9eae0279283e95 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 09:16:06 +0100 Subject: [PATCH 23/36] nits --- .../ccv/provider/v1/query.proto | 3 +- x/ccv/provider/keeper/grpc_query.go | 2 +- x/ccv/provider/types/query.pb.go | 245 +++++++++--------- 3 files changed, 126 insertions(+), 124 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 28662587eb..0cf29f1757 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -250,7 +250,8 @@ message QueryConsumerChainOptedInValidatorsRequest { } message QueryConsumerChainOptedInValidatorsResponse { - repeated string validators_provider_address = 1; + // The consensus addresses of the validators on the provider chain + repeated string validators_provider_addresses = 1; } diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 8d4eb991de..cafcd8d53a 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -245,7 +245,7 @@ func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req * } return &types.QueryConsumerChainOptedInValidatorsResponse{ - ValidatorsProviderAddress: optedInVals, + ValidatorsProviderAddresses: optedInVals, }, nil } diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 1eaa120041..8fed479d66 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1222,7 +1222,8 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) GetChainId() string { } type QueryConsumerChainOptedInValidatorsResponse struct { - ValidatorsProviderAddress []string `protobuf:"bytes,1,rep,name=validators_provider_address,json=validatorsProviderAddress,proto3" json:"validators_provider_address,omitempty"` + // The consensus addresses of the validators on the provider chain + ValidatorsProviderAddresses []string `protobuf:"bytes,1,rep,name=validators_provider_addresses,json=validatorsProviderAddresses,proto3" json:"validators_provider_addresses,omitempty"` } func (m *QueryConsumerChainOptedInValidatorsResponse) Reset() { @@ -1262,9 +1263,9 @@ func (m *QueryConsumerChainOptedInValidatorsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerChainOptedInValidatorsResponse proto.InternalMessageInfo -func (m *QueryConsumerChainOptedInValidatorsResponse) GetValidatorsProviderAddress() []string { +func (m *QueryConsumerChainOptedInValidatorsResponse) GetValidatorsProviderAddresses() []string { if m != nil { - return m.ValidatorsProviderAddress + return m.ValidatorsProviderAddresses } return nil } @@ -1505,113 +1506,113 @@ func init() { var fileDescriptor_422512d7b7586cd7 = []byte{ // 1706 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x6f, 0xdb, 0xc6, - 0x16, 0x36, 0xfd, 0xba, 0xf6, 0x38, 0x71, 0x72, 0x27, 0x8f, 0x6b, 0xd3, 0xbe, 0x92, 0xc3, 0xb4, - 0x89, 0xf3, 0x22, 0x6d, 0xa5, 0x41, 0x9e, 0x8e, 0x63, 0x59, 0x89, 0x23, 0x38, 0x0f, 0x85, 0x71, - 0x52, 0xa0, 0x0d, 0xca, 0xd0, 0xe4, 0x54, 0x26, 0x4c, 0x71, 0x68, 0x72, 0xac, 0x44, 0x08, 0x0a, - 0x34, 0x5d, 0x34, 0xd9, 0x35, 0x45, 0xdb, 0x7d, 0x80, 0xa2, 0x7f, 0xa0, 0xe8, 0x8f, 0xc8, 0xae, - 0x69, 0xb3, 0x29, 0xba, 0x48, 0x0b, 0xa7, 0x8b, 0xa2, 0xab, 0xa2, 0xfb, 0x02, 0x05, 0x87, 0x43, - 0x4a, 0x94, 0x68, 0x89, 0x92, 0xdd, 0x95, 0xcd, 0x99, 0x39, 0xdf, 0x39, 0xdf, 0x99, 0x33, 0x67, - 0xe6, 0x13, 0x90, 0x0c, 0x8b, 0x20, 0x47, 0x5b, 0x51, 0x0d, 0x4b, 0x71, 0x91, 0xb6, 0xee, 0x18, - 0xa4, 0x22, 0x69, 0x5a, 0x59, 0xb2, 0x1d, 0x5c, 0x36, 0x74, 0xe4, 0x48, 0xe5, 0x69, 0x69, 0x6d, - 0x1d, 0x39, 0x15, 0xd1, 0x76, 0x30, 0xc1, 0xf0, 0x60, 0x8c, 0x81, 0xa8, 0x69, 0x65, 0x31, 0x30, - 0x10, 0xcb, 0xd3, 0xfc, 0x78, 0x11, 0xe3, 0xa2, 0x89, 0x24, 0xd5, 0x36, 0x24, 0xd5, 0xb2, 0x30, - 0x51, 0x89, 0x81, 0x2d, 0xd7, 0x87, 0xe0, 0xf7, 0x16, 0x71, 0x11, 0xd3, 0x7f, 0x25, 0xef, 0x3f, - 0x36, 0x9a, 0x66, 0x36, 0xf4, 0x6b, 0x79, 0xfd, 0x43, 0x89, 0x18, 0x25, 0xe4, 0x12, 0xb5, 0x64, - 0xb3, 0x05, 0x99, 0x24, 0xa1, 0x86, 0x51, 0xf8, 0x36, 0x53, 0x9b, 0xd9, 0x94, 0xa7, 0x25, 0x77, - 0x45, 0x75, 0x90, 0xae, 0x68, 0xd8, 0x72, 0xd7, 0x4b, 0xa1, 0xc5, 0xdb, 0x4d, 0x2c, 0x1e, 0x18, - 0x0e, 0x62, 0xcb, 0xc6, 0x09, 0xb2, 0x74, 0xe4, 0x94, 0x0c, 0x8b, 0x48, 0x9a, 0x53, 0xb1, 0x09, - 0x96, 0x56, 0x51, 0x25, 0x60, 0x38, 0xaa, 0x61, 0xb7, 0x84, 0x5d, 0xc5, 0x27, 0xe9, 0x7f, 0xf8, - 0x53, 0xc2, 0x19, 0x30, 0x76, 0xcb, 0x4b, 0xe7, 0x3c, 0x73, 0xbb, 0x80, 0x2c, 0xe4, 0x1a, 0xae, - 0x8c, 0xd6, 0xd6, 0x91, 0x4b, 0xe0, 0x28, 0x18, 0xf0, 0x7d, 0x1b, 0xfa, 0x08, 0x37, 0xc1, 0x4d, - 0x0e, 0xca, 0xff, 0xa1, 0xdf, 0x79, 0x5d, 0x78, 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 0x73, 0x91, 0xa5, 0x23, 0xa7, 0x64, 0x58, 0xae, 0xa4, 0x39, 0x15, 0xdb, 0xc5, + 0xd2, 0x0a, 0xaa, 0x04, 0x0c, 0xf7, 0x69, 0x98, 0x94, 0x30, 0x51, 0x7c, 0x92, 0xfe, 0x87, 0x3f, + 0x25, 0x9c, 0x01, 0xa3, 0xb7, 0xbc, 0x74, 0xce, 0x31, 0xb7, 0xf3, 0xc8, 0x42, 0xc4, 0x20, 0x32, + 0x5a, 0x5d, 0x43, 0xc4, 0x85, 0xfb, 0xc0, 0x80, 0xef, 0xdb, 0xd0, 0x47, 0xb8, 0x71, 0x6e, 0x62, + 0x50, 0xfe, 0x1f, 0xfd, 0xce, 0xeb, 0xc2, 0x23, 0x30, 0x16, 0x6f, 0x49, 0x6c, 0x6c, 0x11, 0x04, + 0x3f, 0x00, 0xdb, 0x8b, 0xfe, 0x90, 0x42, 0x5c, 0xd5, 0x45, 0xd4, 0x7e, 0x28, 0x33, 0x29, 0x6e, + 0xb4, 0x63, 0xe5, 0x29, 0xb1, 0x0e, 0xeb, 0xb6, 0x67, 0x97, 0xed, 0x7d, 0xf1, 0x3a, 0xdd, 0x25, + 0x6f, 0x2b, 0xd6, 0x8c, 0x09, 0x63, 0x80, 0x8f, 0x38, 0x9f, 0xf3, 0xe0, 0x82, 0xa8, 0x05, 0xb5, + 0x8e, 0x54, 0x30, 0xcb, 0x22, 0xcb, 0x82, 0x7e, 0xea, 0x9e, 0x8c, 0x70, 0xe3, 0x3d, 0x13, 0x43, + 0x99, 0xa3, 0x62, 0x82, 0x22, 0x12, 0x29, 0x88, 0xcc, 0x2c, 0x85, 0x23, 0xe0, 0x70, 0xa3, 0x8b, + 0xdb, 0xae, 0xea, 0xb8, 0x05, 0x07, 0xdb, 0x98, 0xa8, 0x66, 0x18, 0xcd, 0x53, 0x0e, 0x4c, 0xb4, + 0x5e, 0xcb, 0x62, 0xbb, 0x07, 0x06, 0xed, 0x60, 0x90, 0x65, 0xec, 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cd, 0xd4, 0x0f, 0xbf, 0xb0, - 0x65, 0x1c, 0x46, 0x7c, 0x8e, 0x12, 0x3f, 0x0f, 0xcf, 0x26, 0xf8, 0xd1, 0x27, 0x00, 0x52, 0x22, - 0x0f, 0x87, 0x18, 0xca, 0xb5, 0x77, 0x57, 0x47, 0x94, 0x63, 0x54, 0x51, 0x47, 0x94, 0xe3, 0x44, - 0x4d, 0x67, 0x94, 0x23, 0xf7, 0x0b, 0xfc, 0x9e, 0x63, 0xaf, 0x97, 0x88, 0x9e, 0x81, 0x17, 0x93, - 0x87, 0x18, 0x27, 0x93, 0xf8, 0xd9, 0x8e, 0xed, 0x19, 0xb5, 0x33, 0x94, 0x5a, 0x06, 0x4e, 0xb5, - 0xa6, 0x46, 0x18, 0x80, 0xff, 0xbb, 0x10, 0xfc, 0xaa, 0x1b, 0x1c, 0x4c, 0x20, 0x50, 0xe0, 0xcd, - 0xe4, 0x21, 0x26, 0x12, 0x46, 0x7c, 0x61, 0xfb, 0x00, 0x59, 0x12, 0x16, 0x69, 0x12, 0x2e, 0xc3, - 0xf9, 0xd6, 0x49, 0x70, 0x42, 0xc4, 0x6a, 0x4d, 0x3b, 0x14, 0x53, 0xf1, 0x05, 0x17, 0xfc, 0xa3, - 0x41, 0x50, 0x45, 0x75, 0x82, 0x0b, 0xdb, 0xb8, 0x55, 0x37, 0x51, 0x6d, 0x7c, 0x76, 0x2b, 0x10, - 0x8c, 0x75, 0x96, 0xb2, 0xbe, 0x00, 0xcf, 0xb5, 0x66, 0x1d, 0xe8, 0x35, 0xa5, 0xfe, 0x02, 0xfb, - 0xb2, 0x9b, 0xfd, 0x48, 0x96, 0x40, 0x20, 0xc1, 0xa5, 0xe4, 0x41, 0x27, 0x97, 0x6f, 0xfc, 0x9d, - 0x6d, 0x46, 0x65, 0xd9, 0x39, 0x4f, 0xb3, 0x73, 0x0a, 0x9e, 0x6c, 0xbb, 0xbf, 0x1b, 0x3a, 0xfc, - 0x96, 0x03, 0x43, 0x35,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x76, 0xd7, 0x0f, 0xf2, 0x49, 0x70, + 0xa0, 0x9b, 0x6b, 0x94, 0x76, 0x0e, 0x74, 0x22, 0xd9, 0xd4, 0xce, 0x81, 0x4e, 0x26, 0x9f, 0x84, + 0x69, 0x4a, 0xfe, 0x34, 0x3c, 0xd5, 0x9a, 0x3c, 0xf6, 0x40, 0x14, 0xc3, 0x52, 0xaa, 0x52, 0x0a, + 0x7e, 0xd3, 0x0d, 0x8e, 0x24, 0xd6, 0x31, 0xf0, 0x4e, 0xa7, 0x2f, 0xc8, 0xa6, 0x52, 0x8c, 0xbf, + 0xbb, 0xd5, 0xb0, 0x9b, 0x7d, 0xb8, 0x10, 0xc5, 0x46, 0x4e, 0x35, 0x4d, 0xf0, 0xf3, 0x6e, 0xf0, + 0x76, 0x12, 0x11, 0x04, 0x0b, 0x9b, 0x78, 0x7a, 0xc4, 0x2a, 0x3b, 0xfe, 0xd6, 0x16, 0x22, 0xb6, + 0xdf, 0x0d, 0xab, 0x69, 0x09, 0xa1, 0x14, 0x4f, 0x93, 0x65, 0xdf, 0x7b, 0xb1, 0x9e, 0xe2, 0x5e, + 0xae, 0xa7, 0xb8, 0xdf, 0xd6, 0x53, 0xdc, 0xb3, 0x37, 0xa9, 0xae, 0x97, 0x6f, 0x52, 0x5d, 0x3f, + 0xbf, 0x49, 0x75, 0xbd, 0x3f, 0xdd, 0xa8, 0xf4, 0xaa, 0x6e, 0x4e, 0x84, 0x6e, 0xca, 0xef, 0x4a, + 0x0f, 0xeb, 0x2e, 0x5d, 0x4f, 0x04, 0x2e, 0xf5, 0xd3, 0xdf, 0x1c, 0x4f, 0xfe, 0x1b, 0x00, 0x00, + 0xff, 0xff, 0xd8, 0x4f, 0xdc, 0x3e, 0x6c, 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1656,10 +1657,10 @@ type QueryClient interface { QueryAllPairsValConAddrByConsumerChainID(ctx context.Context, in *QueryAllPairsValConAddrByConsumerChainIDRequest, opts ...grpc.CallOption) (*QueryAllPairsValConAddrByConsumerChainIDResponse, error) // QueryParams returns all current values of provider parameters QueryParams(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address + // QueryConsumerChainOptedInValidators returns a list of validators consensus address // that opted-in to the given consumer chain QueryConsumerChainOptedInValidators(ctx context.Context, in *QueryConsumerChainOptedInValidatorsRequest, opts ...grpc.CallOption) (*QueryConsumerChainOptedInValidatorsResponse, error) - // QueryConsumerChainsByValidatorAddress returns a list of consumer chains + // QueryConsumerChainsValidatorHasToValidate returns a list of consumer chains // that a given validator must validate QueryConsumerChainsValidatorHasToValidate(ctx context.Context, in *QueryConsumerChainsValidatorHasToValidateRequest, opts ...grpc.CallOption) (*QueryConsumerChainsValidatorHasToValidateResponse, error) // QueryValidatorConsumerCommissionRate returns the commission rate a given @@ -1833,10 +1834,10 @@ type QueryServer interface { QueryAllPairsValConAddrByConsumerChainID(context.Context, *QueryAllPairsValConAddrByConsumerChainIDRequest) (*QueryAllPairsValConAddrByConsumerChainIDResponse, error) // QueryParams returns all current values of provider parameters QueryParams(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // QueryOptedInValidatorsByConsumerChainID returns a list of validators consensus address + // QueryConsumerChainOptedInValidators returns a list of validators consensus address // that opted-in to the given consumer chain QueryConsumerChainOptedInValidators(context.Context, *QueryConsumerChainOptedInValidatorsRequest) (*QueryConsumerChainOptedInValidatorsResponse, error) - // QueryConsumerChainsByValidatorAddress returns a list of consumer chains + // QueryConsumerChainsValidatorHasToValidate returns a list of consumer chains // that a given validator must validate QueryConsumerChainsValidatorHasToValidate(context.Context, *QueryConsumerChainsValidatorHasToValidateRequest) (*QueryConsumerChainsValidatorHasToValidateResponse, error) // QueryValidatorConsumerCommissionRate returns the commission rate a given @@ -3073,11 +3074,11 @@ func (m *QueryConsumerChainOptedInValidatorsResponse) MarshalToSizedBuffer(dAtA _ = i var l int _ = l - if len(m.ValidatorsProviderAddress) > 0 { - for iNdEx := len(m.ValidatorsProviderAddress) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ValidatorsProviderAddress[iNdEx]) - copy(dAtA[i:], m.ValidatorsProviderAddress[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorsProviderAddress[iNdEx]))) + if len(m.ValidatorsProviderAddresses) > 0 { + for iNdEx := len(m.ValidatorsProviderAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ValidatorsProviderAddresses[iNdEx]) + copy(dAtA[i:], m.ValidatorsProviderAddresses[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorsProviderAddresses[iNdEx]))) i-- dAtA[i] = 0xa } @@ -3581,8 +3582,8 @@ func (m *QueryConsumerChainOptedInValidatorsResponse) Size() (n int) { } var l int _ = l - if len(m.ValidatorsProviderAddress) > 0 { - for _, s := range m.ValidatorsProviderAddress { + if len(m.ValidatorsProviderAddresses) > 0 { + for _, s := range m.ValidatorsProviderAddresses { l = len(s) n += 1 + l + sovQuery(uint64(l)) } @@ -5868,7 +5869,7 @@ func (m *QueryConsumerChainOptedInValidatorsResponse) Unmarshal(dAtA []byte) err switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsProviderAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsProviderAddresses", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5896,7 +5897,7 @@ func (m *QueryConsumerChainOptedInValidatorsResponse) Unmarshal(dAtA []byte) err if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorsProviderAddress = append(m.ValidatorsProviderAddress, string(dAtA[iNdEx:postIndex])) + m.ValidatorsProviderAddresses = append(m.ValidatorsProviderAddresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex From 4f9084f7daf53536aa0fc26741def28c38f68d93 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 09:18:01 +0100 Subject: [PATCH 24/36] nits --- .../ccv/provider/v1/query.proto | 2 +- x/ccv/provider/keeper/grpc_query.go | 2 +- x/ccv/provider/types/query.pb.go | 240 +++++++++--------- 3 files changed, 122 insertions(+), 122 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 0cf29f1757..e939767d2f 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -261,7 +261,7 @@ message QueryConsumerChainsValidatorHasToValidateRequest { } message QueryConsumerChainsValidatorHasToValidateResponse { - repeated string consumer_chains = 1; + repeated string consumer_chain_ids = 1; } message QueryValidatorConsumerCommissionRateRequest { diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index cafcd8d53a..27967afe31 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -276,7 +276,7 @@ func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, } return &types.QueryConsumerChainsValidatorHasToValidateResponse{ - ConsumerChains: consumersToValidate, + ConsumerChainIds: consumersToValidate, }, nil } diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 8fed479d66..e71b504a41 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1320,7 +1320,7 @@ func (m *QueryConsumerChainsValidatorHasToValidateRequest) GetProviderAddress() } type QueryConsumerChainsValidatorHasToValidateResponse struct { - ConsumerChains []string `protobuf:"bytes,1,rep,name=consumer_chains,json=consumerChains,proto3" json:"consumer_chains,omitempty"` + ConsumerChainIds []string `protobuf:"bytes,1,rep,name=consumer_chain_ids,json=consumerChainIds,proto3" json:"consumer_chain_ids,omitempty"` } func (m *QueryConsumerChainsValidatorHasToValidateResponse) Reset() { @@ -1360,9 +1360,9 @@ func (m *QueryConsumerChainsValidatorHasToValidateResponse) XXX_DiscardUnknown() var xxx_messageInfo_QueryConsumerChainsValidatorHasToValidateResponse proto.InternalMessageInfo -func (m *QueryConsumerChainsValidatorHasToValidateResponse) GetConsumerChains() []string { +func (m *QueryConsumerChainsValidatorHasToValidateResponse) GetConsumerChainIds() []string { if m != nil { - return m.ConsumerChains + return m.ConsumerChainIds } return nil } @@ -1505,114 +1505,114 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1706 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xdb, 0x6f, 0xd4, 0xc6, - 0x17, 0x8e, 0x73, 0xfb, 0x25, 0x13, 0x08, 0xfc, 0x86, 0x4b, 0x83, 0x13, 0x76, 0x83, 0x69, 0x21, - 0xdc, 0xec, 0x64, 0x29, 0xe2, 0x1a, 0x42, 0x36, 0x0b, 0x61, 0x15, 0x2e, 0x8b, 0x09, 0x54, 0x6a, - 0x51, 0x8d, 0x63, 0x4f, 0x37, 0x56, 0xbc, 0x1e, 0xc7, 0xe3, 0x2c, 0xac, 0x50, 0xa5, 0xd2, 0x87, - 0xc2, 0x5b, 0xa9, 0xda, 0xbe, 0x23, 0x55, 0xfd, 0x07, 0xaa, 0xfe, 0x11, 0xbc, 0x95, 0x96, 0x97, - 0xaa, 0x0f, 0xb4, 0x0a, 0x7d, 0xa8, 0xfa, 0x54, 0xf5, 0xbd, 0x52, 0xe5, 0xf1, 0xd8, 0xbb, 0xde, - 0x75, 0x76, 0xbd, 0x9b, 0xf4, 0x29, 0xf1, 0xcc, 0x9c, 0xef, 0x9c, 0xef, 0xcc, 0x99, 0x33, 0xf3, - 0x2d, 0x90, 0x0c, 0xcb, 0x45, 0x8e, 0xb6, 0xac, 0x1a, 0x96, 0x42, 0x90, 0xb6, 0xe6, 0x18, 0x6e, - 0x45, 0xd2, 0xb4, 0xb2, 0x64, 0x3b, 0xb8, 0x6c, 0xe8, 0xc8, 0x91, 0xca, 0x53, 0xd2, 0xea, 0x1a, - 0x72, 0x2a, 0xa2, 0xed, 0x60, 0x17, 0xc3, 0x83, 0x31, 0x06, 0xa2, 0xa6, 0x95, 0xc5, 0xc0, 0x40, - 0x2c, 0x4f, 0xf1, 0x63, 0x45, 0x8c, 0x8b, 0x26, 0x92, 0x54, 0xdb, 0x90, 0x54, 0xcb, 0xc2, 0xae, - 0xea, 0x1a, 0xd8, 0x22, 0x3e, 0x04, 0xbf, 0xbb, 0x88, 0x8b, 0x98, 0xfe, 0x2b, 0x79, 0xff, 0xb1, - 0xd1, 0x34, 0xb3, 0xa1, 0x5f, 0x4b, 0x6b, 0x1f, 0x49, 0xae, 0x51, 0x42, 0xc4, 0x55, 0x4b, 0x36, - 0x5b, 0x90, 0x49, 0x12, 0x6a, 0x18, 0x85, 0x6f, 0x33, 0xb9, 0x91, 0x4d, 0x79, 0x4a, 0x22, 0xcb, - 0xaa, 0x83, 0x74, 0x45, 0xc3, 0x16, 0x59, 0x2b, 0x85, 0x16, 0xef, 0x34, 0xb1, 0x78, 0x60, 0x38, - 0x88, 0x2d, 0x1b, 0x73, 0x91, 0xa5, 0x23, 0xa7, 0x64, 0x58, 0xae, 0xa4, 0x39, 0x15, 0xdb, 0xc5, - 0xd2, 0x0a, 0xaa, 0x04, 0x0c, 0xf7, 0x69, 0x98, 0x94, 0x30, 0x51, 0x7c, 0x92, 0xfe, 0x87, 0x3f, - 0x25, 0x9c, 0x01, 0xa3, 0xb7, 0xbc, 0x74, 0xce, 0x31, 0xb7, 0xf3, 0xc8, 0x42, 0xc4, 0x20, 0x32, - 0x5a, 0x5d, 0x43, 0xc4, 0x85, 0xfb, 0xc0, 0x80, 0xef, 0xdb, 0xd0, 0x47, 0xb8, 0x71, 0x6e, 0x62, - 0x50, 0xfe, 0x1f, 0xfd, 0xce, 0xeb, 0xc2, 0x23, 0x30, 0x16, 0x6f, 0x49, 0x6c, 0x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, 0xa6, 0x52, 0x8c, 0xbf, - 0xbb, 0xd5, 0xb0, 0x9b, 0x7d, 0xb8, 0x10, 0xc5, 0x46, 0x4e, 0x35, 0x4d, 0xf0, 0xf3, 0x6e, 0xf0, - 0x76, 0x12, 0x11, 0x04, 0x0b, 0x9b, 0x78, 0x7a, 0xc4, 0x2a, 0x3b, 0xfe, 0xd6, 0x16, 0x22, 0xb6, - 0xdf, 0x0d, 0xab, 0x69, 0x09, 0xa1, 0x14, 0x4f, 0x93, 0x65, 0xdf, 0x7b, 0xb1, 0x9e, 0xe2, 0x5e, - 0xae, 0xa7, 0xb8, 0xdf, 0xd6, 0x53, 0xdc, 0xb3, 0x37, 0xa9, 0xae, 0x97, 0x6f, 0x52, 0x5d, 0x3f, - 0xbf, 0x49, 0x75, 0xbd, 0x3f, 0xdd, 0xa8, 0xf4, 0xaa, 0x6e, 0x4e, 0x84, 0x6e, 0xca, 0xef, 0x4a, - 0x0f, 0xeb, 0x2e, 0x5d, 0x4f, 0x04, 0x2e, 0xf5, 0xd3, 0xdf, 0x1c, 0x4f, 0xfe, 0x1b, 0x00, 0x00, - 0xff, 0xff, 0xd8, 0x4f, 0xdc, 0x3e, 0x6c, 0x1b, 0x00, 0x00, + // 1709 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x5b, 0x6f, 0xdb, 0xc8, + 0x15, 0x36, 0x7d, 0xab, 0x3d, 0xce, 0xad, 0x93, 0x4b, 0x1d, 0xda, 0x91, 0x1c, 0xa6, 0x4d, 0x9d, + 0x1b, 0x69, 0x2b, 0x0d, 0x72, 0x75, 0x1c, 0xcb, 0x4a, 0x1c, 0xc1, 0xb9, 0x28, 0x8c, 0x93, 0x02, + 0x6d, 0x51, 0x86, 0x26, 0xa7, 0x32, 0x61, 0x8a, 0x43, 0x73, 0xc6, 0x4a, 0x84, 0xa0, 0x40, 0xd3, + 0x87, 0x26,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x44, 0x5e, 0xc5, 0x72, 0xa8, 0x62, 0x78, 0x35, + 0x97, 0x62, 0x65, 0x1d, 0xd5, 0x42, 0x86, 0x47, 0x0d, 0x4c, 0x2a, 0x98, 0x68, 0x01, 0xc9, 0xe0, + 0x23, 0x98, 0x92, 0x2e, 0x81, 0x89, 0x07, 0x7e, 0x38, 0x17, 0xb9, 0xd9, 0x25, 0xe4, 0x20, 0x62, + 0x11, 0x15, 0x6d, 0x6c, 0x22, 0x42, 0xe1, 0x51, 0x30, 0x12, 0xd8, 0xb6, 0xcc, 0x71, 0x61, 0x4a, + 0x98, 0x1e, 0x55, 0x7f, 0xc6, 0xbe, 0x8b, 0xa6, 0xf4, 0x1c, 0x4c, 0x26, 0xef, 0x24, 0x2e, 0x76, + 0x08, 0x82, 0xbf, 0x07, 0x7b, 0xcb, 0xc1, 0x90, 0x46, 0xa8, 0x4e, 0x11, 0xdb, 0x3f, 0x96, 0x9b, + 0x91, 0xb7, 0x3b, 0xb1, 0xea, 0xac, 0xdc, 0x84, 0xf5, 0xd0, 0xdf, 0x97, 0x1f, 0x7c, 0xfb, 0x21, + 0xdb, 0xa7, 0xee, 0x29, 0x37, 0x8c, 0x49, 0x93, 0x40, 0x8c, 0x19, 0x5f, 0xf4, 0xe1, 0x42, 0xaf, + 0x25, 0xbd, 0x89, 0x54, 0x38, 0xcb, 0x3d, 0xcb, 0x83, 0x61, 0x66, 0x9e, 0x8c, 0x0b, 0x53, 0x03, + 0xd3, 0x63, 0xb9, 0xd3, 0x72, 0x8a, 0x24, 0x92, 0x19, 0x88, 0xca, 0x77, 0x4a, 0xa7, 0xc0, 0xaf, + 0x5b, 0x4d, 0x3c, 0xa4, 0xba, 0x47, 0x4b, 0x1e, 0x76, 0x31, 0xd1, 0xed, 0xc8, 0x9b, 0x57, 0x02, + 0x98, 0xee, 0xbc, 0x96, 0xfb, 0xf6, 0x07, 0x30, 0xea, 0x86, 0x83, 0x3c, 0x62, 0xd7, 0xd3, 0xb9, + 0xc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x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3136,11 +3136,11 @@ func (m *QueryConsumerChainsValidatorHasToValidateResponse) MarshalToSizedBuffer _ = i var l int _ = l - if len(m.ConsumerChains) > 0 { - for iNdEx := len(m.ConsumerChains) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ConsumerChains[iNdEx]) - copy(dAtA[i:], m.ConsumerChains[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerChains[iNdEx]))) + if len(m.ConsumerChainIds) > 0 { + for iNdEx := len(m.ConsumerChainIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ConsumerChainIds[iNdEx]) + copy(dAtA[i:], m.ConsumerChainIds[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerChainIds[iNdEx]))) i-- dAtA[i] = 0xa } @@ -3610,8 +3610,8 @@ func (m *QueryConsumerChainsValidatorHasToValidateResponse) Size() (n int) { } var l int _ = l - if len(m.ConsumerChains) > 0 { - for _, s := range m.ConsumerChains { + if len(m.ConsumerChainIds) > 0 { + for _, s := range m.ConsumerChainIds { l = len(s) n += 1 + l + sovQuery(uint64(l)) } @@ -6033,7 +6033,7 @@ func (m *QueryConsumerChainsValidatorHasToValidateResponse) Unmarshal(dAtA []byt switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerChains", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerChainIds", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6061,7 +6061,7 @@ func (m *QueryConsumerChainsValidatorHasToValidateResponse) Unmarshal(dAtA []byt if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerChains = append(m.ConsumerChains, string(dAtA[iNdEx:postIndex])) + m.ConsumerChainIds = append(m.ConsumerChainIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex From d4fc4cba7ef81f2870fa0fda62ccd71be08e625d Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 09:37:08 +0100 Subject: [PATCH 25/36] docs --- x/ccv/provider/keeper/grpc_query.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 27967afe31..31f5b5f738 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -305,6 +305,8 @@ func (k Keeper) QueryValidatorConsumerCommissionRate(goCtx context.Context, req res := &types.QueryValidatorConsumerCommissionRateResponse{} + // Check if the validator has a commission rate set for the consumer chain, + // otherwise use the commission rate from the validator staking module struct consumerRate, found := k.GetConsumerCommissionRate(ctx, consumerChainID, types.NewProviderConsAddress(consAddr)) if found { res.Rate = consumerRate From 938d930727ae34c4276e0589ba8568b3feba1e0f Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 09:37:38 +0100 Subject: [PATCH 26/36] Update proto/interchain_security/ccv/provider/v1/query.proto Co-authored-by: insumity --- proto/interchain_security/ccv/provider/v1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index e939767d2f..bb7f6638ad 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -101,7 +101,7 @@ service Query { "/interchain_security/ccv/provider/params"; } - // QueryConsumerChainOptedInValidators returns a list of validators consensus address + // QueryConsumerChainOptedInValidators returns a list of validators consensus addresses // that opted-in to the given consumer chain rpc QueryConsumerChainOptedInValidators( QueryConsumerChainOptedInValidatorsRequest) From 9739ddd75c1ea85f53499d941fa61629034efdf1 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 11:23:02 +0100 Subject: [PATCH 27/36] nit --- x/ccv/provider/keeper/keeper.go | 2 +- x/ccv/provider/keeper/keeper_test.go | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 3cc7567b9e..cfb571ef6c 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -257,7 +257,7 @@ func (k Keeper) GetAllConsumerChains(ctx sdk.Context) (chains []types.Chain) { chains = append(chains, types.Chain{ ChainId: chainID, ClientId: clientID, - Opt_In: !isTopN, + Opt_In: !isTopN || topN == 0, Top_N: topN, }) } diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 6f970e85de..9f56f51f87 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/stretchr/testify/require" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + ibctesting "github.com/cosmos/ibc-go/v7/testing" + "github.com/stretchr/testify/require" abci "github.com/cometbft/cometbft/abci/types" tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" @@ -403,9 +403,7 @@ func TestGetAllConsumerChains(t *testing.T) { clientID := fmt.Sprintf("client-%d", len(chainIDs)-i) topN := uint32(i) pk.SetConsumerClientId(ctx, chainID, clientID) - if topN > 0 { - pk.SetTopN(ctx, chainID, topN) - } + pk.SetTopN(ctx, chainID, topN) expectedGetAllOrder = append(expectedGetAllOrder, types.Chain{ChainId: chainID, ClientId: clientID, Opt_In: topN == 0, Top_N: topN}) } // sorting by chainID From c01ab08a3ac8d4a9eca3ac5e7cec1d1b789e50e0 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 13:34:14 +0100 Subject: [PATCH 28/36] add OptedIn in QueryConsumerChainsValidatorHasToValidate --- x/ccv/provider/keeper/grpc_query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 31f5b5f738..8e2c4b11dd 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -270,7 +270,7 @@ func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, consumersToValidate := []string{} for _, consumer := range k.GetAllConsumerChains(ctx) { chainID := consumer.ChainId - if k.IsConsumerValidator(ctx, chainID, types.NewProviderConsAddress(consAddr)) { + if k.IsConsumerValidator(ctx, chainID, types.NewProviderConsAddress(consAddr)) || k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) { consumersToValidate = append(consumersToValidate, chainID) } } From 4661a997d849f4d5c50474c95d08fcc961b11a8c Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 13:37:31 +0100 Subject: [PATCH 29/36] remove OptIn field in consumer chains query response --- .../ccv/provider/v1/query.proto | 4 +- x/ccv/provider/keeper/keeper.go | 3 +- x/ccv/provider/keeper/keeper_test.go | 2 +- x/ccv/provider/types/query.pb.go | 259 ++++++++---------- 4 files changed, 111 insertions(+), 157 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index e939767d2f..8ffd059ecc 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -155,10 +155,8 @@ message QueryConsumerChainStopProposalsResponse { message Chain { string chain_id = 1; string client_id = 2; - // If the `chainID` is an Opt-In chain, i.e., no validator is forced to validate chain `chainID` - bool opt_In = 3; // If chain with `chainID` is a Top-N chain, i.e., enforces at least one validator to validate chain `chainID` - uint32 top_N = 4; + uint32 top_N = 3; } message QueryValidatorConsumerAddrRequest { diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index cfb571ef6c..080bf481c1 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -252,12 +252,11 @@ func (k Keeper) GetAllConsumerChains(ctx sdk.Context) (chains []types.Chain) { // Get the consumer TopN value by checking // if the chain is a TopN chain, // otherwise it's a OptIn chain - topN, isTopN := k.GetTopN(ctx, chainID) + topN, _ := k.GetTopN(ctx, chainID) chains = append(chains, types.Chain{ ChainId: chainID, ClientId: clientID, - Opt_In: !isTopN || topN == 0, Top_N: topN, }) } diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 9f56f51f87..c2cbc386de 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -404,7 +404,7 @@ func TestGetAllConsumerChains(t *testing.T) { topN := uint32(i) pk.SetConsumerClientId(ctx, chainID, clientID) pk.SetTopN(ctx, chainID, topN) - expectedGetAllOrder = append(expectedGetAllOrder, types.Chain{ChainId: chainID, ClientId: clientID, Opt_In: topN == 0, Top_N: topN}) + expectedGetAllOrder = append(expectedGetAllOrder, types.Chain{ChainId: chainID, ClientId: clientID, Top_N: topN}) } // sorting by chainID sort.Slice(expectedGetAllOrder, func(i, j int) bool { diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index e71b504a41..6ad8667003 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -376,10 +376,8 @@ func (m *QueryConsumerChainStopProposalsResponse) GetProposals() *ConsumerRemova type Chain struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - // If the `chainID` is an Opt-In chain, i.e., no validator is forced to validate chain `chainID` - Opt_In bool `protobuf:"varint,3,opt,name=opt_In,json=optIn,proto3" json:"opt_In,omitempty"` // If chain with `chainID` is a Top-N chain, i.e., enforces at least one validator to validate chain `chainID` - Top_N uint32 `protobuf:"varint,4,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + Top_N uint32 `protobuf:"varint,3,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` } func (m *Chain) Reset() { *m = Chain{} } @@ -429,13 +427,6 @@ func (m *Chain) GetClientId() string { return "" } -func (m *Chain) GetOpt_In() bool { - if m != nil { - return m.Opt_In - } - return false -} - func (m *Chain) GetTop_N() uint32 { if m != nil { return m.Top_N @@ -1505,114 +1496,113 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1709 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x5b, 0x6f, 0xdb, 0xc8, - 0x15, 0x36, 0x7d, 0xab, 0x3d, 0xce, 0xad, 0x93, 0x4b, 0x1d, 0xda, 0x91, 0x1c, 0xa6, 0x4d, 0x9d, - 0x1b, 0x69, 0x2b, 0x0d, 0x72, 0x75, 0x1c, 0xcb, 0x4a, 0x1c, 0xc1, 0xb9, 0x28, 0x8c, 0x93, 0x02, - 0x6d, 0x51, 0x86, 0x26, 0xa7, 0x32, 0x61, 0x8a, 0x43, 0x73, 0xc6, 0x4a, 0x84, 0xa0, 0x40, 0xd3, - 0x87, 0x26, 0x6f, 0x4d, 0xd1, 0xf6, 0x3d, 0x40, 0xd1, 0x3f, 0x50, 0xf4, 0x47, 0xe4, 0x6d, 0xb3, - 0x9b, 0x97, 0xc5, 0x3e, 0x64, 0x17, 0xce, 0x3e, 0x2c, 0xf6, 0x69, 0xb1, 0xef, 0x0b, 0x2c, 0x38, - 0x1c, 0x52, 0xa2, 0x44, 0x4b, 0x94, 0xec, 0x7d, 0xb2, 0x39, 0x97, 0xef, 0x9c, 0xef, 0xcc, 0x39, - 0x67, 0xe6, 0x13, 0x50, 0x2c, 0x87, 0x22, 0xcf, 0x58, 0xd3, 0x2d, 0x47, 0x23, 0xc8, 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- 0x4f, 0xc1, 0xff, 0xf4, 0x83, 0x53, 0xa9, 0xc5, 0x0c, 0x7c, 0xd4, 0xeb, 0x0b, 0xb2, 0xad, 0x1e, - 0x13, 0x1f, 0xef, 0x36, 0xec, 0x4e, 0x1f, 0x2e, 0x44, 0x73, 0x91, 0x57, 0x0f, 0x13, 0xfc, 0x7b, - 0x3f, 0xf8, 0x65, 0x1a, 0x11, 0x04, 0x4b, 0x3b, 0x78, 0x7a, 0x24, 0x2a, 0x3b, 0xf1, 0xc1, 0x2e, - 0x22, 0x76, 0xdf, 0x0d, 0xeb, 0x61, 0x89, 0xa0, 0x34, 0x5f, 0x93, 0xe5, 0x7f, 0xfb, 0x76, 0x2b, - 0x23, 0xbc, 0xdb, 0xca, 0x08, 0x5f, 0x6d, 0x65, 0x84, 0xd7, 0x1f, 0x33, 0x7d, 0xef, 0x3e, 0x66, - 0xfa, 0x3e, 0xff, 0x98, 0xe9, 0xfb, 0xdd, 0x5c, 0xab, 0xd2, 0xab, 0x9b, 0x39, 0x17, 0x99, 0xa9, - 0xfe, 0x46, 0x79, 0xd6, 0x74, 0xe9, 0xfa, 0x22, 0x70, 0x75, 0x98, 0xfd, 0xf0, 0x78, 0xfe, 0xc7, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x02, 0x4d, 0x2b, 0x71, 0x1b, 0x00, 0x00, + // 1688 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x5d, 0x6f, 0xd4, 0x46, + 0x17, 0x8e, 0x93, 0x90, 0x37, 0x99, 0xf0, 0xf5, 0x0e, 0xbc, 0xbc, 0xc1, 0x09, 0xbb, 0x60, 0x5a, + 0x1a, 0xbe, 0xec, 0x64, 0x29, 0xe2, 0x33, 0x84, 0x6c, 0x16, 0xc2, 0x2a, 0x7c, 0x2c, 0x26, 0x50, + 0xa9, 0xad, 0x6a, 0x1c, 0x7b, 0x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, 0xeb, 0x3d, 0x67, 0xcd, 0xd4, 0x4a, 0x75, 0xce, 0xd3, 0x51, 0x6b, + 0xf2, 0xd5, 0x82, 0x5a, 0x83, 0xff, 0x56, 0xd4, 0xe2, 0x81, 0x44, 0xd4, 0x9a, 0x32, 0xc9, 0xa8, + 0x35, 0x64, 0x4d, 0x18, 0x07, 0x7b, 0x29, 0xe0, 0xd2, 0x8a, 0x83, 0x5d, 0xd7, 0x44, 0xb4, 0x17, + 0x04, 0x15, 0xfb, 0x03, 0xc7, 0x7a, 0x42, 0xc3, 0x2c, 0x73, 0x93, 0x05, 0xa3, 0xc4, 0x54, 0xc9, + 0x8a, 0x52, 0x41, 0x2e, 0x72, 0xa8, 0x87, 0x01, 0x19, 0xd0, 0xa1, 0x6b, 0xde, 0x08, 0xcc, 0x81, + 0xff, 0xd5, 0x2d, 0x50, 0x54, 0xd3, 0xc4, 0xf7, 0x55, 0x4b, 0x43, 0x94, 0xfb, 0x80, 0xbc, 0x2b, + 0x5a, 0x3a, 0x17, 0x4c, 0xc1, 0x0f, 0xc0, 0x98, 0x85, 0x1e, 0xb8, 0x8a, 0x83, 0x6c, 0x13, 0x59, + 0x06, 0x59, 0x51, 0x34, 0xd5, 0xd2, 0x3d, 0xb2, 0x88, 0x96, 0xdb, 0x68, 0x8e, 0x17, 0xfd, 0x7b, + 0x44, 0x0c, 0xee, 0x11, 0x71, 0x29, 0xb8, 0x47, 0xf2, 0xc3, 0x5e, 0x63, 0x7b, 0xfa, 0x4b, 0x96, + 0x93, 0xf7, 0x78, 0x28, 0x72, 0x00, 0x32, 0x1f, 0x60, 0x08, 0xc7, 0xc0, 0x11, 0x4a, 0x49, 0x46, + 0x65, 0x83, 0xb8, 0xc8, 0x41, 0x7a, 0x74, 0x64, 0xee, 0xab, 0x8e, 0x5e, 0x40, 0x16, 0xae, 0x84, + 0x67, 0xf6, 0x12, 0x38, 0x9a, 0x6a, 0x35, 0xcb, 0xc8, 0x1e, 0x30, 0xa4, 0xd3,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 0xea, 0x60, 0xbb, 0xea, 0x65, 0x0e, 0x7f, 0xba, 0x73, 0x43, + 0x16, 0xff, 0x14, 0x8d, 0xff, 0x08, 0x9c, 0x4c, 0xb1, 0xbb, 0x7e, 0x90, 0x8f, 0x83, 0x03, 0xdd, + 0x5a, 0xa8, 0x74, 0x72, 0xa0, 0x53, 0x69, 0xa7, 0x4e, 0x0e, 0x74, 0x3a, 0x0d, 0x25, 0xcc, 0x50, + 0xf2, 0xa7, 0xe0, 0xc9, 0xf6, 0xe4, 0xb1, 0x07, 0xa2, 0x18, 0x96, 0x12, 0xe9, 0x29, 0xf8, 0x75, + 0x3f, 0x38, 0x9c, 0x5a, 0xcc, 0xc0, 0xdb, 0xdd, 0xbe, 0x20, 0x5b, 0xea, 0x31, 0xfe, 0xce, 0x66, + 0xc3, 0xf6, 0xfa, 0x70, 0x21, 0x8a, 0x8d, 0x9c, 0x28, 0x4d, 0xf0, 0xb3, 0x7e, 0xf0, 0x46, 0x1a, + 0x11, 0x04, 0x4b, 0x3d, 0x3c, 0x3d, 0x12, 0x95, 0x1d, 0x7f, 0x73, 0x13, 0x11, 0x3b, 0xef, 0x86, + 0x51, 0x5a, 0x42, 0x28, 0xc5, 0xd3, 0x64, 0xf9, 0x77, 0x9e, 0xaf, 0x67, 0xb8, 0x17, 0xeb, 0x19, + 0xee, 0xd7, 0xf5, 0x0c, 0xf7, 0xf4, 0x75, 0xa6, 0xef, 0xc5, 0xeb, 0x4c, 0xdf, 0x4f, 0xaf, 0x33, + 0x7d, 0xef, 0xce, 0x34, 0x2b, 0xbd, 0xc8, 0xcd, 0xf1, 0xd0, 0x4d, 0xf5, 0x6d, 0xe9, 0x41, 0xc3, + 0xa5, 0xeb, 0x89, 0xc0, 0xe5, 0x21, 0xfa, 0xc3, 0xe3, 0x89, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0xc8, 0x14, 0xa5, 0x41, 0x5a, 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2475,16 +2465,6 @@ func (m *Chain) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.Top_N != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Top_N)) i-- - dAtA[i] = 0x20 - } - if m.Opt_In { - i-- - if m.Opt_In { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- dAtA[i] = 0x18 } if len(m.ClientId) > 0 { @@ -3335,9 +3315,6 @@ func (m *Chain) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if m.Opt_In { - n += 2 - } if m.Top_N != 0 { n += 1 + sovQuery(uint64(m.Top_N)) } @@ -4318,26 +4295,6 @@ func (m *Chain) Unmarshal(dAtA []byte) error { m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Opt_In", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Opt_In = bool(v != 0) - case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } From 10dbb53a52742119df43e79cf7748bf944601ed1 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 27 Mar 2024 14:02:55 +0100 Subject: [PATCH 30/36] include validators that opt-in during the next epochs --- x/ccv/provider/keeper/grpc_query.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 8e2c4b11dd..279faeb0fb 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -266,11 +266,13 @@ func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, ctx := sdk.UnwrapSDKContext(goCtx) - // get all the consumer chains for which the validator is opted-in + // get all the consumer chains for which the validator is already or will be + // opted-in starting from the next epoch consumersToValidate := []string{} for _, consumer := range k.GetAllConsumerChains(ctx) { chainID := consumer.ChainId - if k.IsConsumerValidator(ctx, chainID, types.NewProviderConsAddress(consAddr)) || k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) { + + if k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) { consumersToValidate = append(consumersToValidate, chainID) } } From d642e8a30f64596ce4686c00b926c29e6b3dc783 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 28 Mar 2024 09:44:24 +0100 Subject: [PATCH 31/36] update has-to-validate condition --- x/ccv/provider/keeper/grpc_query.go | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 279faeb0fb..a25b0d8a1a 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -249,7 +249,7 @@ func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req * }, nil } -// QueryConsumerChainsValidatorHasToValidate returns all consumer chains a given validator has to validate +// QueryConsumerChainsValidatorHasToValidate returns all consumer chains a given validator has to validate. func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, req *types.QueryConsumerChainsValidatorHasToValidateRequest) (*types.QueryConsumerChainsValidatorHasToValidateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") @@ -266,15 +266,31 @@ func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, ctx := sdk.UnwrapSDKContext(goCtx) - // get all the consumer chains for which the validator is already or will be - // opted-in starting from the next epoch + // get all the consumer chains for which the validator is either already + // opted-in, currently a consumer validator or if its voting power is within the TopN validators consumersToValidate := []string{} for _, consumer := range k.GetAllConsumerChains(ctx) { chainID := consumer.ChainId - - if k.IsOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) { - consumersToValidate = append(consumersToValidate, chainID) + provAddr := types.NewProviderConsAddress(consAddr) + if !k.IsOptedIn(ctx, chainID, provAddr) && !k.IsConsumerValidator(ctx, chainID, provAddr) { + // check that the validator voting power isn't in the TopN + if topN, found := k.GetTopN(ctx, chainID); found && topN > 0 { + val, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, consAddr) + if !found { + return nil, status.Error(codes.InvalidArgument, "invalid provider address") + } + power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) + minPowerToOptIn := k.ComputeMinPowerToOptIn(ctx, chainID, k.stakingKeeper.GetLastValidators(ctx), topN) + + // Check that the validator's voting power is smaller + // than the minimum to be automatically opt-in + if power < minPowerToOptIn { + continue + } + } } + + consumersToValidate = append(consumersToValidate, chainID) } return &types.QueryConsumerChainsValidatorHasToValidateResponse{ From f9e63f05d59412190af3691484727f9dad7eccd8 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 28 Mar 2024 10:24:41 +0100 Subject: [PATCH 32/36] fix tinny bug in the tests after merging feat/partial-security --- x/ccv/provider/keeper/proposal_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 60c7dd6ce0..b27ae443fd 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -1002,12 +1002,7 @@ func TestBeginBlockInit(t *testing.T) { } // opt in a sample validator so the chain's proposal can successfully execute - providerKeeper.SetOptedIn(ctx, pendingProps[5].ChainId, providertypes.OptedInValidator{ - ProviderAddr: []byte{1}, - BlockHeight: int64(2), - Power: int64(3), - PublicKey: []byte{4}, - }) + providerKeeper.SetOptedIn(ctx, pendingProps[5].ChainId, providertypes.ProviderConsAddress{[]byte{1}}) providerKeeper.BeginBlockInit(ctx) From 3ae30312088a177320e9cc9c478b325d490c2087 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 28 Mar 2024 10:31:43 +0100 Subject: [PATCH 33/36] update doc --- x/ccv/provider/keeper/grpc_query.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index a25b0d8a1a..db591cda4b 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -249,7 +249,8 @@ func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req * }, nil } -// QueryConsumerChainsValidatorHasToValidate returns all consumer chains a given validator has to validate. +// QueryConsumerChainsValidatorHasToValidate returns all consumer chains that the given validator has to validate now +// or in the next epoch if nothing change. func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, req *types.QueryConsumerChainsValidatorHasToValidateRequest) (*types.QueryConsumerChainsValidatorHasToValidateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") From ed402f8fadde7e027ea7e8ebcefe7747df19dfb4 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 28 Mar 2024 10:37:55 +0100 Subject: [PATCH 34/36] update cli description --- x/ccv/provider/client/cli/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index d7bf45740d..91cd48f94c 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -454,7 +454,7 @@ func CmdConsumerChainsValidatorHasToValidate() *cobra.Command { Use: "has-to-validate [provider-validator-address]", Short: "Query the consumer chains list a given validator has to validate", Long: strings.TrimSpace( - fmt.Sprintf(`Query the consumer chains list a given validator has to validate. + fmt.Sprintf(`the list of consumer chains that as a validator, you need to be running right now, is always a subset of this, so it seems like a very nice "safe bet". Example: $ %s has-to-validate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj `, version.AppName, bech32PrefixConsAddr), From c75594f70afadb8b70784b9fc69df0d1b8596abb Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 28 Mar 2024 14:25:10 +0100 Subject: [PATCH 35/36] Update x/ccv/provider/keeper/grpc_query.go Co-authored-by: insumity --- x/ccv/provider/keeper/grpc_query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index db591cda4b..c1961ca09d 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -250,7 +250,7 @@ func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req * } // QueryConsumerChainsValidatorHasToValidate returns all consumer chains that the given validator has to validate now -// or in the next epoch if nothing change. +// or in the next epoch if nothing changes. func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, req *types.QueryConsumerChainsValidatorHasToValidateRequest) (*types.QueryConsumerChainsValidatorHasToValidateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") From b1c1bebcb152beeb5da44a395e9dabddaebe358d Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 28 Mar 2024 14:29:01 +0100 Subject: [PATCH 36/36] changes --- x/ccv/provider/keeper/grpc_query.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index c1961ca09d..f18ec48bfb 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -283,8 +283,8 @@ func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, power := k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator()) minPowerToOptIn := k.ComputeMinPowerToOptIn(ctx, chainID, k.stakingKeeper.GetLastValidators(ctx), topN) - // Check that the validator's voting power is smaller - // than the minimum to be automatically opt-in + // Check if the validator's voting power is smaller + // than the minimum and hence not automatically opted in if power < minPowerToOptIn { continue }