From bd4b88a46ea4d7268d7b5cd769f20004791109c7 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 30 Jul 2024 12:37:28 +0300 Subject: [PATCH 01/41] (partially) renamed chain ids to consumer ids --- .../ccv/provider/v1/provider.proto | 8 +- .../ccv/provider/v1/query.proto | 22 +- .../ccv/provider/v1/tx.proto | 28 +- tests/integration/setup.go | 2 +- x/ccv/provider/client/cli/query.go | 14 +- .../provider/keeper/consumer_equivocation.go | 42 +- x/ccv/provider/keeper/distribution.go | 2 +- x/ccv/provider/keeper/grpc_query.go | 50 +-- x/ccv/provider/keeper/key_assignment.go | 134 +++---- x/ccv/provider/keeper/legacy_proposal.go | 32 +- x/ccv/provider/keeper/msg_server.go | 12 +- x/ccv/provider/keeper/partial_set_security.go | 6 +- x/ccv/provider/keeper/proposal.go | 14 +- x/ccv/provider/types/errors.go | 5 +- x/ccv/provider/types/events.go | 2 +- x/ccv/provider/types/legacy_proposal.go | 8 +- x/ccv/provider/types/msg.go | 76 ++-- x/ccv/provider/types/msg_test.go | 21 + x/ccv/provider/types/provider.pb.go | 287 +++++++------- x/ccv/provider/types/query.pb.go | 368 +++++++++--------- x/ccv/provider/types/query.pb.gw.go | 116 +++--- x/ccv/provider/types/tx.pb.go | 338 ++++++++-------- 22 files changed, 821 insertions(+), 766 deletions(-) create mode 100644 x/ccv/provider/types/msg_test.go diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 7e1836cf38..e79d031f08 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -124,8 +124,8 @@ message ConsumerRemovalProposal { string title = 1; // the description of the proposal string description = 2; - // the chain-id of the consumer chain to be stopped - string chain_id = 3; + // the consumer id of the consumer chain to be stopped + string consumer_id = 3; // the time on the provider chain at which all validators are responsible to // stop their consumer chain validator node google.protobuf.Timestamp stop_time = 4 @@ -139,8 +139,8 @@ message ConsumerModificationProposal { string title = 1; // the description of the proposal string description = 2; - // the chain-id of the consumer chain to be modified - string chain_id = 3; + // the consumer id of the consumer chain to be modified + string consumer_id = 3; // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 9a8fbf7f42..0996d2a858 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -18,7 +18,7 @@ service Query { rpc QueryConsumerGenesis(QueryConsumerGenesisRequest) returns (QueryConsumerGenesisResponse) { option (google.api.http).get = - "/interchain_security/ccv/provider/consumer_genesis/{chain_id}"; + "/interchain_security/ccv/provider/consumer_genesis/{consumer_id}"; } // ConsumerChains queries active consumer chains supported by the provider @@ -91,7 +91,7 @@ service Query { QueryAllPairsValConAddrByConsumerChainIDRequest) returns (QueryAllPairsValConAddrByConsumerChainIDResponse) { option (google.api.http).get = - "/interchain_security/ccv/provider/consumer_chain_id"; + "/interchain_security/ccv/provider/{consumer_id}"; } // QueryParams returns all current values of provider parameters @@ -107,7 +107,7 @@ service Query { QueryConsumerChainOptedInValidatorsRequest) returns (QueryConsumerChainOptedInValidatorsResponse) { option (google.api.http).get = - "/interchain_security/ccv/provider/opted_in_validators/{chain_id}"; + "/interchain_security/ccv/provider/opted_in_validators/{consumer_id}"; } // QueryConsumerChainsValidatorHasToValidate returns a list of consumer chains @@ -125,7 +125,7 @@ service Query { QueryValidatorConsumerCommissionRateRequest) returns (QueryValidatorConsumerCommissionRateResponse) { option (google.api.http).get = - "/interchain_security/ccv/provider/consumer_commission_rate/{chain_id}/{provider_address}"; + "/interchain_security/ccv/provider/consumer_commission_rate/{consumer_id}/{provider_address}"; } // QueryConsumerValidators returns the latest set consumer-validator set for a given chainID @@ -134,7 +134,7 @@ service Query { rpc QueryConsumerValidators(QueryConsumerValidatorsRequest) returns (QueryConsumerValidatorsResponse) { option (google.api.http).get = - "/interchain_security/ccv/provider/consumer_validators/{chain_id}"; + "/interchain_security/ccv/provider/consumer_validators/{consumer_id}"; } // QueryBlocksUntilNextEpoch returns the number of blocks until the next epoch @@ -146,7 +146,7 @@ service Query { } } -message QueryConsumerGenesisRequest { string chain_id = 1; } +message QueryConsumerGenesisRequest { string consumer_id = 1; } message QueryConsumerGenesisResponse { interchain_security.ccv.v1.ConsumerGenesisState genesis_state = 1 @@ -193,7 +193,7 @@ message QueryValidatorConsumerAddrRequest { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; // The id of the consumer chain - string chain_id = 1; + string consumer_id = 1; // The consensus address of the validator on the provider chain string provider_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; } @@ -251,7 +251,7 @@ message ProposedChain { message QueryAllPairsValConAddrByConsumerChainIDRequest { // The id of the consumer chain - string chain_id = 1; + string consumer_id = 1; } message QueryAllPairsValConAddrByConsumerChainIDResponse { @@ -273,7 +273,7 @@ message QueryParamsResponse { } message QueryConsumerChainOptedInValidatorsRequest { - string chain_id = 1; + string consumer_id = 1; } message QueryConsumerChainOptedInValidatorsResponse { @@ -282,7 +282,7 @@ message QueryConsumerChainOptedInValidatorsResponse { } message QueryConsumerValidatorsRequest { - string chain_id = 1; + string consumer_id = 1; } message QueryConsumerValidatorsValidator { @@ -313,7 +313,7 @@ message QueryConsumerChainsValidatorHasToValidateResponse { } message QueryValidatorConsumerCommissionRateRequest { - string chain_id = 1; + string consumer_id = 1; // The consensus address of the validator on the provider chain string provider_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; } diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index b0f3fc58c2..c1228ba66c 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -39,8 +39,8 @@ message MsgAssignConsumerKey { option (gogoproto.goproto_getters) = false; - // The chain id of the consumer chain to assign a consensus public key to - string chain_id = 1; + // The consumer id of the consumer chain to assign a consensus public key to + string consumer_id = 1; // The validator address on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // The consensus public key to use on the consumer. @@ -202,8 +202,8 @@ message MsgConsumerAdditionResponse {} message MsgConsumerRemoval { option (cosmos.msg.v1.signer) = "authority"; - // the chain-id of the consumer chain to be stopped - string chain_id = 1; + // the consumer id of the consumer chain to be stopped + string consumer_id = 1; // the time on the provider chain at which all validators are responsible to // stop their consumer chain validator node google.protobuf.Timestamp stop_time = 2 @@ -238,8 +238,8 @@ message MsgOptIn { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "signer"; - // the chain id of the consumer chain to opt in to - string chain_id = 1; + // the consumer id of the consumer chain to opt in to + string consumer_id = 1; // the validator address on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // (optional) The consensus public key to use on the consumer in json string format corresponding to proto-any, @@ -258,8 +258,8 @@ message MsgOptOut { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "signer"; - // the chain id of the consumer chain to opt out from - string chain_id = 1; + // the consumer id of the consumer chain to opt out from + string consumer_id = 1; // the validator address on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // signer address @@ -276,10 +276,10 @@ message MsgSetConsumerCommissionRate { option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "signer"; - // The validator address on the provider - string provider_addr = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - // The chain id of the consumer chain to set a commission rate - string chain_id = 2; + // The validator address on the provider + string provider_addr = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + // The consumer id of the consumer chain to set a commission rate + string consumer_id = 2; // The rate to charge delegators on the consumer chain, as a fraction // TODO: migrate rate from sdk.Dec to math.LegacyDec string rate = 3 [ @@ -306,8 +306,8 @@ message MsgConsumerModification { string title = 1; // the description of the proposal string description = 2; - // the chain-id of the consumer chain to be modified - string chain_id = 3; + // the consumer id of the consumer chain to be modified + string consumer_id = 3; // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. diff --git a/tests/integration/setup.go b/tests/integration/setup.go index eeb980200f..c9b625cd0d 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -156,7 +156,7 @@ func (suite *CCVTestSuite) SetupTest() { preProposalKeyAssignment(suite, icstestingutils.FirstConsumerChainID) // remove props so they don't interfere with the rest of the setup - // if not removed here, setupConsumerCallback will have 2 proposals for adding the first consumer chain + c // if not removed here, setupConsumerCallback will have 2 proposals for adding the first consumer chain providerKeeper.DeletePendingConsumerAdditionProps(suite.providerCtx(), ps...) // start consumer chains diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index 84fbff3fd0..d344e5efce 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -57,7 +57,7 @@ func CmdConsumerGenesis() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - req := types.QueryConsumerGenesisRequest{ChainId: args[0]} + req := types.QueryConsumerGenesisRequest{ConsumerId: args[0]} res, err := queryClient.QueryConsumerGenesis(cmd.Context(), &req) if err != nil { return err @@ -211,7 +211,7 @@ $ %s query provider validator-consumer-key foochain %s1gghjut3ccd8ay0zduzj64hwre } queryClient := types.NewQueryClient(clientCtx) - consumerChainID := args[0] + consumerId := args[0] addr, err := sdk.ConsAddressFromBech32(args[1]) if err != nil { @@ -219,7 +219,7 @@ $ %s query provider validator-consumer-key foochain %s1gghjut3ccd8ay0zduzj64hwre } req := &types.QueryValidatorConsumerAddrRequest{ - ChainId: consumerChainID, + ConsumerId: consumerId, ProviderAddress: addr.String(), } res, err := queryClient.QueryValidatorConsumerAddr(cmd.Context(), req) @@ -366,7 +366,7 @@ func CmdAllPairsValConAddrByConsumerChainID() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - req := types.QueryAllPairsValConAddrByConsumerChainIDRequest{ChainId: args[0]} + req := types.QueryAllPairsValConAddrByConsumerChainIDRequest{ConsumerId: args[0]} res, err := queryClient.QueryAllPairsValConAddrByConsumerChainID(cmd.Context(), &req) if err != nil { return err @@ -435,7 +435,7 @@ $ %s consumer-opted-in-validators foochain queryClient := types.NewQueryClient(clientCtx) res, err := queryClient.QueryConsumerChainOptedInValidators(cmd.Context(), - &types.QueryConsumerChainOptedInValidatorsRequest{ChainId: args[0]}) + &types.QueryConsumerChainOptedInValidatorsRequest{ConsumerId: args[0]}) if err != nil { return err } @@ -470,7 +470,7 @@ $ %s consumer-validators foochain queryClient := types.NewQueryClient(clientCtx) res, err := queryClient.QueryConsumerValidators(cmd.Context(), - &types.QueryConsumerValidatorsRequest{ChainId: args[0]}) + &types.QueryConsumerValidatorsRequest{ConsumerId: args[0]}) if err != nil { return err } @@ -554,7 +554,7 @@ $ %s validator-consumer-commission-rate foochain %s1gghjut3ccd8ay0zduzj64hwre2fx res, err := queryClient.QueryValidatorConsumerCommissionRate(cmd.Context(), &types.QueryValidatorConsumerCommissionRateRequest{ - ChainId: args[0], + ConsumerId: args[0], ProviderAddress: addr.String(), }) if err != nil { diff --git a/x/ccv/provider/keeper/consumer_equivocation.go b/x/ccv/provider/keeper/consumer_equivocation.go index 8f4f59732a..3762cbf072 100644 --- a/x/ccv/provider/keeper/consumer_equivocation.go +++ b/x/ccv/provider/keeper/consumer_equivocation.go @@ -28,44 +28,44 @@ import ( // Double Voting section // -// HandleConsumerDoubleVoting verifies a double voting evidence for a given a consumer chain ID +// HandleConsumerDoubleVoting verifies a double voting evidence for a given a consumer id // and a public key and, if successful, executes the slashing, jailing, and tombstoning of the malicious validator. func (k Keeper) HandleConsumerDoubleVoting( ctx sdk.Context, evidence *tmtypes.DuplicateVoteEvidence, - chainID string, + consumerId string, pubkey cryptotypes.PubKey, ) error { // check that the evidence is for an ICS consumer chain - if _, found := k.GetConsumerClientId(ctx, chainID); !found { + if _, found := k.GetConsumerClientId(ctx, consumerId); !found { return errorsmod.Wrapf( ccvtypes.ErrInvalidDoubleVotingEvidence, "cannot find consumer chain %s", - chainID, + consumerId, ) } // check that the evidence is not too old - minHeight := k.GetEquivocationEvidenceMinHeight(ctx, chainID) + minHeight := k.GetEquivocationEvidenceMinHeight(ctx, consumerId) if uint64(evidence.VoteA.Height) < minHeight { return errorsmod.Wrapf( ccvtypes.ErrInvalidDoubleVotingEvidence, "evidence for consumer chain %s is too old - evidence height (%d), min (%d)", - chainID, + consumerId, evidence.VoteA.Height, minHeight, ) } // verifies the double voting evidence using the consumer chain public key - if err := k.VerifyDoubleVotingEvidence(*evidence, chainID, pubkey); err != nil { + if err := k.VerifyDoubleVotingEvidence(*evidence, consumerId, pubkey); err != nil { return err } // get the validator's consensus address on the provider providerAddr := k.GetProviderAddrFromConsumerAddr( ctx, - chainID, + consumerId, types.NewConsumerConsAddress(sdk.ConsAddress(evidence.VoteA.ValidatorAddress.Bytes())), ) @@ -85,10 +85,10 @@ func (k Keeper) HandleConsumerDoubleVoting( } // VerifyDoubleVotingEvidence verifies a double voting evidence -// for a given chain id and a validator public key +// for a given consumer id and a validator public key func (k Keeper) VerifyDoubleVotingEvidence( evidence tmtypes.DuplicateVoteEvidence, - chainID string, + consumerId string, pubkey cryptotypes.PubKey, ) error { if pubkey == nil { @@ -140,10 +140,10 @@ func (k Keeper) VerifyDoubleVotingEvidence( vb := evidence.VoteB.ToProto() // signatures must be valid - if !pubkey.VerifySignature(tmtypes.VoteSignBytes(chainID, va), evidence.VoteA.Signature) { + if !pubkey.VerifySignature(tmtypes.VoteSignBytes(consumerId, va), evidence.VoteA.Signature) { return fmt.Errorf("verifying VoteA: %w", tmtypes.ErrVoteInvalidSignature) } - if !pubkey.VerifySignature(tmtypes.VoteSignBytes(chainID, vb), evidence.VoteB.Signature) { + if !pubkey.VerifySignature(tmtypes.VoteSignBytes(consumerId, vb), evidence.VoteB.Signature) { return fmt.Errorf("verifying VoteB: %w", tmtypes.ErrVoteInvalidSignature) } @@ -517,20 +517,20 @@ func (k Keeper) SlashValidator(ctx sdk.Context, providerAddr types.ProviderConsA // // SetEquivocationEvidenceMinHeight sets the minimum height -// of a valid consumer equivocation evidence for a given consumer chain ID -func (k Keeper) SetEquivocationEvidenceMinHeight(ctx sdk.Context, chainID string, height uint64) { +// of a valid consumer equivocation evidence for a given consumer id +func (k Keeper) SetEquivocationEvidenceMinHeight(ctx sdk.Context, consumerId string, height uint64) { store := ctx.KVStore(k.storeKey) heightBytes := make([]byte, 8) binary.BigEndian.PutUint64(heightBytes, height) - store.Set(types.EquivocationEvidenceMinHeightKey(chainID), heightBytes) + store.Set(types.EquivocationEvidenceMinHeightKey(consumerId), heightBytes) } // GetEquivocationEvidenceMinHeight returns the minimum height -// of a valid consumer equivocation evidence for a given consumer chain ID -func (k Keeper) GetEquivocationEvidenceMinHeight(ctx sdk.Context, chainID string) uint64 { +// of a valid consumer equivocation evidence for a given consumer id +func (k Keeper) GetEquivocationEvidenceMinHeight(ctx sdk.Context, consumerId string) uint64 { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.EquivocationEvidenceMinHeightKey(chainID)) + bz := store.Get(types.EquivocationEvidenceMinHeightKey(consumerId)) if bz == nil { return 0 } @@ -539,8 +539,8 @@ func (k Keeper) GetEquivocationEvidenceMinHeight(ctx sdk.Context, chainID string } // DeleteEquivocationEvidenceMinHeight deletes the minimum height -// of a valid consumer equivocation evidence for a given consumer chain ID -func (k Keeper) DeleteEquivocationEvidenceMinHeight(ctx sdk.Context, chainID string) { +// of a valid consumer equivocation evidence for a given consumer id +func (k Keeper) DeleteEquivocationEvidenceMinHeight(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.EquivocationEvidenceMinHeightKey(chainID)) + store.Delete(types.EquivocationEvidenceMinHeightKey(consumerId)) } diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index 7970a8c682..51316d7f5b 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -335,7 +335,7 @@ func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, // check that the consumer chain exists if !k.IsConsumerProposedOrRegistered(ctx, chainID) { return errorsmod.Wrapf( - types.ErrUnknownConsumerChainId, + types.ErrUnknownConsumerId, "unknown consumer chain, with id: %s", chainID) } diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 415a181096..877fa6a62e 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -25,15 +25,15 @@ func (k Keeper) QueryConsumerGenesis(c context.Context, req *types.QueryConsumer return nil, status.Errorf(codes.InvalidArgument, "empty request") } - if req.ChainId == "" { - return nil, status.Errorf(codes.InvalidArgument, "invalid request: chain id cannot be empty") + if req.ConsumerId == "" { + return nil, status.Errorf(codes.InvalidArgument, "invalid request: consumer id cannot be empty") } - gen, ok := k.GetConsumerGenesis(ctx, req.ChainId) + gen, ok := k.GetConsumerGenesis(ctx, req.ConsumerId) if !ok { return nil, status.Error( codes.NotFound, - errorsmod.Wrap(types.ErrUnknownConsumerChainId, req.ChainId).Error(), + errorsmod.Wrap(types.ErrUnknownConsumerId, req.ConsumerId).Error(), ) } @@ -153,7 +153,7 @@ func (k Keeper) QueryValidatorConsumerAddr(goCtx context.Context, req *types.Que } providerAddr := types.NewProviderConsAddress(providerAddrTmp) - consumerKey, found := k.GetValidatorConsumerPubKey(ctx, req.ChainId, providerAddr) + consumerKey, found := k.GetValidatorConsumerPubKey(ctx, req.ConsumerId, providerAddr) if !found { return &types.QueryValidatorConsumerAddrResponse{}, nil } @@ -242,15 +242,15 @@ func (k Keeper) QueryAllPairsValConAddrByConsumerChainID(goCtx context.Context, return nil, status.Error(codes.InvalidArgument, "empty request") } - if req.ChainId == "" { - return nil, status.Error(codes.InvalidArgument, "empty chainId") + if req.ConsumerId == "" { + return nil, status.Errorf(codes.InvalidArgument, "invalid request: consumer id cannot be empty") } // list of pairs valconsensus addr pairValConAddrs := []*types.PairValConAddrProviderAndConsumer{} ctx := sdk.UnwrapSDKContext(goCtx) - validatorConsumerPubKeys := k.GetAllValidatorConsumerPubKeys(ctx, &req.ChainId) + validatorConsumerPubKeys := k.GetAllValidatorConsumerPubKeys(ctx, &req.ConsumerId) for _, data := range validatorConsumerPubKeys { consumerAddr, err := ccvtypes.TMCryptoPublicKeyToConsAddr(*data.ConsumerKey) if err != nil { @@ -286,19 +286,19 @@ func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req * return nil, status.Error(codes.InvalidArgument, "empty request") } - consumerChainID := req.ChainId - if consumerChainID == "" { - return nil, status.Error(codes.InvalidArgument, "empty chainId") + consumerId := req.ConsumerId + if consumerId == "" { + return nil, status.Error(codes.InvalidArgument, "empty consumer id") } optedInVals := []string{} ctx := sdk.UnwrapSDKContext(goCtx) - if !k.IsConsumerProposedOrRegistered(ctx, consumerChainID) { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unknown consumer chain: %s", consumerChainID)) + if !k.IsConsumerProposedOrRegistered(ctx, consumerId) { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unknown consumer chain: %s", consumerId)) } - for _, v := range k.GetAllOptedIn(ctx, consumerChainID) { + for _, v := range k.GetAllOptedIn(ctx, consumerId) { optedInVals = append(optedInVals, v.ToSdkConsAddr().String()) } @@ -313,21 +313,21 @@ func (k Keeper) QueryConsumerValidators(goCtx context.Context, req *types.QueryC return nil, status.Error(codes.InvalidArgument, "empty request") } - consumerChainID := req.ChainId - if consumerChainID == "" { - return nil, status.Error(codes.InvalidArgument, "empty chainId") + consumerId := req.ConsumerId + if consumerId == "" { + return nil, status.Error(codes.InvalidArgument, "empty consumer id") } ctx := sdk.UnwrapSDKContext(goCtx) - if _, found := k.GetConsumerClientId(ctx, consumerChainID); !found { + if _, found := k.GetConsumerClientId(ctx, consumerId); !found { // chain has to have started; consumer client id is set for a chain during the chain's spawn time - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("no started consumer chain: %s", consumerChainID)) + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("no started consumer chain: %s", consumerId)) } var validators []*types.QueryConsumerValidatorsValidator - consumerValSet, err := k.GetConsumerValSet(ctx, consumerChainID) + consumerValSet, err := k.GetConsumerValSet(ctx, consumerId) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -449,8 +449,8 @@ func (k Keeper) QueryValidatorConsumerCommissionRate(goCtx context.Context, req return nil, status.Error(codes.InvalidArgument, "empty request") } - consumerChainID := req.ChainId - if consumerChainID == "" { + consumerId := req.ConsumerId + if consumerId == "" { return nil, status.Error(codes.InvalidArgument, "empty chainId") } @@ -461,15 +461,15 @@ func (k Keeper) QueryValidatorConsumerCommissionRate(goCtx context.Context, req ctx := sdk.UnwrapSDKContext(goCtx) - if !k.IsConsumerProposedOrRegistered(ctx, consumerChainID) { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unknown consumer chain: %s", consumerChainID)) + if !k.IsConsumerProposedOrRegistered(ctx, consumerId) { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unknown consumer chain: %s", consumerId)) } 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)) + consumerRate, found := k.GetConsumerCommissionRate(ctx, consumerId, types.NewProviderConsAddress(consAddr)) if found { res.Rate = consumerRate } else { diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index 23dd20109d..755e4d247b 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -67,11 +67,11 @@ func (k Keeper) ParseConsumerKey(consumerKey string) (tmprotocrypto.PublicKey, e // GetValidatorConsumerPubKey returns a validator's public key assigned for a consumer chain func (k Keeper) GetValidatorConsumerPubKey( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) (consumerKey tmprotocrypto.PublicKey, found bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerValidatorsKey(chainID, providerAddr)) + bz := store.Get(types.ConsumerValidatorsKey(consumerId, providerAddr)) if bz == nil { return consumerKey, false } @@ -87,7 +87,7 @@ func (k Keeper) GetValidatorConsumerPubKey( // SetValidatorConsumerPubKey sets a validator's public key assigned for a consumer chain func (k Keeper) SetValidatorConsumerPubKey( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, consumerKey tmprotocrypto.PublicKey, ) { @@ -98,33 +98,33 @@ func (k Keeper) SetValidatorConsumerPubKey( // the consumer key is obtained from GetValidatorConsumerPubKey, called from panic(fmt.Sprintf("failed to marshal consumer key: %v", err)) } - store.Set(types.ConsumerValidatorsKey(chainID, providerAddr), bz) + store.Set(types.ConsumerValidatorsKey(consumerId, providerAddr), bz) } // GetAllValidatorConsumerPubKeys gets all the validators public keys assigned for a consumer chain -// If chainID is nil, it returns all the validators public keys assigned for all consumer chains +// If consumerId is nil, it returns all the validators public keys assigned for all consumer chains // // Note that the validators public keys assigned for a consumer chain are stored under keys // with the following format: ConsumerValidatorsBytePrefix | len(chainID) | chainID | providerAddress // Thus, the returned array is -// - in ascending order of providerAddresses, if chainID is not nil; -// - in undetermined order, if chainID is nil. -func (k Keeper) GetAllValidatorConsumerPubKeys(ctx sdk.Context, chainID *string) (validatorConsumerPubKeys []types.ValidatorConsumerPubKey) { +// - in ascending order of providerAddresses, if consumerId is not nil; +// - in undetermined order, if consumerId is nil. +func (k Keeper) GetAllValidatorConsumerPubKeys(ctx sdk.Context, consumerId *string) (validatorConsumerPubKeys []types.ValidatorConsumerPubKey) { store := ctx.KVStore(k.storeKey) var prefix []byte consumerValidatorsKeyPrefix := types.ConsumerValidatorsKeyPrefix() - if chainID == nil { + if consumerId == nil { // iterate over the validators public keys assigned for all consumer chains prefix = []byte{consumerValidatorsKeyPrefix} } else { - // iterate over the validators public keys assigned for chainID - prefix = types.ChainIdWithLenKey(consumerValidatorsKeyPrefix, *chainID) + // iterate over the validators public keys assigned for consumerId + prefix = types.ChainIdWithLenKey(consumerValidatorsKeyPrefix, *consumerId) } iterator := storetypes.KVStorePrefixIterator(store, prefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - // TODO: store chainID and provider cons address in value bytes, marshaled as protobuf type - chainID, providerAddrTmp, err := types.ParseChainIdAndConsAddrKey(consumerValidatorsKeyPrefix, iterator.Key()) + // TODO: store consumerId and provider cons address in value bytes, marshaled as protobuf type + consumerId, providerAddrTmp, err := types.ParseChainIdAndConsAddrKey(consumerValidatorsKeyPrefix, iterator.Key()) if err != nil { // An error here would indicate something is very wrong, // the store key is assumed to be correctly serialized in SetValidatorConsumerPubKey. @@ -140,7 +140,7 @@ func (k Keeper) GetAllValidatorConsumerPubKeys(ctx sdk.Context, chainID *string) } validatorConsumerPubKeys = append(validatorConsumerPubKeys, types.ValidatorConsumerPubKey{ - ChainId: chainID, + ChainId: consumerId, ProviderAddr: providerAddr.ToSdkConsAddr(), ConsumerKey: &consumerKey, }) @@ -150,20 +150,20 @@ func (k Keeper) GetAllValidatorConsumerPubKeys(ctx sdk.Context, chainID *string) } // DeleteValidatorConsumerPubKey deletes a validator's public key assigned for a consumer chain -func (k Keeper) DeleteValidatorConsumerPubKey(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress) { +func (k Keeper) DeleteValidatorConsumerPubKey(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerValidatorsKey(chainID, providerAddr)) + store.Delete(types.ConsumerValidatorsKey(consumerId, providerAddr)) } // GetValidatorByConsumerAddr returns a validator's consensus address on the provider // given the validator's consensus address on a consumer func (k Keeper) GetValidatorByConsumerAddr( ctx sdk.Context, - chainID string, + consumerId string, consumerAddr types.ConsumerConsAddress, ) (providerAddr types.ProviderConsAddress, found bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ValidatorsByConsumerAddrKey(chainID, consumerAddr)) + bz := store.Get(types.ValidatorsByConsumerAddrKey(consumerId, consumerAddr)) if bz == nil { return providerAddr, false } @@ -175,45 +175,45 @@ func (k Keeper) GetValidatorByConsumerAddr( // to the validator's consensus address on the provider func (k Keeper) SetValidatorByConsumerAddr( ctx sdk.Context, - chainID string, + consumerId string, consumerAddr types.ConsumerConsAddress, providerAddr types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) // Cons address is a type alias for a byte string, no marshaling needed bz := providerAddr.ToSdkConsAddr() - store.Set(types.ValidatorsByConsumerAddrKey(chainID, consumerAddr), bz) + store.Set(types.ValidatorsByConsumerAddrKey(consumerId, consumerAddr), bz) } // GetValidatorsByConsumerAddrs gets all the mappings from consensus addresses // on a given consumer chain to consensus addresses on the provider chain. -// If chainID is nil, it returns all the mappings from consensus addresses on all consumer chains. +// If consumerId is nil, it returns all the mappings from consensus addresses on all consumer chains. // // Note that the mappings for a consumer chain are stored under keys with the following format: -// ValidatorsByConsumerAddrKeyPrefix | len(chainID) | chainID | consumerAddress +// ValidatorsByConsumerAddrKeyPrefix | len(consumerId) | consumerId | consumerAddress // Thus, the returned array is -// - in ascending order of consumerAddresses, if chainID is not nil; -// - in undetermined order, if chainID is nil. -func (k Keeper) GetAllValidatorsByConsumerAddr(ctx sdk.Context, chainID *string) (validatorConsumerAddrs []types.ValidatorByConsumerAddr) { +// - in ascending order of consumerAddresses, if consumerId is not nil; +// - in undetermined order, if consumerId is nil. +func (k Keeper) GetAllValidatorsByConsumerAddr(ctx sdk.Context, consumerId *string) (validatorConsumerAddrs []types.ValidatorByConsumerAddr) { store := ctx.KVStore(k.storeKey) var prefix []byte validatorsByConsumerAddrKeyPrefix := types.ValidatorsByConsumerAddrKeyPrefix() - if chainID == nil { + if consumerId == nil { // iterate over the mappings from consensus addresses on all consumer chains prefix = []byte{validatorsByConsumerAddrKeyPrefix} } else { - // iterate over the mappings from consensus addresses on chainID - prefix = types.ChainIdWithLenKey(validatorsByConsumerAddrKeyPrefix, *chainID) + // iterate over the mappings from consensus addresses on consumerId + prefix = types.ChainIdWithLenKey(validatorsByConsumerAddrKeyPrefix, *consumerId) } iterator := storetypes.KVStorePrefixIterator(store, prefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - // TODO: store chainID and consumer cons address in value bytes, marshaled as protobuf type - chainID, consumerAddrTmp, err := types.ParseChainIdAndConsAddrKey(validatorsByConsumerAddrKeyPrefix, iterator.Key()) + // TODO: store consumerId and consumer cons address in value bytes, marshaled as protobuf type + consumerId, consumerAddrTmp, err := types.ParseChainIdAndConsAddrKey(validatorsByConsumerAddrKeyPrefix, iterator.Key()) if err != nil { // An error here would indicate something is very wrong, // store keys are assumed to be correctly serialized in SetValidatorByConsumerAddr. - panic(fmt.Sprintf("failed to parse chainID and consumer address: %v", err)) + panic(fmt.Sprintf("failed to parse consumerId and consumer address: %v", err)) } consumerAddr := types.NewConsumerConsAddress(consumerAddrTmp) providerAddr := types.NewProviderConsAddress(iterator.Value()) @@ -221,7 +221,7 @@ func (k Keeper) GetAllValidatorsByConsumerAddr(ctx sdk.Context, chainID *string) validatorConsumerAddrs = append(validatorConsumerAddrs, types.ValidatorByConsumerAddr{ ConsumerAddr: consumerAddr.ToSdkConsAddr(), ProviderAddr: providerAddr.ToSdkConsAddr(), - ChainId: chainID, + ChainId: consumerId, }) } @@ -230,9 +230,9 @@ func (k Keeper) GetAllValidatorsByConsumerAddr(ctx sdk.Context, chainID *string) // DeleteValidatorByConsumerAddr deletes the mapping from a validator's consensus address on a consumer // to the validator's consensus address on the provider -func (k Keeper) DeleteValidatorByConsumerAddr(ctx sdk.Context, chainID string, consumerAddr types.ConsumerConsAddress) { +func (k Keeper) DeleteValidatorByConsumerAddr(ctx sdk.Context, consumerId string, consumerAddr types.ConsumerConsAddress) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ValidatorsByConsumerAddrKey(chainID, consumerAddr)) + store.Delete(types.ValidatorsByConsumerAddrKey(consumerId, consumerAddr)) } // AppendConsumerAddrsToPrune appends a consumer validator address to the list of consumer addresses @@ -355,12 +355,12 @@ func (k Keeper) ConsumeConsumerAddrsToPrune( // GetAllConsumerAddrsToPrune gets all consumer addresses that can be eventually pruned for a given chainID. // // Note that the list of all consumer addresses is stored under keys with the following format: -// ConsumerAddrsToPruneV2BytePrefix | len(chainID) | chainID | timestamp +// ConsumerAddrsToPruneV2BytePrefix | len(consumerId) | consumerId | timestamp // Thus, the returned array is in ascending order of timestamps. -func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, chainID string) (consumerAddrsToPrune []types.ConsumerAddrsToPruneV2) { +func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, consumerId string) (consumerAddrsToPrune []types.ConsumerAddrsToPruneV2) { store := ctx.KVStore(k.storeKey) consumerAddrsToPruneKeyPrefix := types.ConsumerAddrsToPruneV2KeyPrefix() - iteratorPrefix := types.ChainIdWithLenKey(consumerAddrsToPruneKeyPrefix, chainID) + iteratorPrefix := types.ChainIdWithLenKey(consumerAddrsToPruneKeyPrefix, consumerId) iterator := storetypes.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -381,7 +381,7 @@ func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, chainID string) (con consumerAddrsToPrune = append(consumerAddrsToPrune, types.ConsumerAddrsToPruneV2{ PruneTs: ts, ConsumerAddrs: &addrs, - ChainId: chainID, + ChainId: consumerId, }) } @@ -389,25 +389,25 @@ func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, chainID string) (con } // DeleteConsumerAddrsToPruneV2 deletes the list of consumer addresses mapped to a timestamp -func (k Keeper) DeleteConsumerAddrsToPrune(ctx sdk.Context, chainID string, pruneTs time.Time) { +func (k Keeper) DeleteConsumerAddrsToPrune(ctx sdk.Context, consumerId string, pruneTs time.Time) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerAddrsToPruneV2Key(chainID, pruneTs)) + store.Delete(types.ConsumerAddrsToPruneV2Key(consumerId, pruneTs)) } // AssignConsumerKey assigns the consumerKey to the validator with providerAddr -// on the consumer chain with ID chainID, if it is either registered or currently +// on the consumer chain with the given `consumerId`, if it is either registered or currently // voted on in a ConsumerAddition governance proposal func (k Keeper) AssignConsumerKey( ctx sdk.Context, - chainID string, + consumerId string, validator stakingtypes.Validator, consumerKey tmprotocrypto.PublicKey, ) error { // check that the consumer chain is either registered or that // a ConsumerAdditionProposal was submitted. - if !k.IsConsumerProposedOrRegistered(ctx, chainID) { + if !k.IsConsumerProposedOrRegistered(ctx, consumerId) { return errorsmod.Wrapf( - types.ErrUnknownConsumerChainId, chainID, + types.ErrUnknownConsumerId, consumerId, ) } @@ -433,7 +433,7 @@ func (k Keeper) AssignConsumerKey( } // We prevent a validator from assigning the default provider key as a consumer key // if it has not already assigned a different consumer key - _, found := k.GetValidatorConsumerPubKey(ctx, chainID, providerAddr) + _, found := k.GetValidatorConsumerPubKey(ctx, consumerId, providerAddr) if !found { return errorsmod.Wrapf( types.ErrCannotAssignDefaultKeyAssignment, @@ -442,7 +442,7 @@ func (k Keeper) AssignConsumerKey( } } - if _, found := k.GetValidatorByConsumerAddr(ctx, chainID, consumerAddr); found { + if _, found := k.GetValidatorByConsumerAddr(ctx, consumerId, consumerAddr); found { // This consumer key is already in use, or it is to be pruned. With this check we prevent another validator // from assigning the same consumer key as some other validator. Additionally, we prevent a validator from // reusing a consumer key that it used in the past and is now to be pruned. @@ -452,7 +452,7 @@ func (k Keeper) AssignConsumerKey( } // get the previous key assigned for this validator on this consumer chain - if oldConsumerKey, found := k.GetValidatorConsumerPubKey(ctx, chainID, providerAddr); found { + if oldConsumerKey, found := k.GetValidatorConsumerPubKey(ctx, consumerId, providerAddr); found { oldConsumerAddrTmp, err := ccvtypes.TMCryptoPublicKeyToConsAddr(oldConsumerKey) if err != nil { return err @@ -461,7 +461,7 @@ func (k Keeper) AssignConsumerKey( // check whether the consumer chain is already registered, // i.e., a client to the consumer was already created - if _, consumerRegistered := k.GetConsumerClientId(ctx, chainID); consumerRegistered { + if _, consumerRegistered := k.GetConsumerClientId(ctx, consumerId); consumerRegistered { // mark the old consumer address as prunable once UnbondingPeriod elapses; // note: this state is removed on EndBlock unbondingPeriod, err := k.stakingKeeper.UnbondingTime(ctx) @@ -470,26 +470,26 @@ func (k Keeper) AssignConsumerKey( } k.AppendConsumerAddrsToPrune( ctx, - chainID, + consumerId, ctx.BlockTime().Add(unbondingPeriod), oldConsumerAddr, ) } else { // if the consumer chain is not registered, then remove the mapping // from the old consumer address to the provider address - k.DeleteValidatorByConsumerAddr(ctx, chainID, oldConsumerAddr) + k.DeleteValidatorByConsumerAddr(ctx, consumerId, oldConsumerAddr) } } // set the mapping from this validator's provider address to the new consumer key; // overwrite if already exists // note: this state is deleted when the validator is removed from the staking module - k.SetValidatorConsumerPubKey(ctx, chainID, providerAddr, consumerKey) + k.SetValidatorConsumerPubKey(ctx, consumerId, providerAddr, consumerKey) // set the mapping from this validator's new consensus address on the consumer // to its consensus address on the provider; // note: this state must be deleted through the pruning mechanism - k.SetValidatorByConsumerAddr(ctx, chainID, consumerAddr, providerAddr) + k.SetValidatorByConsumerAddr(ctx, consumerId, consumerAddr, providerAddr) return nil } @@ -498,11 +498,11 @@ func (k Keeper) AssignConsumerKey( // consAddr set as the consensus address on a consumer chain func (k Keeper) GetProviderAddrFromConsumerAddr( ctx sdk.Context, - chainID string, + consumerId string, consumerAddr types.ConsumerConsAddress, ) types.ProviderConsAddress { // check if this address is known only to the consumer chain - if providerConsAddr, found := k.GetValidatorByConsumerAddr(ctx, chainID, consumerAddr); found { + if providerConsAddr, found := k.GetValidatorByConsumerAddr(ctx, consumerId, consumerAddr); found { return providerConsAddr } // If mapping from consumer -> provider addr is not found, there is no assigned key, @@ -512,46 +512,46 @@ func (k Keeper) GetProviderAddrFromConsumerAddr( // PruneKeyAssignments prunes the consumer addresses no longer needed // as they cannot be referenced in slash requests (by a correct consumer) -func (k Keeper) PruneKeyAssignments(ctx sdk.Context, chainID string) { +func (k Keeper) PruneKeyAssignments(ctx sdk.Context, consumerId string) { now := ctx.BlockTime() - consumerAddrs := k.ConsumeConsumerAddrsToPrune(ctx, chainID, now) + consumerAddrs := k.ConsumeConsumerAddrsToPrune(ctx, consumerId, now) for _, addrBz := range consumerAddrs.Addresses { consumerAddr := types.NewConsumerConsAddress(addrBz) - k.DeleteValidatorByConsumerAddr(ctx, chainID, consumerAddr) + k.DeleteValidatorByConsumerAddr(ctx, consumerId, consumerAddr) k.Logger(ctx).Info("consumer address was pruned", - "consumer chainID", chainID, + "consumer consumerId", consumerId, "consumer consensus addr", consumerAddr.String(), ) } } // DeleteKeyAssignments deletes all the state needed for key assignments on a consumer chain -func (k Keeper) DeleteKeyAssignments(ctx sdk.Context, chainID string) { +func (k Keeper) DeleteKeyAssignments(ctx sdk.Context, consumerId string) { // delete ValidatorConsumerPubKey - for _, validatorConsumerAddr := range k.GetAllValidatorConsumerPubKeys(ctx, &chainID) { + for _, validatorConsumerAddr := range k.GetAllValidatorConsumerPubKeys(ctx, &consumerId) { providerAddr := types.NewProviderConsAddress(validatorConsumerAddr.ProviderAddr) - k.DeleteValidatorConsumerPubKey(ctx, chainID, providerAddr) + k.DeleteValidatorConsumerPubKey(ctx, consumerId, providerAddr) } // delete ValidatorsByConsumerAddr - for _, validatorConsumerAddr := range k.GetAllValidatorsByConsumerAddr(ctx, &chainID) { + for _, validatorConsumerAddr := range k.GetAllValidatorsByConsumerAddr(ctx, &consumerId) { consumerAddr := types.NewConsumerConsAddress(validatorConsumerAddr.ConsumerAddr) - k.DeleteValidatorByConsumerAddr(ctx, chainID, consumerAddr) + k.DeleteValidatorByConsumerAddr(ctx, consumerId, consumerAddr) } // delete ValidatorConsumerPubKey - for _, consumerAddrsToPrune := range k.GetAllConsumerAddrsToPrune(ctx, chainID) { - k.DeleteConsumerAddrsToPrune(ctx, chainID, consumerAddrsToPrune.PruneTs) + for _, consumerAddrsToPrune := range k.GetAllConsumerAddrsToPrune(ctx, consumerId) { + k.DeleteConsumerAddrsToPrune(ctx, consumerId, consumerAddrsToPrune.PruneTs) } } // IsConsumerProposedOrRegistered checks if a consumer chain is either registered, meaning either already running // or will run soon, or proposed its ConsumerAdditionProposal was submitted but the chain was not yet added to ICS yet. -func (k Keeper) IsConsumerProposedOrRegistered(ctx sdk.Context, chainID string) bool { +func (k Keeper) IsConsumerProposedOrRegistered(ctx sdk.Context, consumerId string) bool { allConsumerChains := k.GetAllRegisteredAndProposedChainIDs(ctx) for _, c := range allConsumerChains { - if c == chainID { + if c == consumerId { return true } } diff --git a/x/ccv/provider/keeper/legacy_proposal.go b/x/ccv/provider/keeper/legacy_proposal.go index d14773e5ed..5c4293ba9a 100644 --- a/x/ccv/provider/keeper/legacy_proposal.go +++ b/x/ccv/provider/keeper/legacy_proposal.go @@ -75,7 +75,7 @@ func (k Keeper) HandleLegacyConsumerRemovalProposal(ctx sdk.Context, p *types.Co k.SetPendingConsumerRemovalProp(ctx, p) k.Logger(ctx).Info("consumer removal proposal enqueued", - "chainID", p.ChainId, + "consumer id", p.ConsumerId, "title", p.Title, "stop time", p.StopTime.UTC(), ) @@ -85,40 +85,40 @@ func (k Keeper) HandleLegacyConsumerRemovalProposal(ctx sdk.Context, p *types.Co // HandleConsumerModificationProposal modifies a running consumer chain func (k Keeper) HandleLegacyConsumerModificationProposal(ctx sdk.Context, p *types.ConsumerModificationProposal) error { - if _, found := k.GetConsumerClientId(ctx, p.ChainId); !found { - return errorsmod.Wrapf(types.ErrInvalidConsumerChainID, "consumer %s chain is not running", p.ChainId) + if _, found := k.GetConsumerClientId(ctx, p.ConsumerId); !found { + return errorsmod.Wrapf(types.ErrInvalidConsumerId, "chain with consumer id %s is not launched", p.ConsumerId) } - k.SetTopN(ctx, p.ChainId, p.Top_N) - k.SetValidatorsPowerCap(ctx, p.ChainId, p.ValidatorsPowerCap) - k.SetValidatorSetCap(ctx, p.ChainId, p.ValidatorSetCap) - k.SetMinStake(ctx, p.ChainId, p.MinStake) - k.SetInactiveValidatorsAllowed(ctx, p.ChainId, p.AllowInactiveVals) + k.SetTopN(ctx, p.ConsumerId, p.Top_N) + k.SetValidatorsPowerCap(ctx, p.ConsumerId, p.ValidatorsPowerCap) + k.SetValidatorSetCap(ctx, p.ConsumerId, p.ValidatorSetCap) + k.SetMinStake(ctx, p.ConsumerId, p.MinStake) + k.SetInactiveValidatorsAllowed(ctx, p.ConsumerId, p.AllowInactiveVals) - k.DeleteAllowlist(ctx, p.ChainId) + k.DeleteAllowlist(ctx, p.ConsumerId) for _, address := range p.Allowlist { consAddr, err := sdk.ConsAddressFromBech32(address) if err != nil { continue } - k.SetAllowlist(ctx, p.ChainId, types.NewProviderConsAddress(consAddr)) + k.SetAllowlist(ctx, p.ConsumerId, types.NewProviderConsAddress(consAddr)) } - k.DeleteDenylist(ctx, p.ChainId) + k.DeleteDenylist(ctx, p.ConsumerId) for _, address := range p.Denylist { consAddr, err := sdk.ConsAddressFromBech32(address) if err != nil { continue } - k.SetDenylist(ctx, p.ChainId, types.NewProviderConsAddress(consAddr)) + k.SetDenylist(ctx, p.ConsumerId, types.NewProviderConsAddress(consAddr)) } - oldTopN, found := k.GetTopN(ctx, p.ChainId) + oldTopN, found := k.GetTopN(ctx, p.ConsumerId) if !found { oldTopN = 0 - k.Logger(ctx).Info("consumer chain top N not found, treating as 0", "chainID", p.ChainId) + k.Logger(ctx).Info("consumer chain top N not found, treating as 0", "chainID", p.ConsumerId) } // if the top N changes, we need to update the new minimum power in top N @@ -133,10 +133,10 @@ func (k Keeper) HandleLegacyConsumerModificationProposal(ctx sdk.Context, p *typ if err != nil { return err } - k.SetMinimumPowerInTopN(ctx, p.ChainId, minPower) + k.SetMinimumPowerInTopN(ctx, p.ConsumerId, minPower) } else { // if the chain receives a zero top N value, we delete the min power - k.DeleteMinimumPowerInTopN(ctx, p.ChainId) + k.DeleteMinimumPowerInTopN(ctx, p.ConsumerId) } } diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index da6f63cf8a..83f9211b91 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -67,11 +67,11 @@ func (k msgServer) AssignConsumerKey(goCtx context.Context, msg *types.MsgAssign return nil, err } - if err := k.Keeper.AssignConsumerKey(ctx, msg.ChainId, validator, consumerTMPublicKey); err != nil { + if err := k.Keeper.AssignConsumerKey(ctx, msg.ConsumerId, validator, consumerTMPublicKey); err != nil { return nil, err } k.Logger(ctx).Info("assigned consumer key", - "consumer chainID", msg.ChainId, + "consumer id", msg.ConsumerId, "validator operator addr", msg.ProviderAddr, "consumer public key", msg.ConsumerKey, ) @@ -223,7 +223,7 @@ func (k msgServer) OptIn(goCtx context.Context, msg *types.MsgOptIn) (*types.Msg } providerConsAddr := types.NewProviderConsAddress(consAddrTmp) - err = k.Keeper.HandleOptIn(ctx, msg.ChainId, providerConsAddr, msg.ConsumerKey) + err = k.Keeper.HandleOptIn(ctx, msg.ConsumerId, providerConsAddr, msg.ConsumerKey) if err != nil { return nil, err } @@ -259,7 +259,7 @@ func (k msgServer) OptOut(goCtx context.Context, msg *types.MsgOptOut) (*types.M } providerConsAddr := types.NewProviderConsAddress(consAddrTmp) - err = k.Keeper.HandleOptOut(ctx, msg.ChainId, providerConsAddr) + err = k.Keeper.HandleOptOut(ctx, msg.ConsumerId, providerConsAddr) if err != nil { return nil, err } @@ -293,14 +293,14 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M return nil, err } - if err := k.HandleSetConsumerCommissionRate(ctx, msg.ChainId, types.NewProviderConsAddress(consAddr), msg.Rate); err != nil { + if err := k.HandleSetConsumerCommissionRate(ctx, msg.ConsumerId, types.NewProviderConsAddress(consAddr), msg.Rate); err != nil { return nil, err } ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeSetConsumerCommissionRate, - sdk.NewAttribute(types.AttributeConsumerChainID, msg.ChainId), + sdk.NewAttribute(types.AttributeConsumerId, msg.ConsumerId), sdk.NewAttribute(types.AttributeProviderValidatorAddress, msg.ProviderAddr), sdk.NewAttribute(types.AttributeConsumerCommissionRate, msg.Rate.String()), ), diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 3112124724..85ec9f1536 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -18,7 +18,7 @@ import ( func (k Keeper) HandleOptIn(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, consumerKey string) error { if !k.IsConsumerProposedOrRegistered(ctx, chainID) { return errorsmod.Wrapf( - types.ErrUnknownConsumerChainId, + types.ErrUnknownConsumerId, "opting in to an unknown consumer chain, with id: %s", chainID) } @@ -51,7 +51,7 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types // A validator can only opt out from a running chain. We check this by checking the consumer client id, because // `SetConsumerClientId` is set when the chain starts in `CreateConsumerClientInCachedCtx` of `BeginBlockInit`. return errorsmod.Wrapf( - types.ErrUnknownConsumerChainId, + types.ErrUnknownConsumerId, "opting out of an unknown or not running consumer chain, with id: %s", chainID) } @@ -72,7 +72,7 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types minPowerInTopN, found := k.GetMinimumPowerInTopN(ctx, chainID) if !found { return errorsmod.Wrapf( - types.ErrUnknownConsumerChainId, + types.ErrUnknownConsumerId, "Could not find minimum power in top N for chain with id: %s", chainID) } diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 9c2f620636..3eafef20fb 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -53,8 +53,8 @@ func (k Keeper) HandleConsumerAdditionProposal(ctx sdk.Context, proposal *types. // Will replace legacy handler HandleLegacyConsumerRemovalProposal func (k Keeper) HandleConsumerRemovalProposal(ctx sdk.Context, proposal *types.MsgConsumerRemoval) error { p := types.ConsumerRemovalProposal{ - ChainId: proposal.ChainId, - StopTime: proposal.StopTime, + ConsumerId: proposal.ConsumerId, + StopTime: proposal.StopTime, } return k.HandleLegacyConsumerRemovalProposal(ctx, &p) @@ -76,7 +76,7 @@ func (k Keeper) HandleConsumerModificationProposal(ctx sdk.Context, proposal *ty p := types.ConsumerModificationProposal{ Title: proposal.Title, Description: proposal.Description, - ChainId: proposal.ChainId, + ConsumerId: proposal.ConsumerId, Top_N: proposal.Top_N, ValidatorsPowerCap: proposal.ValidatorsPowerCap, ValidatorSetCap: proposal.ValidatorSetCap, @@ -517,7 +517,7 @@ func (k Keeper) SetPendingConsumerRemovalProp(ctx sdk.Context, prop *types.Consu // An error here would indicate something is very wrong panic(fmt.Errorf("failed to marshal consumer removal proposal: %w", err)) } - store.Set(types.PendingCRPKey(prop.StopTime, prop.ChainId), bz) + store.Set(types.PendingCRPKey(prop.StopTime, prop.ConsumerId), bz) } // PendingConsumerRemovalPropExists checks whether a pending consumer removal proposal @@ -537,7 +537,7 @@ func (k Keeper) DeletePendingConsumerRemovalProps(ctx sdk.Context, proposals ... store := ctx.KVStore(k.storeKey) for _, p := range proposals { - store.Delete(types.PendingCRPKey(p.StopTime, p.ChainId)) + store.Delete(types.PendingCRPKey(p.StopTime, p.ConsumerId)) } } @@ -565,7 +565,7 @@ func (k Keeper) BeginBlockCCR(ctx sdk.Context) { writeFn() k.Logger(ctx).Info("executed consumer removal proposal", - "chainID", prop.ChainId, + "consumer id", prop.ConsumerId, "title", prop.Title, "stop time", prop.StopTime.UTC(), ) @@ -646,6 +646,6 @@ func (k Keeper) CreateConsumerClientInCachedCtx(ctx sdk.Context, p types.Consume // from a given consumer removal proposal in a cached context func (k Keeper) StopConsumerChainInCachedCtx(ctx sdk.Context, p types.ConsumerRemovalProposal) (cc sdk.Context, writeCache func(), err error) { cc, writeCache = ctx.CacheContext() - err = k.StopConsumerChain(cc, p.ChainId, true) + err = k.StopConsumerChain(cc, p.ConsumerId, true) return } diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 5109489d76..347b2e4774 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -8,10 +8,10 @@ import ( var ( ErrInvalidConsumerAdditionProposal = errorsmod.Register(ModuleName, 1, "invalid consumer addition proposal") ErrInvalidConsumerRemovalProp = errorsmod.Register(ModuleName, 2, "invalid consumer removal proposal") - ErrUnknownConsumerChainId = errorsmod.Register(ModuleName, 3, "no consumer chain with this chain id") + ErrUnknownConsumerId = errorsmod.Register(ModuleName, 3, "no consumer chain with this consumer id") ErrUnknownConsumerChannelId = errorsmod.Register(ModuleName, 4, "no consumer chain with this channel id") ErrInvalidConsumerConsensusPubKey = errorsmod.Register(ModuleName, 5, "empty consumer consensus public key") - ErrInvalidConsumerChainID = errorsmod.Register(ModuleName, 6, "invalid consumer chain id") + ErrInvalidConsumerId = errorsmod.Register(ModuleName, 6, "invalid consumer id") ErrConsumerKeyNotFound = errorsmod.Register(ModuleName, 7, "consumer key not found") ErrNoValidatorConsumerAddress = errorsmod.Register(ModuleName, 8, "error getting validator consumer address") ErrNoValidatorProviderAddress = errorsmod.Register(ModuleName, 9, "error getting validator provider address") @@ -31,5 +31,4 @@ var ( ErrNoUnbondingTime = errorsmod.Register(ModuleName, 23, "provider unbonding time not found") ErrInvalidAddress = errorsmod.Register(ModuleName, 24, "invalid address") ErrUnauthorized = errorsmod.Register(ModuleName, 25, "unauthorized") - ErrBlankConsumerChainID = errorsmod.Register(ModuleName, 26, "consumer chain id must not be blank") ) diff --git a/x/ccv/provider/types/events.go b/x/ccv/provider/types/events.go index 9abcba7836..982b383f03 100644 --- a/x/ccv/provider/types/events.go +++ b/x/ccv/provider/types/events.go @@ -18,5 +18,5 @@ const ( AttributeConsumerConsensusPubKey = "consumer_consensus_pub_key" AttributeConsumerRewardDenom = "consumer_reward_denom" AttributeConsumerCommissionRate = "consumer_commission_rate" - AttributeConsumerChainID = "consumer_chain_id" + AttributeConsumerId = "consumer_chain_id" ) diff --git a/x/ccv/provider/types/legacy_proposal.go b/x/ccv/provider/types/legacy_proposal.go index 3124cc3d87..2526a46c89 100644 --- a/x/ccv/provider/types/legacy_proposal.go +++ b/x/ccv/provider/types/legacy_proposal.go @@ -213,7 +213,7 @@ func NewConsumerRemovalProposal(title, description, chainID string, stopTime tim return &ConsumerRemovalProposal{ Title: title, Description: description, - ChainId: chainID, + ConsumerId: chainID, StopTime: stopTime, } } @@ -230,7 +230,7 @@ func (sccp *ConsumerRemovalProposal) ValidateBasic() error { return err } - if strings.TrimSpace(sccp.ChainId) == "" { + if strings.TrimSpace(sccp.ConsumerId) == "" { return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "consumer chain id must not be blank") } @@ -253,7 +253,7 @@ func NewConsumerModificationProposal(title, description, chainID string, return &ConsumerModificationProposal{ Title: title, Description: description, - ChainId: chainID, + ConsumerId: chainID, Top_N: topN, ValidatorsPowerCap: validatorsPowerCap, ValidatorSetCap: validatorSetCap, @@ -278,7 +278,7 @@ func (cccp *ConsumerModificationProposal) ValidateBasic() error { return err } - if strings.TrimSpace(cccp.ChainId) == "" { + if strings.TrimSpace(cccp.ConsumerId) == "" { return errorsmod.Wrap(ErrInvalidConsumerModificationProposal, "consumer chain id must not be blank") } diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index c47c62e0a0..f5f1f91c1b 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -3,6 +3,7 @@ package types import ( "encoding/json" "fmt" + "strconv" "strings" ibctmtypes "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" @@ -54,11 +55,11 @@ var ( // NewMsgAssignConsumerKey creates a new MsgAssignConsumerKey instance. // Delegator address and validator address are the same. -func NewMsgAssignConsumerKey(chainID string, providerValidatorAddress sdk.ValAddress, +func NewMsgAssignConsumerKey(consumerId string, providerValidatorAddress sdk.ValAddress, consumerConsensusPubKey, signer string, ) (*MsgAssignConsumerKey, error) { return &MsgAssignConsumerKey{ - ChainId: chainID, + ConsumerId: consumerId, ProviderAddr: providerValidatorAddress.String(), ConsumerKey: consumerConsensusPubKey, Signer: signer, @@ -94,14 +95,14 @@ func (msg MsgAssignConsumerKey) GetSignBytes() []byte { // ValidateBasic implements the sdk.Msg interface. func (msg MsgAssignConsumerKey) ValidateBasic() error { - if strings.TrimSpace(msg.ChainId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot be blank") + if strings.TrimSpace(msg.ConsumerId) == "" { + return errorsmod.Wrapf(ErrInvalidConsumerId, "consumerId cannot be blank") } // It is possible to assign keys for consumer chains that are not yet approved. // This can only be done by a signing validator, but it is still sensible // to limit the chainID size to prevent abuse. - if 128 < len(msg.ChainId) { - return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot exceed 128 length") + if 128 < len(msg.ConsumerId) { + return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot exceed 128 length") } _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { @@ -243,7 +244,7 @@ func (msg *MsgConsumerAddition) GetSigners() []sdk.AccAddress { // ValidateBasic implements the sdk.Msg interface. func (msg *MsgConsumerAddition) ValidateBasic() error { if strings.TrimSpace(msg.ChainId) == "" { - return ErrBlankConsumerChainID + return errorsmod.Wrapf(ErrInvalidConsumerAdditionProposal, "chain id cannot be blank") } if msg.InitialHeight.IsZero() { @@ -293,8 +294,8 @@ func (msg *MsgConsumerAddition) ValidateBasic() error { } func (msg *MsgConsumerRemoval) ValidateBasic() error { - if strings.TrimSpace(msg.ChainId) == "" { - return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "consumer chain id must not be blank") + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err } if msg.StopTime.IsZero() { @@ -305,8 +306,8 @@ func (msg *MsgConsumerRemoval) ValidateBasic() error { // ValidateBasic implements the sdk.Msg interface. func (msg *MsgConsumerModification) ValidateBasic() error { - if strings.TrimSpace(msg.ChainId) == "" { - return ErrBlankConsumerChainID + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err } err := ValidatePSSFeatures(msg.Top_N, msg.ValidatorsPowerCap) @@ -318,9 +319,9 @@ func (msg *MsgConsumerModification) ValidateBasic() error { } // NewMsgOptIn creates a new NewMsgOptIn instance. -func NewMsgOptIn(chainID string, providerValidatorAddress sdk.ValAddress, consumerConsensusPubKey, signer string) (*MsgOptIn, error) { +func NewMsgOptIn(consumerId string, providerValidatorAddress sdk.ValAddress, consumerConsensusPubKey, signer string) (*MsgOptIn, error) { return &MsgOptIn{ - ChainId: chainID, + ConsumerId: consumerId, ProviderAddr: providerValidatorAddress.String(), ConsumerKey: consumerConsensusPubKey, Signer: signer, @@ -348,14 +349,14 @@ func (msg MsgOptIn) GetSigners() []sdk.AccAddress { // ValidateBasic implements the sdk.Msg interface. func (msg MsgOptIn) ValidateBasic() error { - if strings.TrimSpace(msg.ChainId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot be blank") + if strings.TrimSpace(msg.ConsumerId) == "" { + return errorsmod.Wrapf(ErrInvalidConsumerId, "consumer id cannot be blank") } // It is possible to opt in to validate on consumer chains that are not yet approved. // This can only be done by a signing validator, but it is still sensible - // to limit the chainID size to prevent abuse. - if 128 < len(msg.ChainId) { - return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot exceed 128 length") + // to limit the consumerId size to prevent abuse. + if 128 < len(msg.ConsumerId) { + return errorsmod.Wrapf(ErrInvalidConsumerId, "consumer id cannot exceed 128 length") } _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { @@ -371,9 +372,9 @@ func (msg MsgOptIn) ValidateBasic() error { } // NewMsgOptOut creates a new NewMsgOptIn instance. -func NewMsgOptOut(chainID string, providerValidatorAddress sdk.ValAddress, signer string) (*MsgOptOut, error) { +func NewMsgOptOut(consumerId string, providerValidatorAddress sdk.ValAddress, signer string) (*MsgOptOut, error) { return &MsgOptOut{ - ChainId: chainID, + ConsumerId: consumerId, ProviderAddr: providerValidatorAddress.String(), Signer: signer, }, nil @@ -406,14 +407,14 @@ func (msg MsgOptOut) GetSignBytes() []byte { // ValidateBasic implements the sdk.Msg interface. func (msg MsgOptOut) ValidateBasic() error { - if strings.TrimSpace(msg.ChainId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot be blank") + if strings.TrimSpace(msg.ConsumerId) == "" { + return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot be blank") } // It is possible to assign keys for consumer chains that are not yet approved. // This can only be done by a signing validator, but it is still sensible // to limit the chainID size to prevent abuse. - if 128 < len(msg.ChainId) { - return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot exceed 128 length") + if 128 < len(msg.ConsumerId) { + return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot exceed 128 length") } _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { @@ -423,9 +424,9 @@ func (msg MsgOptOut) ValidateBasic() error { } // NewMsgSetConsumerCommissionRate creates a new MsgSetConsumerCommissionRate msg instance. -func NewMsgSetConsumerCommissionRate(chainID string, commission math.LegacyDec, providerValidatorAddress sdk.ValAddress, signer string) *MsgSetConsumerCommissionRate { +func NewMsgSetConsumerCommissionRate(consumerId string, commission math.LegacyDec, providerValidatorAddress sdk.ValAddress, signer string) *MsgSetConsumerCommissionRate { return &MsgSetConsumerCommissionRate{ - ChainId: chainID, + ConsumerId: consumerId, Rate: commission, ProviderAddr: providerValidatorAddress.String(), Signer: signer, @@ -441,12 +442,12 @@ func (msg MsgSetConsumerCommissionRate) Type() string { } func (msg MsgSetConsumerCommissionRate) ValidateBasic() error { - if strings.TrimSpace(msg.ChainId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot be blank") + if strings.TrimSpace(msg.ConsumerId) == "" { + return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot be blank") } - if 128 < len(msg.ChainId) { - return errorsmod.Wrapf(ErrInvalidConsumerChainID, "chainId cannot exceed 128 length") + if 128 < len(msg.ConsumerId) { + return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot exceed 128 length") } _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { @@ -507,3 +508,18 @@ func (msg MsgSetConsumerCommissionRate) GetSignBytes() []byte { bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } + +// ValidateConsumerId validates the provided consumer id and returns an error if it is not valid +func ValidateConsumerId(consumerId string) error { + if strings.TrimSpace(consumerId) == "" { + return errorsmod.Wrapf(ErrInvalidConsumerId, "consumer id cannot be blank") + } + + // check that `consumerId` corresponds to a `uint64` + _, err := strconv.ParseUint(consumerId, 10, 64) + if err != nil { + return errorsmod.Wrapf(ErrInvalidConsumerId, "consumer id (%s) cannot be parsed: %s", consumerId, err.Error()) + } + + return nil +} diff --git a/x/ccv/provider/types/msg_test.go b/x/ccv/provider/types/msg_test.go new file mode 100644 index 0000000000..5044c62f75 --- /dev/null +++ b/x/ccv/provider/types/msg_test.go @@ -0,0 +1,21 @@ +package types_test + +import ( + "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + "github.com/stretchr/testify/require" + "testing" +) + +func TestValidateConsumerId(t *testing.T) { + // empty consumer id + require.Error(t, types.ValidateConsumerId("")) + + // not a `uint64` where `uint64` is in the range [0, 2^64) + require.Error(t, types.ValidateConsumerId("a")) + require.Error(t, types.ValidateConsumerId("-2545")) + require.Error(t, types.ValidateConsumerId("18446744073709551616")) // 2^64 + + // valid consumer id + require.NoError(t, types.ValidateConsumerId("0")) + require.NoError(t, types.ValidateConsumerId("18446744073709551616")) // 2^64 - 1 +} diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 7c30781221..ce0e3447be 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -161,8 +161,8 @@ type ConsumerRemovalProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // the description of the proposal Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the chain-id of the consumer chain to be stopped - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the consumer id of the consumer chain to be stopped + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // the time on the provider chain at which all validators are responsible to // stop their consumer chain validator node StopTime time.Time `protobuf:"bytes,4,opt,name=stop_time,json=stopTime,proto3,stdtime" json:"stop_time"` @@ -215,9 +215,9 @@ func (m *ConsumerRemovalProposal) GetDescription() string { return "" } -func (m *ConsumerRemovalProposal) GetChainId() string { +func (m *ConsumerRemovalProposal) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -236,8 +236,8 @@ type ConsumerModificationProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // the description of the proposal Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the chain-id of the consumer chain to be modified - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the consumer id of the consumer chain to be modified + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. @@ -310,9 +310,9 @@ func (m *ConsumerModificationProposal) GetDescription() string { return "" } -func (m *ConsumerModificationProposal) GetChainId() string { +func (m *ConsumerModificationProposal) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -1399,129 +1399,130 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1946 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, + // 1965 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, 0x15, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x39, 0x52, 0xec, 0x95, 0xa2, 0x92, 0x34, 0x53, 0x1b, - 0x6c, 0x5c, 0x2f, 0x23, 0x05, 0x05, 0x0c, 0xb7, 0x81, 0x21, 0x51, 0x4e, 0x6c, 0xa9, 0x71, 0xd8, - 0x15, 0xa1, 0x00, 0xe9, 0x61, 0x31, 0x9c, 0x1d, 0x91, 0x53, 0xed, 0xee, 0xac, 0x67, 0x86, 0x2b, + 0x6c, 0x5c, 0x2f, 0x23, 0x05, 0x05, 0x0c, 0xb7, 0x81, 0x21, 0x51, 0x4e, 0x2c, 0xa9, 0x71, 0xd8, + 0x95, 0xa0, 0x00, 0xe9, 0x61, 0x31, 0x9c, 0x1d, 0x91, 0x53, 0xed, 0xee, 0xac, 0x67, 0x86, 0x2b, 0xf3, 0xd2, 0x73, 0x2f, 0x05, 0xd2, 0x5b, 0xd0, 0x4b, 0x73, 0x2c, 0x7a, 0xea, 0xa1, 0xe8, 0x1f, - 0xd0, 0x53, 0x50, 0xa0, 0x68, 0x8e, 0x3d, 0x25, 0x85, 0x7d, 0xe8, 0xa1, 0x40, 0xaf, 0xbd, 0x16, - 0x33, 0xfb, 0xc1, 0xa5, 0x3e, 0x1c, 0x1a, 0x69, 0x2e, 0xd2, 0xee, 0x7b, 0xb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0xe0, 0xec, 0x97, 0x94, 0x23, 0x9f, 0x7e, - 0x5d, 0x33, 0xec, 0xb2, 0xb6, 0x53, 0x1a, 0xf8, 0x14, 0xac, 0x0e, 0x83, 0x1e, 0x0b, 0x5c, 0x1a, - 0xf4, 0x9d, 0x90, 0x70, 0xca, 0x5c, 0xb3, 0xa4, 0xa9, 0x36, 0x2f, 0x51, 0x1d, 0x24, 0x21, 0x16, - 0x33, 0x7d, 0xa6, 0x98, 0x56, 0x32, 0xe3, 0x8e, 0xb6, 0x85, 0x3f, 0x03, 0x10, 0xe3, 0x48, 0xbb, - 0xc4, 0x86, 0x32, 0x65, 0x2c, 0x4f, 0xcf, 0xb8, 0x8a, 0x71, 0xd4, 0x8d, 0xad, 0x13, 0xca, 0x9f, - 0x83, 0x9b, 0x92, 0xa3, 0x40, 0x9c, 0x12, 0x7e, 0x91, 0x17, 0x4c, 0xcf, 0xfb, 0x46, 0xca, 0x31, - 0x49, 0xfe, 0x18, 0xd4, 0x71, 0x12, 0x40, 0x0e, 0x27, 0x2e, 0x15, 0x92, 0xd3, 0xde, 0x50, 0xd9, - 0x3a, 0xa7, 0x1c, 0x61, 0x1d, 0x23, 0x15, 0x1d, 0x04, 0xd5, 0x14, 0x67, 0x4f, 0xc0, 0xde, 0x4f, - 0x50, 0xf0, 0x23, 0xf0, 0xfd, 0x9e, 0xc7, 0xf0, 0x99, 0x50, 0xce, 0x39, 0x13, 0x4c, 0x7a, 0x69, - 0x9f, 0x0a, 0xa1, 0xd8, 0x16, 0xeb, 0x46, 0xb3, 0x60, 0xdf, 0x8a, 0xb1, 0x1d, 0xc2, 0x0f, 0x72, - 0xc8, 0x6e, 0x0e, 0x08, 0xef, 0x01, 0x38, 0xa0, 0x42, 0x32, 0x4e, 0x31, 0xf2, 0x1c, 0x12, 0x48, - 0x4e, 0x89, 0x30, 0x97, 0xb4, 0xf9, 0xda, 0x58, 0xf3, 0x28, 0x56, 0xc0, 0x43, 0x70, 0xeb, 0xda, - 0x45,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08, 0xc5, 0x36, 0x5f, 0x37, 0x9a, 0x05, 0xfb, 0x56, 0x8c, 0xed, + 0x10, 0xbe, 0x97, 0x43, 0x1e, 0xe7, 0x80, 0xf0, 0x1e, 0x80, 0x7d, 0x2a, 0x24, 0xe3, 0x14, 0x23, + 0xcf, 0x21, 0x81, 0xe4, 0x94, 0x08, 0x73, 0x41, 0x9b, 0xaf, 0x8c, 0x34, 0x8f, 0x62, 0x05, 0x3c, + 0x00, 0xb7, 0xae, 0x5d, 0xd4, 0xc1, 0x7d, 0x14, 0x04, 0xc4, 0x33, 0x17, 0x75, 0x28, 0x35, 0xf7, + 0x9a, 0x35, 0xdb, 0x31, 0x0c, 0xae, 0x82, 0x19, 0xc9, 0x42, 0xe7, 0x89, 0xb9, 0x54, 0x37, 0x9a, + 0x0b, 0x76, 0x51, 0xb2, 0xf0, 0x09, 0x7c, 0x0f, 0xac, 0x45, 0xc8, 0xa3, 0x2e, 0x92, 0x8c, 0x0b, + 0x27, 0x64, 0xe7, 0x84, 0x3b, 0x18, 0x85, 0xe6, 0xb2, 0xc6, 0xc0, 0x91, 0xae, 0xa3, 0x54, 0x6d, + 0x14, 0xc2, 0x77, 0xc1, 0x4a, 0x26, 0x75, 0x04, 0x91, 0x1a, 0xbe, 0xa2, 0xe1, 0x4b, 0x99, 0xe2, + 0x88, 0x48, 0x85, 0xdd, 0x04, 0x65, 0xe4, 0x79, 0xec, 0xdc, 0xa3, 0x42, 0x9a, 0xb0, 0x5e, 0x68, + 0x96, 0xed, 0x91, 0x00, 0x6e, 0x80, 0x92, 0x4b, 0x82, 0xa1, 0x56, 0xae, 0x6a, 0x65, 0xf6, 0x0e, + 0xdf, 0x06, 0x65, 0x5f, 0xf5, 0x58, 0x89, 0xce, 0x88, 0xb9, 0x56, 0x37, 0x9a, 0x45, 0xbb, 0xe4, + 0xd3, 0xe0, 0x48, 0xbd, 0x43, 0x0b, 0xac, 0x6a, 0x16, 0x87, 0x06, 0xea, 0x9c, 0x22, 0xe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 0x5f, 0x7f, 0x7c, 0xd7, 0xb0, 0xd3, 0x65, 0x76, 0x3f, 0xfd, 0xea, 0x79, 0xd5, + 0xf8, 0xfa, 0x79, 0xd5, 0xf8, 0xe7, 0xf3, 0xaa, 0xf1, 0xf9, 0x8b, 0xea, 0xd4, 0xd7, 0x2f, 0xaa, + 0x53, 0xff, 0x78, 0x51, 0x9d, 0xfa, 0xec, 0x83, 0xcb, 0xa4, 0xa3, 0x43, 0xbb, 0x97, 0xfd, 0xc8, + 0x16, 0xfd, 0xa8, 0xf5, 0x6c, 0xfc, 0x27, 0x3c, 0xbd, 0x5e, 0x77, 0x56, 0x67, 0xc8, 0xfb, 0xff, + 0x0f, 0x00, 0x00, 0xff, 0xff, 0x40, 0xa6, 0xd4, 0x7c, 0xf3, 0x13, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -1736,10 +1737,10 @@ func (m *ConsumerRemovalProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintProvider(dAtA, i, uint64(n6)) i-- dAtA[i] = 0x22 - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintProvider(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintProvider(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0x1a } @@ -1828,10 +1829,10 @@ func (m *ConsumerModificationProposal) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x20 } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintProvider(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintProvider(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0x1a } @@ -2694,7 +2695,7 @@ func (m *ConsumerRemovalProposal) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovProvider(uint64(l)) } @@ -2717,7 +2718,7 @@ func (m *ConsumerModificationProposal) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovProvider(uint64(l)) } @@ -3814,7 +3815,7 @@ func (m *ConsumerRemovalProposal) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3842,7 +3843,7 @@ func (m *ConsumerRemovalProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -3993,7 +3994,7 @@ func (m *ConsumerModificationProposal) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4021,7 +4022,7 @@ func (m *ConsumerModificationProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index bc7866140f..497603c6b1 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -38,7 +38,7 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type QueryConsumerGenesisRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryConsumerGenesisRequest) Reset() { *m = QueryConsumerGenesisRequest{} } @@ -74,9 +74,9 @@ func (m *QueryConsumerGenesisRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerGenesisRequest proto.InternalMessageInfo -func (m *QueryConsumerGenesisRequest) GetChainId() string { +func (m *QueryConsumerGenesisRequest) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -484,7 +484,7 @@ func (m *Chain) GetDenylist() []string { 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"` + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_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"` } @@ -975,7 +975,7 @@ func (m *ProposedChain) GetProposalID() uint64 { type QueryAllPairsValConAddrByConsumerChainIDRequest struct { // The id of the consumer chain - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) Reset() { @@ -1015,9 +1015,9 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAllPairsValConAddrByConsumerChainIDRequest proto.InternalMessageInfo -func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) GetChainId() string { +func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -1213,7 +1213,7 @@ func (m *QueryParamsResponse) GetParams() Params { } type QueryConsumerChainOptedInValidatorsRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryConsumerChainOptedInValidatorsRequest) Reset() { @@ -1253,9 +1253,9 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerChainOptedInValidatorsRequest proto.InternalMessageInfo -func (m *QueryConsumerChainOptedInValidatorsRequest) GetChainId() string { +func (m *QueryConsumerChainOptedInValidatorsRequest) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -1310,7 +1310,7 @@ func (m *QueryConsumerChainOptedInValidatorsResponse) GetValidatorsProviderAddre } type QueryConsumerValidatorsRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryConsumerValidatorsRequest) Reset() { *m = QueryConsumerValidatorsRequest{} } @@ -1346,9 +1346,9 @@ func (m *QueryConsumerValidatorsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerValidatorsRequest proto.InternalMessageInfo -func (m *QueryConsumerValidatorsRequest) GetChainId() string { +func (m *QueryConsumerValidatorsRequest) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -1560,7 +1560,7 @@ func (m *QueryConsumerChainsValidatorHasToValidateResponse) GetConsumerChainIds( } type QueryValidatorConsumerCommissionRateRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_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"` } @@ -1602,9 +1602,9 @@ func (m *QueryValidatorConsumerCommissionRateRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryValidatorConsumerCommissionRateRequest proto.InternalMessageInfo -func (m *QueryValidatorConsumerCommissionRateRequest) GetChainId() string { +func (m *QueryValidatorConsumerCommissionRateRequest) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -1783,133 +1783,133 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 2002 bytes of a gzipped FileDescriptorProto + // 2008 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xcd, 0x6f, 0xdc, 0xc6, - 0x15, 0x17, 0x57, 0xb2, 0x22, 0x8d, 0x62, 0x3b, 0x19, 0xab, 0xb1, 0x4c, 0x29, 0xbb, 0x0a, 0xdd, - 0x0f, 0x59, 0x76, 0x49, 0x49, 0x86, 0x11, 0xc7, 0xae, 0x23, 0x6b, 0x25, 0xd9, 0x59, 0xd8, 0xb1, - 0x15, 0x5a, 0x76, 0x0b, 0xb7, 0x28, 0x3d, 0x22, 0xa7, 0x2b, 0xc2, 0x5c, 0x0e, 0xc5, 0x19, 0xad, - 0xbd, 0x30, 0x72, 0x48, 0x0f, 0x6d, 0x8e, 0x41, 0x3f, 0x80, 0x1e, 0x73, 0xe9, 0xb1, 0x3d, 0xf4, - 0xd0, 0xbf, 0x21, 0xb7, 0xa6, 0xc8, 0xa5, 0xe8, 0xc1, 0x2d, 0xec, 0x1e, 0x8a, 0x02, 0x2d, 0xda, - 0xa0, 0xd7, 0x02, 0x05, 0x87, 0x43, 0x2e, 0xb9, 0xcb, 0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0x04, 0x66, - 0x12, 0x04, 0x16, 0xbe, 0x5d, 0x60, 0xbb, 0x92, 0x44, 0x58, 0xbe, 0x5c, 0x5c, 0x51, 0xd8, 0xbf, - 0xc2, 0xed, 0x5f, 0x86, 0x4b, 0x39, 0x76, 0x37, 0x34, 0xf2, 0x67, 0xd1, 0x81, 0xee, 0x4f, 0x65, - 0x8b, 0x1c, 0xe8, 0x5c, 0xec, 0xba, 0xc8, 0x81, 0xce, 0xc7, 0xb2, 0x8b, 0x74, 0x27, 0x24, 0x00, - 0x31, 0x6c, 0xd7, 0x68, 0x93, 0xb4, 0x64, 0xdf, 0xf9, 0xfb, 0x12, 0x38, 0x97, 0x9b, 0x3d, 0xc1, - 0xfb, 0xc3, 0x36, 0x93, 0x7d, 0x09, 0xa0, 0xfc, 0xe0, 0xa8, 0x61, 0x45, 0x98, 0x1e, 0xf2, 0x30, - 0xed, 0x42, 0xbd, 0x70, 0xe7, 0x6a, 0x78, 0xd8, 0x6f, 0x47, 0x4c, 0x7b, 0xd6, 0x49, 0xd9, 0x3e, - 0x84, 0xbf, 0x29, 0x81, 0xaf, 0xe7, 0x61, 0x62, 0x70, 0x67, 0x84, 0xc6, 0x24, 0x93, 0x5d, 0xca, - 0x1f, 0x1c, 0x21, 0xa2, 0x88, 0xd4, 0x23, 0x1e, 0xa9, 0x87, 0xf0, 0x7b, 0x45, 0x22, 0x15, 0x43, - 0x19, 0x01, 0x63, 0x4c, 0x64, 0x55, 0x56, 0xbc, 0xfe, 0xd5, 0xd9, 0x06, 0x27, 0x4e, 0xdc, 0xe6, - 0x28, 0xef, 0x10, 0x51, 0x54, 0xb6, 0x46, 0x03, 0x19, 0xa1, 0xef, 0xcf, 0x3e, 0x59, 0xff, 0x94, - 0xc4, 0x9f, 0x07, 0x59, 0xec, 0x18, 0x16, 0x78, 0x7a, 0xe9, 0xc3, 0xc0, 0xe5, 0x1b, 0xa3, 0xc2, - 0x14, 0xef, 0x00, 0x7b, 0x90, 0xf9, 0xea, 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xf0, 0xd8, 0x1a, 0xd7, 0xc3, 0x0f, 0x78, 0x01, 0x4c, 0xf8, 0x41, 0x69, 0x9f, 0xe0, 0x9a, + 0x9c, 0x09, 0xce, 0xf6, 0x2f, 0x87, 0x95, 0x85, 0x90, 0x21, 0x50, 0xeb, 0x91, 0x6a, 0x13, 0xad, + 0x81, 0xd8, 0x9e, 0x7a, 0x0b, 0xd7, 0x91, 0xd9, 0xda, 0xc2, 0xa6, 0xce, 0x17, 0x04, 0xdd, 0x6c, + 0xa5, 0xa7, 0xdf, 0xc4, 0xf1, 0x60, 0x00, 0xda, 0x9e, 0x17, 0x79, 0x7f, 0x2d, 0x57, 0xac, 0x0d, + 0xf2, 0xa6, 0x9e, 0x00, 0x56, 0xf6, 0x45, 0x65, 0x4a, 0xb7, 0xf9, 0xb1, 0xec, 0xfb, 0x88, 0xee, + 0x10, 0xf1, 0x15, 0x5d, 0xad, 0x23, 0x9e, 0x86, 0x82, 0xc0, 0x5a, 0x81, 0x2d, 0x85, 0x3b, 0xce, + 0x03, 0x18, 0x1f, 0x61, 0xd4, 0xa9, 0x44, 0x21, 0x1a, 0x97, 0x91, 0xb0, 0x84, 0x5a, 0x34, 0xe8, + 0xea, 0xce, 0x65, 0xb7, 0x51, 0x9b, 0xa4, 0xd1, 0xb0, 0x29, 0xb5, 0x89, 0xab, 0x27, 0x2c, 0xfa, + 0x86, 0xfb, 0x3b, 0xa5, 0x0e, 0xce, 0xe7, 0x53, 0x47, 0x58, 0x1b, 0x45, 0x96, 0x54, 0x34, 0xb2, + 0x14, 0x91, 0x4c, 0x55, 0x87, 0x98, 0x8f, 0xe8, 0x7d, 0x97, 0xd9, 0xce, 0x1d, 0xfc, 0x84, 0x5d, + 0xf3, 0x88, 0xb9, 0x17, 0x15, 0xb6, 0x87, 0xa2, 0x21, 0xcc, 0x96, 0x11, 0x1a, 0xbc, 0x03, 0x4e, + 0xed, 0xf2, 0x79, 0xe3, 0x20, 0x10, 0x30, 0x78, 0x5f, 0x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x1e, 0xfb, 0xf2, + 0x45, 0x79, 0xec, 0xcf, 0x2f, 0xca, 0x63, 0x0f, 0x2f, 0xd5, 0x6d, 0xb6, 0x77, 0xb0, 0xab, 0x9a, + 0xa4, 0x21, 0xfe, 0xfc, 0x4e, 0xec, 0xf2, 0xfd, 0x78, 0x97, 0xe6, 0x3b, 0xda, 0x93, 0x8e, 0xb6, + 0xac, 0xe5, 0x61, 0xba, 0x3b, 0xc5, 0xff, 0xe9, 0x78, 0xfb, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xa4, 0x53, 0xd4, 0x77, 0x9c, 0x20, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2612,10 +2612,10 @@ func (m *QueryConsumerGenesisRequest) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -2933,10 +2933,10 @@ func (m *QueryValidatorConsumerAddrRequest) MarshalToSizedBuffer(dAtA []byte) (i 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))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -3274,10 +3274,10 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) MarshalToSizedBuffer(d _ = i var l int _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -3446,10 +3446,10 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) MarshalToSizedBuffer(dAtA [ _ = i var l int _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -3508,10 +3508,10 @@ func (m *QueryConsumerValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -3701,10 +3701,10 @@ func (m *QueryValidatorConsumerCommissionRateRequest) MarshalToSizedBuffer(dAtA 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))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -3812,7 +3812,7 @@ func (m *QueryConsumerGenesisRequest) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -3945,7 +3945,7 @@ func (m *QueryValidatorConsumerAddrRequest) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -4095,7 +4095,7 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -4164,7 +4164,7 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -4192,7 +4192,7 @@ func (m *QueryConsumerValidatorsRequest) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -4270,7 +4270,7 @@ func (m *QueryValidatorConsumerCommissionRateRequest) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -4350,7 +4350,7 @@ func (m *QueryConsumerGenesisRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4378,7 +4378,7 @@ func (m *QueryConsumerGenesisRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5175,7 +5175,7 @@ func (m *QueryValidatorConsumerAddrRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5203,7 +5203,7 @@ func (m *QueryValidatorConsumerAddrRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -6105,7 +6105,7 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) Unmarshal(dAtA []byte) switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6133,7 +6133,7 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) Unmarshal(dAtA []byte) if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6554,7 +6554,7 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) Unmarshal(dAtA []byte) erro switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6582,7 +6582,7 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) Unmarshal(dAtA []byte) erro if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6718,7 +6718,7 @@ func (m *QueryConsumerValidatorsRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6746,7 +6746,7 @@ func (m *QueryConsumerValidatorsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7219,7 +7219,7 @@ func (m *QueryValidatorConsumerCommissionRateRequest) Unmarshal(dAtA []byte) err switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7247,7 +7247,7 @@ func (m *QueryValidatorConsumerCommissionRateRequest) Unmarshal(dAtA []byte) err if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/ccv/provider/types/query.pb.gw.go b/x/ccv/provider/types/query.pb.gw.go index a115ace156..f3f6211559 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -44,15 +44,15 @@ func request_Query_QueryConsumerGenesis_0(ctx context.Context, marshaler runtime _ = err ) - val, ok = pathParams["chain_id"] + val, ok = pathParams["consumer_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - protoReq.ChainId, err = runtime.String(val) + protoReq.ConsumerId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } msg, err := client.QueryConsumerGenesis(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -71,15 +71,15 @@ func local_request_Query_QueryConsumerGenesis_0(ctx context.Context, marshaler r _ = err ) - val, ok = pathParams["chain_id"] + val, ok = pathParams["consumer_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - protoReq.ChainId, err = runtime.String(val) + protoReq.ConsumerId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } msg, err := server.QueryConsumerGenesis(ctx, &protoReq) @@ -267,19 +267,26 @@ func local_request_Query_QueryProposedConsumerChainIDs_0(ctx context.Context, ma } -var ( - filter_Query_QueryAllPairsValConAddrByConsumerChainID_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - func request_Query_QueryAllPairsValConAddrByConsumerChainID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAllPairsValConAddrByConsumerChainIDRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["consumer_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllPairsValConAddrByConsumerChainID_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.ConsumerId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } msg, err := client.QueryAllPairsValConAddrByConsumerChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -291,11 +298,22 @@ func local_request_Query_QueryAllPairsValConAddrByConsumerChainID_0(ctx context. var protoReq QueryAllPairsValConAddrByConsumerChainIDRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["consumer_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllPairsValConAddrByConsumerChainID_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.ConsumerId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } msg, err := server.QueryAllPairsValConAddrByConsumerChainID(ctx, &protoReq) @@ -332,15 +350,15 @@ func request_Query_QueryConsumerChainOptedInValidators_0(ctx context.Context, ma _ = err ) - val, ok = pathParams["chain_id"] + val, ok = pathParams["consumer_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - protoReq.ChainId, err = runtime.String(val) + protoReq.ConsumerId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } msg, err := client.QueryConsumerChainOptedInValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -359,15 +377,15 @@ func local_request_Query_QueryConsumerChainOptedInValidators_0(ctx context.Conte _ = err ) - val, ok = pathParams["chain_id"] + val, ok = pathParams["consumer_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - protoReq.ChainId, err = runtime.String(val) + protoReq.ConsumerId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } msg, err := server.QueryConsumerChainOptedInValidators(ctx, &protoReq) @@ -440,15 +458,15 @@ func request_Query_QueryValidatorConsumerCommissionRate_0(ctx context.Context, m _ = err ) - val, ok = pathParams["chain_id"] + val, ok = pathParams["consumer_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - protoReq.ChainId, err = runtime.String(val) + protoReq.ConsumerId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } val, ok = pathParams["provider_address"] @@ -478,15 +496,15 @@ func local_request_Query_QueryValidatorConsumerCommissionRate_0(ctx context.Cont _ = err ) - val, ok = pathParams["chain_id"] + val, ok = pathParams["consumer_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - protoReq.ChainId, err = runtime.String(val) + protoReq.ConsumerId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } val, ok = pathParams["provider_address"] @@ -516,15 +534,15 @@ func request_Query_QueryConsumerValidators_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["chain_id"] + val, ok = pathParams["consumer_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - protoReq.ChainId, err = runtime.String(val) + protoReq.ConsumerId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } msg, err := client.QueryConsumerValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -543,15 +561,15 @@ func local_request_Query_QueryConsumerValidators_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["chain_id"] + val, ok = pathParams["consumer_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") } - protoReq.ChainId, err = runtime.String(val) + protoReq.ConsumerId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } msg, err := server.QueryConsumerValidators(ctx, &protoReq) @@ -1316,7 +1334,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_QueryConsumerGenesis_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_genesis", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryConsumerGenesis_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_genesis", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryConsumerChains_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_chains"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1334,17 +1352,17 @@ var ( pattern_Query_QueryProposedConsumerChainIDs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "proposed_consumer_chains"}, "", runtime.AssumeColonVerbOpt(false))) - 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_QueryAllPairsValConAddrByConsumerChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"interchain_security", "ccv", "provider", "consumer_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_QueryConsumerChainOptedInValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "opted_in_validators", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryConsumerChainOptedInValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "opted_in_validators", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryConsumerChainsValidatorHasToValidate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_chains_per_validator", "provider_address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryValidatorConsumerCommissionRate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"interchain_security", "ccv", "provider", "consumer_commission_rate", "chain_id", "provider_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryValidatorConsumerCommissionRate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"interchain_security", "ccv", "provider", "consumer_commission_rate", "consumer_id", "provider_address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryConsumerValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_validators", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryConsumerValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_validators", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryBlocksUntilNextEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "blocks_until_next_epoch"}, "", runtime.AssumeColonVerbOpt(false))) ) diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 146475a32d..440965276d 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -43,8 +43,8 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgAssignConsumerKey struct { - // The chain id of the consumer chain to assign a consensus public key to - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The consumer id of the consumer chain to assign a consensus public key to + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // The validator address on the provider ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` // The consensus public key to use on the consumer. @@ -670,8 +670,8 @@ var xxx_messageInfo_MsgConsumerAdditionResponse proto.InternalMessageInfo // // Note: this replaces ConsumerRemovalProposal which is deprecated and will be removed soon type MsgConsumerRemoval struct { - // the chain-id of the consumer chain to be stopped - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the consumer id of the consumer chain to be stopped + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // the time on the provider chain at which all validators are responsible to // stop their consumer chain validator node StopTime time.Time `protobuf:"bytes,2,opt,name=stop_time,json=stopTime,proto3,stdtime" json:"stop_time"` @@ -712,9 +712,9 @@ func (m *MsgConsumerRemoval) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConsumerRemoval proto.InternalMessageInfo -func (m *MsgConsumerRemoval) GetChainId() string { +func (m *MsgConsumerRemoval) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -875,8 +875,8 @@ func (m *MsgChangeRewardDenomsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChangeRewardDenomsResponse proto.InternalMessageInfo type MsgOptIn struct { - // the chain id of the consumer chain to opt in to - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the consumer id of the consumer chain to opt in to + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // the validator address on the provider ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` // (optional) The consensus public key to use on the consumer in json string format corresponding to proto-any, @@ -958,8 +958,8 @@ func (m *MsgOptInResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgOptInResponse proto.InternalMessageInfo type MsgOptOut struct { - // the chain id of the consumer chain to opt out from - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the consumer id of the consumer chain to opt out from + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // the validator address on the provider ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` // signer address @@ -1040,8 +1040,8 @@ var xxx_messageInfo_MsgOptOutResponse proto.InternalMessageInfo type MsgSetConsumerCommissionRate struct { // The validator address on the provider ProviderAddr string `protobuf:"bytes,1,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` - // The chain id of the consumer chain to set a commission rate - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // The consumer id of the consumer chain to set a commission rate + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // The rate to charge delegators on the consumer chain, as a fraction // TODO: migrate rate from sdk.Dec to math.LegacyDec Rate cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=rate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rate"` @@ -1128,8 +1128,8 @@ type MsgConsumerModification struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // the description of the proposal Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the chain-id of the consumer chain to be modified - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the consumer id of the consumer chain to be modified + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. @@ -1204,9 +1204,9 @@ func (m *MsgConsumerModification) GetDescription() string { return "" } -func (m *MsgConsumerModification) GetChainId() string { +func (m *MsgConsumerModification) GetConsumerId() string { if m != nil { - return m.ChainId + return m.ConsumerId } return "" } @@ -1333,117 +1333,117 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 1746 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x8f, 0x1c, 0x47, - 0x15, 0xdf, 0xde, 0x2f, 0xcf, 0xbc, 0xd9, 0xcf, 0xde, 0x35, 0x3b, 0x3b, 0x76, 0x66, 0xd6, 0x4b, - 0x48, 0x56, 0x26, 0xdb, 0x1d, 0x1b, 0x92, 0x80, 0x15, 0x04, 0xfb, 0x61, 0xf0, 0x06, 0xd6, 0x5e, - 0xda, 0xc6, 0x48, 0x20, 0xd1, 0xaa, 0xe9, 0x2e, 0xf7, 0x94, 0xdc, 0xdd, 0xd5, 0xaa, 0xaa, 0x19, - 0x67, 0x6e, 0x51, 0x4e, 0x48, 0x48, 0x28, 0xdc, 0x10, 0xa7, 0x1c, 0x10, 0x12, 0x12, 0x20, 0x1f, - 0x72, 0xe2, 0xc6, 0xcd, 0x07, 0x0e, 0x51, 0xc4, 0x01, 0xe5, 0x60, 0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, 0xf7, 0x52, 0x98, 0xb9, 0x02, 0x33, 0x82, 0x26, 0xee, 0xed, 0xfa, - 0xfc, 0x86, 0xb1, 0x35, 0xef, 0x4c, 0x0b, 0x9a, 0xdc, 0x36, 0x5f, 0x87, 0xd5, 0x1e, 0x0a, 0x89, - 0x8f, 0x04, 0x65, 0xdc, 0x4d, 0xe8, 0x23, 0xcc, 0x5c, 0x0f, 0x25, 0xf5, 0x05, 0x85, 0x31, 0x07, - 0xb6, 0x23, 0x69, 0xda, 0x43, 0x89, 0x79, 0x15, 0x96, 0xf3, 0x51, 0x97, 0x63, 0xa1, 0xe0, 0x8b, - 0x0a, 0xbe, 0x98, 0x1b, 0xee, 0x62, 0x21, 0xb1, 0x97, 0xa1, 0x8a, 0xc2, 0x90, 0x3e, 0x0a, 0x09, - 0x17, 0xf5, 0xa5, 0x8d, 0xa9, 0xad, 0xaa, 0x33, 0x18, 0x30, 0x1b, 0x50, 0xf1, 0x71, 0xdc, 0x57, - 0xc6, 0x65, 0x65, 0xcc, 0x9f, 0x87, 0xab, 0x8e, 0x59, 0xbe, 0xea, 0x5c, 0x82, 0x6a, 0x24, 0xeb, - 0x8b, 0x40, 0x0f, 0x71, 0x7d, 0x65, 0xc3, 0xd8, 0x9a, 0x76, 0x2a, 0x11, 0x89, 0xef, 0xca, 0x67, - 0xd3, 0x82, 0x15, 0x35, 0xbb, 0x4b, 0x62, 0xb9, 0xbe, 0x3d, 0xec, 0xf6, 0x50, 0xc8, 0xeb, 0xab, - 0x1b, 0xc6, 0x56, 0xc5, 0x59, 0x56, 0xa6, 0x03, 0x6d, 0xb9, 0x8f, 0xc2, 0x93, 0x75, 0xe7, 0x25, - 0xb8, 0x74, 0x4a, 0x6d, 0xc9, 0x6b, 0xcf, 0x5f, 0x0d, 0x30, 0x0b, 0x76, 0x07, 0x47, 0xb4, 0x87, - 0xc2, 0x51, 0xa5, 0x67, 0x07, 0xaa, 0x5c, 0xae, 0x89, 0xda, 0xec, 0x93, 0xe7, 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7, 0xa7, 0xf6, 0xac, - 0xba, 0x22, 0x7c, 0xe3, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x84, 0x6b, 0xca, 0xd4, 0xc7, 0x16, - 0x00, 0x00, + // 1753 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x6f, 0x1c, 0x49, + 0x15, 0x77, 0xfb, 0x2b, 0x33, 0x6f, 0xfc, 0xd9, 0x76, 0xf0, 0x78, 0x92, 0x9d, 0x71, 0xcc, 0xb2, + 0x6b, 0x85, 0x75, 0xf7, 0x26, 0xb0, 0xbb, 0x10, 0x2d, 0x02, 0x7f, 0x04, 0xe2, 0x05, 0x27, 0xa6, + 0x13, 0x82, 0x04, 0x12, 0xad, 0x9a, 0xee, 0x4a, 0x4f, 0x29, 0xdd, 0x55, 0xad, 0xaa, 0x9a, 0xc9, + 0xce, 0x0d, 0xed, 0x01, 0x21, 0x21, 0xa1, 0xe5, 0x86, 0x38, 0xed, 0x81, 0x0b, 0xd2, 0x22, 0xe5, + 0x90, 0x3f, 0x00, 0x6e, 0x7b, 0x40, 0x68, 0xb5, 0x27, 0x94, 0x43, 0x40, 0xc9, 0x61, 0x39, 0xf3, + 0x17, 0xa0, 0xaa, 0xae, 0xee, 0x99, 0xf1, 0xd8, 0xce, 0xd8, 0x0e, 0x17, 0x2e, 0xa3, 0xa9, 0xf7, + 0x7e, 0xef, 0xf7, 0x3e, 0xaa, 0xeb, 0xbd, 0xea, 0x86, 0xb7, 0x08, 0x95, 0x98, 0x07, 0x2d, 0x44, + 0xa8, 0x2f, 0x70, 0xd0, 0xe6, 0x44, 0x76, 0xdd, 0x20, 0xe8, 0xb8, 0x29, 0x67, 0x1d, 0x12, 0x62, + 0xee, 0x76, 0xae, 0xb9, 0xf2, 0x43, 0x27, 0xe5, 0x4c, 0x32, 0xfb, 0xab, 0x47, 0xa0, 0x9d, 0x20, + 0xe8, 0x38, 0x39, 0xda, 0xe9, 0x5c, 0xab, 0x2d, 0xa2, 0x84, 0x50, 0xe6, 0xea, 0xdf, 0xcc, 0xae, + 0x76, 0x39, 0x62, 0x2c, 0x8a, 0xb1, 0x8b, 0x52, 0xe2, 0x22, 0x4a, 0x99, 0x44, 0x92, 0x30, 0x2a, + 0x8c, 0xb6, 0x61, 0xb4, 0x7a, 0xd5, 0x6c, 0x3f, 0x70, 0x25, 0x49, 0xb0, 0x90, 0x28, 0x49, 0x0d, + 0xa0, 0x7e, 0x18, 0x10, 0xb6, 0xb9, 0x66, 0x30, 0xfa, 0xd5, 0xc3, 0x7a, 0x44, 0xbb, 0x46, 0xb5, + 0x1c, 0xb1, 0x88, 0xe9, 0xbf, 0xae, 0xfa, 0x97, 0x1b, 0x04, 0x4c, 0x24, 0x4c, 0xf8, 0x99, 0x22, + 0x5b, 0x18, 0xd5, 0x4a, 0xb6, 0x72, 0x13, 0x11, 0xa9, 0xd4, 0x13, 0x11, 0xe5, 0x51, 0x92, 0x66, + 0xe0, 0x06, 0x8c, 0x63, 0x37, 0x88, 0x09, 0xa6, 0x52, 0x69, 0xb3, 0x7f, 0x06, 0x70, 0x7d, 0x94, + 0x52, 0x16, 0x85, 0xca, 0x6c, 0x5c, 0x45, 0x1a, 0x93, 0xa8, 0x25, 0x33, 0x2a, 0xe1, 0x4a, 0x4c, + 0x43, 0xcc, 0x13, 0x92, 0x39, 0xe8, 0xad, 0xf2, 0x28, 0xfa, 0xf4, 0xb2, 0x9b, 0x62, 0xe1, 0x62, + 0xc5, 0x47, 0x03, 0x9c, 0x01, 0xd6, 0x9f, 0x5a, 0xb0, 0xbc, 0x2f, 0xa2, 0x2d, 0x21, 0x48, 0x44, + 0x77, 0x18, 0x15, 0xed, 0x04, 0xf3, 0x1f, 0xe2, 0xae, 0xdd, 0x80, 0x4a, 0x60, 0x96, 0x3e, 0x09, + 0xab, 0xd6, 0x9a, 0xb5, 0x51, 0xf6, 0x20, 0x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, 0x9a, 0x18, 0x2a, 0x55, + 0x31, 0x61, 0x26, 0x47, 0x98, 0x30, 0x53, 0xa7, 0x9b, 0x30, 0xd3, 0x23, 0x4c, 0x98, 0x0b, 0x27, + 0x4d, 0x98, 0xd2, 0x49, 0x13, 0xa6, 0x7c, 0xc6, 0x09, 0x03, 0xa3, 0x4d, 0x98, 0xca, 0xa8, 0x13, + 0xe6, 0x0a, 0x34, 0x8e, 0xd9, 0xb5, 0x7c, 0x67, 0xaf, 0xff, 0xad, 0x02, 0x13, 0xfb, 0x22, 0xb2, + 0x7f, 0x67, 0xc1, 0xe2, 0xf0, 0xeb, 0xee, 0xb7, 0x47, 0xba, 0x65, 0x1f, 0xf5, 0x36, 0x59, 0xdb, + 0x3a, 0xb3, 0x69, 0x1e, 0x9b, 0xfd, 0xa9, 0x05, 0xb5, 0x13, 0xde, 0x42, 0xb7, 0x47, 0xf5, 0x70, + 0x3c, 0x47, 0xed, 0x83, 0xf3, 0x73, 0x9c, 0x10, 0xee, 0xc0, 0x7b, 0xe4, 0x19, 0xc3, 0xed, 0xe7, + 0x38, 0x6b, 0xb8, 0x47, 0xbd, 0x9d, 0xd9, 0xbf, 0xb5, 0x60, 0x61, 0xe8, 0xc5, 0xe6, 0x5b, 0xa3, + 0x3a, 0x38, 0x6c, 0x59, 0xfb, 0xde, 0x59, 0x2d, 0x8b, 0x80, 0x7e, 0x63, 0xc1, 0xfc, 0xe1, 0xdb, + 0xce, 0x7b, 0xa7, 0x65, 0x35, 0x86, 0xb5, 0xef, 0x9e, 0xd1, 0xb0, 0x88, 0xe6, 0x23, 0x0b, 0x66, + 0x06, 0xde, 0x5c, 0xbf, 0x39, 0x2a, 0x63, 0xbf, 0x55, 0xed, 0xfd, 0xb3, 0x58, 0x15, 0x41, 0x24, + 0x30, 0x95, 0xdd, 0x26, 0x36, 0x47, 0xa5, 0xd1, 0xf0, 0xda, 0x3b, 0xa7, 0x82, 0x17, 0xee, 0x52, + 0x98, 0x36, 0x73, 0xdd, 0x39, 0x05, 0xc1, 0x9d, 0xb6, 0xac, 0xbd, 0x7b, 0x3a, 0x7c, 0xe1, 0xf1, + 0x4f, 0x16, 0xac, 0x1e, 0x3f, 0x86, 0x47, 0xee, 0x21, 0xc7, 0x52, 0xd4, 0xf6, 0xce, 0x4d, 0x51, + 0xc4, 0xfa, 0x07, 0x0b, 0x96, 0x8f, 0x9c, 0x80, 0xef, 0x9f, 0xf6, 0x59, 0xeb, 0xb7, 0xae, 0xed, + 0x9e, 0xc7, 0x3a, 0x0f, 0xae, 0x36, 0xf5, 0xcb, 0x2f, 0x1f, 0x5f, 0xb5, 0xb6, 0x7f, 0xfa, 0xd9, + 0xf3, 0xba, 0xf5, 0xf9, 0xf3, 0xba, 0xf5, 0xaf, 0xe7, 0x75, 0xeb, 0xe3, 0x17, 0xf5, 0xb1, 0xcf, + 0x5f, 0xd4, 0xc7, 0xfe, 0xf1, 0xa2, 0x3e, 0xf6, 0xb3, 0xef, 0x44, 0x44, 0xb6, 0xda, 0x4d, 0x27, + 0x60, 0x89, 0xf9, 0x56, 0xeb, 0xf6, 0xfc, 0x6e, 0x16, 0x9f, 0x5a, 0x3b, 0xef, 0xb8, 0x1f, 0x0e, + 0x7e, 0x6f, 0xd5, 0x5f, 0xa6, 0x9a, 0xd3, 0xfa, 0xd5, 0xe1, 0x1b, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0xff, 0x5e, 0x5e, 0x72, 0x81, 0xeb, 0x16, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1891,10 +1891,10 @@ func (m *MsgAssignConsumerKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -2362,10 +2362,10 @@ func (m *MsgConsumerRemoval) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(n10)) i-- dAtA[i] = 0x12 - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -2507,10 +2507,10 @@ func (m *MsgOptIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -2574,10 +2574,10 @@ func (m *MsgOptOut) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0xa } @@ -2644,10 +2644,10 @@ func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, e } i-- dAtA[i] = 0x1a - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0x12 } @@ -2759,10 +2759,10 @@ func (m *MsgConsumerModification) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x20 } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) i-- dAtA[i] = 0x1a } @@ -2823,7 +2823,7 @@ func (m *MsgAssignConsumerKey) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3022,7 +3022,7 @@ func (m *MsgConsumerRemoval) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3084,7 +3084,7 @@ func (m *MsgOptIn) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3118,7 +3118,7 @@ func (m *MsgOptOut) Size() (n int) { } var l int _ = l - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3152,7 +3152,7 @@ func (m *MsgSetConsumerCommissionRate) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3188,7 +3188,7 @@ func (m *MsgConsumerModification) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ChainId) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3272,7 +3272,7 @@ func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3300,7 +3300,7 @@ func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -4696,7 +4696,7 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4724,7 +4724,7 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -5089,7 +5089,7 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5117,7 +5117,7 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -5317,7 +5317,7 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5345,7 +5345,7 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -5545,7 +5545,7 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5573,7 +5573,7 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -5807,7 +5807,7 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5835,7 +5835,7 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { From 27936c5c32af48fe7a9857cb0c41009c86db78c2 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 30 Jul 2024 12:51:21 +0300 Subject: [PATCH 02/41] renamed proposal messages --- .../ccv/provider/v1/tx.proto | 32 +- x/ccv/provider/keeper/msg_server.go | 15 +- x/ccv/provider/keeper/proposal.go | 4 +- x/ccv/provider/types/codec.go | 2 +- x/ccv/provider/types/legacy_proposal.go | 4 +- x/ccv/provider/types/msg.go | 12 +- x/ccv/provider/types/tx.pb.go | 501 +++++++++--------- 7 files changed, 278 insertions(+), 292 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index c1228ba66c..87366d3281 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -24,12 +24,12 @@ service Msg { rpc SubmitConsumerMisbehaviour(MsgSubmitConsumerMisbehaviour) returns (MsgSubmitConsumerMisbehaviourResponse); rpc SubmitConsumerDoubleVoting(MsgSubmitConsumerDoubleVoting) returns (MsgSubmitConsumerDoubleVotingResponse); rpc ConsumerAddition(MsgConsumerAddition) returns (MsgConsumerAdditionResponse); - rpc ConsumerRemoval(MsgConsumerRemoval) returns (MsgConsumerRemovalResponse); + rpc RemoveConsumer(MsgRemoveConsumer) returns (MsgRemoveConsumerResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); rpc OptIn(MsgOptIn) returns (MsgOptInResponse); rpc OptOut(MsgOptOut) returns (MsgOptOutResponse); rpc SetConsumerCommissionRate(MsgSetConsumerCommissionRate) returns (MsgSetConsumerCommissionRateResponse); - rpc ConsumerModification(MsgConsumerModification) returns (MsgConsumerModificationResponse); + rpc UpdateConsumer(MsgUpdateConsumer) returns (MsgUpdateConsumerResponse); } @@ -193,13 +193,9 @@ message MsgConsumerAddition { message MsgConsumerAdditionResponse {} -// MsgConsumerRemoval message contains a governance proposal on the provider chain to -// remove (and stop) a consumer chain. If it passes, all the consumer chain's -// state is removed from the provider chain. The outstanding unbonding operation -// funds are released. -// -// Note: this replaces ConsumerRemovalProposal which is deprecated and will be removed soon -message MsgConsumerRemoval { +// MsgConsumerRemoval defines the message used to remove (and stop) a consumer chain. +// If it passes, all the consumer chain's state is eventually removed from the provider chain. +message MsgRemoveConsumer { option (cosmos.msg.v1.signer) = "authority"; // the consumer id of the consumer chain to be stopped @@ -212,8 +208,8 @@ message MsgConsumerRemoval { string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } -// MsgConsumerRemovalResponse defines response type for MsgConsumerRemoval messages -message MsgConsumerRemovalResponse {} +// MsgRemoveConsumerResponse defines response type for MsgRemoveConsumer messages +message MsgRemoveConsumerResponse {} // ChangeRewardDenomsProposal is a governance proposal on the provider chain to // mutate the set of denoms accepted by the provider as rewards. @@ -294,19 +290,16 @@ message MsgSetConsumerCommissionRate { message MsgSetConsumerCommissionRateResponse {} -// MsgConsumerModification message contains a governance proposal on the provider chain to -// modify a running consumer chain. If it passes, the consumer chain's -// parameters are updated. -// -// Note: this replaces ConsumerModificationProposal which is deprecated and will be removed soon -message MsgConsumerModification { +// MsgConsumerModification defines the message used to modify a running consumer chain. +// If it passes, the consumer chain's parameters are updated. +message MsgUpdateConsumer { option (cosmos.msg.v1.signer) = "authority"; // the title of the proposal string title = 1; // the description of the proposal string description = 2; - // the consumer id of the consumer chain to be modified + // the consumer id of the consumer chain to be updated string consumer_id = 3; // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power @@ -335,4 +328,5 @@ message MsgConsumerModification { bool allow_inactive_vals = 11; } -message MsgConsumerModificationResponse {} +// MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages +message MsgUpdateConsumerResponse {} diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 83f9211b91..a1d8d1f0e0 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -101,11 +101,10 @@ func (k msgServer) ConsumerAddition(goCtx context.Context, msg *types.MsgConsume return &types.MsgConsumerAdditionResponse{}, nil } -// ConsumerRemoval defines an RPC handler method for MsgConsumerRemoval -func (k msgServer) ConsumerRemoval( +// RemoveConsumer defines an RPC handler method for MsgRemoveConsumer +func (k msgServer) RemoveConsumer( goCtx context.Context, - msg *types.MsgConsumerRemoval, -) (*types.MsgConsumerRemovalResponse, error) { + msg *types.MsgRemoveConsumer) (*types.MsgRemoveConsumerResponse, error) { if k.GetAuthority() != msg.Authority { return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) } @@ -116,7 +115,7 @@ func (k msgServer) ConsumerRemoval( return nil, errorsmod.Wrapf(err, "failed handling ConsumerAddition proposal") } - return &types.MsgConsumerRemovalResponse{}, nil + return &types.MsgRemoveConsumerResponse{}, nil } // ChangeRewardDenoms defines a rpc handler method for MsgChangeRewardDenoms @@ -309,7 +308,7 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M return &types.MsgSetConsumerCommissionRateResponse{}, nil } -func (k msgServer) ConsumerModification(goCtx context.Context, msg *types.MsgConsumerModification) (*types.MsgConsumerModificationResponse, error) { +func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateConsumer) (*types.MsgUpdateConsumerResponse, error) { if k.GetAuthority() != msg.Authority { return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) } @@ -317,8 +316,8 @@ func (k msgServer) ConsumerModification(goCtx context.Context, msg *types.MsgCon ctx := sdk.UnwrapSDKContext(goCtx) err := k.Keeper.HandleConsumerModificationProposal(ctx, msg) if err != nil { - return nil, errorsmod.Wrapf(err, "failed handling ConsumerModification proposal") + return nil, errorsmod.Wrapf(err, "failed handling UpdateConsumer proposal") } - return &types.MsgConsumerModificationResponse{}, nil + return &types.MsgUpdateConsumerResponse{}, nil } diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 3eafef20fb..1f631c95a1 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -51,7 +51,7 @@ func (k Keeper) HandleConsumerAdditionProposal(ctx sdk.Context, proposal *types. // Wrapper for the new proposal message MsgConsumerRemoval // Will replace legacy handler HandleLegacyConsumerRemovalProposal -func (k Keeper) HandleConsumerRemovalProposal(ctx sdk.Context, proposal *types.MsgConsumerRemoval) error { +func (k Keeper) HandleConsumerRemovalProposal(ctx sdk.Context, proposal *types.MsgRemoveConsumer) error { p := types.ConsumerRemovalProposal{ ConsumerId: proposal.ConsumerId, StopTime: proposal.StopTime, @@ -72,7 +72,7 @@ func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, proposal *typ } // HandleConsumerModificationProposal modifies a running consumer chain -func (k Keeper) HandleConsumerModificationProposal(ctx sdk.Context, proposal *types.MsgConsumerModification) error { +func (k Keeper) HandleConsumerModificationProposal(ctx sdk.Context, proposal *types.MsgUpdateConsumer) error { p := types.ConsumerModificationProposal{ Title: proposal.Title, Description: proposal.Description, diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index a3593fb22f..edca412b06 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -32,7 +32,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { (*sdk.Msg)(nil), &MsgAssignConsumerKey{}, &MsgConsumerAddition{}, - &MsgConsumerRemoval{}, + &MsgRemoveConsumer{}, &MsgChangeRewardDenoms{}, &MsgUpdateParams{}, ) diff --git a/x/ccv/provider/types/legacy_proposal.go b/x/ccv/provider/types/legacy_proposal.go index 2526a46c89..b4117ab7c0 100644 --- a/x/ccv/provider/types/legacy_proposal.go +++ b/x/ccv/provider/types/legacy_proposal.go @@ -20,8 +20,8 @@ import ( const ( ProposalTypeConsumerAddition = "ConsumerAddition" - ProposalTypeConsumerRemoval = "ConsumerRemoval" - ProposalTypeConsumerModification = "ConsumerModification" + ProposalTypeConsumerRemoval = "RemoveConsumer" + ProposalTypeConsumerModification = "UpdateConsumer" ProposalTypeEquivocation = "Equivocation" ProposalTypeChangeRewardDenoms = "ChangeRewardDenoms" ) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index f5f1f91c1b..9ade81fc84 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -32,8 +32,8 @@ const ( var ( _ sdk.Msg = (*MsgAssignConsumerKey)(nil) _ sdk.Msg = (*MsgConsumerAddition)(nil) - _ sdk.Msg = (*MsgConsumerRemoval)(nil) - _ sdk.Msg = (*MsgConsumerModification)(nil) + _ sdk.Msg = (*MsgRemoveConsumer)(nil) + _ sdk.Msg = (*MsgUpdateConsumer)(nil) _ sdk.Msg = (*MsgChangeRewardDenoms)(nil) _ sdk.Msg = (*MsgSubmitConsumerMisbehaviour)(nil) _ sdk.Msg = (*MsgSubmitConsumerDoubleVoting)(nil) @@ -43,8 +43,8 @@ var ( _ sdk.HasValidateBasic = (*MsgAssignConsumerKey)(nil) _ sdk.HasValidateBasic = (*MsgConsumerAddition)(nil) - _ sdk.HasValidateBasic = (*MsgConsumerRemoval)(nil) - _ sdk.HasValidateBasic = (*MsgConsumerModification)(nil) + _ sdk.HasValidateBasic = (*MsgRemoveConsumer)(nil) + _ sdk.HasValidateBasic = (*MsgUpdateConsumer)(nil) _ sdk.HasValidateBasic = (*MsgChangeRewardDenoms)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerMisbehaviour)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerDoubleVoting)(nil) @@ -293,7 +293,7 @@ func (msg *MsgConsumerAddition) ValidateBasic() error { return nil } -func (msg *MsgConsumerRemoval) ValidateBasic() error { +func (msg *MsgRemoveConsumer) ValidateBasic() error { if err := ValidateConsumerId(msg.ConsumerId); err != nil { return err } @@ -305,7 +305,7 @@ func (msg *MsgConsumerRemoval) ValidateBasic() error { } // ValidateBasic implements the sdk.Msg interface. -func (msg *MsgConsumerModification) ValidateBasic() error { +func (msg *MsgUpdateConsumer) ValidateBasic() error { if err := ValidateConsumerId(msg.ConsumerId); err != nil { return err } diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 440965276d..b09c09f9ca 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -663,13 +663,9 @@ func (m *MsgConsumerAdditionResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConsumerAdditionResponse proto.InternalMessageInfo -// MsgConsumerRemoval message contains a governance proposal on the provider chain to -// remove (and stop) a consumer chain. If it passes, all the consumer chain's -// state is removed from the provider chain. The outstanding unbonding operation -// funds are released. -// -// Note: this replaces ConsumerRemovalProposal which is deprecated and will be removed soon -type MsgConsumerRemoval struct { +// MsgConsumerRemoval defines the message used to remove (and stop) a consumer chain. +// If it passes, all the consumer chain's state is eventually removed from the provider chain. +type MsgRemoveConsumer struct { // the consumer id of the consumer chain to be stopped ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // the time on the provider chain at which all validators are responsible to @@ -679,18 +675,18 @@ type MsgConsumerRemoval struct { Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` } -func (m *MsgConsumerRemoval) Reset() { *m = MsgConsumerRemoval{} } -func (m *MsgConsumerRemoval) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerRemoval) ProtoMessage() {} -func (*MsgConsumerRemoval) Descriptor() ([]byte, []int) { +func (m *MsgRemoveConsumer) Reset() { *m = MsgRemoveConsumer{} } +func (m *MsgRemoveConsumer) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveConsumer) ProtoMessage() {} +func (*MsgRemoveConsumer) Descriptor() ([]byte, []int) { return fileDescriptor_43221a4391e9fbf4, []int{10} } -func (m *MsgConsumerRemoval) XXX_Unmarshal(b []byte) error { +func (m *MsgRemoveConsumer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgConsumerRemoval) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgRemoveConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgConsumerRemoval.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgRemoveConsumer.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -700,55 +696,55 @@ func (m *MsgConsumerRemoval) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgConsumerRemoval) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerRemoval.Merge(m, src) +func (m *MsgRemoveConsumer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveConsumer.Merge(m, src) } -func (m *MsgConsumerRemoval) XXX_Size() int { +func (m *MsgRemoveConsumer) XXX_Size() int { return m.Size() } -func (m *MsgConsumerRemoval) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerRemoval.DiscardUnknown(m) +func (m *MsgRemoveConsumer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveConsumer.DiscardUnknown(m) } -var xxx_messageInfo_MsgConsumerRemoval proto.InternalMessageInfo +var xxx_messageInfo_MsgRemoveConsumer proto.InternalMessageInfo -func (m *MsgConsumerRemoval) GetConsumerId() string { +func (m *MsgRemoveConsumer) GetConsumerId() string { if m != nil { return m.ConsumerId } return "" } -func (m *MsgConsumerRemoval) GetStopTime() time.Time { +func (m *MsgRemoveConsumer) GetStopTime() time.Time { if m != nil { return m.StopTime } return time.Time{} } -func (m *MsgConsumerRemoval) GetAuthority() string { +func (m *MsgRemoveConsumer) GetAuthority() string { if m != nil { return m.Authority } return "" } -// MsgConsumerRemovalResponse defines response type for MsgConsumerRemoval messages -type MsgConsumerRemovalResponse struct { +// MsgRemoveConsumerResponse defines response type for MsgRemoveConsumer messages +type MsgRemoveConsumerResponse struct { } -func (m *MsgConsumerRemovalResponse) Reset() { *m = MsgConsumerRemovalResponse{} } -func (m *MsgConsumerRemovalResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerRemovalResponse) ProtoMessage() {} -func (*MsgConsumerRemovalResponse) Descriptor() ([]byte, []int) { +func (m *MsgRemoveConsumerResponse) Reset() { *m = MsgRemoveConsumerResponse{} } +func (m *MsgRemoveConsumerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveConsumerResponse) ProtoMessage() {} +func (*MsgRemoveConsumerResponse) Descriptor() ([]byte, []int) { return fileDescriptor_43221a4391e9fbf4, []int{11} } -func (m *MsgConsumerRemovalResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgRemoveConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgConsumerRemovalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgRemoveConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgConsumerRemovalResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgRemoveConsumerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -758,17 +754,17 @@ func (m *MsgConsumerRemovalResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *MsgConsumerRemovalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerRemovalResponse.Merge(m, src) +func (m *MsgRemoveConsumerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveConsumerResponse.Merge(m, src) } -func (m *MsgConsumerRemovalResponse) XXX_Size() int { +func (m *MsgRemoveConsumerResponse) XXX_Size() int { return m.Size() } -func (m *MsgConsumerRemovalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerRemovalResponse.DiscardUnknown(m) +func (m *MsgRemoveConsumerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveConsumerResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgConsumerRemovalResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgRemoveConsumerResponse proto.InternalMessageInfo // ChangeRewardDenomsProposal is a governance proposal on the provider chain to // mutate the set of denoms accepted by the provider as rewards. @@ -1118,17 +1114,14 @@ func (m *MsgSetConsumerCommissionRateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetConsumerCommissionRateResponse proto.InternalMessageInfo -// MsgConsumerModification message contains a governance proposal on the provider chain to -// modify a running consumer chain. If it passes, the consumer chain's -// parameters are updated. -// -// Note: this replaces ConsumerModificationProposal which is deprecated and will be removed soon -type MsgConsumerModification struct { +// MsgConsumerModification defines the message used to modify a running consumer chain. +// If it passes, the consumer chain's parameters are updated. +type MsgUpdateConsumer struct { // the title of the proposal Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // the description of the proposal Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the consumer id of the consumer chain to be modified + // the consumer id of the consumer chain to be updated ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power @@ -1157,18 +1150,18 @@ type MsgConsumerModification struct { AllowInactiveVals bool `protobuf:"varint,11,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` } -func (m *MsgConsumerModification) Reset() { *m = MsgConsumerModification{} } -func (m *MsgConsumerModification) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerModification) ProtoMessage() {} -func (*MsgConsumerModification) Descriptor() ([]byte, []int) { +func (m *MsgUpdateConsumer) Reset() { *m = MsgUpdateConsumer{} } +func (m *MsgUpdateConsumer) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateConsumer) ProtoMessage() {} +func (*MsgUpdateConsumer) Descriptor() ([]byte, []int) { return fileDescriptor_43221a4391e9fbf4, []int{20} } -func (m *MsgConsumerModification) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateConsumer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgConsumerModification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgConsumerModification.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateConsumer.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1178,110 +1171,111 @@ func (m *MsgConsumerModification) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *MsgConsumerModification) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerModification.Merge(m, src) +func (m *MsgUpdateConsumer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateConsumer.Merge(m, src) } -func (m *MsgConsumerModification) XXX_Size() int { +func (m *MsgUpdateConsumer) XXX_Size() int { return m.Size() } -func (m *MsgConsumerModification) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerModification.DiscardUnknown(m) +func (m *MsgUpdateConsumer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateConsumer.DiscardUnknown(m) } -var xxx_messageInfo_MsgConsumerModification proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateConsumer proto.InternalMessageInfo -func (m *MsgConsumerModification) GetTitle() string { +func (m *MsgUpdateConsumer) GetTitle() string { if m != nil { return m.Title } return "" } -func (m *MsgConsumerModification) GetDescription() string { +func (m *MsgUpdateConsumer) GetDescription() string { if m != nil { return m.Description } return "" } -func (m *MsgConsumerModification) GetConsumerId() string { +func (m *MsgUpdateConsumer) GetConsumerId() string { if m != nil { return m.ConsumerId } return "" } -func (m *MsgConsumerModification) GetTop_N() uint32 { +func (m *MsgUpdateConsumer) GetTop_N() uint32 { if m != nil { return m.Top_N } return 0 } -func (m *MsgConsumerModification) GetValidatorsPowerCap() uint32 { +func (m *MsgUpdateConsumer) GetValidatorsPowerCap() uint32 { if m != nil { return m.ValidatorsPowerCap } return 0 } -func (m *MsgConsumerModification) GetValidatorSetCap() uint32 { +func (m *MsgUpdateConsumer) GetValidatorSetCap() uint32 { if m != nil { return m.ValidatorSetCap } return 0 } -func (m *MsgConsumerModification) GetAllowlist() []string { +func (m *MsgUpdateConsumer) GetAllowlist() []string { if m != nil { return m.Allowlist } return nil } -func (m *MsgConsumerModification) GetDenylist() []string { +func (m *MsgUpdateConsumer) GetDenylist() []string { if m != nil { return m.Denylist } return nil } -func (m *MsgConsumerModification) GetAuthority() string { +func (m *MsgUpdateConsumer) GetAuthority() string { if m != nil { return m.Authority } return "" } -func (m *MsgConsumerModification) GetMinStake() uint64 { +func (m *MsgUpdateConsumer) GetMinStake() uint64 { if m != nil { return m.MinStake } return 0 } -func (m *MsgConsumerModification) GetAllowInactiveVals() bool { +func (m *MsgUpdateConsumer) GetAllowInactiveVals() bool { if m != nil { return m.AllowInactiveVals } return false } -type MsgConsumerModificationResponse struct { +// MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages +type MsgUpdateConsumerResponse struct { } -func (m *MsgConsumerModificationResponse) Reset() { *m = MsgConsumerModificationResponse{} } -func (m *MsgConsumerModificationResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerModificationResponse) ProtoMessage() {} -func (*MsgConsumerModificationResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpdateConsumerResponse) Reset() { *m = MsgUpdateConsumerResponse{} } +func (m *MsgUpdateConsumerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateConsumerResponse) ProtoMessage() {} +func (*MsgUpdateConsumerResponse) Descriptor() ([]byte, []int) { return fileDescriptor_43221a4391e9fbf4, []int{21} } -func (m *MsgConsumerModificationResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgConsumerModificationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgConsumerModificationResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateConsumerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1291,17 +1285,17 @@ func (m *MsgConsumerModificationResponse) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } -func (m *MsgConsumerModificationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerModificationResponse.Merge(m, src) +func (m *MsgUpdateConsumerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateConsumerResponse.Merge(m, src) } -func (m *MsgConsumerModificationResponse) XXX_Size() int { +func (m *MsgUpdateConsumerResponse) XXX_Size() int { return m.Size() } -func (m *MsgConsumerModificationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerModificationResponse.DiscardUnknown(m) +func (m *MsgUpdateConsumerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateConsumerResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgConsumerModificationResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateConsumerResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") @@ -1314,8 +1308,8 @@ func init() { proto.RegisterType((*MsgUpdateParamsResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParamsResponse") proto.RegisterType((*MsgConsumerAddition)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAddition") proto.RegisterType((*MsgConsumerAdditionResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAdditionResponse") - proto.RegisterType((*MsgConsumerRemoval)(nil), "interchain_security.ccv.provider.v1.MsgConsumerRemoval") - proto.RegisterType((*MsgConsumerRemovalResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerRemovalResponse") + proto.RegisterType((*MsgRemoveConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumer") + proto.RegisterType((*MsgRemoveConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumerResponse") proto.RegisterType((*MsgChangeRewardDenoms)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenoms") proto.RegisterType((*MsgChangeRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenomsResponse") proto.RegisterType((*MsgOptIn)(nil), "interchain_security.ccv.provider.v1.MsgOptIn") @@ -1324,8 +1318,8 @@ func init() { proto.RegisterType((*MsgOptOutResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptOutResponse") proto.RegisterType((*MsgSetConsumerCommissionRate)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRate") proto.RegisterType((*MsgSetConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRateResponse") - proto.RegisterType((*MsgConsumerModification)(nil), "interchain_security.ccv.provider.v1.MsgConsumerModification") - proto.RegisterType((*MsgConsumerModificationResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerModificationResponse") + proto.RegisterType((*MsgUpdateConsumer)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumer") + proto.RegisterType((*MsgUpdateConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumerResponse") } func init() { @@ -1333,117 +1327,116 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 1753 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x6f, 0x1c, 0x49, - 0x15, 0x77, 0xfb, 0x2b, 0x33, 0x6f, 0xfc, 0xd9, 0x76, 0xf0, 0x78, 0x92, 0x9d, 0x71, 0xcc, 0xb2, - 0x6b, 0x85, 0x75, 0xf7, 0x26, 0xb0, 0xbb, 0x10, 0x2d, 0x02, 0x7f, 0x04, 0xe2, 0x05, 0x27, 0xa6, - 0x13, 0x82, 0x04, 0x12, 0xad, 0x9a, 0xee, 0x4a, 0x4f, 0x29, 0xdd, 0x55, 0xad, 0xaa, 0x9a, 0xc9, - 0xce, 0x0d, 0xed, 0x01, 0x21, 0x21, 0xa1, 0xe5, 0x86, 0x38, 0xed, 0x81, 0x0b, 0xd2, 0x22, 0xe5, - 0x90, 0x3f, 0x00, 0x6e, 0x7b, 0x40, 0x68, 0xb5, 0x27, 0x94, 0x43, 0x40, 0xc9, 0x61, 0x39, 0xf3, - 0x17, 0xa0, 0xaa, 0xae, 0xee, 0x99, 0xf1, 0xd8, 0xce, 0xd8, 0x0e, 0x17, 0x2e, 0xa3, 0xa9, 0xf7, - 0x7e, 0xef, 0xf7, 0x3e, 0xaa, 0xeb, 0xbd, 0xea, 0x86, 0xb7, 0x08, 0x95, 0x98, 0x07, 0x2d, 0x44, - 0xa8, 0x2f, 0x70, 0xd0, 0xe6, 0x44, 0x76, 0xdd, 0x20, 0xe8, 0xb8, 0x29, 0x67, 0x1d, 0x12, 0x62, - 0xee, 0x76, 0xae, 0xb9, 0xf2, 0x43, 0x27, 0xe5, 0x4c, 0x32, 0xfb, 0xab, 0x47, 0xa0, 0x9d, 0x20, - 0xe8, 0x38, 0x39, 0xda, 0xe9, 0x5c, 0xab, 0x2d, 0xa2, 0x84, 0x50, 0xe6, 0xea, 0xdf, 0xcc, 0xae, - 0x76, 0x39, 0x62, 0x2c, 0x8a, 0xb1, 0x8b, 0x52, 0xe2, 0x22, 0x4a, 0x99, 0x44, 0x92, 0x30, 0x2a, - 0x8c, 0xb6, 0x61, 0xb4, 0x7a, 0xd5, 0x6c, 0x3f, 0x70, 0x25, 0x49, 0xb0, 0x90, 0x28, 0x49, 0x0d, - 0xa0, 0x7e, 0x18, 0x10, 0xb6, 0xb9, 0x66, 0x30, 0xfa, 0xd5, 0xc3, 0x7a, 0x44, 0xbb, 0x46, 0xb5, - 0x1c, 0xb1, 0x88, 0xe9, 0xbf, 0xae, 0xfa, 0x97, 0x1b, 0x04, 0x4c, 0x24, 0x4c, 0xf8, 0x99, 0x22, - 0x5b, 0x18, 0xd5, 0x4a, 0xb6, 0x72, 0x13, 0x11, 0xa9, 0xd4, 0x13, 0x11, 0xe5, 0x51, 0x92, 0x66, - 0xe0, 0x06, 0x8c, 0x63, 0x37, 0x88, 0x09, 0xa6, 0x52, 0x69, 0xb3, 0x7f, 0x06, 0x70, 0x7d, 0x94, - 0x52, 0x16, 0x85, 0xca, 0x6c, 0x5c, 0x45, 0x1a, 0x93, 0xa8, 0x25, 0x33, 0x2a, 0xe1, 0x4a, 0x4c, - 0x43, 0xcc, 0x13, 0x92, 0x39, 0xe8, 0xad, 0xf2, 0x28, 0xfa, 0xf4, 0xb2, 0x9b, 0x62, 0xe1, 0x62, - 0xc5, 0x47, 0x03, 0x9c, 0x01, 0xd6, 0x9f, 0x5a, 0xb0, 0xbc, 0x2f, 0xa2, 0x2d, 0x21, 0x48, 0x44, - 0x77, 0x18, 0x15, 0xed, 0x04, 0xf3, 0x1f, 0xe2, 0xae, 0xdd, 0x80, 0x4a, 0x60, 0x96, 0x3e, 0x09, - 0xab, 0xd6, 0x9a, 0xb5, 0x51, 0xf6, 0x20, 0x17, 0xed, 0x85, 0xf6, 0x7b, 0x30, 0x9b, 0x47, 0xe7, - 0xa3, 0x30, 0xe4, 0xd5, 0x71, 0x05, 0xd9, 0xb6, 0xff, 0xf3, 0xac, 0x31, 0xd7, 0x45, 0x49, 0x7c, - 0x63, 0x5d, 0x49, 0xb1, 0x10, 0xeb, 0xde, 0x4c, 0x0e, 0xdc, 0x0a, 0x43, 0x6e, 0x5f, 0x81, 0x99, - 0x82, 0xf9, 0x21, 0xee, 0x56, 0x27, 0x34, 0x75, 0xe1, 0x4d, 0x39, 0x7f, 0x1b, 0xa6, 0x55, 0x3c, - 0x98, 0x57, 0x27, 0x35, 0x69, 0xf5, 0x8b, 0x27, 0x9b, 0xcb, 0xa6, 0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xba, 0xf5, 0xaf, 0xe7, 0x75, 0xeb, 0xe3, 0x17, 0xf5, 0xb1, 0xcf, - 0x5f, 0xd4, 0xc7, 0xfe, 0xf1, 0xa2, 0x3e, 0xf6, 0xb3, 0xef, 0x44, 0x44, 0xb6, 0xda, 0x4d, 0x27, - 0x60, 0x89, 0xf9, 0x56, 0xeb, 0xf6, 0xfc, 0x6e, 0x16, 0x9f, 0x5a, 0x3b, 0xef, 0xb8, 0x1f, 0x0e, - 0x7e, 0x6f, 0xd5, 0x5f, 0xa6, 0x9a, 0xd3, 0xfa, 0xd5, 0xe1, 0x1b, 0xff, 0x0d, 0x00, 0x00, 0xff, - 0xff, 0x5e, 0x5e, 0x72, 0x81, 0xeb, 0x16, 0x00, 0x00, + // 1741 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcb, 0x6f, 0x1c, 0x49, + 0x19, 0x77, 0xfb, 0x95, 0x99, 0x1a, 0xdb, 0xb1, 0xdb, 0x0e, 0x6e, 0x4f, 0xb2, 0x33, 0x8e, 0x59, + 0x76, 0xad, 0xb0, 0xee, 0xde, 0x04, 0x36, 0x40, 0x04, 0x08, 0x3f, 0x02, 0xf1, 0x82, 0x13, 0xd3, + 0x09, 0x41, 0x02, 0x89, 0x56, 0x4d, 0x77, 0xa5, 0xa7, 0x94, 0xee, 0xaa, 0x56, 0x55, 0xcd, 0x78, + 0xe7, 0x86, 0xf6, 0x80, 0xf6, 0x84, 0x96, 0x1b, 0xc7, 0x3d, 0x70, 0x41, 0x5a, 0x50, 0x0e, 0x2b, + 0x71, 0x44, 0xdc, 0xf6, 0x84, 0x56, 0x7b, 0x42, 0x39, 0x04, 0x94, 0x1c, 0x96, 0x33, 0x7f, 0x01, + 0xaa, 0x47, 0xf7, 0xbc, 0x6c, 0xa7, 0xed, 0x2c, 0x17, 0x2e, 0xa3, 0xa9, 0xfa, 0x7e, 0xdf, 0xef, + 0x7b, 0x54, 0xd5, 0xf7, 0x55, 0x35, 0x78, 0x0b, 0x13, 0x81, 0x58, 0xd8, 0x86, 0x98, 0x04, 0x1c, + 0x85, 0x1d, 0x86, 0x45, 0xcf, 0x0b, 0xc3, 0xae, 0x97, 0x31, 0xda, 0xc5, 0x11, 0x62, 0x5e, 0xf7, + 0xba, 0x27, 0xde, 0x73, 0x33, 0x46, 0x05, 0xb5, 0xbf, 0x7a, 0x0c, 0xda, 0x0d, 0xc3, 0xae, 0x9b, + 0xa3, 0xdd, 0xee, 0xf5, 0xfa, 0x12, 0x4c, 0x31, 0xa1, 0x9e, 0xfa, 0xd5, 0x7a, 0xf5, 0x2b, 0x31, + 0xa5, 0x71, 0x82, 0x3c, 0x98, 0x61, 0x0f, 0x12, 0x42, 0x05, 0x14, 0x98, 0x12, 0x6e, 0xa4, 0x4d, + 0x23, 0x55, 0xa3, 0x56, 0xe7, 0x91, 0x27, 0x70, 0x8a, 0xb8, 0x80, 0x69, 0x66, 0x00, 0x8d, 0x51, + 0x40, 0xd4, 0x61, 0x8a, 0xc1, 0xc8, 0xd7, 0x46, 0xe5, 0x90, 0xf4, 0x8c, 0x68, 0x25, 0xa6, 0x31, + 0x55, 0x7f, 0x3d, 0xf9, 0x2f, 0x57, 0x08, 0x29, 0x4f, 0x29, 0x0f, 0xb4, 0x40, 0x0f, 0x8c, 0x68, + 0x55, 0x8f, 0xbc, 0x94, 0xc7, 0x32, 0xf4, 0x94, 0xc7, 0xb9, 0x97, 0xb8, 0x15, 0x7a, 0x21, 0x65, + 0xc8, 0x0b, 0x13, 0x8c, 0x88, 0x90, 0x52, 0xfd, 0xcf, 0x00, 0x6e, 0x94, 0x49, 0x65, 0x91, 0x28, + 0xad, 0xe3, 0x49, 0xd2, 0x04, 0xc7, 0x6d, 0xa1, 0xa9, 0xb8, 0x27, 0x10, 0x89, 0x10, 0x4b, 0xb1, + 0x36, 0xd0, 0x1f, 0xe5, 0x5e, 0x0c, 0xc8, 0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1, 0x29, + 0xbe, 0xf4, 0xa1, 0xf6, 0x21, 0x98, 0x4b, 0x07, 0x78, 0x54, 0x6e, 0x6a, 0x37, 0xde, 0x72, 0x71, + 0x2b, 0x74, 0x07, 0xd7, 0xcf, 0x1d, 0x58, 0xb1, 0xee, 0x75, 0x77, 0xd0, 0xb6, 0x3f, 0xc4, 0x70, + 0xeb, 0x2b, 0x83, 0x01, 0xf6, 0x2d, 0x6d, 0xbc, 0x09, 0xbe, 0x76, 0x6a, 0x08, 0x45, 0xb0, 0x4f, + 0x26, 0x8f, 0x09, 0x76, 0x8f, 0x76, 0x5a, 0x09, 0x7a, 0x48, 0x05, 0x26, 0xf1, 0xb9, 0x83, 0x0d, + 0xc0, 0x6a, 0xd4, 0xc9, 0x12, 0x1c, 0x42, 0x81, 0x82, 0x2e, 0x15, 0x28, 0xc8, 0x37, 0x99, 0x89, + 0xfb, 0xcd, 0xc1, 0x30, 0xd5, 0x36, 0x74, 0xf7, 0x72, 0x85, 0x87, 0x54, 0xa0, 0xdb, 0x06, 0xee, + 0x5f, 0x8a, 0x8e, 0x9b, 0xb6, 0x7f, 0x05, 0x56, 0x31, 0x79, 0xc4, 0x60, 0x28, 0x0f, 0x71, 0xd0, + 0x4a, 0x68, 0xf8, 0x38, 0x68, 0x23, 0x18, 0x21, 0xa6, 0x36, 0x4f, 0xed, 0xc6, 0x1b, 0x2f, 0x4b, + 0xec, 0x1d, 0x85, 0xf6, 0x2f, 0xf5, 0x69, 0x76, 0x24, 0x8b, 0x9e, 0x3e, 0x53, 0x6e, 0x07, 0x33, + 0x56, 0xe4, 0xf6, 0x0f, 0x16, 0xb8, 0x78, 0xc0, 0xe3, 0x9f, 0x65, 0x11, 0x14, 0xe8, 0x10, 0x32, + 0x98, 0x72, 0x99, 0x4d, 0xd8, 0x11, 0x6d, 0x2a, 0xcf, 0xf5, 0xcb, 0xb3, 0x59, 0x40, 0xed, 0x7d, + 0x30, 0x9b, 0x29, 0x06, 0x93, 0xbc, 0xa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xa6, 0x8b, + 0x85, 0xf2, 0xa1, 0xd2, 0xb5, 0x7f, 0x0a, 0xec, 0x30, 0xec, 0x2a, 0x97, 0x68, 0x47, 0xe4, 0x8c, + 0x17, 0xca, 0x33, 0x2e, 0x86, 0x61, 0xf7, 0x81, 0xd6, 0x36, 0x94, 0xbf, 0x04, 0xab, 0x82, 0x41, + 0xc2, 0x1f, 0x21, 0x36, 0xca, 0x5b, 0x29, 0xcf, 0x7b, 0x29, 0xe7, 0x18, 0x26, 0xbf, 0x03, 0xd6, + 0x8b, 0xca, 0xcc, 0x50, 0x84, 0xb9, 0x60, 0xb8, 0xd5, 0x51, 0x87, 0x2e, 0x3f, 0x36, 0x4e, 0x55, + 0x6d, 0x82, 0x46, 0x8e, 0xf3, 0x87, 0x60, 0x3f, 0x34, 0x28, 0xfb, 0x1e, 0x78, 0x5d, 0x1d, 0x53, + 0x2e, 0x9d, 0x0b, 0x86, 0x98, 0x94, 0xe9, 0x14, 0x73, 0x2e, 0xd9, 0xc0, 0xba, 0xb5, 0x39, 0xe5, + 0x5f, 0xd5, 0xd8, 0x43, 0xc4, 0xf6, 0x06, 0x90, 0x0f, 0x06, 0x80, 0xf6, 0x16, 0xb0, 0xdb, 0x98, + 0x0b, 0xca, 0x70, 0x08, 0x93, 0x00, 0x11, 0xc1, 0x30, 0xe2, 0x4e, 0x4d, 0xa9, 0x2f, 0xf5, 0x25, + 0xb7, 0xb5, 0xc0, 0x7e, 0x17, 0x5c, 0x3d, 0xd1, 0x68, 0x10, 0xb6, 0x21, 0x21, 0x28, 0x71, 0xe6, + 0x54, 0x28, 0xcd, 0xe8, 0x04, 0x9b, 0xbb, 0x1a, 0x66, 0x2f, 0x83, 0x19, 0x41, 0xb3, 0xe0, 0xae, + 0x33, 0xbf, 0x6e, 0x6d, 0xce, 0xfb, 0xd3, 0x82, 0x66, 0x77, 0xed, 0xb7, 0xc1, 0x4a, 0x17, 0x26, + 0x38, 0x82, 0x82, 0x32, 0x1e, 0x64, 0x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x12, 0x23, 0x1f, + 0x1d, 0x41, 0x16, 0xed, 0x21, 0x42, 0x53, 0x6e, 0x6f, 0x80, 0xf9, 0x48, 0xfd, 0x0b, 0x04, 0x95, + 0x77, 0x28, 0xc7, 0x52, 0xab, 0x59, 0xd3, 0x93, 0x0f, 0xe8, 0x76, 0x14, 0xd9, 0x9b, 0x60, 0xb1, + 0x8f, 0x61, 0xca, 0x82, 0x33, 0xa9, 0x60, 0x0b, 0x39, 0x4c, 0xdb, 0xfd, 0xd2, 0x82, 0x69, 0xaa, + 0x7b, 0xc2, 0xb8, 0xbb, 0x45, 0x40, 0x7f, 0xb7, 0x40, 0xe5, 0x80, 0xc7, 0xf7, 0x32, 0xb1, 0x4f, + 0xfe, 0x2f, 0xee, 0x89, 0x36, 0x58, 0xcc, 0xe3, 0x29, 0x82, 0xfc, 0xd8, 0x02, 0x55, 0x3d, 0x79, + 0xaf, 0x23, 0xfe, 0x87, 0x51, 0xf6, 0x43, 0x98, 0x7a, 0x95, 0x10, 0x96, 0xd5, 0x11, 0xd2, 0xde, + 0x16, 0x31, 0xfc, 0x66, 0x52, 0x5d, 0x80, 0x65, 0x51, 0x31, 0x9e, 0xee, 0xd2, 0xd4, 0x54, 0x37, + 0x1f, 0x0a, 0x34, 0xee, 0xb5, 0x55, 0xd2, 0xeb, 0x91, 0x7c, 0x4c, 0x8e, 0xe5, 0xe3, 0x36, 0x98, + 0x66, 0x50, 0x20, 0x13, 0xd4, 0x75, 0x79, 0xf6, 0x9e, 0x3e, 0x6b, 0x5e, 0xd6, 0x81, 0xf1, 0xe8, + 0xb1, 0x8b, 0xa9, 0x97, 0x42, 0xd1, 0x76, 0x7f, 0x82, 0x62, 0x18, 0xf6, 0xf6, 0x50, 0xf8, 0xf9, + 0x27, 0x5b, 0xc0, 0xc4, 0xbd, 0x87, 0x42, 0x5f, 0xa9, 0x7f, 0x59, 0x0b, 0xfc, 0x06, 0x78, 0xfd, + 0xb4, 0x3c, 0x14, 0x09, 0xfb, 0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0x73, 0x43, 0x0f, 0xd5, 0x6f, 0x96, 0x25, + 0x1c, 0xd4, 0xaa, 0x7f, 0xf7, 0x3c, 0x5a, 0x85, 0x13, 0x29, 0x98, 0xd1, 0xd7, 0x87, 0xad, 0xb2, + 0x34, 0x0a, 0x5e, 0x7f, 0xe7, 0x4c, 0xf0, 0xc2, 0x5c, 0x06, 0x66, 0x4d, 0x23, 0x77, 0xcf, 0x40, + 0x70, 0xaf, 0x23, 0xea, 0x37, 0xcf, 0x86, 0x2f, 0x2c, 0xfe, 0xd1, 0x02, 0x6b, 0x27, 0xf7, 0xdd, + 0xd2, 0x05, 0xe4, 0x44, 0x8a, 0xfa, 0xfe, 0x2b, 0x53, 0x0c, 0x6d, 0xce, 0x91, 0x96, 0x77, 0xf3, + 0x6c, 0xab, 0x7b, 0xf6, 0xcd, 0x79, 0x7c, 0xc9, 0xae, 0xcf, 0xfc, 0xfa, 0x8b, 0x27, 0xd7, 0xac, + 0x9d, 0x9f, 0x7f, 0xfa, 0xbc, 0x61, 0x7d, 0xf6, 0xbc, 0x61, 0xfd, 0xeb, 0x79, 0xc3, 0xfa, 0xf0, + 0x45, 0x63, 0xe2, 0xb3, 0x17, 0x8d, 0x89, 0x7f, 0xbc, 0x68, 0x4c, 0xfc, 0xe2, 0x7b, 0x31, 0x16, + 0xed, 0x4e, 0xcb, 0x0d, 0x69, 0x6a, 0x3e, 0xc4, 0x7a, 0x7d, 0x8b, 0x5b, 0xc5, 0x77, 0xd4, 0xee, + 0x3b, 0xde, 0x7b, 0xc3, 0x1f, 0x53, 0xd5, 0x67, 0xa7, 0xd6, 0xac, 0x7a, 0x18, 0x7c, 0xe3, 0xbf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x87, 0xbe, 0x95, 0xc8, 0x16, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1462,12 +1455,12 @@ type MsgClient interface { SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) - ConsumerRemoval(ctx context.Context, in *MsgConsumerRemoval, opts ...grpc.CallOption) (*MsgConsumerRemovalResponse, error) + RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) - ConsumerModification(ctx context.Context, in *MsgConsumerModification, opts ...grpc.CallOption) (*MsgConsumerModificationResponse, error) + UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) } type msgClient struct { @@ -1514,9 +1507,9 @@ func (c *msgClient) ConsumerAddition(ctx context.Context, in *MsgConsumerAdditio return out, nil } -func (c *msgClient) ConsumerRemoval(ctx context.Context, in *MsgConsumerRemoval, opts ...grpc.CallOption) (*MsgConsumerRemovalResponse, error) { - out := new(MsgConsumerRemovalResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/ConsumerRemoval", in, out, opts...) +func (c *msgClient) RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) { + out := new(MsgRemoveConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", in, out, opts...) if err != nil { return nil, err } @@ -1559,9 +1552,9 @@ func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetCon return out, nil } -func (c *msgClient) ConsumerModification(ctx context.Context, in *MsgConsumerModification, opts ...grpc.CallOption) (*MsgConsumerModificationResponse, error) { - out := new(MsgConsumerModificationResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/ConsumerModification", in, out, opts...) +func (c *msgClient) UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) { + out := new(MsgUpdateConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", in, out, opts...) if err != nil { return nil, err } @@ -1574,12 +1567,12 @@ type MsgServer interface { SubmitConsumerMisbehaviour(context.Context, *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) ConsumerAddition(context.Context, *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) - ConsumerRemoval(context.Context, *MsgConsumerRemoval) (*MsgConsumerRemovalResponse, error) + RemoveConsumer(context.Context, *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) - ConsumerModification(context.Context, *MsgConsumerModification) (*MsgConsumerModificationResponse, error) + UpdateConsumer(context.Context, *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1598,8 +1591,8 @@ func (*UnimplementedMsgServer) SubmitConsumerDoubleVoting(ctx context.Context, r func (*UnimplementedMsgServer) ConsumerAddition(ctx context.Context, req *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ConsumerAddition not implemented") } -func (*UnimplementedMsgServer) ConsumerRemoval(ctx context.Context, req *MsgConsumerRemoval) (*MsgConsumerRemovalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConsumerRemoval not implemented") +func (*UnimplementedMsgServer) RemoveConsumer(ctx context.Context, req *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveConsumer not implemented") } func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") @@ -1613,8 +1606,8 @@ func (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*Msg func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") } -func (*UnimplementedMsgServer) ConsumerModification(ctx context.Context, req *MsgConsumerModification) (*MsgConsumerModificationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConsumerModification not implemented") +func (*UnimplementedMsgServer) UpdateConsumer(ctx context.Context, req *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConsumer not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -1693,20 +1686,20 @@ func _Msg_ConsumerAddition_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Msg_ConsumerRemoval_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConsumerRemoval) +func _Msg_RemoveConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveConsumer) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).ConsumerRemoval(ctx, in) + return srv.(MsgServer).RemoveConsumer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/ConsumerRemoval", + FullMethod: "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConsumerRemoval(ctx, req.(*MsgConsumerRemoval)) + return srv.(MsgServer).RemoveConsumer(ctx, req.(*MsgRemoveConsumer)) } return interceptor(ctx, in, info, handler) } @@ -1783,20 +1776,20 @@ func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } -func _Msg_ConsumerModification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConsumerModification) +func _Msg_UpdateConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateConsumer) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).ConsumerModification(ctx, in) + return srv.(MsgServer).UpdateConsumer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/ConsumerModification", + FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConsumerModification(ctx, req.(*MsgConsumerModification)) + return srv.(MsgServer).UpdateConsumer(ctx, req.(*MsgUpdateConsumer)) } return interceptor(ctx, in, info, handler) } @@ -1822,8 +1815,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_ConsumerAddition_Handler, }, { - MethodName: "ConsumerRemoval", - Handler: _Msg_ConsumerRemoval_Handler, + MethodName: "RemoveConsumer", + Handler: _Msg_RemoveConsumer_Handler, }, { MethodName: "UpdateParams", @@ -1842,8 +1835,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_SetConsumerCommissionRate_Handler, }, { - MethodName: "ConsumerModification", - Handler: _Msg_ConsumerModification_Handler, + MethodName: "UpdateConsumer", + Handler: _Msg_UpdateConsumer_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -2327,7 +2320,7 @@ func (m *MsgConsumerAdditionResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *MsgConsumerRemoval) Marshal() (dAtA []byte, err error) { +func (m *MsgRemoveConsumer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2337,12 +2330,12 @@ func (m *MsgConsumerRemoval) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgConsumerRemoval) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRemoveConsumer) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgConsumerRemoval) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRemoveConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2372,7 +2365,7 @@ func (m *MsgConsumerRemoval) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgConsumerRemovalResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgRemoveConsumerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2382,12 +2375,12 @@ func (m *MsgConsumerRemovalResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgConsumerRemovalResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRemoveConsumerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgConsumerRemovalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRemoveConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2684,7 +2677,7 @@ func (m *MsgSetConsumerCommissionRateResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } -func (m *MsgConsumerModification) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateConsumer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2694,12 +2687,12 @@ func (m *MsgConsumerModification) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgConsumerModification) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateConsumer) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgConsumerModification) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2783,7 +2776,7 @@ func (m *MsgConsumerModification) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *MsgConsumerModificationResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateConsumerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2793,12 +2786,12 @@ func (m *MsgConsumerModificationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgConsumerModificationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateConsumerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgConsumerModificationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3016,7 +3009,7 @@ func (m *MsgConsumerAdditionResponse) Size() (n int) { return n } -func (m *MsgConsumerRemoval) Size() (n int) { +func (m *MsgRemoveConsumer) Size() (n int) { if m == nil { return 0 } @@ -3035,7 +3028,7 @@ func (m *MsgConsumerRemoval) Size() (n int) { return n } -func (m *MsgConsumerRemovalResponse) Size() (n int) { +func (m *MsgRemoveConsumerResponse) Size() (n int) { if m == nil { return 0 } @@ -3174,7 +3167,7 @@ func (m *MsgSetConsumerCommissionRateResponse) Size() (n int) { return n } -func (m *MsgConsumerModification) Size() (n int) { +func (m *MsgUpdateConsumer) Size() (n int) { if m == nil { return 0 } @@ -3226,7 +3219,7 @@ func (m *MsgConsumerModification) Size() (n int) { return n } -func (m *MsgConsumerModificationResponse) Size() (n int) { +func (m *MsgUpdateConsumerResponse) Size() (n int) { if m == nil { return 0 } @@ -4665,7 +4658,7 @@ func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { +func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4688,10 +4681,10 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerRemoval: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRemoveConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerRemoval: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRemoveConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4812,7 +4805,7 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerRemovalResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4835,10 +4828,10 @@ func (m *MsgConsumerRemovalResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerRemovalResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRemoveConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerRemovalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRemoveConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -5712,7 +5705,7 @@ func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5735,10 +5728,10 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerModification: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerModification: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6050,7 +6043,7 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerModificationResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6073,10 +6066,10 @@ func (m *MsgConsumerModificationResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerModificationResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerModificationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From 008553daa683388dd292aa06b24cbfc139dc76b8 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 30 Jul 2024 13:04:10 +0300 Subject: [PATCH 03/41] removed global slash entry --- x/ccv/provider/types/keys.go | 44 ------------------------------- x/ccv/provider/types/keys_test.go | 31 ++-------------------- x/ccv/provider/types/throttle.go | 17 ------------ 3 files changed, 2 insertions(+), 90 deletions(-) delete mode 100644 x/ccv/provider/types/throttle.go diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index bd9ccbd807..2985d9c35a 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -518,50 +518,6 @@ func ParseThrottledPacketDataKey(key []byte) (chainId string, ibcSeqNum uint64, return ParseChainIdAndUintIdKey(ThrottledPacketDataKeyPrefix(), key) } -// GlobalSlashEntryKeyPrefix returns the key for storing a global slash queue entry. -func GlobalSlashEntryKeyPrefix() []byte { - return []byte{mustGetKeyPrefix(GlobalSlashEntryKeyName)} -} - -// GlobalSlashEntryKey returns the key for storing a global slash queue entry. -func GlobalSlashEntryKey(entry GlobalSlashEntry) []byte { - recvTime := uint64(entry.RecvTime.UTC().UnixNano()) - return ccvtypes.AppendMany( - // Append byte prefix - GlobalSlashEntryKeyPrefix(), - // Append time bz - sdk.Uint64ToBigEndian(recvTime), - // Append ibc seq num - sdk.Uint64ToBigEndian(entry.IbcSeqNum), - // Append consumer chain id - []byte(entry.ConsumerChainID), - ) -} - -// MustParseGlobalSlashEntryKey returns the received time and chainID for a global slash queue entry key, -// or panics if the key is invalid. -func MustParseGlobalSlashEntryKey(bz []byte) ( - recvTime time.Time, consumerChainID string, ibcSeqNum uint64, -) { - // Prefix is in first byte - expectedPrefix := GlobalSlashEntryKeyPrefix() - if prefix := bz[:1]; !bytes.Equal(prefix, expectedPrefix) { - panic(fmt.Sprintf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix)) - } - - // 8 bytes for uint64 storing time bytes - timeBz := sdk.BigEndianToUint64(bz[1:9]) - recvTime = time.Unix(0, int64(timeBz)).UTC() - - // 8 bytes for uint64 storing ibc seq num - ibcSeqNum = sdk.BigEndianToUint64(bz[9:17]) - - // ChainID is stored after 8 byte ibc seq num - chainID := string(bz[17:]) - - return recvTime, chainID, ibcSeqNum -} - // ConsumerValidatorsKey returns the key for storing the validator assigned keys for every consumer chain func ConsumerValidatorsKeyPrefix() byte { return mustGetKeyPrefix(ConsumerValidatorsKeyName) diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 800b6ee669..dc0a23a44d 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -73,7 +73,8 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(20), providertypes.ThrottledPacketDataKeyPrefix()) i++ - require.Equal(t, byte(21), providertypes.GlobalSlashEntryKeyPrefix()[0]) + // DEPRECATED + // require.Equal(t, uint8(21), providertypes.GlobalSlashEntryKeyPrefix()[0]) i++ require.Equal(t, byte(22), providertypes.ConsumerValidatorsKeyPrefix()) i++ @@ -168,7 +169,6 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.PendingVSCsKey("chainID"), providertypes.ThrottledPacketDataSizeKey("chainID"), providertypes.ThrottledPacketDataKey("chainID", 88), - providertypes.GlobalSlashEntryKey(providertypes.GlobalSlashEntry{}), providertypes.ConsumerValidatorsKey("chainID", providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.ValidatorsByConsumerAddrKey("chainID", providertypes.NewConsumerConsAddress([]byte{0x05})), providertypes.SlashLogKey(providertypes.NewProviderConsAddress([]byte{0x05})), @@ -270,33 +270,6 @@ func TestThrottledPacketDataKeyAndParse(t *testing.T) { require.NotEqual(t, key1, key2) } -// Tests the construction and parsing of keys for global slash entries -func TestGlobalSlashEntryKeyAndParse(t *testing.T) { - now := time.Now() - - providerConsAddrs := []providertypes.ProviderConsAddress{ - cryptoutil.NewCryptoIdentityFromIntSeed(0).ProviderConsAddress(), - cryptoutil.NewCryptoIdentityFromIntSeed(1).ProviderConsAddress(), - cryptoutil.NewCryptoIdentityFromIntSeed(2).ProviderConsAddress(), - } - - entries := []providertypes.GlobalSlashEntry{} - entries = append(entries, providertypes.NewGlobalSlashEntry(now, "chain-0", 2, providerConsAddrs[0])) - entries = append(entries, providertypes.NewGlobalSlashEntry(now.Add(2*time.Hour), "chain-7896978", 3, providerConsAddrs[1])) - entries = append(entries, providertypes.NewGlobalSlashEntry(now.Add(3*time.Hour), "chain-1", 4723894, providerConsAddrs[2])) - - for _, entry := range entries { - key := providertypes.GlobalSlashEntryKey(entry) - require.NotEmpty(t, key) - // This key should be of set length: prefix + 8 + 8 + chainID - require.Equal(t, 1+8+8+len(entry.ConsumerChainID), len(key)) - parsedRecvTime, parsedChainID, parsedIBCSeqNum := providertypes.MustParseGlobalSlashEntryKey(key) - require.Equal(t, entry.RecvTime, parsedRecvTime) - require.Equal(t, entry.ConsumerChainID, parsedChainID) - require.Equal(t, entry.IbcSeqNum, parsedIBCSeqNum) - } -} - // Tests the construction and parsing of ChainIdAndConsAddr keys func TestChainIdAndConsAddrAndParse(t *testing.T) { cIds := []*cryptoutil.CryptoIdentity{ diff --git a/x/ccv/provider/types/throttle.go b/x/ccv/provider/types/throttle.go deleted file mode 100644 index e41396eb3a..0000000000 --- a/x/ccv/provider/types/throttle.go +++ /dev/null @@ -1,17 +0,0 @@ -package types - -import ( - "time" -) - -// NewGlobalSlashEntry creates a new GlobalSlashEntry. -func NewGlobalSlashEntry(recvTime time.Time, consumerChainID string, - ibcSeqNum uint64, providerValConsAddr ProviderConsAddress, -) GlobalSlashEntry { - return GlobalSlashEntry{ - RecvTime: recvTime.UTC(), // UTC prevents serialization inconsistencies - ConsumerChainID: consumerChainID, - IbcSeqNum: ibcSeqNum, - ProviderValConsAddr: providerValConsAddr.ToSdkConsAddr(), - } -} From da27847b093b37f0c0a93ed86f48f474825c2f32 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 30 Jul 2024 13:14:15 +0300 Subject: [PATCH 04/41] fixed unit tests --- tests/integration/setup.go | 2 +- x/ccv/provider/keeper/genesis_test.go | 4 +- x/ccv/provider/keeper/grpc_query_test.go | 10 ++-- x/ccv/provider/keeper/legacy_proposal_test.go | 6 +-- x/ccv/provider/keeper/proposal_test.go | 50 +++++++++---------- x/ccv/provider/types/keys.go | 3 +- x/ccv/provider/types/msg_test.go | 2 +- 7 files changed, 39 insertions(+), 38 deletions(-) diff --git a/tests/integration/setup.go b/tests/integration/setup.go index c9b625cd0d..eeb980200f 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -156,7 +156,7 @@ func (suite *CCVTestSuite) SetupTest() { preProposalKeyAssignment(suite, icstestingutils.FirstConsumerChainID) // remove props so they don't interfere with the rest of the setup - c // if not removed here, setupConsumerCallback will have 2 proposals for adding the first consumer chain + // if not removed here, setupConsumerCallback will have 2 proposals for adding the first consumer chain providerKeeper.DeletePendingConsumerAdditionProps(suite.providerCtx(), ps...) // start consumer chains diff --git a/x/ccv/provider/keeper/genesis_test.go b/x/ccv/provider/keeper/genesis_test.go index 82069b4b8d..dcdfb1519c 100644 --- a/x/ccv/provider/keeper/genesis_test.go +++ b/x/ccv/provider/keeper/genesis_test.go @@ -67,8 +67,8 @@ func TestInitAndExportGenesis(t *testing.T) { SpawnTime: oneHourFromNow, }}, []providertypes.ConsumerRemovalProposal{{ - ChainId: cChainIDs[0], - StopTime: oneHourFromNow, + ConsumerId: cChainIDs[0], + StopTime: oneHourFromNow, }}, params, []providertypes.ValidatorConsumerPubKey{ diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index 27e6d00155..53056910ad 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -50,12 +50,12 @@ func TestQueryAllPairsValConAddrByConsumerChainID(t *testing.T) { require.Error(t, err) // Request with chainId is invalid - response, err := pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ChainId: "invalidChainId"}) + response, err := pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ConsumerId: "invalidChainId"}) require.NoError(t, err) require.Equal(t, []*types.PairValConAddrProviderAndConsumer{}, response.PairValConAddr) // Request is valid - response, err = pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ChainId: chainID}) + response, err = pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ConsumerId: chainID}) require.NoError(t, err) expectedResult := types.PairValConAddrProviderAndConsumer{ @@ -74,7 +74,7 @@ func TestQueryConsumerChainOptedInValidators(t *testing.T) { defer ctrl.Finish() req := types.QueryConsumerChainOptedInValidatorsRequest{ - ChainId: chainID, + ConsumerId: chainID, } // error returned from not yet proposed or not yet registered chain @@ -103,7 +103,7 @@ func TestQueryConsumerValidators(t *testing.T) { defer ctrl.Finish() req := types.QueryConsumerValidatorsRequest{ - ChainId: chainID, + ConsumerId: chainID, } // error returned from not-started chain @@ -204,7 +204,7 @@ func TestQueryValidatorConsumerCommissionRate(t *testing.T) { providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) req := types.QueryValidatorConsumerCommissionRateRequest{ - ChainId: chainID, + ConsumerId: chainID, ProviderAddress: providerAddr.String(), } diff --git a/x/ccv/provider/keeper/legacy_proposal_test.go b/x/ccv/provider/keeper/legacy_proposal_test.go index 23c2c6a948..cfde12c3f8 100644 --- a/x/ccv/provider/keeper/legacy_proposal_test.go +++ b/x/ccv/provider/keeper/legacy_proposal_test.go @@ -243,7 +243,7 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { gomock.InOrder(testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) } - tc.setupMocks(ctx, providerKeeper, tc.prop.ChainId) + tc.setupMocks(ctx, providerKeeper, tc.prop.ConsumerId) err := providerKeeper.HandleLegacyConsumerRemovalProposal(ctx, tc.prop) @@ -251,7 +251,7 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { require.NoError(t, err) // Proposal should be stored as pending - found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ChainId, tc.prop.StopTime) + found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ConsumerId, tc.prop.StopTime) require.True(t, found) // confirm that the channel was not closed @@ -261,7 +261,7 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { require.Error(t, err) // Expect no pending proposal to exist - found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ChainId, tc.prop.StopTime) + found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ConsumerId, tc.prop.StopTime) require.False(t, found) } diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 472cb3c64c..ade3eaa4b2 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -455,11 +455,11 @@ func TestPendingConsumerRemovalPropDeletion(t *testing.T) { ExpDeleted bool }{ { - ConsumerRemovalProposal: providertypes.ConsumerRemovalProposal{ChainId: "8", StopTime: time.Now().UTC()}, + ConsumerRemovalProposal: providertypes.ConsumerRemovalProposal{ConsumerId: "8", StopTime: time.Now().UTC()}, ExpDeleted: true, }, { - ConsumerRemovalProposal: providertypes.ConsumerRemovalProposal{ChainId: "9", StopTime: time.Now().UTC().Add(time.Hour)}, + ConsumerRemovalProposal: providertypes.ConsumerRemovalProposal{ConsumerId: "9", StopTime: time.Now().UTC().Add(time.Hour)}, ExpDeleted: false, }, } @@ -478,13 +478,13 @@ func TestPendingConsumerRemovalPropDeletion(t *testing.T) { providerKeeper.DeletePendingConsumerRemovalProps(ctx, propsToExecute...) numDeleted := 0 for _, tc := range testCases { - res := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.ChainId, tc.StopTime) + res := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.ConsumerId, tc.StopTime) if !tc.ExpDeleted { - require.NotEmpty(t, res, "consumer removal prop was deleted: %s %s", tc.ChainId, tc.StopTime.String()) + require.NotEmpty(t, res, "consumer removal prop was deleted: %s %s", tc.ConsumerId, tc.StopTime.String()) continue } - require.Empty(t, res, "consumer removal prop was not deleted %s %s", tc.ChainId, tc.StopTime.String()) - require.Equal(t, propsToExecute[numDeleted].ChainId, tc.ChainId) + require.Empty(t, res, "consumer removal prop was not deleted %s %s", tc.ConsumerId, tc.StopTime.String()) + require.Equal(t, propsToExecute[numDeleted].ConsumerId, tc.ConsumerId) numDeleted += 1 } } @@ -493,11 +493,11 @@ func TestPendingConsumerRemovalPropDeletion(t *testing.T) { // that are ready to execute are accessed in order by timestamp via the iterator func TestGetConsumerRemovalPropsToExecute(t *testing.T) { now := time.Now().UTC() - sampleProp1 := providertypes.ConsumerRemovalProposal{ChainId: "chain-2", StopTime: now} - sampleProp2 := providertypes.ConsumerRemovalProposal{ChainId: "chain-1", StopTime: now.Add(time.Hour)} - sampleProp3 := providertypes.ConsumerRemovalProposal{ChainId: "chain-4", StopTime: now.Add(-time.Hour)} - sampleProp4 := providertypes.ConsumerRemovalProposal{ChainId: "chain-3", StopTime: now} - sampleProp5 := providertypes.ConsumerRemovalProposal{ChainId: "chain-1", StopTime: now.Add(2 * time.Hour)} + sampleProp1 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-2", StopTime: now} + sampleProp2 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-1", StopTime: now.Add(time.Hour)} + sampleProp3 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-4", StopTime: now.Add(-time.Hour)} + sampleProp4 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-3", StopTime: now} + sampleProp5 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-1", StopTime: now.Add(2 * time.Hour)} getExpectedOrder := func(props []providertypes.ConsumerRemovalProposal, accessTime time.Time) []providertypes.ConsumerRemovalProposal { expectedOrder := []providertypes.ConsumerRemovalProposal{} @@ -510,7 +510,7 @@ func TestGetConsumerRemovalPropsToExecute(t *testing.T) { sort.Slice(expectedOrder, func(i, j int) bool { if expectedOrder[i].StopTime.UTC() == expectedOrder[j].StopTime.UTC() { // proposals with same StopTime - return expectedOrder[i].ChainId < expectedOrder[j].ChainId + return expectedOrder[i].ConsumerId < expectedOrder[j].ConsumerId } return expectedOrder[i].StopTime.UTC().Before(expectedOrder[j].StopTime.UTC()) }) @@ -569,11 +569,11 @@ func TestGetAllConsumerRemovalProps(t *testing.T) { now := time.Now().UTC() props := []providertypes.ConsumerRemovalProposal{ - {ChainId: "chain-2", StopTime: now}, - {ChainId: "chain-1", StopTime: now.Add(2 * time.Hour)}, - {ChainId: "chain-4", StopTime: now.Add(-time.Hour)}, - {ChainId: "chain-3", StopTime: now.Add(4 * time.Hour)}, - {ChainId: "chain-1", StopTime: now}, + {ConsumerId: "chain-2", StopTime: now}, + {ConsumerId: "chain-1", StopTime: now.Add(2 * time.Hour)}, + {ConsumerId: "chain-4", StopTime: now.Add(-time.Hour)}, + {ConsumerId: "chain-3", StopTime: now.Add(4 * time.Hour)}, + {ConsumerId: "chain-1", StopTime: now}, } expectedGetAllOrder := props // sorting by StopTime.UnixNano() @@ -583,7 +583,7 @@ func TestGetAllConsumerRemovalProps(t *testing.T) { cmpTimestamps := bytes.Compare(sdk.Uint64ToBigEndian(tsi), sdk.Uint64ToBigEndian(tsj)) if cmpTimestamps == 0 { // proposals with same StopTime - return expectedGetAllOrder[i].ChainId < expectedGetAllOrder[j].ChainId + return expectedGetAllOrder[i].ConsumerId < expectedGetAllOrder[j].ConsumerId } return cmpTimestamps == -1 }) @@ -1043,8 +1043,8 @@ func TestBeginBlockCCR(t *testing.T) { // A consumer chain is setup corresponding to each prop, making these mocks necessary testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, 1) expectations = append(expectations, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, - prop.ChainId, clienttypes.NewHeight(2, 3))...) - expectations = append(expectations, testkeeper.GetMocksForSetConsumerChain(ctx, &mocks, prop.ChainId)...) + prop.ConsumerId, clienttypes.NewHeight(2, 3))...) + expectations = append(expectations, testkeeper.GetMocksForSetConsumerChain(ctx, &mocks, prop.ConsumerId)...) } // Only first two consumer chains should be stopped expectations = append(expectations, testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) @@ -1058,7 +1058,7 @@ func TestBeginBlockCCR(t *testing.T) { for _, prop := range pendingProps { // Setup a valid consumer chain for each prop additionProp := testkeeper.GetTestConsumerAdditionProp() - additionProp.ChainId = prop.ChainId + additionProp.ChainId = prop.ConsumerId additionProp.InitialHeight = clienttypes.NewHeight(2, 3) err := providerKeeper.CreateConsumerClient(ctx, additionProp) @@ -1084,15 +1084,15 @@ func TestBeginBlockCCR(t *testing.T) { // Only the 3rd (final) proposal is still stored as pending found := providerKeeper.PendingConsumerRemovalPropExists( - ctx, pendingProps[0].ChainId, pendingProps[0].StopTime) + ctx, pendingProps[0].ConsumerId, pendingProps[0].StopTime) require.False(t, found) found = providerKeeper.PendingConsumerRemovalPropExists( - ctx, pendingProps[1].ChainId, pendingProps[1].StopTime) + ctx, pendingProps[1].ConsumerId, pendingProps[1].StopTime) require.False(t, found) found = providerKeeper.PendingConsumerRemovalPropExists( - ctx, pendingProps[2].ChainId, pendingProps[2].StopTime) + ctx, pendingProps[2].ConsumerId, pendingProps[2].StopTime) require.True(t, found) found = providerKeeper.PendingConsumerRemovalPropExists( - ctx, invalidProp.ChainId, invalidProp.StopTime) + ctx, invalidProp.ConsumerId, invalidProp.StopTime) require.False(t, found) } diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 2985d9c35a..16e5251f69 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -81,7 +81,7 @@ const ( ThrottledPacketDataKeyName = "ThrottledPacketDataKey" - GlobalSlashEntryKeyName = "GlobalSlashEntryKey" + GlobalSlashEntryKeyName = "DeprecatedGlobalSlashEntryKey" ConsumerValidatorsKeyName = "ConsumerValidatorsKey" @@ -223,6 +223,7 @@ func getKeyPrefixes() map[string]byte { ThrottledPacketDataKeyName: 20, // GlobalSlashEntryKey is the key for storing global slash queue entries + // [DEPRECATED] GlobalSlashEntryKeyName: 21, // ConsumerValidatorsKey is the key for storing the validator assigned keys for every consumer chain diff --git a/x/ccv/provider/types/msg_test.go b/x/ccv/provider/types/msg_test.go index 5044c62f75..da6d24d793 100644 --- a/x/ccv/provider/types/msg_test.go +++ b/x/ccv/provider/types/msg_test.go @@ -17,5 +17,5 @@ func TestValidateConsumerId(t *testing.T) { // valid consumer id require.NoError(t, types.ValidateConsumerId("0")) - require.NoError(t, types.ValidateConsumerId("18446744073709551616")) // 2^64 - 1 + require.NoError(t, types.ValidateConsumerId("18446744073709551615")) // 2^64 - 1 } From 8366967bc4dd78fc78f61365434b0a75cce67eba Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 30 Jul 2024 15:09:39 +0300 Subject: [PATCH 05/41] added new messages --- docs/docs/adrs/adr-019-permissionless-ics.md | 6 +- .../ccv/provider/v1/tx.proto | 136 +- x/ccv/provider/keeper/msg_server.go | 14 + x/ccv/provider/keeper/proposal.go | 19 +- x/ccv/provider/types/msg.go | 2 +- x/ccv/provider/types/tx.pb.go | 6541 +++++++++++------ 6 files changed, 4413 insertions(+), 2305 deletions(-) diff --git a/docs/docs/adrs/adr-019-permissionless-ics.md b/docs/docs/adrs/adr-019-permissionless-ics.md index 59b13659a4..0d691e356d 100644 --- a/docs/docs/adrs/adr-019-permissionless-ics.md +++ b/docs/docs/adrs/adr-019-permissionless-ics.md @@ -161,9 +161,9 @@ where `ConsumerRegistrationRecord` contains information about the to-be-launched ```protobuf message ConsumerRegistrationRecord { - // the title of the chain to-be-launched + // the title of the chain to-be-registered string title; - // the description of the chain to-be-launched + // the description of the chain to-be-registered string description; // the chain id of the new consumer chain string chain_id; @@ -183,7 +183,7 @@ To move an Opt In consumer chain to its initialized phase, we issue a `MsgInitia ```protobuf message MsgInitializeConsumer { - // consumer id of the to-be-updated consumer chain + // consumer id of the to-be-initialized consumer chain string consumer_id; // the initialization record that contains initialization parameters for the upcoming chain ConsumerInitializationRecord initialization_record; diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 87366d3281..b6cade34ff 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -23,13 +23,15 @@ service Msg { rpc AssignConsumerKey(MsgAssignConsumerKey) returns (MsgAssignConsumerKeyResponse); rpc SubmitConsumerMisbehaviour(MsgSubmitConsumerMisbehaviour) returns (MsgSubmitConsumerMisbehaviourResponse); rpc SubmitConsumerDoubleVoting(MsgSubmitConsumerDoubleVoting) returns (MsgSubmitConsumerDoubleVotingResponse); + rpc RegisterConsumer(MsgRegisterConsumer) returns (MsgRegisterConsumerResponse); rpc ConsumerAddition(MsgConsumerAddition) returns (MsgConsumerAdditionResponse); + rpc InitializeConsumer(MsgInitializeConsumer) returns (MsgInitializeConsumerResponse); + rpc UpdateConsumer(MsgUpdateConsumer) returns (MsgUpdateConsumerResponse); rpc RemoveConsumer(MsgRemoveConsumer) returns (MsgRemoveConsumerResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); rpc OptIn(MsgOptIn) returns (MsgOptInResponse); rpc OptOut(MsgOptOut) returns (MsgOptOutResponse); rpc SetConsumerCommissionRate(MsgSetConsumerCommissionRate) returns (MsgSetConsumerCommissionRateResponse); - rpc UpdateConsumer(MsgUpdateConsumer) returns (MsgUpdateConsumerResponse); } @@ -295,38 +297,142 @@ message MsgSetConsumerCommissionRateResponse {} message MsgUpdateConsumer { option (cosmos.msg.v1.signer) = "authority"; - // the title of the proposal - string title = 1; - // the description of the proposal - string description = 2; + // signer address + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // the consumer id of the consumer chain to be updated - string consumer_id = 3; + string consumer_id = 2; + + ConsumerUpdateRecord update_record = 3; +} + +// ConsumerUpdateRecord is the record that contains parameters to modify in the to-be-updated chain +message ConsumerUpdateRecord { + // + string owner_address = 1; // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - uint32 top_N = 4; + uint32 top_N = 2; // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - uint32 validators_power_cap = 5; + uint32 validators_power_cap = 3; // Corresponds to the maximum number of validators that can validate a consumer chain. // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - uint32 validator_set_cap = 6; + uint32 validator_set_cap = 4; // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate // the consumer chain. - repeated string allowlist = 7; + repeated string allowlist = 5; // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - repeated string denylist = 8; - // signer address - string authority = 9 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated string denylist = 6; // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - uint64 min_stake = 10; + uint64 min_stake = 7; // Corresponds to whether inactive validators are allowed to validate the consumer chain. - bool allow_inactive_vals = 11; + bool allow_inactive_vals = 8; } // MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages message MsgUpdateConsumerResponse {} + +// MsgRegisterConsumer defines the message that registers a consumer chain +message MsgRegisterConsumer { + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + ConsumerRegistrationRecord registration_record = 2; +} + +// ConsumerRegistrationRecord is the record that contains information for the registered chain +message ConsumerRegistrationRecord { + // the title of the chain to-be-registered + string title = 1; + // the description of the chain to-be-registered + string description = 2; + // the chain id of the new consumer chain + string chain_id = 3; +} + +// MsgRegisterConsumerResponse defines response type for MsgRegisterConsumer +message MsgRegisterConsumerResponse { + string consumer_id = 1; +} + +// MsgInitializeConsumer defines the message that initializes the consumer chain with the given consumer id +message MsgInitializeConsumer { + option (cosmos.msg.v1.signer) = "authority"; + + // signer address + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // consumer id of the to-be-initialized consumer chain + string consumer_id = 2; + + ConsumerInitializationRecord initialization_record = 3; +} + +// ConsumerInitializationRecord is the record that contains information for the to-be-initialized chain +message ConsumerInitializationRecord { + // ---------- ---------- ---------- + // Following fields are used when the consumer chain launches and are not needed by the provider afterwards. + // ---------- ---------- ---------- + + // the proposed initial height of new consumer chain. + // For a completely new chain, this will be {0,1}. However, it may be + // different if this is a chain that is converting to a consumer chain. + ibc.core.client.v1.Height initial_height = 1 [ (gogoproto.nullable) = false ]; + // The hash of the consumer chain genesis state without the consumer CCV + // module genesis params. It is used for off-chain confirmation of + // genesis.json validity by validators and other parties. + bytes genesis_hash = 2; + // The hash of the consumer chain binary that should be run by validators on + // chain initialization. It is used for off-chain confirmation of binary + // validity by validators and other parties. + bytes binary_hash = 3; + // spawn time is the time on the provider chain at which the consumer chain + // genesis is finalized and all validators will be responsible for starting + // their consumer chain validator node. + google.protobuf.Timestamp spawn_time = 4 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + google.protobuf.Duration unbonding_period = 5 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + + // ---------- ---------- ---------- + // Following fields are used to construct the consumer genesis of the to-be-launched consumer chain + // and are set up as params on the consumer chain. Those params can then be directly modified by the consumer chain. + // ---------- ---------- ---------- + + // Sent CCV related IBC packets will timeout after this duration + google.protobuf.Duration ccv_timeout_period = 6 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // Sent transfer related IBC packets will timeout after this duration + google.protobuf.Duration transfer_timeout_period = 7 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + string consumer_redistribution_fraction = 8; + // BlocksPerDistributionTransmission is the number of blocks between + // ibc-token-transfers from the consumer chain to the provider chain. On + // sending transmission event, `consumer_redistribution_fraction` of the + // accumulated tokens are sent to the consumer redistribution address. + int64 blocks_per_distribution_transmission = 9; + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + int64 historical_entries = 10; + // The ID of a token transfer channel used for the Reward Distribution + // sub-protocol. If DistributionTransmissionChannel == "", a new transfer + // channel is created on top of the same connection as the CCV channel. + // Note that transfer_channel_id is the ID of the channel end on the consumer + // chain. it is most relevant for chains performing a sovereign to consumer + // changeover in order to maintain the existing ibc transfer channel + string distribution_transmission_channel = 11; +} + +// MsgInitializeConsumerResponse defines response type for MsgRegisterConsumer +message MsgInitializeConsumerResponse {} diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index a1d8d1f0e0..91bbd1dabd 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -321,3 +321,17 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon return &types.MsgUpdateConsumerResponse{}, nil } + +// RegisterConsumer registers a consumer chain +func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegisterConsumer) (*types.MsgRegisterConsumerResponse, error) { + //ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.MsgRegisterConsumerResponse{}, nil +} + +// InitializeConsumer registers a consumer chain +func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgInitializeConsumer) (*types.MsgInitializeConsumerResponse, error) { + //ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.MsgInitializeConsumerResponse{}, nil +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 1f631c95a1..822df82ed9 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -74,16 +74,17 @@ func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, proposal *typ // HandleConsumerModificationProposal modifies a running consumer chain func (k Keeper) HandleConsumerModificationProposal(ctx sdk.Context, proposal *types.MsgUpdateConsumer) error { p := types.ConsumerModificationProposal{ - Title: proposal.Title, - Description: proposal.Description, + // TODO (PERMISSIONLESS) + //Title: proposal.UpdateRecord.Title, + //Description: proposal.UpdateRecord.Description, ConsumerId: proposal.ConsumerId, - Top_N: proposal.Top_N, - ValidatorsPowerCap: proposal.ValidatorsPowerCap, - ValidatorSetCap: proposal.ValidatorSetCap, - Allowlist: proposal.Allowlist, - Denylist: proposal.Denylist, - MinStake: proposal.MinStake, - AllowInactiveVals: proposal.AllowInactiveVals, + Top_N: proposal.UpdateRecord.Top_N, + ValidatorsPowerCap: proposal.UpdateRecord.ValidatorsPowerCap, + ValidatorSetCap: proposal.UpdateRecord.ValidatorSetCap, + Allowlist: proposal.UpdateRecord.Allowlist, + Denylist: proposal.UpdateRecord.Denylist, + MinStake: proposal.UpdateRecord.MinStake, + AllowInactiveVals: proposal.UpdateRecord.AllowInactiveVals, } return k.HandleLegacyConsumerModificationProposal(ctx, &p) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 9ade81fc84..9684046f4c 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -310,7 +310,7 @@ func (msg *MsgUpdateConsumer) ValidateBasic() error { return err } - err := ValidatePSSFeatures(msg.Top_N, msg.ValidatorsPowerCap) + err := ValidatePSSFeatures(msg.UpdateRecord.Top_N, msg.UpdateRecord.ValidatorsPowerCap) if err != nil { return errorsmod.Wrapf(ErrInvalidConsumerModificationProposal, "invalid PSS features: %s", err.Error()) } diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index b09c09f9ca..14f6f99a55 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -1117,37 +1117,11 @@ var xxx_messageInfo_MsgSetConsumerCommissionRateResponse proto.InternalMessageIn // MsgConsumerModification defines the message used to modify a running consumer chain. // If it passes, the consumer chain's parameters are updated. type MsgUpdateConsumer struct { - // the title of the proposal - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // the description of the proposal - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the consumer id of the consumer chain to be updated - ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - // Corresponds to the percentage of validators that have to validate the chain under the Top N case. - // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power - // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. - // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - Top_N uint32 `protobuf:"varint,4,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` - // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if - // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the - // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only - // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need - // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - ValidatorsPowerCap uint32 `protobuf:"varint,5,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` - // Corresponds to the maximum number of validators that can validate a consumer chain. - // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - ValidatorSetCap uint32 `protobuf:"varint,6,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate - // the consumer chain. - Allowlist []string `protobuf:"bytes,7,rep,name=allowlist,proto3" json:"allowlist,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - Denylist []string `protobuf:"bytes,8,rep,name=denylist,proto3" json:"denylist,omitempty"` // signer address - Authority string `protobuf:"bytes,9,opt,name=authority,proto3" json:"authority,omitempty"` - // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - MinStake uint64 `protobuf:"varint,10,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` - // Corresponds to whether inactive validators are allowed to validate the consumer chain. - AllowInactiveVals bool `protobuf:"varint,11,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // the consumer id of the consumer chain to be updated + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + UpdateRecord *ConsumerUpdateRecord `protobuf:"bytes,3,opt,name=update_record,json=updateRecord,proto3" json:"update_record,omitempty"` } func (m *MsgUpdateConsumer) Reset() { *m = MsgUpdateConsumer{} } @@ -1183,77 +1157,139 @@ func (m *MsgUpdateConsumer) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateConsumer proto.InternalMessageInfo -func (m *MsgUpdateConsumer) GetTitle() string { +func (m *MsgUpdateConsumer) GetAuthority() string { if m != nil { - return m.Title + return m.Authority } return "" } -func (m *MsgUpdateConsumer) GetDescription() string { +func (m *MsgUpdateConsumer) GetConsumerId() string { if m != nil { - return m.Description + return m.ConsumerId } return "" } -func (m *MsgUpdateConsumer) GetConsumerId() string { +func (m *MsgUpdateConsumer) GetUpdateRecord() *ConsumerUpdateRecord { if m != nil { - return m.ConsumerId + return m.UpdateRecord + } + return nil +} + +// ConsumerUpdateRecord is the record that contains parameters to modify in the to-be-updated chain +type ConsumerUpdateRecord struct { + // + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + Top_N uint32 `protobuf:"varint,2,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + ValidatorsPowerCap uint32 `protobuf:"varint,3,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + ValidatorSetCap uint32 `protobuf:"varint,4,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate + // the consumer chain. + Allowlist []string `protobuf:"bytes,5,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. + Denylist []string `protobuf:"bytes,6,rep,name=denylist,proto3" json:"denylist,omitempty"` + // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. + MinStake uint64 `protobuf:"varint,7,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` + // Corresponds to whether inactive validators are allowed to validate the consumer chain. + AllowInactiveVals bool `protobuf:"varint,8,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` +} + +func (m *ConsumerUpdateRecord) Reset() { *m = ConsumerUpdateRecord{} } +func (m *ConsumerUpdateRecord) String() string { return proto.CompactTextString(m) } +func (*ConsumerUpdateRecord) ProtoMessage() {} +func (*ConsumerUpdateRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{21} +} +func (m *ConsumerUpdateRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsumerUpdateRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsumerUpdateRecord.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 *ConsumerUpdateRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerUpdateRecord.Merge(m, src) +} +func (m *ConsumerUpdateRecord) XXX_Size() int { + return m.Size() +} +func (m *ConsumerUpdateRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerUpdateRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsumerUpdateRecord proto.InternalMessageInfo + +func (m *ConsumerUpdateRecord) GetOwnerAddress() string { + if m != nil { + return m.OwnerAddress } return "" } -func (m *MsgUpdateConsumer) GetTop_N() uint32 { +func (m *ConsumerUpdateRecord) GetTop_N() uint32 { if m != nil { return m.Top_N } return 0 } -func (m *MsgUpdateConsumer) GetValidatorsPowerCap() uint32 { +func (m *ConsumerUpdateRecord) GetValidatorsPowerCap() uint32 { if m != nil { return m.ValidatorsPowerCap } return 0 } -func (m *MsgUpdateConsumer) GetValidatorSetCap() uint32 { +func (m *ConsumerUpdateRecord) GetValidatorSetCap() uint32 { if m != nil { return m.ValidatorSetCap } return 0 } -func (m *MsgUpdateConsumer) GetAllowlist() []string { +func (m *ConsumerUpdateRecord) GetAllowlist() []string { if m != nil { return m.Allowlist } return nil } -func (m *MsgUpdateConsumer) GetDenylist() []string { +func (m *ConsumerUpdateRecord) GetDenylist() []string { if m != nil { return m.Denylist } return nil } -func (m *MsgUpdateConsumer) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateConsumer) GetMinStake() uint64 { +func (m *ConsumerUpdateRecord) GetMinStake() uint64 { if m != nil { return m.MinStake } return 0 } -func (m *MsgUpdateConsumer) GetAllowInactiveVals() bool { +func (m *ConsumerUpdateRecord) GetAllowInactiveVals() bool { if m != nil { return m.AllowInactiveVals } @@ -1268,7 +1304,7 @@ func (m *MsgUpdateConsumerResponse) Reset() { *m = MsgUpdateConsumerResp func (m *MsgUpdateConsumerResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateConsumerResponse) ProtoMessage() {} func (*MsgUpdateConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{21} + return fileDescriptor_43221a4391e9fbf4, []int{22} } func (m *MsgUpdateConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1297,1030 +1333,1069 @@ func (m *MsgUpdateConsumerResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateConsumerResponse proto.InternalMessageInfo -func init() { - proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") - proto.RegisterType((*MsgAssignConsumerKeyResponse)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKeyResponse") - proto.RegisterType((*MsgSubmitConsumerMisbehaviour)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour") - proto.RegisterType((*MsgSubmitConsumerMisbehaviourResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviourResponse") - proto.RegisterType((*MsgSubmitConsumerDoubleVoting)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting") - proto.RegisterType((*MsgSubmitConsumerDoubleVotingResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVotingResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgConsumerAddition)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAddition") - proto.RegisterType((*MsgConsumerAdditionResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAdditionResponse") - proto.RegisterType((*MsgRemoveConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumer") - proto.RegisterType((*MsgRemoveConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumerResponse") - proto.RegisterType((*MsgChangeRewardDenoms)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenoms") - proto.RegisterType((*MsgChangeRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenomsResponse") - proto.RegisterType((*MsgOptIn)(nil), "interchain_security.ccv.provider.v1.MsgOptIn") - proto.RegisterType((*MsgOptInResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptInResponse") - proto.RegisterType((*MsgOptOut)(nil), "interchain_security.ccv.provider.v1.MsgOptOut") - proto.RegisterType((*MsgOptOutResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptOutResponse") - proto.RegisterType((*MsgSetConsumerCommissionRate)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRate") - proto.RegisterType((*MsgSetConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRateResponse") - proto.RegisterType((*MsgUpdateConsumer)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumer") - proto.RegisterType((*MsgUpdateConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumerResponse") +// MsgRegisterConsumer defines the message that registers a consumer chain +type MsgRegisterConsumer struct { + // signer address + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + RegistrationRecord *ConsumerRegistrationRecord `protobuf:"bytes,2,opt,name=registration_record,json=registrationRecord,proto3" json:"registration_record,omitempty"` } -func init() { - proto.RegisterFile("interchain_security/ccv/provider/v1/tx.proto", fileDescriptor_43221a4391e9fbf4) +func (m *MsgRegisterConsumer) Reset() { *m = MsgRegisterConsumer{} } +func (m *MsgRegisterConsumer) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterConsumer) ProtoMessage() {} +func (*MsgRegisterConsumer) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{23} } - -var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 1741 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcb, 0x6f, 0x1c, 0x49, - 0x19, 0x77, 0xfb, 0x95, 0x99, 0x1a, 0xdb, 0xb1, 0xdb, 0x0e, 0x6e, 0x4f, 0xb2, 0x33, 0x8e, 0x59, - 0x76, 0xad, 0xb0, 0xee, 0xde, 0x04, 0x36, 0x40, 0x04, 0x08, 0x3f, 0x02, 0xf1, 0x82, 0x13, 0xd3, - 0x09, 0x41, 0x02, 0x89, 0x56, 0x4d, 0x77, 0xa5, 0xa7, 0x94, 0xee, 0xaa, 0x56, 0x55, 0xcd, 0x78, - 0xe7, 0x86, 0xf6, 0x80, 0xf6, 0x84, 0x96, 0x1b, 0xc7, 0x3d, 0x70, 0x41, 0x5a, 0x50, 0x0e, 0x2b, - 0x71, 0x44, 0xdc, 0xf6, 0x84, 0x56, 0x7b, 0x42, 0x39, 0x04, 0x94, 0x1c, 0x96, 0x33, 0x7f, 0x01, - 0xaa, 0x47, 0xf7, 0xbc, 0x6c, 0xa7, 0xed, 0x2c, 0x17, 0x2e, 0xa3, 0xa9, 0xfa, 0x7e, 0xdf, 0xef, - 0x7b, 0x54, 0xd5, 0xf7, 0x55, 0x35, 0x78, 0x0b, 0x13, 0x81, 0x58, 0xd8, 0x86, 0x98, 0x04, 0x1c, - 0x85, 0x1d, 0x86, 0x45, 0xcf, 0x0b, 0xc3, 0xae, 0x97, 0x31, 0xda, 0xc5, 0x11, 0x62, 0x5e, 0xf7, - 0xba, 0x27, 0xde, 0x73, 0x33, 0x46, 0x05, 0xb5, 0xbf, 0x7a, 0x0c, 0xda, 0x0d, 0xc3, 0xae, 0x9b, - 0xa3, 0xdd, 0xee, 0xf5, 0xfa, 0x12, 0x4c, 0x31, 0xa1, 0x9e, 0xfa, 0xd5, 0x7a, 0xf5, 0x2b, 0x31, - 0xa5, 0x71, 0x82, 0x3c, 0x98, 0x61, 0x0f, 0x12, 0x42, 0x05, 0x14, 0x98, 0x12, 0x6e, 0xa4, 0x4d, - 0x23, 0x55, 0xa3, 0x56, 0xe7, 0x91, 0x27, 0x70, 0x8a, 0xb8, 0x80, 0x69, 0x66, 0x00, 0x8d, 0x51, - 0x40, 0xd4, 0x61, 0x8a, 0xc1, 0xc8, 0xd7, 0x46, 0xe5, 0x90, 0xf4, 0x8c, 0x68, 0x25, 0xa6, 0x31, - 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6, 0xd3, 0x88, 0x69, 0x85, 0x00, 0x7a, 0x4a, 0x01, 0x76, - 0x01, 0xe0, 0x19, 0x3c, 0x22, 0x81, 0x6c, 0x06, 0xce, 0x8c, 0x71, 0x44, 0x17, 0x7a, 0x37, 0x2f, - 0xf4, 0xee, 0x83, 0xbc, 0x53, 0xec, 0x54, 0xa4, 0x23, 0x1f, 0xfe, 0xb3, 0x69, 0xf9, 0x55, 0xa5, - 0x27, 0x25, 0xf6, 0x5d, 0xb0, 0xd8, 0x21, 0x2d, 0x4a, 0x22, 0x4c, 0xe2, 0x20, 0x43, 0x0c, 0xd3, - 0xc8, 0x99, 0x55, 0x54, 0x6b, 0x63, 0x54, 0x7b, 0xa6, 0xa7, 0x68, 0xa6, 0xdf, 0x4b, 0xa6, 0x8b, - 0x85, 0xf2, 0xa1, 0xd2, 0xb5, 0x7f, 0x0a, 0xec, 0x30, 0xec, 0x2a, 0x97, 0x68, 0x47, 0xe4, 0x8c, - 0x17, 0xca, 0x33, 0x2e, 0x86, 0x61, 0xf7, 0x81, 0xd6, 0x36, 0x94, 0xbf, 0x04, 0xab, 0x82, 0x41, - 0xc2, 0x1f, 0x21, 0x36, 0xca, 0x5b, 0x29, 0xcf, 0x7b, 0x29, 0xe7, 0x18, 0x26, 0xbf, 0x03, 0xd6, - 0x8b, 0xca, 0xcc, 0x50, 0x84, 0xb9, 0x60, 0xb8, 0xd5, 0x51, 0x87, 0x2e, 0x3f, 0x36, 0x4e, 0x55, - 0x6d, 0x82, 0x46, 0x8e, 0xf3, 0x87, 0x60, 0x3f, 0x34, 0x28, 0xfb, 0x1e, 0x78, 0x5d, 0x1d, 0x53, - 0x2e, 0x9d, 0x0b, 0x86, 0x98, 0x94, 0xe9, 0x14, 0x73, 0x2e, 0xd9, 0xc0, 0xba, 0xb5, 0x39, 0xe5, - 0x5f, 0xd5, 0xd8, 0x43, 0xc4, 0xf6, 0x06, 0x90, 0x0f, 0x06, 0x80, 0xf6, 0x16, 0xb0, 0xdb, 0x98, - 0x0b, 0xca, 0x70, 0x08, 0x93, 0x00, 0x11, 0xc1, 0x30, 0xe2, 0x4e, 0x4d, 0xa9, 0x2f, 0xf5, 0x25, - 0xb7, 0xb5, 0xc0, 0x7e, 0x17, 0x5c, 0x3d, 0xd1, 0x68, 0x10, 0xb6, 0x21, 0x21, 0x28, 0x71, 0xe6, - 0x54, 0x28, 0xcd, 0xe8, 0x04, 0x9b, 0xbb, 0x1a, 0x66, 0x2f, 0x83, 0x19, 0x41, 0xb3, 0xe0, 0xae, - 0x33, 0xbf, 0x6e, 0x6d, 0xce, 0xfb, 0xd3, 0x82, 0x66, 0x77, 0xed, 0xb7, 0xc1, 0x4a, 0x17, 0x26, - 0x38, 0x82, 0x82, 0x32, 0x1e, 0x64, 0xf4, 0x08, 0xb1, 0x20, 0x84, 0x99, 0xb3, 0xa0, 0x30, 0x76, - 0x5f, 0x76, 0x28, 0x45, 0xbb, 0x30, 0xb3, 0xaf, 0x81, 0xa5, 0x62, 0x36, 0xe0, 0x48, 0x28, 0xf8, - 0x45, 0x05, 0xbf, 0x58, 0x08, 0xee, 0x23, 0x21, 0xb1, 0x57, 0x40, 0x15, 0x26, 0x09, 0x3d, 0x4a, - 0x30, 0x17, 0xce, 0xe2, 0xfa, 0xd4, 0x66, 0xd5, 0xef, 0x4f, 0xd8, 0x75, 0x50, 0x89, 0x10, 0xe9, - 0x29, 0xe1, 0x92, 0x12, 0x16, 0xe3, 0xe1, 0xaa, 0x63, 0x97, 0xaf, 0x3a, 0x97, 0x41, 0x35, 0x95, - 0xf5, 0x45, 0xc0, 0xc7, 0xc8, 0x59, 0x5e, 0xb7, 0x36, 0xa7, 0xfd, 0x4a, 0x8a, 0xc9, 0x7d, 0x39, - 0xb6, 0x5d, 0xb0, 0xac, 0xac, 0x07, 0x98, 0xc8, 0xf5, 0xed, 0xa2, 0xa0, 0x0b, 0x13, 0xee, 0xac, - 0xac, 0x5b, 0x9b, 0x15, 0x7f, 0x49, 0x89, 0xf6,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x7f, 0xbc, 0x68, 0x4c, 0xfc, 0xe2, 0x7b, 0x31, 0x16, - 0xed, 0x4e, 0xcb, 0x0d, 0x69, 0x6a, 0x3e, 0xc4, 0x7a, 0x7d, 0x8b, 0x5b, 0xc5, 0x77, 0xd4, 0xee, - 0x3b, 0xde, 0x7b, 0xc3, 0x1f, 0x53, 0xd5, 0x67, 0xa7, 0xd6, 0xac, 0x7a, 0x18, 0x7c, 0xe3, 0xbf, - 0x01, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x87, 0xbe, 0x95, 0xc8, 0x16, 0x00, 0x00, +func (m *MsgRegisterConsumer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterConsumer.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 *MsgRegisterConsumer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterConsumer.Merge(m, src) +} +func (m *MsgRegisterConsumer) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterConsumer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterConsumer.DiscardUnknown(m) } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +var xxx_messageInfo_MsgRegisterConsumer proto.InternalMessageInfo -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) - SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) - SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) - ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) - RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) - OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) - SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) - UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) +func (m *MsgRegisterConsumer) GetSigner() string { + if m != nil { + return m.Signer + } + return "" } -type msgClient struct { - cc grpc1.ClientConn +func (m *MsgRegisterConsumer) GetRegistrationRecord() *ConsumerRegistrationRecord { + if m != nil { + return m.RegistrationRecord + } + return nil } -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} +// ConsumerRegistrationRecord is the record that contains information for the registered chain +type ConsumerRegistrationRecord struct { + // the title of the chain to-be-registered + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the chain to-be-registered + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the chain id of the new consumer chain + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } -func (c *msgClient) AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) { - out := new(MsgAssignConsumerKeyResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", in, out, opts...) - if err != nil { - return nil, err +func (m *ConsumerRegistrationRecord) Reset() { *m = ConsumerRegistrationRecord{} } +func (m *ConsumerRegistrationRecord) String() string { return proto.CompactTextString(m) } +func (*ConsumerRegistrationRecord) ProtoMessage() {} +func (*ConsumerRegistrationRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{24} +} +func (m *ConsumerRegistrationRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsumerRegistrationRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsumerRegistrationRecord.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *ConsumerRegistrationRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerRegistrationRecord.Merge(m, src) +} +func (m *ConsumerRegistrationRecord) XXX_Size() int { + return m.Size() +} +func (m *ConsumerRegistrationRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerRegistrationRecord.DiscardUnknown(m) } -func (c *msgClient) SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) { - out := new(MsgSubmitConsumerMisbehaviourResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_ConsumerRegistrationRecord proto.InternalMessageInfo + +func (m *ConsumerRegistrationRecord) GetTitle() string { + if m != nil { + return m.Title } - return out, nil + return "" } -func (c *msgClient) SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) { - out := new(MsgSubmitConsumerDoubleVotingResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", in, out, opts...) - if err != nil { - return nil, err +func (m *ConsumerRegistrationRecord) GetDescription() string { + if m != nil { + return m.Description } - return out, nil + return "" } -func (c *msgClient) ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) { - out := new(MsgConsumerAdditionResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/ConsumerAddition", in, out, opts...) - if err != nil { - return nil, err +func (m *ConsumerRegistrationRecord) GetChainId() string { + if m != nil { + return m.ChainId } - return out, nil + return "" } -func (c *msgClient) RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) { - out := new(MsgRemoveConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +// MsgRegisterConsumerResponse defines response type for MsgRegisterConsumer +type MsgRegisterConsumerResponse struct { + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgRegisterConsumerResponse) Reset() { *m = MsgRegisterConsumerResponse{} } +func (m *MsgRegisterConsumerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterConsumerResponse) ProtoMessage() {} +func (*MsgRegisterConsumerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{25} +} +func (m *MsgRegisterConsumerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterConsumerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *MsgRegisterConsumerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterConsumerResponse.Merge(m, src) +} +func (m *MsgRegisterConsumerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterConsumerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterConsumerResponse.DiscardUnknown(m) } -func (c *msgClient) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) { - out := new(MsgOptInResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptIn", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_MsgRegisterConsumerResponse proto.InternalMessageInfo + +func (m *MsgRegisterConsumerResponse) GetConsumerId() string { + if m != nil { + return m.ConsumerId } - return out, nil + return "" } -func (c *msgClient) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) { - out := new(MsgOptOutResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptOut", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +// MsgInitializeConsumer defines the message that initializes the consumer chain with the given consumer id +type MsgInitializeConsumer struct { + // signer address + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // consumer id of the to-be-initialized consumer chain + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + InitializationRecord *ConsumerInitializationRecord `protobuf:"bytes,3,opt,name=initialization_record,json=initializationRecord,proto3" json:"initialization_record,omitempty"` } -func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) { - out := new(MsgSetConsumerCommissionRateResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgInitializeConsumer) Reset() { *m = MsgInitializeConsumer{} } +func (m *MsgInitializeConsumer) String() string { return proto.CompactTextString(m) } +func (*MsgInitializeConsumer) ProtoMessage() {} +func (*MsgInitializeConsumer) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{26} +} +func (m *MsgInitializeConsumer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitializeConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitializeConsumer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *MsgInitializeConsumer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitializeConsumer.Merge(m, src) +} +func (m *MsgInitializeConsumer) XXX_Size() int { + return m.Size() +} +func (m *MsgInitializeConsumer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitializeConsumer.DiscardUnknown(m) } -func (c *msgClient) UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) { - out := new(MsgUpdateConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_MsgInitializeConsumer proto.InternalMessageInfo + +func (m *MsgInitializeConsumer) GetAuthority() string { + if m != nil { + return m.Authority } - return out, nil + return "" } -// MsgServer is the server API for Msg service. -type MsgServer interface { - AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) - SubmitConsumerMisbehaviour(context.Context, *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) - SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) - ConsumerAddition(context.Context, *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) - RemoveConsumer(context.Context, *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) - OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) - SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) - UpdateConsumer(context.Context, *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) +func (m *MsgInitializeConsumer) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" } -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { +func (m *MsgInitializeConsumer) GetInitializationRecord() *ConsumerInitializationRecord { + if m != nil { + return m.InitializationRecord + } + return nil } -func (*UnimplementedMsgServer) AssignConsumerKey(ctx context.Context, req *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AssignConsumerKey not implemented") -} -func (*UnimplementedMsgServer) SubmitConsumerMisbehaviour(ctx context.Context, req *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerMisbehaviour not implemented") -} -func (*UnimplementedMsgServer) SubmitConsumerDoubleVoting(ctx context.Context, req *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerDoubleVoting not implemented") -} -func (*UnimplementedMsgServer) ConsumerAddition(ctx context.Context, req *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConsumerAddition not implemented") +// ConsumerInitializationRecord is the record that contains information for the to-be-initialized chain +type ConsumerInitializationRecord struct { + // the proposed initial height of new consumer chain. + // For a completely new chain, this will be {0,1}. However, it may be + // different if this is a chain that is converting to a consumer chain. + InitialHeight types1.Height `protobuf:"bytes,1,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` + // The hash of the consumer chain genesis state without the consumer CCV + // module genesis params. It is used for off-chain confirmation of + // genesis.json validity by validators and other parties. + GenesisHash []byte `protobuf:"bytes,2,opt,name=genesis_hash,json=genesisHash,proto3" json:"genesis_hash,omitempty"` + // The hash of the consumer chain binary that should be run by validators on + // chain initialization. It is used for off-chain confirmation of binary + // validity by validators and other parties. + BinaryHash []byte `protobuf:"bytes,3,opt,name=binary_hash,json=binaryHash,proto3" json:"binary_hash,omitempty"` + // spawn time is the time on the provider chain at which the consumer chain + // genesis is finalized and all validators will be responsible for starting + // their consumer chain validator node. + SpawnTime time.Time `protobuf:"bytes,4,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + UnbondingPeriod time.Duration `protobuf:"bytes,5,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` + // Sent CCV related IBC packets will timeout after this duration + CcvTimeoutPeriod time.Duration `protobuf:"bytes,6,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` + // Sent transfer related IBC packets will timeout after this duration + TransferTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + ConsumerRedistributionFraction string `protobuf:"bytes,8,opt,name=consumer_redistribution_fraction,json=consumerRedistributionFraction,proto3" json:"consumer_redistribution_fraction,omitempty"` + // BlocksPerDistributionTransmission is the number of blocks between + // ibc-token-transfers from the consumer chain to the provider chain. On + // sending transmission event, `consumer_redistribution_fraction` of the + // accumulated tokens are sent to the consumer redistribution address. + BlocksPerDistributionTransmission int64 `protobuf:"varint,9,opt,name=blocks_per_distribution_transmission,json=blocksPerDistributionTransmission,proto3" json:"blocks_per_distribution_transmission,omitempty"` + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + HistoricalEntries int64 `protobuf:"varint,10,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"` + // The ID of a token transfer channel used for the Reward Distribution + // sub-protocol. If DistributionTransmissionChannel == "", a new transfer + // channel is created on top of the same connection as the CCV channel. + // Note that transfer_channel_id is the ID of the channel end on the consumer + // chain. it is most relevant for chains performing a sovereign to consumer + // changeover in order to maintain the existing ibc transfer channel + DistributionTransmissionChannel string `protobuf:"bytes,11,opt,name=distribution_transmission_channel,json=distributionTransmissionChannel,proto3" json:"distribution_transmission_channel,omitempty"` } -func (*UnimplementedMsgServer) RemoveConsumer(ctx context.Context, req *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveConsumer not implemented") + +func (m *ConsumerInitializationRecord) Reset() { *m = ConsumerInitializationRecord{} } +func (m *ConsumerInitializationRecord) String() string { return proto.CompactTextString(m) } +func (*ConsumerInitializationRecord) ProtoMessage() {} +func (*ConsumerInitializationRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{27} } -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +func (m *ConsumerInitializationRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedMsgServer) OptIn(ctx context.Context, req *MsgOptIn) (*MsgOptInResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OptIn not implemented") +func (m *ConsumerInitializationRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsumerInitializationRecord.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 (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*MsgOptOutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OptOut not implemented") +func (m *ConsumerInitializationRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerInitializationRecord.Merge(m, src) } -func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") +func (m *ConsumerInitializationRecord) XXX_Size() int { + return m.Size() } -func (*UnimplementedMsgServer) UpdateConsumer(ctx context.Context, req *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateConsumer not implemented") +func (m *ConsumerInitializationRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerInitializationRecord.DiscardUnknown(m) } -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} +var xxx_messageInfo_ConsumerInitializationRecord proto.InternalMessageInfo -func _Msg_AssignConsumerKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAssignConsumerKey) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).AssignConsumerKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AssignConsumerKey(ctx, req.(*MsgAssignConsumerKey)) +func (m *ConsumerInitializationRecord) GetInitialHeight() types1.Height { + if m != nil { + return m.InitialHeight } - return interceptor(ctx, in, info, handler) + return types1.Height{} } -func _Msg_SubmitConsumerMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitConsumerMisbehaviour) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, req.(*MsgSubmitConsumerMisbehaviour)) +func (m *ConsumerInitializationRecord) GetGenesisHash() []byte { + if m != nil { + return m.GenesisHash } - return interceptor(ctx, in, info, handler) + return nil } -func _Msg_SubmitConsumerDoubleVoting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitConsumerDoubleVoting) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, req.(*MsgSubmitConsumerDoubleVoting)) +func (m *ConsumerInitializationRecord) GetBinaryHash() []byte { + if m != nil { + return m.BinaryHash } - return interceptor(ctx, in, info, handler) + return nil } -func _Msg_ConsumerAddition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConsumerAddition) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ConsumerAddition(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/ConsumerAddition", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConsumerAddition(ctx, req.(*MsgConsumerAddition)) +func (m *ConsumerInitializationRecord) GetSpawnTime() time.Time { + if m != nil { + return m.SpawnTime } - return interceptor(ctx, in, info, handler) + return time.Time{} } -func _Msg_RemoveConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRemoveConsumer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RemoveConsumer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RemoveConsumer(ctx, req.(*MsgRemoveConsumer)) +func (m *ConsumerInitializationRecord) GetUnbondingPeriod() time.Duration { + if m != nil { + return m.UnbondingPeriod } - return interceptor(ctx, in, info, handler) + return 0 } -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) +func (m *ConsumerInitializationRecord) GetCcvTimeoutPeriod() time.Duration { + if m != nil { + return m.CcvTimeoutPeriod } - return interceptor(ctx, in, info, handler) + return 0 } -func _Msg_OptIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgOptIn) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).OptIn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptIn", +func (m *ConsumerInitializationRecord) GetTransferTimeoutPeriod() time.Duration { + if m != nil { + return m.TransferTimeoutPeriod } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).OptIn(ctx, req.(*MsgOptIn)) + return 0 +} + +func (m *ConsumerInitializationRecord) GetConsumerRedistributionFraction() string { + if m != nil { + return m.ConsumerRedistributionFraction } - return interceptor(ctx, in, info, handler) + return "" } -func _Msg_OptOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgOptOut) - if err := dec(in); err != nil { - return nil, err +func (m *ConsumerInitializationRecord) GetBlocksPerDistributionTransmission() int64 { + if m != nil { + return m.BlocksPerDistributionTransmission } - if interceptor == nil { - return srv.(MsgServer).OptOut(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptOut", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).OptOut(ctx, req.(*MsgOptOut)) - } - return interceptor(ctx, in, info, handler) + return 0 } -func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetConsumerCommissionRate) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetConsumerCommissionRate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetConsumerCommissionRate(ctx, req.(*MsgSetConsumerCommissionRate)) +func (m *ConsumerInitializationRecord) GetHistoricalEntries() int64 { + if m != nil { + return m.HistoricalEntries } - return interceptor(ctx, in, info, handler) + return 0 } -func _Msg_UpdateConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateConsumer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateConsumer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateConsumer(ctx, req.(*MsgUpdateConsumer)) +func (m *ConsumerInitializationRecord) GetDistributionTransmissionChannel() string { + if m != nil { + return m.DistributionTransmissionChannel } - return interceptor(ctx, in, info, handler) + return "" } -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "interchain_security.ccv.provider.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AssignConsumerKey", - Handler: _Msg_AssignConsumerKey_Handler, - }, - { - MethodName: "SubmitConsumerMisbehaviour", - Handler: _Msg_SubmitConsumerMisbehaviour_Handler, - }, - { - MethodName: "SubmitConsumerDoubleVoting", - Handler: _Msg_SubmitConsumerDoubleVoting_Handler, - }, - { - MethodName: "ConsumerAddition", - Handler: _Msg_ConsumerAddition_Handler, - }, - { - MethodName: "RemoveConsumer", - Handler: _Msg_RemoveConsumer_Handler, - }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "OptIn", - Handler: _Msg_OptIn_Handler, - }, - { - MethodName: "OptOut", - Handler: _Msg_OptOut_Handler, - }, - { - MethodName: "SetConsumerCommissionRate", - Handler: _Msg_SetConsumerCommissionRate_Handler, - }, - { - MethodName: "UpdateConsumer", - Handler: _Msg_UpdateConsumer_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "interchain_security/ccv/provider/v1/tx.proto", +// MsgInitializeConsumerResponse defines response type for MsgRegisterConsumer +type MsgInitializeConsumerResponse struct { } -func (m *MsgAssignConsumerKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *MsgInitializeConsumerResponse) Reset() { *m = MsgInitializeConsumerResponse{} } +func (m *MsgInitializeConsumerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgInitializeConsumerResponse) ProtoMessage() {} +func (*MsgInitializeConsumerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{28} +} +func (m *MsgInitializeConsumerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitializeConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitializeConsumerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil +} +func (m *MsgInitializeConsumerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitializeConsumerResponse.Merge(m, src) +} +func (m *MsgInitializeConsumerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgInitializeConsumerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitializeConsumerResponse.DiscardUnknown(m) } -func (m *MsgAssignConsumerKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +var xxx_messageInfo_MsgInitializeConsumerResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") + proto.RegisterType((*MsgAssignConsumerKeyResponse)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKeyResponse") + proto.RegisterType((*MsgSubmitConsumerMisbehaviour)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour") + proto.RegisterType((*MsgSubmitConsumerMisbehaviourResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviourResponse") + proto.RegisterType((*MsgSubmitConsumerDoubleVoting)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting") + proto.RegisterType((*MsgSubmitConsumerDoubleVotingResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVotingResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgConsumerAddition)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAddition") + proto.RegisterType((*MsgConsumerAdditionResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAdditionResponse") + proto.RegisterType((*MsgRemoveConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumer") + proto.RegisterType((*MsgRemoveConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumerResponse") + proto.RegisterType((*MsgChangeRewardDenoms)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenoms") + proto.RegisterType((*MsgChangeRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenomsResponse") + proto.RegisterType((*MsgOptIn)(nil), "interchain_security.ccv.provider.v1.MsgOptIn") + proto.RegisterType((*MsgOptInResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptInResponse") + proto.RegisterType((*MsgOptOut)(nil), "interchain_security.ccv.provider.v1.MsgOptOut") + proto.RegisterType((*MsgOptOutResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptOutResponse") + proto.RegisterType((*MsgSetConsumerCommissionRate)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRate") + proto.RegisterType((*MsgSetConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRateResponse") + proto.RegisterType((*MsgUpdateConsumer)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumer") + proto.RegisterType((*ConsumerUpdateRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerUpdateRecord") + proto.RegisterType((*MsgUpdateConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumerResponse") + proto.RegisterType((*MsgRegisterConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumer") + proto.RegisterType((*ConsumerRegistrationRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerRegistrationRecord") + proto.RegisterType((*MsgRegisterConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumerResponse") + proto.RegisterType((*MsgInitializeConsumer)(nil), "interchain_security.ccv.provider.v1.MsgInitializeConsumer") + proto.RegisterType((*ConsumerInitializationRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerInitializationRecord") + proto.RegisterType((*MsgInitializeConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgInitializeConsumerResponse") } -func (m *MsgAssignConsumerKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - if len(m.ConsumerKey) > 0 { - i -= len(m.ConsumerKey) - copy(dAtA[i:], m.ConsumerKey) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerKey))) - i-- - dAtA[i] = 0x1a - } - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) - i-- - dAtA[i] = 0x12 - } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func init() { + proto.RegisterFile("interchain_security/ccv/provider/v1/tx.proto", fileDescriptor_43221a4391e9fbf4) } -func (m *MsgAssignConsumerKeyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +var fileDescriptor_43221a4391e9fbf4 = []byte{ + // 2008 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4b, 0x6c, 0x1b, 0xc7, + 0x19, 0xd6, 0xea, 0x65, 0x72, 0xf4, 0xb0, 0x34, 0x92, 0x2b, 0x8a, 0x76, 0x44, 0x99, 0x49, 0x13, + 0xc1, 0x8d, 0x96, 0xb1, 0xdb, 0xb8, 0xad, 0xd0, 0xa6, 0xd5, 0xc3, 0xad, 0x95, 0x56, 0xb6, 0xba, + 0x76, 0x5d, 0xa0, 0x05, 0xb2, 0x18, 0xee, 0x8e, 0x97, 0x03, 0x73, 0x77, 0x16, 0x33, 0x43, 0x2a, + 0xea, 0xa9, 0xc8, 0x21, 0xc8, 0xa9, 0x48, 0x81, 0x1e, 0x7a, 0xcc, 0xa1, 0x97, 0x02, 0x29, 0xe0, + 0x43, 0x7a, 0x2e, 0x7a, 0x29, 0x72, 0x2a, 0x82, 0x9c, 0x0a, 0xa3, 0x70, 0x0a, 0xfb, 0x90, 0x9e, + 0x7b, 0xea, 0xb1, 0x98, 0xc7, 0x2e, 0xb9, 0x24, 0x25, 0xad, 0x28, 0x25, 0x87, 0x5c, 0x04, 0xcd, + 0xfc, 0xdf, 0xff, 0xfd, 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, 0x4c, 0xc6, 0x8a, 0xc1, 0x24, 0xef, 0x1b, 0x76, + 0x8e, 0x2a, 0x6a, 0x6b, 0xa3, 0x5b, 0xe3, 0x1f, 0x3f, 0xad, 0x8c, 0x38, 0x86, 0x60, 0x63, 0x56, + 0xc5, 0x93, 0x52, 0x57, 0x97, 0xc1, 0x52, 0x8f, 0x97, 0x69, 0x04, 0x4f, 0x0a, 0x60, 0x61, 0x8f, + 0x07, 0x49, 0x94, 0x9b, 0xbe, 0x4f, 0x64, 0x96, 0xe0, 0x32, 0x28, 0x68, 0xcb, 0x69, 0x0d, 0xb8, + 0xa0, 0xc6, 0xbb, 0x3e, 0xfc, 0x31, 0x98, 0x25, 0x11, 0x11, 0x04, 0x35, 0xdd, 0x06, 0x96, 0xa9, + 0x37, 0x0e, 0x97, 0xd5, 0x62, 0xc8, 0xd2, 0x67, 0x9b, 0x82, 0xa7, 0x16, 0x40, 0x22, 0x8c, 0x7f, + 0x33, 0x46, 0x4f, 0x4f, 0xca, 0x82, 0x10, 0xe0, 0x08, 0x73, 0xc2, 0xdd, 0x06, 0xe2, 0x0d, 0xb5, + 0xa6, 0xd3, 0xce, 0x94, 0x99, 0xbb, 0x8d, 0x78, 0x43, 0x56, 0xa3, 0x3a, 0x89, 0x10, 0x3b, 0xd4, + 0x88, 0x71, 0x85, 0x00, 0x7a, 0x4a, 0x01, 0xb6, 0x01, 0xe0, 0x31, 0x3a, 0x88, 0x5c, 0x79, 0x19, + 0x94, 0x26, 0x8c, 0x23, 0xba, 0xd0, 0xdb, 0x49, 0xa1, 0xb7, 0xef, 0x27, 0x37, 0xc5, 0x56, 0x41, + 0x3a, 0xf2, 0xfe, 0x67, 0x15, 0xcb, 0x29, 0x2a, 0x3d, 0x29, 0x81, 0x77, 0xc0, 0x5c, 0x2b, 0xaa, + 0xd3, 0xc8, 0x27, 0x51, 0xe0, 0xc6, 0x98, 0x11, 0xea, 0x97, 0x26, 0x15, 0xd5, 0x72, 0x1f, 0xd5, + 0x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 0x9e, 0xad, 0x58, 0xff, 0x7e, 0xb6, 0x62, 0xbd, 0xff, 0x7c, 0x65, 0xe4, 0x93, 0xe7, 0x2b, + 0x23, 0xff, 0x7c, 0xbe, 0x32, 0xf2, 0xcb, 0xef, 0x07, 0x44, 0x34, 0x5a, 0x75, 0xdb, 0xa3, 0xa1, + 0xf9, 0xd5, 0xb2, 0xd6, 0x31, 0xbe, 0x9e, 0xfe, 0xe8, 0xd8, 0x7e, 0xbd, 0xf6, 0x76, 0xf6, 0x97, + 0x47, 0xf5, 0x1b, 0x4d, 0x7d, 0x52, 0xbd, 0x52, 0xbe, 0xf9, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xd5, 0xb8, 0x36, 0x0f, 0xf5, 0x1d, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) + SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) + SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) + RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) + ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) + InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) + UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) + RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) + OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) { + out := new(MsgAssignConsumerKeyResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgAssignConsumerKeyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) { + out := new(MsgSubmitConsumerMisbehaviourResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgAssignConsumerKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (c *msgClient) SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) { + out := new(MsgSubmitConsumerDoubleVotingResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgSubmitConsumerMisbehaviour) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) { + out := new(MsgRegisterConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RegisterConsumer", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgSubmitConsumerMisbehaviour) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitConsumerMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Misbehaviour != nil { - { - size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Submitter) > 0 { - i -= len(m.Submitter) - copy(dAtA[i:], m.Submitter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Submitter))) - i-- - dAtA[i] = 0xa +func (c *msgClient) ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) { + out := new(MsgConsumerAdditionResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/ConsumerAddition", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *MsgSubmitConsumerMisbehaviourResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) { + out := new(MsgInitializeConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgSubmitConsumerMisbehaviourResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) { + out := new(MsgUpdateConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgSubmitConsumerMisbehaviourResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func (c *msgClient) RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) { + out := new(MsgRemoveConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgSubmitConsumerDoubleVoting) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgSubmitConsumerDoubleVoting) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) { + out := new(MsgOptInResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptIn", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.InfractionBlockHeader != nil { - { - size, err := m.InfractionBlockHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.DuplicateVoteEvidence != nil { - { - size, err := m.DuplicateVoteEvidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Submitter) > 0 { - i -= len(m.Submitter) - copy(dAtA[i:], m.Submitter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Submitter))) - i-- - dAtA[i] = 0xa +func (c *msgClient) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) { + out := new(MsgOptOutResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptOut", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *MsgSubmitConsumerDoubleVotingResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) { + out := new(MsgSetConsumerCommissionRateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *MsgSubmitConsumerDoubleVotingResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// MsgServer is the server API for Msg service. +type MsgServer interface { + AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) + SubmitConsumerMisbehaviour(context.Context, *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) + SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) + RegisterConsumer(context.Context, *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) + ConsumerAddition(context.Context, *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) + InitializeConsumer(context.Context, *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) + UpdateConsumer(context.Context, *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) + RemoveConsumer(context.Context, *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) + OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) } -func (m *MsgSubmitConsumerDoubleVotingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { } -func (m *MsgUpdateParams) 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 (*UnimplementedMsgServer) AssignConsumerKey(ctx context.Context, req *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AssignConsumerKey not implemented") +} +func (*UnimplementedMsgServer) SubmitConsumerMisbehaviour(ctx context.Context, req *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerMisbehaviour not implemented") +} +func (*UnimplementedMsgServer) SubmitConsumerDoubleVoting(ctx context.Context, req *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerDoubleVoting not implemented") +} +func (*UnimplementedMsgServer) RegisterConsumer(ctx context.Context, req *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterConsumer not implemented") +} +func (*UnimplementedMsgServer) ConsumerAddition(ctx context.Context, req *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConsumerAddition not implemented") +} +func (*UnimplementedMsgServer) InitializeConsumer(ctx context.Context, req *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitializeConsumer not implemented") +} +func (*UnimplementedMsgServer) UpdateConsumer(ctx context.Context, req *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConsumer not implemented") +} +func (*UnimplementedMsgServer) RemoveConsumer(ctx context.Context, req *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveConsumer not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) OptIn(ctx context.Context, req *MsgOptIn) (*MsgOptInResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptIn not implemented") +} +func (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*MsgOptOutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptOut not implemented") +} +func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") } -func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) } -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) +func _Msg_AssignConsumerKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAssignConsumerKey) + if err := dec(in); err != nil { + return nil, err } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa + if interceptor == nil { + return srv.(MsgServer).AssignConsumerKey(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AssignConsumerKey(ctx, req.(*MsgAssignConsumerKey)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_SubmitConsumerMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitConsumerMisbehaviour) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, req.(*MsgSubmitConsumerMisbehaviour)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgConsumerAddition) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_SubmitConsumerDoubleVoting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitConsumerDoubleVoting) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *MsgConsumerAddition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if interceptor == nil { + return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, req.(*MsgSubmitConsumerDoubleVoting)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerAddition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AllowInactiveVals { - i-- - if m.AllowInactiveVals { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa0 +func _Msg_RegisterConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterConsumer) + if err := dec(in); err != nil { + return nil, err } - if m.MinStake != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 + if interceptor == nil { + return srv.(MsgServer).RegisterConsumer(ctx, in) } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/RegisterConsumer", } - if len(m.Denylist) > 0 { - for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denylist[iNdEx]) - copy(dAtA[i:], m.Denylist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterConsumer(ctx, req.(*MsgRegisterConsumer)) } - if len(m.Allowlist) > 0 { - for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Allowlist[iNdEx]) - copy(dAtA[i:], m.Allowlist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConsumerAddition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConsumerAddition) + if err := dec(in); err != nil { + return nil, err } - if m.ValidatorSetCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) - i-- - dAtA[i] = 0x78 + if interceptor == nil { + return srv.(MsgServer).ConsumerAddition(ctx, in) } - if m.ValidatorsPowerCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) - i-- - dAtA[i] = 0x70 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/ConsumerAddition", } - if m.Top_N != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) - i-- - dAtA[i] = 0x68 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConsumerAddition(ctx, req.(*MsgConsumerAddition)) } - if len(m.DistributionTransmissionChannel) > 0 { - i -= len(m.DistributionTransmissionChannel) - copy(dAtA[i:], m.DistributionTransmissionChannel) - i = encodeVarintTx(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) - i-- - dAtA[i] = 0x62 + return interceptor(ctx, in, info, handler) +} + +func _Msg_InitializeConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgInitializeConsumer) + if err := dec(in); err != nil { + return nil, err } - if m.HistoricalEntries != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.HistoricalEntries)) - i-- - dAtA[i] = 0x58 + if interceptor == nil { + return srv.(MsgServer).InitializeConsumer(ctx, in) } - if m.BlocksPerDistributionTransmission != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) - i-- - dAtA[i] = 0x50 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", } - if len(m.ConsumerRedistributionFraction) > 0 { - i -= len(m.ConsumerRedistributionFraction) - copy(dAtA[i:], m.ConsumerRedistributionFraction) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) - i-- - dAtA[i] = 0x4a + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InitializeConsumer(ctx, req.(*MsgInitializeConsumer)) } - n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) - if err5 != nil { - return 0, err5 + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateConsumer) + if err := dec(in); err != nil { + return nil, err } - i -= n5 - i = encodeVarintTx(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x42 - n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) - if err6 != nil { - return 0, err6 + if interceptor == nil { + return srv.(MsgServer).UpdateConsumer(ctx, in) } - i -= n6 - i = encodeVarintTx(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x3a - n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) - if err7 != nil { - return 0, err7 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", } - i -= n7 - i = encodeVarintTx(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x32 - n8, err8 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) - if err8 != nil { - return 0, err8 + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateConsumer(ctx, req.(*MsgUpdateConsumer)) } - i -= n8 - i = encodeVarintTx(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x2a - if len(m.BinaryHash) > 0 { - i -= len(m.BinaryHash) - copy(dAtA[i:], m.BinaryHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.BinaryHash))) - i-- - dAtA[i] = 0x22 + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveConsumer) + if err := dec(in); err != nil { + return nil, err } - if len(m.GenesisHash) > 0 { - i -= len(m.GenesisHash) - copy(dAtA[i:], m.GenesisHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisHash))) - i-- - dAtA[i] = 0x1a + if interceptor == nil { + return srv.(MsgServer).RemoveConsumer(ctx, in) } - { - size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", } - i-- - dAtA[i] = 0x12 - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveConsumer(ctx, req.(*MsgRemoveConsumer)) } - return len(dAtA) - i, nil + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerAdditionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *MsgConsumerAdditionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerAdditionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil +func _Msg_OptIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgOptIn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).OptIn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptIn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).OptIn(ctx, req.(*MsgOptIn)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgRemoveConsumer) Marshal() (dAtA []byte, err error) { +func _Msg_OptOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgOptOut) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).OptOut(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptOut", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).OptOut(ctx, req.(*MsgOptOut)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetConsumerCommissionRate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, req.(*MsgSetConsumerCommissionRate)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "interchain_security.ccv.provider.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AssignConsumerKey", + Handler: _Msg_AssignConsumerKey_Handler, + }, + { + MethodName: "SubmitConsumerMisbehaviour", + Handler: _Msg_SubmitConsumerMisbehaviour_Handler, + }, + { + MethodName: "SubmitConsumerDoubleVoting", + Handler: _Msg_SubmitConsumerDoubleVoting_Handler, + }, + { + MethodName: "RegisterConsumer", + Handler: _Msg_RegisterConsumer_Handler, + }, + { + MethodName: "ConsumerAddition", + Handler: _Msg_ConsumerAddition_Handler, + }, + { + MethodName: "InitializeConsumer", + Handler: _Msg_InitializeConsumer_Handler, + }, + { + MethodName: "UpdateConsumer", + Handler: _Msg_UpdateConsumer_Handler, + }, + { + MethodName: "RemoveConsumer", + Handler: _Msg_RemoveConsumer_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "OptIn", + Handler: _Msg_OptIn_Handler, + }, + { + MethodName: "OptOut", + Handler: _Msg_OptOut_Handler, + }, + { + MethodName: "SetConsumerCommissionRate", + Handler: _Msg_SetConsumerCommissionRate_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "interchain_security/ccv/provider/v1/tx.proto", +} + +func (m *MsgAssignConsumerKey) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2330,31 +2405,37 @@ func (m *MsgRemoveConsumer) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRemoveConsumer) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAssignConsumerKey) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRemoveConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAssignConsumerKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + if len(m.ConsumerKey) > 0 { + i -= len(m.ConsumerKey) + copy(dAtA[i:], m.ConsumerKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerKey))) i-- dAtA[i] = 0x1a } - n10, err10 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) - if err10 != nil { - return 0, err10 + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- + dAtA[i] = 0x12 } - i -= n10 - i = encodeVarintTx(dAtA, i, uint64(n10)) - i-- - dAtA[i] = 0x12 if len(m.ConsumerId) > 0 { i -= len(m.ConsumerId) copy(dAtA[i:], m.ConsumerId) @@ -2365,7 +2446,7 @@ func (m *MsgRemoveConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgRemoveConsumerResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgAssignConsumerKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2375,12 +2456,12 @@ func (m *MsgRemoveConsumerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRemoveConsumerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAssignConsumerKeyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRemoveConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAssignConsumerKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2388,7 +2469,7 @@ func (m *MsgRemoveConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *MsgChangeRewardDenoms) Marshal() (dAtA []byte, err error) { +func (m *MsgSubmitConsumerMisbehaviour) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2398,45 +2479,39 @@ func (m *MsgChangeRewardDenoms) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgChangeRewardDenoms) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerMisbehaviour) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgChangeRewardDenoms) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x1a - } - if len(m.DenomsToRemove) > 0 { - for iNdEx := len(m.DenomsToRemove) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DenomsToRemove[iNdEx]) - copy(dAtA[i:], m.DenomsToRemove[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.DenomsToRemove[iNdEx]))) - i-- - dAtA[i] = 0x12 + if m.Misbehaviour != nil { + { + size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if len(m.DenomsToAdd) > 0 { - for iNdEx := len(m.DenomsToAdd) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DenomsToAdd[iNdEx]) - copy(dAtA[i:], m.DenomsToAdd[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.DenomsToAdd[iNdEx]))) - i-- - dAtA[i] = 0xa - } + if len(m.Submitter) > 0 { + i -= len(m.Submitter) + copy(dAtA[i:], m.Submitter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Submitter))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgChangeRewardDenomsResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgSubmitConsumerMisbehaviourResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2446,12 +2521,12 @@ func (m *MsgChangeRewardDenomsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgChangeRewardDenomsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerMisbehaviourResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgChangeRewardDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerMisbehaviourResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2459,7 +2534,7 @@ func (m *MsgChangeRewardDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *MsgOptIn) Marshal() (dAtA []byte, err error) { +func (m *MsgSubmitConsumerDoubleVoting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2469,48 +2544,51 @@ func (m *MsgOptIn) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgOptIn) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerDoubleVoting) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgOptIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - if len(m.ConsumerKey) > 0 { - i -= len(m.ConsumerKey) - copy(dAtA[i:], m.ConsumerKey) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerKey))) + if m.InfractionBlockHeader != nil { + { + size, err := m.InfractionBlockHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x1a } - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + if m.DuplicateVoteEvidence != nil { + { + size, err := m.DuplicateVoteEvidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + if len(m.Submitter) > 0 { + i -= len(m.Submitter) + copy(dAtA[i:], m.Submitter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Submitter))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgOptInResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgSubmitConsumerDoubleVotingResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2520,12 +2598,12 @@ func (m *MsgOptInResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgOptInResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerDoubleVotingResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgOptInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerDoubleVotingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2533,7 +2611,7 @@ func (m *MsgOptInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgOptOut) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2543,118 +2621,37 @@ func (m *MsgOptOut) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgOptOut) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgOptOut) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x1a - } - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) - i-- - dAtA[i] = 0x12 - } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgOptOutResponse) 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 *MsgOptOutResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgOptOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgSetConsumerCommissionRate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgSetConsumerCommissionRate) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } { - size := m.Rate.Size() - i -= size - if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgSetConsumerCommissionRateResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2664,12 +2661,12 @@ func (m *MsgSetConsumerCommissionRateResponse) Marshal() (dAtA []byte, err error return dAtA[:n], nil } -func (m *MsgSetConsumerCommissionRateResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSetConsumerCommissionRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2677,7 +2674,7 @@ func (m *MsgSetConsumerCommissionRateResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } -func (m *MsgUpdateConsumer) Marshal() (dAtA []byte, err error) { +func (m *MsgConsumerAddition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2687,12 +2684,12 @@ func (m *MsgUpdateConsumer) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateConsumer) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConsumerAddition) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConsumerAddition) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2705,19 +2702,25 @@ func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x58 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 } if m.MinStake != 0 { i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) i-- - dAtA[i] = 0x50 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 } if len(m.Authority) > 0 { i -= len(m.Authority) copy(dAtA[i:], m.Authority) i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 } if len(m.Denylist) > 0 { for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { @@ -2725,7 +2728,9 @@ func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Denylist[iNdEx]) i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a } } if len(m.Allowlist) > 0 { @@ -2734,49 +2739,117 @@ func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Allowlist[iNdEx]) i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } } if m.ValidatorSetCap != 0 { i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x78 } if m.ValidatorsPowerCap != 0 { i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x70 } if m.Top_N != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x68 } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + if len(m.DistributionTransmissionChannel) > 0 { + i -= len(m.DistributionTransmissionChannel) + copy(dAtA[i:], m.DistributionTransmissionChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x62 } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + if m.HistoricalEntries != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.HistoricalEntries)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x58 } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + if m.BlocksPerDistributionTransmission != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) + i-- + dAtA[i] = 0x50 + } + if len(m.ConsumerRedistributionFraction) > 0 { + i -= len(m.ConsumerRedistributionFraction) + copy(dAtA[i:], m.ConsumerRedistributionFraction) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) + i-- + dAtA[i] = 0x4a + } + n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintTx(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x42 + n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x3a + n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x32 + n8, err8 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintTx(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x2a + if len(m.BinaryHash) > 0 { + i -= len(m.BinaryHash) + copy(dAtA[i:], m.BinaryHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.BinaryHash))) + i-- + dAtA[i] = 0x22 + } + if len(m.GenesisHash) > 0 { + i -= len(m.GenesisHash) + copy(dAtA[i:], m.GenesisHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisHash))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgUpdateConsumerResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgConsumerAdditionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2786,12 +2859,12 @@ func (m *MsgUpdateConsumerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateConsumerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConsumerAdditionResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConsumerAdditionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2799,473 +2872,2502 @@ func (m *MsgUpdateConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgRemoveConsumer) 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 *MsgAssignConsumerKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ProviderAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + +func (m *MsgRemoveConsumer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x1a } - l = len(m.ConsumerKey) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + n10, err10 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) + if err10 != nil { + return 0, err10 } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + i -= n10 + i = encodeVarintTx(dAtA, i, uint64(n10)) + i-- + dAtA[i] = 0x12 + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgAssignConsumerKeyResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgRemoveConsumerResponse) 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 *MsgRemoveConsumerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgSubmitConsumerMisbehaviour) Size() (n int) { - if m == nil { - return 0 +func (m *MsgChangeRewardDenoms) 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 *MsgChangeRewardDenoms) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChangeRewardDenoms) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Submitter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x1a } - if m.Misbehaviour != nil { - l = m.Misbehaviour.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.DenomsToRemove) > 0 { + for iNdEx := len(m.DenomsToRemove) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DenomsToRemove[iNdEx]) + copy(dAtA[i:], m.DenomsToRemove[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.DenomsToRemove[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } - return n + if len(m.DenomsToAdd) > 0 { + for iNdEx := len(m.DenomsToAdd) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DenomsToAdd[iNdEx]) + copy(dAtA[i:], m.DenomsToAdd[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.DenomsToAdd[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil } -func (m *MsgSubmitConsumerMisbehaviourResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgChangeRewardDenomsResponse) 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 *MsgChangeRewardDenomsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChangeRewardDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgSubmitConsumerDoubleVoting) Size() (n int) { - if m == nil { - return 0 +func (m *MsgOptIn) 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 *MsgOptIn) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgOptIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Submitter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 } - if m.DuplicateVoteEvidence != nil { - l = m.DuplicateVoteEvidence.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.ConsumerKey) > 0 { + i -= len(m.ConsumerKey) + copy(dAtA[i:], m.ConsumerKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerKey))) + i-- + dAtA[i] = 0x1a } - if m.InfractionBlockHeader != nil { - l = m.InfractionBlockHeader.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- + dAtA[i] = 0x12 } - return n + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgSubmitConsumerDoubleVotingResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgOptInResponse) 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 *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n +func (m *MsgOptInResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgOptInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgConsumerAddition) Size() (n int) { - if m == nil { - return 0 +func (m *MsgOptOut) 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 *MsgOptOut) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgOptOut) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.InitialHeight.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.GenesisHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.BinaryHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) - n += 1 + l + sovTx(uint64(l)) - l = len(m.ConsumerRedistributionFraction) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.BlocksPerDistributionTransmission != 0 { - n += 1 + sovTx(uint64(m.BlocksPerDistributionTransmission)) - } - if m.HistoricalEntries != 0 { - n += 1 + sovTx(uint64(m.HistoricalEntries)) - } - l = len(m.DistributionTransmissionChannel) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Top_N != 0 { - n += 1 + sovTx(uint64(m.Top_N)) - } - if m.ValidatorsPowerCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) - } - if m.ValidatorSetCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorSetCap)) - } - if len(m.Allowlist) > 0 { - for _, s := range m.Allowlist { - l = len(s) - n += 2 + l + sovTx(uint64(l)) - } - } - if len(m.Denylist) > 0 { - for _, s := range m.Denylist { - l = len(s) - n += 2 + l + sovTx(uint64(l)) - } - } - l = len(m.Authority) - if l > 0 { - n += 2 + l + sovTx(uint64(l)) + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a } - if m.MinStake != 0 { - n += 2 + sovTx(uint64(m.MinStake)) + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- + dAtA[i] = 0x12 } - if m.AllowInactiveVals { - n += 3 + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgConsumerAdditionResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgOptOutResponse) 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 *MsgRemoveConsumer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) - n += 1 + l + sovTx(uint64(l)) - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n +func (m *MsgOptOutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRemoveConsumerResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgOptOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgChangeRewardDenoms) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.DenomsToAdd) > 0 { - for _, s := range m.DenomsToAdd { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.DenomsToRemove) > 0 { - for _, s := range m.DenomsToRemove { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) +func (m *MsgSetConsumerCommissionRate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *MsgChangeRewardDenomsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n +func (m *MsgSetConsumerCommissionRate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgOptIn) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 } - l = len(m.ProviderAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + { + size := m.Rate.Size() + i -= size + if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } - l = len(m.ConsumerKey) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + i-- + dAtA[i] = 0x1a + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x12 } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgOptInResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgSetConsumerCommissionRateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *MsgOptOut) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ProviderAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n +func (m *MsgSetConsumerCommissionRateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgOptOutResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgSetConsumerCommissionRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgSetConsumerCommissionRate) Size() (n int) { - if m == nil { - return 0 +func (m *MsgUpdateConsumer) 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 *MsgUpdateConsumer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ProviderAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.UpdateRecord != nil { + { + size, err := m.UpdateRecord.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x12 } - l = m.Rate.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgSetConsumerCommissionRateResponse) Size() (n int) { - if m == nil { - return 0 +func (m *ConsumerUpdateRecord) 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 *MsgUpdateConsumer) Size() (n int) { - if m == nil { - return 0 - } +func (m *ConsumerUpdateRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsumerUpdateRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Top_N != 0 { - n += 1 + sovTx(uint64(m.Top_N)) + if m.AllowInactiveVals { + i-- + if m.AllowInactiveVals { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 } - if m.ValidatorsPowerCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) + if m.MinStake != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) + i-- + dAtA[i] = 0x38 } - if m.ValidatorSetCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorSetCap)) + if len(m.Denylist) > 0 { + for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denylist[iNdEx]) + copy(dAtA[i:], m.Denylist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x32 + } } if len(m.Allowlist) > 0 { - for _, s := range m.Allowlist { - l = len(s) - n += 1 + l + sovTx(uint64(l)) + for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Allowlist[iNdEx]) + copy(dAtA[i:], m.Allowlist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0x2a } } - if len(m.Denylist) > 0 { - for _, s := range m.Denylist { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } + if m.ValidatorSetCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) + i-- + dAtA[i] = 0x20 } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.ValidatorsPowerCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) + i-- + dAtA[i] = 0x18 } - if m.MinStake != 0 { - n += 1 + sovTx(uint64(m.MinStake)) + if m.Top_N != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) + i-- + dAtA[i] = 0x10 } - if m.AllowInactiveVals { - n += 2 + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgUpdateConsumerResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgUpdateConsumerResponse) 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 *MsgUpdateConsumerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *MsgRegisterConsumer) 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 sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *MsgRegisterConsumer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + +func (m *MsgRegisterConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RegistrationRecord != nil { + { + size, err := m.RegistrationRecord.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgAssignConsumerKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAssignConsumerKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsumerRegistrationRecord) 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 *ConsumerRegistrationRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsumerRegistrationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterConsumerResponse) 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 *MsgRegisterConsumerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgInitializeConsumer) 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 *MsgInitializeConsumer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInitializeConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.InitializationRecord != nil { + { + size, err := m.InitializationRecord.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsumerInitializationRecord) 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 *ConsumerInitializationRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsumerInitializationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DistributionTransmissionChannel) > 0 { + i -= len(m.DistributionTransmissionChannel) + copy(dAtA[i:], m.DistributionTransmissionChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) + i-- + dAtA[i] = 0x5a + } + if m.HistoricalEntries != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.HistoricalEntries)) + i-- + dAtA[i] = 0x50 + } + if m.BlocksPerDistributionTransmission != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) + i-- + dAtA[i] = 0x48 + } + if len(m.ConsumerRedistributionFraction) > 0 { + i -= len(m.ConsumerRedistributionFraction) + copy(dAtA[i:], m.ConsumerRedistributionFraction) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) + i-- + dAtA[i] = 0x42 + } + n14, err14 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) + if err14 != nil { + return 0, err14 + } + i -= n14 + i = encodeVarintTx(dAtA, i, uint64(n14)) + i-- + dAtA[i] = 0x3a + n15, err15 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + if err15 != nil { + return 0, err15 + } + i -= n15 + i = encodeVarintTx(dAtA, i, uint64(n15)) + i-- + dAtA[i] = 0x32 + n16, err16 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err16 != nil { + return 0, err16 + } + i -= n16 + i = encodeVarintTx(dAtA, i, uint64(n16)) + i-- + dAtA[i] = 0x2a + n17, err17 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) + if err17 != nil { + return 0, err17 + } + i -= n17 + i = encodeVarintTx(dAtA, i, uint64(n17)) + i-- + dAtA[i] = 0x22 + if len(m.BinaryHash) > 0 { + i -= len(m.BinaryHash) + copy(dAtA[i:], m.BinaryHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.BinaryHash))) + i-- + dAtA[i] = 0x1a + } + if len(m.GenesisHash) > 0 { + i -= len(m.GenesisHash) + copy(dAtA[i:], m.GenesisHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisHash))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgInitializeConsumerResponse) 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 *MsgInitializeConsumerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInitializeConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgAssignConsumerKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAssignConsumerKeyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSubmitConsumerMisbehaviour) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Submitter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Misbehaviour != nil { + l = m.Misbehaviour.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitConsumerMisbehaviourResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSubmitConsumerDoubleVoting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Submitter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.DuplicateVoteEvidence != nil { + l = m.DuplicateVoteEvidence.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.InfractionBlockHeader != nil { + l = m.InfractionBlockHeader.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitConsumerDoubleVotingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConsumerAddition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.InitialHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.GenesisHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BinaryHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) + n += 1 + l + sovTx(uint64(l)) + l = len(m.ConsumerRedistributionFraction) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BlocksPerDistributionTransmission != 0 { + n += 1 + sovTx(uint64(m.BlocksPerDistributionTransmission)) + } + if m.HistoricalEntries != 0 { + n += 1 + sovTx(uint64(m.HistoricalEntries)) + } + l = len(m.DistributionTransmissionChannel) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Top_N != 0 { + n += 1 + sovTx(uint64(m.Top_N)) + } + if m.ValidatorsPowerCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) + } + if m.ValidatorSetCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorSetCap)) + } + if len(m.Allowlist) > 0 { + for _, s := range m.Allowlist { + l = len(s) + n += 2 + l + sovTx(uint64(l)) + } + } + if len(m.Denylist) > 0 { + for _, s := range m.Denylist { + l = len(s) + n += 2 + l + sovTx(uint64(l)) + } + } + l = len(m.Authority) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + if m.MinStake != 0 { + n += 2 + sovTx(uint64(m.MinStake)) + } + if m.AllowInactiveVals { + n += 3 + } + return n +} + +func (m *MsgConsumerAdditionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveConsumer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) + n += 1 + l + sovTx(uint64(l)) + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRemoveConsumerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgChangeRewardDenoms) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DenomsToAdd) > 0 { + for _, s := range m.DenomsToAdd { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.DenomsToRemove) > 0 { + for _, s := range m.DenomsToRemove { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChangeRewardDenomsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgOptIn) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgOptInResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgOptOut) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgOptOutResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetConsumerCommissionRate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Rate.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetConsumerCommissionRateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateConsumer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.UpdateRecord != nil { + l = m.UpdateRecord.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *ConsumerUpdateRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Top_N != 0 { + n += 1 + sovTx(uint64(m.Top_N)) + } + if m.ValidatorsPowerCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) + } + if m.ValidatorSetCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorSetCap)) + } + if len(m.Allowlist) > 0 { + for _, s := range m.Allowlist { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.Denylist) > 0 { + for _, s := range m.Denylist { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.MinStake != 0 { + n += 1 + sovTx(uint64(m.MinStake)) + } + if m.AllowInactiveVals { + n += 2 + } + return n +} + +func (m *MsgUpdateConsumerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRegisterConsumer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.RegistrationRecord != nil { + l = m.RegistrationRecord.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *ConsumerRegistrationRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRegisterConsumerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgInitializeConsumer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.InitializationRecord != nil { + l = m.InitializationRecord.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *ConsumerInitializationRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.InitialHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.GenesisHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BinaryHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) + n += 1 + l + sovTx(uint64(l)) + l = len(m.ConsumerRedistributionFraction) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BlocksPerDistributionTransmission != 0 { + n += 1 + sovTx(uint64(m.BlocksPerDistributionTransmission)) + } + if m.HistoricalEntries != 0 { + n += 1 + sovTx(uint64(m.HistoricalEntries)) + } + l = len(m.DistributionTransmissionChannel) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgInitializeConsumerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAssignConsumerKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAssignConsumerKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Submitter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Misbehaviour == nil { + m.Misbehaviour = &_07_tendermint.Misbehaviour{} + } + if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Submitter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DuplicateVoteEvidence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DuplicateVoteEvidence == nil { + m.DuplicateVoteEvidence = &types.DuplicateVoteEvidence{} + } + if err := m.DuplicateVoteEvidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InfractionBlockHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InfractionBlockHeader == nil { + m.InfractionBlockHeader = &_07_tendermint.Header{} + } + if err := m.InfractionBlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConsumerAddition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConsumerAddition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) + if m.GenesisHash == nil { + m.GenesisHash = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) + if m.BinaryHash == nil { + m.BinaryHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) + } + m.BlocksPerDistributionTransmission = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) + } + m.HistoricalEntries = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistoricalEntries |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3293,13 +5395,13 @@ func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } - var stringLen uint64 + m.Top_N = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3309,27 +5411,52 @@ func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Top_N |= uint32(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx + m.ValidatorsPowerCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorsPowerCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } } - if postIndex > l { - return io.ErrUnexpectedEOF + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + m.ValidatorSetCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorSetCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3357,11 +5484,11 @@ func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerKey = string(dAtA[iNdEx:postIndex]) + m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3389,111 +5516,11 @@ func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 18: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3521,13 +5548,13 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Submitter = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) } - var msglen int + m.MinStake = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3537,28 +5564,31 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.MinStake |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Misbehaviour == nil { - m.Misbehaviour = &_07_tendermint.Misbehaviour{} + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) } - if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex + m.AllowInactiveVals = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3580,7 +5610,7 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3603,10 +5633,10 @@ func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerAdditionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerAdditionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3630,7 +5660,7 @@ func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { +func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3653,15 +5683,15 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRemoveConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRemoveConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3689,11 +5719,11 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Submitter = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DuplicateVoteEvidence", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3720,18 +5750,15 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DuplicateVoteEvidence == nil { - m.DuplicateVoteEvidence = &types.DuplicateVoteEvidence{} - } - if err := m.DuplicateVoteEvidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InfractionBlockHeader", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3741,27 +5768,23 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.InfractionBlockHeader == nil { - m.InfractionBlockHeader = &_07_tendermint.Header{} - } - if err := m.InfractionBlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3784,7 +5807,7 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3807,10 +5830,10 @@ func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRemoveConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRemoveConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3834,7 +5857,7 @@ func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3857,15 +5880,15 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: MsgChangeRewardDenoms: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgChangeRewardDenoms: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DenomsToAdd", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3893,13 +5916,13 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.DenomsToAdd = append(m.DenomsToAdd, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DenomsToRemove", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3909,24 +5932,55 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.DenomsToRemove = append(m.DenomsToRemove, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3949,7 +6003,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3972,10 +6026,10 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3999,7 +6053,7 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { +func (m *MsgOptIn) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4022,15 +6076,15 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerAddition: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOptIn: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerAddition: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOptIn: 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) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4058,13 +6112,13 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4074,30 +6128,29 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4107,31 +6160,29 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) - if m.GenesisHash == nil { - m.GenesisHash = []byte{} - } + m.ConsumerKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4141,130 +6192,129 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) - if m.BinaryHash == nil { - m.BinaryHash = []byte{} - } + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgOptInResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgOptInResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgOptOut) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 8: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgOptOut: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgOptOut: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4274,28 +6324,27 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4323,49 +6372,11 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) - } - m.BlocksPerDistributionTransmission = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) - } - m.HistoricalEntries = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HistoricalEntries |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4393,68 +6404,111 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - m.Top_N = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Top_N |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx } - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.ValidatorsPowerCap = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorsPowerCap |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx } - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.ValidatorSetCap = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorSetCap |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - case 16: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgOptOutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgOptOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetConsumerCommissionRate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetConsumerCommissionRate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4482,11 +6536,11 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 17: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4514,11 +6568,11 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 18: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4546,13 +6600,15 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - m.MinStake = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4562,31 +6618,24 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinStake |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx } - m.AllowInactiveVals = bool(v != 0) + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4608,7 +6657,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4631,10 +6680,10 @@ func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerAdditionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerAdditionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -4658,7 +6707,7 @@ func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4681,15 +6730,15 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveConsumer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4717,13 +6766,13 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4733,30 +6782,29 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UpdateRecord", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4766,23 +6814,27 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + if m.UpdateRecord == nil { + m.UpdateRecord = &ConsumerUpdateRecord{} + } + if err := m.UpdateRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -4805,7 +6857,7 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { +func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4828,65 +6880,104 @@ func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveConsumerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerUpdateRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerUpdateRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + m.Top_N = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Top_N |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChangeRewardDenoms: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeRewardDenoms: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.ValidatorsPowerCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorsPowerCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) + } + m.ValidatorSetCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorSetCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomsToAdd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4914,11 +7005,11 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DenomsToAdd = append(m.DenomsToAdd, string(dAtA[iNdEx:postIndex])) + m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomsToRemove", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4946,13 +7037,32 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DenomsToRemove = append(m.DenomsToRemove, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) + } + m.MinStake = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinStake |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) } - var stringLen uint64 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4962,24 +7072,12 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.AllowInactiveVals = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -5001,7 +7099,7 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5024,10 +7122,10 @@ func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -5051,7 +7149,7 @@ func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptIn) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5074,15 +7172,15 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptIn: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptIn: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5110,45 +7208,13 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationRecord", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5158,106 +7224,28 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF + if m.RegistrationRecord == nil { + m.RegistrationRecord = &ConsumerRegistrationRecord{} } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { + if err := m.RegistrationRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgOptInResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptInResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -5279,7 +7267,7 @@ func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptOut) Unmarshal(dAtA []byte) error { +func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5302,15 +7290,15 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptOut: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerRegistrationRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptOut: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerRegistrationRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5338,11 +7326,11 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5370,11 +7358,11 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5402,7 +7390,7 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5425,7 +7413,7 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5448,12 +7436,44 @@ func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptOutResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -5475,7 +7495,7 @@ func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { +func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5498,15 +7518,15 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgInitializeConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgInitializeConsumer: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5534,43 +7554,11 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5598,15 +7586,13 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitializationRecord", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5616,74 +7602,28 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if m.InitializationRecord == nil { + m.InitializationRecord = &ConsumerInitializationRecord{} } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := m.InitializationRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -5705,7 +7645,7 @@ func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { +func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5728,17 +7668,17 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateConsumer: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerInitializationRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerInitializationRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5748,29 +7688,30 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Title = string(dAtA[iNdEx:postIndex]) + if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5780,29 +7721,31 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) + if m.GenesisHash == nil { + m.GenesisHash = []byte{} + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5812,29 +7755,31 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) + if m.BinaryHash == nil { + m.BinaryHash = []byte{} + } iNdEx = postIndex case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) } - m.Top_N = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5844,16 +7789,30 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Top_N |= uint32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) } - m.ValidatorsPowerCap = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5863,16 +7822,30 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ValidatorsPowerCap |= uint32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) } - m.ValidatorSetCap = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5882,16 +7855,30 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ValidatorSetCap |= uint32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5901,27 +7888,28 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5949,13 +7937,13 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) + m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) } - var stringLen uint64 + m.BlocksPerDistributionTransmission = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5965,29 +7953,16 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 10: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) } - m.MinStake = 0 + m.HistoricalEntries = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5997,16 +7972,16 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinStake |= uint64(b&0x7F) << shift + m.HistoricalEntries |= int64(b&0x7F) << shift if b < 0x80 { break } } case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6016,12 +7991,24 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.AllowInactiveVals = bool(v != 0) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -6043,7 +8030,7 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgInitializeConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6066,10 +8053,10 @@ func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateConsumerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgInitializeConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgInitializeConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From 47f2a3e46b56e67e5bbd55be6ae7df5e17dbcc4e Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 30 Jul 2024 15:55:12 +0300 Subject: [PATCH 06/41] introduced new state --- x/ccv/provider/keeper/permissionless.go | 83 ++++++++++++++++++++ x/ccv/provider/keeper/permissionless_test.go | 78 ++++++++++++++++++ x/ccv/provider/types/keys.go | 38 +++++++++ x/ccv/provider/types/keys_test.go | 9 +++ 4 files changed, 208 insertions(+) create mode 100644 x/ccv/provider/keeper/permissionless.go create mode 100644 x/ccv/provider/keeper/permissionless_test.go diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go new file mode 100644 index 0000000000..4a7ff0d4c0 --- /dev/null +++ b/x/ccv/provider/keeper/permissionless.go @@ -0,0 +1,83 @@ +package keeper + +import ( + "encoding/binary" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" +) + +// setConsumerId sets the provided consumerId +func (k Keeper) setConsumerId(ctx sdk.Context, consumerId uint64) { + store := ctx.KVStore(k.storeKey) + + buf := make([]byte, 8) + binary.BigEndian.PutUint64(buf, consumerId) + + store.Set(types.ConsumerIdKey(), buf) +} + +// GetConsumerId returns the last registered consumer id +func (k Keeper) GetConsumerId(ctx sdk.Context) (uint64, bool) { + store := ctx.KVStore(k.storeKey) + buf := store.Get(types.ConsumerIdKey()) + if buf == nil { + return 0, false + } + return binary.BigEndian.Uint64(buf), true +} + +// FetchAndIncrementConsumerId fetches the first consumer id that can be used and increments the +// underlying consumer id +func (k Keeper) FetchAndIncrementConsumerId(ctx sdk.Context) uint64 { + consumerId, found := k.GetConsumerId(ctx) + if !found { + consumerId = 0 + } + + k.setConsumerId(ctx, consumerId+1) + return consumerId +} + +// GetConsumerIdToChainId returns the chain id associated with this consumer id +func (k Keeper) GetConsumerIdToChainId(ctx sdk.Context, consumerId string) (string, bool) { + store := ctx.KVStore(k.storeKey) + buf := store.Get(types.ConsumerIdToChainIdKey(consumerId)) + if buf == nil { + return "", false + } + return string(buf), true +} + +// SetConsumerIdToChainId sets the chain id associated with this consumer id +func (k Keeper) SetConsumerIdToChainId(ctx sdk.Context, consumerId string, chainId string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ConsumerIdToChainIdKey(consumerId), []byte(chainId)) +} + +// DeleteConsumerIdToChainId deletes the chain id to consumer id association +func (k Keeper) DeleteConsumerIdToChainId(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToChainIdKey(consumerId)) +} + +// GetClientIdToConsumerId returns the consumer id associated with this client id +func (k Keeper) GetClientIdToConsumerId(ctx sdk.Context, clientId string) (string, bool) { + store := ctx.KVStore(k.storeKey) + buf := store.Get(types.ClientIdToConsumerIdKey(clientId)) + if buf == nil { + return "", false + } + return string(buf), true +} + +// SetClientIdToConsumerId sets the client id associated with this consumer id +func (k Keeper) SetClientIdToConsumerId(ctx sdk.Context, clientId string, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ClientIdToConsumerIdKey(clientId), []byte(consumerId)) +} + +// DeleteClientIdToConsumerId deletes the client id to consumer id association +func (k Keeper) DeleteClientIdToConsumerId(ctx sdk.Context, clientId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ClientIdToConsumerIdKey(clientId)) +} diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go new file mode 100644 index 0000000000..7f4c4598b9 --- /dev/null +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -0,0 +1,78 @@ +package keeper_test + +import ( + testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" + "github.com/stretchr/testify/require" + "testing" +) + +// TestConsumerId tests methods for retrieving and incrementing consumer id +func TestConsumerId(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + consumerId, found := providerKeeper.GetConsumerId(ctx) + require.False(t, found) + + consumerId = providerKeeper.FetchAndIncrementConsumerId(ctx) + require.Equal(t, uint64(0), consumerId) + + consumerId, found = providerKeeper.GetConsumerId(ctx) + require.True(t, found) + require.Equal(t, uint64(1), consumerId) + + consumerId = providerKeeper.FetchAndIncrementConsumerId(ctx) + require.Equal(t, uint64(1), consumerId) + + consumerId, found = providerKeeper.GetConsumerId(ctx) + require.True(t, found) + require.Equal(t, uint64(2), consumerId) +} + +// TestConsumerIdToChainId tests the getter, setter, and deletion methods for the consumer id to chain id +func TestConsumerIdToChainId(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + _, found := providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") + require.False(t, found) + + providerKeeper.SetConsumerIdToChainId(ctx, "consumerId", "chainId") + chainId, found := providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") + require.True(t, found) + require.Equal(t, "chainId", chainId) + + providerKeeper.SetConsumerIdToChainId(ctx, "consumerId", "chainId2") + chainId, found = providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") + require.True(t, found) + require.Equal(t, "chainId2", chainId) + + providerKeeper.DeleteConsumerIdToChainId(ctx, "consumerId") + chainId, found = providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") + require.False(t, found) + require.Equal(t, "", chainId) +} + +// TestClientIdToConsumerId tests the getter, setter, and deletion methods for the client id to consumer id +func TestClientIdToConsumerId(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + _, found := providerKeeper.GetClientIdToConsumerId(ctx, "clientId") + require.False(t, found) + + providerKeeper.SetClientIdToConsumerId(ctx, "clientId", "consumerId") + consumerId, found := providerKeeper.GetClientIdToConsumerId(ctx, "clientId") + require.True(t, found) + require.Equal(t, "consumerId", consumerId) + + providerKeeper.SetClientIdToConsumerId(ctx, "clientId", "consumerId2") + consumerId, found = providerKeeper.GetClientIdToConsumerId(ctx, "clientId") + require.True(t, found) + require.Equal(t, "consumerId2", consumerId) + + providerKeeper.DeleteClientIdToConsumerId(ctx, "clientId") + consumerId, found = providerKeeper.GetClientIdToConsumerId(ctx, "clientId") + require.False(t, found) + require.Equal(t, "", consumerId) +} diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 16e5251f69..8e17014a59 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -128,6 +128,12 @@ const ( AllowInactiveValidatorsKeyName = "AllowInactiveValidatorsKey" ConsumerAddrsToPruneV2KeyName = "ConsumerAddrsToPruneV2Key" + + ConsumerIdKeyName = "ConsumerIdKey" + + ConsumerIdToChainIdKeyName = "ConsumerIdToChainIdKey" + + ClientIdToConsumerIdKeyName = "ClientIdToConsumerIdKey" ) // getKeyPrefixes returns a constant map of all the byte prefixes for existing keys @@ -321,6 +327,15 @@ func getKeyPrefixes() map[string]byte { // that determines whether inactive validators can validate on that chain AllowInactiveValidatorsKeyName: 44, + // ConsumerIdKeyName is the key for storing the consumer id for the next registered consumer chain + ConsumerIdKeyName: 45, + + // ConsumerIdToChainIdKeyName is the key for storing the chain id for the given consumer id + ConsumerIdToChainIdKeyName: 46, + + // ClientIdToConsumerIdKeyName is the key for storing the consumer id for the given client id + ClientIdToConsumerIdKeyName: 47, + // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO TestPreserveBytePrefix() IN keys_test.go } } @@ -705,6 +720,29 @@ func AllowInactiveValidatorsKey(chainID string) []byte { return ChainIdWithLenKey(mustGetKeyPrefix(AllowInactiveValidatorsKeyName), chainID) } +// ConsumerIdKey returns the key used to store the consumerId of the next registered chain +func ConsumerIdKey() []byte { + return []byte{mustGetKeyPrefix(ConsumerIdKeyName)} +} + +// ConsumerIdToChainIdKey returns the chain id that corresponds to this consumer id +func ConsumerIdToChainIdKey(consumerId string) []byte { + return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToChainIdKeyName), consumerId) +} + +// ClientIdToConsumerIdKey returns the consumer id that corresponds to this client id +func ClientIdToConsumerIdKey(clientId string) []byte { + clientIdLength := len(clientId) + return ccvtypes.AppendMany( + // Append the prefix + []byte{mustGetKeyPrefix(ClientIdToConsumerIdKeyName)}, + // Append the chainID length + sdk.Uint64ToBigEndian(uint64(clientIdLength)), + // Append the chainID + []byte(clientId), + ) +} + // NOTE: DO NOT ADD FULLY DEFINED KEY FUNCTIONS WITHOUT ADDING THEM TO getAllFullyDefinedKeys() IN keys_test.go // diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index dc0a23a44d..07f47f7e9f 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -122,6 +122,12 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(44), providertypes.AllowInactiveValidatorsKey("chainID")[0]) i++ + require.Equal(t, uint8(45), providertypes.ConsumerIdKey()[0]) + i++ + require.Equal(t, uint8(46), providertypes.ConsumerIdToChainIdKey("consumerId")[0]) + i++ + require.Equal(t, uint8(47), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + i++ prefixes := providertypes.GetAllKeyPrefixes() require.Equal(t, len(prefixes), i) @@ -189,6 +195,9 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.MinStakeKey("chainID"), providertypes.AllowInactiveValidatorsKey("chainID"), providerkeeper.GetValidatorKey(types.LastProviderConsensusValsPrefix(), providertypes.NewProviderConsAddress([]byte{0x05})), + providertypes.ConsumerIdKey(), + providertypes.ConsumerIdToChainIdKey("consumerId"), + providertypes.ClientIdToConsumerIdKey("clientId"), } } From a117b1ac442adb040c19baa0f1a46ea302fc257a Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 31 Jul 2024 14:41:32 +0300 Subject: [PATCH 07/41] added functionality for the register and initialize messages --- x/ccv/provider/keeper/msg_server.go | 53 ++++-- x/ccv/provider/keeper/msg_server_test.go | 173 +++++++++++++++++++ x/ccv/provider/keeper/permissionless.go | 83 +++++++++ x/ccv/provider/keeper/permissionless_test.go | 119 ++++++++++++- x/ccv/provider/types/keys.go | 34 +++- x/ccv/provider/types/keys_test.go | 11 +- 6 files changed, 454 insertions(+), 19 deletions(-) create mode 100644 x/ccv/provider/keeper/msg_server_test.go diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 91bbd1dabd..984babcf15 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "strconv" errorsmod "cosmossdk.io/errors" @@ -308,6 +309,44 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M return &types.MsgSetConsumerCommissionRateResponse{}, nil } +// RegisterConsumer registers a consumer chain +func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegisterConsumer) (*types.MsgRegisterConsumerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + consumerId := strconv.FormatUint(k.Keeper.FetchAndIncrementConsumerId(ctx), 10) + + k.Keeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, *msg.RegistrationRecord) + k.Keeper.SetConsumerIdToOwnerAddress(ctx, consumerId, msg.Signer) + + return &types.MsgRegisterConsumerResponse{ConsumerId: consumerId}, nil +} + +// InitializeConsumer initializes a consumer chain +func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgInitializeConsumer) (*types.MsgInitializeConsumerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + consumerId := msg.ConsumerId + _, found := k.Keeper.GetConsumerIdToRegistrationRecord(ctx, consumerId) + if !found { + // fix error type + return nil, errorsmod.Wrapf(types.ErrInvalidConsumerModificationProposal, "no registered chain with consumer id: %s", msg.GetConsumerId()) + } + + ownerAddress, found := k.Keeper.GetConsumerIdToOwnerAddress(ctx, consumerId) + if k.GetAuthority() == msg.Authority { + // message is executed as part of governance proposal and hence we change the owner address + // to be the one of the module account address + k.Keeper.SetConsumerIdToOwnerAddress(ctx, consumerId, k.GetAuthority()) + } else if msg.Authority != ownerAddress { + return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Authority) + } + + k.Keeper.SetConsumerIdToInitializationRecord(ctx, consumerId, *msg.InitializationRecord) + + return &types.MsgInitializeConsumerResponse{}, nil +} + +// UpdateConsumer updates a consumer chain func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateConsumer) (*types.MsgUpdateConsumerResponse, error) { if k.GetAuthority() != msg.Authority { return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) @@ -321,17 +360,3 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon return &types.MsgUpdateConsumerResponse{}, nil } - -// RegisterConsumer registers a consumer chain -func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegisterConsumer) (*types.MsgRegisterConsumerResponse, error) { - //ctx := sdk.UnwrapSDKContext(goCtx) - - return &types.MsgRegisterConsumerResponse{}, nil -} - -// InitializeConsumer registers a consumer chain -func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgInitializeConsumer) (*types.MsgInitializeConsumerResponse, error) { - //ctx := sdk.UnwrapSDKContext(goCtx) - - return &types.MsgInitializeConsumerResponse{}, nil -} diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go new file mode 100644 index 0000000000..7577fec0f0 --- /dev/null +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -0,0 +1,173 @@ +package keeper_test + +import ( + "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" + providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" + providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + "github.com/stretchr/testify/require" + "testing" + "time" +) + +func TestRegisterConsumer(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + + expectedRecord := providertypes.ConsumerRegistrationRecord{ + Title: "title", + Description: "description", + ChainId: "chain_id", + } + response, err := msgServer.RegisterConsumer(ctx, + &providertypes.MsgRegisterConsumer{Signer: "signer", RegistrationRecord: &expectedRecord}) + require.NoError(t, err) + require.Equal(t, "0", response.ConsumerId) + actualRecord, found := providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "0") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + ownerAddress, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "0") + require.Equal(t, "signer", ownerAddress) + + expectedRecord = providertypes.ConsumerRegistrationRecord{ + Title: "title2", + Description: "description2", + ChainId: "chain_id2", + } + response, err = msgServer.RegisterConsumer(ctx, + &providertypes.MsgRegisterConsumer{Signer: "signer2", RegistrationRecord: &expectedRecord}) + require.NoError(t, err) + // assert that the consumer id is different from the previously registered chain + require.Equal(t, "1", response.ConsumerId) + actualRecord, found = providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "1") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "1") + require.Equal(t, "signer2", ownerAddress) +} + +func TestInitializeConsumer(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + + // initializing a non-registered chain should give an error + _, err := msgServer.InitializeConsumer(ctx, + &providertypes.MsgInitializeConsumer{ + Authority: "signer", + ConsumerId: "0", + InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) + require.ErrorContains(t, err, "no registered chain") + + // register chains with consumers ids "0" and "1" + _, _ = msgServer.RegisterConsumer(ctx, + &providertypes.MsgRegisterConsumer{ + Signer: "signer", + RegistrationRecord: &providertypes.ConsumerRegistrationRecord{}}) + + _, _ = msgServer.RegisterConsumer(ctx, + &providertypes.MsgRegisterConsumer{ + Signer: "signer2", + RegistrationRecord: &providertypes.ConsumerRegistrationRecord{}}) + + // assert that you CANNOT initialize a consumer chain that you do NOT own + _, err = msgServer.InitializeConsumer(ctx, + &providertypes.MsgInitializeConsumer{ + Authority: "signer2", + ConsumerId: "0", + InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) + require.ErrorContains(t, err, "expected owner") + + // initialize chain with consumer id "0" + expectedRecord := providertypes.ConsumerInitializationRecord{ + InitialHeight: types.Height{RevisionNumber: 1, RevisionHeight: 2}, + GenesisHash: []byte{0, 1}, + BinaryHash: []byte{2, 3}, + SpawnTime: time.Unix(1, 2).UTC(), + UnbondingPeriod: 3456, + CcvTimeoutPeriod: 789, + TransferTimeoutPeriod: 101112, + ConsumerRedistributionFraction: "consumer_redistribution_fraction", + BlocksPerDistributionTransmission: 123, + HistoricalEntries: 456, + DistributionTransmissionChannel: "distribution_transmission_channel", + } + + _, err = msgServer.InitializeConsumer(ctx, + &providertypes.MsgInitializeConsumer{ + Authority: "signer", + ConsumerId: "0", + InitializationRecord: &expectedRecord}) + require.NoError(t, err) + actualRecord, found := providerKeeper.GetConsumerIdToInitializationRecord(ctx, "0") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + // verify that the owner of the consumer chain did NOT change + ownerAddress, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "0") + require.True(t, found) + require.Equal(t, "signer", ownerAddress) + + // assert that we can re-initialize chain with consumer id "0" + expectedRecord = providertypes.ConsumerInitializationRecord{ + InitialHeight: types.Height{RevisionNumber: 2, RevisionHeight: 3}, + GenesisHash: []byte{2, 3}, + BinaryHash: []byte{4, 5}, + SpawnTime: time.Unix(2, 3).UTC(), + UnbondingPeriod: 789, + CcvTimeoutPeriod: 101112, + TransferTimeoutPeriod: 131415, + ConsumerRedistributionFraction: "consumer_redistribution_fraction2", + BlocksPerDistributionTransmission: 456, + HistoricalEntries: 789, + DistributionTransmissionChannel: "distribution_transmission_channel2", + } + + _, err = msgServer.InitializeConsumer(ctx, + &providertypes.MsgInitializeConsumer{ + Authority: "signer", + ConsumerId: "0", + InitializationRecord: &expectedRecord}) + require.NoError(t, err) + actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "0") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + // verify that the owner of the consumer chain did NOT change + ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "0") + require.True(t, found) + require.Equal(t, "signer", ownerAddress) + + // initialize chain with consumer id "1" but with a different owner (as part of a governance proposal) + + // first verify that the current owner can initialize the chain + _, err = msgServer.InitializeConsumer(ctx, + &providertypes.MsgInitializeConsumer{ + Authority: "signer2", + ConsumerId: "1", + InitializationRecord: &expectedRecord}) + require.NoError(t, err) + actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "1") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + // verify that the owner of the consumer chain did NOT change + ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "1") + require.True(t, found) + require.Equal(t, "signer2", ownerAddress) + + // second, reinitialize by with a gov proposal owner + _, err = msgServer.InitializeConsumer(ctx, + &providertypes.MsgInitializeConsumer{ + Authority: providerKeeper.GetAuthority(), + ConsumerId: "1", + InitializationRecord: &expectedRecord}) + require.NoError(t, err) + actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "1") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + // verify that the owner of the consumer chain did change + ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "1") + require.True(t, found) + require.Equal(t, providerKeeper.GetAuthority(), ownerAddress) +} diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 4a7ff0d4c0..48ea034189 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -2,6 +2,7 @@ package keeper import ( "encoding/binary" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" ) @@ -60,6 +61,88 @@ func (k Keeper) DeleteConsumerIdToChainId(ctx sdk.Context, consumerId string) { store.Delete(types.ConsumerIdToChainIdKey(consumerId)) } +// GetConsumerIdToRegistrationRecord returns the registration record associated with this consumer id +func (k Keeper) GetConsumerIdToRegistrationRecord(ctx sdk.Context, consumerId string) (types.ConsumerRegistrationRecord, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ConsumerIdToRegistrationRecordKey(consumerId)) + if bz == nil { + return types.ConsumerRegistrationRecord{}, false + } + var record types.ConsumerRegistrationRecord + if err := record.Unmarshal(bz); err != nil { + panic(fmt.Errorf("failed to unmarshal record: %w", err)) + } + return record, true +} + +// SetConsumerIdToRegistrationRecord sets the registration record associated with this consumer id +func (k Keeper) SetConsumerIdToRegistrationRecord(ctx sdk.Context, consumerId string, record types.ConsumerRegistrationRecord) { + store := ctx.KVStore(k.storeKey) + bz, err := record.Marshal() + if err != nil { + panic(fmt.Errorf("failed to marshal record (%+v): %w", record, err)) + } + store.Set(types.ConsumerIdToRegistrationRecordKey(consumerId), bz) +} + +// DeleteConsumerIdToRegistrationRecord deletes the registration record associated with this consumer id +func (k Keeper) DeleteConsumerIdToRegistrationRecord(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToRegistrationRecordKey(consumerId)) +} + +// GetConsumerIdToInitializationRecord returns the initialization record associated with this consumer id +func (k Keeper) GetConsumerIdToInitializationRecord(ctx sdk.Context, consumerId string) (types.ConsumerInitializationRecord, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ConsumerIdToInitializationRecordKey(consumerId)) + if bz == nil { + return types.ConsumerInitializationRecord{}, false + } + var record types.ConsumerInitializationRecord + if err := record.Unmarshal(bz); err != nil { + panic(fmt.Errorf("failed to unmarshal record: %w", err)) + } + return record, true +} + +// SetConsumerIdToInitializationRecord sets the initialization record associated with this consumer id +func (k Keeper) SetConsumerIdToInitializationRecord(ctx sdk.Context, consumerId string, record types.ConsumerInitializationRecord) { + store := ctx.KVStore(k.storeKey) + bz, err := record.Marshal() + if err != nil { + panic(fmt.Errorf("failed to marshal record (%+v): %w", record, err)) + } + store.Set(types.ConsumerIdToInitializationRecordKey(consumerId), bz) +} + +// DeleteConsumerIdToInitializationRecord deletes the initializatoin record associated with this consumer id +func (k Keeper) DeleteConsumerIdToInitializationRecord(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToInitializationRecordKey(consumerId)) +} + +// GetConsumerIdToOwnerAddress returns the owner address associated with this consumer id +func (k Keeper) GetConsumerIdToOwnerAddress(ctx sdk.Context, consumerId string) (string, bool) { + store := ctx.KVStore(k.storeKey) + buf := store.Get(types.ConsumerIdToOwnerAddressKey(consumerId)) + if buf == nil { + return "", false + } + return string(buf), true +} + +// SetConsumerIdToOwnerAddress sets the owner address associated with this consumer id +func (k Keeper) SetConsumerIdToOwnerAddress(ctx sdk.Context, consumerId string, ownerAddress string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ConsumerIdToOwnerAddressKey(consumerId), []byte(ownerAddress)) +} + +// DeleteConsumerIdToOwnerAddress deletes the owner address associated with this consumer id +func (k Keeper) DeleteConsumerIdToOwnerAddress(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToOwnerAddressKey(consumerId)) +} + // GetClientIdToConsumerId returns the consumer id associated with this client id func (k Keeper) GetClientIdToConsumerId(ctx sdk.Context, clientId string) (string, bool) { store := ctx.KVStore(k.storeKey) diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index 7f4c4598b9..9917ff96b0 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -1,9 +1,12 @@ package keeper_test import ( + "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" + providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" "github.com/stretchr/testify/require" "testing" + "time" ) // TestConsumerId tests methods for retrieving and incrementing consumer id @@ -29,7 +32,7 @@ func TestConsumerId(t *testing.T) { require.Equal(t, uint64(2), consumerId) } -// TestConsumerIdToChainId tests the getter, setter, and deletion methods for the consumer id to chain id +// TestConsumerIdToChainId tests the getter, setter, and deletion methods of the consumer id to chain id methos func TestConsumerIdToChainId(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -42,6 +45,7 @@ func TestConsumerIdToChainId(t *testing.T) { require.True(t, found) require.Equal(t, "chainId", chainId) + // assert that overwriting the current chain id record works providerKeeper.SetConsumerIdToChainId(ctx, "consumerId", "chainId2") chainId, found = providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") require.True(t, found) @@ -53,7 +57,7 @@ func TestConsumerIdToChainId(t *testing.T) { require.Equal(t, "", chainId) } -// TestClientIdToConsumerId tests the getter, setter, and deletion methods for the client id to consumer id +// TestClientIdToConsumerId tests the getter, setter, and deletion methods of the client id to consumer id methods func TestClientIdToConsumerId(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -66,6 +70,7 @@ func TestClientIdToConsumerId(t *testing.T) { require.True(t, found) require.Equal(t, "consumerId", consumerId) + // assert that overwriting the current consumer id record works providerKeeper.SetClientIdToConsumerId(ctx, "clientId", "consumerId2") consumerId, found = providerKeeper.GetClientIdToConsumerId(ctx, "clientId") require.True(t, found) @@ -76,3 +81,113 @@ func TestClientIdToConsumerId(t *testing.T) { require.False(t, found) require.Equal(t, "", consumerId) } + +// TestConsumerIdToRegistrationRecord tests the getter, setter, and deletion methods of the consumer id to registration record methods +func TestConsumerIdToRegistrationRecord(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + _, found := providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "consumerId") + require.False(t, found) + + expectedRecord := providertypes.ConsumerRegistrationRecord{ + Title: "title", + Description: "description", + ChainId: "chain_id", + } + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "consumerId", expectedRecord) + actualRecord, found := providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "consumerId") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + + // assert that overwriting the current registration record works + expectedRecord = providertypes.ConsumerRegistrationRecord{ + Title: "title 2", + Description: "description 2", + ChainId: "chain_id2", + } + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "consumerId", expectedRecord) + actualRecord, found = providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "consumerId") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + + providerKeeper.DeleteConsumerIdToRegistrationRecord(ctx, "consumerId") + actualRecord, found = providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "consumerId") + require.False(t, found) + require.Equal(t, providertypes.ConsumerRegistrationRecord{}, actualRecord) +} + +// TestConsumerIdToInitializationRecord tests the getter, setter, and deletion methods of the consumer id to initialization record methods +func TestConsumerIdToInitializationRecord(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + _, found := providerKeeper.GetConsumerIdToInitializationRecord(ctx, "consumerId") + require.False(t, found) + + expectedRecord := providertypes.ConsumerInitializationRecord{ + InitialHeight: types.Height{RevisionNumber: 1, RevisionHeight: 2}, + GenesisHash: []byte{0, 1}, + BinaryHash: []byte{2, 3}, + SpawnTime: time.Unix(1, 2).UTC(), + UnbondingPeriod: 3456, + CcvTimeoutPeriod: 789, + TransferTimeoutPeriod: 101112, + ConsumerRedistributionFraction: "consumer_redistribution_fraction", + BlocksPerDistributionTransmission: 123, + HistoricalEntries: 456, + DistributionTransmissionChannel: "distribution_transmission_channel", + } + providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId", expectedRecord) + actualRecord, found := providerKeeper.GetConsumerIdToInitializationRecord(ctx, "consumerId") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + + // assert that overwriting the current initialization record works + expectedRecord = providertypes.ConsumerInitializationRecord{ + InitialHeight: types.Height{RevisionNumber: 2, RevisionHeight: 3}, + GenesisHash: []byte{2, 3}, + BinaryHash: []byte{4, 5}, + SpawnTime: time.Unix(2, 3).UTC(), + UnbondingPeriod: 789, + CcvTimeoutPeriod: 101112, + TransferTimeoutPeriod: 131415, + ConsumerRedistributionFraction: "consumer_redistribution_fraction2", + BlocksPerDistributionTransmission: 456, + HistoricalEntries: 789, + DistributionTransmissionChannel: "distribution_transmission_channel2", + } + providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId", expectedRecord) + actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "consumerId") + require.True(t, found) + require.Equal(t, expectedRecord, actualRecord) + + providerKeeper.DeleteConsumerIdToInitializationRecord(ctx, "consumerId") + actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "consumerId") + require.False(t, found) + require.Equal(t, providertypes.ConsumerInitializationRecord{}, actualRecord) +} + +// TestConsumerIdToOwnerAddress tests the getter, setter, and deletion methods of the owner address to registration record methods +func TestConsumerIdToOwnerAddress(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + _, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") + require.False(t, found) + + providerKeeper.SetConsumerIdToOwnerAddress(ctx, "consumerId", "owner_address") + address, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") + require.True(t, found) + require.Equal(t, "owner_address", address) + + // assert that overwriting the current owner address works + providerKeeper.SetConsumerIdToOwnerAddress(ctx, "consumerId", "owner_address2") + address, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") + require.True(t, found) + require.Equal(t, "owner_address2", address) + + providerKeeper.DeleteConsumerIdToOwnerAddress(ctx, "consumerId") + _, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") + require.False(t, found) +} diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 8e17014a59..d7329e5cec 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -133,6 +133,12 @@ const ( ConsumerIdToChainIdKeyName = "ConsumerIdToChainIdKey" + ConsumerIdToRegistrationRecordKeyName = "ConsumerIdToRegistrationRecordKey" + + ConsumerIdToInitializationRecordKeyName = "ConsumerIdToInitializationRecordKey" + + ConsumerIdToOwnerAddressKeyName = "ConsumerIdToOwnerAddress" + ClientIdToConsumerIdKeyName = "ClientIdToConsumerIdKey" ) @@ -333,8 +339,17 @@ func getKeyPrefixes() map[string]byte { // ConsumerIdToChainIdKeyName is the key for storing the chain id for the given consumer id ConsumerIdToChainIdKeyName: 46, + // ConsumerIdToRegistrationRecordKeyName is the key for storing the registration record for the given consumer id + ConsumerIdToRegistrationRecordKeyName: 47, + + // ConsumerIdToInitializationRecordKeyName is the key for storing the initialization record for the given consumer id + ConsumerIdToInitializationRecordKeyName: 48, + + // ConsumerIdToOwnerAddressKeyName is the key for storing the owner address for the given consumer id + ConsumerIdToOwnerAddressKeyName: 49, + // ClientIdToConsumerIdKeyName is the key for storing the consumer id for the given client id - ClientIdToConsumerIdKeyName: 47, + ClientIdToConsumerIdKeyName: 50, // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO TestPreserveBytePrefix() IN keys_test.go } @@ -725,11 +740,26 @@ func ConsumerIdKey() []byte { return []byte{mustGetKeyPrefix(ConsumerIdKeyName)} } -// ConsumerIdToChainIdKey returns the chain id that corresponds to this consumer id +// ConsumerIdToChainIdKey returns the key used to store the chain id that corresponds to this consumer id func ConsumerIdToChainIdKey(consumerId string) []byte { return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToChainIdKeyName), consumerId) } +// ConsumerIdToRegistrationRecordKey returns the key used to store the registration record that corresponds to this consumer id +func ConsumerIdToRegistrationRecordKey(consumerId string) []byte { + return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName), consumerId) +} + +// ConsumerIdToInitializationRecordKey returns the key used to store the initialization record that corresponds to this consumer id +func ConsumerIdToInitializationRecordKey(consumerId string) []byte { + return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName), consumerId) +} + +// ConsumerIdToOwnerAddressKey returns the key used to store the owner address that corresponds to this consumer id +func ConsumerIdToOwnerAddressKey(consumerId string) []byte { + return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToOwnerAddressKeyName), consumerId) +} + // ClientIdToConsumerIdKey returns the consumer id that corresponds to this client id func ClientIdToConsumerIdKey(clientId string) []byte { clientIdLength := len(clientId) diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 07f47f7e9f..bff00613e0 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -126,7 +126,13 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, uint8(46), providertypes.ConsumerIdToChainIdKey("consumerId")[0]) i++ - require.Equal(t, uint8(47), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, uint8(47), providertypes.ConsumerIdToRegistrationRecordKey("consumerId")[0]) + i++ + require.Equal(t, uint8(48), providertypes.ConsumerIdToInitializationRecordKey("consumerId")[0]) + i++ + require.Equal(t, uint8(49), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) + i++ + require.Equal(t, uint8(50), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() @@ -197,6 +203,9 @@ func getAllFullyDefinedKeys() [][]byte { providerkeeper.GetValidatorKey(types.LastProviderConsensusValsPrefix(), providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.ConsumerIdKey(), providertypes.ConsumerIdToChainIdKey("consumerId"), + providertypes.ConsumerIdToRegistrationRecordKey("consumerId"), + providertypes.ConsumerIdToInitializationRecordKey("consumerId"), + providertypes.ConsumerIdToOwnerAddressKey("consumerId"), providertypes.ClientIdToConsumerIdKey("clientId"), } } From 90db06450069c773823a9c271d7a28a9ff295abe Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 31 Jul 2024 15:11:32 +0300 Subject: [PATCH 08/41] renamed (partially) chainIds to consumerIds --- x/ccv/provider/keeper/keeper.go | 44 ++++---- x/ccv/provider/keeper/key_assignment.go | 6 +- x/ccv/provider/types/keys.go | 143 ++++++++++++------------ x/ccv/provider/types/keys_test.go | 22 ++-- 4 files changed, 108 insertions(+), 107 deletions(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 1125ae52c8..f613180836 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -192,13 +192,13 @@ func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability // SetChainToChannel sets the mapping from a consumer chainID to the CCV channel ID for that consumer chain. func (k Keeper) SetChainToChannel(ctx sdk.Context, chainID, channelID string) { store := ctx.KVStore(k.storeKey) - store.Set(types.ChainToChannelKey(chainID), []byte(channelID)) + store.Set(types.ConsumerIdToChannelIdKey(chainID), []byte(channelID)) } // GetChainToChannel gets the CCV channelID for the given consumer chainID func (k Keeper) GetChainToChannel(ctx sdk.Context, chainID string) (string, bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ChainToChannelKey(chainID)) + bz := store.Get(types.ConsumerIdToChannelIdKey(chainID)) if bz == nil { return "", false } @@ -208,7 +208,7 @@ func (k Keeper) GetChainToChannel(ctx sdk.Context, chainID string) (string, bool // DeleteChainToChannel deletes the CCV channel ID for the given consumer chain ID func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ChainToChannelKey(chainID)) + store.Delete(types.ConsumerIdToChannelIdKey(chainID)) } // SetProposedConsumerChain stores a consumer chainId corresponding to a submitted consumer addition proposal @@ -274,13 +274,13 @@ func (k Keeper) GetAllPendingConsumerChainIDs(ctx sdk.Context) []string { // created IBC clients. Consumer chains with created clients are also referred to as registered. // // Note that the registered consumer chains are stored under keys with the following format: -// ChainToClientKeyPrefix | chainID +// ConsumerIdToClientIdKeyPrefix | chainID // Thus, the returned array is in ascending order of chainIDs. func (k Keeper) GetAllRegisteredConsumerChainIDs(ctx sdk.Context) []string { chainIDs := []string{} store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ChainToClientKeyPrefix()) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToClientIdKeyPrefix()) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -295,13 +295,13 @@ func (k Keeper) GetAllRegisteredConsumerChainIDs(ctx sdk.Context) []string { // SetChannelToChain sets the mapping from the CCV channel ID to the consumer chainID. func (k Keeper) SetChannelToChain(ctx sdk.Context, channelID, chainID string) { store := ctx.KVStore(k.storeKey) - store.Set(types.ChannelToChainKey(channelID), []byte(chainID)) + store.Set(types.ChannelToConsumerIdKey(channelID), []byte(chainID)) } // GetChannelToChain gets the consumer chainID for a given CCV channelID func (k Keeper) GetChannelToChain(ctx sdk.Context, channelID string) (string, bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ChannelToChainKey(channelID)) + bz := store.Get(types.ChannelToConsumerIdKey(channelID)) if bz == nil { return "", false } @@ -311,7 +311,7 @@ func (k Keeper) GetChannelToChain(ctx sdk.Context, channelID string) (string, bo // DeleteChannelToChain deletes the consumer chain ID for a given CCV channelID func (k Keeper) DeleteChannelToChain(ctx sdk.Context, channelID string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ChannelToChainKey(channelID)) + store.Delete(types.ChannelToConsumerIdKey(channelID)) } // GetAllChannelToChains gets all channel to chain mappings. If a mapping exists, @@ -319,11 +319,11 @@ func (k Keeper) DeleteChannelToChain(ctx sdk.Context, channelID string) { // // Note that mapping from CCV channel IDs to consumer chainIDs // is stored under keys with the following format: -// ChannelToChainKeyPrefix | channelID +// ChannelIdToConsumerIdKeyPrefix | channelID // Thus, the returned array is in ascending order of channelIDs. func (k Keeper) GetAllChannelToChains(ctx sdk.Context) (channels []types.ChannelToChain) { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ChannelToChainKeyPrefix()) + iterator := storetypes.KVStorePrefixIterator(store, types.ChannelIdToConsumerIdKeyPrefix()) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -683,13 +683,13 @@ func (k Keeper) DeletePendingVSCPackets(ctx sdk.Context, chainID string) { // SetConsumerClientId sets the client ID for the given chain ID func (k Keeper) SetConsumerClientId(ctx sdk.Context, chainID, clientID string) { store := ctx.KVStore(k.storeKey) - store.Set(types.ChainToClientKey(chainID), []byte(clientID)) + store.Set(types.ConsumerIdToClientIdKey(chainID), []byte(clientID)) } // GetConsumerClientId returns the client ID for the given chain ID. func (k Keeper) GetConsumerClientId(ctx sdk.Context, chainID string) (string, bool) { store := ctx.KVStore(k.storeKey) - clientIdBytes := store.Get(types.ChainToClientKey(chainID)) + clientIdBytes := store.Get(types.ConsumerIdToClientIdKey(chainID)) if clientIdBytes == nil { return "", false } @@ -699,7 +699,7 @@ func (k Keeper) GetConsumerClientId(ctx sdk.Context, chainID string) (string, bo // DeleteConsumerClientId removes from the store the clientID for the given chainID. func (k Keeper) DeleteConsumerClientId(ctx sdk.Context, chainID string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ChainToClientKey(chainID)) + store.Delete(types.ConsumerIdToClientIdKey(chainID)) } // SetSlashLog updates validator's slash log for a consumer chain @@ -822,7 +822,7 @@ func (k Keeper) GetAllOptedIn( chainID string, ) (providerConsAddresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.OptedInKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.OptedInKeyPrefix(), chainID) iterator := storetypes.KVStorePrefixIterator(store, key) defer iterator.Close() @@ -839,7 +839,7 @@ func (k Keeper) DeleteAllOptedIn( chainID string, ) { store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.OptedInKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.OptedInKeyPrefix(), chainID) iterator := storetypes.KVStorePrefixIterator(store, key) var keysToDel [][]byte @@ -902,7 +902,7 @@ func (k Keeper) GetAllCommissionRateValidators( chainID string, ) (addresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.ConsumerCommissionRateKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.ConsumerCommissionRateKeyPrefix(), chainID) iterator := storetypes.KVStorePrefixIterator(store, key) defer iterator.Close() @@ -1013,7 +1013,7 @@ func (k Keeper) GetAllowList( chainID string, ) (providerConsAddresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.AllowlistKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), chainID) iterator := storetypes.KVStorePrefixIterator(store, key) defer iterator.Close() @@ -1038,7 +1038,7 @@ func (k Keeper) IsAllowlisted( // DeleteAllowlist deletes all allowlisted validators func (k Keeper) DeleteAllowlist(ctx sdk.Context, chainID string) { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ChainIdWithLenKey(types.AllowlistKeyPrefix(), chainID)) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), chainID)) defer iterator.Close() keysToDel := [][]byte{} @@ -1054,7 +1054,7 @@ func (k Keeper) DeleteAllowlist(ctx sdk.Context, chainID string) { // IsAllowlistEmpty returns `true` if no validator is allowlisted on chain `chainID` func (k Keeper) IsAllowlistEmpty(ctx sdk.Context, chainID string) bool { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ChainIdWithLenKey(types.AllowlistKeyPrefix(), chainID)) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), chainID)) defer iterator.Close() return !iterator.Valid() @@ -1076,7 +1076,7 @@ func (k Keeper) GetDenyList( chainID string, ) (providerConsAddresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ChainIdWithLenKey(types.DenylistKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), chainID) iterator := storetypes.KVStorePrefixIterator(store, key) defer iterator.Close() @@ -1101,7 +1101,7 @@ func (k Keeper) IsDenylisted( // DeleteDenylist deletes all denylisted validators func (k Keeper) DeleteDenylist(ctx sdk.Context, chainID string) { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ChainIdWithLenKey(types.DenylistKeyPrefix(), chainID)) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), chainID)) defer iterator.Close() keysToDel := [][]byte{} @@ -1117,7 +1117,7 @@ func (k Keeper) DeleteDenylist(ctx sdk.Context, chainID string) { // IsDenylistEmpty returns `true` if no validator is denylisted on chain `chainID` func (k Keeper) IsDenylistEmpty(ctx sdk.Context, chainID string) bool { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ChainIdWithLenKey(types.DenylistKeyPrefix(), chainID)) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), chainID)) defer iterator.Close() return !iterator.Valid() diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index 755e4d247b..915618b86b 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -118,7 +118,7 @@ func (k Keeper) GetAllValidatorConsumerPubKeys(ctx sdk.Context, consumerId *stri prefix = []byte{consumerValidatorsKeyPrefix} } else { // iterate over the validators public keys assigned for consumerId - prefix = types.ChainIdWithLenKey(consumerValidatorsKeyPrefix, *consumerId) + prefix = types.ConsumerIdWithLenKey(consumerValidatorsKeyPrefix, *consumerId) } iterator := storetypes.KVStorePrefixIterator(store, prefix) defer iterator.Close() @@ -203,7 +203,7 @@ func (k Keeper) GetAllValidatorsByConsumerAddr(ctx sdk.Context, consumerId *stri prefix = []byte{validatorsByConsumerAddrKeyPrefix} } else { // iterate over the mappings from consensus addresses on consumerId - prefix = types.ChainIdWithLenKey(validatorsByConsumerAddrKeyPrefix, *consumerId) + prefix = types.ConsumerIdWithLenKey(validatorsByConsumerAddrKeyPrefix, *consumerId) } iterator := storetypes.KVStorePrefixIterator(store, prefix) defer iterator.Close() @@ -307,7 +307,7 @@ func (k Keeper) ConsumeConsumerAddrsToPrune( ) (consumerAddrsToPrune types.AddressList) { store := ctx.KVStore(k.storeKey) consumerAddrsToPruneKeyPrefix := types.ConsumerAddrsToPruneV2KeyPrefix() - startPrefix := types.ChainIdWithLenKey(consumerAddrsToPruneKeyPrefix, chainID) + startPrefix := types.ConsumerIdWithLenKey(consumerAddrsToPruneKeyPrefix, chainID) iterator := store.Iterator(startPrefix, storetypes.InclusiveEndBytes(types.ConsumerAddrsToPruneV2Key(chainID, ts))) defer iterator.Close() diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index d7329e5cec..6f858fb769 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -49,11 +49,11 @@ const ( SlashMeterReplenishTimeCandidateKeyName = "SlashMeterReplenishTimeCandidateKey" - ChainToChannelKeyName = "ChainToChannelKey" + ChainToChannelKeyName = "ConsumerIdToChannelIdKey" - ChannelToChainKeyName = "ChannelToChainKey" + ChannelToChainKeyName = "ChannelToConsumerIdKey" - ChainToClientKeyName = "ChainToClientKey" + ChainToClientKeyName = "ConsumerIdToClientIdKey" DeprecatedInitTimeoutTimestampKeyName = "DeprecatedInitTimeoutTimestampKey" @@ -169,15 +169,15 @@ func getKeyPrefixes() map[string]byte { // SlashMeterReplenishTimeCandidateKey is the key for storing the slash meter replenish time candidate SlashMeterReplenishTimeCandidateKeyName: 4, - // ChainToChannelKey is the key for storing mapping + // ConsumerIdToChannelIdKey is the key for storing mapping // from chainID to the channel ID that is used to send over validator set changes. ChainToChannelKeyName: 5, - // ChannelToChainKey is the key for storing mapping + // ChannelToConsumerIdKey is the key for storing mapping // from the CCV channel ID to the consumer chain ID. ChannelToChainKeyName: 6, - // ChainToClientKey is the key for storing the client ID for a given consumer chainID. + // ConsumerIdToClientIdKey is the key for storing the client ID for a given consumer chainID. ChainToClientKeyName: 7, // InitTimeoutTimestampKey is the key for storing @@ -423,29 +423,29 @@ func SlashMeterReplenishTimeCandidateKey() []byte { return []byte{mustGetKeyPrefix(SlashMeterReplenishTimeCandidateKeyName)} } -// ChainToChannelKey returns the key under which the CCV channel ID will be stored for the given consumer chain. -func ChainToChannelKey(chainID string) []byte { - return append([]byte{mustGetKeyPrefix(ChainToChannelKeyName)}, []byte(chainID)...) +// ConsumerIdToChannelIdKey returns the key under which the CCV channel ID will be stored for the given consumer chain. +func ConsumerIdToChannelIdKey(consumerId string) []byte { + return append([]byte{mustGetKeyPrefix(ChainToChannelKeyName)}, []byte(consumerId)...) } -// ChannelToChainKeyPrefix returns the key prefix for storing the consumer chain IDs. -func ChannelToChainKeyPrefix() []byte { +// ChannelIdToConsumerIdKeyPrefix returns the key prefix for storing the consumer chain ids. +func ChannelIdToConsumerIdKeyPrefix() []byte { return []byte{mustGetKeyPrefix(ChannelToChainKeyName)} } -// ChannelToChainKey returns the key under which the consumer chain ID will be stored for the given channelID. -func ChannelToChainKey(channelID string) []byte { - return append(ChannelToChainKeyPrefix(), []byte(channelID)...) +// ChannelToConsumerIdKey returns the key under which the consumer chain id will be stored for the given channelId. +func ChannelToConsumerIdKey(channelId string) []byte { + return append(ChannelIdToConsumerIdKeyPrefix(), []byte(channelId)...) } -// ChainToClientKeyPrefix returns the key prefix for storing the clientID for the given chainID. -func ChainToClientKeyPrefix() []byte { +// ConsumerIdToClientIdKeyPrefix returns the key prefix for storing the clientId for the given consumerId. +func ConsumerIdToClientIdKeyPrefix() []byte { return []byte{mustGetKeyPrefix(ChainToClientKeyName)} } -// ChainToClientKey returns the key under which the clientID for the given chainID is stored. -func ChainToClientKey(chainID string) []byte { - return append(ChainToClientKeyPrefix(), []byte(chainID)...) +// ConsumerIdToClientIdKey returns the key under which the clientId for the given consumerId is stored. +func ConsumerIdToClientIdKey(consumerId string) []byte { + return append(ConsumerIdToClientIdKeyPrefix(), []byte(consumerId)...) } // PendingCAPKeyPrefix returns the key prefix for storing a pending consumer addition proposal @@ -499,14 +499,14 @@ func ValsetUpdateBlockHeightKey(valsetUpdateId uint64) []byte { } // ConsumerGenesisKey returns the key corresponding to consumer genesis state material -// (consensus state and client state) indexed by consumer chain id -func ConsumerGenesisKey(chainID string) []byte { - return append([]byte{mustGetKeyPrefix(ConsumerGenesisKeyName)}, []byte(chainID)...) +// (consensus state and client state) indexed by consumer id +func ConsumerGenesisKey(consumerId string) []byte { + return append([]byte{mustGetKeyPrefix(ConsumerGenesisKeyName)}, []byte(consumerId)...) } -// SlashAcksKey returns the key under which slashing acks are stored for a given chain ID -func SlashAcksKey(chainID string) []byte { - return append([]byte{mustGetKeyPrefix(SlashAcksKeyName)}, []byte(chainID)...) +// SlashAcksKey returns the key under which slashing acks are stored for a given consumer id +func SlashAcksKey(consumerId string) []byte { + return append([]byte{mustGetKeyPrefix(SlashAcksKeyName)}, []byte(consumerId)...) } // InitChainHeightKey returns the key under which the block height for a given chain ID is stored @@ -556,8 +556,8 @@ func ConsumerValidatorsKeyPrefix() byte { // ConsumerValidatorsKey returns the key under which the // validator assigned keys for every consumer chain are stored -func ConsumerValidatorsKey(chainID string, addr ProviderConsAddress) []byte { - return ChainIdAndConsAddrKey(ConsumerValidatorsKeyPrefix(), chainID, addr.ToSdkConsAddr()) +func ConsumerValidatorsKey(consumerId string, addr ProviderConsAddress) []byte { + return ConsumerIdAndConsAddrKey(ConsumerValidatorsKeyPrefix(), consumerId, addr.ToSdkConsAddr()) } // ValidatorsByConsumerAddrKeyPrefix returns the key prefix for storing the mapping from validator addresses @@ -568,8 +568,8 @@ func ValidatorsByConsumerAddrKeyPrefix() byte { // ValidatorsByConsumerAddrKey returns the key for storing the mapping from validator addresses // on consumer chains to validator addresses on the provider chain -func ValidatorsByConsumerAddrKey(chainID string, addr ConsumerConsAddress) []byte { - return ChainIdAndConsAddrKey(ValidatorsByConsumerAddrKeyPrefix(), chainID, addr.ToSdkConsAddr()) +func ValidatorsByConsumerAddrKey(consumerId string, addr ConsumerConsAddress) []byte { + return ConsumerIdAndConsAddrKey(ValidatorsByConsumerAddrKeyPrefix(), consumerId, addr.ToSdkConsAddr()) } // SlashLogKey returns the key to a validator's slash log @@ -588,9 +588,9 @@ func ConsumerRewardDenomsKey(denom string) []byte { } // EquivocationEvidenceMinHeightKey returns the key storing the minimum height -// of a valid consumer equivocation evidence for a given consumer chain ID -func EquivocationEvidenceMinHeightKey(consumerChainID string) []byte { - return append([]byte{mustGetKeyPrefix(EquivocationEvidenceMinHeightKeyName)}, []byte(consumerChainID)...) +// of a valid consumer equivocation evidence for a given consumer id +func EquivocationEvidenceMinHeightKey(consumerId string) []byte { + return append([]byte{mustGetKeyPrefix(EquivocationEvidenceMinHeightKeyName)}, []byte(consumerId)...) } // ProposedConsumerChainKeyPrefix returns the key prefix for storing proposed consumer chainId @@ -625,26 +625,26 @@ func ConsumerValidatorKeyPrefix() byte { } // ConsumerValidatorKey returns the key for storing consumer validators -// for the given consumer chain `chainID` and validator with `providerAddr` -func ConsumerValidatorKey(chainID string, providerAddr []byte) []byte { - prefix := ChainIdWithLenKey(ConsumerValidatorKeyPrefix(), chainID) +// for the given consumer chain `consumerId` and validator with `providerAddr` +func ConsumerValidatorKey(consumerId string, providerAddr []byte) []byte { + prefix := ConsumerIdWithLenKey(ConsumerValidatorKeyPrefix(), consumerId) return append(prefix, providerAddr...) } // TopNKey returns the key used to store the Top N value per consumer chain. // This value corresponds to the N% of the top validators that have to validate the consumer chain. -func TopNKey(chainID string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(TopNKeyName), chainID) +func TopNKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(TopNKeyName), consumerId) } -// ValidatorSetPowerKey returns the key of consumer chain `chainID` -func ValidatorsPowerCapKey(chainID string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(ValidatorsPowerCapKeyName), chainID) +// ValidatorSetPowerKey returns the key of consumer `consumerId` +func ValidatorsPowerCapKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(ValidatorsPowerCapKeyName), consumerId) } // ValidatorSetCapKey returns the key of consumer chain `chainID` -func ValidatorSetCapKey(chainID string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(ValidatorSetCapKeyName), chainID) +func ValidatorSetCapKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(ValidatorSetCapKeyName), consumerId) } // AllowlistKeyPrefix returns the key prefix for storing consumer chains allowlists @@ -653,9 +653,9 @@ func AllowlistKeyPrefix() byte { } // AllowlistKey returns the key for storing consumer chains allowlists -func AllowlistKey(chainID string, providerAddr ProviderConsAddress) []byte { +func AllowlistKey(consumerId string, providerAddr ProviderConsAddress) []byte { return append( - ChainIdWithLenKey(AllowlistKeyPrefix(), chainID), + ConsumerIdWithLenKey(AllowlistKeyPrefix(), consumerId), providerAddr.ToSdkConsAddr().Bytes()..., ) } @@ -666,9 +666,9 @@ func DenylistKeyPrefix() byte { } // DenylistKey returns the key for storing consumer chains denylists -func DenylistKey(chainID string, providerAddr ProviderConsAddress) []byte { +func DenylistKey(consumerId string, providerAddr ProviderConsAddress) []byte { return append( - ChainIdWithLenKey(DenylistKeyPrefix(), chainID), + ConsumerIdWithLenKey(DenylistKeyPrefix(), consumerId), providerAddr.ToSdkConsAddr().Bytes()..., ) } @@ -679,14 +679,14 @@ func OptedInKeyPrefix() byte { } // OptedInKey returns the key used to store whether a validator is opted in on a consumer chain. -func OptedInKey(chainID string, providerAddr ProviderConsAddress) []byte { - prefix := ChainIdWithLenKey(OptedInKeyPrefix(), chainID) +func OptedInKey(consumerId string, providerAddr ProviderConsAddress) []byte { + prefix := ConsumerIdWithLenKey(OptedInKeyPrefix(), consumerId) return append(prefix, providerAddr.ToSdkConsAddr().Bytes()...) } // ConsumerRewardsAllocationKey returns the key used to store the ICS rewards per consumer chain -func ConsumerRewardsAllocationKey(chainID string) []byte { - return append([]byte{mustGetKeyPrefix(ConsumerRewardsAllocationKeyName)}, []byte(chainID)...) +func ConsumerRewardsAllocationKey(consumerId string) []byte { + return append([]byte{mustGetKeyPrefix(ConsumerRewardsAllocationKeyName)}, []byte(consumerId)...) } // ConsumerCommissionRateKeyPrefix returns the key prefix for storing the commission rate per validator per consumer chain. @@ -695,16 +695,16 @@ func ConsumerCommissionRateKeyPrefix() byte { } // ConsumerCommissionRateKey returns the key used to store the commission rate per validator per consumer chain. -func ConsumerCommissionRateKey(chainID string, providerAddr ProviderConsAddress) []byte { - return ChainIdAndConsAddrKey( +func ConsumerCommissionRateKey(consumerId string, providerAddr ProviderConsAddress) []byte { + return ConsumerIdAndConsAddrKey( ConsumerCommissionRateKeyPrefix(), - chainID, + consumerId, providerAddr.ToSdkConsAddr(), ) } -func MinimumPowerInTopNKey(chainID string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(MinimumPowerInTopNKeyName), chainID) +func MinimumPowerInTopNKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(MinimumPowerInTopNKeyName), consumerId) } // ConsumerAddrsToPruneV2KeyPrefix returns the key prefix for storing the consumer validators @@ -742,22 +742,22 @@ func ConsumerIdKey() []byte { // ConsumerIdToChainIdKey returns the key used to store the chain id that corresponds to this consumer id func ConsumerIdToChainIdKey(consumerId string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToChainIdKeyName), consumerId) + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToChainIdKeyName), consumerId) } // ConsumerIdToRegistrationRecordKey returns the key used to store the registration record that corresponds to this consumer id func ConsumerIdToRegistrationRecordKey(consumerId string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName), consumerId) + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName), consumerId) } // ConsumerIdToInitializationRecordKey returns the key used to store the initialization record that corresponds to this consumer id func ConsumerIdToInitializationRecordKey(consumerId string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName), consumerId) + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName), consumerId) } // ConsumerIdToOwnerAddressKey returns the key used to store the owner address that corresponds to this consumer id func ConsumerIdToOwnerAddressKey(consumerId string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(ConsumerIdToOwnerAddressKeyName), consumerId) + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToOwnerAddressKeyName), consumerId) } // ClientIdToConsumerIdKey returns the consumer id that corresponds to this client id @@ -786,7 +786,7 @@ func ClientIdToConsumerIdKey(clientId string) []byte { // ChainIdAndTsKey returns the key with the following format: // bytePrefix | len(chainID) | chainID | timestamp func ChainIdAndTsKey(prefix byte, chainID string, timestamp time.Time) []byte { - partialKey := ChainIdWithLenKey(prefix, chainID) + partialKey := ConsumerIdWithLenKey(prefix, chainID) timeBz := sdk.FormatTimeBytes(timestamp) return ccvtypes.AppendMany( // Append the partialKey @@ -796,17 +796,16 @@ func ChainIdAndTsKey(prefix byte, chainID string, timestamp time.Time) []byte { ) } -// ChainIdWithLenKey returns the key with the following format: -// bytePrefix | len(chainID) | chainID -func ChainIdWithLenKey(prefix byte, chainID string) []byte { - chainIdL := len(chainID) +// ConsumerIdWithLenKey returns the key with the following format: +// bytePrefix | len(consumerId) | consumerId +func ConsumerIdWithLenKey(prefix byte, consumerId string) []byte { return ccvtypes.AppendMany( // Append the prefix []byte{prefix}, // Append the chainID length - sdk.Uint64ToBigEndian(uint64(chainIdL)), + sdk.Uint64ToBigEndian(uint64(len(consumerId))), // Append the chainID - []byte(chainID), + []byte(consumerId), ) } @@ -829,7 +828,7 @@ func ParseChainIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { // ChainIdAndUintIdKey returns the key with the following format: // bytePrefix | len(chainID) | chainID | uint64(ID) func ChainIdAndUintIdKey(prefix byte, chainID string, uintId uint64) []byte { - partialKey := ChainIdWithLenKey(prefix, chainID) + partialKey := ConsumerIdWithLenKey(prefix, chainID) return ccvtypes.AppendMany( // Append the partialKey partialKey, @@ -851,10 +850,10 @@ func ParseChainIdAndUintIdKey(prefix byte, bz []byte) (string, uint64, error) { return chainID, uintID, nil } -// ChainIdAndConsAddrKey returns the key with the following format: -// bytePrefix | len(chainID) | chainID | ConsAddress -func ChainIdAndConsAddrKey(prefix byte, chainID string, addr sdk.ConsAddress) []byte { - partialKey := ChainIdWithLenKey(prefix, chainID) +// ConsumerIdAndConsAddrKey returns the key with the following format: +// bytePrefix | len(consumerId) | consumerId | ConsAddress +func ConsumerIdAndConsAddrKey(prefix byte, consumerId string, addr sdk.ConsAddress) []byte { + partialKey := ConsumerIdWithLenKey(prefix, consumerId) return ccvtypes.AppendMany( // Append the partialKey partialKey, @@ -863,7 +862,7 @@ func ChainIdAndConsAddrKey(prefix byte, chainID string, addr sdk.ConsAddress) [] ) } -// ParseChainIdAndConsAddrKey returns the chain ID and ConsAddress for a ChainIdAndConsAddrKey key +// ParseChainIdAndConsAddrKey returns the chain ID and ConsAddress for a ConsumerIdAndConsAddrKey key func ParseChainIdAndConsAddrKey(prefix byte, bz []byte) (string, sdk.ConsAddress, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index bff00613e0..00e253beee 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -41,11 +41,11 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(4), providertypes.SlashMeterReplenishTimeCandidateKey()[0]) i++ - require.Equal(t, byte(5), providertypes.ChainToChannelKey("chainID")[0]) + require.Equal(t, uint8(5), providertypes.ConsumerIdToChannelIdKey("chainID")[0]) i++ - require.Equal(t, byte(6), providertypes.ChannelToChainKeyPrefix()[0]) + require.Equal(t, uint8(6), providertypes.ChannelIdToConsumerIdKeyPrefix()[0]) i++ - require.Equal(t, byte(7), providertypes.ChainToClientKeyPrefix()[0]) + require.Equal(t, uint8(7), providertypes.ConsumerIdToClientIdKeyPrefix()[0]) i++ // reserve 8 as deprecated i++ @@ -169,9 +169,10 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.ValidatorSetUpdateIdKey(), providertypes.SlashMeterKey(), providertypes.SlashMeterReplenishTimeCandidateKey(), - providertypes.ChainToChannelKey("chainID"), - providertypes.ChannelToChainKey("channelID"), - providertypes.ChainToClientKey("chainID"), + providertypes.ConsumerIdToChannelIdKey("chainID"), + providertypes.ChannelToConsumerIdKey("channelID"), + providertypes.ConsumerIdToClientIdKey("chainID"), + providertypes.InitTimeoutTimestampKey("chainID"), providertypes.PendingCAPKey(time.Time{}, "chainID"), providertypes.PendingCRPKey(time.Time{}, "chainID"), providertypes.ValsetUpdateBlockHeightKey(7), @@ -310,7 +311,7 @@ func TestChainIdAndConsAddrAndParse(t *testing.T) { } for _, test := range tests { - key := providertypes.ChainIdAndConsAddrKey(test.prefix, test.chainID, test.addr) + key := providertypes.ConsumerIdAndConsAddrKey(test.prefix, test.chainID, test.addr) require.NotEmpty(t, key) // Expected bytes = prefix + chainID length + chainID + consAddr bytes expectedLen := 1 + 8 + len(test.chainID) + len(test.addr) @@ -325,9 +326,10 @@ func TestChainIdAndConsAddrAndParse(t *testing.T) { // Test key packing functions with the format func TestKeysWithPrefixAndId(t *testing.T) { funcs := []func(string) []byte{ - providertypes.ChainToChannelKey, - providertypes.ChannelToChainKey, - providertypes.ChainToClientKey, + providertypes.ConsumerIdToChannelIdKey, + providertypes.ChannelToConsumerIdKey, + providertypes.ConsumerIdToClientIdKey, + providertypes.InitTimeoutTimestampKey, providertypes.ConsumerGenesisKey, providertypes.SlashAcksKey, providertypes.InitChainHeightKey, From 995a6e4e071c447fb0fa4d27adad5f54886deabb Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 31 Jul 2024 15:24:49 +0300 Subject: [PATCH 09/41] set consumerId to chainId association during registration --- x/ccv/provider/keeper/keeper.go | 32 ++++++++++++------------ x/ccv/provider/keeper/msg_server.go | 1 + x/ccv/provider/keeper/msg_server_test.go | 6 +++++ x/ccv/provider/types/keys.go | 6 ++--- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index f613180836..593e0a2fb9 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -641,12 +641,12 @@ func (k Keeper) DeleteInitChainHeight(ctx sdk.Context, chainID string) { store.Delete(types.InitChainHeightKey(chainID)) } -// GetPendingVSCPackets returns the list of pending ValidatorSetChange packets stored under chain ID -func (k Keeper) GetPendingVSCPackets(ctx sdk.Context, chainID string) []ccv.ValidatorSetChangePacketData { +// GetPendingVSCPackets returns the list of pending ValidatorSetChange packets stored under consumer id +func (k Keeper) GetPendingVSCPackets(ctx sdk.Context, consumerId string) []ccv.ValidatorSetChangePacketData { var packets types.ValidatorSetChangePackets store := ctx.KVStore(k.storeKey) - bz := store.Get(types.PendingVSCsKey(chainID)) + bz := store.Get(types.PendingVSCsKey(consumerId)) if bz == nil { return []ccv.ValidatorSetChangePacketData{} } @@ -659,9 +659,9 @@ func (k Keeper) GetPendingVSCPackets(ctx sdk.Context, chainID string) []ccv.Vali } // AppendPendingVSCPackets adds the given ValidatorSetChange packet to the list -// of pending ValidatorSetChange packets stored under chain ID -func (k Keeper) AppendPendingVSCPackets(ctx sdk.Context, chainID string, newPackets ...ccv.ValidatorSetChangePacketData) { - pds := append(k.GetPendingVSCPackets(ctx, chainID), newPackets...) +// of pending ValidatorSetChange packets stored under consumer id +func (k Keeper) AppendPendingVSCPackets(ctx sdk.Context, consumerId string, newPackets ...ccv.ValidatorSetChangePacketData) { + pds := append(k.GetPendingVSCPackets(ctx, consumerId), newPackets...) store := ctx.KVStore(k.storeKey) packets := types.ValidatorSetChangePackets{List: pds} @@ -671,7 +671,7 @@ func (k Keeper) AppendPendingVSCPackets(ctx sdk.Context, chainID string, newPack // packets is instantiated in this method and should be able to be marshaled. panic(fmt.Errorf("cannot marshal pending validator set changes: %w", err)) } - store.Set(types.PendingVSCsKey(chainID), buf) + store.Set(types.PendingVSCsKey(consumerId), buf) } // DeletePendingVSCPackets deletes the list of pending ValidatorSetChange packets for chain ID @@ -680,26 +680,26 @@ func (k Keeper) DeletePendingVSCPackets(ctx sdk.Context, chainID string) { store.Delete(types.PendingVSCsKey(chainID)) } -// SetConsumerClientId sets the client ID for the given chain ID -func (k Keeper) SetConsumerClientId(ctx sdk.Context, chainID, clientID string) { +// SetConsumerClientId sets the client id for the given consumer id +func (k Keeper) SetConsumerClientId(ctx sdk.Context, consumerId, clientID string) { store := ctx.KVStore(k.storeKey) - store.Set(types.ConsumerIdToClientIdKey(chainID), []byte(clientID)) + store.Set(types.ConsumerIdToClientIdKey(consumerId), []byte(clientID)) } -// GetConsumerClientId returns the client ID for the given chain ID. -func (k Keeper) GetConsumerClientId(ctx sdk.Context, chainID string) (string, bool) { +// GetConsumerClientId returns the client id for the given consumer id. +func (k Keeper) GetConsumerClientId(ctx sdk.Context, consumerId string) (string, bool) { store := ctx.KVStore(k.storeKey) - clientIdBytes := store.Get(types.ConsumerIdToClientIdKey(chainID)) + clientIdBytes := store.Get(types.ConsumerIdToClientIdKey(consumerId)) if clientIdBytes == nil { return "", false } return string(clientIdBytes), true } -// DeleteConsumerClientId removes from the store the clientID for the given chainID. -func (k Keeper) DeleteConsumerClientId(ctx sdk.Context, chainID string) { +// DeleteConsumerClientId removes from the store the client id for the given consumer id. +func (k Keeper) DeleteConsumerClientId(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerIdToClientIdKey(chainID)) + store.Delete(types.ConsumerIdToClientIdKey(consumerId)) } // SetSlashLog updates validator's slash log for a consumer chain diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 984babcf15..b602e4d21f 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -317,6 +317,7 @@ func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegiste k.Keeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, *msg.RegistrationRecord) k.Keeper.SetConsumerIdToOwnerAddress(ctx, consumerId, msg.Signer) + k.Keeper.SetConsumerIdToChainId(ctx, consumerId, msg.RegistrationRecord.ChainId) return &types.MsgRegisterConsumerResponse{ConsumerId: consumerId}, nil } diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go index 7577fec0f0..f953d8a77f 100644 --- a/x/ccv/provider/keeper/msg_server_test.go +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -30,6 +30,9 @@ func TestRegisterConsumer(t *testing.T) { require.Equal(t, expectedRecord, actualRecord) ownerAddress, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "0") require.Equal(t, "signer", ownerAddress) + chainId, found := providerKeeper.GetConsumerIdToChainId(ctx, "0") + require.True(t, found) + require.Equal(t, "chain_id", chainId) expectedRecord = providertypes.ConsumerRegistrationRecord{ Title: "title2", @@ -46,6 +49,9 @@ func TestRegisterConsumer(t *testing.T) { require.Equal(t, expectedRecord, actualRecord) ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "1") require.Equal(t, "signer2", ownerAddress) + chainId, found = providerKeeper.GetConsumerIdToChainId(ctx, "1") + require.True(t, found) + require.Equal(t, "chain_id2", chainId) } func TestInitializeConsumer(t *testing.T) { diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 6f858fb769..68409a376b 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -515,9 +515,9 @@ func InitChainHeightKey(chainID string) []byte { } // PendingVSCsKey returns the key under which -// pending ValidatorSetChangePacket data is stored for a given chain ID -func PendingVSCsKey(chainID string) []byte { - return append([]byte{mustGetKeyPrefix(PendingVSCsKeyName)}, []byte(chainID)...) +// pending ValidatorSetChangePacket data is stored for a given consumer id +func PendingVSCsKey(consumerId string) []byte { + return append([]byte{mustGetKeyPrefix(PendingVSCsKeyName)}, []byte(consumerId)...) } // ThrottledPacketDataSizeKey returns the key storing the size of the throttled packet data queue for a given chain ID From 13d3e9fd0a8e0b55aad86af58e5272f4ced7c10f Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 31 Jul 2024 15:55:09 +0300 Subject: [PATCH 10/41] added extra check in the initialization so unknokwn, launched, or stopped chains cannot re-initialize --- x/ccv/provider/keeper/msg_server.go | 11 ++++-- x/ccv/provider/keeper/msg_server_test.go | 27 +++++++++++++- x/ccv/provider/keeper/permissionless.go | 39 ++++++++++++++++++++ x/ccv/provider/keeper/permissionless_test.go | 11 ++++++ x/ccv/provider/types/errors.go | 1 + x/ccv/provider/types/keys.go | 14 ++++++- 6 files changed, 95 insertions(+), 8 deletions(-) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index b602e4d21f..0f61586cec 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -318,6 +318,7 @@ func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegiste k.Keeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, *msg.RegistrationRecord) k.Keeper.SetConsumerIdToOwnerAddress(ctx, consumerId, msg.Signer) k.Keeper.SetConsumerIdToChainId(ctx, consumerId, msg.RegistrationRecord.ChainId) + k.Keeper.SetConsumerIdToPhase(ctx, consumerId, Registered) return &types.MsgRegisterConsumerResponse{ConsumerId: consumerId}, nil } @@ -327,10 +328,11 @@ func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgIniti ctx := sdk.UnwrapSDKContext(goCtx) consumerId := msg.ConsumerId - _, found := k.Keeper.GetConsumerIdToRegistrationRecord(ctx, consumerId) - if !found { - // fix error type - return nil, errorsmod.Wrapf(types.ErrInvalidConsumerModificationProposal, "no registered chain with consumer id: %s", msg.GetConsumerId()) + + phase, found := k.Keeper.GetConsumerIdToPhase(ctx, consumerId) + if !found || (phase != Registered && phase != Initialized) { + return nil, errorsmod.Wrapf(types.ErrInitialization, + "chain with consumer id: %s has to be in its registered or initialized phase", consumerId) } ownerAddress, found := k.Keeper.GetConsumerIdToOwnerAddress(ctx, consumerId) @@ -343,6 +345,7 @@ func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgIniti } k.Keeper.SetConsumerIdToInitializationRecord(ctx, consumerId, *msg.InitializationRecord) + k.Keeper.SetConsumerIdToPhase(ctx, consumerId, Initialized) return &types.MsgInitializeConsumerResponse{}, nil } diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go index f953d8a77f..fd9336eb6a 100644 --- a/x/ccv/provider/keeper/msg_server_test.go +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -33,6 +33,9 @@ func TestRegisterConsumer(t *testing.T) { chainId, found := providerKeeper.GetConsumerIdToChainId(ctx, "0") require.True(t, found) require.Equal(t, "chain_id", chainId) + phase, found := providerKeeper.GetConsumerIdToPhase(ctx, "0") + require.True(t, found) + require.Equal(t, providerkeeper.Registered, phase) expectedRecord = providertypes.ConsumerRegistrationRecord{ Title: "title2", @@ -52,6 +55,10 @@ func TestRegisterConsumer(t *testing.T) { chainId, found = providerKeeper.GetConsumerIdToChainId(ctx, "1") require.True(t, found) require.Equal(t, "chain_id2", chainId) + phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "1") + require.True(t, found) + require.Equal(t, providerkeeper.Registered, phase) + } func TestInitializeConsumer(t *testing.T) { @@ -60,13 +67,29 @@ func TestInitializeConsumer(t *testing.T) { msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) - // initializing a non-registered chain should give an error + // initializing a chain with no phase, or a chain that is launched or stopped should give an error _, err := msgServer.InitializeConsumer(ctx, &providertypes.MsgInitializeConsumer{ Authority: "signer", ConsumerId: "0", InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) - require.ErrorContains(t, err, "no registered chain") + require.ErrorContains(t, err, "its registered or initialized phase") + + providerKeeper.SetConsumerIdToPhase(ctx, "0", providerkeeper.Launched) + _, err = msgServer.InitializeConsumer(ctx, + &providertypes.MsgInitializeConsumer{ + Authority: "signer", + ConsumerId: "0", + InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) + require.ErrorContains(t, err, "its registered or initialized phase") + + providerKeeper.SetConsumerIdToPhase(ctx, "0", providerkeeper.Stopped) + _, err = msgServer.InitializeConsumer(ctx, + &providertypes.MsgInitializeConsumer{ + Authority: "signer", + ConsumerId: "0", + InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) + require.ErrorContains(t, err, "its registered or initialized phase") // register chains with consumers ids "0" and "1" _, _ = msgServer.RegisterConsumer(ctx, diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 48ea034189..6647cd2882 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -7,6 +7,16 @@ import ( "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" ) +// ConsumerPhase captures the phases of a consumer chain according to `docs/docs/adrs/adr-018-permissionless-ics.md` +type ConsumerPhase byte + +const ( + Registered ConsumerPhase = iota + Initialized + Launched + Stopped +) + // setConsumerId sets the provided consumerId func (k Keeper) setConsumerId(ctx sdk.Context, consumerId uint64) { store := ctx.KVStore(k.storeKey) @@ -143,6 +153,29 @@ func (k Keeper) DeleteConsumerIdToOwnerAddress(ctx sdk.Context, consumerId strin store.Delete(types.ConsumerIdToOwnerAddressKey(consumerId)) } +// GetConsumerIdToPhase returns the phase associated with this consumer id +func (k Keeper) GetConsumerIdToPhase(ctx sdk.Context, consumerId string) (ConsumerPhase, bool) { + store := ctx.KVStore(k.storeKey) + buf := store.Get(types.ConsumerIdToPhaseKey(consumerId)) + if buf == nil { + return ConsumerPhase(0), false + } + return ConsumerPhase(buf[0]), true +} + +// SetConsumerIdToPhase sets the phase associated with this consumer id +// TODO (PERMISSIONLESS): use this method when launching and when stopping a chian +func (k Keeper) SetConsumerIdToPhase(ctx sdk.Context, consumerId string, phase ConsumerPhase) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ConsumerIdToPhaseKey(consumerId), []byte{byte(phase)}) +} + +// DeleteConsumerIdToPhase deletes the phase associated with this consumer id +func (k Keeper) DeleteConsumerIdToPhase(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToPhaseKey(consumerId)) +} + // GetClientIdToConsumerId returns the consumer id associated with this client id func (k Keeper) GetClientIdToConsumerId(ctx sdk.Context, clientId string) (string, bool) { store := ctx.KVStore(k.storeKey) @@ -164,3 +197,9 @@ func (k Keeper) DeleteClientIdToConsumerId(ctx sdk.Context, clientId string) { store := ctx.KVStore(k.storeKey) store.Delete(types.ClientIdToConsumerIdKey(clientId)) } + +// IsConsumerLaunched returns true if the consumer chain with the provided id is launched +func (k Keeper) IsConsumerLaunched(ctx sdk.Context, consumerId string) bool { + _, found := k.GetConsumerClientId(ctx, consumerId) + return found +} diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index 9917ff96b0..aa352f6b9b 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -191,3 +191,14 @@ func TestConsumerIdToOwnerAddress(t *testing.T) { _, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") require.False(t, found) } + +func TestIsConsumerLaunched(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + require.False(t, providerKeeper.IsConsumerLaunched(ctx, "consumerId")) + + // set a consumer client id which is what happens when the chain launches + providerKeeper.SetConsumerClientId(ctx, "consumerId", "clientId") + require.True(t, providerKeeper.IsConsumerLaunched(ctx, "consumerId")) +} diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 347b2e4774..eebfa6592b 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -31,4 +31,5 @@ var ( ErrNoUnbondingTime = errorsmod.Register(ModuleName, 23, "provider unbonding time not found") ErrInvalidAddress = errorsmod.Register(ModuleName, 24, "invalid address") ErrUnauthorized = errorsmod.Register(ModuleName, 25, "unauthorized") + ErrInitialization = errorsmod.Register(ModuleName, 26, "cannot initialize consumer chain") ) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 68409a376b..0f4c1ab678 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -137,7 +137,9 @@ const ( ConsumerIdToInitializationRecordKeyName = "ConsumerIdToInitializationRecordKey" - ConsumerIdToOwnerAddressKeyName = "ConsumerIdToOwnerAddress" + ConsumerIdToOwnerAddressKeyName = "ConsumerIdToOwnerAddressKey" + + ConsumerIdToPhaseKeyName = "ConsumerIdToPhaseKey" ClientIdToConsumerIdKeyName = "ClientIdToConsumerIdKey" ) @@ -348,8 +350,11 @@ func getKeyPrefixes() map[string]byte { // ConsumerIdToOwnerAddressKeyName is the key for storing the owner address for the given consumer id ConsumerIdToOwnerAddressKeyName: 49, + // ConsumerIdToPhaseKeyName is the key for storing the phase of a consumer chain with the given consumer id + ConsumerIdToPhaseKeyName: 50, + // ClientIdToConsumerIdKeyName is the key for storing the consumer id for the given client id - ClientIdToConsumerIdKeyName: 50, + ClientIdToConsumerIdKeyName: 51, // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO TestPreserveBytePrefix() IN keys_test.go } @@ -760,6 +765,11 @@ func ConsumerIdToOwnerAddressKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToOwnerAddressKeyName), consumerId) } +// ConsumerIdToPhaseKey returns the key used to store the phase that corresponds to this consumer id +func ConsumerIdToPhaseKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToPhaseKeyName), consumerId) +} + // ClientIdToConsumerIdKey returns the consumer id that corresponds to this client id func ClientIdToConsumerIdKey(clientId string) []byte { clientIdLength := len(clientId) From a1a1321bddf39f936211daeb9078b92d2d8cb0d7 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 31 Jul 2024 18:11:21 +0300 Subject: [PATCH 11/41] added initial work on traversing initialized chains that are to-be-launched --- x/ccv/provider/keeper/permissionless.go | 29 +++++++++-- x/ccv/provider/keeper/permissionless_test.go | 52 ++++++++++++++++++-- x/ccv/provider/keeper/proposal.go | 16 ++++++ x/ccv/provider/types/keys.go | 5 ++ 4 files changed, 93 insertions(+), 9 deletions(-) diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 6647cd2882..168ca3c61c 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -1,6 +1,7 @@ package keeper import ( + storetypes "cosmossdk.io/store/types" "encoding/binary" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" @@ -198,8 +199,28 @@ func (k Keeper) DeleteClientIdToConsumerId(ctx sdk.Context, clientId string) { store.Delete(types.ClientIdToConsumerIdKey(clientId)) } -// IsConsumerLaunched returns true if the consumer chain with the provided id is launched -func (k Keeper) IsConsumerLaunched(ctx sdk.Context, consumerId string) bool { - _, found := k.GetConsumerClientId(ctx, consumerId) - return found +// GetInitializedConsumersReadyToLaunch returns the consumer ids of the pending initialized consumer chains +// that are ready to launch, i.e., consumer clients to be created. +func (k Keeper) GetInitializedConsumersReadyToLaunch(ctx sdk.Context) []string { + store := ctx.KVStore(k.storeKey) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToInitializationRecordKeyNameKeyPrefix()) + defer iterator.Close() + + var consumerIds []string + + for ; iterator.Valid(); iterator.Next() { + var record types.ConsumerInitializationRecord + err := record.Unmarshal(iterator.Value()) + if err != nil { + panic(fmt.Errorf("failed to unmarshal consumer record: %w for consumer id: %s", err, string(iterator.Value()))) + } + + if !ctx.BlockTime().Before(record.SpawnTime) { + // the `consumerId` resides in the whole key, but we skip the first byte (because it's the `ConsumerIdKey`) + // plus 8 more bytes for the `uint64` in the key that contains the length of the `consumerId` + consumerIds = append(consumerIds, string(iterator.Key()[1+8:])) + } + } + + return consumerIds } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index aa352f6b9b..1a75cd27fa 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" + "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" "github.com/stretchr/testify/require" "testing" @@ -192,13 +193,54 @@ func TestConsumerIdToOwnerAddress(t *testing.T) { require.False(t, found) } -func TestIsConsumerLaunched(t *testing.T) { +// TestConsumerIdToPhase tests the getter, setter, and deletion methods of the consumer id to phase methods +func TestConsumerIdToPhase(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - require.False(t, providerKeeper.IsConsumerLaunched(ctx, "consumerId")) + _, found := providerKeeper.GetConsumerIdToPhase(ctx, "consumerId") + require.False(t, found) + + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId", keeper.Registered) + phase, found := providerKeeper.GetConsumerIdToPhase(ctx, "consumerId") + require.True(t, found) + require.Equal(t, keeper.Registered, phase) + + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId", keeper.Launched) + phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "consumerId") + require.True(t, found) + require.Equal(t, keeper.Launched, phase) +} + +// TestGetInitializedConsumersReadyToLaunch tests that the ready to-be-launched consumer chains are returned +func TestGetInitializedConsumersReadyToLaunch(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + // no chains to-be-launched exist + require.Empty(t, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) + + // set 3 initialization records with different spawn times + providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId1", + providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(10, 0)}) + providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId2", + providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(20, 0)}) + providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId3", + providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(30, 0)}) + + // time has not yet reached the spawn time of "consumerId1" + ctx = ctx.WithBlockTime(time.Unix(9, 999999999)) + require.Empty(t, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) + + // time has reached the spawn time of "consumerId1" + ctx = ctx.WithBlockTime(time.Unix(10, 0)) + require.Equal(t, []string{"consumerId1"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) + + // time has reached the spawn time of "consumerId1" and "consumerId2" + ctx = ctx.WithBlockTime(time.Unix(20, 0)) + require.Equal(t, []string{"consumerId1", "consumerId2"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) - // set a consumer client id which is what happens when the chain launches - providerKeeper.SetConsumerClientId(ctx, "consumerId", "clientId") - require.True(t, providerKeeper.IsConsumerLaunched(ctx, "consumerId")) + // time has reached the spawn time of all chains + ctx = ctx.WithBlockTime(time.Unix(30, 0)) + require.Equal(t, []string{"consumerId1", "consumerId2", "consumerId3"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) } diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 822df82ed9..38b8c34008 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -373,6 +373,22 @@ func (k Keeper) GetPendingConsumerAdditionProp(ctx sdk.Context, spawnTime time.T // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-bblock-init1 // Spec tag:[CCV-PCF-BBLOCK-INIT.1] func (k Keeper) BeginBlockInit(ctx sdk.Context) { + // TODO (PERMISSIONLESS) + //consumerIds := k.GetInitializedConsumersReadyToLaunch(ctx) + // + //for _, consumerId := range consumerIds { + // record, found := k.GetConsumerIdToInitializationRecord(ctx, consumerId) + // if !found { + // // something is off + // } + // // set the chain ...(have it all in one method) + // // call the method LaunchConsumer + // // cachedCtx, ... + // // k.LaunchConsumerChain(cachedTx, ...) + // // k.SetPhase(Launched) + // + // // CHANGE THEIR PHASE ... + //} propsToExecute := k.GetConsumerAdditionPropsToExecute(ctx) for i, prop := range propsToExecute { diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 0f4c1ab678..ae91c3ef88 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -755,6 +755,11 @@ func ConsumerIdToRegistrationRecordKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName), consumerId) } +// ConsumerIdToInitializationRecordKeyNameKeyPrefix returns the key prefix for storing consumer initialization records +func ConsumerIdToInitializationRecordKeyNameKeyPrefix() []byte { + return []byte{mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName)} +} + // ConsumerIdToInitializationRecordKey returns the key used to store the initialization record that corresponds to this consumer id func ConsumerIdToInitializationRecordKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName), consumerId) From e2539177be922e678538d546400f5b783d62de41 Mon Sep 17 00:00:00 2001 From: insumity Date: Thu, 1 Aug 2024 11:54:53 +0300 Subject: [PATCH 12/41] fixed rebase issues after bringing the VSCMaturedPackets work in --- x/ccv/provider/keeper/key_assignment.go | 2 +- x/ccv/provider/types/keys.go | 12 ++++++------ x/ccv/provider/types/keys_test.go | 7 ++++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index 915618b86b..093e767f1f 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -360,7 +360,7 @@ func (k Keeper) ConsumeConsumerAddrsToPrune( func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, consumerId string) (consumerAddrsToPrune []types.ConsumerAddrsToPruneV2) { store := ctx.KVStore(k.storeKey) consumerAddrsToPruneKeyPrefix := types.ConsumerAddrsToPruneV2KeyPrefix() - iteratorPrefix := types.ChainIdWithLenKey(consumerAddrsToPruneKeyPrefix, consumerId) + iteratorPrefix := types.ConsumerIdWithLenKey(consumerAddrsToPruneKeyPrefix, consumerId) iterator := storetypes.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index ae91c3ef88..729c05c22e 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -81,7 +81,7 @@ const ( ThrottledPacketDataKeyName = "ThrottledPacketDataKey" - GlobalSlashEntryKeyName = "DeprecatedGlobalSlashEntryKey" + DeprecatedGlobalSlashEntryKeyName = "DeprecatedGlobalSlashEntryKey" ConsumerValidatorsKeyName = "ConsumerValidatorsKey" @@ -238,7 +238,7 @@ func getKeyPrefixes() map[string]byte { // GlobalSlashEntryKey is the key for storing global slash queue entries // [DEPRECATED] - GlobalSlashEntryKeyName: 21, + DeprecatedGlobalSlashEntryKeyName: 21, // ConsumerValidatorsKey is the key for storing the validator assigned keys for every consumer chain ConsumerValidatorsKeyName: 22, @@ -732,12 +732,12 @@ func LastProviderConsensusValsPrefix() []byte { } // MinStakeKey returns the key used to store the minimum stake required to validate on consumer chain `chainID` -func MinStakeKey(chainID string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(MinStakeKeyName), chainID) +func MinStakeKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(MinStakeKeyName), consumerId) } -func AllowInactiveValidatorsKey(chainID string) []byte { - return ChainIdWithLenKey(mustGetKeyPrefix(AllowInactiveValidatorsKeyName), chainID) +func AllowInactiveValidatorsKey(consumerId string) []byte { + return ConsumerIddWithLenKey(mustGetKeyPrefix(AllowInactiveValidatorsKeyName), consumerId) } // ConsumerIdKey returns the key used to store the consumerId of the next registered chain diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 00e253beee..1c01c86a03 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -132,7 +132,9 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, uint8(49), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) i++ - require.Equal(t, uint8(50), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, uint8(47), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) + i++ + require.Equal(t, uint8(48), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() @@ -172,7 +174,6 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.ConsumerIdToChannelIdKey("chainID"), providertypes.ChannelToConsumerIdKey("channelID"), providertypes.ConsumerIdToClientIdKey("chainID"), - providertypes.InitTimeoutTimestampKey("chainID"), providertypes.PendingCAPKey(time.Time{}, "chainID"), providertypes.PendingCRPKey(time.Time{}, "chainID"), providertypes.ValsetUpdateBlockHeightKey(7), @@ -207,6 +208,7 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.ConsumerIdToRegistrationRecordKey("consumerId"), providertypes.ConsumerIdToInitializationRecordKey("consumerId"), providertypes.ConsumerIdToOwnerAddressKey("consumerId"), + providertypes.ConsumerIdToPhaseKey("consumerId"), providertypes.ClientIdToConsumerIdKey("clientId"), } } @@ -329,7 +331,6 @@ func TestKeysWithPrefixAndId(t *testing.T) { providertypes.ConsumerIdToChannelIdKey, providertypes.ChannelToConsumerIdKey, providertypes.ConsumerIdToClientIdKey, - providertypes.InitTimeoutTimestampKey, providertypes.ConsumerGenesisKey, providertypes.SlashAcksKey, providertypes.InitChainHeightKey, From 337298ac55d3f12057261b465a73fb8b8468400c Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 2 Aug 2024 17:05:28 +0300 Subject: [PATCH 13/41] made it so we traverse initialization records instead of addition proposals (+ additional changes so the unit tests pass) --- tests/integration/stop_consumer.go | 4 +- testutil/keeper/unit_test_helpers.go | 68 ++- x/ccv/provider/ibc_module_test.go | 10 +- x/ccv/provider/keeper/distribution.go | 2 +- x/ccv/provider/keeper/distribution_test.go | 2 +- x/ccv/provider/keeper/genesis.go | 6 +- x/ccv/provider/keeper/genesis_test.go | 4 +- x/ccv/provider/keeper/keeper.go | 48 +- x/ccv/provider/keeper/keeper_test.go | 2 +- x/ccv/provider/keeper/legacy_proposal.go | 24 - x/ccv/provider/keeper/legacy_proposal_test.go | 125 +--- x/ccv/provider/keeper/msg_server.go | 23 +- x/ccv/provider/keeper/permissionless.go | 63 +- x/ccv/provider/keeper/proposal.go | 278 +++------ x/ccv/provider/keeper/proposal_test.go | 536 +++++++----------- x/ccv/provider/keeper/relay.go | 8 +- x/ccv/provider/keeper/relay_test.go | 17 +- x/ccv/provider/module_test.go | 4 +- x/ccv/provider/proposal_handler.go | 2 +- x/ccv/provider/proposal_handler_test.go | 52 +- x/ccv/provider/types/errors.go | 8 +- x/ccv/provider/types/keys.go | 12 +- x/ccv/provider/types/keys_test.go | 11 +- 23 files changed, 519 insertions(+), 790 deletions(-) diff --git a/tests/integration/stop_consumer.go b/tests/integration/stop_consumer.go index 839bd10771..763aa30296 100644 --- a/tests/integration/stop_consumer.go +++ b/tests/integration/stop_consumer.go @@ -141,10 +141,10 @@ func (s *CCVTestSuite) checkConsumerChainIsRemoved(chainID string, checkChannel _, found = providerKeeper.GetConsumerClientId(s.providerCtx(), chainID) s.Require().False(found) - _, found = providerKeeper.GetChainToChannel(s.providerCtx(), chainID) + _, found = providerKeeper.GetConsumerIdToChannelId(s.providerCtx(), chainID) s.Require().False(found) - _, found = providerKeeper.GetChannelToChain(s.providerCtx(), channelID) + _, found = providerKeeper.GetChannelIdToConsumerId(s.providerCtx(), channelID) s.Require().False(found) s.Require().Nil(providerKeeper.GetSlashAcks(s.providerCtx(), chainID)) diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index f458ac4c3b..3ad6b3d67b 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -219,6 +219,7 @@ func GetNewSlashPacketData() types.SlashPacketData { // Also see `TestProviderStateIsCleanedAfterConsumerChainIsStopped`. func SetupForStoppingConsumerChain(t *testing.T, ctx sdk.Context, providerKeeper *providerkeeper.Keeper, mocks MockedKeepers, + consumerId string, ) { t.Helper() @@ -230,9 +231,14 @@ func SetupForStoppingConsumerChain(t *testing.T, ctx sdk.Context, gomock.InOrder(expectations...) - prop := GetTestConsumerAdditionProp() - err := providerKeeper.CreateConsumerClient(ctx, prop) + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, GetTestRegistrationRecord()) + providerKeeper.SetConsumerIdToInitializationRecord(ctx, consumerId, GetTestInitializationRecord()) + providerKeeper.SetConsumerIdToUpdateRecord(ctx, consumerId, GetTestUpdateRecord()) + providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Initialized) + + err := providerKeeper.CreateConsumerClient(ctx, consumerId) require.NoError(t, err) + providerKeeper.SetClientIdToConsumerId(ctx, "clientID", consumerId) err = providerKeeper.SetConsumerChain(ctx, "channelID") require.NoError(t, err) } @@ -240,30 +246,64 @@ func SetupForStoppingConsumerChain(t *testing.T, ctx sdk.Context, // TestProviderStateIsCleanedAfterConsumerChainIsStopped executes test assertions for the provider's state being cleaned // after a stopped consumer chain. func TestProviderStateIsCleanedAfterConsumerChainIsStopped(t *testing.T, ctx sdk.Context, providerKeeper providerkeeper.Keeper, - expectedChainID, expectedChannelID string, + consumerId, expectedChannelID string, ) { t.Helper() - _, found := providerKeeper.GetConsumerClientId(ctx, expectedChainID) + _, found := providerKeeper.GetConsumerClientId(ctx, consumerId) require.False(t, found) - _, found = providerKeeper.GetChainToChannel(ctx, expectedChainID) + _, found = providerKeeper.GetConsumerIdToChannelId(ctx, consumerId) require.False(t, found) - _, found = providerKeeper.GetChannelToChain(ctx, expectedChannelID) + _, found = providerKeeper.GetChannelIdToConsumerId(ctx, expectedChannelID) require.False(t, found) - _, found = providerKeeper.GetInitChainHeight(ctx, expectedChainID) + _, found = providerKeeper.GetInitChainHeight(ctx, consumerId) require.False(t, found) - acks := providerKeeper.GetSlashAcks(ctx, expectedChainID) + acks := providerKeeper.GetSlashAcks(ctx, consumerId) require.Empty(t, acks) // in case the chain was successfully stopped, it should not contain a Top N associated to it - _, found = providerKeeper.GetTopN(ctx, expectedChainID) + _, found = providerKeeper.GetTopN(ctx, consumerId) require.False(t, found) // test key assignment state is cleaned - require.Empty(t, providerKeeper.GetAllValidatorConsumerPubKeys(ctx, &expectedChainID)) - require.Empty(t, providerKeeper.GetAllValidatorsByConsumerAddr(ctx, &expectedChainID)) - require.Empty(t, providerKeeper.GetAllConsumerAddrsToPrune(ctx, expectedChainID)) - require.Empty(t, providerKeeper.GetAllCommissionRateValidators(ctx, expectedChainID)) - require.Zero(t, providerKeeper.GetEquivocationEvidenceMinHeight(ctx, expectedChainID)) + require.Empty(t, providerKeeper.GetAllValidatorConsumerPubKeys(ctx, &consumerId)) + require.Empty(t, providerKeeper.GetAllValidatorsByConsumerAddr(ctx, &consumerId)) + require.Empty(t, providerKeeper.GetAllConsumerAddrsToPrune(ctx, consumerId)) + require.Empty(t, providerKeeper.GetAllCommissionRateValidators(ctx, consumerId)) + require.Zero(t, providerKeeper.GetEquivocationEvidenceMinHeight(ctx, consumerId)) +} + +func GetTestRegistrationRecord() providertypes.ConsumerRegistrationRecord { + return providertypes.ConsumerRegistrationRecord{ + Title: "title", + Description: "description", + ChainId: "chainID", + } +} + +func GetTestInitializationRecord() providertypes.ConsumerInitializationRecord { + return providertypes.ConsumerInitializationRecord{ + InitialHeight: clienttypes.NewHeight(4, 5), + GenesisHash: []byte("gen_hash"), + BinaryHash: []byte("bin_hash"), + SpawnTime: time.Now(), + ConsumerRedistributionFraction: types.DefaultConsumerRedistributeFrac, + BlocksPerDistributionTransmission: types.DefaultBlocksPerDistributionTransmission, + DistributionTransmissionChannel: "", + HistoricalEntries: types.DefaultHistoricalEntries, + CcvTimeoutPeriod: types.DefaultCCVTimeoutPeriod, + TransferTimeoutPeriod: types.DefaultTransferTimeoutPeriod, + UnbondingPeriod: types.DefaultConsumerUnbondingPeriod, + } +} + +func GetTestUpdateRecord() providertypes.ConsumerUpdateRecord { + return providertypes.ConsumerUpdateRecord{ + Top_N: 0, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: nil, + Denylist: nil, + } } func GetTestConsumerAdditionProp() *providertypes.ConsumerAdditionProposal { diff --git a/x/ccv/provider/ibc_module_test.go b/x/ccv/provider/ibc_module_test.go index 58573d3e3b..49ddb2901b 100644 --- a/x/ccv/provider/ibc_module_test.go +++ b/x/ccv/provider/ibc_module_test.go @@ -104,7 +104,7 @@ func TestOnChanOpenTry(t *testing.T) { { "other CCV channel exists for this consumer chain", func(params *params, keeper *providerkeeper.Keeper) { - keeper.SetChainToChannel( + keeper.SetConsumerIdToChannelId( params.ctx, "consumerChainID", "some existing channel ID", @@ -309,9 +309,11 @@ func TestOnChanOpenConfirm(t *testing.T) { gomock.InOrder(tc.mockExpectations(ctx, mocks)...) if tc.setDuplicateChannel { - providerKeeper.SetChainToChannel(ctx, "consumerChainID", "existingChannelID") + providerKeeper.SetConsumerIdToChannelId(ctx, "consumerChainID", "existingChannelID") } + providerKeeper.SetClientIdToConsumerId(ctx, "clientID", "consumerChainID") + providerModule := provider.NewAppModule(&providerKeeper, *keeperParams.ParamsSubspace, keeperParams.StoreKey) err := providerModule.OnChanOpenConfirm(ctx, "providerPortID", "channelID") @@ -320,11 +322,11 @@ func TestOnChanOpenConfirm(t *testing.T) { require.NoError(t, err) // Validate channel mappings - channelID, found := providerKeeper.GetChainToChannel(ctx, "consumerChainID") + channelID, found := providerKeeper.GetConsumerIdToChannelId(ctx, "consumerChainID") require.True(t, found) require.Equal(t, "channelID", channelID) - chainID, found := providerKeeper.GetChannelToChain(ctx, "channelID") + chainID, found := providerKeeper.GetChannelIdToConsumerId(ctx, "channelID") require.True(t, found) require.Equal(t, "consumerChainID", chainID) diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index 51316d7f5b..5751ab60d6 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -322,7 +322,7 @@ func (k Keeper) IdentifyConsumerChainIDFromIBCPacket(ctx sdk.Context, packet cha } chainID := tmClient.ChainId - if _, ok := k.GetChainToChannel(ctx, chainID); !ok { + if _, ok := k.GetConsumerIdToChannelId(ctx, chainID); !ok { return "", errorsmod.Wrapf(types.ErrUnknownConsumerChannelId, "no CCV channel found for chain with ID: %s", chainID) } diff --git a/x/ccv/provider/keeper/distribution_test.go b/x/ccv/provider/keeper/distribution_test.go index e8caeb7c36..624febc22b 100644 --- a/x/ccv/provider/keeper/distribution_test.go +++ b/x/ccv/provider/keeper/distribution_test.go @@ -231,7 +231,7 @@ func TestIdentifyConsumerChainIDFromIBCPacket(t *testing.T) { ) if tc.expCCVChannel { - keeper.SetChainToChannel(ctx, chainID, ccvChannel) + keeper.SetConsumerIdToChannelId(ctx, chainID, ccvChannel) } if !tc.expErr { diff --git a/x/ccv/provider/keeper/genesis.go b/x/ccv/provider/keeper/genesis.go index 5b44227f90..cc284448a6 100644 --- a/x/ccv/provider/keeper/genesis.go +++ b/x/ccv/provider/keeper/genesis.go @@ -53,8 +53,8 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) []abc } // check if the CCV channel was established if cs.ChannelId != "" { - k.SetChannelToChain(ctx, cs.ChannelId, chainID) - k.SetChainToChannel(ctx, chainID, cs.ChannelId) + k.SetChannelToConsumerId(ctx, cs.ChannelId, chainID) + k.SetConsumerIdToChannelId(ctx, chainID, cs.ChannelId) k.SetInitChainHeight(ctx, chainID, cs.InitialHeight) k.SetSlashAcks(ctx, cs.ChainId, cs.SlashDowntimeAck) } else { @@ -151,7 +151,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { } // try to find channel id for the current consumer chain - channelId, found := k.GetChainToChannel(ctx, chainID) + channelId, found := k.GetConsumerIdToChannelId(ctx, chainID) if found { cs.ChannelId = channelId cs.InitialHeight, found = k.GetInitChainHeight(ctx, chainID) diff --git a/x/ccv/provider/keeper/genesis_test.go b/x/ccv/provider/keeper/genesis_test.go index dcdfb1519c..c93e28501b 100644 --- a/x/ccv/provider/keeper/genesis_test.go +++ b/x/ccv/provider/keeper/genesis_test.go @@ -132,7 +132,7 @@ func TestInitAndExportGenesis(t *testing.T) { require.Equal(t, expectedCandidate, pk.GetSlashMeterReplenishTimeCandidate(ctx)) // check local provider chain states - chainID, found := pk.GetChannelToChain(ctx, provGenesis.ConsumerStates[0].ChannelId) + chainID, found := pk.GetChannelIdToConsumerId(ctx, provGenesis.ConsumerStates[0].ChannelId) require.True(t, found) require.Equal(t, cChainIDs[0], chainID) require.Equal(t, vscID, pk.GetValidatorSetUpdateId(ctx)) @@ -189,7 +189,7 @@ func assertConsumerChainStates(t *testing.T, ctx sdk.Context, pk keeper.Keeper, require.Equal(t, cs.ClientId, clientID) if expChan := cs.ChannelId; expChan != "" { - gotChan, found := pk.GetChainToChannel(ctx, chainID) + gotChan, found := pk.GetConsumerIdToChannelId(ctx, chainID) require.True(t, found) require.Equal(t, expChan, gotChan) } diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 593e0a2fb9..55101c695c 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -189,26 +189,26 @@ func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability return k.scopedKeeper.ClaimCapability(ctx, cap, name) } -// SetChainToChannel sets the mapping from a consumer chainID to the CCV channel ID for that consumer chain. -func (k Keeper) SetChainToChannel(ctx sdk.Context, chainID, channelID string) { +// SetConsumerIdToChannelId sets the mapping from a consumer id to the CCV channel id for that consumer chain. +func (k Keeper) SetConsumerIdToChannelId(ctx sdk.Context, consumerId, channelId string) { store := ctx.KVStore(k.storeKey) - store.Set(types.ConsumerIdToChannelIdKey(chainID), []byte(channelID)) + store.Set(types.ConsumerIdToChannelIdKey(consumerId), []byte(channelId)) } -// GetChainToChannel gets the CCV channelID for the given consumer chainID -func (k Keeper) GetChainToChannel(ctx sdk.Context, chainID string) (string, bool) { +// GetConsumerIdToChannelId gets the CCV channelId for the given consumer chainID +func (k Keeper) GetConsumerIdToChannelId(ctx sdk.Context, consumerId string) (string, bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerIdToChannelIdKey(chainID)) + bz := store.Get(types.ConsumerIdToChannelIdKey(consumerId)) if bz == nil { return "", false } return string(bz), true } -// DeleteChainToChannel deletes the CCV channel ID for the given consumer chain ID -func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { +// DeleteConsumerIdToChannelId deletes the CCV channel id for the given consumer id +func (k Keeper) DeleteConsumerIdToChannelId(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerIdToChannelIdKey(chainID)) + store.Delete(types.ConsumerIdToChannelIdKey(consumerId)) } // SetProposedConsumerChain stores a consumer chainId corresponding to a submitted consumer addition proposal @@ -292,14 +292,14 @@ func (k Keeper) GetAllRegisteredConsumerChainIDs(ctx sdk.Context) []string { return chainIDs } -// SetChannelToChain sets the mapping from the CCV channel ID to the consumer chainID. -func (k Keeper) SetChannelToChain(ctx sdk.Context, channelID, chainID string) { +// SetChannelToConsumerId sets the mapping from the CCV channel id to the consumer id. +func (k Keeper) SetChannelToConsumerId(ctx sdk.Context, channelId, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Set(types.ChannelToConsumerIdKey(channelID), []byte(chainID)) + store.Set(types.ChannelToConsumerIdKey(channelId), []byte(consumerId)) } -// GetChannelToChain gets the consumer chainID for a given CCV channelID -func (k Keeper) GetChannelToChain(ctx sdk.Context, channelID string) (string, bool) { +// GetChannelIdToConsumerId gets the consumer id for a given CCV channel id +func (k Keeper) GetChannelIdToConsumerId(ctx sdk.Context, channelID string) (string, bool) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.ChannelToConsumerIdKey(channelID)) if bz == nil { @@ -308,10 +308,10 @@ func (k Keeper) GetChannelToChain(ctx sdk.Context, channelID string) (string, bo return string(bz), true } -// DeleteChannelToChain deletes the consumer chain ID for a given CCV channelID -func (k Keeper) DeleteChannelToChain(ctx sdk.Context, channelID string) { +// DeleteChannelIdToConsumerId deletes the consumer id for a given CCV channel id +func (k Keeper) DeleteChannelIdToConsumerId(ctx sdk.Context, channelId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ChannelToConsumerIdKey(channelID)) + store.Delete(types.ChannelToConsumerIdKey(channelId)) } // GetAllChannelToChains gets all channel to chain mappings. If a mapping exists, @@ -392,7 +392,7 @@ func (k Keeper) VerifyConsumerChain(ctx sdk.Context, channelID string, connectio } // Verify that there isn't already a CCV channel for the consumer chain - if prevChannel, ok := k.GetChainToChannel(ctx, tmClient.ChainId); ok { + if prevChannel, ok := k.GetConsumerIdToChannelId(ctx, tmClient.ChainId); ok { return errorsmod.Wrapf(ccv.ErrDuplicateChannel, "CCV channel with ID: %s already created for consumer chain %s", prevChannel, tmClient.ChainId) } return nil @@ -418,18 +418,22 @@ func (k Keeper) SetConsumerChain(ctx sdk.Context, channelID string) error { if err != nil { return err } + consumerId, found := k.GetClientIdToConsumerId(ctx, clientID) + if !found { + return errorsmod.Wrapf(types.ErrNoConsumerId, "cannot find a consumer chain associated for this client: %s", clientID) + } // Verify that there isn't already a CCV channel for the consumer chain chainID := tmClient.ChainId - if prevChannelID, ok := k.GetChainToChannel(ctx, chainID); ok { + if prevChannelID, ok := k.GetConsumerIdToChannelId(ctx, consumerId); ok { return errorsmod.Wrapf(ccv.ErrDuplicateChannel, "CCV channel with ID: %s already created for consumer chain %s", prevChannelID, chainID) } // the CCV channel is established: // - set channel mappings - k.SetChainToChannel(ctx, chainID, channelID) - k.SetChannelToChain(ctx, channelID, chainID) + k.SetConsumerIdToChannelId(ctx, consumerId, channelID) + k.SetChannelToConsumerId(ctx, channelID, consumerId) // - set current block height for the consumer chain initialization - k.SetInitChainHeight(ctx, chainID, uint64(ctx.BlockHeight())) + k.SetInitChainHeight(ctx, consumerId, uint64(ctx.BlockHeight())) // emit event on successful addition ctx.EventManager().EmitEvent( diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 442e86c09d..bfdac533dd 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -251,7 +251,7 @@ func TestGetAllChannelToChains(t *testing.T) { expectedGetAllOrder := []types.ChannelToChain{} for i, chainID := range chainIDs { channelID := fmt.Sprintf("client-%d", len(chainIDs)-i) - pk.SetChannelToChain(ctx, channelID, chainID) + pk.SetChannelToConsumerId(ctx, channelID, chainID) expectedGetAllOrder = append(expectedGetAllOrder, types.ChannelToChain{ChainId: chainID, ChannelId: channelID}) } // sorting by channelID diff --git a/x/ccv/provider/keeper/legacy_proposal.go b/x/ccv/provider/keeper/legacy_proposal.go index 5c4293ba9a..3d39cdacb5 100644 --- a/x/ccv/provider/keeper/legacy_proposal.go +++ b/x/ccv/provider/keeper/legacy_proposal.go @@ -35,30 +35,6 @@ func (k Keeper) HandleLegacyConsumerRewardDenomProposal(ctx sdk.Context, p *type return nil } -// HandleConsumerAdditionProposal will receive the consumer chain's client state from the proposal. -// If the client can be successfully created in a cached context, it stores the proposal as a pending proposal. -// -// Note: This method implements SpawnConsumerChainProposalHandler in spec. -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-hcaprop1 -// Spec tag: [CCV-PCF-HCAPROP.1] -func (k Keeper) HandleLegacyConsumerAdditionProposal(ctx sdk.Context, p *types.ConsumerAdditionProposal) error { - // verify the consumer addition proposal execution - // in cached context and discard the cached writes - if _, _, err := k.CreateConsumerClientInCachedCtx(ctx, *p); err != nil { - return err - } - - k.SetPendingConsumerAdditionProp(ctx, p) - - k.Logger(ctx).Info("consumer addition proposal enqueued", - "chainID", p.ChainId, - "title", p.Title, - "spawn time", p.SpawnTime.UTC(), - ) - - return nil -} - // HandleConsumerRemovalProposal stops a consumer chain and released the outstanding unbonding operations. // If the consumer can be successfully stopped in a cached context, it stores the proposal as a pending proposal. // diff --git a/x/ccv/provider/keeper/legacy_proposal_test.go b/x/ccv/provider/keeper/legacy_proposal_test.go index cfde12c3f8..8cd4c267b9 100644 --- a/x/ccv/provider/keeper/legacy_proposal_test.go +++ b/x/ccv/provider/keeper/legacy_proposal_test.go @@ -4,13 +4,10 @@ import ( "testing" "time" - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" @@ -20,124 +17,6 @@ import ( // Initialization sub-protocol related tests of proposal.go // -// Tests the HandleConsumerAdditionProposal method against the SpawnConsumerChainProposalHandler spec. -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-hcaprop1 -// Spec tag: [CCV-PCF-HCAPROP.1] -func TestHandleLegacyConsumerAdditionProposal(t *testing.T) { - type testCase struct { - description string - malleate func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) - prop *providertypes.ConsumerAdditionProposal - // Time when prop is handled - blockTime time.Time - // Whether it's expected that the proposal is successfully verified - // and appended to the pending proposals - expAppendProp bool - } - - // Snapshot times asserted in tests - now := time.Now().UTC() - - tests := []testCase{ - { - description: "expect to append valid proposal", - malleate: func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) {}, - prop: providertypes.NewConsumerAdditionProposal( - "title", - "description", - "chainID", - clienttypes.NewHeight(2, 3), - []byte("gen_hash"), - []byte("bin_hash"), - now, // Spawn time - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 0, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - blockTime: now, - expAppendProp: true, - }, - { - description: "expect to not append invalid proposal using an already existing chain id", - malleate: func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) { - k.SetConsumerClientId(ctx, chainID, "anyClientId") - }, - - prop: providertypes.NewConsumerAdditionProposal( - "title", - "description", - "chainID", - clienttypes.NewHeight(2, 3), - []byte("gen_hash"), - []byte("bin_hash"), - now, - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 0, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - blockTime: now, - expAppendProp: false, - }, - } - - for _, tc := range tests { - // Common setup - keeperParams := testkeeper.NewInMemKeeperParams(t) - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) - providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - ctx = ctx.WithBlockTime(tc.blockTime) - - if tc.expAppendProp { - // Mock calls are only asserted if we expect a client to be created. - testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 1, []stakingtypes.Validator{}, 1) - gomock.InOrder( - testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, tc.prop.ChainId, clienttypes.NewHeight(2, 3))..., - ) - } - - tc.malleate(ctx, providerKeeper, tc.prop.ChainId) - - err := providerKeeper.HandleLegacyConsumerAdditionProposal(ctx, tc.prop) - - if tc.expAppendProp { - require.NoError(t, err) - // check that prop was added to the stored pending props - gotProposal, found := providerKeeper.GetPendingConsumerAdditionProp(ctx, tc.prop.SpawnTime, tc.prop.ChainId) - require.True(t, found) - require.Equal(t, *tc.prop, gotProposal) - } else { - require.Error(t, err) - // check that prop wasn't added to the stored pending props - _, found := providerKeeper.GetPendingConsumerAdditionProp(ctx, tc.prop.SpawnTime, tc.prop.ChainId) - require.False(t, found) - } - - ctrl.Finish() - } -} - // TestHandleConsumerRemovalProposal tests HandleConsumerRemovalProposal against its corresponding spec method. // // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-hcrprop1 @@ -238,7 +117,7 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { // Note: when expAppendProp is false, no mocks are setup, // meaning no external keeper methods are allowed to be called. if tc.expAppendProp { - testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks) + testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks, tc.prop.ConsumerId) // Valid client creation is asserted with mock expectations here gomock.InOrder(testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) } @@ -255,7 +134,7 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { require.True(t, found) // confirm that the channel was not closed - _, found = providerKeeper.GetChainToChannel(ctx, tc.chainId) + _, found = providerKeeper.GetConsumerIdToChannelId(ctx, tc.chainId) require.True(t, found) } else { require.Error(t, err) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 0f61586cec..d5d540b8c7 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -94,11 +94,6 @@ func (k msgServer) ConsumerAddition(goCtx context.Context, msg *types.MsgConsume return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) } - ctx := sdk.UnwrapSDKContext(goCtx) - err := k.Keeper.HandleConsumerAdditionProposal(ctx, msg) - if err != nil { - return nil, errorsmod.Wrapf(err, "failed handling ConsumerAddition proposal") - } return &types.MsgConsumerAdditionResponse{}, nil } @@ -331,11 +326,11 @@ func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgIniti phase, found := k.Keeper.GetConsumerIdToPhase(ctx, consumerId) if !found || (phase != Registered && phase != Initialized) { - return nil, errorsmod.Wrapf(types.ErrInitialization, + return nil, errorsmod.Wrapf(types.ErrInvalidPhase, "chain with consumer id: %s has to be in its registered or initialized phase", consumerId) } - ownerAddress, found := k.Keeper.GetConsumerIdToOwnerAddress(ctx, consumerId) + ownerAddress, _ := k.Keeper.GetConsumerIdToOwnerAddress(ctx, consumerId) if k.GetAuthority() == msg.Authority { // message is executed as part of governance proposal and hence we change the owner address // to be the one of the module account address @@ -350,17 +345,15 @@ func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgIniti return &types.MsgInitializeConsumerResponse{}, nil } -// UpdateConsumer updates a consumer chain +// UpdateConsumer updates the record of a consumer chain func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateConsumer) (*types.MsgUpdateConsumerResponse, error) { - if k.GetAuthority() != msg.Authority { - return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) - } - ctx := sdk.UnwrapSDKContext(goCtx) - err := k.Keeper.HandleConsumerModificationProposal(ctx, msg) - if err != nil { - return nil, errorsmod.Wrapf(err, "failed handling UpdateConsumer proposal") + ownerAddress, _ := k.Keeper.GetConsumerIdToOwnerAddress(ctx, msg.ConsumerId) + + if k.GetAuthority() != msg.Authority && msg.Authority != ownerAddress { + return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) } + k.Keeper.SetConsumerIdToUpdateRecord(ctx, msg.ConsumerId, *msg.UpdateRecord) return &types.MsgUpdateConsumerResponse{}, nil } diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 168ca3c61c..1ee0415f12 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -1,6 +1,7 @@ package keeper import ( + errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" "encoding/binary" "fmt" @@ -18,6 +19,15 @@ const ( Stopped ) +var DefaultUpdateRecord = types.ConsumerUpdateRecord{ + OwnerAddress: "", + Top_N: 0, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: []string{}, + Denylist: []string{}, +} + // setConsumerId sets the provided consumerId func (k Keeper) setConsumerId(ctx sdk.Context, consumerId uint64) { store := ctx.KVStore(k.storeKey) @@ -126,12 +136,42 @@ func (k Keeper) SetConsumerIdToInitializationRecord(ctx sdk.Context, consumerId store.Set(types.ConsumerIdToInitializationRecordKey(consumerId), bz) } -// DeleteConsumerIdToInitializationRecord deletes the initializatoin record associated with this consumer id +// DeleteConsumerIdToInitializationRecord deletes the initialization record associated with this consumer id func (k Keeper) DeleteConsumerIdToInitializationRecord(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) store.Delete(types.ConsumerIdToInitializationRecordKey(consumerId)) } +// GetConsumerIdToUpdateRecord returns the update record associated with this consumer id +func (k Keeper) GetConsumerIdToUpdateRecordOrDefault(ctx sdk.Context, consumerId string, defaultRecord types.ConsumerUpdateRecord) types.ConsumerUpdateRecord { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ConsumerIdToUpdateRecordKey(consumerId)) + if bz == nil { + return defaultRecord + } + var record types.ConsumerUpdateRecord + if err := record.Unmarshal(bz); err != nil { + panic(fmt.Errorf("failed to unmarshal record: %w", err)) + } + return record +} + +// SetConsumerIdToUpdateRecord sets the update record associated with this consumer id +func (k Keeper) SetConsumerIdToUpdateRecord(ctx sdk.Context, consumerId string, record types.ConsumerUpdateRecord) { + store := ctx.KVStore(k.storeKey) + bz, err := record.Marshal() + if err != nil { + panic(fmt.Errorf("failed to marshal record (%+v): %w", record, err)) + } + store.Set(types.ConsumerIdToUpdateRecordKey(consumerId), bz) +} + +// DeleteConsumerIdToUpdateRecord deletes the update record associated with this consumer id +func (k Keeper) DeleteConsumerIdToUpdateRecord(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToUpdateRecordKey(consumerId)) +} + // GetConsumerIdToOwnerAddress returns the owner address associated with this consumer id func (k Keeper) GetConsumerIdToOwnerAddress(ctx sdk.Context, consumerId string) (string, bool) { store := ctx.KVStore(k.storeKey) @@ -224,3 +264,24 @@ func (k Keeper) GetInitializedConsumersReadyToLaunch(ctx sdk.Context) []string { return consumerIds } + +func (k Keeper) LaunchConsumer(ctx sdk.Context, consumerId string) error { + err := k.CreateConsumerClient(ctx, consumerId) + if err != nil { + return err + } + + consumerGenesis, found := k.GetConsumerGenesis(ctx, consumerId) + if !found { + return errorsmod.Wrapf(types.ErrNoConsumerGenesis, "consumer genesis could not be found") + } + + if len(consumerGenesis.Provider.InitialValSet) == 0 { + return errorsmod.Wrapf(types.ErrInvalidConsumerGenesis, "consumer genesis initial validator set is empty - no validators opted in") + } + + // The cached context is created with a new EventManager so we merge the event + // into the original context + ctx.EventManager().EmitEvents(ctx.EventManager().Events()) + return nil +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 38b8c34008..95135da0a4 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -23,32 +23,6 @@ import ( ccv "github.com/cosmos/interchain-security/v5/x/ccv/types" ) -// Wrapper for the new proposal message MsgConsumerAddition -// Will replace legacy handler HandleLegacyConsumerAdditionProposal -func (k Keeper) HandleConsumerAdditionProposal(ctx sdk.Context, proposal *types.MsgConsumerAddition) error { - p := types.ConsumerAdditionProposal{ - ChainId: proposal.ChainId, - InitialHeight: proposal.InitialHeight, - GenesisHash: proposal.GenesisHash, - BinaryHash: proposal.BinaryHash, - SpawnTime: proposal.SpawnTime, - UnbondingPeriod: proposal.UnbondingPeriod, - CcvTimeoutPeriod: proposal.CcvTimeoutPeriod, - TransferTimeoutPeriod: proposal.TransferTimeoutPeriod, - ConsumerRedistributionFraction: proposal.ConsumerRedistributionFraction, - BlocksPerDistributionTransmission: proposal.BlocksPerDistributionTransmission, - HistoricalEntries: proposal.HistoricalEntries, - DistributionTransmissionChannel: proposal.DistributionTransmissionChannel, - Top_N: proposal.Top_N, - ValidatorsPowerCap: proposal.ValidatorsPowerCap, - ValidatorSetCap: proposal.ValidatorSetCap, - Allowlist: proposal.Allowlist, - Denylist: proposal.Denylist, - } - - return k.HandleLegacyConsumerAdditionProposal(ctx, &p) -} - // Wrapper for the new proposal message MsgConsumerRemoval // Will replace legacy handler HandleLegacyConsumerRemovalProposal func (k Keeper) HandleConsumerRemovalProposal(ctx sdk.Context, proposal *types.MsgRemoveConsumer) error { @@ -92,27 +66,37 @@ func (k Keeper) HandleConsumerModificationProposal(ctx sdk.Context, proposal *ty // CreateConsumerClient will create the CCV client for the given consumer chain. The CCV channel must be built // on top of the CCV client to ensure connection with the right consumer chain. -// -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-crclient1 -// Spec tag: [CCV-PCF-CRCLIENT.1] -func (k Keeper) CreateConsumerClient(ctx sdk.Context, prop *types.ConsumerAdditionProposal) error { - chainID := prop.ChainId - // check that a client for this chain does not exist - if _, found := k.GetConsumerClientId(ctx, chainID); found { - return errorsmod.Wrap(types.ErrDuplicateConsumerChain, - fmt.Sprintf("cannot create client for existent consumer chain: %s", chainID)) +func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { + initializationRecord, found := k.GetConsumerIdToInitializationRecord(ctx, consumerId) + if !found { + return errorsmod.Wrapf(types.ErrNoInitializationRecord, + "initialization record for consumer chain: %s is missing", consumerId) + } + + phase, found := k.GetConsumerIdToPhase(ctx, consumerId) + if !found || phase != Initialized { + return errorsmod.Wrapf(types.ErrInvalidPhase, + "cannot create client for consumer chain that is neither in the initialized phase: %s", consumerId) + } + + // TODO (PERMISSIONLESS): make this a function ... GetChainId(consumerId) ... + registrationRecord, found := k.GetConsumerIdToRegistrationRecord(ctx, consumerId) + if !found { + return errorsmod.Wrapf(types.ErrNoChainId, + "the chain id for this consumer chain: %s is missing", consumerId) } + chainId := registrationRecord.ChainId // Set minimum height for equivocation evidence from this consumer chain - k.SetEquivocationEvidenceMinHeight(ctx, chainID, prop.InitialHeight.RevisionHeight) + k.SetEquivocationEvidenceMinHeight(ctx, consumerId, initializationRecord.InitialHeight.RevisionHeight) // Consumers start out with the unbonding period from the consumer addition prop - consumerUnbondingPeriod := prop.UnbondingPeriod + consumerUnbondingPeriod := initializationRecord.UnbondingPeriod // Create client state by getting template client from parameters and filling in zeroed fields from proposal. clientState := k.GetTemplateClient(ctx) - clientState.ChainId = chainID - clientState.LatestHeight = prop.InitialHeight + clientState.ChainId = chainId + clientState.LatestHeight = initializationRecord.InitialHeight trustPeriod, err := ccv.CalculateTrustPeriod(consumerUnbondingPeriod, k.GetTrustingPeriodFraction(ctx)) if err != nil { @@ -121,11 +105,11 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, prop *types.ConsumerAdditi clientState.TrustingPeriod = trustPeriod clientState.UnbondingPeriod = consumerUnbondingPeriod - consumerGen, validatorSetHash, err := k.MakeConsumerGenesis(ctx, prop) + consumerGen, validatorSetHash, err := k.MakeConsumerGenesis(ctx, consumerId) if err != nil { return err } - err = k.SetConsumerGenesis(ctx, chainID, consumerGen) + err = k.SetConsumerGenesis(ctx, consumerId, consumerGen) if err != nil { return err } @@ -141,20 +125,20 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, prop *types.ConsumerAdditi if err != nil { return err } - k.SetConsumerClientId(ctx, chainID, clientID) + k.SetConsumerClientId(ctx, consumerId, clientID) k.Logger(ctx).Info("consumer chain registered (client created)", - "chainID", chainID, - "clientID", clientID, + "consumer id", consumerId, + "client id", clientID, ) ctx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeConsumerClientCreated, sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - sdk.NewAttribute(ccv.AttributeChainID, chainID), + sdk.NewAttribute(ccv.AttributeChainID, consumerId), sdk.NewAttribute(clienttypes.AttributeKeyClientID, clientID), - sdk.NewAttribute(types.AttributeInitialHeight, prop.InitialHeight.String()), + sdk.NewAttribute(types.AttributeInitialHeight, initializationRecord.InitialHeight.String()), sdk.NewAttribute(types.AttributeTrustingPeriod, clientState.TrustingPeriod.String()), sdk.NewAttribute(types.AttributeUnbondingPeriod, clientState.UnbondingPeriod.String()), ), @@ -163,29 +147,25 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, prop *types.ConsumerAdditi return nil } -// StopConsumerChain cleans up the states for the given consumer chain ID and -// completes the outstanding unbonding operations on the consumer chain. -// -// This method implements StopConsumerChain from spec. -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-stcc1 -// Spec tag: [CCV-PCF-STCC.1] -func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, closeChan bool) (err error) { - // check that a client for chainID exists - if _, found := k.GetConsumerClientId(ctx, chainID); !found { +// StopConsumerChain cleans up the states for the given consumer id +func (k Keeper) StopConsumerChain(ctx sdk.Context, consumerId string, closeChan bool) (err error) { + // check that a client for consumerId exists + // TODO (PERMISSIONLESS): change to use phases instead + if _, found := k.GetConsumerClientId(ctx, consumerId); !found { return errorsmod.Wrap(types.ErrConsumerChainNotFound, - fmt.Sprintf("cannot stop non-existent consumer chain: %s", chainID)) + fmt.Sprintf("cannot stop non-existent consumer chain: %s", consumerId)) } // clean up states - k.DeleteConsumerClientId(ctx, chainID) - k.DeleteConsumerGenesis(ctx, chainID) + k.DeleteConsumerClientId(ctx, consumerId) + k.DeleteConsumerGenesis(ctx, consumerId) // Note: this call panics if the key assignment state is invalid - k.DeleteKeyAssignments(ctx, chainID) - k.DeleteMinimumPowerInTopN(ctx, chainID) - k.DeleteEquivocationEvidenceMinHeight(ctx, chainID) + k.DeleteKeyAssignments(ctx, consumerId) + k.DeleteMinimumPowerInTopN(ctx, consumerId) + k.DeleteEquivocationEvidenceMinHeight(ctx, consumerId) // close channel and delete the mappings between chain ID and channel ID - if channelID, found := k.GetChainToChannel(ctx, chainID); found { + if channelID, found := k.GetConsumerIdToChannelId(ctx, consumerId); found { if closeChan { // Close the channel for the given channel ID on the condition // that the channel exists and isn't already in the CLOSED state @@ -194,49 +174,57 @@ func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, closeChan boo err := k.chanCloseInit(ctx, channelID) if err != nil { k.Logger(ctx).Error("channel to consumer chain could not be closed", - "chainID", chainID, + "consumerId", consumerId, "channelID", channelID, "error", err.Error(), ) } } } - k.DeleteChainToChannel(ctx, chainID) - k.DeleteChannelToChain(ctx, channelID) + k.DeleteConsumerIdToChannelId(ctx, consumerId) + k.DeleteChannelIdToConsumerId(ctx, channelID) } // delete consumer commission rate - provAddrs := k.GetAllCommissionRateValidators(ctx, chainID) + provAddrs := k.GetAllCommissionRateValidators(ctx, consumerId) for _, addr := range provAddrs { - k.DeleteConsumerCommissionRate(ctx, chainID, addr) + k.DeleteConsumerCommissionRate(ctx, consumerId, addr) } - k.DeleteInitChainHeight(ctx, chainID) - k.DeleteSlashAcks(ctx, chainID) - k.DeletePendingVSCPackets(ctx, chainID) + k.DeleteInitChainHeight(ctx, consumerId) + k.DeleteSlashAcks(ctx, consumerId) + k.DeletePendingVSCPackets(ctx, consumerId) - k.DeleteTopN(ctx, chainID) - k.DeleteValidatorsPowerCap(ctx, chainID) - k.DeleteValidatorSetCap(ctx, chainID) - k.DeleteAllowlist(ctx, chainID) - k.DeleteDenylist(ctx, chainID) - k.DeleteMinStake(ctx, chainID) - k.DisableInactiveValidators(ctx, chainID) + k.DeleteTopN(ctx, consumerId) + k.DeleteValidatorsPowerCap(ctx, consumerId) + k.DeleteValidatorSetCap(ctx, consumerId) + k.DeleteAllowlist(ctx, consumerId) + k.DeleteDenylist(ctx, consumerId) + k.DeleteMinStake(ctx, consumerId) + k.DisableInactiveValidators(ctx, consumerId) - k.DeleteAllOptedIn(ctx, chainID) - k.DeleteConsumerValSet(ctx, chainID) + k.DeleteAllOptedIn(ctx, consumerId) + k.DeleteConsumerValSet(ctx, consumerId) - k.Logger(ctx).Info("consumer chain removed from provider", "chainID", chainID) + k.Logger(ctx).Info("consumer chain removed from provider", "consumerId", consumerId) return nil } -// MakeConsumerGenesis constructs the consumer CCV module part of the genesis state. +// MakeConsumerGenesis returns the created consumer genesis state for consumer chain `consumerId`, +// as well as the validator hash of the initial validator set of the consumer chain func (k Keeper) MakeConsumerGenesis( ctx sdk.Context, - prop *types.ConsumerAdditionProposal, + consumerId string, ) (gen ccv.ConsumerGenesisState, nextValidatorsHash []byte, err error) { - chainID := prop.ChainId + initializationRecord, found := k.GetConsumerIdToInitializationRecord(ctx, consumerId) + if !found { + return gen, nil, errorsmod.Wrapf(types.ErrNoInitializationRecord, + "initialization record for consumer chain: %s is missing", consumerId) + + } + updateRecord := k.GetConsumerIdToUpdateRecordOrDefault(ctx, consumerId, DefaultUpdateRecord) + providerUnbondingPeriod, err := k.stakingKeeper.UnbondingTime(ctx) if err != nil { return gen, nil, errorsmod.Wrapf(types.ErrNoUnbondingTime, "unbonding time not found: %s", err) @@ -267,7 +255,7 @@ func (k Keeper) MakeConsumerGenesis( return gen, nil, errorsmod.Wrapf(stakingtypes.ErrNoValidatorFound, "error getting last bonded validators: %s", err) } - if prop.Top_N > 0 { + if updateRecord.Top_N > 0 { // get the consensus active validators // we do not want to base the power calculation for the top N // on inactive validators, too, since the top N will be a percentage of the active set power @@ -278,22 +266,21 @@ func (k Keeper) MakeConsumerGenesis( } // in a Top-N chain, we automatically opt in all validators that belong to the top N - minPower, err := k.ComputeMinPowerInTopN(ctx, activeValidators, prop.Top_N) + minPower, err := k.ComputeMinPowerInTopN(ctx, activeValidators, updateRecord.Top_N) if err != nil { return gen, nil, err } // log the minimum power in top N k.Logger(ctx).Info("minimum power in top N at consumer genesis", - "chainID", chainID, + "consumerId", consumerId, "minPower", minPower, ) - k.OptInTopNValidators(ctx, chainID, activeValidators, minPower) - k.SetMinimumPowerInTopN(ctx, chainID, minPower) + k.OptInTopNValidators(ctx, consumerId, activeValidators, minPower) + k.SetMinimumPowerInTopN(ctx, consumerId, minPower) } // need to use the bondedValidators, not activeValidators, here since the chain might be opt-in and allow inactive vals - nextValidators := k.ComputeNextValidators(ctx, chainID, bondedValidators) - - k.SetConsumerValSet(ctx, chainID, nextValidators) + nextValidators := k.ComputeNextValidators(ctx, consumerId, bondedValidators) + k.SetConsumerValSet(ctx, consumerId, nextValidators) // get the initial updates with the latest set consumer public keys initialUpdatesWithConsumerKeys := DiffValidators([]types.ConsensusValidator{}, nextValidators) @@ -307,14 +294,14 @@ func (k Keeper) MakeConsumerGenesis( consumerGenesisParams := ccv.NewParams( true, - prop.BlocksPerDistributionTransmission, - prop.DistributionTransmissionChannel, + initializationRecord.BlocksPerDistributionTransmission, + initializationRecord.DistributionTransmissionChannel, "", // providerFeePoolAddrStr, - prop.CcvTimeoutPeriod, - prop.TransferTimeoutPeriod, - prop.ConsumerRedistributionFraction, - prop.HistoricalEntries, - prop.UnbondingPeriod, + initializationRecord.CcvTimeoutPeriod, + initializationRecord.TransferTimeoutPeriod, + initializationRecord.ConsumerRedistributionFraction, + initializationRecord.HistoricalEntries, + initializationRecord.UnbondingPeriod, []string{}, []string{}, ccv.DefaultRetryDelayPeriod, @@ -367,92 +354,21 @@ func (k Keeper) GetPendingConsumerAdditionProp(ctx sdk.Context, spawnTime time.T return prop, true } -// BeginBlockInit iterates over the pending consumer addition proposals in order, and creates -// clients for props in which the spawn time has passed. Executed proposals are deleted. -// -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-bblock-init1 -// Spec tag:[CCV-PCF-BBLOCK-INIT.1] +// BeginBlockInit iterates over the initialized consumers chains and creates clients for chains +// in which the spawn time has passed func (k Keeper) BeginBlockInit(ctx sdk.Context) { - // TODO (PERMISSIONLESS) - //consumerIds := k.GetInitializedConsumersReadyToLaunch(ctx) - // - //for _, consumerId := range consumerIds { - // record, found := k.GetConsumerIdToInitializationRecord(ctx, consumerId) - // if !found { - // // something is off - // } - // // set the chain ...(have it all in one method) - // // call the method LaunchConsumer - // // cachedCtx, ... - // // k.LaunchConsumerChain(cachedTx, ...) - // // k.SetPhase(Launched) - // - // // CHANGE THEIR PHASE ... - //} - propsToExecute := k.GetConsumerAdditionPropsToExecute(ctx) - - for i, prop := range propsToExecute { - // create consumer client in a cached context to handle errors + for _, consumerId := range k.GetInitializedConsumersReadyToLaunch(ctx) { cachedCtx, writeFn := ctx.CacheContext() - - k.SetTopN(cachedCtx, prop.ChainId, prop.Top_N) - k.SetValidatorSetCap(cachedCtx, prop.ChainId, prop.ValidatorSetCap) - k.SetValidatorsPowerCap(cachedCtx, prop.ChainId, prop.ValidatorsPowerCap) - k.SetMinStake(cachedCtx, prop.ChainId, prop.MinStake) - k.SetInactiveValidatorsAllowed(cachedCtx, prop.ChainId, prop.AllowInactiveVals) - - for _, address := range prop.Allowlist { - consAddr, err := sdk.ConsAddressFromBech32(address) - if err != nil { - continue - } - - k.SetAllowlist(cachedCtx, prop.ChainId, types.NewProviderConsAddress(consAddr)) - } - - for _, address := range prop.Denylist { - consAddr, err := sdk.ConsAddressFromBech32(address) - if err != nil { - continue - } - - k.SetDenylist(cachedCtx, prop.ChainId, types.NewProviderConsAddress(consAddr)) - } - - err := k.CreateConsumerClient(cachedCtx, &propsToExecute[i]) + err := k.LaunchConsumer(cachedCtx, consumerId) if err != nil { - // drop the proposal - ctx.Logger().Info("consumer client could not be created: %w", err) - continue - } - - consumerGenesis, found := k.GetConsumerGenesis(cachedCtx, prop.ChainId) - if !found { - // drop the proposal - ctx.Logger().Info("consumer genesis could not be created") + ctx.Logger().Error("could not launch chain", + "consumerId", consumerId, + "error", err) continue } - - if len(consumerGenesis.Provider.InitialValSet) == 0 { - // drop the proposal - ctx.Logger().Info("consumer genesis initial validator set is empty - no validators opted in") - continue - } - - // The cached context is created with a new EventManager so we merge the event - // into the original context - ctx.EventManager().EmitEvents(cachedCtx.EventManager().Events()) - // write cache + k.SetConsumerIdToPhase(cachedCtx, consumerId, Launched) writeFn() - - k.Logger(ctx).Info("executed consumer addition proposal", - "chainID", prop.ChainId, - "title", prop.Title, - "spawn time", prop.SpawnTime.UTC(), - ) } - // delete the executed proposals - k.DeletePendingConsumerAdditionProps(ctx, propsToExecute...) } // GetConsumerAdditionPropsToExecute returns the pending consumer addition proposals @@ -651,14 +567,6 @@ func (k Keeper) GetAllPendingConsumerRemovalProps(ctx sdk.Context) (props []type return props } -// CreateConsumerClientInCachedCtx creates a consumer client -// from a given consumer addition proposal in a cached context -func (k Keeper) CreateConsumerClientInCachedCtx(ctx sdk.Context, p types.ConsumerAdditionProposal) (cc sdk.Context, writeCache func(), err error) { - cc, writeCache = ctx.CacheContext() - err = k.CreateConsumerClient(cc, &p) - return -} - // StopConsumerChainInCachedCtx stop a consumer chain // from a given consumer removal proposal in a cached context func (k Keeper) StopConsumerChainInCachedCtx(ctx sdk.Context, p types.ConsumerRemovalProposal) (cc sdk.Context, writeCache func(), err error) { diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index ade3eaa4b2..d8fa36787b 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -3,6 +3,8 @@ package keeper_test import ( "bytes" "encoding/json" + "fmt" + cryptotestutil "github.com/cosmos/interchain-security/v5/testutil/crypto" "sort" "testing" "time" @@ -19,7 +21,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - cryptotestutil "github.com/cosmos/interchain-security/v5/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" @@ -30,128 +31,8 @@ import ( // Initialization sub-protocol related tests of proposal.go // -// Tests the HandleConsumerAdditionProposal method against the SpawnConsumerChainProposalHandler spec. -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-hcaprop1 -// Spec tag: [CCV-PCF-HCAPROP.1] -func TestHandleConsumerAdditionProposal(t *testing.T) { - type testCase struct { - description string - malleate func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) - prop *providertypes.ConsumerAdditionProposal - // Time when prop is handled - blockTime time.Time - // Whether it's expected that the proposal is successfully verified - // and appended to the pending proposals - expAppendProp bool - } - - // Snapshot times asserted in tests - now := time.Now().UTC() - - tests := []testCase{ - { - description: "expect to append valid proposal", - malleate: func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) {}, - prop: providertypes.NewConsumerAdditionProposal( - "title", - "description", - "chainID", - clienttypes.NewHeight(2, 3), - []byte("gen_hash"), - []byte("bin_hash"), - now, // Spawn time - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 0, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - blockTime: now, - expAppendProp: true, - }, - { - description: "expect to not append invalid proposal using an already existing chain id", - malleate: func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) { - k.SetConsumerClientId(ctx, chainID, "anyClientId") - }, - - prop: providertypes.NewConsumerAdditionProposal( - "title", - "description", - "chainID", - clienttypes.NewHeight(2, 3), - []byte("gen_hash"), - []byte("bin_hash"), - now, - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 0, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - blockTime: now, - expAppendProp: false, - }, - } - - for _, tc := range tests { - // Common setup - keeperParams := testkeeper.NewInMemKeeperParams(t) - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) - providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - ctx = ctx.WithBlockTime(tc.blockTime) - - if tc.expAppendProp { - // Mock calls are only asserted if we expect a client to be created. - testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, 1) // returns empty validator set - gomock.InOrder( - testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, tc.prop.ChainId, clienttypes.NewHeight(2, 3))..., - ) - } - - tc.malleate(ctx, providerKeeper, tc.prop.ChainId) - - err := providerKeeper.HandleLegacyConsumerAdditionProposal(ctx, tc.prop) - - if tc.expAppendProp { - require.NoError(t, err) - // check that prop was added to the stored pending props - gotProposal, found := providerKeeper.GetPendingConsumerAdditionProp(ctx, tc.prop.SpawnTime, tc.prop.ChainId) - require.True(t, found) - require.Equal(t, *tc.prop, gotProposal) - } else { - require.Error(t, err) - // check that prop wasn't added to the stored pending props - _, found := providerKeeper.GetPendingConsumerAdditionProp(ctx, tc.prop.SpawnTime, tc.prop.ChainId) - require.False(t, found) - } - - ctrl.Finish() - } -} - // Tests the CreateConsumerClient method against the spec, // with more granularity than what's covered in TestHandleCreateConsumerChainProposal. -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-crclient1 -// Spec tag: [CCV-PCF-CRCLIENT.1] func TestCreateConsumerClient(t *testing.T) { type testCase struct { description string @@ -164,6 +45,8 @@ func TestCreateConsumerClient(t *testing.T) { { description: "No state mutation, new client should be created", setup: func(providerKeeper *providerkeeper.Keeper, ctx sdk.Context, mocks *testkeeper.MockedKeepers) { + providerKeeper.SetConsumerIdToPhase(ctx, "0", providerkeeper.Initialized) + // Valid client creation is asserted with mock expectations here testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, 1) // returns empty validator set gomock.InOrder( @@ -173,9 +56,9 @@ func TestCreateConsumerClient(t *testing.T) { expClientCreated: true, }, { - description: "client for this chain already exists, new one is not created", + description: "chain for this consumer id has already launched, and hence client was created, NO new one is created", setup: func(providerKeeper *providerkeeper.Keeper, ctx sdk.Context, mocks *testkeeper.MockedKeepers) { - providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") + providerKeeper.SetConsumerIdToPhase(ctx, "0", providerkeeper.Launched) // Expect none of the client creation related calls to happen mocks.MockStakingKeeper.EXPECT().UnbondingTime(gomock.Any()).Times(0) @@ -197,11 +80,14 @@ func TestCreateConsumerClient(t *testing.T) { tc.setup(&providerKeeper, ctx, &mocks) // Call method with same arbitrary values as defined above in mock expectations. - err := providerKeeper.CreateConsumerClient(ctx, testkeeper.GetTestConsumerAdditionProp()) + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "0", testkeeper.GetTestRegistrationRecord()) + providerKeeper.SetConsumerIdToInitializationRecord(ctx, "0", testkeeper.GetTestInitializationRecord()) + providerKeeper.SetConsumerIdToUpdateRecord(ctx, "0", testkeeper.GetTestUpdateRecord()) + err := providerKeeper.CreateConsumerClient(ctx, "0") if tc.expClientCreated { require.NoError(t, err) - testCreatedConsumerClient(t, ctx, providerKeeper, "chainID", "clientID") + testCreatedConsumerClient(t, ctx, providerKeeper, "0", "clientID") } else { require.Error(t, err) } @@ -215,17 +101,17 @@ func TestCreateConsumerClient(t *testing.T) { // // Note: Separated from TestCreateConsumerClient to also be called from TestCreateConsumerChainProposal. func testCreatedConsumerClient(t *testing.T, - ctx sdk.Context, providerKeeper providerkeeper.Keeper, expectedChainID, expectedClientID string, + ctx sdk.Context, providerKeeper providerkeeper.Keeper, consumerId, expectedClientID string, ) { t.Helper() // ClientID should be stored. - clientId, found := providerKeeper.GetConsumerClientId(ctx, expectedChainID) + clientId, found := providerKeeper.GetConsumerClientId(ctx, consumerId) require.True(t, found, "consumer client not found") require.Equal(t, expectedClientID, clientId) // Only assert that consumer genesis was set, // more granular tests on consumer genesis should be defined in TestMakeConsumerGenesis - _, ok := providerKeeper.GetConsumerGenesis(ctx, expectedChainID) + _, ok := providerKeeper.GetConsumerGenesis(ctx, consumerId) require.True(t, ok) } @@ -398,7 +284,7 @@ func TestStopConsumerChain(t *testing.T) { expErr bool } - consumerCID := "chainID" + consumerId := "0" tests := []testCase{ { @@ -411,10 +297,10 @@ func TestStopConsumerChain(t *testing.T) { { description: "valid stop of consumer chain, all mock calls hit", setup: func(ctx sdk.Context, providerKeeper *providerkeeper.Keeper, mocks testkeeper.MockedKeepers) { - testkeeper.SetupForStoppingConsumerChain(t, ctx, providerKeeper, mocks) + testkeeper.SetupForStoppingConsumerChain(t, ctx, providerKeeper, mocks, consumerId) // set consumer minimum equivocation height - providerKeeper.SetEquivocationEvidenceMinHeight(ctx, consumerCID, 1) + providerKeeper.SetEquivocationEvidenceMinHeight(ctx, consumerId, 1) // assert mocks for expected calls to `StopConsumerChain` when closing the underlying channel gomock.InOrder(testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) @@ -433,7 +319,7 @@ func TestStopConsumerChain(t *testing.T) { // Setup specific to test case tc.setup(ctx, &providerKeeper, mocks) - err := providerKeeper.StopConsumerChain(ctx, consumerCID, true) + err := providerKeeper.StopConsumerChain(ctx, consumerId, true) if tc.expErr { require.Error(t, err) @@ -441,7 +327,7 @@ func TestStopConsumerChain(t *testing.T) { require.NoError(t, err) } - testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, consumerCID, "channelID") + testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, consumerId, "channelID") ctrl.Finish() } @@ -675,10 +561,13 @@ func TestMakeConsumerGenesis(t *testing.T) { gomock.InOrder(testkeeper.GetMocksForMakeConsumerGenesis(ctx, &mocks, 1814400000000000)...) // matches params from jsonString - prop := providertypes.ConsumerAdditionProposal{ - Title: "title", - Description: "desc", - ChainId: "testchain1", + registrationRecord := providertypes.ConsumerRegistrationRecord{ + Title: "title", + Description: "desc", + ChainId: "testchain1", + } + + initializationRecord := providertypes.ConsumerInitializationRecord{ BlocksPerDistributionTransmission: 1000, CcvTimeoutPeriod: 2419200000000000, TransferTimeoutPeriod: 3600000000000, @@ -686,7 +575,10 @@ func TestMakeConsumerGenesis(t *testing.T) { HistoricalEntries: 10000, UnbondingPeriod: 1728000000000000, } - actualGenesis, _, err := providerKeeper.MakeConsumerGenesis(ctx, &prop) + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "0", registrationRecord) + providerKeeper.SetConsumerIdToInitializationRecord(ctx, "0", initializationRecord) + + actualGenesis, _, err := providerKeeper.MakeConsumerGenesis(ctx, "0") require.NoError(t, err) // JSON string with tabs, newlines and spaces for readability @@ -788,9 +680,6 @@ func TestMakeConsumerGenesis(t *testing.T) { } // TestBeginBlockInit directly tests BeginBlockInit against the spec using helpers defined above. -// -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-bblock-init1 -// Spec tag:[CCV-PCF-BBLOCK-INIT.1] func TestBeginBlockInit(t *testing.T) { now := time.Now().UTC() @@ -800,130 +689,160 @@ func TestBeginBlockInit(t *testing.T) { defer ctrl.Finish() ctx = ctx.WithBlockTime(now) - pendingProps := []*providertypes.ConsumerAdditionProposal{ - providertypes.NewConsumerAdditionProposal( - "title", "spawn time passed", "chain1", clienttypes.NewHeight(3, 4), []byte{}, []byte{}, - now.Add(-time.Hour*2).UTC(), - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 50, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - providertypes.NewConsumerAdditionProposal( - "title", "spawn time passed", "chain2", clienttypes.NewHeight(3, 4), []byte{}, []byte{}, - now.Add(-time.Hour*1).UTC(), - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 50, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - providertypes.NewConsumerAdditionProposal( - "title", "spawn time not passed", "chain3", clienttypes.NewHeight(3, 4), []byte{}, []byte{}, - now.Add(time.Hour).UTC(), - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 50, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - providertypes.NewConsumerAdditionProposal( - "title", "invalid proposal: chain id already exists", "chain2", clienttypes.NewHeight(4, 5), []byte{}, []byte{}, - now.UTC(), - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 50, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - providertypes.NewConsumerAdditionProposal( - "title", "opt-in chain with at least one validator opted in", "chain5", clienttypes.NewHeight(3, 4), []byte{}, []byte{}, - now.Add(-time.Hour*1).UTC(), - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 0, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), - providertypes.NewConsumerAdditionProposal( - "title", "opt-in chain with no validator opted in", "chain6", clienttypes.NewHeight(3, 4), []byte{}, []byte{}, - now.Add(-time.Minute).UTC(), - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 0, - 0, - 0, - nil, - nil, - 0, - false, - ).(*providertypes.ConsumerAdditionProposal), + // initialize registration, initialization, and update records + registrationRecords := []providertypes.ConsumerRegistrationRecord{ + { + Title: "title", + Description: "spawn time passed", + ChainId: "chain0", + }, + { + Title: "title", + Description: "spawn time passed", + ChainId: "chain1", + }, + { + Title: "title", + Description: "spawn time not passed", + ChainId: "chain2", + }, + { + Title: "title", + Description: "opt-in chain with at least one validator opted in", + ChainId: "chain3", + }, + { + Title: "title", + Description: "opt-in chain with no validator opted in", + ChainId: "chain4", + }, } + initializationRecords := []providertypes.ConsumerInitializationRecord{ + { + InitialHeight: clienttypes.NewHeight(3, 4), + GenesisHash: []byte{}, + BinaryHash: []byte{}, + SpawnTime: now.Add(-time.Hour * 2).UTC(), + UnbondingPeriod: 100000000000, + CcvTimeoutPeriod: 100000000000, + TransferTimeoutPeriod: 100000000000, + ConsumerRedistributionFraction: "0.75", + BlocksPerDistributionTransmission: 10, + HistoricalEntries: 10000, + DistributionTransmissionChannel: "", + }, + { + InitialHeight: clienttypes.NewHeight(3, 4), + GenesisHash: []byte{}, + BinaryHash: []byte{}, + SpawnTime: now.Add(-time.Hour * 1).UTC(), + UnbondingPeriod: 100000000000, + CcvTimeoutPeriod: 100000000000, + TransferTimeoutPeriod: 100000000000, + ConsumerRedistributionFraction: "0.75", + BlocksPerDistributionTransmission: 10, + HistoricalEntries: 10000, + DistributionTransmissionChannel: "", + }, + { + InitialHeight: clienttypes.NewHeight(3, 4), + GenesisHash: []byte{}, + BinaryHash: []byte{}, + SpawnTime: now.Add(time.Hour).UTC(), + UnbondingPeriod: 100000000000, + CcvTimeoutPeriod: 100000000000, + TransferTimeoutPeriod: 100000000000, + ConsumerRedistributionFraction: "0.75", + BlocksPerDistributionTransmission: 10, + HistoricalEntries: 10000, + DistributionTransmissionChannel: "", + }, + { + InitialHeight: clienttypes.NewHeight(3, 4), + GenesisHash: []byte{}, + BinaryHash: []byte{}, + SpawnTime: now.Add(-time.Hour * 1).UTC(), + UnbondingPeriod: 100000000000, + CcvTimeoutPeriod: 100000000000, + TransferTimeoutPeriod: 100000000000, + ConsumerRedistributionFraction: "0.75", + BlocksPerDistributionTransmission: 10, + HistoricalEntries: 10000, + DistributionTransmissionChannel: "", + }, + { + InitialHeight: clienttypes.NewHeight(3, 4), + GenesisHash: []byte{}, + BinaryHash: []byte{}, + SpawnTime: now.Add(-time.Minute).UTC(), + UnbondingPeriod: 100000000000, + CcvTimeoutPeriod: 100000000000, + TransferTimeoutPeriod: 100000000000, + ConsumerRedistributionFraction: "0.75", + BlocksPerDistributionTransmission: 10, + HistoricalEntries: 10000, + DistributionTransmissionChannel: "", + }, + } + updateRecords := []providertypes.ConsumerUpdateRecord{ + { + Top_N: 50, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: []string{}, + Denylist: []string{}, + }, + { + Top_N: 50, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: []string{}, + Denylist: []string{}, + }, + { + Top_N: 50, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: []string{}, + Denylist: []string{}, + }, + { + Top_N: 0, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: []string{}, + Denylist: []string{}, + }, + { + Top_N: 0, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: []string{}, + Denylist: []string{}, + }} // Expect client creation for only the first, second, and fifth proposals (spawn time already passed and valid) - expectedCalls := testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chain1", clienttypes.NewHeight(3, 4)) - expectedCalls = append(expectedCalls, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chain2", clienttypes.NewHeight(3, 4))...) - expectedCalls = append(expectedCalls, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chain5", clienttypes.NewHeight(3, 4))...) + expectedCalls := testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chain0", clienttypes.NewHeight(3, 4)) + expectedCalls = append(expectedCalls, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chain1", clienttypes.NewHeight(3, 4))...) + expectedCalls = append(expectedCalls, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chain3", clienttypes.NewHeight(3, 4))...) - // The sixth proposal would have spawn time passed and hence needs the mocks but the client will not be - // created because `chain6` is an Opt In chain and has no validator opted in - expectedCalls = append(expectedCalls, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chain6", clienttypes.NewHeight(3, 4))...) + // The fifth chain would have spawn time passed and hence needs the mocks but the client will not be + // created because `chain4` is an Opt In chain and has no validator opted in + expectedCalls = append(expectedCalls, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chain4", clienttypes.NewHeight(3, 4))...) gomock.InOrder(expectedCalls...) - for _, prop := range pendingProps { - providerKeeper.SetPendingConsumerAdditionProp(ctx, prop) + // set up all the records + for i, r := range registrationRecords { + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, fmt.Sprintf("%d", i), r) + } + for i, r := range initializationRecords { + providerKeeper.SetConsumerIdToInitializationRecord(ctx, fmt.Sprintf("%d", i), r) + // set up the chains in their initialized phase, hence they could launch + providerKeeper.SetConsumerIdToPhase(ctx, fmt.Sprintf("%d", i), providerkeeper.Initialized) + } + for i, r := range updateRecords { + providerKeeper.SetConsumerIdToUpdateRecord(ctx, fmt.Sprintf("%d", i), r) } // opt in a sample validator so the chain's proposal can successfully execute @@ -933,81 +852,49 @@ func TestBeginBlockInit(t *testing.T) { valAddr, _ := sdk.ValAddressFromBech32(validator.GetOperator()) mocks.MockStakingKeeper.EXPECT().GetLastValidatorPower(gomock.Any(), valAddr).Return(int64(1), nil).AnyTimes() - // for the validator, expect a call to GetValidatorByConsAddr with its consensus address mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(gomock.Any(), consAddr).Return(validator, nil).AnyTimes() - providerKeeper.SetOptedIn(ctx, pendingProps[4].ChainId, providertypes.NewProviderConsAddress(consAddr)) + providerKeeper.SetOptedIn(ctx, "3", providertypes.NewProviderConsAddress(consAddr)) providerKeeper.BeginBlockInit(ctx) - // first proposal is not pending anymore because its spawn time already passed and was executed - _, found := providerKeeper.GetPendingConsumerAdditionProp( - ctx, pendingProps[0].SpawnTime, pendingProps[0].ChainId) - require.False(t, found) - // first proposal was successfully executed and hence consumer genesis was created - _, found = providerKeeper.GetConsumerGenesis(ctx, pendingProps[0].ChainId) + // first chain was successfully launched + phase, found := providerKeeper.GetConsumerIdToPhase(ctx, "0") require.True(t, found) - - // second proposal is not pending anymore because its spawn time already passed and was executed - _, found = providerKeeper.GetPendingConsumerAdditionProp( - ctx, pendingProps[1].SpawnTime, pendingProps[1].ChainId) - require.False(t, found) - // second proposal was successfully executed and hence consumer genesis was created - _, found = providerKeeper.GetConsumerGenesis(ctx, pendingProps[1].ChainId) + require.Equal(t, providerkeeper.Launched, phase) + _, found = providerKeeper.GetConsumerGenesis(ctx, "0") require.True(t, found) - // third proposal is still stored as pending because its spawn time has not passed - _, found = providerKeeper.GetPendingConsumerAdditionProp( - ctx, pendingProps[2].SpawnTime, pendingProps[2].ChainId) + // second chain was successfully launched + phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "1") + require.True(t, found) + require.Equal(t, providerkeeper.Launched, phase) + _, found = providerKeeper.GetConsumerGenesis(ctx, "1") require.True(t, found) - // because the proposal is still pending, no consumer genesis was created - _, found = providerKeeper.GetConsumerGenesis(ctx, pendingProps[2].ChainId) - require.False(t, found) - // check that the invalid proposals were dropped - _, found = providerKeeper.GetPendingConsumerAdditionProp( - ctx, pendingProps[3].SpawnTime, pendingProps[3].ChainId) + // third chain was not launched because its spawn time has not passed + phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "2") + require.True(t, found) + require.Equal(t, providerkeeper.Initialized, phase) + _, found = providerKeeper.GetConsumerGenesis(ctx, "2") require.False(t, found) - // Note that we do not check that `GetConsumerGenesis(ctx, pendingProps[3].ChainId)` returns `false` here because - // `pendingProps[3]` is an invalid proposal due to the chain id already existing so the consumer genesis also exists - // fifth proposal corresponds to an Opt-In chain with one opted-in validator and hence the proposal gets + // fourth chain corresponds to an Opt-In chain with one opted-in validator and hence the chain gets // successfully executed - _, found = providerKeeper.GetPendingConsumerAdditionProp( - ctx, pendingProps[4].SpawnTime, pendingProps[4].ChainId) - require.False(t, found) - // fifth proposal was successfully executed and hence consumer genesis was created - _, found = providerKeeper.GetConsumerGenesis(ctx, pendingProps[4].ChainId) + phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "3") require.True(t, found) - - // sixth proposal corresponds to an Opt-In chain with no opted-in validators and hence the - // proposal is not successful - _, found = providerKeeper.GetPendingConsumerAdditionProp( - ctx, pendingProps[5].SpawnTime, pendingProps[5].ChainId) - // the proposal was dropped and deleted - require.False(t, found) - // no consumer genesis is created - _, found = providerKeeper.GetConsumerGenesis(ctx, pendingProps[5].ChainId) - require.False(t, found) - // no consumer client is associated with this chain - _, found = providerKeeper.GetConsumerClientId(ctx, pendingProps[5].ChainId) - require.False(t, found) - // no fields should be set for this (check some of them) - _, found = providerKeeper.GetTopN(ctx, pendingProps[5].ChainId) - require.False(t, found) - _, found = providerKeeper.GetValidatorsPowerCap(ctx, pendingProps[5].ChainId) - require.False(t, found) - _, found = providerKeeper.GetValidatorSetCap(ctx, pendingProps[5].ChainId) - require.False(t, found) - - // test that Top N is set correctly - require.True(t, providerKeeper.IsTopN(ctx, "chain1")) - topN, found := providerKeeper.GetTopN(ctx, "chain1") + require.Equal(t, providerkeeper.Launched, phase) + _, found = providerKeeper.GetConsumerGenesis(ctx, "3") require.True(t, found) - require.Equal(t, uint32(50), topN) - require.True(t, providerKeeper.IsOptIn(ctx, "chain4")) + // fifth chain corresponds to an Opt-In chain with no opted-in validators and hence the + // chain launch is NOT successful + phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "4") + require.True(t, found) + require.Equal(t, providerkeeper.Initialized, phase) + _, found = providerKeeper.GetConsumerGenesis(ctx, "4") + require.False(t, found) } // TestBeginBlockCCR tests BeginBlockCCR against the spec. @@ -1057,11 +944,18 @@ func TestBeginBlockCCR(t *testing.T) { // for _, prop := range pendingProps { // Setup a valid consumer chain for each prop - additionProp := testkeeper.GetTestConsumerAdditionProp() - additionProp.ChainId = prop.ConsumerId - additionProp.InitialHeight = clienttypes.NewHeight(2, 3) - - err := providerKeeper.CreateConsumerClient(ctx, additionProp) + initializationRecord := testkeeper.GetTestInitializationRecord() + initializationRecord.InitialHeight = clienttypes.NewHeight(2, 3) + registrationRecord := testkeeper.GetTestRegistrationRecord() + registrationRecord.ChainId = prop.ConsumerId + + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, prop.ConsumerId, registrationRecord) + providerKeeper.SetConsumerIdToInitializationRecord(ctx, prop.ConsumerId, initializationRecord) + providerKeeper.SetConsumerIdToUpdateRecord(ctx, prop.ConsumerId, testkeeper.GetTestUpdateRecord()) + providerKeeper.SetConsumerIdToPhase(ctx, prop.ConsumerId, providerkeeper.Initialized) + providerKeeper.SetClientIdToConsumerId(ctx, "clientID", prop.ConsumerId) + + err := providerKeeper.CreateConsumerClient(ctx, prop.ConsumerId) require.NoError(t, err) err = providerKeeper.SetConsumerChain(ctx, "channelID") require.NoError(t, err) diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index c95bd71079..cd11b9e9d1 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -30,7 +30,7 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac "channelID", packet.SourceChannel, "error", err, ) - if chainID, ok := k.GetChannelToChain(ctx, packet.SourceChannel); ok { + if chainID, ok := k.GetChannelIdToConsumerId(ctx, packet.SourceChannel); ok { // stop consumer chain and release unbonding return k.StopConsumerChain(ctx, chainID, false) } @@ -42,7 +42,7 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac // OnTimeoutPacket aborts the transaction if no chain exists for the destination channel, // otherwise it stops the chain func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) error { - chainID, found := k.GetChannelToChain(ctx, packet.SourceChannel) + chainID, found := k.GetChannelIdToConsumerId(ctx, packet.SourceChannel) if !found { k.Logger(ctx).Error("packet timeout, unknown channel:", "channelID", packet.SourceChannel) // abort transaction @@ -138,7 +138,7 @@ func (k Keeper) BlocksUntilNextEpoch(ctx sdk.Context) int64 { func (k Keeper) SendVSCPackets(ctx sdk.Context) { for _, chainID := range k.GetAllRegisteredConsumerChainIDs(ctx) { // check if CCV channel is established and send - if channelID, found := k.GetChainToChannel(ctx, chainID); found { + if channelID, found := k.GetConsumerIdToChannelId(ctx, chainID); found { k.SendVSCPacketsToChain(ctx, chainID, channelID) } } @@ -279,7 +279,7 @@ func (k Keeper) OnRecvSlashPacket( data ccv.SlashPacketData, ) (ccv.PacketAckResult, error) { // check that the channel is established, panic if not - chainID, found := k.GetChannelToChain(ctx, packet.DestinationChannel) + chainID, found := k.GetChannelIdToConsumerId(ctx, packet.DestinationChannel) if !found { // SlashPacket packet was sent on a channel different than any of the established CCV channels; // this should never happen diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index 91de369851..e4c8f222e8 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -139,8 +139,8 @@ func TestOnRecvDowntimeSlashPacket(t *testing.T) { providerKeeper.SetParams(ctx, providertypes.DefaultParams()) // Set channel to chain (faking multiple established channels) - providerKeeper.SetChannelToChain(ctx, "channel-1", "chain-1") - providerKeeper.SetChannelToChain(ctx, "channel-2", "chain-2") + providerKeeper.SetChannelToConsumerId(ctx, "channel-1", "chain-1") + providerKeeper.SetChannelToConsumerId(ctx, "channel-2", "chain-2") // Generate a new slash packet data instance with double sign infraction type packetData := testkeeper.GetNewSlashPacketData() @@ -212,8 +212,8 @@ func TestOnRecvDoubleSignSlashPacket(t *testing.T) { providerKeeper.SetParams(ctx, providertypes.DefaultParams()) // Set channel to chain (faking multiple established channels) - providerKeeper.SetChannelToChain(ctx, "channel-1", "chain-1") - providerKeeper.SetChannelToChain(ctx, "channel-2", "chain-2") + providerKeeper.SetChannelToConsumerId(ctx, "channel-1", "chain-1") + providerKeeper.SetChannelToConsumerId(ctx, "channel-2", "chain-2") // Generate a new slash packet data instance with double sign infraction type packetData := testkeeper.GetNewSlashPacketData() @@ -294,7 +294,7 @@ func TestValidateSlashPacket(t *testing.T) { packet := channeltypes.Packet{DestinationChannel: "channel-9"} // Pseudo setup ccv channel for channel ID specified in packet. - providerKeeper.SetChannelToChain(ctx, "channel-9", "consumer-chain-id") + providerKeeper.SetChannelToConsumerId(ctx, "channel-9", "consumer-chain-id") // Setup init chain height for consumer (allowing 0 vscID to be valid). providerKeeper.SetInitChainHeight(ctx, "consumer-chain-id", uint64(89)) @@ -497,6 +497,7 @@ func TestSendVSCPacketsToChainFailure(t *testing.T) { gomock.InOrder(mockCalls...) // Execute setup + providerKeeper.SetClientIdToConsumerId(ctx, "clientID", "consumerChainID") err := providerKeeper.SetConsumerChain(ctx, "channelID") require.NoError(t, err) providerKeeper.SetConsumerClientId(ctx, "consumerChainID", "clientID") @@ -514,7 +515,7 @@ func TestOnTimeoutPacketWithNoChainFound(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - // We do not `SetChannelToChain` for "channelID" and therefore `OnTimeoutPacket` fails + // We do not `SetChannelToConsumerId` for "channelID" and therefore `OnTimeoutPacket` fails packet := channeltypes.Packet{ SourceChannel: "channelID", } @@ -530,7 +531,7 @@ func TestOnTimeoutPacketStopsChain(t *testing.T) { defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks) + testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks, "consumerId") packet := channeltypes.Packet{ SourceChannel: "channelID", @@ -566,7 +567,7 @@ func TestOnAcknowledgementPacketWithAckError(t *testing.T) { require.True(t, strings.Contains(err.Error(), providertypes.ErrUnknownConsumerChannelId.Error())) // test that we stop the consumer chain when `OnAcknowledgementPacket` returns an error and the chain is found - testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks) + testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks, "consumerId") packet := channeltypes.Packet{ SourceChannel: "channelID", } diff --git a/x/ccv/provider/module_test.go b/x/ccv/provider/module_test.go index 2b2ac1c63f..a019eb162f 100644 --- a/x/ccv/provider/module_test.go +++ b/x/ccv/provider/module_test.go @@ -174,11 +174,11 @@ func TestInitGenesis(t *testing.T) { numStatesCounted := 0 for _, state := range tc.consumerStates { numStatesCounted += 1 - channelID, found := providerKeeper.GetChainToChannel(ctx, state.ChainId) + channelID, found := providerKeeper.GetConsumerIdToChannelId(ctx, state.ChainId) require.True(t, found) require.Equal(t, state.ChannelId, channelID) - chainID, found := providerKeeper.GetChannelToChain(ctx, state.ChannelId) + chainID, found := providerKeeper.GetChannelIdToConsumerId(ctx, state.ChannelId) require.True(t, found) require.Equal(t, state.ChainId, chainID) } diff --git a/x/ccv/provider/proposal_handler.go b/x/ccv/provider/proposal_handler.go index 40a551d185..4c7c8ece80 100644 --- a/x/ccv/provider/proposal_handler.go +++ b/x/ccv/provider/proposal_handler.go @@ -18,7 +18,7 @@ func NewProviderProposalHandler(k keeper.Keeper) govv1beta1.Handler { return func(ctx sdk.Context, content govv1beta1.Content) error { switch c := content.(type) { case *types.ConsumerAdditionProposal: - return k.HandleLegacyConsumerAdditionProposal(ctx, c) + return nil case *types.ConsumerRemovalProposal: return k.HandleLegacyConsumerRemovalProposal(ctx, c) case *types.ConsumerModificationProposal: diff --git a/x/ccv/provider/proposal_handler_test.go b/x/ccv/provider/proposal_handler_test.go index 67bcad7d15..cf1e82284b 100644 --- a/x/ccv/provider/proposal_handler_test.go +++ b/x/ccv/provider/proposal_handler_test.go @@ -6,14 +6,10 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" "github.com/cosmos/interchain-security/v5/x/ccv/provider" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" @@ -30,40 +26,9 @@ func TestProviderProposalHandler(t *testing.T) { name string content govv1beta1.Content blockTime time.Time - expValidConsumerAddition bool expValidConsumerRemoval bool expValidChangeRewardDenom bool }{ - { - name: "valid consumer addition proposal", - content: providertypes.NewConsumerAdditionProposal( - "title", "description", "chainID", - clienttypes.NewHeight(2, 3), []byte("gen_hash"), []byte("bin_hash"), now, - "0.75", - 10, - "", - 10000, - 100000000000, - 100000000000, - 100000000000, - 0, - 0, - 0, - nil, - nil, - 0, - false, - ), - blockTime: hourFromNow, // ctx blocktime is after proposal's spawn time - expValidConsumerAddition: true, - }, - { - name: "valid consumer removal proposal", - content: providertypes.NewConsumerRemovalProposal( - "title", "description", "chainID", now), - blockTime: hourFromNow, - expValidConsumerRemoval: true, - }, { name: "valid change reward denoms proposal", content: providertypes.NewChangeRewardDenomsProposal( @@ -93,23 +58,12 @@ func TestProviderProposalHandler(t *testing.T) { // Setup keeperParams := testkeeper.NewInMemKeeperParams(t) - providerKeeper, ctx, _, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) + providerKeeper, ctx, _, _ := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) providerKeeper.SetParams(ctx, providertypes.DefaultParams()) ctx = ctx.WithBlockTime(tc.blockTime) // Mock expectations depending on expected outcome switch { - case tc.expValidConsumerAddition: - testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 1, []stakingtypes.Validator{}, 1) - gomock.InOrder(testkeeper.GetMocksForCreateConsumerClient( - ctx, &mocks, "chainID", clienttypes.NewHeight(2, 3), - )...) - - case tc.expValidConsumerRemoval: - testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks) - - // assert mocks for expected calls to `StopConsumerChain` when closing the underlying channel - gomock.InOrder(testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) case tc.expValidChangeRewardDenom: // Nothing to mock } @@ -117,9 +71,7 @@ func TestProviderProposalHandler(t *testing.T) { // Execution proposalHandler := provider.NewProviderProposalHandler(providerKeeper) err := proposalHandler(ctx, tc.content) - - if tc.expValidConsumerAddition || tc.expValidConsumerRemoval || - tc.expValidChangeRewardDenom { + if tc.expValidChangeRewardDenom { require.NoError(t, err) } else { require.Error(t, err) diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index eebfa6592b..c2b6e768e4 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -31,5 +31,11 @@ var ( ErrNoUnbondingTime = errorsmod.Register(ModuleName, 23, "provider unbonding time not found") ErrInvalidAddress = errorsmod.Register(ModuleName, 24, "invalid address") ErrUnauthorized = errorsmod.Register(ModuleName, 25, "unauthorized") - ErrInitialization = errorsmod.Register(ModuleName, 26, "cannot initialize consumer chain") + ErrInvalidPhase = errorsmod.Register(ModuleName, 26, "cannot perform action in the current phase of consumer chain") + ErrNoInitializationRecord = errorsmod.Register(ModuleName, 27, "initialization record is missing") + ErrNoRegistrationRecord = errorsmod.Register(ModuleName, 28, "registration record is missing") + ErrNoChainId = errorsmod.Register(ModuleName, 29, "missing chain id for consumer chain") + ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 30, "missing consumer genesis") + ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 31, "invalid consumer genesis") + ErrNoConsumerId = errorsmod.Register(ModuleName, 32, "missing consumer id") ) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 729c05c22e..83c8405bd1 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -137,6 +137,8 @@ const ( ConsumerIdToInitializationRecordKeyName = "ConsumerIdToInitializationRecordKey" + ConsumerIdToUpdateRecordKeyName = "ConsumerIdToUpdateRecordKey" + ConsumerIdToOwnerAddressKeyName = "ConsumerIdToOwnerAddressKey" ConsumerIdToPhaseKeyName = "ConsumerIdToPhaseKey" @@ -347,6 +349,9 @@ func getKeyPrefixes() map[string]byte { // ConsumerIdToInitializationRecordKeyName is the key for storing the initialization record for the given consumer id ConsumerIdToInitializationRecordKeyName: 48, + // ConsumerIdToUpdateRecordKeyName is the key for storing the update record for the given consumer id + ConsumerIdToUpdateRecordKeyName: 46, + // ConsumerIdToOwnerAddressKeyName is the key for storing the owner address for the given consumer id ConsumerIdToOwnerAddressKeyName: 49, @@ -737,7 +742,7 @@ func MinStakeKey(consumerId string) []byte { } func AllowInactiveValidatorsKey(consumerId string) []byte { - return ConsumerIddWithLenKey(mustGetKeyPrefix(AllowInactiveValidatorsKeyName), consumerId) + return ConsumerIdWithLenKey(mustGetKeyPrefix(AllowInactiveValidatorsKeyName), consumerId) } // ConsumerIdKey returns the key used to store the consumerId of the next registered chain @@ -765,6 +770,11 @@ func ConsumerIdToInitializationRecordKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName), consumerId) } +// ConsumerIdToUpdateRecordKey returns the key used to store the update record that corresponds to this consumer id +func ConsumerIdToUpdateRecordKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToUpdateRecordKeyName), consumerId) +} + // ConsumerIdToOwnerAddressKey returns the key used to store the owner address that corresponds to this consumer id func ConsumerIdToOwnerAddressKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToOwnerAddressKeyName), consumerId) diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 1c01c86a03..b9f17e2ff2 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -124,17 +124,19 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, uint8(45), providertypes.ConsumerIdKey()[0]) i++ - require.Equal(t, uint8(46), providertypes.ConsumerIdToChainIdKey("consumerId")[0]) - i++ require.Equal(t, uint8(47), providertypes.ConsumerIdToRegistrationRecordKey("consumerId")[0]) i++ require.Equal(t, uint8(48), providertypes.ConsumerIdToInitializationRecordKey("consumerId")[0]) i++ require.Equal(t, uint8(49), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) i++ - require.Equal(t, uint8(47), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) + require.Equal(t, uint8(46), providertypes.ConsumerIdToUpdateRecordKey("consumerId")[0]) + i++ + require.Equal(t, uint8(47), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) + i++ + require.Equal(t, uint8(48), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) i++ - require.Equal(t, uint8(48), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, uint8(49), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() @@ -207,6 +209,7 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.ConsumerIdToChainIdKey("consumerId"), providertypes.ConsumerIdToRegistrationRecordKey("consumerId"), providertypes.ConsumerIdToInitializationRecordKey("consumerId"), + providertypes.ConsumerIdToUpdateRecordKey("consumerId"), providertypes.ConsumerIdToOwnerAddressKey("consumerId"), providertypes.ConsumerIdToPhaseKey("consumerId"), providertypes.ClientIdToConsumerIdKey("clientId"), From b60271b3a33840396131ba523760724b1c820585 Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 2 Aug 2024 17:24:18 +0300 Subject: [PATCH 14/41] renamed more chainIDs to consumerIds --- x/ccv/provider/keeper/distribution.go | 41 +++-- x/ccv/provider/keeper/grpc_query.go | 40 ++--- x/ccv/provider/keeper/keeper.go | 226 +++++++++++++------------- x/ccv/provider/types/keys.go | 18 +- 4 files changed, 162 insertions(+), 163 deletions(-) diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index 5751ab60d6..d0d99dd0ab 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -176,7 +176,7 @@ func (k Keeper) IsEligibleForConsumerRewards(ctx sdk.Context, consumerValidatorH // to the given consumer chain's validator set func (k Keeper) AllocateTokensToConsumerValidators( ctx sdk.Context, - chainID string, + consumerId string, tokens sdk.DecCoins, ) (allocated sdk.DecCoins) { // return early if the tokens are empty @@ -185,17 +185,17 @@ func (k Keeper) AllocateTokensToConsumerValidators( } // get the total voting power of the consumer valset - totalPower := math.LegacyNewDec(k.ComputeConsumerTotalVotingPower(ctx, chainID)) + totalPower := math.LegacyNewDec(k.ComputeConsumerTotalVotingPower(ctx, consumerId)) if totalPower.IsZero() { return allocated } // Allocate tokens by iterating over the consumer validators - consumerVals, err := k.GetConsumerValSet(ctx, chainID) + consumerVals, err := k.GetConsumerValSet(ctx, consumerId) if err != nil { k.Logger(ctx).Error( "cannot get consumer validator set while allocating rewards from consumer chain", - chainID, + consumerId, "error", err, ) @@ -220,7 +220,7 @@ func (k Keeper) AllocateTokensToConsumerValidators( "cannot find validator by consensus address", consAddr, "while allocating rewards from consumer chain", - chainID, + consumerId, "error", err, ) @@ -228,7 +228,7 @@ func (k Keeper) AllocateTokensToConsumerValidators( } // check if the validator set a custom commission rate for the consumer chain - if cr, found := k.GetConsumerCommissionRate(ctx, chainID, types.NewProviderConsAddress(consAddr)); found { + if cr, found := k.GetConsumerCommissionRate(ctx, consumerId, types.NewProviderConsAddress(consAddr)); found { // set the validator commission rate val.Commission.CommissionRates.Rate = cr } @@ -241,7 +241,7 @@ func (k Keeper) AllocateTokensToConsumerValidators( ) if err != nil { k.Logger(ctx).Error("fail to allocate tokens to validator :%s while allocating rewards from consumer chain: %s", - consAddr, chainID) + consAddr, consumerId) continue } @@ -254,19 +254,19 @@ func (k Keeper) AllocateTokensToConsumerValidators( // consumer reward pools getter and setter -// GetConsumerRewardsAllocation returns the consumer rewards allocation for the given chain ID -func (k Keeper) GetConsumerRewardsAllocation(ctx sdk.Context, chainID string) (pool types.ConsumerRewardsAllocation) { +// GetConsumerRewardsAllocation returns the consumer rewards allocation for the given consumer id +func (k Keeper) GetConsumerRewardsAllocation(ctx sdk.Context, consumerId string) (pool types.ConsumerRewardsAllocation) { store := ctx.KVStore(k.storeKey) - b := store.Get(types.ConsumerRewardsAllocationKey(chainID)) + b := store.Get(types.ConsumerRewardsAllocationKey(consumerId)) k.cdc.MustUnmarshal(b, &pool) return } -// SetConsumerRewardsAllocation sets the consumer rewards allocation for the given chain ID -func (k Keeper) SetConsumerRewardsAllocation(ctx sdk.Context, chainID string, pool types.ConsumerRewardsAllocation) { +// SetConsumerRewardsAllocation sets the consumer rewards allocation for the given consumer id +func (k Keeper) SetConsumerRewardsAllocation(ctx sdk.Context, consumerId string, pool types.ConsumerRewardsAllocation) { store := ctx.KVStore(k.storeKey) b := k.cdc.MustMarshal(&pool) - store.Set(types.ConsumerRewardsAllocationKey(chainID), b) + store.Set(types.ConsumerRewardsAllocationKey(consumerId), b) } // GetConsumerRewardsPool returns the balance @@ -280,20 +280,19 @@ func (k Keeper) GetConsumerRewardsPool(ctx sdk.Context) sdk.Coins { // ComputeConsumerTotalVotingPower returns the validator set total voting power // for the given consumer chain -func (k Keeper) ComputeConsumerTotalVotingPower(ctx sdk.Context, chainID string) (totalPower int64) { +func (k Keeper) ComputeConsumerTotalVotingPower(ctx sdk.Context, consumerId string) (totalPower int64) { // sum the consumer validators set voting powers - vals, err := k.GetConsumerValSet(ctx, chainID) + vals, err := k.GetConsumerValSet(ctx, consumerId) if err != nil { k.Logger(ctx).Error( "cannot get consumer validator set while computing total voting power for consumer chain", - chainID, + consumerId, "error", err, ) return } for _, v := range vals { - // only consider the voting power of a validator that would receive rewards (i.e., validator has been validating for a number of blocks) if !k.IsEligibleForConsumerRewards(ctx, v.JoinHeight) { continue @@ -331,12 +330,12 @@ func (k Keeper) IdentifyConsumerChainIDFromIBCPacket(ctx sdk.Context, packet cha // HandleSetConsumerCommissionRate sets a per-consumer chain commission rate for the given provider address // on the condition that the given consumer chain exists. -func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress, commissionRate math.LegacyDec) error { +func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, commissionRate math.LegacyDec) error { // check that the consumer chain exists - if !k.IsConsumerProposedOrRegistered(ctx, chainID) { + if !k.IsConsumerProposedOrRegistered(ctx, consumerId) { return errorsmod.Wrapf( types.ErrUnknownConsumerId, - "unknown consumer chain, with id: %s", chainID) + "unknown consumer chain, with id: %s", consumerId) } // validate against the minimum commission rate @@ -353,7 +352,7 @@ func (k Keeper) HandleSetConsumerCommissionRate(ctx sdk.Context, chainID string, // set per-consumer chain commission rate for the validator address return k.SetConsumerCommissionRate( ctx, - chainID, + consumerId, providerAddr, commissionRate, ) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 877fa6a62e..3cf3f5cec4 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -60,43 +60,43 @@ func (k Keeper) QueryConsumerChains(goCtx context.Context, req *types.QueryConsu } // GetConsumerChain returns a Chain data structure with all the necessary fields -func (k Keeper) GetConsumerChain(ctx sdk.Context, chainID string) (types.Chain, error) { - clientID, found := k.GetConsumerClientId(ctx, chainID) +func (k Keeper) GetConsumerChain(ctx sdk.Context, consumerId string) (types.Chain, error) { + clientID, found := k.GetConsumerClientId(ctx, consumerId) if !found { - return types.Chain{}, fmt.Errorf("cannot find clientID for consumer (%s)", chainID) + return types.Chain{}, fmt.Errorf("cannot find clientID for consumer (%s)", consumerId) } - topN, found := k.GetTopN(ctx, chainID) + topN, found := k.GetTopN(ctx, consumerId) if !found { - k.Logger(ctx).Error("failed to get top N, treating as 0", "chain", chainID) + k.Logger(ctx).Error("failed to get top N, treating as 0", "chain", consumerId) topN = 0 } // Get the minimal power in the top N for the consumer chain - minPowerInTopN, found := k.GetMinimumPowerInTopN(ctx, chainID) + minPowerInTopN, found := k.GetMinimumPowerInTopN(ctx, consumerId) if !found { - k.Logger(ctx).Error("failed to get minimum power in top N, treating as -1", "chain", chainID) + k.Logger(ctx).Error("failed to get minimum power in top N, treating as -1", "chain", consumerId) minPowerInTopN = -1 } - validatorSetCap, _ := k.GetValidatorSetCap(ctx, chainID) + validatorSetCap, _ := k.GetValidatorSetCap(ctx, consumerId) - validatorsPowerCap, _ := k.GetValidatorsPowerCap(ctx, chainID) + validatorsPowerCap, _ := k.GetValidatorsPowerCap(ctx, consumerId) - allowlist := k.GetAllowList(ctx, chainID) + allowlist := k.GetAllowList(ctx, consumerId) strAllowlist := make([]string, len(allowlist)) for i, addr := range allowlist { strAllowlist[i] = addr.String() } - denylist := k.GetDenyList(ctx, chainID) + denylist := k.GetDenyList(ctx, consumerId) strDenylist := make([]string, len(denylist)) for i, addr := range denylist { strDenylist[i] = addr.String() } return types.Chain{ - ChainId: chainID, + ChainId: consumerId, ClientId: clientID, Top_N: topN, MinPowerInTop_N: minPowerInTopN, @@ -401,10 +401,10 @@ func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, func (k Keeper) hasToValidate( ctx sdk.Context, provAddr types.ProviderConsAddress, - chainID string, + consumerId string, ) (bool, error) { // if the validator was sent as part of the packet in the last epoch, it has to validate - if k.IsConsumerValidator(ctx, chainID, provAddr) { + if k.IsConsumerValidator(ctx, consumerId, provAddr) { return true, nil } @@ -413,24 +413,24 @@ func (k Keeper) hasToValidate( if err != nil { return false, nil } - if topN, found := k.GetTopN(ctx, chainID); found && topN > 0 { + if topN, found := k.GetTopN(ctx, consumerId); found && topN > 0 { // in a Top-N chain, we automatically opt in all validators that belong to the top N - minPower, found := k.GetMinimumPowerInTopN(ctx, chainID) + minPower, found := k.GetMinimumPowerInTopN(ctx, consumerId) if found { - k.OptInTopNValidators(ctx, chainID, activeValidators, minPower) + k.OptInTopNValidators(ctx, consumerId, activeValidators, minPower) } else { - k.Logger(ctx).Error("did not find min power in top N for chain", "chain", chainID) + k.Logger(ctx).Error("did not find min power in top N for chain", "chain", consumerId) } } // if the validator is opted in and belongs to the validators of the next epoch, then if nothing changes // the validator would have to validate in the next epoch - if k.IsOptedIn(ctx, chainID, provAddr) { + if k.IsOptedIn(ctx, consumerId, provAddr) { lastVals, err := k.GetLastBondedValidators(ctx) if err != nil { return false, err } - nextValidators := k.ComputeNextValidators(ctx, chainID, lastVals) + nextValidators := k.ComputeNextValidators(ctx, consumerId, lastVals) for _, v := range nextValidators { consAddr := sdk.ConsAddress(v.ProviderConsAddr) if provAddr.ToSdkConsAddr().Equals(consAddr) { diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 55101c695c..0e1facf472 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -195,7 +195,7 @@ func (k Keeper) SetConsumerIdToChannelId(ctx sdk.Context, consumerId, channelId store.Set(types.ConsumerIdToChannelIdKey(consumerId), []byte(channelId)) } -// GetConsumerIdToChannelId gets the CCV channelId for the given consumer chainID +// GetConsumerIdToChannelId gets the CCV channelId for the given consumer id func (k Keeper) GetConsumerIdToChannelId(ctx sdk.Context, consumerId string) (string, bool) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.ConsumerIdToChannelIdKey(consumerId)) @@ -211,11 +211,11 @@ func (k Keeper) DeleteConsumerIdToChannelId(ctx sdk.Context, consumerId string) store.Delete(types.ConsumerIdToChannelIdKey(consumerId)) } -// SetProposedConsumerChain stores a consumer chainId corresponding to a submitted consumer addition proposal -// This consumer chainId is deleted once the voting period for the proposal ends. -func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, chainID string, proposalID uint64) { +// SetProposedConsumerChain stores a consumer id corresponding to a submitted consumer addition proposal +// This consumer id is deleted once the voting period for the proposal ends. +func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, consumerId string, proposalID uint64) { store := ctx.KVStore(k.storeKey) - store.Set(types.ProposedConsumerChainKey(proposalID), []byte(chainID)) + store.Set(types.ProposedConsumerChainKey(proposalID), []byte(consumerId)) } // GetProposedConsumerChain returns the proposed chainID for the given consumerAddition proposal ID. @@ -340,20 +340,20 @@ func (k Keeper) GetAllChannelToChains(ctx sdk.Context) (channels []types.Channel return channels } -func (k Keeper) SetConsumerGenesis(ctx sdk.Context, chainID string, gen ccv.ConsumerGenesisState) error { +func (k Keeper) SetConsumerGenesis(ctx sdk.Context, consumerId string, gen ccv.ConsumerGenesisState) error { store := ctx.KVStore(k.storeKey) bz, err := gen.Marshal() if err != nil { return err } - store.Set(types.ConsumerGenesisKey(chainID), bz) + store.Set(types.ConsumerGenesisKey(consumerId), bz) return nil } -func (k Keeper) GetConsumerGenesis(ctx sdk.Context, chainID string) (ccv.ConsumerGenesisState, bool) { +func (k Keeper) GetConsumerGenesis(ctx sdk.Context, consumerId string) (ccv.ConsumerGenesisState, bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerGenesisKey(chainID)) + bz := store.Get(types.ConsumerGenesisKey(consumerId)) if bz == nil { return ccv.ConsumerGenesisState{}, false } @@ -367,9 +367,9 @@ func (k Keeper) GetConsumerGenesis(ctx sdk.Context, chainID string) (ccv.Consume return data, true } -func (k Keeper) DeleteConsumerGenesis(ctx sdk.Context, chainID string) { +func (k Keeper) DeleteConsumerGenesis(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerGenesisKey(chainID)) + store.Delete(types.ConsumerGenesisKey(consumerId)) } // VerifyConsumerChain verifies that the chain trying to connect on the channel handshake @@ -558,7 +558,7 @@ func (k Keeper) DeleteValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId ui // // TODO: SlashAcks should be persisted as a list of ConsumerConsAddr types, not strings. // See https://github.com/cosmos/interchain-security/issues/728 -func (k Keeper) SetSlashAcks(ctx sdk.Context, chainID string, acks []string) { +func (k Keeper) SetSlashAcks(ctx sdk.Context, consumerId string, acks []string) { store := ctx.KVStore(k.storeKey) sa := types.SlashAcks{ @@ -570,16 +570,16 @@ func (k Keeper) SetSlashAcks(ctx sdk.Context, chainID string, acks []string) { // sa is instantiated in this method and should be able to be marshaled. panic(fmt.Errorf("failed to marshal SlashAcks: %w", err)) } - store.Set(types.SlashAcksKey(chainID), bz) + store.Set(types.SlashAcksKey(consumerId), bz) } -// GetSlashAcks returns the slash acks stored under the given chain ID +// GetSlashAcks returns the slash acks stored under the given consumer id // // TODO: SlashAcks should be persisted as a list of ConsumerConsAddr types, not strings. // See https://github.com/cosmos/interchain-security/issues/728 -func (k Keeper) GetSlashAcks(ctx sdk.Context, chainID string) []string { +func (k Keeper) GetSlashAcks(ctx sdk.Context, consumerId string) []string { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.SlashAcksKey(chainID)) + bz := store.Get(types.SlashAcksKey(consumerId)) if bz == nil { return nil } @@ -593,45 +593,45 @@ func (k Keeper) GetSlashAcks(ctx sdk.Context, chainID string) []string { return acks.GetAddresses() } -// ConsumeSlashAcks empties and returns the slash acks for a given chain ID -func (k Keeper) ConsumeSlashAcks(ctx sdk.Context, chainID string) (acks []string) { - acks = k.GetSlashAcks(ctx, chainID) +// ConsumeSlashAcks empties and returns the slash acks for a given consumer id +func (k Keeper) ConsumeSlashAcks(ctx sdk.Context, consumerId string) (acks []string) { + acks = k.GetSlashAcks(ctx, consumerId) if len(acks) < 1 { return } store := ctx.KVStore(k.storeKey) - store.Delete(types.SlashAcksKey(chainID)) + store.Delete(types.SlashAcksKey(consumerId)) return } -// DeleteSlashAcks deletes the slash acks for a given chain ID -func (k Keeper) DeleteSlashAcks(ctx sdk.Context, chainID string) { +// DeleteSlashAcks deletes the slash acks for a given consumer id +func (k Keeper) DeleteSlashAcks(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.SlashAcksKey(chainID)) + store.Delete(types.SlashAcksKey(consumerId)) } -// AppendSlashAck appends the given slash ack to the given chain ID slash acks in store -func (k Keeper) AppendSlashAck(ctx sdk.Context, chainID, +// AppendSlashAck appends the given slash ack to the given consumer id slash acks in store +func (k Keeper) AppendSlashAck(ctx sdk.Context, consumerId, ack string, // TODO: consumer cons addr should be accepted here, see https://github.com/cosmos/interchain-security/issues/728 ) { - acks := k.GetSlashAcks(ctx, chainID) + acks := k.GetSlashAcks(ctx, consumerId) acks = append(acks, ack) - k.SetSlashAcks(ctx, chainID, acks) + k.SetSlashAcks(ctx, consumerId, acks) } // SetInitChainHeight sets the provider block height when the given consumer chain was initiated -func (k Keeper) SetInitChainHeight(ctx sdk.Context, chainID string, height uint64) { +func (k Keeper) SetInitChainHeight(ctx sdk.Context, consumerId string, height uint64) { store := ctx.KVStore(k.storeKey) heightBytes := make([]byte, 8) binary.BigEndian.PutUint64(heightBytes, height) - store.Set(types.InitChainHeightKey(chainID), heightBytes) + store.Set(types.InitChainHeightKey(consumerId), heightBytes) } // GetInitChainHeight returns the provider block height when the given consumer chain was initiated -func (k Keeper) GetInitChainHeight(ctx sdk.Context, chainID string) (uint64, bool) { +func (k Keeper) GetInitChainHeight(ctx sdk.Context, consumerId string) (uint64, bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.InitChainHeightKey(chainID)) + bz := store.Get(types.InitChainHeightKey(consumerId)) if bz == nil { return 0, false } @@ -640,9 +640,9 @@ func (k Keeper) GetInitChainHeight(ctx sdk.Context, chainID string) (uint64, boo } // DeleteInitChainHeight deletes the block height value for which the given consumer chain's channel was established -func (k Keeper) DeleteInitChainHeight(ctx sdk.Context, chainID string) { +func (k Keeper) DeleteInitChainHeight(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.InitChainHeightKey(chainID)) + store.Delete(types.InitChainHeightKey(consumerId)) } // GetPendingVSCPackets returns the list of pending ValidatorSetChange packets stored under consumer id @@ -679,9 +679,9 @@ func (k Keeper) AppendPendingVSCPackets(ctx sdk.Context, consumerId string, newP } // DeletePendingVSCPackets deletes the list of pending ValidatorSetChange packets for chain ID -func (k Keeper) DeletePendingVSCPackets(ctx sdk.Context, chainID string) { +func (k Keeper) DeletePendingVSCPackets(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.PendingVSCsKey(chainID)) + store.Delete(types.PendingVSCsKey(consumerId)) } // SetConsumerClientId sets the client id for the given consumer id @@ -748,7 +748,7 @@ func (k Keeper) GetAllRegisteredAndProposedChainIDs(ctx sdk.Context) []string { // SetTopN stores the N value associated to chain with `chainID` func (k Keeper) SetTopN( ctx sdk.Context, - chainID string, + consumerId string, N uint32, ) { store := ctx.KVStore(k.storeKey) @@ -756,25 +756,25 @@ func (k Keeper) SetTopN( buf := make([]byte, 4) binary.BigEndian.PutUint32(buf, N) - store.Set(types.TopNKey(chainID), buf) + store.Set(types.TopNKey(consumerId), buf) } // DeleteTopN removes the N value associated to chain with `chainID` func (k Keeper) DeleteTopN( ctx sdk.Context, - chainID string, + consumerId string, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.TopNKey(chainID)) + store.Delete(types.TopNKey(consumerId)) } // GetTopN returns (N, true) if chain `chainID` has a top N associated, and (0, false) otherwise. func (k Keeper) GetTopN( ctx sdk.Context, - chainID string, + consumerId string, ) (uint32, bool) { store := ctx.KVStore(k.storeKey) - buf := store.Get(types.TopNKey(chainID)) + buf := store.Get(types.TopNKey(consumerId)) if buf == nil { return 0, false } @@ -782,51 +782,51 @@ func (k Keeper) GetTopN( } // 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) +func (k Keeper) IsTopN(ctx sdk.Context, consumerId string) bool { + topN, found := k.GetTopN(ctx, consumerId) 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`) -func (k Keeper) IsOptIn(ctx sdk.Context, chainID string) bool { - topN, found := k.GetTopN(ctx, chainID) +// IsOptIn returns true if chain with `consumerId` is an Opt-In chain (i.e., no validator is forced to validate chain `chainID`) +func (k Keeper) IsOptIn(ctx sdk.Context, consumerId string) bool { + topN, found := k.GetTopN(ctx, consumerId) return !found || topN == 0 } func (k Keeper) SetOptedIn( ctx sdk.Context, - chainID string, + consumerId string, providerConsAddress types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) - store.Set(types.OptedInKey(chainID, providerConsAddress), []byte{}) + store.Set(types.OptedInKey(consumerId, providerConsAddress), []byte{}) } func (k Keeper) DeleteOptedIn( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.OptedInKey(chainID, providerAddr)) + store.Delete(types.OptedInKey(consumerId, providerAddr)) } func (k Keeper) IsOptedIn( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) bool { store := ctx.KVStore(k.storeKey) - return store.Get(types.OptedInKey(chainID, providerAddr)) != nil + return store.Get(types.OptedInKey(consumerId, providerAddr)) != nil } // GetAllOptedIn returns all the opted-in validators on chain `chainID` func (k Keeper) GetAllOptedIn( ctx sdk.Context, - chainID string, + consumerId string, ) (providerConsAddresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ConsumerIdWithLenKey(types.OptedInKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.OptedInKeyPrefix(), consumerId) iterator := storetypes.KVStorePrefixIterator(store, key) defer iterator.Close() @@ -840,10 +840,10 @@ func (k Keeper) GetAllOptedIn( // DeleteAllOptedIn deletes all the opted-in validators for chain with `chainID` func (k Keeper) DeleteAllOptedIn( ctx sdk.Context, - chainID string, + consumerId string, ) { store := ctx.KVStore(k.storeKey) - key := types.ConsumerIdWithLenKey(types.OptedInKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.OptedInKeyPrefix(), consumerId) iterator := storetypes.KVStorePrefixIterator(store, key) var keysToDel [][]byte @@ -860,7 +860,7 @@ func (k Keeper) DeleteAllOptedIn( // for the given validator address func (k Keeper) SetConsumerCommissionRate( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, commissionRate math.LegacyDec, ) error { @@ -872,7 +872,7 @@ func (k Keeper) SetConsumerCommissionRate( return err } - store.Set(types.ConsumerCommissionRateKey(chainID, providerAddr), bz) + store.Set(types.ConsumerCommissionRateKey(consumerId, providerAddr), bz) return nil } @@ -880,11 +880,11 @@ func (k Keeper) SetConsumerCommissionRate( // for the given validator address func (k Keeper) GetConsumerCommissionRate( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) (math.LegacyDec, bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerCommissionRateKey(chainID, providerAddr)) + bz := store.Get(types.ConsumerCommissionRateKey(consumerId, providerAddr)) if bz == nil { return math.LegacyZeroDec(), false } @@ -900,13 +900,13 @@ func (k Keeper) GetConsumerCommissionRate( } // GetAllCommissionRateValidators returns all the validator address -// that set a commission rate for the given chain ID +// that set a commission rate for the given consumer id func (k Keeper) GetAllCommissionRateValidators( ctx sdk.Context, - chainID string, + consumerId string, ) (addresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ConsumerIdWithLenKey(types.ConsumerCommissionRateKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.ConsumerCommissionRateKeyPrefix(), consumerId) iterator := storetypes.KVStorePrefixIterator(store, key) defer iterator.Close() @@ -922,17 +922,17 @@ func (k Keeper) GetAllCommissionRateValidators( // associated to the given validator address func (k Keeper) DeleteConsumerCommissionRate( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerCommissionRateKey(chainID, providerAddr)) + store.Delete(types.ConsumerCommissionRateKey(consumerId, providerAddr)) } -// SetValidatorsPowerCap sets the power-cap value `p` associated to chain with `chainID` +// SetValidatorsPowerCap sets the power-cap value `p` associated to chain with `consumerId` func (k Keeper) SetValidatorsPowerCap( ctx sdk.Context, - chainID string, + consumerId string, p uint32, ) { store := ctx.KVStore(k.storeKey) @@ -940,35 +940,35 @@ func (k Keeper) SetValidatorsPowerCap( buf := make([]byte, 4) binary.BigEndian.PutUint32(buf, p) - store.Set(types.ValidatorsPowerCapKey(chainID), buf) + store.Set(types.ValidatorsPowerCapKey(consumerId), buf) } -// DeleteValidatorsPowerCap removes the power-cap value associated to chain with `chainID` +// DeleteValidatorsPowerCap removes the power-cap value associated to chain with `consumerId` func (k Keeper) DeleteValidatorsPowerCap( ctx sdk.Context, - chainID string, + consumerId string, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ValidatorsPowerCapKey(chainID)) + store.Delete(types.ValidatorsPowerCapKey(consumerId)) } -// GetValidatorsPowerCap returns `(p, true)` if chain `chainID` has power cap `p` associated with it, and (0, false) otherwise +// GetValidatorsPowerCap returns `(p, true)` if chain `consumerId` has power cap `p` associated with it, and (0, false) otherwise func (k Keeper) GetValidatorsPowerCap( ctx sdk.Context, - chainID string, + consumerId string, ) (uint32, bool) { store := ctx.KVStore(k.storeKey) - buf := store.Get(types.ValidatorsPowerCapKey(chainID)) + buf := store.Get(types.ValidatorsPowerCapKey(consumerId)) if buf == nil { return 0, false } return binary.BigEndian.Uint32(buf), true } -// SetValidatorSetCap stores the validator-set cap value `c` associated to chain with `chainID` +// SetValidatorSetCap stores the validator-set cap value `c` associated to chain with `consumerId` func (k Keeper) SetValidatorSetCap( ctx sdk.Context, - chainID string, + consumerId string, c uint32, ) { store := ctx.KVStore(k.storeKey) @@ -976,48 +976,48 @@ func (k Keeper) SetValidatorSetCap( buf := make([]byte, 4) binary.BigEndian.PutUint32(buf, c) - store.Set(types.ValidatorSetCapKey(chainID), buf) + store.Set(types.ValidatorSetCapKey(consumerId), buf) } -// DeleteValidatorSetCap removes the validator-set cap value associated to chain with `chainID` +// DeleteValidatorSetCap removes the validator-set cap value associated to chain with `consumerId` func (k Keeper) DeleteValidatorSetCap( ctx sdk.Context, - chainID string, + consumerId string, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ValidatorSetCapKey(chainID)) + store.Delete(types.ValidatorSetCapKey(consumerId)) } -// GetValidatorSetCap returns `(c, true)` if chain `chainID` has validator-set cap `c` associated with it, and (0, false) otherwise +// GetValidatorSetCap returns `(c, true)` if chain `consumerId` has validator-set cap `c` associated with it, and (0, false) otherwise func (k Keeper) GetValidatorSetCap( ctx sdk.Context, - chainID string, + consumerId string, ) (uint32, bool) { store := ctx.KVStore(k.storeKey) - buf := store.Get(types.ValidatorSetCapKey(chainID)) + buf := store.Get(types.ValidatorSetCapKey(consumerId)) if buf == nil { return 0, false } return binary.BigEndian.Uint32(buf), true } -// SetAllowlist allowlists validator with `providerAddr` address on chain `chainID` +// SetAllowlist allowlists validator with `providerAddr` address on chain `consumerId` func (k Keeper) SetAllowlist( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) - store.Set(types.AllowlistKey(chainID, providerAddr), []byte{}) + store.Set(types.AllowlistKey(consumerId, providerAddr), []byte{}) } // GetAllowList returns all allowlisted validators func (k Keeper) GetAllowList( ctx sdk.Context, - chainID string, + consumerId string, ) (providerConsAddresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), consumerId) iterator := storetypes.KVStorePrefixIterator(store, key) defer iterator.Close() @@ -1031,18 +1031,18 @@ func (k Keeper) GetAllowList( // IsAllowlisted returns `true` if validator with `providerAddr` has been allowlisted on chain `chainID` func (k Keeper) IsAllowlisted( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) bool { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.AllowlistKey(chainID, providerAddr)) + bz := store.Get(types.AllowlistKey(consumerId, providerAddr)) return bz != nil } // DeleteAllowlist deletes all allowlisted validators -func (k Keeper) DeleteAllowlist(ctx sdk.Context, chainID string) { +func (k Keeper) DeleteAllowlist(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), chainID)) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), consumerId)) defer iterator.Close() keysToDel := [][]byte{} @@ -1056,31 +1056,31 @@ func (k Keeper) DeleteAllowlist(ctx sdk.Context, chainID string) { } // IsAllowlistEmpty returns `true` if no validator is allowlisted on chain `chainID` -func (k Keeper) IsAllowlistEmpty(ctx sdk.Context, chainID string) bool { +func (k Keeper) IsAllowlistEmpty(ctx sdk.Context, consumerId string) bool { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), chainID)) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), consumerId)) defer iterator.Close() return !iterator.Valid() } -// SetDenylist denylists validator with `providerAddr` address on chain `chainID` +// SetDenylist denylists validator with `providerAddr` address on chain `consumerId` func (k Keeper) SetDenylist( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) { store := ctx.KVStore(k.storeKey) - store.Set(types.DenylistKey(chainID, providerAddr), []byte{}) + store.Set(types.DenylistKey(consumerId, providerAddr), []byte{}) } // GetDenyList returns all denylisted validators func (k Keeper) GetDenyList( ctx sdk.Context, - chainID string, + consumerId string, ) (providerConsAddresses []types.ProviderConsAddress) { store := ctx.KVStore(k.storeKey) - key := types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), chainID) + key := types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), consumerId) iterator := storetypes.KVStorePrefixIterator(store, key) defer iterator.Close() @@ -1091,21 +1091,21 @@ func (k Keeper) GetDenyList( return providerConsAddresses } -// IsDenylisted returns `true` if validator with `providerAddr` has been denylisted on chain `chainID` +// IsDenylisted returns `true` if validator with `providerAddr` has been denylisted on chain `consumerId` func (k Keeper) IsDenylisted( ctx sdk.Context, - chainID string, + consumerId string, providerAddr types.ProviderConsAddress, ) bool { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.DenylistKey(chainID, providerAddr)) + bz := store.Get(types.DenylistKey(consumerId, providerAddr)) return bz != nil } // DeleteDenylist deletes all denylisted validators -func (k Keeper) DeleteDenylist(ctx sdk.Context, chainID string) { +func (k Keeper) DeleteDenylist(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), chainID)) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), consumerId)) defer iterator.Close() keysToDel := [][]byte{} @@ -1118,10 +1118,10 @@ func (k Keeper) DeleteDenylist(ctx sdk.Context, chainID string) { } } -// IsDenylistEmpty returns `true` if no validator is denylisted on chain `chainID` -func (k Keeper) IsDenylistEmpty(ctx sdk.Context, chainID string) bool { +// IsDenylistEmpty returns `true` if no validator is denylisted on chain `consumerId` +func (k Keeper) IsDenylistEmpty(ctx sdk.Context, consumerId string) bool { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), chainID)) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.DenylistKeyPrefix(), consumerId)) defer iterator.Close() return !iterator.Valid() @@ -1131,7 +1131,7 @@ func (k Keeper) IsDenylistEmpty(ctx sdk.Context, chainID string) bool { // for a given consumer chain. func (k Keeper) SetMinimumPowerInTopN( ctx sdk.Context, - chainID string, + consumerId string, power int64, ) { store := ctx.KVStore(k.storeKey) @@ -1139,17 +1139,17 @@ func (k Keeper) SetMinimumPowerInTopN( buf := make([]byte, 8) binary.BigEndian.PutUint64(buf, uint64(power)) - store.Set(types.MinimumPowerInTopNKey(chainID), buf) + store.Set(types.MinimumPowerInTopNKey(consumerId), buf) } // GetMinimumPowerInTopN returns the minimum power required for a validator to be in the top N // for a given consumer chain. func (k Keeper) GetMinimumPowerInTopN( ctx sdk.Context, - chainID string, + consumerId string, ) (int64, bool) { store := ctx.KVStore(k.storeKey) - buf := store.Get(types.MinimumPowerInTopNKey(chainID)) + buf := store.Get(types.MinimumPowerInTopNKey(consumerId)) if buf == nil { return 0, false } @@ -1160,10 +1160,10 @@ func (k Keeper) GetMinimumPowerInTopN( // for a given consumer chain. func (k Keeper) DeleteMinimumPowerInTopN( ctx sdk.Context, - chainID string, + consumerId string, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.MinimumPowerInTopNKey(chainID)) + store.Delete(types.MinimumPowerInTopNKey(consumerId)) } // SetMinStake sets the minimum stake required for a validator to validate diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 83c8405bd1..ad4de44980 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -49,11 +49,11 @@ const ( SlashMeterReplenishTimeCandidateKeyName = "SlashMeterReplenishTimeCandidateKey" - ChainToChannelKeyName = "ConsumerIdToChannelIdKey" + ConsumerIdToChannelIdKeyName = "ConsumerIdToChannelIdKey" - ChannelToChainKeyName = "ChannelToConsumerIdKey" + ChannelIdToConsumerIdKeyName = "ChannelToConsumerIdKey" - ChainToClientKeyName = "ConsumerIdToClientIdKey" + ConsumerIdToClientIdKeyName = "ConsumerIdToClientIdKey" DeprecatedInitTimeoutTimestampKeyName = "DeprecatedInitTimeoutTimestampKey" @@ -175,14 +175,14 @@ func getKeyPrefixes() map[string]byte { // ConsumerIdToChannelIdKey is the key for storing mapping // from chainID to the channel ID that is used to send over validator set changes. - ChainToChannelKeyName: 5, + ConsumerIdToChannelIdKeyName: 5, // ChannelToConsumerIdKey is the key for storing mapping // from the CCV channel ID to the consumer chain ID. - ChannelToChainKeyName: 6, + ChannelIdToConsumerIdKeyName: 6, // ConsumerIdToClientIdKey is the key for storing the client ID for a given consumer chainID. - ChainToClientKeyName: 7, + ConsumerIdToClientIdKeyName: 7, // InitTimeoutTimestampKey is the key for storing // the init timeout timestamp for a given consumer chainID. @@ -435,12 +435,12 @@ func SlashMeterReplenishTimeCandidateKey() []byte { // ConsumerIdToChannelIdKey returns the key under which the CCV channel ID will be stored for the given consumer chain. func ConsumerIdToChannelIdKey(consumerId string) []byte { - return append([]byte{mustGetKeyPrefix(ChainToChannelKeyName)}, []byte(consumerId)...) + return append([]byte{mustGetKeyPrefix(ConsumerIdToChannelIdKeyName)}, []byte(consumerId)...) } // ChannelIdToConsumerIdKeyPrefix returns the key prefix for storing the consumer chain ids. func ChannelIdToConsumerIdKeyPrefix() []byte { - return []byte{mustGetKeyPrefix(ChannelToChainKeyName)} + return []byte{mustGetKeyPrefix(ChannelIdToConsumerIdKeyName)} } // ChannelToConsumerIdKey returns the key under which the consumer chain id will be stored for the given channelId. @@ -450,7 +450,7 @@ func ChannelToConsumerIdKey(channelId string) []byte { // ConsumerIdToClientIdKeyPrefix returns the key prefix for storing the clientId for the given consumerId. func ConsumerIdToClientIdKeyPrefix() []byte { - return []byte{mustGetKeyPrefix(ChainToClientKeyName)} + return []byte{mustGetKeyPrefix(ConsumerIdToClientIdKeyName)} } // ConsumerIdToClientIdKey returns the key under which the clientId for the given consumerId is stored. From 600e2762553591a0763f5bc26b1fa3ad4efb5426 Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 2 Aug 2024 17:29:07 +0300 Subject: [PATCH 15/41] removed ClientIdToChainId state because chainId already resides on the registration record --- x/ccv/provider/keeper/msg_server.go | 1 - x/ccv/provider/keeper/msg_server_test.go | 6 ----- x/ccv/provider/keeper/permissionless.go | 22 ----------------- x/ccv/provider/keeper/permissionless_test.go | 25 -------------------- x/ccv/provider/types/keys.go | 16 +++---------- x/ccv/provider/types/keys_test.go | 9 ++----- 6 files changed, 5 insertions(+), 74 deletions(-) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index d5d540b8c7..0d8329fabd 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -312,7 +312,6 @@ func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegiste k.Keeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, *msg.RegistrationRecord) k.Keeper.SetConsumerIdToOwnerAddress(ctx, consumerId, msg.Signer) - k.Keeper.SetConsumerIdToChainId(ctx, consumerId, msg.RegistrationRecord.ChainId) k.Keeper.SetConsumerIdToPhase(ctx, consumerId, Registered) return &types.MsgRegisterConsumerResponse{ConsumerId: consumerId}, nil diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go index fd9336eb6a..1386fcdd9d 100644 --- a/x/ccv/provider/keeper/msg_server_test.go +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -30,9 +30,6 @@ func TestRegisterConsumer(t *testing.T) { require.Equal(t, expectedRecord, actualRecord) ownerAddress, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "0") require.Equal(t, "signer", ownerAddress) - chainId, found := providerKeeper.GetConsumerIdToChainId(ctx, "0") - require.True(t, found) - require.Equal(t, "chain_id", chainId) phase, found := providerKeeper.GetConsumerIdToPhase(ctx, "0") require.True(t, found) require.Equal(t, providerkeeper.Registered, phase) @@ -52,9 +49,6 @@ func TestRegisterConsumer(t *testing.T) { require.Equal(t, expectedRecord, actualRecord) ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "1") require.Equal(t, "signer2", ownerAddress) - chainId, found = providerKeeper.GetConsumerIdToChainId(ctx, "1") - require.True(t, found) - require.Equal(t, "chain_id2", chainId) phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "1") require.True(t, found) require.Equal(t, providerkeeper.Registered, phase) diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 1ee0415f12..8ce3e38a1f 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -60,28 +60,6 @@ func (k Keeper) FetchAndIncrementConsumerId(ctx sdk.Context) uint64 { return consumerId } -// GetConsumerIdToChainId returns the chain id associated with this consumer id -func (k Keeper) GetConsumerIdToChainId(ctx sdk.Context, consumerId string) (string, bool) { - store := ctx.KVStore(k.storeKey) - buf := store.Get(types.ConsumerIdToChainIdKey(consumerId)) - if buf == nil { - return "", false - } - return string(buf), true -} - -// SetConsumerIdToChainId sets the chain id associated with this consumer id -func (k Keeper) SetConsumerIdToChainId(ctx sdk.Context, consumerId string, chainId string) { - store := ctx.KVStore(k.storeKey) - store.Set(types.ConsumerIdToChainIdKey(consumerId), []byte(chainId)) -} - -// DeleteConsumerIdToChainId deletes the chain id to consumer id association -func (k Keeper) DeleteConsumerIdToChainId(ctx sdk.Context, consumerId string) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerIdToChainIdKey(consumerId)) -} - // GetConsumerIdToRegistrationRecord returns the registration record associated with this consumer id func (k Keeper) GetConsumerIdToRegistrationRecord(ctx sdk.Context, consumerId string) (types.ConsumerRegistrationRecord, bool) { store := ctx.KVStore(k.storeKey) diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index 1a75cd27fa..a45d3c6c65 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -33,31 +33,6 @@ func TestConsumerId(t *testing.T) { require.Equal(t, uint64(2), consumerId) } -// TestConsumerIdToChainId tests the getter, setter, and deletion methods of the consumer id to chain id methos -func TestConsumerIdToChainId(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - _, found := providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") - require.False(t, found) - - providerKeeper.SetConsumerIdToChainId(ctx, "consumerId", "chainId") - chainId, found := providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") - require.True(t, found) - require.Equal(t, "chainId", chainId) - - // assert that overwriting the current chain id record works - providerKeeper.SetConsumerIdToChainId(ctx, "consumerId", "chainId2") - chainId, found = providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") - require.True(t, found) - require.Equal(t, "chainId2", chainId) - - providerKeeper.DeleteConsumerIdToChainId(ctx, "consumerId") - chainId, found = providerKeeper.GetConsumerIdToChainId(ctx, "consumerId") - require.False(t, found) - require.Equal(t, "", chainId) -} - // TestClientIdToConsumerId tests the getter, setter, and deletion methods of the client id to consumer id methods func TestClientIdToConsumerId(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index ad4de44980..61086bd5a2 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -131,8 +131,6 @@ const ( ConsumerIdKeyName = "ConsumerIdKey" - ConsumerIdToChainIdKeyName = "ConsumerIdToChainIdKey" - ConsumerIdToRegistrationRecordKeyName = "ConsumerIdToRegistrationRecordKey" ConsumerIdToInitializationRecordKeyName = "ConsumerIdToInitializationRecordKey" @@ -340,17 +338,14 @@ func getKeyPrefixes() map[string]byte { // ConsumerIdKeyName is the key for storing the consumer id for the next registered consumer chain ConsumerIdKeyName: 45, - // ConsumerIdToChainIdKeyName is the key for storing the chain id for the given consumer id - ConsumerIdToChainIdKeyName: 46, - // ConsumerIdToRegistrationRecordKeyName is the key for storing the registration record for the given consumer id - ConsumerIdToRegistrationRecordKeyName: 47, + ConsumerIdToRegistrationRecordKeyName: 46, // ConsumerIdToInitializationRecordKeyName is the key for storing the initialization record for the given consumer id - ConsumerIdToInitializationRecordKeyName: 48, + ConsumerIdToInitializationRecordKeyName: 47, // ConsumerIdToUpdateRecordKeyName is the key for storing the update record for the given consumer id - ConsumerIdToUpdateRecordKeyName: 46, + ConsumerIdToUpdateRecordKeyName: 48, // ConsumerIdToOwnerAddressKeyName is the key for storing the owner address for the given consumer id ConsumerIdToOwnerAddressKeyName: 49, @@ -750,11 +745,6 @@ func ConsumerIdKey() []byte { return []byte{mustGetKeyPrefix(ConsumerIdKeyName)} } -// ConsumerIdToChainIdKey returns the key used to store the chain id that corresponds to this consumer id -func ConsumerIdToChainIdKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToChainIdKeyName), consumerId) -} - // ConsumerIdToRegistrationRecordKey returns the key used to store the registration record that corresponds to this consumer id func ConsumerIdToRegistrationRecordKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName), consumerId) diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index b9f17e2ff2..d7310d4232 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -130,13 +130,9 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, uint8(49), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) i++ - require.Equal(t, uint8(46), providertypes.ConsumerIdToUpdateRecordKey("consumerId")[0]) + require.Equal(t, uint8(50), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) i++ - require.Equal(t, uint8(47), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) - i++ - require.Equal(t, uint8(48), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) - i++ - require.Equal(t, uint8(49), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, uint8(51), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() @@ -206,7 +202,6 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.AllowInactiveValidatorsKey("chainID"), providerkeeper.GetValidatorKey(types.LastProviderConsensusValsPrefix(), providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.ConsumerIdKey(), - providertypes.ConsumerIdToChainIdKey("consumerId"), providertypes.ConsumerIdToRegistrationRecordKey("consumerId"), providertypes.ConsumerIdToInitializationRecordKey("consumerId"), providertypes.ConsumerIdToUpdateRecordKey("consumerId"), From 299413625e70e163ba08708843ffad0fb1cd9cb3 Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 2 Aug 2024 18:03:08 +0300 Subject: [PATCH 16/41] nit fixes in go docs --- proto/interchain_security/ccv/provider/v1/tx.proto | 4 ++-- x/ccv/provider/types/tx.pb.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index b6cade34ff..9621ea43a8 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -195,7 +195,7 @@ message MsgConsumerAddition { message MsgConsumerAdditionResponse {} -// MsgConsumerRemoval defines the message used to remove (and stop) a consumer chain. +// MsgRemoveConsumer defines the message used to remove (and stop) a consumer chain. // If it passes, all the consumer chain's state is eventually removed from the provider chain. message MsgRemoveConsumer { option (cosmos.msg.v1.signer) = "authority"; @@ -292,7 +292,7 @@ message MsgSetConsumerCommissionRate { message MsgSetConsumerCommissionRateResponse {} -// MsgConsumerModification defines the message used to modify a running consumer chain. +// MsgUpdateConsumer defines the message used to modify a running consumer chain. // If it passes, the consumer chain's parameters are updated. message MsgUpdateConsumer { option (cosmos.msg.v1.signer) = "authority"; diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 14f6f99a55..80ea86900e 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -663,7 +663,7 @@ func (m *MsgConsumerAdditionResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConsumerAdditionResponse proto.InternalMessageInfo -// MsgConsumerRemoval defines the message used to remove (and stop) a consumer chain. +// MsgRemoveConsumer defines the message used to remove (and stop) a consumer chain. // If it passes, all the consumer chain's state is eventually removed from the provider chain. type MsgRemoveConsumer struct { // the consumer id of the consumer chain to be stopped @@ -1114,7 +1114,7 @@ func (m *MsgSetConsumerCommissionRateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetConsumerCommissionRateResponse proto.InternalMessageInfo -// MsgConsumerModification defines the message used to modify a running consumer chain. +// MsgUpdateConsumer defines the message used to modify a running consumer chain. // If it passes, the consumer chain's parameters are updated. type MsgUpdateConsumer struct { // signer address From ff5ef0a47ba74426efdacf1814367085aea40307 Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 2 Aug 2024 18:06:30 +0300 Subject: [PATCH 17/41] removed MsgConsumerAddition --- .../ccv/provider/v1/tx.proto | 93 - x/ccv/provider/keeper/msg_server.go | 9 - x/ccv/provider/types/codec.go | 1 - x/ccv/provider/types/msg.go | 67 - x/ccv/provider/types/tx.pb.go | 1615 ++--------------- 5 files changed, 168 insertions(+), 1617 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 9621ea43a8..9a683cbf4c 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -24,7 +24,6 @@ service Msg { rpc SubmitConsumerMisbehaviour(MsgSubmitConsumerMisbehaviour) returns (MsgSubmitConsumerMisbehaviourResponse); rpc SubmitConsumerDoubleVoting(MsgSubmitConsumerDoubleVoting) returns (MsgSubmitConsumerDoubleVotingResponse); rpc RegisterConsumer(MsgRegisterConsumer) returns (MsgRegisterConsumerResponse); - rpc ConsumerAddition(MsgConsumerAddition) returns (MsgConsumerAdditionResponse); rpc InitializeConsumer(MsgInitializeConsumer) returns (MsgInitializeConsumerResponse); rpc UpdateConsumer(MsgUpdateConsumer) returns (MsgUpdateConsumerResponse); rpc RemoveConsumer(MsgRemoveConsumer) returns (MsgRemoveConsumerResponse); @@ -103,98 +102,6 @@ message MsgUpdateParams { message MsgUpdateParamsResponse {} - -// MsgConsumerAddition defines the message used to spawn a new consumer chain using a v1 governance proposal. -// If it passes, then all validators on the provider chain are expected to validate -// the consumer chain at spawn time or get slashed. -// It is recommended that spawn time occurs after the proposal end time. -// -// Note: this replaces ConsumerAdditionProposal which is deprecated and will be removed soon -message MsgConsumerAddition { - option (cosmos.msg.v1.signer) = "authority"; - - // the proposed chain-id of the new consumer chain, must be different from all - // other consumer chain ids of the executing provider chain. - string chain_id = 1; - // the proposed initial height of new consumer chain. - // For a completely new chain, this will be {0,1}. However, it may be - // different if this is a chain that is converting to a consumer chain. - ibc.core.client.v1.Height initial_height = 2 [ (gogoproto.nullable) = false ]; - // The hash of the consumer chain genesis state without the consumer CCV - // module genesis params. It is used for off-chain confirmation of - // genesis.json validity by validators and other parties. - bytes genesis_hash = 3; - // The hash of the consumer chain binary that should be run by validators on - // chain initialization. It is used for off-chain confirmation of binary - // validity by validators and other parties. - bytes binary_hash = 4; - // spawn time is the time on the provider chain at which the consumer chain - // genesis is finalized and all validators will be responsible for starting - // their consumer chain validator node. - google.protobuf.Timestamp spawn_time = 5 - [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - - // Unbonding period for the consumer, - // which should be smaller than that of the provider in general. - google.protobuf.Duration unbonding_period = 6 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - // Sent CCV related IBC packets will timeout after this duration - google.protobuf.Duration ccv_timeout_period = 7 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - // Sent transfer related IBC packets will timeout after this duration - google.protobuf.Duration transfer_timeout_period = 8 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - // The fraction of tokens allocated to the consumer redistribution address - // during distribution events. The fraction is a string representing a - // decimal number. For example "0.75" would represent 75%. - string consumer_redistribution_fraction = 9; - // BlocksPerDistributionTransmission is the number of blocks between - // ibc-token-transfers from the consumer chain to the provider chain. On - // sending transmission event, `consumer_redistribution_fraction` of the - // accumulated tokens are sent to the consumer redistribution address. - int64 blocks_per_distribution_transmission = 10; - // The number of historical info entries to persist in store. - // This param is a part of the cosmos sdk staking module. In the case of - // a ccv enabled consumer chain, the ccv module acts as the staking module. - int64 historical_entries = 11; - // The ID of a token transfer channel used for the Reward Distribution - // sub-protocol. If DistributionTransmissionChannel == "", a new transfer - // channel is created on top of the same connection as the CCV channel. - // Note that transfer_channel_id is the ID of the channel end on the consumer - // chain. it is most relevant for chains performing a sovereign to consumer - // changeover in order to maintain the existing ibc transfer channel - string distribution_transmission_channel = 12; - // Corresponds to the percentage of validators that have to validate the chain under the Top N case. - // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power - // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. - // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - uint32 top_N = 13; - // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if - // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the - // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only - // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need - // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - uint32 validators_power_cap = 14; - // Corresponds to the maximum number of validators that can validate a consumer chain. - // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - uint32 validator_set_cap = 15; - // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate - // the consumer chain. - repeated string allowlist = 16; - // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - repeated string denylist = 17; - // signer address - string authority = 18 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - uint64 min_stake = 19; - // Corresponds to whether inactive validators are allowed to validate the consumer chain. - bool allow_inactive_vals = 20; -} - -// MsgConsumerAdditionResponse defines response type for MsgConsumerAddition messages -message MsgConsumerAdditionResponse {} - - // MsgRemoveConsumer defines the message used to remove (and stop) a consumer chain. // If it passes, all the consumer chain's state is eventually removed from the provider chain. message MsgRemoveConsumer { diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 0d8329fabd..8bcec5ae5b 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -88,15 +88,6 @@ func (k msgServer) AssignConsumerKey(goCtx context.Context, msg *types.MsgAssign return &types.MsgAssignConsumerKeyResponse{}, nil } -// ConsumerAddition defines an RPC handler method for MsgConsumerAddition -func (k msgServer) ConsumerAddition(goCtx context.Context, msg *types.MsgConsumerAddition) (*types.MsgConsumerAdditionResponse, error) { - if k.GetAuthority() != msg.Authority { - return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) - } - - return &types.MsgConsumerAdditionResponse{}, nil -} - // RemoveConsumer defines an RPC handler method for MsgRemoveConsumer func (k msgServer) RemoveConsumer( goCtx context.Context, diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index edca412b06..bb32d207de 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -31,7 +31,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgAssignConsumerKey{}, - &MsgConsumerAddition{}, &MsgRemoveConsumer{}, &MsgChangeRewardDenoms{}, &MsgUpdateParams{}, diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 9684046f4c..3b861ea853 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -31,7 +31,6 @@ const ( var ( _ sdk.Msg = (*MsgAssignConsumerKey)(nil) - _ sdk.Msg = (*MsgConsumerAddition)(nil) _ sdk.Msg = (*MsgRemoveConsumer)(nil) _ sdk.Msg = (*MsgUpdateConsumer)(nil) _ sdk.Msg = (*MsgChangeRewardDenoms)(nil) @@ -42,7 +41,6 @@ var ( _ sdk.Msg = (*MsgSetConsumerCommissionRate)(nil) _ sdk.HasValidateBasic = (*MsgAssignConsumerKey)(nil) - _ sdk.HasValidateBasic = (*MsgConsumerAddition)(nil) _ sdk.HasValidateBasic = (*MsgRemoveConsumer)(nil) _ sdk.HasValidateBasic = (*MsgUpdateConsumer)(nil) _ sdk.HasValidateBasic = (*MsgChangeRewardDenoms)(nil) @@ -228,71 +226,6 @@ func (msg MsgSubmitConsumerDoubleVoting) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{addr} } -// GetSigners implements the sdk.Msg interface. It returns the address(es) that -// must sign over msg.GetSignBytes(). -// If the validator address is not same as delegator's, then the validator must -// sign the msg as well. -func (msg *MsgConsumerAddition) GetSigners() []sdk.AccAddress { - valAddr, err := sdk.ValAddressFromBech32(msg.Authority) - if err != nil { - // same behavior as in cosmos-sdk - panic(err) - } - return []sdk.AccAddress{valAddr.Bytes()} -} - -// ValidateBasic implements the sdk.Msg interface. -func (msg *MsgConsumerAddition) ValidateBasic() error { - if strings.TrimSpace(msg.ChainId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerAdditionProposal, "chain id cannot be blank") - } - - if msg.InitialHeight.IsZero() { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "initial height cannot be zero") - } - - if len(msg.GenesisHash) == 0 { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "genesis hash cannot be empty") - } - if len(msg.BinaryHash) == 0 { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "binary hash cannot be empty") - } - - if msg.SpawnTime.IsZero() { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "spawn time cannot be zero") - } - - if err := ccvtypes.ValidateStringFraction(msg.ConsumerRedistributionFraction); err != nil { - return errorsmod.Wrapf(ErrInvalidConsumerAdditionProposal, "consumer redistribution fraction is invalid: %s", err) - } - - if err := ccvtypes.ValidatePositiveInt64(msg.BlocksPerDistributionTransmission); err != nil { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "blocks per distribution transmission cannot be < 1") - } - - if err := ccvtypes.ValidateDistributionTransmissionChannel(msg.DistributionTransmissionChannel); err != nil { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "distribution transmission channel") - } - - if err := ccvtypes.ValidatePositiveInt64(msg.HistoricalEntries); err != nil { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "historical entries cannot be < 1") - } - - if err := ccvtypes.ValidateDuration(msg.CcvTimeoutPeriod); err != nil { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "ccv timeout period cannot be zero") - } - - if err := ccvtypes.ValidateDuration(msg.TransferTimeoutPeriod); err != nil { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "transfer timeout period cannot be zero") - } - - if err := ccvtypes.ValidateDuration(msg.UnbondingPeriod); err != nil { - return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "unbonding period cannot be zero") - } - - return nil -} - func (msg *MsgRemoveConsumer) ValidateBasic() error { if err := ValidateConsumerId(msg.ConsumerId); err != nil { return err diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 80ea86900e..b475f29f62 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -373,296 +373,6 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo -// MsgConsumerAddition defines the message used to spawn a new consumer chain using a v1 governance proposal. -// If it passes, then all validators on the provider chain are expected to validate -// the consumer chain at spawn time or get slashed. -// It is recommended that spawn time occurs after the proposal end time. -// -// Note: this replaces ConsumerAdditionProposal which is deprecated and will be removed soon -type MsgConsumerAddition struct { - // the proposed chain-id of the new consumer chain, must be different from all - // other consumer chain ids of the executing provider chain. - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // the proposed initial height of new consumer chain. - // For a completely new chain, this will be {0,1}. However, it may be - // different if this is a chain that is converting to a consumer chain. - InitialHeight types1.Height `protobuf:"bytes,2,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` - // The hash of the consumer chain genesis state without the consumer CCV - // module genesis params. It is used for off-chain confirmation of - // genesis.json validity by validators and other parties. - GenesisHash []byte `protobuf:"bytes,3,opt,name=genesis_hash,json=genesisHash,proto3" json:"genesis_hash,omitempty"` - // The hash of the consumer chain binary that should be run by validators on - // chain initialization. It is used for off-chain confirmation of binary - // validity by validators and other parties. - BinaryHash []byte `protobuf:"bytes,4,opt,name=binary_hash,json=binaryHash,proto3" json:"binary_hash,omitempty"` - // spawn time is the time on the provider chain at which the consumer chain - // genesis is finalized and all validators will be responsible for starting - // their consumer chain validator node. - SpawnTime time.Time `protobuf:"bytes,5,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` - // Unbonding period for the consumer, - // which should be smaller than that of the provider in general. - UnbondingPeriod time.Duration `protobuf:"bytes,6,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` - // Sent CCV related IBC packets will timeout after this duration - CcvTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` - // Sent transfer related IBC packets will timeout after this duration - TransferTimeoutPeriod time.Duration `protobuf:"bytes,8,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` - // The fraction of tokens allocated to the consumer redistribution address - // during distribution events. The fraction is a string representing a - // decimal number. For example "0.75" would represent 75%. - ConsumerRedistributionFraction string `protobuf:"bytes,9,opt,name=consumer_redistribution_fraction,json=consumerRedistributionFraction,proto3" json:"consumer_redistribution_fraction,omitempty"` - // BlocksPerDistributionTransmission is the number of blocks between - // ibc-token-transfers from the consumer chain to the provider chain. On - // sending transmission event, `consumer_redistribution_fraction` of the - // accumulated tokens are sent to the consumer redistribution address. - BlocksPerDistributionTransmission int64 `protobuf:"varint,10,opt,name=blocks_per_distribution_transmission,json=blocksPerDistributionTransmission,proto3" json:"blocks_per_distribution_transmission,omitempty"` - // The number of historical info entries to persist in store. - // This param is a part of the cosmos sdk staking module. In the case of - // a ccv enabled consumer chain, the ccv module acts as the staking module. - HistoricalEntries int64 `protobuf:"varint,11,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"` - // The ID of a token transfer channel used for the Reward Distribution - // sub-protocol. If DistributionTransmissionChannel == "", a new transfer - // channel is created on top of the same connection as the CCV channel. - // Note that transfer_channel_id is the ID of the channel end on the consumer - // chain. it is most relevant for chains performing a sovereign to consumer - // changeover in order to maintain the existing ibc transfer channel - DistributionTransmissionChannel string `protobuf:"bytes,12,opt,name=distribution_transmission_channel,json=distributionTransmissionChannel,proto3" json:"distribution_transmission_channel,omitempty"` - // Corresponds to the percentage of validators that have to validate the chain under the Top N case. - // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power - // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. - // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - Top_N uint32 `protobuf:"varint,13,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` - // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if - // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the - // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only - // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need - // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - ValidatorsPowerCap uint32 `protobuf:"varint,14,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` - // Corresponds to the maximum number of validators that can validate a consumer chain. - // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - ValidatorSetCap uint32 `protobuf:"varint,15,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate - // the consumer chain. - Allowlist []string `protobuf:"bytes,16,rep,name=allowlist,proto3" json:"allowlist,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - Denylist []string `protobuf:"bytes,17,rep,name=denylist,proto3" json:"denylist,omitempty"` - // signer address - Authority string `protobuf:"bytes,18,opt,name=authority,proto3" json:"authority,omitempty"` - // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - MinStake uint64 `protobuf:"varint,19,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` - // Corresponds to whether inactive validators are allowed to validate the consumer chain. - AllowInactiveVals bool `protobuf:"varint,20,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` -} - -func (m *MsgConsumerAddition) Reset() { *m = MsgConsumerAddition{} } -func (m *MsgConsumerAddition) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerAddition) ProtoMessage() {} -func (*MsgConsumerAddition) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{8} -} -func (m *MsgConsumerAddition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConsumerAddition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConsumerAddition.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 *MsgConsumerAddition) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerAddition.Merge(m, src) -} -func (m *MsgConsumerAddition) XXX_Size() int { - return m.Size() -} -func (m *MsgConsumerAddition) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerAddition.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConsumerAddition proto.InternalMessageInfo - -func (m *MsgConsumerAddition) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *MsgConsumerAddition) GetInitialHeight() types1.Height { - if m != nil { - return m.InitialHeight - } - return types1.Height{} -} - -func (m *MsgConsumerAddition) GetGenesisHash() []byte { - if m != nil { - return m.GenesisHash - } - return nil -} - -func (m *MsgConsumerAddition) GetBinaryHash() []byte { - if m != nil { - return m.BinaryHash - } - return nil -} - -func (m *MsgConsumerAddition) GetSpawnTime() time.Time { - if m != nil { - return m.SpawnTime - } - return time.Time{} -} - -func (m *MsgConsumerAddition) GetUnbondingPeriod() time.Duration { - if m != nil { - return m.UnbondingPeriod - } - return 0 -} - -func (m *MsgConsumerAddition) GetCcvTimeoutPeriod() time.Duration { - if m != nil { - return m.CcvTimeoutPeriod - } - return 0 -} - -func (m *MsgConsumerAddition) GetTransferTimeoutPeriod() time.Duration { - if m != nil { - return m.TransferTimeoutPeriod - } - return 0 -} - -func (m *MsgConsumerAddition) GetConsumerRedistributionFraction() string { - if m != nil { - return m.ConsumerRedistributionFraction - } - return "" -} - -func (m *MsgConsumerAddition) GetBlocksPerDistributionTransmission() int64 { - if m != nil { - return m.BlocksPerDistributionTransmission - } - return 0 -} - -func (m *MsgConsumerAddition) GetHistoricalEntries() int64 { - if m != nil { - return m.HistoricalEntries - } - return 0 -} - -func (m *MsgConsumerAddition) GetDistributionTransmissionChannel() string { - if m != nil { - return m.DistributionTransmissionChannel - } - return "" -} - -func (m *MsgConsumerAddition) GetTop_N() uint32 { - if m != nil { - return m.Top_N - } - return 0 -} - -func (m *MsgConsumerAddition) GetValidatorsPowerCap() uint32 { - if m != nil { - return m.ValidatorsPowerCap - } - return 0 -} - -func (m *MsgConsumerAddition) GetValidatorSetCap() uint32 { - if m != nil { - return m.ValidatorSetCap - } - return 0 -} - -func (m *MsgConsumerAddition) GetAllowlist() []string { - if m != nil { - return m.Allowlist - } - return nil -} - -func (m *MsgConsumerAddition) GetDenylist() []string { - if m != nil { - return m.Denylist - } - return nil -} - -func (m *MsgConsumerAddition) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgConsumerAddition) GetMinStake() uint64 { - if m != nil { - return m.MinStake - } - return 0 -} - -func (m *MsgConsumerAddition) GetAllowInactiveVals() bool { - if m != nil { - return m.AllowInactiveVals - } - return false -} - -// MsgConsumerAdditionResponse defines response type for MsgConsumerAddition messages -type MsgConsumerAdditionResponse struct { -} - -func (m *MsgConsumerAdditionResponse) Reset() { *m = MsgConsumerAdditionResponse{} } -func (m *MsgConsumerAdditionResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerAdditionResponse) ProtoMessage() {} -func (*MsgConsumerAdditionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{9} -} -func (m *MsgConsumerAdditionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConsumerAdditionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConsumerAdditionResponse.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 *MsgConsumerAdditionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerAdditionResponse.Merge(m, src) -} -func (m *MsgConsumerAdditionResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgConsumerAdditionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerAdditionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConsumerAdditionResponse proto.InternalMessageInfo - // MsgRemoveConsumer defines the message used to remove (and stop) a consumer chain. // If it passes, all the consumer chain's state is eventually removed from the provider chain. type MsgRemoveConsumer struct { @@ -679,7 +389,7 @@ func (m *MsgRemoveConsumer) Reset() { *m = MsgRemoveConsumer{} } func (m *MsgRemoveConsumer) String() string { return proto.CompactTextString(m) } func (*MsgRemoveConsumer) ProtoMessage() {} func (*MsgRemoveConsumer) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{10} + return fileDescriptor_43221a4391e9fbf4, []int{8} } func (m *MsgRemoveConsumer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -737,7 +447,7 @@ func (m *MsgRemoveConsumerResponse) Reset() { *m = MsgRemoveConsumerResp func (m *MsgRemoveConsumerResponse) String() string { return proto.CompactTextString(m) } func (*MsgRemoveConsumerResponse) ProtoMessage() {} func (*MsgRemoveConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{11} + return fileDescriptor_43221a4391e9fbf4, []int{9} } func (m *MsgRemoveConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -783,7 +493,7 @@ func (m *MsgChangeRewardDenoms) Reset() { *m = MsgChangeRewardDenoms{} } func (m *MsgChangeRewardDenoms) String() string { return proto.CompactTextString(m) } func (*MsgChangeRewardDenoms) ProtoMessage() {} func (*MsgChangeRewardDenoms) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{12} + return fileDescriptor_43221a4391e9fbf4, []int{10} } func (m *MsgChangeRewardDenoms) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -841,7 +551,7 @@ func (m *MsgChangeRewardDenomsResponse) Reset() { *m = MsgChangeRewardDe func (m *MsgChangeRewardDenomsResponse) String() string { return proto.CompactTextString(m) } func (*MsgChangeRewardDenomsResponse) ProtoMessage() {} func (*MsgChangeRewardDenomsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{13} + return fileDescriptor_43221a4391e9fbf4, []int{11} } func (m *MsgChangeRewardDenomsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -888,7 +598,7 @@ func (m *MsgOptIn) Reset() { *m = MsgOptIn{} } func (m *MsgOptIn) String() string { return proto.CompactTextString(m) } func (*MsgOptIn) ProtoMessage() {} func (*MsgOptIn) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{14} + return fileDescriptor_43221a4391e9fbf4, []int{12} } func (m *MsgOptIn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -924,7 +634,7 @@ func (m *MsgOptInResponse) Reset() { *m = MsgOptInResponse{} } func (m *MsgOptInResponse) String() string { return proto.CompactTextString(m) } func (*MsgOptInResponse) ProtoMessage() {} func (*MsgOptInResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{15} + return fileDescriptor_43221a4391e9fbf4, []int{13} } func (m *MsgOptInResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -966,7 +676,7 @@ func (m *MsgOptOut) Reset() { *m = MsgOptOut{} } func (m *MsgOptOut) String() string { return proto.CompactTextString(m) } func (*MsgOptOut) ProtoMessage() {} func (*MsgOptOut) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{16} + return fileDescriptor_43221a4391e9fbf4, []int{14} } func (m *MsgOptOut) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1002,7 +712,7 @@ func (m *MsgOptOutResponse) Reset() { *m = MsgOptOutResponse{} } func (m *MsgOptOutResponse) String() string { return proto.CompactTextString(m) } func (*MsgOptOutResponse) ProtoMessage() {} func (*MsgOptOutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{17} + return fileDescriptor_43221a4391e9fbf4, []int{15} } func (m *MsgOptOutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1049,7 +759,7 @@ func (m *MsgSetConsumerCommissionRate) Reset() { *m = MsgSetConsumerComm func (m *MsgSetConsumerCommissionRate) String() string { return proto.CompactTextString(m) } func (*MsgSetConsumerCommissionRate) ProtoMessage() {} func (*MsgSetConsumerCommissionRate) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{18} + return fileDescriptor_43221a4391e9fbf4, []int{16} } func (m *MsgSetConsumerCommissionRate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1085,7 +795,7 @@ func (m *MsgSetConsumerCommissionRateResponse) Reset() { *m = MsgSetCons func (m *MsgSetConsumerCommissionRateResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetConsumerCommissionRateResponse) ProtoMessage() {} func (*MsgSetConsumerCommissionRateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{19} + return fileDescriptor_43221a4391e9fbf4, []int{17} } func (m *MsgSetConsumerCommissionRateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1128,7 +838,7 @@ func (m *MsgUpdateConsumer) Reset() { *m = MsgUpdateConsumer{} } func (m *MsgUpdateConsumer) String() string { return proto.CompactTextString(m) } func (*MsgUpdateConsumer) ProtoMessage() {} func (*MsgUpdateConsumer) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{20} + return fileDescriptor_43221a4391e9fbf4, []int{18} } func (m *MsgUpdateConsumer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1211,7 +921,7 @@ func (m *ConsumerUpdateRecord) Reset() { *m = ConsumerUpdateRecord{} } func (m *ConsumerUpdateRecord) String() string { return proto.CompactTextString(m) } func (*ConsumerUpdateRecord) ProtoMessage() {} func (*ConsumerUpdateRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{21} + return fileDescriptor_43221a4391e9fbf4, []int{19} } func (m *ConsumerUpdateRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1304,7 +1014,7 @@ func (m *MsgUpdateConsumerResponse) Reset() { *m = MsgUpdateConsumerResp func (m *MsgUpdateConsumerResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateConsumerResponse) ProtoMessage() {} func (*MsgUpdateConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{22} + return fileDescriptor_43221a4391e9fbf4, []int{20} } func (m *MsgUpdateConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1344,7 +1054,7 @@ func (m *MsgRegisterConsumer) Reset() { *m = MsgRegisterConsumer{} } func (m *MsgRegisterConsumer) String() string { return proto.CompactTextString(m) } func (*MsgRegisterConsumer) ProtoMessage() {} func (*MsgRegisterConsumer) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{23} + return fileDescriptor_43221a4391e9fbf4, []int{21} } func (m *MsgRegisterConsumer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1401,7 +1111,7 @@ func (m *ConsumerRegistrationRecord) Reset() { *m = ConsumerRegistration func (m *ConsumerRegistrationRecord) String() string { return proto.CompactTextString(m) } func (*ConsumerRegistrationRecord) ProtoMessage() {} func (*ConsumerRegistrationRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{24} + return fileDescriptor_43221a4391e9fbf4, []int{22} } func (m *ConsumerRegistrationRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1460,7 +1170,7 @@ func (m *MsgRegisterConsumerResponse) Reset() { *m = MsgRegisterConsumer func (m *MsgRegisterConsumerResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterConsumerResponse) ProtoMessage() {} func (*MsgRegisterConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{25} + return fileDescriptor_43221a4391e9fbf4, []int{23} } func (m *MsgRegisterConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1509,7 +1219,7 @@ func (m *MsgInitializeConsumer) Reset() { *m = MsgInitializeConsumer{} } func (m *MsgInitializeConsumer) String() string { return proto.CompactTextString(m) } func (*MsgInitializeConsumer) ProtoMessage() {} func (*MsgInitializeConsumer) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{26} + return fileDescriptor_43221a4391e9fbf4, []int{24} } func (m *MsgInitializeConsumer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1610,7 +1320,7 @@ func (m *ConsumerInitializationRecord) Reset() { *m = ConsumerInitializa func (m *ConsumerInitializationRecord) String() string { return proto.CompactTextString(m) } func (*ConsumerInitializationRecord) ProtoMessage() {} func (*ConsumerInitializationRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{27} + return fileDescriptor_43221a4391e9fbf4, []int{25} } func (m *ConsumerInitializationRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1724,7 +1434,7 @@ func (m *MsgInitializeConsumerResponse) Reset() { *m = MsgInitializeCons func (m *MsgInitializeConsumerResponse) String() string { return proto.CompactTextString(m) } func (*MsgInitializeConsumerResponse) ProtoMessage() {} func (*MsgInitializeConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{28} + return fileDescriptor_43221a4391e9fbf4, []int{26} } func (m *MsgInitializeConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1762,8 +1472,6 @@ func init() { proto.RegisterType((*MsgSubmitConsumerDoubleVotingResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVotingResponse") proto.RegisterType((*MsgUpdateParams)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgConsumerAddition)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAddition") - proto.RegisterType((*MsgConsumerAdditionResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAdditionResponse") proto.RegisterType((*MsgRemoveConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumer") proto.RegisterType((*MsgRemoveConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumerResponse") proto.RegisterType((*MsgChangeRewardDenoms)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenoms") @@ -1790,133 +1498,124 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 2008 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4b, 0x6c, 0x1b, 0xc7, - 0x19, 0xd6, 0xea, 0x65, 0x72, 0xf4, 0xb0, 0x34, 0x92, 0x2b, 0x8a, 0x76, 0x44, 0x99, 0x49, 0x13, - 0xc1, 0x8d, 0x96, 0xb1, 0xdb, 0xb8, 0xad, 0xd0, 0xa6, 0xd5, 0xc3, 0xad, 0x95, 0x56, 0xb6, 0xba, - 0x76, 0x5d, 0xa0, 0x05, 0xb2, 0x18, 0xee, 0x8e, 0x97, 0x03, 0x73, 0x77, 0x16, 0x33, 0x43, 0x2a, - 0xea, 0xa9, 0xc8, 0x21, 0xc8, 0xa9, 0x48, 0x81, 0x1e, 0x7a, 0xcc, 0xa1, 0x97, 0x02, 0x29, 0xe0, - 0x43, 0x7a, 0x2e, 0x7a, 0x29, 0x72, 0x2a, 0x82, 0x9c, 0x0a, 0xa3, 0x70, 0x0a, 0xfb, 0x90, 0x9e, - 0x7b, 0xea, 0xb1, 0x98, 0xc7, 0x2e, 0xb9, 0x24, 0x25, 0xad, 0x28, 0x25, 0x87, 0x5c, 0x04, 0xcd, - 0xfc, 0xdf, 0xff, 0xfd, 0x8f, 0x99, 0xf9, 0x67, 0xfe, 0x25, 0x78, 0x95, 0x44, 0x02, 0x33, 0xaf, - 0x81, 0x48, 0xe4, 0x72, 0xec, 0xb5, 0x18, 0x11, 0x87, 0x35, 0xcf, 0x6b, 0xd7, 0x62, 0x46, 0xdb, - 0xc4, 0xc7, 0xac, 0xd6, 0xbe, 0x5e, 0x13, 0x6f, 0xdb, 0x31, 0xa3, 0x82, 0xc2, 0x17, 0x07, 0xa0, - 0x6d, 0xcf, 0x6b, 0xdb, 0x09, 0xda, 0x6e, 0x5f, 0x2f, 0xcf, 0xa3, 0x90, 0x44, 0xb4, 0xa6, 0xfe, - 0x6a, 0xb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x31, 0x98, 0x25, 0x11, 0x11, 0x04, 0x35, 0xdd, 0x06, 0x96, 0xa9, - 0x37, 0x0e, 0x97, 0xd5, 0x62, 0xc8, 0xd2, 0x67, 0x9b, 0x82, 0xa7, 0x16, 0x40, 0x22, 0x8c, 0x7f, - 0x33, 0x46, 0x4f, 0x4f, 0xca, 0x82, 0x10, 0xe0, 0x08, 0x73, 0xc2, 0xdd, 0x06, 0xe2, 0x0d, 0xb5, - 0xa6, 0xd3, 0xce, 0x94, 0x99, 0xbb, 0x8d, 0x78, 0x43, 0x56, 0xa3, 0x3a, 0x89, 0x10, 0x3b, 0xd4, - 0x88, 0x71, 0x85, 0x00, 0x7a, 0x4a, 0x01, 0xb6, 0x01, 0xe0, 0x31, 0x3a, 0x88, 0x5c, 0x79, 0x19, - 0x94, 0x26, 0x8c, 0x23, 0xba, 0xd0, 0xdb, 0x49, 0xa1, 0xb7, 0xef, 0x27, 0x37, 0xc5, 0x56, 0x41, - 0x3a, 0xf2, 0xfe, 0x67, 0x15, 0xcb, 0x29, 0x2a, 0x3d, 0x29, 0x81, 0x77, 0xc0, 0x5c, 0x2b, 0xaa, - 0xd3, 0xc8, 0x27, 0x51, 0xe0, 0xc6, 0x98, 0x11, 0xea, 0x97, 0x26, 0x15, 0xd5, 0x72, 0x1f, 0xd5, - 0x8e, 0xb9, 0x53, 0x34, 0xd3, 0x1f, 0x24, 0xd3, 0xc5, 0x54, 0x79, 0x5f, 0xe9, 0xc2, 0x9f, 0x01, - 0xe8, 0x79, 0x6d, 0xe5, 0x12, 0x6d, 0x89, 0x84, 0xf1, 0x42, 0x7e, 0xc6, 0x39, 0xcf, 0x6b, 0xdf, - 0xd7, 0xda, 0x86, 0xf2, 0x57, 0x60, 0x49, 0x30, 0x14, 0xf1, 0x87, 0x98, 0xf5, 0xf2, 0x16, 0xf2, - 0xf3, 0x5e, 0x4a, 0x38, 0xb2, 0xe4, 0xb7, 0xc1, 0x6a, 0x5a, 0x99, 0x19, 0xf6, 0x09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0xff, 0xff, - 0xd5, 0xb8, 0x36, 0x0f, 0xf5, 0x1d, 0x00, 0x00, + // 1871 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4b, 0x6c, 0x24, 0x47, + 0x19, 0x76, 0xfb, 0xb5, 0x9e, 0xb2, 0xbd, 0x6b, 0x97, 0x6d, 0x3c, 0x9e, 0x5d, 0x66, 0xbc, 0x93, + 0x90, 0x58, 0x4b, 0xdc, 0x9d, 0x5d, 0xc8, 0x02, 0x16, 0x04, 0xfc, 0x58, 0x58, 0x07, 0xbc, 0x6b, + 0x7a, 0x97, 0x45, 0x02, 0x29, 0xad, 0x9a, 0xee, 0xda, 0x9e, 0xd2, 0x4e, 0x57, 0xb5, 0xaa, 0x6a, + 0xc6, 0x19, 0x4e, 0x28, 0x87, 0x28, 0x27, 0x14, 0x24, 0x0e, 0x1c, 0x73, 0xe0, 0x82, 0x14, 0xa4, + 0x3d, 0x84, 0x33, 0xe2, 0x82, 0x72, 0x8a, 0xa2, 0x9c, 0x50, 0x84, 0x16, 0xb4, 0x7b, 0x08, 0x67, + 0x4e, 0x1c, 0x51, 0x3d, 0xba, 0x67, 0xc6, 0x33, 0xb6, 0xc7, 0xb3, 0x81, 0x03, 0x97, 0xd1, 0x54, + 0xfd, 0xdf, 0xff, 0xfd, 0x8f, 0xfe, 0xeb, 0xaf, 0x07, 0x78, 0x85, 0x50, 0x89, 0x79, 0x58, 0x47, + 0x84, 0x06, 0x02, 0x87, 0x4d, 0x4e, 0x64, 0xdb, 0x0b, 0xc3, 0x96, 0x97, 0x72, 0xd6, 0x22, 0x11, + 0xe6, 0x5e, 0xeb, 0xba, 0x27, 0xdf, 0x72, 0x53, 0xce, 0x24, 0x83, 0x2f, 0x0c, 0x40, 0xbb, 0x61, + 0xd8, 0x72, 0x33, 0xb4, 0xdb, 0xba, 0x5e, 0x5a, 0x44, 0x09, 0xa1, 0xcc, 0xd3, 0xbf, 0x46, 0xaf, + 0x74, 0x25, 0x66, 0x2c, 0x6e, 0x60, 0x0f, 0xa5, 0xc4, 0x43, 0x94, 0x32, 0x89, 0x24, 0x61, 0x54, + 0x58, 0x69, 0xc5, 0x4a, 0xf5, 0xa8, 0xd6, 0x7c, 0xe8, 0x49, 0x92, 0x60, 0x21, 0x51, 0x92, 0x5a, + 0x40, 0xf9, 0x38, 0x20, 0x6a, 0x72, 0xcd, 0x60, 0xe5, 0x6b, 0xc7, 0xe5, 0x88, 0xb6, 0xad, 0x68, + 0x39, 0x66, 0x31, 0xd3, 0x7f, 0x3d, 0xf5, 0x2f, 0x53, 0x08, 0x99, 0x48, 0x98, 0x08, 0x8c, 0xc0, + 0x0c, 0xac, 0x68, 0xd5, 0x8c, 0xbc, 0x44, 0xc4, 0x2a, 0xf4, 0x44, 0xc4, 0x99, 0x97, 0xa4, 0x16, + 0x7a, 0x21, 0xe3, 0xd8, 0x0b, 0x1b, 0x04, 0x53, 0xa9, 0xa4, 0xe6, 0x9f, 0x05, 0xdc, 0x18, 0x26, + 0x95, 0x79, 0xa2, 0x8c, 0x8e, 0xa7, 0x48, 0x1b, 0x24, 0xae, 0x4b, 0x43, 0x25, 0x3c, 0x89, 0x69, + 0x84, 0x79, 0x42, 0x8c, 0x81, 0xce, 0x28, 0xf3, 0xa2, 0x4b, 0x2e, 0xdb, 0x29, 0x16, 0x1e, 0x56, + 0x7c, 0x34, 0xc4, 0x06, 0x50, 0xfd, 0xcc, 0x01, 0xcb, 0x07, 0x22, 0xde, 0x16, 0x82, 0xc4, 0x74, + 0x97, 0x51, 0xd1, 0x4c, 0x30, 0xff, 0x21, 0x6e, 0xc3, 0x0a, 0x98, 0x0d, 0xed, 0x30, 0x20, 0x51, + 0xd1, 0x59, 0x77, 0x36, 0x0a, 0x3e, 0xc8, 0xa6, 0xf6, 0x23, 0xf8, 0x0d, 0x30, 0x9f, 0x79, 0x17, + 0xa0, 0x28, 0xe2, 0xc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x3c, 0xf6, 0xc9, 0xb3, 0xf2, 0xd8, 0x5f, 0x9f, 0x95, 0xc7, 0x7e, 0xf6, + 0x9d, 0x98, 0xc8, 0x7a, 0xb3, 0xe6, 0x86, 0x2c, 0xb1, 0x0f, 0xf5, 0x5e, 0xc7, 0xf8, 0x66, 0xfe, + 0xce, 0xde, 0x7a, 0xcd, 0x7b, 0xab, 0xf7, 0xb1, 0x5d, 0x3f, 0x4b, 0xd6, 0xa6, 0xf5, 0xa1, 0xe0, + 0x6b, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x60, 0xdc, 0xc1, 0xa8, 0xe8, 0x18, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1935,7 +1634,6 @@ type MsgClient interface { SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) - ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) @@ -1989,15 +1687,6 @@ func (c *msgClient) RegisterConsumer(ctx context.Context, in *MsgRegisterConsume return out, nil } -func (c *msgClient) ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) { - out := new(MsgConsumerAdditionResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/ConsumerAddition", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) { out := new(MsgInitializeConsumerResponse) err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", in, out, opts...) @@ -2067,7 +1756,6 @@ type MsgServer interface { SubmitConsumerMisbehaviour(context.Context, *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) RegisterConsumer(context.Context, *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) - ConsumerAddition(context.Context, *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) InitializeConsumer(context.Context, *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) UpdateConsumer(context.Context, *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) RemoveConsumer(context.Context, *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) @@ -2093,9 +1781,6 @@ func (*UnimplementedMsgServer) SubmitConsumerDoubleVoting(ctx context.Context, r func (*UnimplementedMsgServer) RegisterConsumer(ctx context.Context, req *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterConsumer not implemented") } -func (*UnimplementedMsgServer) ConsumerAddition(ctx context.Context, req *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ConsumerAddition not implemented") -} func (*UnimplementedMsgServer) InitializeConsumer(ctx context.Context, req *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InitializeConsumer not implemented") } @@ -2194,24 +1879,6 @@ func _Msg_RegisterConsumer_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Msg_ConsumerAddition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgConsumerAddition) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ConsumerAddition(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/ConsumerAddition", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ConsumerAddition(ctx, req.(*MsgConsumerAddition)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_InitializeConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgInitializeConsumer) if err := dec(in); err != nil { @@ -2358,10 +2025,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RegisterConsumer", Handler: _Msg_RegisterConsumer_Handler, }, - { - MethodName: "ConsumerAddition", - Handler: _Msg_ConsumerAddition_Handler, - }, { MethodName: "InitializeConsumer", Handler: _Msg_InitializeConsumer_Handler, @@ -2674,204 +2337,6 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *MsgConsumerAddition) 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 *MsgConsumerAddition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConsumerAddition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AllowInactiveVals { - i-- - if m.AllowInactiveVals { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa0 - } - if m.MinStake != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } - if len(m.Denylist) > 0 { - for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denylist[iNdEx]) - copy(dAtA[i:], m.Denylist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - } - if len(m.Allowlist) > 0 { - for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Allowlist[iNdEx]) - copy(dAtA[i:], m.Allowlist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - } - if m.ValidatorSetCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) - i-- - dAtA[i] = 0x78 - } - if m.ValidatorsPowerCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) - i-- - dAtA[i] = 0x70 - } - if m.Top_N != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) - i-- - dAtA[i] = 0x68 - } - if len(m.DistributionTransmissionChannel) > 0 { - i -= len(m.DistributionTransmissionChannel) - copy(dAtA[i:], m.DistributionTransmissionChannel) - i = encodeVarintTx(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) - i-- - dAtA[i] = 0x62 - } - if m.HistoricalEntries != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.HistoricalEntries)) - i-- - dAtA[i] = 0x58 - } - if m.BlocksPerDistributionTransmission != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) - i-- - dAtA[i] = 0x50 - } - if len(m.ConsumerRedistributionFraction) > 0 { - i -= len(m.ConsumerRedistributionFraction) - copy(dAtA[i:], m.ConsumerRedistributionFraction) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) - i-- - dAtA[i] = 0x4a - } - n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintTx(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x42 - n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintTx(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x3a - n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintTx(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x32 - n8, err8 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintTx(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x2a - if len(m.BinaryHash) > 0 { - i -= len(m.BinaryHash) - copy(dAtA[i:], m.BinaryHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.BinaryHash))) - i-- - dAtA[i] = 0x22 - } - if len(m.GenesisHash) > 0 { - i -= len(m.GenesisHash) - copy(dAtA[i:], m.GenesisHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisHash))) - i-- - dAtA[i] = 0x1a - } - { - size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgConsumerAdditionResponse) 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 *MsgConsumerAdditionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConsumerAdditionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *MsgRemoveConsumer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2899,12 +2364,12 @@ func (m *MsgRemoveConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - n10, err10 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) - if err10 != nil { - return 0, err10 + n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) + if err5 != nil { + return 0, err5 } - i -= n10 - i = encodeVarintTx(dAtA, i, uint64(n10)) + i -= n5 + i = encodeVarintTx(dAtA, i, uint64(n5)) i-- dAtA[i] = 0x12 if len(m.ConsumerId) > 0 { @@ -3588,36 +3053,36 @@ func (m *ConsumerInitializationRecord) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x42 } - n14, err14 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) - if err14 != nil { - return 0, err14 + n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) + if err9 != nil { + return 0, err9 } - i -= n14 - i = encodeVarintTx(dAtA, i, uint64(n14)) + i -= n9 + i = encodeVarintTx(dAtA, i, uint64(n9)) i-- dAtA[i] = 0x3a - n15, err15 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) - if err15 != nil { - return 0, err15 + n10, err10 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + if err10 != nil { + return 0, err10 } - i -= n15 - i = encodeVarintTx(dAtA, i, uint64(n15)) + i -= n10 + i = encodeVarintTx(dAtA, i, uint64(n10)) i-- dAtA[i] = 0x32 - n16, err16 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) - if err16 != nil { - return 0, err16 + n11, err11 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err11 != nil { + return 0, err11 } - i -= n16 - i = encodeVarintTx(dAtA, i, uint64(n16)) + i -= n11 + i = encodeVarintTx(dAtA, i, uint64(n11)) i-- dAtA[i] = 0x2a - n17, err17 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) - if err17 != nil { - return 0, err17 + n12, err12 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) + if err12 != nil { + return 0, err12 } - i -= n17 - i = encodeVarintTx(dAtA, i, uint64(n17)) + i -= n12 + i = encodeVarintTx(dAtA, i, uint64(n12)) i-- dAtA[i] = 0x22 if len(m.BinaryHash) > 0 { @@ -3795,83 +3260,26 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } -func (m *MsgConsumerAddition) Size() (n int) { +func (m *MsgRemoveConsumer) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.InitialHeight.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.GenesisHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.BinaryHash) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) n += 1 + l + sovTx(uint64(l)) - l = len(m.ConsumerRedistributionFraction) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.BlocksPerDistributionTransmission != 0 { - n += 1 + sovTx(uint64(m.BlocksPerDistributionTransmission)) - } - if m.HistoricalEntries != 0 { - n += 1 + sovTx(uint64(m.HistoricalEntries)) - } - l = len(m.DistributionTransmissionChannel) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Top_N != 0 { - n += 1 + sovTx(uint64(m.Top_N)) - } - if m.ValidatorsPowerCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) - } - if m.ValidatorSetCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorSetCap)) - } - if len(m.Allowlist) > 0 { - for _, s := range m.Allowlist { - l = len(s) - n += 2 + l + sovTx(uint64(l)) - } - } - if len(m.Denylist) > 0 { - for _, s := range m.Denylist { - l = len(s) - n += 2 + l + sovTx(uint64(l)) - } - } l = len(m.Authority) if l > 0 { - n += 2 + l + sovTx(uint64(l)) - } - if m.MinStake != 0 { - n += 2 + sovTx(uint64(m.MinStake)) - } - if m.AllowInactiveVals { - n += 3 + n += 1 + l + sovTx(uint64(l)) } return n } -func (m *MsgConsumerAdditionResponse) Size() (n int) { +func (m *MsgRemoveConsumerResponse) Size() (n int) { if m == nil { return 0 } @@ -3880,35 +3288,7 @@ func (m *MsgConsumerAdditionResponse) Size() (n int) { return n } -func (m *MsgRemoveConsumer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) - n += 1 + l + sovTx(uint64(l)) - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRemoveConsumerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgChangeRewardDenoms) Size() (n int) { +func (m *MsgChangeRewardDenoms) Size() (n int) { if m == nil { return 0 } @@ -5001,665 +4381,6 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerAddition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerAddition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) - if m.GenesisHash == nil { - m.GenesisHash = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) - if m.BinaryHash == nil { - m.BinaryHash = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) - } - m.BlocksPerDistributionTransmission = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) - } - m.HistoricalEntries = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HistoricalEntries |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Top_N |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) - } - m.ValidatorsPowerCap = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorsPowerCap |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) - } - m.ValidatorSetCap = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorSetCap |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) - } - m.MinStake = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinStake |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowInactiveVals = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerAdditionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerAdditionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From 285456896f6780ab7c8570123eaf55bbaf5457b4 Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 2 Aug 2024 18:50:41 +0300 Subject: [PATCH 18/41] added CLI commands for new messages --- x/ccv/provider/client/cli/tx.go | 220 ++++++++++++++++++++++++ x/ccv/provider/types/errors.go | 64 +++---- x/ccv/provider/types/legacy_proposal.go | 8 +- x/ccv/provider/types/msg.go | 185 ++++++++++++++++++-- 4 files changed, 429 insertions(+), 48 deletions(-) diff --git a/x/ccv/provider/client/cli/tx.go b/x/ccv/provider/client/cli/tx.go index 4011a36a79..9dfbd741fb 100644 --- a/x/ccv/provider/client/cli/tx.go +++ b/x/ccv/provider/client/cli/tx.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "strings" + "time" "cosmossdk.io/math" @@ -36,6 +37,10 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(NewAssignConsumerKeyCmd()) cmd.AddCommand(NewSubmitConsumerMisbehaviourCmd()) cmd.AddCommand(NewSubmitConsumerDoubleVotingCmd()) + cmd.AddCommand(NewRegisterConsumerCmd()) + cmd.AddCommand(NewInitializeConsumerCmd()) + cmd.AddCommand(NewUpdateConsumerCmd()) + cmd.AddCommand(NewRemoveConsumerCmd()) cmd.AddCommand(NewOptInCmd()) cmd.AddCommand(NewOptOutCmd()) cmd.AddCommand(NewSetConsumerCommissionRateCmd()) @@ -209,6 +214,221 @@ Example: return cmd } +func NewRegisterConsumerCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "register-consumer [path/to/registration-record.json]", + Short: "register a consumer chain", + Long: strings.TrimSpace( + fmt.Sprintf(`Register a consumer chain to get back the assigned consumer id of this chain. +Note that the one that signs this message is the owner of this consumer chain. The owner can be later +changed by updating the consumer chain. + +Example: +%s tx provider register-cosumer [path/to/registration-record.json] --from node0 --home ../node0 --chain-id $CID +`, version.AppName)), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + signer := clientCtx.GetFromAddress().String() + registrationRecord := types.ConsumerRegistrationRecord{} + registrationRecordJson, err := os.ReadFile(args[0]) + if err != nil { + return err + } + if err := json.Unmarshal(registrationRecordJson, ®istrationRecord); err != nil { + return fmt.Errorf("registration record unmarshalling failed: %w", err) + } + + msg, err := types.NewMsgRegisterConsumer(signer, registrationRecord) + if err != nil { + return err + } + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(flags.FlagFrom) + + return cmd +} + +func NewInitializeConsumerCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "initialize-consumer [consumer-id] [path/to/initialization-record.json]", + Short: "initialize a consumer chain", + Long: strings.TrimSpace( + fmt.Sprintf(`Initialize a consumer chain to get it ready to launch +Note that only the owner of the chain can initialize it. + +Example: +%s tx provider initialize-cosumer [consumer-id] [path/to/initialization-record.json] --from node0 --home ../node0 --chain-id $CID +`, version.AppName)), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + signer := clientCtx.GetFromAddress().String() + consumerId := args[0] + initializationRecord := types.ConsumerInitializationRecord{} + initializationRecordJson, err := os.ReadFile(args[1]) + if err != nil { + return err + } + if err := json.Unmarshal(initializationRecordJson, &initializationRecord); err != nil { + return fmt.Errorf("initialization record unmarshalling failed: %w", err) + } + + msg, err := types.NewMsgInitializeConsumer(signer, consumerId, initializationRecord) + if err != nil { + return err + } + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(flags.FlagFrom) + + return cmd +} + +func NewUpdateConsumerCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-consumer [consumer-id] [path/to/update-record.json]", + Short: "update a consumer chain", + Long: strings.TrimSpace( + fmt.Sprintf(`Update a consumer chain to change its running parameters (e.g., the allow list). +Note that only the owner of the chain can initialize it. + +Example: +%s tx provider update-cosumer [consumer-id] [path/to/update-record.json] --from node0 --home ../node0 --chain-id $CID +`, version.AppName)), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + signer := clientCtx.GetFromAddress().String() + consumerId := args[0] + updateRecord := types.ConsumerUpdateRecord{} + updateRecordJson, err := os.ReadFile(args[1]) + if err != nil { + return err + } + if err := json.Unmarshal(updateRecordJson, &updateRecord); err != nil { + return fmt.Errorf("update record unmarshalling failed: %w", err) + } + + msg, err := types.NewMsgUpdateConsumer(signer, consumerId, updateRecord) + if err != nil { + return err + } + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(flags.FlagFrom) + + return cmd +} + +func NewRemoveConsumerCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "remove-consumer [consumer-id] [stop-time-layout] [stop-time-value]", + Short: "remove a consumer chain", + Long: strings.TrimSpace( + fmt.Sprintf(`Removes (and stops) a consumer chain. Note that only the owner of the chain can remove it. +Stop time is parsed by using the layout and the value (see https://pkg.go.dev/time#Parse). + +Example: +%s tx provider remove-cosumer [consumer-id] [stop-time-layout] [stop-time-value] --from node0 --home ../node0 --chain-id $CID +`, version.AppName)), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) + + signer := clientCtx.GetFromAddress().String() + consumerId := args[0] + stopTimeLayout := args[1] + stopTimeValue := args[2] + + stopTime, err := time.Parse(stopTimeLayout, stopTimeValue) + if err != nil { + return err + } + + msg, err := types.NewMsgRemoveConsumer(signer, consumerId, stopTime) + if err != nil { + return err + } + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(flags.FlagFrom) + + return cmd +} + func NewOptInCmd() *cobra.Command { cmd := &cobra.Command{ Use: "opt-in [consumer-chain-id] [consumer-pubkey]", diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index c2b6e768e4..933995538c 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -6,36 +6,36 @@ import ( // Provider sentinel errors var ( - ErrInvalidConsumerAdditionProposal = errorsmod.Register(ModuleName, 1, "invalid consumer addition proposal") - ErrInvalidConsumerRemovalProp = errorsmod.Register(ModuleName, 2, "invalid consumer removal proposal") - ErrUnknownConsumerId = errorsmod.Register(ModuleName, 3, "no consumer chain with this consumer id") - ErrUnknownConsumerChannelId = errorsmod.Register(ModuleName, 4, "no consumer chain with this channel id") - ErrInvalidConsumerConsensusPubKey = errorsmod.Register(ModuleName, 5, "empty consumer consensus public key") - ErrInvalidConsumerId = errorsmod.Register(ModuleName, 6, "invalid consumer id") - ErrConsumerKeyNotFound = errorsmod.Register(ModuleName, 7, "consumer key not found") - ErrNoValidatorConsumerAddress = errorsmod.Register(ModuleName, 8, "error getting validator consumer address") - ErrNoValidatorProviderAddress = errorsmod.Register(ModuleName, 9, "error getting validator provider address") - ErrConsumerKeyInUse = errorsmod.Register(ModuleName, 10, "consumer key is already in use by a validator") - ErrCannotAssignDefaultKeyAssignment = errorsmod.Register(ModuleName, 11, "cannot re-assign default key assignment") - ErrInvalidConsumerParams = errorsmod.Register(ModuleName, 12, "invalid consumer params") - ErrInvalidProviderAddress = errorsmod.Register(ModuleName, 13, "invalid provider address") - ErrInvalidConsumerRewardDenom = errorsmod.Register(ModuleName, 14, "invalid consumer reward denom") - ErrInvalidDepositorAddress = errorsmod.Register(ModuleName, 15, "invalid depositor address") - ErrInvalidConsumerClient = errorsmod.Register(ModuleName, 16, "ccv channel is not built on correct client") - ErrDuplicateConsumerChain = errorsmod.Register(ModuleName, 17, "consumer chain already exists") - ErrConsumerChainNotFound = errorsmod.Register(ModuleName, 18, "consumer chain not found") - ErrInvalidConsumerCommissionRate = errorsmod.Register(ModuleName, 19, "consumer commission rate is invalid") - ErrCannotOptOutFromTopN = errorsmod.Register(ModuleName, 20, "cannot opt out from a Top N chain") - ErrNoUnconfirmedVSCPacket = errorsmod.Register(ModuleName, 21, "no unconfirmed vsc packet for this chain id") - ErrInvalidConsumerModificationProposal = errorsmod.Register(ModuleName, 22, "invalid consumer modification proposal") - ErrNoUnbondingTime = errorsmod.Register(ModuleName, 23, "provider unbonding time not found") - ErrInvalidAddress = errorsmod.Register(ModuleName, 24, "invalid address") - ErrUnauthorized = errorsmod.Register(ModuleName, 25, "unauthorized") - ErrInvalidPhase = errorsmod.Register(ModuleName, 26, "cannot perform action in the current phase of consumer chain") - ErrNoInitializationRecord = errorsmod.Register(ModuleName, 27, "initialization record is missing") - ErrNoRegistrationRecord = errorsmod.Register(ModuleName, 28, "registration record is missing") - ErrNoChainId = errorsmod.Register(ModuleName, 29, "missing chain id for consumer chain") - ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 30, "missing consumer genesis") - ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 31, "invalid consumer genesis") - ErrNoConsumerId = errorsmod.Register(ModuleName, 32, "missing consumer id") + ErrInvalidConsumerAdditionProposal = errorsmod.Register(ModuleName, 1, "invalid consumer addition proposal") + ErrInvalidConsumerRemoval = errorsmod.Register(ModuleName, 2, "invalid consumer removal") + ErrUnknownConsumerId = errorsmod.Register(ModuleName, 3, "no consumer chain with this consumer id") + ErrUnknownConsumerChannelId = errorsmod.Register(ModuleName, 4, "no consumer chain with this channel id") + ErrInvalidConsumerConsensusPubKey = errorsmod.Register(ModuleName, 5, "empty consumer consensus public key") + ErrInvalidConsumerId = errorsmod.Register(ModuleName, 6, "invalid consumer id") + ErrConsumerKeyNotFound = errorsmod.Register(ModuleName, 7, "consumer key not found") + ErrNoValidatorConsumerAddress = errorsmod.Register(ModuleName, 8, "error getting validator consumer address") + ErrNoValidatorProviderAddress = errorsmod.Register(ModuleName, 9, "error getting validator provider address") + ErrConsumerKeyInUse = errorsmod.Register(ModuleName, 10, "consumer key is already in use by a validator") + ErrCannotAssignDefaultKeyAssignment = errorsmod.Register(ModuleName, 11, "cannot re-assign default key assignment") + ErrInvalidConsumerParams = errorsmod.Register(ModuleName, 12, "invalid consumer params") + ErrInvalidProviderAddress = errorsmod.Register(ModuleName, 13, "invalid provider address") + ErrInvalidConsumerRewardDenom = errorsmod.Register(ModuleName, 14, "invalid consumer reward denom") + ErrInvalidDepositorAddress = errorsmod.Register(ModuleName, 15, "invalid depositor address") + ErrInvalidConsumerClient = errorsmod.Register(ModuleName, 16, "ccv channel is not built on correct client") + ErrDuplicateConsumerChain = errorsmod.Register(ModuleName, 17, "consumer chain already exists") + ErrConsumerChainNotFound = errorsmod.Register(ModuleName, 18, "consumer chain not found") + ErrInvalidConsumerCommissionRate = errorsmod.Register(ModuleName, 19, "consumer commission rate is invalid") + ErrCannotOptOutFromTopN = errorsmod.Register(ModuleName, 20, "cannot opt out from a Top N chain") + ErrNoUnconfirmedVSCPacket = errorsmod.Register(ModuleName, 21, "no unconfirmed vsc packet for this chain id") + ErrInvalidUpdateRecord = errorsmod.Register(ModuleName, 22, "invalid consumer update record") + ErrNoUnbondingTime = errorsmod.Register(ModuleName, 23, "provider unbonding time not found") + ErrInvalidAddress = errorsmod.Register(ModuleName, 24, "invalid address") + ErrUnauthorized = errorsmod.Register(ModuleName, 25, "unauthorized") + ErrInvalidPhase = errorsmod.Register(ModuleName, 26, "cannot perform action in the current phase of consumer chain") + ErrNoInitializationRecord = errorsmod.Register(ModuleName, 27, "initialization record is missing") + ErrNoRegistrationRecord = errorsmod.Register(ModuleName, 28, "registration record is missing") + ErrNoChainId = errorsmod.Register(ModuleName, 29, "missing chain id for consumer chain") + ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 30, "missing consumer genesis") + ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 31, "invalid consumer genesis") + ErrNoConsumerId = errorsmod.Register(ModuleName, 32, "missing consumer id") ) diff --git a/x/ccv/provider/types/legacy_proposal.go b/x/ccv/provider/types/legacy_proposal.go index b4117ab7c0..20b0522d69 100644 --- a/x/ccv/provider/types/legacy_proposal.go +++ b/x/ccv/provider/types/legacy_proposal.go @@ -231,11 +231,11 @@ func (sccp *ConsumerRemovalProposal) ValidateBasic() error { } if strings.TrimSpace(sccp.ConsumerId) == "" { - return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "consumer chain id must not be blank") + return errorsmod.Wrap(ErrInvalidConsumerRemoval, "consumer chain id must not be blank") } if sccp.StopTime.IsZero() { - return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "spawn time cannot be zero") + return errorsmod.Wrap(ErrInvalidConsumerRemoval, "spawn time cannot be zero") } return nil } @@ -279,12 +279,12 @@ func (cccp *ConsumerModificationProposal) ValidateBasic() error { } if strings.TrimSpace(cccp.ConsumerId) == "" { - return errorsmod.Wrap(ErrInvalidConsumerModificationProposal, "consumer chain id must not be blank") + return errorsmod.Wrap(ErrInvalidUpdateRecord, "consumer chain id must not be blank") } err := ValidatePSSFeatures(cccp.Top_N, cccp.ValidatorsPowerCap) if err != nil { - return errorsmod.Wrapf(ErrInvalidConsumerModificationProposal, "invalid PSS features: %s", err.Error()) + return errorsmod.Wrapf(ErrInvalidUpdateRecord, "invalid PSS features: %s", err.Error()) } return nil } diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 3b861ea853..dbb931731c 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -5,6 +5,7 @@ import ( "fmt" "strconv" "strings" + "time" ibctmtypes "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" @@ -24,6 +25,10 @@ const ( TypeMsgAssignConsumerKey = "assign_consumer_key" TypeMsgSubmitConsumerMisbehaviour = "submit_consumer_misbehaviour" TypeMsgSubmitConsumerDoubleVoting = "submit_consumer_double_vote" + TypeMsgRegisterConsumer = "register_consumer" + TypeMsgInitializeConsumer = "initialize_consumer" + TypeMsgUpdateConsumer = "update_consumer" + TypeMsgRemoveConsumer = "remove_consumer" TypeMsgOptIn = "opt_in" TypeMsgOptOut = "opt_out" TypeMsgSetConsumerCommissionRate = "set_consumer_commission_rate" @@ -31,21 +36,25 @@ const ( var ( _ sdk.Msg = (*MsgAssignConsumerKey)(nil) - _ sdk.Msg = (*MsgRemoveConsumer)(nil) - _ sdk.Msg = (*MsgUpdateConsumer)(nil) _ sdk.Msg = (*MsgChangeRewardDenoms)(nil) _ sdk.Msg = (*MsgSubmitConsumerMisbehaviour)(nil) _ sdk.Msg = (*MsgSubmitConsumerDoubleVoting)(nil) + _ sdk.Msg = (*MsgRegisterConsumer)(nil) + _ sdk.Msg = (*MsgInitializeConsumer)(nil) + _ sdk.Msg = (*MsgUpdateConsumer)(nil) + _ sdk.Msg = (*MsgRemoveConsumer)(nil) _ sdk.Msg = (*MsgOptIn)(nil) _ sdk.Msg = (*MsgOptOut)(nil) _ sdk.Msg = (*MsgSetConsumerCommissionRate)(nil) _ sdk.HasValidateBasic = (*MsgAssignConsumerKey)(nil) - _ sdk.HasValidateBasic = (*MsgRemoveConsumer)(nil) - _ sdk.HasValidateBasic = (*MsgUpdateConsumer)(nil) _ sdk.HasValidateBasic = (*MsgChangeRewardDenoms)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerMisbehaviour)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerDoubleVoting)(nil) + _ sdk.HasValidateBasic = (*MsgRegisterConsumer)(nil) + _ sdk.HasValidateBasic = (*MsgInitializeConsumer)(nil) + _ sdk.HasValidateBasic = (*MsgUpdateConsumer)(nil) + _ sdk.HasValidateBasic = (*MsgRemoveConsumer)(nil) _ sdk.HasValidateBasic = (*MsgOptIn)(nil) _ sdk.HasValidateBasic = (*MsgOptOut)(nil) _ sdk.HasValidateBasic = (*MsgSetConsumerCommissionRate)(nil) @@ -226,29 +235,181 @@ func (msg MsgSubmitConsumerDoubleVoting) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{addr} } -func (msg *MsgRemoveConsumer) ValidateBasic() error { - if err := ValidateConsumerId(msg.ConsumerId); err != nil { - return err - } +// NewMsgRegisterConsumer creates a new MsgRegisterConsumer instance +func NewMsgRegisterConsumer(signer string, registrationRecord ConsumerRegistrationRecord) (*MsgRegisterConsumer, error) { + return &MsgRegisterConsumer{ + Signer: signer, + RegistrationRecord: ®istrationRecord, + }, nil +} - if msg.StopTime.IsZero() { - return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "spawn time cannot be zero") +// Type implements the sdk.Msg interface. +func (msg MsgRegisterConsumer) Type() string { + return TypeMsgRegisterConsumer +} + +// Route implements the sdk.Msg interface. +func (msg MsgRegisterConsumer) Route() string { return RouterKey } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgRegisterConsumer) ValidateBasic() error { + // add checks + // TODO (PERMISSIONLESS) + return nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgRegisterConsumer) GetSignBytes() []byte { + bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +func (msg MsgRegisterConsumer) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.Signer) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) } + return []sdk.AccAddress{valAddr.Bytes()} +} + +// NewMsgInitializeConsumer creates a new MsgInitializeConsumer instance +func NewMsgInitializeConsumer(signer string, consumerId string, initializationRecord ConsumerInitializationRecord) (*MsgInitializeConsumer, error) { + return &MsgInitializeConsumer{ + Authority: signer, + ConsumerId: consumerId, + InitializationRecord: &initializationRecord, + }, nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgInitializeConsumer) Type() string { + return TypeMsgInitializeConsumer +} + +// Route implements the sdk.Msg interface. +func (msg MsgInitializeConsumer) Route() string { return RouterKey } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgInitializeConsumer) ValidateBasic() error { + // add checks + // TODO (PERMISSIONLESS) return nil } +// Type implements the sdk.Msg interface. +func (msg MsgInitializeConsumer) GetSignBytes() []byte { + bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +func (msg MsgInitializeConsumer) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.Authority) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } + return []sdk.AccAddress{valAddr.Bytes()} +} + +// NewMsgUpdateConsumer creates a new MsgUpdateConsumer instance +func NewMsgUpdateConsumer(signer string, consumerId string, updateRecord ConsumerUpdateRecord) (*MsgUpdateConsumer, error) { + return &MsgUpdateConsumer{ + Authority: signer, + ConsumerId: consumerId, + UpdateRecord: &updateRecord, + }, nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgUpdateConsumer) Type() string { + return TypeMsgUpdateConsumer +} + +// Route implements the sdk.Msg interface. +func (msg MsgUpdateConsumer) Route() string { return RouterKey } + // ValidateBasic implements the sdk.Msg interface. -func (msg *MsgUpdateConsumer) ValidateBasic() error { +func (msg MsgUpdateConsumer) ValidateBasic() error { if err := ValidateConsumerId(msg.ConsumerId); err != nil { return err } err := ValidatePSSFeatures(msg.UpdateRecord.Top_N, msg.UpdateRecord.ValidatorsPowerCap) if err != nil { - return errorsmod.Wrapf(ErrInvalidConsumerModificationProposal, "invalid PSS features: %s", err.Error()) + return errorsmod.Wrapf(ErrInvalidUpdateRecord, "invalid PSS features: %s", err.Error()) + } + + return nil + return nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgUpdateConsumer) GetSignBytes() []byte { + bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +func (msg MsgUpdateConsumer) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.Authority) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } + return []sdk.AccAddress{valAddr.Bytes()} +} + +// NewMsgRemoveConsumer creates a new MsgRemoveConsumer instance +func NewMsgRemoveConsumer(signer string, consumerId string, stopTime time.Time) (*MsgRemoveConsumer, error) { + return &MsgRemoveConsumer{ + Authority: signer, + ConsumerId: consumerId, + StopTime: stopTime, + }, nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgRemoveConsumer) Type() string { + return TypeMsgRemoveConsumer +} + +// Route implements the sdk.Msg interface. +func (msg MsgRemoveConsumer) Route() string { return RouterKey } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgRemoveConsumer) ValidateBasic() error { + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err } + if msg.StopTime.IsZero() { + return errorsmod.Wrap(ErrInvalidConsumerRemoval, "spawn time cannot be zero") + } return nil + +} + +// Type implements the sdk.Msg interface. +func (msg MsgRemoveConsumer) GetSignBytes() []byte { + bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +func (msg MsgRemoveConsumer) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.Authority) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } + return []sdk.AccAddress{valAddr.Bytes()} } // NewMsgOptIn creates a new NewMsgOptIn instance. From 34d916485a9d37b6b301d482860fb49d3ff03742 Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 2 Aug 2024 19:21:19 +0300 Subject: [PATCH 19/41] removed consumer modification proposal --- x/ccv/provider/keeper/legacy_proposal.go | 61 ------------ x/ccv/provider/keeper/legacy_proposal_test.go | 65 ++++++------- x/ccv/provider/keeper/permissionless.go | 81 ++++++++++++++++ x/ccv/provider/keeper/proposal.go | 21 +---- x/ccv/provider/proposal_handler.go | 2 - x/ccv/provider/types/codec.go | 7 +- x/ccv/provider/types/legacy_proposal.go | 50 ---------- x/ccv/provider/types/legacy_proposal_test.go | 93 ++++++++----------- x/ccv/provider/types/msg.go | 1 - 9 files changed, 158 insertions(+), 223 deletions(-) diff --git a/x/ccv/provider/keeper/legacy_proposal.go b/x/ccv/provider/keeper/legacy_proposal.go index 3d39cdacb5..e36874a142 100644 --- a/x/ccv/provider/keeper/legacy_proposal.go +++ b/x/ccv/provider/keeper/legacy_proposal.go @@ -1,7 +1,6 @@ package keeper import ( - errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" @@ -58,63 +57,3 @@ func (k Keeper) HandleLegacyConsumerRemovalProposal(ctx sdk.Context, p *types.Co return nil } - -// HandleConsumerModificationProposal modifies a running consumer chain -func (k Keeper) HandleLegacyConsumerModificationProposal(ctx sdk.Context, p *types.ConsumerModificationProposal) error { - if _, found := k.GetConsumerClientId(ctx, p.ConsumerId); !found { - return errorsmod.Wrapf(types.ErrInvalidConsumerId, "chain with consumer id %s is not launched", p.ConsumerId) - } - - k.SetTopN(ctx, p.ConsumerId, p.Top_N) - k.SetValidatorsPowerCap(ctx, p.ConsumerId, p.ValidatorsPowerCap) - k.SetValidatorSetCap(ctx, p.ConsumerId, p.ValidatorSetCap) - k.SetMinStake(ctx, p.ConsumerId, p.MinStake) - k.SetInactiveValidatorsAllowed(ctx, p.ConsumerId, p.AllowInactiveVals) - - k.DeleteAllowlist(ctx, p.ConsumerId) - for _, address := range p.Allowlist { - consAddr, err := sdk.ConsAddressFromBech32(address) - if err != nil { - continue - } - - k.SetAllowlist(ctx, p.ConsumerId, types.NewProviderConsAddress(consAddr)) - } - - k.DeleteDenylist(ctx, p.ConsumerId) - for _, address := range p.Denylist { - consAddr, err := sdk.ConsAddressFromBech32(address) - if err != nil { - continue - } - - k.SetDenylist(ctx, p.ConsumerId, types.NewProviderConsAddress(consAddr)) - } - - oldTopN, found := k.GetTopN(ctx, p.ConsumerId) - if !found { - oldTopN = 0 - k.Logger(ctx).Info("consumer chain top N not found, treating as 0", "chainID", p.ConsumerId) - } - - // if the top N changes, we need to update the new minimum power in top N - if p.Top_N != oldTopN { - if p.Top_N > 0 { - // if the chain receives a non-zero top N value, store the minimum power in the top N - activeValidators, err := k.GetLastProviderConsensusActiveValidators(ctx) - if err != nil { - return err - } - minPower, err := k.ComputeMinPowerInTopN(ctx, activeValidators, p.Top_N) - if err != nil { - return err - } - k.SetMinimumPowerInTopN(ctx, p.ConsumerId, minPower) - } else { - // if the chain receives a zero top N value, we delete the min power - k.DeleteMinimumPowerInTopN(ctx, p.ConsumerId) - } - } - - return nil -} diff --git a/x/ccv/provider/keeper/legacy_proposal_test.go b/x/ccv/provider/keeper/legacy_proposal_test.go index 8cd4c267b9..c5bb596681 100644 --- a/x/ccv/provider/keeper/legacy_proposal_test.go +++ b/x/ccv/provider/keeper/legacy_proposal_test.go @@ -149,24 +149,24 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { } } -func TestHandleConsumerModificationProposal(t *testing.T) { +func TestUpdateConsumer(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + consumerId := "0" - // set up a consumer client, so it seems that "chainID" is running - providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") + // set up a consumer client, so it seems that chain is running + providerKeeper.SetConsumerClientId(ctx, consumerId, "clientID") // set PSS-related fields to update them later on - providerKeeper.SetTopN(ctx, chainID, 50) - providerKeeper.SetValidatorSetCap(ctx, chainID, 10) - providerKeeper.SetValidatorsPowerCap(ctx, chainID, 34) - providerKeeper.SetAllowlist(ctx, chainID, providertypes.NewProviderConsAddress([]byte("allowlistedAddr1"))) - providerKeeper.SetAllowlist(ctx, chainID, providertypes.NewProviderConsAddress([]byte("allowlistedAddr2"))) - providerKeeper.SetDenylist(ctx, chainID, providertypes.NewProviderConsAddress([]byte("denylistedAddr1"))) - providerKeeper.SetMinStake(ctx, chainID, 1000) - providerKeeper.SetInactiveValidatorsAllowed(ctx, chainID, true) + providerKeeper.SetTopN(ctx, consumerId, 50) + providerKeeper.SetValidatorSetCap(ctx, consumerId, 10) + providerKeeper.SetValidatorsPowerCap(ctx, consumerId, 34) + providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr1"))) + providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr2"))) + providerKeeper.SetDenylist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("denylistedAddr1"))) + providerKeeper.SetMinStake(ctx, consumerId, 1000) + providerKeeper.SetInactiveValidatorsAllowed(ctx, consumerId, true) expectedTopN := uint32(75) expectedValidatorsPowerCap := uint32(67) @@ -175,39 +175,40 @@ func TestHandleConsumerModificationProposal(t *testing.T) { expectedDenylistedValidator := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" expectedMinStake := uint64(0) expectedAllowInactiveValidators := false - proposal := providertypes.NewConsumerModificationProposal("title", "description", chainID, - expectedTopN, - expectedValidatorsPowerCap, - expectedValidatorSetCap, - []string{expectedAllowlistedValidator}, - []string{expectedDenylistedValidator}, - expectedMinStake, - expectedAllowInactiveValidators, - ).(*providertypes.ConsumerModificationProposal) - - err := providerKeeper.HandleLegacyConsumerModificationProposal(ctx, proposal) + + updateRecord := providertypes.ConsumerUpdateRecord{ + Top_N: expectedTopN, + ValidatorsPowerCap: expectedValidatorsPowerCap, + ValidatorSetCap: expectedValidatorSetCap, + Allowlist: []string{expectedAllowlistedValidator}, + Denylist: []string{expectedDenylistedValidator}, + } + + providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Initialized) + providerKeeper.SetConsumerIdToUpdateRecord(ctx, consumerId, updateRecord) + err := providerKeeper.UpdateConsumer(ctx, consumerId) require.NoError(t, err) - actualTopN, _ := providerKeeper.GetTopN(ctx, chainID) + actualTopN, _ := providerKeeper.GetTopN(ctx, consumerId) require.Equal(t, expectedTopN, actualTopN) - actualValidatorsPowerCap, _ := providerKeeper.GetValidatorsPowerCap(ctx, chainID) + actualValidatorsPowerCap, _ := providerKeeper.GetValidatorsPowerCap(ctx, consumerId) require.Equal(t, expectedValidatorsPowerCap, actualValidatorsPowerCap) - actualValidatorSetCap, _ := providerKeeper.GetValidatorSetCap(ctx, chainID) + actualValidatorSetCap, _ := providerKeeper.GetValidatorSetCap(ctx, consumerId) require.Equal(t, expectedValidatorSetCap, actualValidatorSetCap) allowlistedValidator, err := sdk.ConsAddressFromBech32(expectedAllowlistedValidator) require.NoError(t, err) - require.Equal(t, 1, len(providerKeeper.GetAllowList(ctx, chainID))) - require.Equal(t, providertypes.NewProviderConsAddress(allowlistedValidator), providerKeeper.GetAllowList(ctx, chainID)[0]) + require.Equal(t, 1, len(providerKeeper.GetAllowList(ctx, consumerId))) + require.Equal(t, providertypes.NewProviderConsAddress(allowlistedValidator), providerKeeper.GetAllowList(ctx, consumerId)[0]) denylistedValidator, err := sdk.ConsAddressFromBech32(expectedDenylistedValidator) require.NoError(t, err) - require.Equal(t, 1, len(providerKeeper.GetDenyList(ctx, chainID))) - require.Equal(t, providertypes.NewProviderConsAddress(denylistedValidator), providerKeeper.GetDenyList(ctx, chainID)[0]) + require.Equal(t, 1, len(providerKeeper.GetDenyList(ctx, consumerId))) + require.Equal(t, providertypes.NewProviderConsAddress(denylistedValidator), providerKeeper.GetDenyList(ctx, consumerId)[0]) - actualMinStake, _ := providerKeeper.GetMinStake(ctx, chainID) + actualMinStake, _ := providerKeeper.GetMinStake(ctx, consumerId) require.Equal(t, expectedMinStake, actualMinStake) - actualAllowInactiveValidators := providerKeeper.AllowsInactiveValidators(ctx, chainID) + actualAllowInactiveValidators := providerKeeper.AllowsInactiveValidators(ctx, consumerId) require.Equal(t, expectedAllowInactiveValidators, actualAllowInactiveValidators) } diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 8ce3e38a1f..eda61b8f03 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -121,6 +121,21 @@ func (k Keeper) DeleteConsumerIdToInitializationRecord(ctx sdk.Context, consumer } // GetConsumerIdToUpdateRecord returns the update record associated with this consumer id +func (k Keeper) GetConsumerIdToUpdateRecord(ctx sdk.Context, consumerId string) (types.ConsumerUpdateRecord, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ConsumerIdToUpdateRecordKey(consumerId)) + if bz == nil { + return types.ConsumerUpdateRecord{}, false + } + var record types.ConsumerUpdateRecord + if err := record.Unmarshal(bz); err != nil { + panic(fmt.Errorf("failed to unmarshal record: %w", err)) + } + return record, true +} + +// GetConsumerIdToUpdateRecordOrDefault returns the update record associated with this consumer id or the default record +// if there is no update record associated with this consumer id func (k Keeper) GetConsumerIdToUpdateRecordOrDefault(ctx sdk.Context, consumerId string, defaultRecord types.ConsumerUpdateRecord) types.ConsumerUpdateRecord { store := ctx.KVStore(k.storeKey) bz := store.Get(types.ConsumerIdToUpdateRecordKey(consumerId)) @@ -263,3 +278,69 @@ func (k Keeper) LaunchConsumer(ctx sdk.Context, consumerId string) error { ctx.EventManager().EmitEvents(ctx.EventManager().Events()) return nil } + +func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { + phase, found := k.GetConsumerIdToPhase(ctx, consumerId) + if !found || phase == Stopped { + return errorsmod.Wrapf(types.ErrInvalidPhase, + "cannot update stopped or not existing chain: %s", consumerId) + } + + updateRecord, found := k.GetConsumerIdToUpdateRecord(ctx, consumerId) + if !found { + // TODO (permissionless) -- not really an invalid update record + return errorsmod.Wrapf(types.ErrInvalidUpdateRecord, + "did not find update record for chain: %s", consumerId) + } + + k.SetTopN(ctx, consumerId, updateRecord.Top_N) + k.SetValidatorsPowerCap(ctx, consumerId, updateRecord.ValidatorsPowerCap) + k.SetValidatorSetCap(ctx, consumerId, updateRecord.ValidatorSetCap) + + k.DeleteAllowlist(ctx, consumerId) + for _, address := range updateRecord.Allowlist { + consAddr, err := sdk.ConsAddressFromBech32(address) + if err != nil { + continue + } + + k.SetAllowlist(ctx, consumerId, types.NewProviderConsAddress(consAddr)) + } + + k.DeleteDenylist(ctx, consumerId) + for _, address := range updateRecord.Denylist { + consAddr, err := sdk.ConsAddressFromBech32(address) + if err != nil { + continue + } + + k.SetDenylist(ctx, consumerId, types.NewProviderConsAddress(consAddr)) + } + + oldTopN, found := k.GetTopN(ctx, consumerId) + if !found { + oldTopN = 0 + k.Logger(ctx).Info("consumer chain top N not found, treating as 0", "consumerId", consumerId) + } + + // if the top N changes, we need to update the new minimum power in top N + if updateRecord.Top_N != oldTopN { + if updateRecord.Top_N > 0 { + // if the chain receives a non-zero top N value, store the minimum power in the top N + bondedValidators, err := k.GetLastBondedValidators(ctx) + if err != nil { + return err + } + minPower, err := k.ComputeMinPowerInTopN(ctx, bondedValidators, updateRecord.Top_N) + if err != nil { + return err + } + k.SetMinimumPowerInTopN(ctx, consumerId, minPower) + } else { + // if the chain receives a zero top N value, we delete the min power + k.DeleteMinimumPowerInTopN(ctx, consumerId) + } + } + + return nil +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 95135da0a4..a7926f352a 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -45,25 +45,6 @@ func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, proposal *typ return k.HandleLegacyConsumerRewardDenomProposal(ctx, &p) } -// HandleConsumerModificationProposal modifies a running consumer chain -func (k Keeper) HandleConsumerModificationProposal(ctx sdk.Context, proposal *types.MsgUpdateConsumer) error { - p := types.ConsumerModificationProposal{ - // TODO (PERMISSIONLESS) - //Title: proposal.UpdateRecord.Title, - //Description: proposal.UpdateRecord.Description, - ConsumerId: proposal.ConsumerId, - Top_N: proposal.UpdateRecord.Top_N, - ValidatorsPowerCap: proposal.UpdateRecord.ValidatorsPowerCap, - ValidatorSetCap: proposal.UpdateRecord.ValidatorSetCap, - Allowlist: proposal.UpdateRecord.Allowlist, - Denylist: proposal.UpdateRecord.Denylist, - MinStake: proposal.UpdateRecord.MinStake, - AllowInactiveVals: proposal.UpdateRecord.AllowInactiveVals, - } - - return k.HandleLegacyConsumerModificationProposal(ctx, &p) -} - // CreateConsumerClient will create the CCV client for the given consumer chain. The CCV channel must be built // on top of the CCV client to ensure connection with the right consumer chain. func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { @@ -206,6 +187,8 @@ func (k Keeper) StopConsumerChain(ctx sdk.Context, consumerId string, closeChan k.DeleteAllOptedIn(ctx, consumerId) k.DeleteConsumerValSet(ctx, consumerId) + // TODO (PERMISSIONLESS) add newly-added state to be deleted + k.Logger(ctx).Info("consumer chain removed from provider", "consumerId", consumerId) return nil diff --git a/x/ccv/provider/proposal_handler.go b/x/ccv/provider/proposal_handler.go index 4c7c8ece80..daae9699a6 100644 --- a/x/ccv/provider/proposal_handler.go +++ b/x/ccv/provider/proposal_handler.go @@ -21,8 +21,6 @@ func NewProviderProposalHandler(k keeper.Keeper) govv1beta1.Handler { return nil case *types.ConsumerRemovalProposal: return k.HandleLegacyConsumerRemovalProposal(ctx, c) - case *types.ConsumerModificationProposal: - return k.HandleLegacyConsumerModificationProposal(ctx, c) case *types.ChangeRewardDenomsProposal: return k.HandleLegacyConsumerRewardDenomProposal(ctx, c) default: diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index bb32d207de..d1ca068cd1 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -24,13 +24,12 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { (*govv1beta1.Content)(nil), &ConsumerRemovalProposal{}, ) - registry.RegisterImplementations( - (*govv1beta1.Content)(nil), - &ConsumerModificationProposal{}, - ) registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgAssignConsumerKey{}, + &MsgRegisterConsumer{}, + &MsgInitializeConsumer{}, + &MsgUpdateConsumer{}, &MsgRemoveConsumer{}, &MsgChangeRewardDenoms{}, &MsgUpdateParams{}, diff --git a/x/ccv/provider/types/legacy_proposal.go b/x/ccv/provider/types/legacy_proposal.go index 20b0522d69..47cfaa3728 100644 --- a/x/ccv/provider/types/legacy_proposal.go +++ b/x/ccv/provider/types/legacy_proposal.go @@ -29,7 +29,6 @@ const ( var ( _ govv1beta1.Content = &ConsumerAdditionProposal{} _ govv1beta1.Content = &ConsumerRemovalProposal{} - _ govv1beta1.Content = &ConsumerModificationProposal{} _ govv1beta1.Content = &ChangeRewardDenomsProposal{} _ govv1beta1.Content = &EquivocationProposal{} ) @@ -240,55 +239,6 @@ func (sccp *ConsumerRemovalProposal) ValidateBasic() error { return nil } -// NewConsumerModificationProposal creates a new consumer modification proposal. -func NewConsumerModificationProposal(title, description, chainID string, - topN uint32, - validatorsPowerCap uint32, - validatorSetCap uint32, - allowlist []string, - denylist []string, - minStake uint64, - allowInactiveVals bool, -) govv1beta1.Content { - return &ConsumerModificationProposal{ - Title: title, - Description: description, - ConsumerId: chainID, - Top_N: topN, - ValidatorsPowerCap: validatorsPowerCap, - ValidatorSetCap: validatorSetCap, - Allowlist: allowlist, - Denylist: denylist, - MinStake: minStake, - AllowInactiveVals: allowInactiveVals, - } -} - -// ProposalRoute returns the routing key of a consumer modification proposal. -func (cccp *ConsumerModificationProposal) ProposalRoute() string { return RouterKey } - -// ProposalType returns the type of the consumer modification proposal. -func (cccp *ConsumerModificationProposal) ProposalType() string { - return ProposalTypeConsumerModification -} - -// ValidateBasic runs basic stateless validity checks -func (cccp *ConsumerModificationProposal) ValidateBasic() error { - if err := govv1beta1.ValidateAbstract(cccp); err != nil { - return err - } - - if strings.TrimSpace(cccp.ConsumerId) == "" { - return errorsmod.Wrap(ErrInvalidUpdateRecord, "consumer chain id must not be blank") - } - - err := ValidatePSSFeatures(cccp.Top_N, cccp.ValidatorsPowerCap) - if err != nil { - return errorsmod.Wrapf(ErrInvalidUpdateRecord, "invalid PSS features: %s", err.Error()) - } - return nil -} - // NewEquivocationProposal creates a new equivocation proposal. // [DEPRECATED]: do not use because equivocations can be submitted // and verified automatically on the provider. diff --git a/x/ccv/provider/types/legacy_proposal_test.go b/x/ccv/provider/types/legacy_proposal_test.go index 02fdb5245e..77c4e977c8 100644 --- a/x/ccv/provider/types/legacy_proposal_test.go +++ b/x/ccv/provider/types/legacy_proposal_test.go @@ -544,80 +544,65 @@ func TestChangeRewardDenomsProposalValidateBasic(t *testing.T) { func TestConsumerModificationProposalValidateBasic(t *testing.T) { testCases := []struct { - name string - proposal govv1beta1.Content - expPass bool + name string + updateRecord types.ConsumerUpdateRecord + expPass bool }{ { "success", - types.NewConsumerModificationProposal("title", "description", "chainID", - 50, - 100, - 34, - []string{"addr1"}, - nil, - 0, - false, - ), + types.ConsumerUpdateRecord{ + Top_N: 50, + ValidatorsPowerCap: 100, + ValidatorSetCap: 34, + Allowlist: []string{"addr1"}, + Denylist: nil, + MinStake: 0, + AllowInactiveVals: false, + }, true, }, - { - "invalid chain id", - types.NewConsumerModificationProposal("title", "description", " ", - 0, - 0, - 0, - nil, - nil, - 0, - false, - ), - false, - }, { "top N is invalid", - types.NewConsumerModificationProposal("title", "description", "chainID", - 10, - 0, - 0, - nil, - nil, - 0, - false, - ), + types.ConsumerUpdateRecord{ + Top_N: 10, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: nil, + Denylist: nil, + }, false, }, { "validators power cap is invalid", - types.NewConsumerModificationProposal("title", "description", "chainID", - 50, - 101, - 0, - nil, - nil, - 0, - false, - ), + types.ConsumerUpdateRecord{ + Top_N: 50, + ValidatorsPowerCap: 101, + ValidatorSetCap: 0, + Allowlist: nil, + Denylist: nil, + MinStake: 0, + AllowInactiveVals: false, + }, false, }, { "valid proposal", - types.NewConsumerModificationProposal("title", "description", "chainID", - 0, - 34, - 101, - []string{"addr1"}, - []string{"addr2", "addr3"}, - 0, - false, - ), + types.ConsumerUpdateRecord{ + Top_N: 54, + ValidatorsPowerCap: 92, + ValidatorSetCap: 0, + Allowlist: []string{"addr1"}, + Denylist: []string{"addr2", "addr3"}, + MinStake: 0, + AllowInactiveVals: false, + }, true, }, } for _, tc := range testCases { - - err := tc.proposal.ValidateBasic() + msg, _ := types.NewMsgUpdateConsumer("", "0", tc.updateRecord) + err := msg.ValidateBasic() if tc.expPass { require.NoError(t, err, "valid case: %s should not return error. got %w", tc.name, err) } else { diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index dbb931731c..68861d86c6 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -345,7 +345,6 @@ func (msg MsgUpdateConsumer) ValidateBasic() error { } return nil - return nil } // Type implements the sdk.Msg interface. From 9c51962a39d4110d66be9bd8b5489aae1ce95094 Mon Sep 17 00:00:00 2001 From: insumity Date: Mon, 5 Aug 2024 18:13:35 +0300 Subject: [PATCH 20/41] removed (partially) consumer removal proposal --- x/ccv/provider/keeper/msg_server.go | 6 +- x/ccv/provider/keeper/permissionless.go | 77 +++++- x/ccv/provider/keeper/permissionless_test.go | 54 ++++ x/ccv/provider/keeper/proposal.go | 112 ++++---- x/ccv/provider/keeper/proposal_test.go | 263 ++++++++----------- x/ccv/provider/module.go | 5 +- x/ccv/provider/proposal_handler.go | 2 +- x/ccv/provider/types/keys.go | 18 +- x/ccv/provider/types/keys_test.go | 5 +- x/ccv/provider/types/msg.go | 1 + 10 files changed, 306 insertions(+), 237 deletions(-) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 8bcec5ae5b..ea8aa6ee01 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -97,10 +97,8 @@ func (k msgServer) RemoveConsumer( } ctx := sdk.UnwrapSDKContext(goCtx) - err := k.Keeper.HandleConsumerRemovalProposal(ctx, msg) - if err != nil { - return nil, errorsmod.Wrapf(err, "failed handling ConsumerAddition proposal") - } + + k.Keeper.SetConsumerIdToStopTime(ctx, msg.ConsumerId, msg.StopTime) return &types.MsgRemoveConsumerResponse{}, nil } diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index eda61b8f03..120bdc9a84 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -7,6 +7,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + "time" ) // ConsumerPhase captures the phases of a consumer chain according to `docs/docs/adrs/adr-018-permissionless-ics.md` @@ -198,7 +199,7 @@ func (k Keeper) GetConsumerIdToPhase(ctx sdk.Context, consumerId string) (Consum } // SetConsumerIdToPhase sets the phase associated with this consumer id -// TODO (PERMISSIONLESS): use this method when launching and when stopping a chian +// TODO (PERMISSIONLESS): use this method when launching and when stopping a chain func (k Keeper) SetConsumerIdToPhase(ctx sdk.Context, consumerId string, phase ConsumerPhase) { store := ctx.KVStore(k.storeKey) store.Set(types.ConsumerIdToPhaseKey(consumerId), []byte{byte(phase)}) @@ -210,6 +211,36 @@ func (k Keeper) DeleteConsumerIdToPhase(ctx sdk.Context, consumerId string) { store.Delete(types.ConsumerIdToPhaseKey(consumerId)) } +// GetConsumerIdToStopTime returns the stop time associated with the to-be-stopped chain with consumer id +func (k Keeper) GetConsumerIdToStopTime(ctx sdk.Context, consumerId string) (time.Time, bool) { + store := ctx.KVStore(k.storeKey) + buf := store.Get(types.ConsumerIdToStopTimeKey(consumerId)) + if buf == nil { + return time.Time{}, false + } + var time time.Time + if err := time.UnmarshalBinary(buf); err != nil { + panic(fmt.Errorf("failed to unmarshal time: %w", err)) + } + return time, true +} + +// SetConsumerIdToStopTime sets the stop time associated with this consumer id +func (k Keeper) SetConsumerIdToStopTime(ctx sdk.Context, consumerId string, stopTime time.Time) { + store := ctx.KVStore(k.storeKey) + buf, err := stopTime.MarshalBinary() + if err != nil { + panic(fmt.Errorf("failed to marshal time: %w", err)) + } + store.Set(types.ConsumerIdToStopTimeKey(consumerId), buf) +} + +// DeleteConsumerIdToStopTime deletes the stop time associated with this consumer id +func (k Keeper) DeleteConsumerIdToStopTime(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToStopTimeKey(consumerId)) +} + // GetClientIdToConsumerId returns the consumer id associated with this client id func (k Keeper) GetClientIdToConsumerId(ctx sdk.Context, clientId string) (string, bool) { store := ctx.KVStore(k.storeKey) @@ -242,16 +273,20 @@ func (k Keeper) GetInitializedConsumersReadyToLaunch(ctx sdk.Context) []string { var consumerIds []string for ; iterator.Valid(); iterator.Next() { + // the `consumerId` resides in the whole key, but we skip the first byte (because it's the `ConsumerIdKey`) + // plus 8 more bytes for the `uint64` in the key that contains the length of the `consumerId` + consumerId := string(iterator.Key()[1+8:]) + var record types.ConsumerInitializationRecord err := record.Unmarshal(iterator.Value()) if err != nil { - panic(fmt.Errorf("failed to unmarshal consumer record: %w for consumer id: %s", err, string(iterator.Value()))) + panic(fmt.Errorf("failed to unmarshal consumer record: %w for consumer id: %s", err, consumerId)) } - if !ctx.BlockTime().Before(record.SpawnTime) { - // the `consumerId` resides in the whole key, but we skip the first byte (because it's the `ConsumerIdKey`) - // plus 8 more bytes for the `uint64` in the key that contains the length of the `consumerId` - consumerIds = append(consumerIds, string(iterator.Key()[1+8:])) + // if current block time is equal to or after spawnTime, and the chain is initialized, we can launch the chain + phase, found := k.GetConsumerIdToPhase(ctx, consumerId) + if !ctx.BlockTime().Before(record.SpawnTime) && (found && phase == Initialized) { + consumerIds = append(consumerIds, consumerId) } } @@ -344,3 +379,33 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { return nil } + +// GetLaunchedConsumersReadyToStop returns the consumer ids of the pending launched consumer chains +// that are ready to stop +func (k Keeper) GetLaunchedConsumersReadyToStop(ctx sdk.Context) []string { + store := ctx.KVStore(k.storeKey) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToStopTimeKeyNamePrefix()) + defer iterator.Close() + + var consumerIds []string + + for ; iterator.Valid(); iterator.Next() { + // the `consumerId` resides in the whole key, but we skip the first byte (because it's the `ConsumerIdKey`) + // plus 8 more bytes for the `uint64` in the key that contains the length of the `consumerId` + consumerId := string(iterator.Key()[1+8:]) + + var stopTime time.Time + err := stopTime.UnmarshalBinary(iterator.Value()) + if err != nil { + panic(fmt.Errorf("failed to unmarshal stop stopTime: %w for consumer id: %s", err, consumerId)) + } + + // if current block time is equal to or after stop stopTime, and the chain is launched we can stop the chain + phase, found := k.GetConsumerIdToPhase(ctx, consumerId) + if !ctx.BlockTime().Before(stopTime) && (found && phase == Launched) { + consumerIds = append(consumerIds, string(iterator.Key()[1+8:])) + } + } + + return consumerIds +} diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index a45d3c6c65..4aaefe785b 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -187,6 +187,25 @@ func TestConsumerIdToPhase(t *testing.T) { require.Equal(t, keeper.Launched, phase) } +// TestConsumerIdToStopTime tests the getter, setter, and deletion methods of the consumer id to stop times +func TestConsumerIdToStopTime(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + _, found := providerKeeper.GetConsumerIdToStopTime(ctx, "consumerId") + require.False(t, found) + + expectedStopTime := time.Unix(1234, 56789) + providerKeeper.SetConsumerIdToStopTime(ctx, "consumerId", expectedStopTime) + actualStopTime, found := providerKeeper.GetConsumerIdToStopTime(ctx, "consumerId") + require.True(t, found) + require.Equal(t, actualStopTime, expectedStopTime) + + providerKeeper.DeleteConsumerIdToStopTime(ctx, "consumerId") + _, found = providerKeeper.GetConsumerIdToStopTime(ctx, "consumerId") + require.False(t, found) +} + // TestGetInitializedConsumersReadyToLaunch tests that the ready to-be-launched consumer chains are returned func TestGetInitializedConsumersReadyToLaunch(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) @@ -196,10 +215,13 @@ func TestGetInitializedConsumersReadyToLaunch(t *testing.T) { require.Empty(t, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) // set 3 initialization records with different spawn times + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId1", keeper.Initialized) providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId1", providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(10, 0)}) + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId2", keeper.Initialized) providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId2", providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(20, 0)}) + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId3", keeper.Initialized) providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId3", providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(30, 0)}) @@ -219,3 +241,35 @@ func TestGetInitializedConsumersReadyToLaunch(t *testing.T) { ctx = ctx.WithBlockTime(time.Unix(30, 0)) require.Equal(t, []string{"consumerId1", "consumerId2", "consumerId3"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) } + +func TestGetLaunchedConsumersReadyToStop(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + // no chains to-be-stopped exist + require.Empty(t, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + + // set 3 initialization records with different spawn times + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId1", keeper.Launched) + providerKeeper.SetConsumerIdToStopTime(ctx, "consumerId1", time.Unix(10, 0)) + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId2", keeper.Launched) + providerKeeper.SetConsumerIdToStopTime(ctx, "consumerId2", time.Unix(20, 0)) + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId3", keeper.Launched) + providerKeeper.SetConsumerIdToStopTime(ctx, "consumerId3", time.Unix(30, 0)) + + // time has not yet reached the stop time of "consumerId1" + ctx = ctx.WithBlockTime(time.Unix(9, 999999999)) + require.Empty(t, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + + // time has reached the stop time of "consumerId1" + ctx = ctx.WithBlockTime(time.Unix(10, 0)) + require.Equal(t, []string{"consumerId1"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + + // time has reached the stop time of "consumerId1" and "consumerId2" + ctx = ctx.WithBlockTime(time.Unix(20, 0)) + require.Equal(t, []string{"consumerId1", "consumerId2"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + + // time has reached the stop time of all chains + ctx = ctx.WithBlockTime(time.Unix(30, 0)) + require.Equal(t, []string{"consumerId1", "consumerId2", "consumerId3"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index a7926f352a..0d6c94977f 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -23,17 +23,6 @@ import ( ccv "github.com/cosmos/interchain-security/v5/x/ccv/types" ) -// Wrapper for the new proposal message MsgConsumerRemoval -// Will replace legacy handler HandleLegacyConsumerRemovalProposal -func (k Keeper) HandleConsumerRemovalProposal(ctx sdk.Context, proposal *types.MsgRemoveConsumer) error { - p := types.ConsumerRemovalProposal{ - ConsumerId: proposal.ConsumerId, - StopTime: proposal.StopTime, - } - - return k.HandleLegacyConsumerRemovalProposal(ctx, &p) -} - // Wrapper for the new proposal message MsgChangeRewardDenoms // Will replace legacy handler HandleLegacyConsumerRewardDenomProposal func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, proposal *types.MsgChangeRewardDenoms) error { @@ -457,73 +446,72 @@ func (k Keeper) DeletePendingConsumerRemovalProps(ctx sdk.Context, proposals ... } } -// BeginBlockCCR iterates over the pending consumer removal proposals -// in order and stop/removes the chain if the stop time has passed, -// otherwise it will break out of loop and return. Executed proposals are deleted. -// -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-bblock-ccr1 -// Spec tag: [CCV-PCF-BBLOCK-CCR.1] +// BeginBlockCCR iterates over the pending consumer proposals and stop/removes the chain if the stop time has passed func (k Keeper) BeginBlockCCR(ctx sdk.Context) { - propsToExecute := k.GetConsumerRemovalPropsToExecute(ctx) - - for _, prop := range propsToExecute { + for _, consumerId := range k.GetLaunchedConsumersReadyToStop(ctx) { // stop consumer chain in a cached context to handle errors - cachedCtx, writeFn, err := k.StopConsumerChainInCachedCtx(ctx, prop) + cachedCtx, writeFn := ctx.CacheContext() + + stopTime, found := k.GetConsumerIdToStopTime(ctx, consumerId) + if !found { + ctx.Logger().Info("this chain (%s) is not meant to be stopped", consumerId) + continue + } + + err := k.StopConsumerChain(cachedCtx, consumerId, true) if err != nil { - // drop the proposal ctx.Logger().Info("consumer chain could not be stopped: %w", err) continue } // The cached context is created with a new EventManager so we merge the event // into the original context + // TODO (PERMISSIONLESS): verify this here and in the initialized chains to launch ctx.EventManager().EmitEvents(cachedCtx.EventManager().Events()) - // write cache + + k.SetConsumerIdToPhase(cachedCtx, consumerId, Stopped) writeFn() - k.Logger(ctx).Info("executed consumer removal proposal", - "consumer id", prop.ConsumerId, - "title", prop.Title, - "stop time", prop.StopTime.UTC(), + k.Logger(ctx).Info("executed consumer removal", + "consumer id", consumerId, + "stop time", stopTime, ) } - // delete the executed proposals - k.DeletePendingConsumerRemovalProps(ctx, propsToExecute...) } -// GetConsumerRemovalPropsToExecute iterates over the pending consumer removal proposals -// and returns an ordered list of consumer removal proposals to be executed, -// ie. consumer chains to be stopped and removed from the provider chain. -// A prop is included in the returned list if its proposed stop time has passed. +//// GetConsumerRemovalPropsToExecute iterates over the pending consumer removal proposals +//// and returns an ordered list of consumer removal proposals to be executed, +//// ie. consumer chains to be stopped and removed from the provider chain. +//// A prop is included in the returned list if its proposed stop time has passed. +//// +//// Note: this method is split out from BeginBlockCCR to be easily unit tested. +//func (k Keeper) GetConsumerRemovalPropsToExecute(ctx sdk.Context) []types.ConsumerRemovalProposal { +// // store the (to be) executed consumer removal proposals in order +// propsToExecute := []types.ConsumerRemovalProposal{} // -// Note: this method is split out from BeginBlockCCR to be easily unit tested. -func (k Keeper) GetConsumerRemovalPropsToExecute(ctx sdk.Context) []types.ConsumerRemovalProposal { - // store the (to be) executed consumer removal proposals in order - propsToExecute := []types.ConsumerRemovalProposal{} - - store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.PendingCRPKeyPrefix()) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var prop types.ConsumerRemovalProposal - err := prop.Unmarshal(iterator.Value()) - if err != nil { - // An error here would indicate something is very wrong, - // the ConsumerRemovalProposal is assumed to be correctly serialized in SetPendingConsumerRemovalProp. - panic(fmt.Errorf("failed to unmarshal consumer removal proposal: %w", err)) - } - - // If current block time is equal to or after stop time, proposal is ready to be executed - if !ctx.BlockTime().Before(prop.StopTime) { - propsToExecute = append(propsToExecute, prop) - } else { - // No more proposals to check, since they're stored/ordered by timestamp. - break - } - } - - return propsToExecute -} +// store := ctx.KVStore(k.storeKey) +// iterator := storetypes.KVStorePrefixIterator(store, types.PendingCRPKeyPrefix()) +// defer iterator.Close() +// +// for ; iterator.Valid(); iterator.Next() { +// var prop types.ConsumerRemovalProposal +// err := prop.Unmarshal(iterator.Value()) +// if err != nil { +// // An error here would indicate something is very wrong, +// // the ConsumerRemovalProposal is assumed to be correctly serialized in SetPendingConsumerRemovalProp. +// panic(fmt.Errorf("failed to unmarshal consumer removal proposal: %w", err)) +// } +// +// // If current block time is equal to or after stop time, proposal is ready to be executed +// if !ctx.BlockTime().Before(prop.StopTime) { +// propsToExecute = append(propsToExecute, prop) +// } else { +// // No more proposals to check, since they're stored/ordered by timestamp. +// break +// } +// } +// +// return propsToExecute +//} // GetAllPendingConsumerRemovalProps iterates through the pending consumer removal proposals. // diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index d8fa36787b..65c1ca4738 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -333,120 +333,80 @@ func TestStopConsumerChain(t *testing.T) { } } -// TestPendingConsumerRemovalPropDeletion tests the getting/setting -// and deletion methods for pending consumer removal props -func TestPendingConsumerRemovalPropDeletion(t *testing.T) { - testCases := []struct { - providertypes.ConsumerRemovalProposal - ExpDeleted bool - }{ - { - ConsumerRemovalProposal: providertypes.ConsumerRemovalProposal{ConsumerId: "8", StopTime: time.Now().UTC()}, - ExpDeleted: true, - }, - { - ConsumerRemovalProposal: providertypes.ConsumerRemovalProposal{ConsumerId: "9", StopTime: time.Now().UTC().Add(time.Hour)}, - ExpDeleted: false, - }, - } - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - for _, tc := range testCases { - tc := tc - providerKeeper.SetPendingConsumerRemovalProp(ctx, &tc.ConsumerRemovalProposal) - } - - ctx = ctx.WithBlockTime(time.Now().UTC()) - - propsToExecute := providerKeeper.GetConsumerRemovalPropsToExecute(ctx) - // Delete consumer removal proposals, same as what would be done by BeginBlockCCR - providerKeeper.DeletePendingConsumerRemovalProps(ctx, propsToExecute...) - numDeleted := 0 - for _, tc := range testCases { - res := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.ConsumerId, tc.StopTime) - if !tc.ExpDeleted { - require.NotEmpty(t, res, "consumer removal prop was deleted: %s %s", tc.ConsumerId, tc.StopTime.String()) - continue - } - require.Empty(t, res, "consumer removal prop was not deleted %s %s", tc.ConsumerId, tc.StopTime.String()) - require.Equal(t, propsToExecute[numDeleted].ConsumerId, tc.ConsumerId) - numDeleted += 1 - } -} - +// TODO (PERMISSIONLESS) +// WE DO NOT go by order in permissionless (?) DO WE need to? // TestGetConsumerRemovalPropsToExecute tests that pending consumer removal proposals // that are ready to execute are accessed in order by timestamp via the iterator -func TestGetConsumerRemovalPropsToExecute(t *testing.T) { - now := time.Now().UTC() - sampleProp1 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-2", StopTime: now} - sampleProp2 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-1", StopTime: now.Add(time.Hour)} - sampleProp3 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-4", StopTime: now.Add(-time.Hour)} - sampleProp4 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-3", StopTime: now} - sampleProp5 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-1", StopTime: now.Add(2 * time.Hour)} - - getExpectedOrder := func(props []providertypes.ConsumerRemovalProposal, accessTime time.Time) []providertypes.ConsumerRemovalProposal { - expectedOrder := []providertypes.ConsumerRemovalProposal{} - for _, prop := range props { - if !accessTime.Before(prop.StopTime) { - expectedOrder = append(expectedOrder, prop) - } - } - // sorting by SpawnTime.UnixNano() - sort.Slice(expectedOrder, func(i, j int) bool { - if expectedOrder[i].StopTime.UTC() == expectedOrder[j].StopTime.UTC() { - // proposals with same StopTime - return expectedOrder[i].ConsumerId < expectedOrder[j].ConsumerId - } - return expectedOrder[i].StopTime.UTC().Before(expectedOrder[j].StopTime.UTC()) - }) - return expectedOrder - } - - testCases := []struct { - propSubmitOrder []providertypes.ConsumerRemovalProposal - accessTime time.Time - }{ - { - propSubmitOrder: []providertypes.ConsumerRemovalProposal{ - sampleProp1, sampleProp2, sampleProp3, sampleProp4, sampleProp5, - }, - accessTime: now, - }, - { - propSubmitOrder: []providertypes.ConsumerRemovalProposal{ - sampleProp3, sampleProp2, sampleProp1, sampleProp5, sampleProp4, - }, - accessTime: now.Add(time.Hour), - }, - { - propSubmitOrder: []providertypes.ConsumerRemovalProposal{ - sampleProp5, sampleProp4, sampleProp3, sampleProp2, sampleProp1, - }, - accessTime: now.Add(-2 * time.Hour), - }, - { - propSubmitOrder: []providertypes.ConsumerRemovalProposal{ - sampleProp5, sampleProp4, sampleProp3, sampleProp2, sampleProp1, - }, - accessTime: now.Add(3 * time.Hour), - }, - } - - for _, tc := range testCases { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - expectedOrderedProps := getExpectedOrder(tc.propSubmitOrder, tc.accessTime) - - for _, prop := range tc.propSubmitOrder { - cpProp := prop - providerKeeper.SetPendingConsumerRemovalProp(ctx, &cpProp) - } - propsToExecute := providerKeeper.GetConsumerRemovalPropsToExecute(ctx.WithBlockTime(tc.accessTime)) - require.Equal(t, expectedOrderedProps, propsToExecute) - } -} +//func TestGetConsumerRemovalPropsToExecute(t *testing.T) { +// now := time.Now().UTC() +// sampleProp1 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-2", StopTime: now} +// sampleProp2 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-1", StopTime: now.Add(time.Hour)} +// sampleProp3 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-4", StopTime: now.Add(-time.Hour)} +// sampleProp4 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-3", StopTime: now} +// sampleProp5 := providertypes.ConsumerRemovalProposal{ConsumerId: "chain-1", StopTime: now.Add(2 * time.Hour)} +// +// getExpectedOrder := func(props []providertypes.ConsumerRemovalProposal, accessTime time.Time) []providertypes.ConsumerRemovalProposal { +// expectedOrder := []providertypes.ConsumerRemovalProposal{} +// for _, prop := range props { +// if !accessTime.Before(prop.StopTime) { +// expectedOrder = append(expectedOrder, prop) +// } +// } +// // sorting by SpawnTime.UnixNano() +// sort.Slice(expectedOrder, func(i, j int) bool { +// if expectedOrder[i].StopTime.UTC() == expectedOrder[j].StopTime.UTC() { +// // proposals with same StopTime +// return expectedOrder[i].ConsumerId < expectedOrder[j].ConsumerId +// } +// return expectedOrder[i].StopTime.UTC().Before(expectedOrder[j].StopTime.UTC()) +// }) +// return expectedOrder +// } +// +// testCases := []struct { +// propSubmitOrder []providertypes.ConsumerRemovalProposal +// accessTime time.Time +// }{ +// { +// propSubmitOrder: []providertypes.ConsumerRemovalProposal{ +// sampleProp1, sampleProp2, sampleProp3, sampleProp4, sampleProp5, +// }, +// accessTime: now, +// }, +// { +// propSubmitOrder: []providertypes.ConsumerRemovalProposal{ +// sampleProp3, sampleProp2, sampleProp1, sampleProp5, sampleProp4, +// }, +// accessTime: now.Add(time.Hour), +// }, +// { +// propSubmitOrder: []providertypes.ConsumerRemovalProposal{ +// sampleProp5, sampleProp4, sampleProp3, sampleProp2, sampleProp1, +// }, +// accessTime: now.Add(-2 * time.Hour), +// }, +// { +// propSubmitOrder: []providertypes.ConsumerRemovalProposal{ +// sampleProp5, sampleProp4, sampleProp3, sampleProp2, sampleProp1, +// }, +// accessTime: now.Add(3 * time.Hour), +// }, +// } +// +// for _, tc := range testCases { +// providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) +// defer ctrl.Finish() +// +// expectedOrderedProps := getExpectedOrder(tc.propSubmitOrder, tc.accessTime) +// +// for _, prop := range tc.propSubmitOrder { +// cpProp := prop +// providerKeeper.SetPendingConsumerRemovalProp(ctx, &cpProp) +// } +// propsToExecute := providerKeeper.GetConsumerRemovalPropsToExecute(ctx.WithBlockTime(tc.accessTime)) +// require.Equal(t, expectedOrderedProps, propsToExecute) +// } +//} // Test getting both matured and pending consumer removal proposals func TestGetAllConsumerRemovalProps(t *testing.T) { @@ -897,10 +857,6 @@ func TestBeginBlockInit(t *testing.T) { require.False(t, found) } -// TestBeginBlockCCR tests BeginBlockCCR against the spec. -// -// See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-bblock-ccr1 -// Spec tag: [CCV-PCF-BBLOCK-CCR.1] func TestBeginBlockCCR(t *testing.T) { now := time.Now().UTC() @@ -910,28 +866,23 @@ func TestBeginBlockCCR(t *testing.T) { defer ctrl.Finish() ctx = ctx.WithBlockTime(now) - pendingProps := []*providertypes.ConsumerRemovalProposal{ - providertypes.NewConsumerRemovalProposal( - "title", "description", "chain1", now.Add(-time.Hour).UTC(), - ).(*providertypes.ConsumerRemovalProposal), - providertypes.NewConsumerRemovalProposal( - "title", "description", "chain2", now, - ).(*providertypes.ConsumerRemovalProposal), - providertypes.NewConsumerRemovalProposal( - "title", "description", "chain3", now.Add(time.Hour).UTC(), - ).(*providertypes.ConsumerRemovalProposal), - } + chainIds := []string{"chain1", "chain2", "chain3"} + consumerIds := []string{"consumerId1", "consumerId2", "consumerId3"} + providerKeeper.SetConsumerIdToStopTime(ctx, consumerIds[0], now.Add(-time.Hour)) + providerKeeper.SetConsumerIdToStopTime(ctx, consumerIds[1], now) + providerKeeper.SetConsumerIdToStopTime(ctx, consumerIds[2], now.Add(time.Hour)) // // Mock expectations // expectations := []*gomock.Call{} - for _, prop := range pendingProps { - // A consumer chain is setup corresponding to each prop, making these mocks necessary - testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, 1) + for i, _ := range consumerIds { + chainId := chainIds[i] + // A consumer chain is setup corresponding to each consumerId, making these mocks necessary + testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, []int64{}, 1) expectations = append(expectations, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, - prop.ConsumerId, clienttypes.NewHeight(2, 3))...) - expectations = append(expectations, testkeeper.GetMocksForSetConsumerChain(ctx, &mocks, prop.ConsumerId)...) + chainId, clienttypes.NewHeight(2, 3))...) + expectations = append(expectations, testkeeper.GetMocksForSetConsumerChain(ctx, &mocks, chainId)...) } // Only first two consumer chains should be stopped expectations = append(expectations, testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) @@ -942,34 +893,28 @@ func TestBeginBlockCCR(t *testing.T) { // // Remaining setup // - for _, prop := range pendingProps { - // Setup a valid consumer chain for each prop + for i, consumerId := range consumerIds { + // Setup a valid consumer chain for each consumerId initializationRecord := testkeeper.GetTestInitializationRecord() initializationRecord.InitialHeight = clienttypes.NewHeight(2, 3) registrationRecord := testkeeper.GetTestRegistrationRecord() - registrationRecord.ChainId = prop.ConsumerId + registrationRecord.ChainId = chainIds[i] - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, prop.ConsumerId, registrationRecord) - providerKeeper.SetConsumerIdToInitializationRecord(ctx, prop.ConsumerId, initializationRecord) - providerKeeper.SetConsumerIdToUpdateRecord(ctx, prop.ConsumerId, testkeeper.GetTestUpdateRecord()) - providerKeeper.SetConsumerIdToPhase(ctx, prop.ConsumerId, providerkeeper.Initialized) - providerKeeper.SetClientIdToConsumerId(ctx, "clientID", prop.ConsumerId) + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, registrationRecord) + providerKeeper.SetConsumerIdToInitializationRecord(ctx, consumerId, initializationRecord) + providerKeeper.SetConsumerIdToUpdateRecord(ctx, consumerId, testkeeper.GetTestUpdateRecord()) + providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Initialized) + providerKeeper.SetClientIdToConsumerId(ctx, "clientID", consumerId) - err := providerKeeper.CreateConsumerClient(ctx, prop.ConsumerId) + err := providerKeeper.CreateConsumerClient(ctx, consumerId) require.NoError(t, err) err = providerKeeper.SetConsumerChain(ctx, "channelID") require.NoError(t, err) - // Set removal props for all consumer chains - providerKeeper.SetPendingConsumerRemovalProp(ctx, prop) + // after we have created the consumer client, the chain is considered launched and hence we could later stop the chain + providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Launched) } - // Add an invalid prop to the store with an non-existing chain id - invalidProp := providertypes.NewConsumerRemovalProposal( - "title", "description", "chain4", now.Add(-time.Hour).UTC(), - ).(*providertypes.ConsumerRemovalProposal) - providerKeeper.SetPendingConsumerRemovalProp(ctx, invalidProp) - // // Test execution // @@ -977,16 +922,14 @@ func TestBeginBlockCCR(t *testing.T) { providerKeeper.BeginBlockCCR(ctx) // Only the 3rd (final) proposal is still stored as pending - found := providerKeeper.PendingConsumerRemovalPropExists( - ctx, pendingProps[0].ConsumerId, pendingProps[0].StopTime) - require.False(t, found) - found = providerKeeper.PendingConsumerRemovalPropExists( - ctx, pendingProps[1].ConsumerId, pendingProps[1].StopTime) - require.False(t, found) - found = providerKeeper.PendingConsumerRemovalPropExists( - ctx, pendingProps[2].ConsumerId, pendingProps[2].StopTime) + phase, found := providerKeeper.GetConsumerIdToPhase(ctx, consumerIds[0]) require.True(t, found) - found = providerKeeper.PendingConsumerRemovalPropExists( - ctx, invalidProp.ConsumerId, invalidProp.StopTime) - require.False(t, found) + require.Equal(t, providerkeeper.Stopped, phase) + phase, found = providerKeeper.GetConsumerIdToPhase(ctx, consumerIds[1]) + require.True(t, found) + require.Equal(t, providerkeeper.Stopped, phase) + // third chain had a stopTime in the future and hence did not stop + phase, found = providerKeeper.GetConsumerIdToPhase(ctx, consumerIds[2]) + require.True(t, found) + require.Equal(t, providerkeeper.Launched, phase) } diff --git a/x/ccv/provider/module.go b/x/ccv/provider/module.go index 320a135a69..65ced5f37e 100644 --- a/x/ccv/provider/module.go +++ b/x/ccv/provider/module.go @@ -171,10 +171,11 @@ func (AppModule) ConsensusVersion() uint64 { return 8 } // BeginBlock implements the AppModule interface func (am AppModule) BeginBlock(ctx context.Context) error { - sdkCtx := sdk.UnwrapSDKContext(ctx) // Create clients to consumer chains that are due to be spawned via pending consumer addition proposals + sdkCtx := sdk.UnwrapSDKContext(ctx) + // Create clients to consumer chains that are due to be spawned am.keeper.BeginBlockInit(sdkCtx) - // Stop and remove state for any consumer chains that are due to be stopped via pending consumer removal proposals + // Stop and remove state for any consumer chains that are due to be stopped am.keeper.BeginBlockCCR(sdkCtx) // Check for replenishing slash meter before any slash packets are processed for this block am.keeper.BeginBlockCIS(sdkCtx) diff --git a/x/ccv/provider/proposal_handler.go b/x/ccv/provider/proposal_handler.go index daae9699a6..01d92d3e9e 100644 --- a/x/ccv/provider/proposal_handler.go +++ b/x/ccv/provider/proposal_handler.go @@ -20,7 +20,7 @@ func NewProviderProposalHandler(k keeper.Keeper) govv1beta1.Handler { case *types.ConsumerAdditionProposal: return nil case *types.ConsumerRemovalProposal: - return k.HandleLegacyConsumerRemovalProposal(ctx, c) + return nil case *types.ChangeRewardDenomsProposal: return k.HandleLegacyConsumerRewardDenomProposal(ctx, c) default: diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 61086bd5a2..0564b7416b 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -141,6 +141,8 @@ const ( ConsumerIdToPhaseKeyName = "ConsumerIdToPhaseKey" + ConsumerIdToStopTimeKeyName = "ConsumerIdToStopTimeKey" + ClientIdToConsumerIdKeyName = "ClientIdToConsumerIdKey" ) @@ -353,8 +355,11 @@ func getKeyPrefixes() map[string]byte { // ConsumerIdToPhaseKeyName is the key for storing the phase of a consumer chain with the given consumer id ConsumerIdToPhaseKeyName: 50, + // ConsumerIdToStopTimeKeyName is the key for storing the stop time of a consumer chain that is to be removed + ConsumerIdToStopTimeKeyName: 51, + // ClientIdToConsumerIdKeyName is the key for storing the consumer id for the given client id - ClientIdToConsumerIdKeyName: 51, + ClientIdToConsumerIdKeyName: 52, // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO TestPreserveBytePrefix() IN keys_test.go } @@ -775,6 +780,17 @@ func ConsumerIdToPhaseKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToPhaseKeyName), consumerId) } +// ConsumerIdToStopTimeKey returns the key used to store the stop time that corresponds to a to-be-stopped chain with consumer id +func ConsumerIdToStopTimeKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToStopTimeKeyName), consumerId) +} + +// ConsumerIdToStopTimeKeyNamePrefix returns the key prefix for storing the stop times of consumer chains +// that are about to be stopped +func ConsumerIdToStopTimeKeyNamePrefix() []byte { + return []byte{mustGetKeyPrefix(ConsumerIdToStopTimeKeyName)} +} + // ClientIdToConsumerIdKey returns the consumer id that corresponds to this client id func ClientIdToConsumerIdKey(clientId string) []byte { clientIdLength := len(clientId) diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index d7310d4232..7c79c507f7 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -132,7 +132,9 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, uint8(50), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) i++ - require.Equal(t, uint8(51), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, uint8(52), providertypes.ConsumerIdToStopTimeKey("consumerId")[0]) + i++ + require.Equal(t, uint8(53), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() @@ -207,6 +209,7 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.ConsumerIdToUpdateRecordKey("consumerId"), providertypes.ConsumerIdToOwnerAddressKey("consumerId"), providertypes.ConsumerIdToPhaseKey("consumerId"), + providertypes.ConsumerIdToStopTimeKey("consumerId"), providertypes.ClientIdToConsumerIdKey("clientId"), } } diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 68861d86c6..68479ab899 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -51,6 +51,7 @@ var ( _ sdk.HasValidateBasic = (*MsgChangeRewardDenoms)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerMisbehaviour)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerDoubleVoting)(nil) + // TODO (PERMISSIONLESS) add extensive checks, etc. _ sdk.HasValidateBasic = (*MsgRegisterConsumer)(nil) _ sdk.HasValidateBasic = (*MsgInitializeConsumer)(nil) _ sdk.HasValidateBasic = (*MsgUpdateConsumer)(nil) From cfa8a1a3a803bcfdf022e13687547e0e8b7ae9d8 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 6 Aug 2024 13:24:31 +0300 Subject: [PATCH 21/41] rebased to pick up the inactive-validators work (PR #2079) --- x/ccv/provider/keeper/legacy_proposal_test.go | 2 ++ x/ccv/provider/keeper/permissionless.go | 3 +++ x/ccv/provider/keeper/validator_set_update.go | 2 +- x/ccv/provider/types/keys_test.go | 10 ++++++---- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/x/ccv/provider/keeper/legacy_proposal_test.go b/x/ccv/provider/keeper/legacy_proposal_test.go index c5bb596681..346be55d07 100644 --- a/x/ccv/provider/keeper/legacy_proposal_test.go +++ b/x/ccv/provider/keeper/legacy_proposal_test.go @@ -182,6 +182,8 @@ func TestUpdateConsumer(t *testing.T) { ValidatorSetCap: expectedValidatorSetCap, Allowlist: []string{expectedAllowlistedValidator}, Denylist: []string{expectedDenylistedValidator}, + MinStake: expectedMinStake, + AllowInactiveVals: expectedAllowInactiveValidators, } providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Initialized) diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 120bdc9a84..b106183308 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -377,6 +377,9 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { } } + k.SetMinStake(ctx, consumerId, updateRecord.MinStake) + k.SetInactiveValidatorsAllowed(ctx, consumerId, updateRecord.AllowInactiveVals) + return nil } diff --git a/x/ccv/provider/keeper/validator_set_update.go b/x/ccv/provider/keeper/validator_set_update.go index 1c55f26553..b4ed48f4e1 100644 --- a/x/ccv/provider/keeper/validator_set_update.go +++ b/x/ccv/provider/keeper/validator_set_update.go @@ -14,7 +14,7 @@ import ( // GetConsumerChainConsensusValidatorsKey returns the store key for consumer validators of the consumer chain with `chainID` func (k Keeper) GetConsumerChainConsensusValidatorsKey(ctx sdk.Context, chainID string) []byte { - return types.ChainIdWithLenKey(types.ConsumerValidatorKeyPrefix(), chainID) + return types.ConsumerIdWithLenKey(types.ConsumerValidatorKeyPrefix(), chainID) } // SetConsumerValidator sets provided consumer `validator` on the consumer chain with `chainID` diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 7c79c507f7..e0a4da3b49 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -124,17 +124,19 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, uint8(45), providertypes.ConsumerIdKey()[0]) i++ - require.Equal(t, uint8(47), providertypes.ConsumerIdToRegistrationRecordKey("consumerId")[0]) + require.Equal(t, uint8(46), providertypes.ConsumerIdToRegistrationRecordKey("consumerId")[0]) i++ - require.Equal(t, uint8(48), providertypes.ConsumerIdToInitializationRecordKey("consumerId")[0]) + require.Equal(t, uint8(47), providertypes.ConsumerIdToInitializationRecordKey("consumerId")[0]) + i++ + require.Equal(t, uint8(48), providertypes.ConsumerIdToUpdateRecordKey("consumerId")[0]) i++ require.Equal(t, uint8(49), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) i++ require.Equal(t, uint8(50), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) i++ - require.Equal(t, uint8(52), providertypes.ConsumerIdToStopTimeKey("consumerId")[0]) + require.Equal(t, uint8(51), providertypes.ConsumerIdToStopTimeKey("consumerId")[0]) i++ - require.Equal(t, uint8(53), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, uint8(52), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() From 5de11fddae9d9d5e08e82c4e9685b5c1acf1c5f7 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 6 Aug 2024 16:27:32 +0300 Subject: [PATCH 22/41] introduced consumerId in the equivocation messages (and a useful query for Hermes to get the consumerId) --- .../ccv/provider/v1/query.proto | 19 + .../ccv/provider/v1/tx.proto | 10 +- .../provider/keeper/consumer_equivocation.go | 54 +- x/ccv/provider/keeper/grpc_query.go | 12 + x/ccv/provider/keeper/grpc_query_test.go | 16 + x/ccv/provider/keeper/msg_server.go | 8 +- x/ccv/provider/types/query.pb.go | 641 ++++++++++++++---- x/ccv/provider/types/query.pb.gw.go | 101 +++ x/ccv/provider/types/tx.pb.go | 335 +++++---- 9 files changed, 923 insertions(+), 273 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 0996d2a858..1f45a8144c 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -144,6 +144,14 @@ service Query { option (google.api.http).get = "/interchain_security/ccv/provider/blocks_until_next_epoch"; } + + // QueryConsumerIdFromClientId returns the consumer id of the chain + // associated with the provided client id + rpc QueryConsumerIdFromClientId(QueryConsumerIdFromClientIdRequest) + returns (QueryConsumerIdFromClientIdResponse) { + option (google.api.http).get = + "/interchain_security/ccv/provider/consumer_id/{client_id}"; + } } message QueryConsumerGenesisRequest { string consumer_id = 1; } @@ -332,3 +340,14 @@ message QueryBlocksUntilNextEpochResponse { // The number of blocks until the next epoch starts uint64 blocks_until_next_epoch = 1; } + +message QueryConsumerIdFromClientIdRequest { + // the client id (on the provider) that is tracking the consumer chain + // the client id can be found from the consumer chain by querying (i.e., `query ccvconsumer provider-info`) + string client_id = 1; +} + +message QueryConsumerIdFromClientIdResponse { + // the consumer id of the chain associated with this client id + string consumer_id = 1; +} diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 9a683cbf4c..acee16bc7a 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -64,9 +64,11 @@ message MsgSubmitConsumerMisbehaviour { option (gogoproto.goproto_getters) = false; string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // the consumer id of the consumer chain where the misbehaviour occurred + string consumer_id = 2; // The Misbehaviour of the consumer chain wrapping // two conflicting IBC headers - ibc.lightclients.tendermint.v1.Misbehaviour misbehaviour = 2; + ibc.lightclients.tendermint.v1.Misbehaviour misbehaviour = 3; } message MsgSubmitConsumerMisbehaviourResponse {} @@ -80,11 +82,13 @@ message MsgSubmitConsumerDoubleVoting { option (gogoproto.goproto_getters) = false; string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // the consumer id of the consumer chain where the double-voting took place + string consumer_id = 2; // The equivocation of the consumer chain wrapping // an evidence of a validator that signed two conflicting votes - tendermint.types.DuplicateVoteEvidence duplicate_vote_evidence = 2; + tendermint.types.DuplicateVoteEvidence duplicate_vote_evidence = 3; // The light client header of the infraction block - ibc.lightclients.tendermint.v1.Header infraction_block_header = 3; + ibc.lightclients.tendermint.v1.Header infraction_block_header = 4; } message MsgSubmitConsumerDoubleVotingResponse {} diff --git a/x/ccv/provider/keeper/consumer_equivocation.go b/x/ccv/provider/keeper/consumer_equivocation.go index 3762cbf072..1f058cfe27 100644 --- a/x/ccv/provider/keeper/consumer_equivocation.go +++ b/x/ccv/provider/keeper/consumer_equivocation.go @@ -32,8 +32,8 @@ import ( // and a public key and, if successful, executes the slashing, jailing, and tombstoning of the malicious validator. func (k Keeper) HandleConsumerDoubleVoting( ctx sdk.Context, - evidence *tmtypes.DuplicateVoteEvidence, consumerId string, + evidence *tmtypes.DuplicateVoteEvidence, pubkey cryptotypes.PubKey, ) error { // check that the evidence is for an ICS consumer chain @@ -57,8 +57,18 @@ func (k Keeper) HandleConsumerDoubleVoting( ) } + // get the chainId of this consumer chain to verify the double-voting evidence + chainId, found := k.GetConsumerIdToRegistrationRecord(ctx, consumerId) + if !found { + return errorsmod.Wrapf( + ccvtypes.ErrInvalidDoubleVotingEvidence, + "could not find the chain id of the consumer chain with consuemr id: %s", + consumerId, + ) + } + // verifies the double voting evidence using the consumer chain public key - if err := k.VerifyDoubleVotingEvidence(*evidence, consumerId, pubkey); err != nil { + if err := k.VerifyDoubleVotingEvidence(*evidence, chainId.ChainId, pubkey); err != nil { return err } @@ -85,10 +95,10 @@ func (k Keeper) HandleConsumerDoubleVoting( } // VerifyDoubleVotingEvidence verifies a double voting evidence -// for a given consumer id and a validator public key +// for a given chain id and a validator public key func (k Keeper) VerifyDoubleVotingEvidence( evidence tmtypes.DuplicateVoteEvidence, - consumerId string, + chainId string, pubkey cryptotypes.PubKey, ) error { if pubkey == nil { @@ -140,10 +150,10 @@ func (k Keeper) VerifyDoubleVotingEvidence( vb := evidence.VoteB.ToProto() // signatures must be valid - if !pubkey.VerifySignature(tmtypes.VoteSignBytes(consumerId, va), evidence.VoteA.Signature) { + if !pubkey.VerifySignature(tmtypes.VoteSignBytes(chainId, va), evidence.VoteA.Signature) { return fmt.Errorf("verifying VoteA: %w", tmtypes.ErrVoteInvalidSignature) } - if !pubkey.VerifySignature(tmtypes.VoteSignBytes(consumerId, vb), evidence.VoteB.Signature) { + if !pubkey.VerifySignature(tmtypes.VoteSignBytes(chainId, vb), evidence.VoteB.Signature) { return fmt.Errorf("verifying VoteB: %w", tmtypes.ErrVoteInvalidSignature) } @@ -156,11 +166,11 @@ func (k Keeper) VerifyDoubleVotingEvidence( // HandleConsumerMisbehaviour checks if the given IBC misbehaviour corresponds to an equivocation light client attack, // and in this case, slashes, jails, and tombstones -func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, misbehaviour ibctmtypes.Misbehaviour) error { +func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { logger := k.Logger(ctx) // Check that the misbehaviour is valid and that the client consensus states at trusted heights are within trusting period - if err := k.CheckMisbehaviour(ctx, misbehaviour); err != nil { + if err := k.CheckMisbehaviour(ctx, consumerId, misbehaviour); err != nil { logger.Info("Misbehaviour rejected", err.Error()) return err @@ -182,7 +192,7 @@ func (k Keeper) HandleConsumerMisbehaviour(ctx sdk.Context, misbehaviour ibctmty for _, v := range byzantineValidators { providerAddr := k.GetProviderAddrFromConsumerAddr( ctx, - misbehaviour.Header1.Header.ChainID, + consumerId, types.NewConsumerConsAddress(sdk.ConsAddress(v.Address.Bytes())), ) err := k.SlashValidator(ctx, providerAddr) @@ -292,16 +302,26 @@ func headerToLightBlock(h ibctmtypes.Header) (*tmtypes.LightBlock, error) { // CheckMisbehaviour checks that headers in the given misbehaviour forms // a valid light client attack from an ICS consumer chain and that the light client isn't expired -func (k Keeper) CheckMisbehaviour(ctx sdk.Context, misbehaviour ibctmtypes.Misbehaviour) error { - consumerChainID := misbehaviour.Header1.Header.ChainID +func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { + chainId := misbehaviour.Header1.Header.ChainID + + registrationRecord, found := k.GetConsumerIdToRegistrationRecord(ctx, consumerId) + if !found { + return fmt.Errorf("cannot find registration record of consumer chain (consumerId): %s", consumerId) + } else if registrationRecord.ChainId != chainId { + return fmt.Errorf("incorrect misbheaviour for a different chain id (%s) than that of the consumer chain %s (consumerId): %s", + chainId, + registrationRecord.ChainId, + consumerId) + } // check that the misbehaviour is for an ICS consumer chain - clientId, found := k.GetConsumerClientId(ctx, consumerChainID) + clientId, found := k.GetConsumerClientId(ctx, consumerId) if !found { - return fmt.Errorf("incorrect misbehaviour with conflicting headers from a non-existent consumer chain: %s", consumerChainID) + return fmt.Errorf("incorrect misbehaviour with conflicting headers from a non-existent consumer chain (consumerId): %s", consumerId) } else if misbehaviour.ClientId != clientId { - return fmt.Errorf("incorrect misbehaviour: expected client ID for consumer chain %s is %s got %s", - consumerChainID, + return fmt.Errorf("incorrect misbehaviour: expected client ID for consumer chain with id %s is %s got %s", + consumerId, clientId, misbehaviour.ClientId, ) @@ -315,7 +335,7 @@ func (k Keeper) CheckMisbehaviour(ctx sdk.Context, misbehaviour ibctmtypes.Misbe } // Check that the evidence is not too old - minHeight := k.GetEquivocationEvidenceMinHeight(ctx, consumerChainID) + minHeight := k.GetEquivocationEvidenceMinHeight(ctx, consumerId) evidenceHeight := misbehaviour.Header1.GetHeight().GetRevisionHeight() // Note that the revision number is not relevant for checking the age of evidence // as it's already part of the chain ID and the minimum height is mapped to chain IDs @@ -323,7 +343,7 @@ func (k Keeper) CheckMisbehaviour(ctx sdk.Context, misbehaviour ibctmtypes.Misbe return errorsmod.Wrapf( ccvtypes.ErrInvalidDoubleVotingEvidence, "evidence for consumer chain %s is too old - evidence height (%d), min (%d)", - consumerChainID, + consumerId, evidenceHeight, minHeight, ) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 3cf3f5cec4..3afab65af8 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -492,3 +492,15 @@ func (k Keeper) QueryBlocksUntilNextEpoch(goCtx context.Context, req *types.Quer return &types.QueryBlocksUntilNextEpochResponse{BlocksUntilNextEpoch: uint64(blocksUntilNextEpoch)}, nil } + +// QueryConsumerIdFromClientId returns the consumer id of the chain associated with this client id +func (k Keeper) QueryConsumerIdFromClientId(goCtx context.Context, req *types.QueryConsumerIdFromClientIdRequest) (*types.QueryConsumerIdFromClientIdResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + consumerId, found := k.GetClientIdToConsumerId(ctx, req.ClientId) + if !found { + return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("no known consumer chain for this client id: %s", req.ClientId)) + } + + return &types.QueryConsumerIdFromClientIdResponse{ConsumerId: consumerId}, nil +} diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index 53056910ad..3806118159 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -324,3 +324,19 @@ func TestGetConsumerChain(t *testing.T) { require.Equal(t, expectedGetAllOrder[i], c) } } + +func TestQueryConsumerIdFromClientId(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + _, err := providerKeeper.QueryConsumerIdFromClientId(ctx, &types.QueryConsumerIdFromClientIdRequest{ClientId: "clientId"}) + require.Error(t, err) + require.ErrorContains(t, err, "no known consumer chain") + + expectedConsumerId := "consumerId" + providerKeeper.SetClientIdToConsumerId(ctx, "clientId", expectedConsumerId) + + res, err := providerKeeper.QueryConsumerIdFromClientId(ctx, &types.QueryConsumerIdFromClientIdRequest{ClientId: "clientId"}) + require.NoError(t, err) + require.Equal(t, expectedConsumerId, res.ConsumerId) +} diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index ea8aa6ee01..f278ef5680 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -120,7 +120,7 @@ func (k msgServer) ChangeRewardDenoms(goCtx context.Context, msg *types.MsgChang func (k msgServer) SubmitConsumerMisbehaviour(goCtx context.Context, msg *types.MsgSubmitConsumerMisbehaviour) (*types.MsgSubmitConsumerMisbehaviourResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - if err := k.Keeper.HandleConsumerMisbehaviour(ctx, *msg.Misbehaviour); err != nil { + if err := k.Keeper.HandleConsumerMisbehaviour(ctx, msg.ConsumerId, *msg.Misbehaviour); err != nil { return nil, err } @@ -169,9 +169,9 @@ func (k msgServer) SubmitConsumerDoubleVoting(goCtx context.Context, msg *types. return nil, err } - // handle the double voting evidence using the chain ID of the infraction block header - // and the malicious validator's public key - if err := k.Keeper.HandleConsumerDoubleVoting(ctx, evidence, msg.InfractionBlockHeader.Header.ChainID, pubkey); err != nil { + // handle the double voting evidence using the malicious validator's public key + consumerId := msg.ConsumerId + if err := k.Keeper.HandleConsumerDoubleVoting(ctx, consumerId, evidence, pubkey); err != nil { return nil, err } diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 497603c6b1..9e5fe38c94 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1739,6 +1739,97 @@ func (m *QueryBlocksUntilNextEpochResponse) GetBlocksUntilNextEpoch() uint64 { return 0 } +type QueryConsumerIdFromClientIdRequest struct { + // the client id (on the provider) that is tracking the consumer chain + // the client id can be found from the consumer chain by querying (i.e., `query ccvconsumer provider-info`) + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` +} + +func (m *QueryConsumerIdFromClientIdRequest) Reset() { *m = QueryConsumerIdFromClientIdRequest{} } +func (m *QueryConsumerIdFromClientIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryConsumerIdFromClientIdRequest) ProtoMessage() {} +func (*QueryConsumerIdFromClientIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{36} +} +func (m *QueryConsumerIdFromClientIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConsumerIdFromClientIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConsumerIdFromClientIdRequest.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 *QueryConsumerIdFromClientIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConsumerIdFromClientIdRequest.Merge(m, src) +} +func (m *QueryConsumerIdFromClientIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryConsumerIdFromClientIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConsumerIdFromClientIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConsumerIdFromClientIdRequest proto.InternalMessageInfo + +func (m *QueryConsumerIdFromClientIdRequest) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +type QueryConsumerIdFromClientIdResponse struct { + // the consumer id of the chain associated with this client id + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` +} + +func (m *QueryConsumerIdFromClientIdResponse) Reset() { *m = QueryConsumerIdFromClientIdResponse{} } +func (m *QueryConsumerIdFromClientIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryConsumerIdFromClientIdResponse) ProtoMessage() {} +func (*QueryConsumerIdFromClientIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{37} +} +func (m *QueryConsumerIdFromClientIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConsumerIdFromClientIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConsumerIdFromClientIdResponse.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 *QueryConsumerIdFromClientIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConsumerIdFromClientIdResponse.Merge(m, src) +} +func (m *QueryConsumerIdFromClientIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryConsumerIdFromClientIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConsumerIdFromClientIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConsumerIdFromClientIdResponse proto.InternalMessageInfo + +func (m *QueryConsumerIdFromClientIdResponse) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" +} + func init() { proto.RegisterType((*QueryConsumerGenesisRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisRequest") proto.RegisterType((*QueryConsumerGenesisResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisResponse") @@ -1776,6 +1867,8 @@ func init() { proto.RegisterType((*QueryValidatorConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.QueryValidatorConsumerCommissionRateResponse") proto.RegisterType((*QueryBlocksUntilNextEpochRequest)(nil), "interchain_security.ccv.provider.v1.QueryBlocksUntilNextEpochRequest") proto.RegisterType((*QueryBlocksUntilNextEpochResponse)(nil), "interchain_security.ccv.provider.v1.QueryBlocksUntilNextEpochResponse") + proto.RegisterType((*QueryConsumerIdFromClientIdRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerIdFromClientIdRequest") + proto.RegisterType((*QueryConsumerIdFromClientIdResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerIdFromClientIdResponse") } func init() { @@ -1783,133 +1876,137 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 2008 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xcd, 0x6f, 0xdc, 0xc6, - 0x15, 0x17, 0x57, 0x1f, 0x91, 0x46, 0xb1, 0x9d, 0x8c, 0xd5, 0x58, 0xa6, 0x94, 0x5d, 0x85, 0xee, - 0x87, 0x2c, 0xbb, 0xa4, 0xa4, 0x20, 0x70, 0xe2, 0xd6, 0x1f, 0x5a, 0xc9, 0x76, 0x16, 0xfe, 0x52, - 0x68, 0xd9, 0x05, 0x9c, 0xb6, 0xcc, 0x88, 0x9c, 0xae, 0x08, 0x73, 0x39, 0x14, 0x67, 0xb4, 0xf6, - 0xc2, 0xc8, 0x21, 0x3d, 0xb4, 0xb9, 0x14, 0x30, 0x50, 0x14, 0xe8, 0x31, 0x97, 0xde, 0x8b, 0x1e, - 0xf2, 0x37, 0xe4, 0xd6, 0x14, 0xb9, 0x14, 0x3d, 0xa8, 0x85, 0xdd, 0x02, 0x45, 0x81, 0x02, 0x8d, - 0xd1, 0x6b, 0x81, 0x82, 0xc3, 0x21, 0x97, 0xdc, 0xe5, 0xee, 0x92, 0xbb, 0xca, 0x6d, 0x39, 0xf3, - 0xe6, 0x37, 0xef, 0xbd, 0x79, 0xef, 0xcd, 0xfb, 0xcd, 0x02, 0xcd, 0x76, 0x19, 0xf6, 0xcd, 0x3d, - 0x64, 0xbb, 0x06, 0xc5, 0xe6, 0x81, 0x6f, 0xb3, 0x96, 0x66, 0x9a, 0x4d, 0xcd, 0xf3, 0x49, 0xd3, - 0xb6, 0xb0, 0xaf, 0x35, 0xd7, 0xb4, 0xfd, 0x03, 0xec, 0xb7, 0x54, 0xcf, 0x27, 0x8c, 0xc0, 0x33, - 0x19, 0x0b, 0x54, 0xd3, 0x6c, 0xaa, 0xd1, 0x02, 0xb5, 0xb9, 0x26, 0x2f, 0xd6, 0x09, 0xa9, 0x3b, - 0x58, 0x43, 0x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 0x20, 0x00, 0x00, + // 2073 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x5a, 0xcb, 0x6f, 0xdc, 0xc6, + 0x19, 0x17, 0x57, 0x8f, 0x48, 0xa3, 0xd8, 0x4e, 0xc6, 0x6a, 0x2c, 0x53, 0xca, 0xae, 0x4c, 0xf7, + 0x21, 0xcb, 0x2e, 0x29, 0x29, 0x08, 0x9c, 0xb8, 0xf5, 0x63, 0x77, 0x65, 0xd9, 0x0b, 0xbf, 0x14, + 0x5a, 0x76, 0x01, 0xa7, 0x2d, 0x43, 0x91, 0xd3, 0x15, 0x61, 0x2e, 0x87, 0xe2, 0xcc, 0xae, 0xbd, + 0x30, 0x7c, 0x48, 0x0f, 0x6d, 0x2e, 0x05, 0x0c, 0x14, 0x05, 0x7a, 0xcc, 0xa5, 0xb7, 0x1e, 0x8a, + 0x1e, 0xfa, 0x37, 0xe4, 0xd6, 0x14, 0xb9, 0x14, 0x3d, 0xa8, 0x85, 0xdd, 0x02, 0x45, 0x81, 0x02, + 0x4d, 0xda, 0x6b, 0x81, 0x82, 0xc3, 0x21, 0x97, 0xdc, 0xe5, 0xee, 0x92, 0xbb, 0xea, 0x4d, 0x9c, + 0xf9, 0xe6, 0x37, 0xdf, 0x7b, 0xbe, 0xef, 0x5b, 0x01, 0xc5, 0x72, 0x28, 0xf2, 0x8c, 0x7d, 0xdd, + 0x72, 0x34, 0x82, 0x8c, 0xa6, 0x67, 0xd1, 0xb6, 0x62, 0x18, 0x2d, 0xc5, 0xf5, 0x70, 0xcb, 0x32, + 0x91, 0xa7, 0xb4, 0x36, 0x94, 0x83, 0x26, 0xf2, 0xda, 0xb2, 0xeb, 0x61, 0x8a, 0xe1, 0xd9, 0x94, + 0x03, 0xb2, 0x61, 0xb4, 0xe4, 0xf0, 0x80, 0xdc, 0xda, 0x10, 0x97, 0xeb, 0x18, 0xd7, 0x6d, 0xa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0x4d, 0x41, 0x9e, 0x57, 0xbe, 0xf7, + 0xd9, 0xcb, 0xa2, 0xf0, 0xf9, 0xcb, 0xa2, 0xf0, 0x97, 0x97, 0x45, 0xe1, 0xc5, 0xab, 0xe2, 0xc4, + 0xe7, 0xaf, 0x8a, 0x13, 0x7f, 0x7c, 0x55, 0x9c, 0x78, 0x74, 0xb9, 0x6e, 0xd1, 0xfd, 0xe6, 0x9e, + 0x6c, 0xe0, 0x06, 0xff, 0xef, 0x83, 0xd8, 0x2d, 0xdf, 0x8e, 0x6e, 0x69, 0xbd, 0xab, 0x3c, 0xed, + 0x2a, 0x46, 0xdb, 0x2e, 0x22, 0x7b, 0x33, 0xec, 0xa7, 0xa6, 0x77, 0xfe, 0x17, 0x00, 0x00, 0xff, + 0xff, 0xd3, 0xe6, 0xc0, 0x96, 0x1d, 0x22, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1970,6 +2067,9 @@ type QueryClient interface { // QueryBlocksUntilNextEpoch returns the number of blocks until the next epoch // starts and validator updates are sent to the consumer chains QueryBlocksUntilNextEpoch(ctx context.Context, in *QueryBlocksUntilNextEpochRequest, opts ...grpc.CallOption) (*QueryBlocksUntilNextEpochResponse, error) + // QueryConsumerIdFromClientId returns the consumer id of the chain + // associated with the provided client id + QueryConsumerIdFromClientId(ctx context.Context, in *QueryConsumerIdFromClientIdRequest, opts ...grpc.CallOption) (*QueryConsumerIdFromClientIdResponse, error) } type queryClient struct { @@ -2124,6 +2224,15 @@ func (c *queryClient) QueryBlocksUntilNextEpoch(ctx context.Context, in *QueryBl return out, nil } +func (c *queryClient) QueryConsumerIdFromClientId(ctx context.Context, in *QueryConsumerIdFromClientIdRequest, opts ...grpc.CallOption) (*QueryConsumerIdFromClientIdResponse, error) { + out := new(QueryConsumerIdFromClientIdResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryConsumerIdFromClientId", 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 @@ -2172,6 +2281,9 @@ type QueryServer interface { // QueryBlocksUntilNextEpoch returns the number of blocks until the next epoch // starts and validator updates are sent to the consumer chains QueryBlocksUntilNextEpoch(context.Context, *QueryBlocksUntilNextEpochRequest) (*QueryBlocksUntilNextEpochResponse, error) + // QueryConsumerIdFromClientId returns the consumer id of the chain + // associated with the provided client id + QueryConsumerIdFromClientId(context.Context, *QueryConsumerIdFromClientIdRequest) (*QueryConsumerIdFromClientIdResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -2226,6 +2338,9 @@ func (*UnimplementedQueryServer) QueryConsumerValidators(ctx context.Context, re func (*UnimplementedQueryServer) QueryBlocksUntilNextEpoch(ctx context.Context, req *QueryBlocksUntilNextEpochRequest) (*QueryBlocksUntilNextEpochResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryBlocksUntilNextEpoch not implemented") } +func (*UnimplementedQueryServer) QueryConsumerIdFromClientId(ctx context.Context, req *QueryConsumerIdFromClientIdRequest) (*QueryConsumerIdFromClientIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryConsumerIdFromClientId not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -2519,6 +2634,24 @@ func _Query_QueryBlocksUntilNextEpoch_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Query_QueryConsumerIdFromClientId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryConsumerIdFromClientIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryConsumerIdFromClientId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryConsumerIdFromClientId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryConsumerIdFromClientId(ctx, req.(*QueryConsumerIdFromClientIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.provider.v1.Query", HandlerType: (*QueryServer)(nil), @@ -2587,6 +2720,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryBlocksUntilNextEpoch", Handler: _Query_QueryBlocksUntilNextEpoch_Handler, }, + { + MethodName: "QueryConsumerIdFromClientId", + Handler: _Query_QueryConsumerIdFromClientId_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/query.proto", @@ -3795,6 +3932,66 @@ func (m *QueryBlocksUntilNextEpochResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } +func (m *QueryConsumerIdFromClientIdRequest) 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 *QueryConsumerIdFromClientIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConsumerIdFromClientIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryConsumerIdFromClientIdResponse) 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 *QueryConsumerIdFromClientIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConsumerIdFromClientIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -4313,6 +4510,32 @@ func (m *QueryBlocksUntilNextEpochResponse) Size() (n int) { return n } +func (m *QueryConsumerIdFromClientIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryConsumerIdFromClientIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7505,6 +7728,170 @@ func (m *QueryBlocksUntilNextEpochResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryConsumerIdFromClientIdRequest) 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: QueryConsumerIdFromClientIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConsumerIdFromClientIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", 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.ClientId = 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 *QueryConsumerIdFromClientIdResponse) 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: QueryConsumerIdFromClientIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConsumerIdFromClientIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", 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.ConsumerId = 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 f3f6211559..fc131975db 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -595,6 +595,60 @@ func local_request_Query_QueryBlocksUntilNextEpoch_0(ctx context.Context, marsha } +func request_Query_QueryConsumerIdFromClientId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerIdFromClientIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["client_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "client_id") + } + + protoReq.ClientId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "client_id", err) + } + + msg, err := client.QueryConsumerIdFromClientId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryConsumerIdFromClientId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerIdFromClientIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["client_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "client_id") + } + + protoReq.ClientId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "client_id", err) + } + + msg, err := server.QueryConsumerIdFromClientId(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. @@ -969,6 +1023,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryConsumerIdFromClientId_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_QueryConsumerIdFromClientId_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_QueryConsumerIdFromClientId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1330,6 +1407,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryConsumerIdFromClientId_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_QueryConsumerIdFromClientId_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_QueryConsumerIdFromClientId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1365,6 +1462,8 @@ var ( pattern_Query_QueryConsumerValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_validators", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryBlocksUntilNextEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "blocks_until_next_epoch"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryConsumerIdFromClientId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_id", "client_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1399,4 +1498,6 @@ var ( forward_Query_QueryConsumerValidators_0 = runtime.ForwardResponseMessage forward_Query_QueryBlocksUntilNextEpoch_0 = runtime.ForwardResponseMessage + + forward_Query_QueryConsumerIdFromClientId_0 = runtime.ForwardResponseMessage ) diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index b475f29f62..4d2f4be391 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -128,9 +128,11 @@ var xxx_messageInfo_MsgAssignConsumerKeyResponse proto.InternalMessageInfo // also known as a misbehaviour, observed on a consumer chain type MsgSubmitConsumerMisbehaviour struct { Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"` + // the consumer id of the consumer chain where the misbehaviour occurred + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // The Misbehaviour of the consumer chain wrapping // two conflicting IBC headers - Misbehaviour *_07_tendermint.Misbehaviour `protobuf:"bytes,2,opt,name=misbehaviour,proto3" json:"misbehaviour,omitempty"` + Misbehaviour *_07_tendermint.Misbehaviour `protobuf:"bytes,3,opt,name=misbehaviour,proto3" json:"misbehaviour,omitempty"` } func (m *MsgSubmitConsumerMisbehaviour) Reset() { *m = MsgSubmitConsumerMisbehaviour{} } @@ -206,11 +208,13 @@ var xxx_messageInfo_MsgSubmitConsumerMisbehaviourResponse proto.InternalMessageI // a double signing infraction observed on a consumer chain type MsgSubmitConsumerDoubleVoting struct { Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"` + // the consumer id of the consumer chain where the double-voting took place + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // The equivocation of the consumer chain wrapping // an evidence of a validator that signed two conflicting votes - DuplicateVoteEvidence *types.DuplicateVoteEvidence `protobuf:"bytes,2,opt,name=duplicate_vote_evidence,json=duplicateVoteEvidence,proto3" json:"duplicate_vote_evidence,omitempty"` + DuplicateVoteEvidence *types.DuplicateVoteEvidence `protobuf:"bytes,3,opt,name=duplicate_vote_evidence,json=duplicateVoteEvidence,proto3" json:"duplicate_vote_evidence,omitempty"` // The light client header of the infraction block - InfractionBlockHeader *_07_tendermint.Header `protobuf:"bytes,3,opt,name=infraction_block_header,json=infractionBlockHeader,proto3" json:"infraction_block_header,omitempty"` + InfractionBlockHeader *_07_tendermint.Header `protobuf:"bytes,4,opt,name=infraction_block_header,json=infractionBlockHeader,proto3" json:"infraction_block_header,omitempty"` } func (m *MsgSubmitConsumerDoubleVoting) Reset() { *m = MsgSubmitConsumerDoubleVoting{} } @@ -1498,124 +1502,125 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 1871 bytes of a gzipped FileDescriptorProto + // 1875 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4b, 0x6c, 0x24, 0x47, - 0x19, 0x76, 0xfb, 0xb5, 0x9e, 0xb2, 0xbd, 0x6b, 0x97, 0x6d, 0x3c, 0x9e, 0x5d, 0x66, 0xbc, 0x93, - 0x90, 0x58, 0x4b, 0xdc, 0x9d, 0x5d, 0xc8, 0x02, 0x16, 0x04, 0xfc, 0x58, 0x58, 0x07, 0xbc, 0x6b, - 0x7a, 0x97, 0x45, 0x02, 0x29, 0xad, 0x9a, 0xee, 0xda, 0x9e, 0xd2, 0x4e, 0x57, 0xb5, 0xaa, 0x6a, - 0xc6, 0x19, 0x4e, 0x28, 0x87, 0x28, 0x27, 0x14, 0x24, 0x0e, 0x1c, 0x73, 0xe0, 0x82, 0x14, 0xa4, - 0x3d, 0x84, 0x33, 0xe2, 0x82, 0x72, 0x8a, 0xa2, 0x9c, 0x50, 0x84, 0x16, 0xb4, 0x7b, 0x08, 0x67, - 0x4e, 0x1c, 0x51, 0x3d, 0xba, 0x67, 0xc6, 0x33, 0xb6, 0xc7, 0xb3, 0x81, 0x03, 0x97, 0xd1, 0x54, - 0xfd, 0xdf, 0xff, 0xfd, 0x8f, 0xfe, 0xeb, 0xaf, 0x07, 0x78, 0x85, 0x50, 0x89, 0x79, 0x58, 0x47, - 0x84, 0x06, 0x02, 0x87, 0x4d, 0x4e, 0x64, 0xdb, 0x0b, 0xc3, 0x96, 0x97, 0x72, 0xd6, 0x22, 0x11, - 0xe6, 0x5e, 0xeb, 0xba, 0x27, 0xdf, 0x72, 0x53, 0xce, 0x24, 0x83, 0x2f, 0x0c, 0x40, 0xbb, 0x61, - 0xd8, 0x72, 0x33, 0xb4, 0xdb, 0xba, 0x5e, 0x5a, 0x44, 0x09, 0xa1, 0xcc, 0xd3, 0xbf, 0x46, 0xaf, - 0x74, 0x25, 0x66, 0x2c, 0x6e, 0x60, 0x0f, 0xa5, 0xc4, 0x43, 0x94, 0x32, 0x89, 0x24, 0x61, 0x54, - 0x58, 0x69, 0xc5, 0x4a, 0xf5, 0xa8, 0xd6, 0x7c, 0xe8, 0x49, 0x92, 0x60, 0x21, 0x51, 0x92, 0x5a, - 0x40, 0xf9, 0x38, 0x20, 0x6a, 0x72, 0xcd, 0x60, 0xe5, 0x6b, 0xc7, 0xe5, 0x88, 0xb6, 0xad, 0x68, - 0x39, 0x66, 0x31, 0xd3, 0x7f, 0x3d, 0xf5, 0x2f, 0x53, 0x08, 0x99, 0x48, 0x98, 0x08, 0x8c, 0xc0, - 0x0c, 0xac, 0x68, 0xd5, 0x8c, 0xbc, 0x44, 0xc4, 0x2a, 0xf4, 0x44, 0xc4, 0x99, 0x97, 0xa4, 0x16, - 0x7a, 0x21, 0xe3, 0xd8, 0x0b, 0x1b, 0x04, 0x53, 0xa9, 0xa4, 0xe6, 0x9f, 0x05, 0xdc, 0x18, 0x26, - 0x95, 0x79, 0xa2, 0x8c, 0x8e, 0xa7, 0x48, 0x1b, 0x24, 0xae, 0x4b, 0x43, 0x25, 0x3c, 0x89, 0x69, - 0x84, 0x79, 0x42, 0x8c, 0x81, 0xce, 0x28, 0xf3, 0xa2, 0x4b, 0x2e, 0xdb, 0x29, 0x16, 0x1e, 0x56, - 0x7c, 0x34, 0xc4, 0x06, 0x50, 0xfd, 0xcc, 0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0x1a, - 0x24, 0x42, 0x92, 0x71, 0x11, 0xa4, 0xec, 0x08, 0xf3, 0x20, 0x44, 0xa9, 0x8e, 0x64, 0xde, 0x87, - 0x1d, 0xd9, 0xa1, 0x12, 0xed, 0xa2, 0x14, 0x5e, 0x03, 0x8b, 0xf9, 0x6c, 0x20, 0xb0, 0xd4, 0xf0, - 0x49, 0x0d, 0xbf, 0x94, 0x0b, 0xd4, 0xa7, 0x42, 0x29, 0xbc, 0x02, 0x0a, 0xa8, 0xd1, 0x60, 0x47, - 0x0d, 0x22, 0x64, 0x71, 0x4a, 0x77, 0xbd, 0xce, 0x04, 0x2c, 0x81, 0x99, 0x08, 0xd3, 0xb6, 0x16, - 0x4e, 0x6b, 0x61, 0x3e, 0x86, 0x97, 0x41, 0x21, 0x51, 0xd9, 0x93, 0xe8, 0x11, 0x2e, 0x5e, 0x58, - 0x77, 0x36, 0x26, 0xfd, 0x99, 0x84, 0xd0, 0x7b, 0x6a, 0x0c, 0x5d, 0xb0, 0xa4, 0x59, 0x02, 0x42, - 0xd5, 0x86, 0xdc, 0xc2, 0x41, 0x0b, 0x35, 0x44, 0x71, 0x66, 0xdd, 0xd9, 0x98, 0xf1, 0x17, 0xb5, - 0x68, 0xdf, 0x4a, 0x1e, 0xa0, 0x86, 0xb0, 0xed, 0xbd, 0xb7, 0x2a, 0xf2, 0x9a, 0xf9, 0x8b, 0x03, - 0x96, 0x74, 0xf3, 0x8f, 0x89, 0x90, 0xaa, 0xb2, 0x6c, 0xd5, 0x74, 0x4a, 0xd7, 0x19, 0xae, 0x74, - 0x61, 0x0a, 0x96, 0xb8, 0x66, 0x31, 0x37, 0x86, 0xac, 0x28, 0xcc, 0xd6, 0xf6, 0xdd, 0x73, 0x15, - 0x85, 0xdf, 0xc5, 0x63, 0x4b, 0x03, 0xf2, 0xbe, 0xb9, 0xad, 0xd9, 0xee, 0x45, 0xc2, 0x40, 0xe9, - 0x64, 0x75, 0xb8, 0x0c, 0xa6, 0x24, 0x91, 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e, 0xa8, 0x1e, 0xdd, 0x33, 0xe3, 0x19, 0xdb, 0x63, 0x6f, 0xc2, 0x21, 0x97, 0xd1, 0x54, 0xfd, + 0xdf, 0xff, 0xfd, 0x8f, 0xfe, 0xeb, 0xaf, 0x07, 0xbc, 0x44, 0x63, 0x41, 0x52, 0xbf, 0x8e, 0x69, + 0xec, 0x71, 0xe2, 0x37, 0x53, 0x2a, 0xda, 0x8e, 0xef, 0xb7, 0x9c, 0x24, 0x65, 0x2d, 0x1a, 0x90, + 0xd4, 0x69, 0xdd, 0x70, 0xc4, 0x1b, 0x76, 0x92, 0x32, 0xc1, 0xd0, 0x73, 0x03, 0xd0, 0xb6, 0xef, + 0xb7, 0xec, 0x0c, 0x6d, 0xb7, 0x6e, 0x94, 0x16, 0x70, 0x44, 0x63, 0xe6, 0xa8, 0x5f, 0xad, 0x57, + 0xba, 0x1a, 0x32, 0x16, 0x36, 0x88, 0x83, 0x13, 0xea, 0xe0, 0x38, 0x66, 0x02, 0x0b, 0xca, 0x62, + 0x6e, 0xa4, 0x15, 0x23, 0x55, 0xa3, 0x5a, 0xf3, 0xa1, 0x23, 0x68, 0x44, 0xb8, 0xc0, 0x51, 0x62, + 0x00, 0xe5, 0xe3, 0x80, 0xa0, 0x99, 0x2a, 0x06, 0x23, 0x5f, 0x3d, 0x2e, 0xc7, 0x71, 0xdb, 0x88, + 0x96, 0x42, 0x16, 0x32, 0xf5, 0xd7, 0x91, 0xff, 0x32, 0x05, 0x9f, 0xf1, 0x88, 0x71, 0x4f, 0x0b, + 0xf4, 0xc0, 0x88, 0x56, 0xf4, 0xc8, 0x89, 0x78, 0x28, 0x43, 0x8f, 0x78, 0x98, 0x79, 0x49, 0x6b, + 0xbe, 0xe3, 0xb3, 0x94, 0x38, 0x7e, 0x83, 0x92, 0x58, 0x48, 0xa9, 0xfe, 0x67, 0x00, 0x9b, 0xc3, + 0xa4, 0x32, 0x4f, 0x94, 0xd6, 0x71, 0x24, 0x69, 0x83, 0x86, 0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x07, 0xb3, 0xec, 0x28, 0x36, 0x45, 0x40, 0x38, 0x37, 0x05, 0x3e, 0xa3, 0x26, 0x4d, 0x7c, + 0x68, 0x11, 0x26, 0x64, 0xbb, 0xbd, 0xa3, 0x02, 0x99, 0x75, 0xc7, 0x05, 0x4b, 0xee, 0xa0, 0x97, + 0x61, 0xa9, 0x85, 0x1b, 0x34, 0xc0, 0x82, 0xa5, 0xdc, 0x4b, 0xd8, 0x11, 0x49, 0x3d, 0x1f, 0x27, + 0x2a, 0x92, 0x59, 0x17, 0x75, 0x64, 0x87, 0x52, 0xb4, 0x8b, 0x13, 0x74, 0x1d, 0x16, 0xf2, 0x59, + 0x8f, 0x13, 0xa1, 0xe0, 0xe3, 0x0a, 0x7e, 0x39, 0x17, 0xc8, 0x4f, 0x85, 0x13, 0x74, 0x15, 0x0a, + 0xb8, 0xd1, 0x60, 0x47, 0x0d, 0xca, 0x45, 0x71, 0x42, 0x75, 0xbd, 0xce, 0x04, 0x2a, 0xc1, 0x54, + 0x40, 0xe2, 0xb6, 0x12, 0x4e, 0x2a, 0x61, 0x3e, 0x46, 0x57, 0xa0, 0x10, 0xc9, 0xec, 0x09, 0xfc, + 0x88, 0x14, 0x2f, 0xad, 0x59, 0xeb, 0xe3, 0xee, 0x54, 0x44, 0xe3, 0x7b, 0x72, 0x8c, 0x6c, 0x58, + 0x54, 0x2c, 0x1e, 0x8d, 0xe5, 0x86, 0xdc, 0x22, 0x5e, 0x0b, 0x37, 0x78, 0x71, 0x6a, 0xcd, 0x5a, + 0x9f, 0x72, 0x17, 0x94, 0x68, 0xdf, 0x48, 0x1e, 0xe0, 0x06, 0x37, 0xed, 0xbd, 0xb7, 0x2a, 0xf2, + 0x9a, 0xf9, 0xab, 0x05, 0x8b, 0xaa, 0xf9, 0x87, 0x94, 0x0b, 0x59, 0x59, 0xa6, 0x6a, 0x3a, 0xa5, + 0x6b, 0x0d, 0x57, 0xba, 0x28, 0x81, 0xc5, 0x54, 0xb1, 0xe8, 0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0x22, 0x98, 0xd0, 0xb7, + 0xec, 0x8d, 0x61, 0x69, 0x14, 0xbc, 0xf4, 0xca, 0xb9, 0xe0, 0xb9, 0xb9, 0x04, 0x26, 0xcd, 0x7d, + 0xd7, 0x3e, 0x07, 0xc1, 0xdd, 0xa6, 0x28, 0xdd, 0x3c, 0x1f, 0x3e, 0xb7, 0xf8, 0x47, 0x0b, 0x56, + 0x4f, 0xbe, 0x9e, 0x0e, 0xdd, 0x62, 0x4f, 0xa4, 0x28, 0xed, 0x3f, 0x33, 0x45, 0xe6, 0x6b, 0x69, + 0xe2, 0xd7, 0x9f, 0xbd, 0x7f, 0xdd, 0xda, 0xf9, 0xf9, 0x87, 0x4f, 0xca, 0xd6, 0xc7, 0x4f, 0xca, + 0xd6, 0xbf, 0x9e, 0x94, 0xad, 0x77, 0x9e, 0x96, 0x47, 0x3e, 0x7e, 0x5a, 0x1e, 0xf9, 0xfb, 0xd3, + 0xf2, 0xc8, 0x2f, 0xbe, 0x17, 0x52, 0x51, 0x6f, 0xd6, 0x6c, 0x9f, 0x45, 0xe6, 0xa9, 0xdf, 0xe9, + 0x18, 0xdf, 0xc8, 0x5f, 0xea, 0x5b, 0xaf, 0x38, 0x6f, 0xf4, 0x3e, 0xd7, 0xab, 0x67, 0xc9, 0xda, + 0xa4, 0x3a, 0x14, 0x7c, 0xe3, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xe1, 0xb3, 0x5b, 0x2a, + 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2162,6 +2167,13 @@ func (m *MsgSubmitConsumerMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintTx(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x1a + } + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- dAtA[i] = 0x12 } if len(m.Submitter) > 0 { @@ -2227,7 +2239,7 @@ func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if m.DuplicateVoteEvidence != nil { { @@ -2239,6 +2251,13 @@ func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintTx(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x1a + } + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- dAtA[i] = 0x12 } if len(m.Submitter) > 0 { @@ -3190,6 +3209,10 @@ func (m *MsgSubmitConsumerMisbehaviour) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } if m.Misbehaviour != nil { l = m.Misbehaviour.Size() n += 1 + l + sovTx(uint64(l)) @@ -3216,6 +3239,10 @@ func (m *MsgSubmitConsumerDoubleVoting) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } if m.DuplicateVoteEvidence != nil { l = m.DuplicateVoteEvidence.Size() n += 1 + l + sovTx(uint64(l)) @@ -3906,6 +3933,38 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { m.Submitter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) } @@ -4074,6 +4133,38 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { m.Submitter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DuplicateVoteEvidence", wireType) } @@ -4109,7 +4200,7 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InfractionBlockHeader", wireType) } From 0c3d3b6e43dff4be29a4676645fe5e57fd10c2b5 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 6 Aug 2024 18:11:45 +0300 Subject: [PATCH 23/41] added safeguard so that a validator cannot opt-in to two different chains with the same chain id --- docs/docs/adrs/adr-019-permissionless-ics.md | 6 ++-- x/ccv/provider/keeper/partial_set_security.go | 27 +++++++++++---- .../keeper/partial_set_security_test.go | 33 +++++++++++++++---- x/ccv/provider/keeper/permissionless.go | 28 +++++++++++++++- x/ccv/provider/keeper/permissionless_test.go | 19 +++++++++++ x/ccv/provider/types/errors.go | 1 + x/ccv/provider/types/keys.go | 9 +++-- 7 files changed, 106 insertions(+), 17 deletions(-) diff --git a/docs/docs/adrs/adr-019-permissionless-ics.md b/docs/docs/adrs/adr-019-permissionless-ics.md index 0d691e356d..70273ee2f3 100644 --- a/docs/docs/adrs/adr-019-permissionless-ics.md +++ b/docs/docs/adrs/adr-019-permissionless-ics.md @@ -95,8 +95,7 @@ consumer chains with the exact same `chainId`, and it is the responsibility of t to interact with by providing the right `consumerId`. Note that with Permissionless ICS, all interactions on a consumer chain have to use the `consumerId` instead of the `chainId`. -For example, if a validator opts in on a chain using `MsgOptIn`, the validator has to provide the `consumerId`. To also -provide the `consumerId` for Top N consumers chains, we store a mapping between `proposalID` to `consumerId`. This storing +For example, if a validator opts in on a chain using `MsgOptIn`, the validator has to provide the `consumerId`. To also provide the `consumerId` for Top N consumers chains, we store a mapping between `proposalID` to `consumerId`. This storing takes place in the [`AfterProposalSubmission`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.8/x/gov/types/hooks.go#L19) hook. Specifically, for the equivocation evidence, we update the `MsgSubmitConsumerMisbehaviour` and `MsgSubmitConsumerDoubleVoting` messages to include the `consumerId`, and change [Hermes](https://github.com/informalsystems/hermes) to include `consumerId` in those constructed messages as well. @@ -332,6 +331,9 @@ Because we only have two consumer chains at the moment, this is not going to be consumer chains that are being voted upon. Similarly, all the messages, queries, etc. would need to be changed to operate on a `consumerId` instead of a `chainId`. +To prevent a validator from accidentally opting in to a wrong chain, we disallow a validator from opting in to two or more +different chains (different `consumerId`) with the same `chainId`. + It is **important** to migrate any ongoing `ConsumerAdditionProposal`s when we upgrade before we actually deprecate `ConsumerAdditionProposal`s. ## Consequences diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 85ec9f1536..275a0d7b35 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -13,16 +13,31 @@ import ( "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" ) -// HandleOptIn prepares validator `providerAddr` to opt in to `chainID` with an optional `consumerKey` consumer public key. +// HandleOptIn prepares validator `providerAddr` to opt in to `consumerId` 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) { +func (k Keeper) HandleOptIn(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress, consumerKey string) error { + phase, found := k.GetConsumerIdToPhase(ctx, consumerId) + if !found || phase == Stopped { + return errorsmod.Wrapf( + types.ErrInvalidPhase, + "opting in to an unknown (or stopped) consumer chain, with id: %s", consumerId) + } + + registrationRecord, found := k.GetConsumerIdToRegistrationRecord(ctx, consumerId) + if !found { return errorsmod.Wrapf( types.ErrUnknownConsumerId, - "opting in to an unknown consumer chain, with id: %s", chainID) + "opting in to an unknown consumer chain, with id: %s", consumerId) + } + + optedInToConsumerId, found := k.IsValidatorOptedInToChain(ctx, providerAddr, registrationRecord.ChainId) + if found && consumerId != optedInToConsumerId { + return errorsmod.Wrapf(types.ErrAlreadyOptedIn, + "validator has already opted in to a chain (%s) with the same chain id (%s)", + optedInToConsumerId, registrationRecord.ChainId) } - k.SetOptedIn(ctx, chainID, providerAddr) + k.SetOptedIn(ctx, consumerId, providerAddr) if consumerKey != "" { consumerTMPublicKey, err := k.ParseConsumerKey(consumerKey) @@ -35,7 +50,7 @@ func (k Keeper) HandleOptIn(ctx sdk.Context, chainID string, providerAddr types. return err } - err = k.AssignConsumerKey(ctx, chainID, validator, consumerTMPublicKey) + err = k.AssignConsumerKey(ctx, consumerId, validator, consumerTMPublicKey) if err != nil { return err } diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index e180554239..fcc0accf14 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -32,13 +32,30 @@ func TestHandleOptIn(t *testing.T) { providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) - // trying to opt in to a non-proposed and non-registered chain returns an error - require.Error(t, providerKeeper.HandleOptIn(ctx, "unknownChainID", providerAddr, "")) + // trying to opt in to an unknown chain + require.Error(t, providerKeeper.HandleOptIn(ctx, "unknownConsumerId", providerAddr, "")) - providerKeeper.SetProposedConsumerChain(ctx, "chainID", 1) - require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", providerAddr)) - providerKeeper.HandleOptIn(ctx, "chainID", providerAddr, "") - require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", providerAddr)) + // trying to opt in to a stopped consumer chain + providerKeeper.SetConsumerIdToPhase(ctx, "stoppedConsumerId", keeper.Stopped) + require.Error(t, providerKeeper.HandleOptIn(ctx, "stoppedConsumerId", providerAddr, "")) + + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId", keeper.Registered) + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "consumerId", types.ConsumerRegistrationRecord{ + ChainId: "chainId", + }) + require.False(t, providerKeeper.IsOptedIn(ctx, "consumerId", providerAddr)) + err := providerKeeper.HandleOptIn(ctx, "consumerId", providerAddr, "") + require.NoError(t, err) + require.True(t, providerKeeper.IsOptedIn(ctx, "consumerId", providerAddr)) + + // validator tries to opt in to another chain with chain id ("chainId") while it is already opted in to + // a different chain with the same chain id + providerKeeper.SetConsumerIdToPhase(ctx, "consumerId2", keeper.Registered) + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "consumerId2", types.ConsumerRegistrationRecord{ + ChainId: "chainId", + }) + err = providerKeeper.HandleOptIn(ctx, "consumerId2", providerAddr, "") + require.ErrorContains(t, err, "validator has already opted in to a chain") } func TestHandleOptInWithConsumerKey(t *testing.T) { @@ -75,6 +92,10 @@ func TestHandleOptInWithConsumerKey(t *testing.T) { expectedConsumerPubKey, err := providerKeeper.ParseConsumerKey(consumerKey) require.NoError(t, err) + providerKeeper.SetConsumerIdToPhase(ctx, "chainID", keeper.Registered) + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "chainID", types.ConsumerRegistrationRecord{ + ChainId: "chainID", + }) err = providerKeeper.HandleOptIn(ctx, "chainID", providerAddr, consumerKey) require.NoError(t, err) diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index b106183308..5115f9d5fa 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -267,7 +267,7 @@ func (k Keeper) DeleteClientIdToConsumerId(ctx sdk.Context, clientId string) { // that are ready to launch, i.e., consumer clients to be created. func (k Keeper) GetInitializedConsumersReadyToLaunch(ctx sdk.Context) []string { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToInitializationRecordKeyNameKeyPrefix()) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToInitializationRecordKeyPrefix()) defer iterator.Close() var consumerIds []string @@ -412,3 +412,29 @@ func (k Keeper) GetLaunchedConsumersReadyToStop(ctx sdk.Context) []string { return consumerIds } + +// IsValidatorOptedInToChain checks if the validator with `providerAddr` is opted into the chain with the specified `chainId`. +// It returns `found == true` and the corresponding chain's `consumerId` if the validator is opted in. Otherwise, it returns an empty string +// for `consumerId` and `found == false`. +func (k Keeper) IsValidatorOptedInToChain(ctx sdk.Context, providerAddr types.ProviderConsAddress, chainId string) (consumerId string, found bool) { + store := ctx.KVStore(k.storeKey) + iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToRegistrationRecordKeyPrefix()) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + // the `currentConsumerId` resides in the whole key, but we skip the first byte (because it's the `ConsumerIdKey`) + // plus 8 more bytes for the `uint64` in the key that contains the length of the `currentConsumerId` + currentConsumerId := string(iterator.Key()[1+8:]) + + var record types.ConsumerRegistrationRecord + err := record.Unmarshal(iterator.Value()) + if err != nil { + panic(fmt.Errorf("failed to unmarshal registration record: %w for consumer id: %s", err, currentConsumerId)) + } + + if record.ChainId == chainId && k.IsOptedIn(ctx, currentConsumerId, providerAddr) { + return currentConsumerId, true + } + } + return "", false +} diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index 4aaefe785b..aad177de61 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -273,3 +273,22 @@ func TestGetLaunchedConsumersReadyToStop(t *testing.T) { ctx = ctx.WithBlockTime(time.Unix(30, 0)) require.Equal(t, []string{"consumerId1", "consumerId2", "consumerId3"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) } + +func TestIsValidatorOptedInToChain(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + chainId := "chainId" + providerAddr := providertypes.NewProviderConsAddress([]byte("providerAddr")) + _, found := providerKeeper.IsValidatorOptedInToChain(ctx, providerAddr, chainId) + require.False(t, found) + + expectedConsumerId := "consumerId" + providerKeeper.SetConsumerIdToRegistrationRecord(ctx, expectedConsumerId, providertypes.ConsumerRegistrationRecord{ + ChainId: chainId, + }) + providerKeeper.SetOptedIn(ctx, expectedConsumerId, providerAddr) + actualConsumerId, found := providerKeeper.IsValidatorOptedInToChain(ctx, providerAddr, chainId) + require.True(t, found) + require.Equal(t, expectedConsumerId, actualConsumerId) +} diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 933995538c..1c13a2f3c7 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -38,4 +38,5 @@ var ( ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 30, "missing consumer genesis") ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 31, "invalid consumer genesis") ErrNoConsumerId = errorsmod.Register(ModuleName, 32, "missing consumer id") + ErrAlreadyOptedIn = errorsmod.Register(ModuleName, 33, "already opted in to a chain with the same chain id") ) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 0564b7416b..c1db6c2328 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -750,13 +750,18 @@ func ConsumerIdKey() []byte { return []byte{mustGetKeyPrefix(ConsumerIdKeyName)} } +// ConsumerIdToRegistrationRecordKeyPrefix returns the key prefix for storing consumer registration records +func ConsumerIdToRegistrationRecordKeyPrefix() []byte { + return []byte{mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName)} +} + // ConsumerIdToRegistrationRecordKey returns the key used to store the registration record that corresponds to this consumer id func ConsumerIdToRegistrationRecordKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName), consumerId) } -// ConsumerIdToInitializationRecordKeyNameKeyPrefix returns the key prefix for storing consumer initialization records -func ConsumerIdToInitializationRecordKeyNameKeyPrefix() []byte { +// ConsumerIdToInitializationRecordKeyPrefix returns the key prefix for storing consumer initialization records +func ConsumerIdToInitializationRecordKeyPrefix() []byte { return []byte{mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName)} } From 2cee3e9546781d856306e22d6d34ff8cd83ec593 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 6 Aug 2024 18:24:16 +0300 Subject: [PATCH 24/41] renamed some chainIDs to consumerIds --- x/ccv/provider/keeper/keeper.go | 30 +++---- x/ccv/provider/keeper/key_assignment.go | 24 +++--- x/ccv/provider/keeper/partial_set_security.go | 79 ++++++++++--------- x/ccv/provider/keeper/validator_set_update.go | 56 ++++++------- x/ccv/provider/types/keys.go | 40 +++++----- x/ccv/provider/types/keys_test.go | 4 +- 6 files changed, 117 insertions(+), 116 deletions(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 0e1facf472..0189ffb8d4 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -1170,7 +1170,7 @@ func (k Keeper) DeleteMinimumPowerInTopN( // a given consumer chain. func (k Keeper) SetMinStake( ctx sdk.Context, - chainID string, + consumerId string, minStake uint64, ) { store := ctx.KVStore(k.storeKey) @@ -1178,17 +1178,17 @@ func (k Keeper) SetMinStake( buf := make([]byte, 8) binary.BigEndian.PutUint64(buf, minStake) - store.Set(types.MinStakeKey(chainID), buf) + store.Set(types.MinStakeKey(consumerId), buf) } // GetMinStake returns the minimum stake required for a validator to validate // a given consumer chain. func (k Keeper) GetMinStake( ctx sdk.Context, - chainID string, + consumerId string, ) (uint64, bool) { store := ctx.KVStore(k.storeKey) - buf := store.Get(types.MinStakeKey(chainID)) + buf := store.Get(types.MinStakeKey(consumerId)) if buf == nil { return 0, false } @@ -1199,23 +1199,23 @@ func (k Keeper) GetMinStake( // a given consumer chain. func (k Keeper) DeleteMinStake( ctx sdk.Context, - chainID string, + consumerId string, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.MinStakeKey(chainID)) + store.Delete(types.MinStakeKey(consumerId)) } // SetInactiveValidatorsAllowed sets whether inactive validators are allowed to validate // a given consumer chain. func (k Keeper) SetInactiveValidatorsAllowed( ctx sdk.Context, - chainID string, + consumerId string, allowed bool, ) { if allowed { - k.EnableInactiveValidators(ctx, chainID) + k.EnableInactiveValidators(ctx, consumerId) } else { - k.DisableInactiveValidators(ctx, chainID) + k.DisableInactiveValidators(ctx, consumerId) } } @@ -1223,30 +1223,30 @@ func (k Keeper) SetInactiveValidatorsAllowed( // a given consumer chain. func (k Keeper) EnableInactiveValidators( ctx sdk.Context, - chainID string, + consumerId string, ) { store := ctx.KVStore(k.storeKey) - store.Set(types.AllowInactiveValidatorsKey(chainID), []byte{}) + store.Set(types.AllowInactiveValidatorsKey(consumerId), []byte{}) } // AllowsInactiveValidators returns whether inactive validators are allowed to validate // a given consumer chain. func (k Keeper) AllowsInactiveValidators( ctx sdk.Context, - chainID string, + consumerId string, ) bool { store := ctx.KVStore(k.storeKey) - return store.Has(types.AllowInactiveValidatorsKey(chainID)) + return store.Has(types.AllowInactiveValidatorsKey(consumerId)) } // DisableInactiveValidators removes the flag of whether inactive validators are allowed to validate // a given consumer chain. func (k Keeper) DisableInactiveValidators( ctx sdk.Context, - chainID string, + consumerId string, ) { store := ctx.KVStore(k.storeKey) - store.Delete(types.AllowInactiveValidatorsKey(chainID)) + store.Delete(types.AllowInactiveValidatorsKey(consumerId)) } func (k Keeper) UnbondingCanComplete(ctx sdk.Context, id uint64) error { diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index 093e767f1f..fb9d11d3fc 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -245,12 +245,12 @@ func (k Keeper) DeleteValidatorByConsumerAddr(ctx sdk.Context, consumerId string // - or there exists a timestamp in ConsumerAddrsToPrune s.t. cAddr in ConsumerAddrsToPrune(timestamp) func (k Keeper) AppendConsumerAddrsToPrune( ctx sdk.Context, - chainID string, + consumerId string, pruneTs time.Time, consumerAddr types.ConsumerConsAddress, ) { store := ctx.KVStore(k.storeKey) - storeKey := types.ConsumerAddrsToPruneV2Key(chainID, pruneTs) + storeKey := types.ConsumerAddrsToPruneV2Key(consumerId, pruneTs) bz := store.Get(storeKey) var consumerAddrsToPrune types.AddressList if bz != nil { @@ -275,12 +275,12 @@ func (k Keeper) AppendConsumerAddrsToPrune( // Note that this method is only used in testing. func (k Keeper) GetConsumerAddrsToPrune( ctx sdk.Context, - chainID string, + consumerId string, ts time.Time, ) (consumerAddrsToPrune types.AddressList) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerAddrsToPruneV2Key(chainID, ts)) + bz := store.Get(types.ConsumerAddrsToPruneV2Key(consumerId, ts)) if bz == nil { return } @@ -297,28 +297,28 @@ func (k Keeper) GetConsumerAddrsToPrune( // The returned addresses are removed from the store. // // Note that the list of all consumer addresses is stored under keys with the following format: -// ConsumerAddrsToPruneV2BytePrefix | len(chainID) | chainID | timestamp +// ConsumerAddrsToPruneV2BytePrefix | len(consumerId) | consumerId | timestamp // Thus, this method returns all the consumer addresses stored under keys in the following range: -// (ConsumerAddrsToPruneV2BytePrefix | len(chainID) | chainID | ts') where ts' <= ts +// (ConsumerAddrsToPruneV2BytePrefix | len(consumerId) | consumerId | ts') where ts' <= ts func (k Keeper) ConsumeConsumerAddrsToPrune( ctx sdk.Context, - chainID string, + consumerId string, ts time.Time, ) (consumerAddrsToPrune types.AddressList) { store := ctx.KVStore(k.storeKey) consumerAddrsToPruneKeyPrefix := types.ConsumerAddrsToPruneV2KeyPrefix() - startPrefix := types.ConsumerIdWithLenKey(consumerAddrsToPruneKeyPrefix, chainID) + startPrefix := types.ConsumerIdWithLenKey(consumerAddrsToPruneKeyPrefix, consumerId) iterator := store.Iterator(startPrefix, - storetypes.InclusiveEndBytes(types.ConsumerAddrsToPruneV2Key(chainID, ts))) + storetypes.InclusiveEndBytes(types.ConsumerAddrsToPruneV2Key(consumerId, ts))) defer iterator.Close() var keysToDel [][]byte for ; iterator.Valid(); iterator.Next() { // Sanity check - if _, pruneTs, err := types.ParseChainIdAndTsKey(consumerAddrsToPruneKeyPrefix, iterator.Key()); err != nil { + if _, pruneTs, err := types.ParseConsumerIdAndTsKey(consumerAddrsToPruneKeyPrefix, iterator.Key()); err != nil { // An error here would indicate something is very wrong, // store keys are assumed to be correctly serialized in AppendConsumerAddrsToPrune. - k.Logger(ctx).Error("ParseChainIdAndTsKey failed", + k.Logger(ctx).Error("ParseConsumerIdAndTsKey failed", "key", string(iterator.Key()), "error", err.Error(), ) @@ -364,7 +364,7 @@ func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, consumerId string) ( iterator := storetypes.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - _, ts, err := types.ParseChainIdAndTsKey(consumerAddrsToPruneKeyPrefix, iterator.Key()) + _, ts, err := types.ParseConsumerIdAndTsKey(consumerAddrsToPruneKeyPrefix, iterator.Key()) if err != nil { // An error here would indicate something is very wrong, // store keys are assumed to be correctly serialized in AppendConsumerAddrsToPrune. diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 275a0d7b35..2afd553eb6 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -59,18 +59,18 @@ func (k Keeper) HandleOptIn(ctx sdk.Context, consumerId string, providerAddr typ return nil } -// HandleOptOut prepares validator `providerAddr` to opt out from running `chainID`. +// HandleOptOut prepares validator `providerAddr` to opt out from running `consumerId`. // 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 { +func (k Keeper) HandleOptOut(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) error { + if _, found := k.GetConsumerClientId(ctx, consumerId); !found { // A validator can only opt out from a running chain. We check this by checking the consumer client id, because // `SetConsumerClientId` is set when the chain starts in `CreateConsumerClientInCachedCtx` of `BeginBlockInit`. return errorsmod.Wrapf( types.ErrUnknownConsumerId, - "opting out of an unknown or not running consumer chain, with id: %s", chainID) + "opting out of an unknown or not running consumer chain, with id: %s", consumerId) } - if topN, found := k.GetTopN(ctx, chainID); found && topN > 0 { + if topN, found := k.GetTopN(ctx, consumerId); found && topN > 0 { // a validator cannot opt out from a Top N chain if the validator is in the Top N validators validator, err := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerAddr.ToSdkConsAddr()) if err != nil { @@ -84,27 +84,27 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, chainID string, providerAddr types if err != nil { return err } - minPowerInTopN, found := k.GetMinimumPowerInTopN(ctx, chainID) + minPowerInTopN, found := k.GetMinimumPowerInTopN(ctx, consumerId) if !found { return errorsmod.Wrapf( types.ErrUnknownConsumerId, - "Could not find minimum power in top N for chain with id: %s", chainID) + "Could not find minimum power in top N for chain with consumer id: %s", consumerId) } if power >= minPowerInTopN { return errorsmod.Wrapf( types.ErrCannotOptOutFromTopN, - "validator with power (%d) cannot opt out from Top N chain (%s) because all validators"+ - " with at least %d power have to validate", power, chainID, minPowerInTopN) + "validator with power (%d) cannot opt out from Top N chain with consumer id (%s) because all validators"+ + " with at least %d power have to validate", power, consumerId, minPowerInTopN) } } - k.DeleteOptedIn(ctx, chainID, providerAddr) + k.DeleteOptedIn(ctx, consumerId, providerAddr) return nil } -// 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) { +// OptInTopNValidators opts in to `consumerId` all the `bondedValidators` that have at least `minPowerToOptIn` power +func (k Keeper) OptInTopNValidators(ctx sdk.Context, consumerId string, bondedValidators []stakingtypes.Validator, minPowerToOptIn int64) { for _, val := range bondedValidators { // log the validator k.Logger(ctx).Debug("Checking whether to opt in validator because of top N", "validator", val.GetOperator()) @@ -133,7 +133,8 @@ func (k Keeper) OptInTopNValidators(ctx sdk.Context, chainID string, bondedValid // if validator already exists it gets overwritten k.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) - } + k.SetOptedIn(ctx, consumerId, types.NewProviderConsAddress(consAddr)) + } // else validators that do not belong to the top N validators but were opted in, remain opted in } } @@ -183,15 +184,15 @@ func (k Keeper) ComputeMinPowerInTopN(ctx sdk.Context, bondedValidators []stakin return 0, fmt.Errorf("should never reach this point with topN (%d), totalPower (%d), and powerSum (%d)", topN, totalPower, powerSum) } -// CapValidatorSet caps the provided `validators` if chain `chainID` is an Opt In chain with a validator-set cap. If cap -// is `k`, `CapValidatorSet` returns the first `k` validators from `validators` with the highest power. -func (k Keeper) CapValidatorSet(ctx sdk.Context, chainID string, validators []types.ConsensusValidator) []types.ConsensusValidator { - if topN, found := k.GetTopN(ctx, chainID); found && topN > 0 { +// CapValidatorSet caps the provided `validators` if chain with `consumerId` is an Opt In chain with a validator-set cap. +// If cap is `k`, `CapValidatorSet` returns the first `k` validators from `validators` with the highest power. +func (k Keeper) CapValidatorSet(ctx sdk.Context, consumerId string, validators []types.ConsensusValidator) []types.ConsensusValidator { + if topN, found := k.GetTopN(ctx, consumerId); found && topN > 0 { // is a no-op if the chain is a Top N chain return validators } - if validatorSetCap, found := k.GetValidatorSetCap(ctx, chainID); found && validatorSetCap != 0 && int(validatorSetCap) < len(validators) { + if validatorSetCap, found := k.GetValidatorSetCap(ctx, consumerId); found && validatorSetCap != 0 && int(validatorSetCap) < len(validators) { sort.Slice(validators, func(i, j int) bool { return validators[i].Power > validators[j].Power }) @@ -202,15 +203,15 @@ func (k Keeper) CapValidatorSet(ctx sdk.Context, chainID string, validators []ty } } -// CapValidatorsPower caps the power of the validators on chain `chainID` and returns an updated slice of validators +// CapValidatorsPower caps the power of the validators on chain with `consumerId` and returns an updated slice of validators // with their new powers. Works on a best-basis effort because there are cases where we cannot guarantee that all validators // on the consumer chain have less power than the set validators-power cap. For example, if we have 10 validators and // the power cap is set to 5%, we need at least one validator to have more than 10% of the voting power on the consumer chain. -func (k Keeper) CapValidatorsPower(ctx sdk.Context, chainID string, validators []types.ConsensusValidator) []types.ConsensusValidator { - if p, found := k.GetValidatorsPowerCap(ctx, chainID); found && p > 0 { +func (k Keeper) CapValidatorsPower(ctx sdk.Context, consumerId string, validators []types.ConsensusValidator) []types.ConsensusValidator { + if p, found := k.GetValidatorsPowerCap(ctx, consumerId); found && p > 0 { return NoMoreThanPercentOfTheSum(validators, p) } else { - // is a no-op if power cap is not set for `chainID` + // is a no-op if power cap is not set for `consumerId` return validators } } @@ -315,23 +316,23 @@ func NoMoreThanPercentOfTheSum(validators []types.ConsensusValidator, percent ui return updatedValidators } -// CanValidateChain returns true if the validator `providerAddr` is opted-in to chain `chainID` and the allowlist and -// denylist do not prevent the validator from validating the chain. -func (k Keeper) CanValidateChain(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress) bool { +// CanValidateChain returns true if the validator `providerAddr` is opted-in to chain with `consumerId` and the allowlist +// and denylist do not prevent the validator from validating the chain. +func (k Keeper) CanValidateChain(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool { // only consider opted-in validators - return k.IsOptedIn(ctx, chainID, providerAddr) && + return k.IsOptedIn(ctx, consumerId, providerAddr) && // if an allowlist is declared, only consider allowlisted validators - (k.IsAllowlistEmpty(ctx, chainID) || - k.IsAllowlisted(ctx, chainID, providerAddr)) && + (k.IsAllowlistEmpty(ctx, consumerId) || + k.IsAllowlisted(ctx, consumerId, providerAddr)) && // if a denylist is declared, only consider denylisted validators - (k.IsDenylistEmpty(ctx, chainID) || - !k.IsDenylisted(ctx, chainID, providerAddr)) + (k.IsDenylistEmpty(ctx, consumerId) || + !k.IsDenylisted(ctx, consumerId, providerAddr)) } -// FulfillsMinStake returns true if the validator `providerAddr` has enough stake to validate chain `chainID` +// FulfillsMinStake returns true if the validator `providerAddr` has enough stake to validate chain with `consumerId` // by checking its staked tokens against the minimum stake required to validate the chain. -func (k Keeper) FulfillsMinStake(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress) bool { - minStake, found := k.GetMinStake(ctx, chainID) +func (k Keeper) FulfillsMinStake(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool { + minStake, found := k.GetMinStake(ctx, consumerId) if !found { return true } @@ -347,7 +348,7 @@ func (k Keeper) FulfillsMinStake(ctx sdk.Context, chainID string, providerAddr t } // ComputeNextValidators computes the validators for the upcoming epoch based on the currently `bondedValidators`. -func (k Keeper) ComputeNextValidators(ctx sdk.Context, chainID string, bondedValidators []stakingtypes.Validator) []types.ConsensusValidator { +func (k Keeper) ComputeNextValidators(ctx sdk.Context, consumerId string, bondedValidators []stakingtypes.Validator) []types.ConsensusValidator { // sort the bonded validators by number of staked tokens in descending order sort.Slice(bondedValidators, func(i, j int) bool { return bondedValidators[i].GetBondedTokens().GT(bondedValidators[j].GetBondedTokens()) @@ -355,7 +356,7 @@ func (k Keeper) ComputeNextValidators(ctx sdk.Context, chainID string, bondedVal // if inactive validators are not allowed, only consider the first `MaxProviderConsensusValidators` validators // since those are the ones that participate in consensus - allowInactiveVals := k.AllowsInactiveValidators(ctx, chainID) + allowInactiveVals := k.AllowsInactiveValidators(ctx, consumerId) if !allowInactiveVals { // only leave the first MaxProviderConsensusValidators bonded validators maxProviderConsensusVals := k.GetMaxProviderConsensusValidators(ctx) @@ -364,11 +365,11 @@ func (k Keeper) ComputeNextValidators(ctx sdk.Context, chainID string, bondedVal } } - nextValidators := k.FilterValidators(ctx, chainID, bondedValidators, + nextValidators := k.FilterValidators(ctx, consumerId, bondedValidators, func(providerAddr types.ProviderConsAddress) bool { - return k.CanValidateChain(ctx, chainID, providerAddr) && k.FulfillsMinStake(ctx, chainID, providerAddr) + return k.CanValidateChain(ctx, consumerId, providerAddr) && k.FulfillsMinStake(ctx, consumerId, providerAddr) }) - nextValidators = k.CapValidatorSet(ctx, chainID, nextValidators) - return k.CapValidatorsPower(ctx, chainID, nextValidators) + nextValidators = k.CapValidatorSet(ctx, consumerId, nextValidators) + return k.CapValidatorsPower(ctx, consumerId, nextValidators) } diff --git a/x/ccv/provider/keeper/validator_set_update.go b/x/ccv/provider/keeper/validator_set_update.go index b4ed48f4e1..a0afc94ef9 100644 --- a/x/ccv/provider/keeper/validator_set_update.go +++ b/x/ccv/provider/keeper/validator_set_update.go @@ -12,53 +12,53 @@ import ( ccv "github.com/cosmos/interchain-security/v5/x/ccv/types" ) -// GetConsumerChainConsensusValidatorsKey returns the store key for consumer validators of the consumer chain with `chainID` -func (k Keeper) GetConsumerChainConsensusValidatorsKey(ctx sdk.Context, chainID string) []byte { - return types.ConsumerIdWithLenKey(types.ConsumerValidatorKeyPrefix(), chainID) +// GetConsumerChainConsensusValidatorsKey returns the store key for consumer validators of the consumer chain with `consumerId` +func (k Keeper) GetConsumerChainConsensusValidatorsKey(ctx sdk.Context, consumerId string) []byte { + return types.ConsumerIdWithLenKey(types.ConsumerValidatorKeyPrefix(), consumerId) } -// SetConsumerValidator sets provided consumer `validator` on the consumer chain with `chainID` +// SetConsumerValidator sets provided consumer `validator` on the consumer chain with `consumerId` func (k Keeper) SetConsumerValidator( ctx sdk.Context, - chainID string, + consumerId string, validator types.ConsensusValidator, ) { - k.setValidator(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, chainID), validator) + k.setValidator(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, consumerId), validator) } // SetConsumerValSet resets the current consumer validators with the `nextValidators` computed by // `FilterValidators` and hence this method should only be called after `FilterValidators` has completed. -func (k Keeper) SetConsumerValSet(ctx sdk.Context, chainID string, nextValidators []types.ConsensusValidator) { - k.setValSet(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, chainID), nextValidators) +func (k Keeper) SetConsumerValSet(ctx sdk.Context, consumerId string, nextValidators []types.ConsensusValidator) { + k.setValSet(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, consumerId), nextValidators) } // DeleteConsumerValidator removes consumer validator with `providerAddr` address func (k Keeper) DeleteConsumerValidator( ctx sdk.Context, - chainID string, + consumerId string, providerConsAddr types.ProviderConsAddress, ) { - k.deleteValidator(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, chainID), providerConsAddr) + k.deleteValidator(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, consumerId), providerConsAddr) } -// DeleteConsumerValSet deletes all the stored consumer validators for chain `chainID` +// DeleteConsumerValSet deletes all the stored consumer validators for chain with `consumerId` func (k Keeper) DeleteConsumerValSet( ctx sdk.Context, - chainID string, + consumerId string, ) { - k.deleteValSet(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, chainID)) + k.deleteValSet(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, consumerId)) } -// IsConsumerValidator returns `true` if the consumer validator with `providerAddr` exists for chain `chainID` +// IsConsumerValidator returns `true` if the consumer validator with `providerAddr` exists for chain with `consumerId` // and `false` otherwise -func (k Keeper) IsConsumerValidator(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress) bool { - return k.isValidator(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, chainID), providerAddr) +func (k Keeper) IsConsumerValidator(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool { + return k.isValidator(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, consumerId), providerAddr) } -// GetConsumerValidator returns the consumer validator with `providerAddr` if it exists for chain `chainID` -func (k Keeper) GetConsumerValidator(ctx sdk.Context, chainID string, providerAddr types.ProviderConsAddress) (types.ConsensusValidator, bool) { +// GetConsumerValidator returns the consumer validator with `providerAddr` if it exists for chain with `consumerId` +func (k Keeper) GetConsumerValidator(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) (types.ConsensusValidator, bool) { store := ctx.KVStore(k.storeKey) - marshalledConsumerValidator := store.Get(types.ConsumerValidatorKey(chainID, providerAddr.ToSdkConsAddr())) + marshalledConsumerValidator := store.Get(types.ConsumerValidatorKey(consumerId, providerAddr.ToSdkConsAddr())) if marshalledConsumerValidator == nil { return types.ConsensusValidator{}, false @@ -72,12 +72,12 @@ func (k Keeper) GetConsumerValidator(ctx sdk.Context, chainID string, providerAd return validator, true } -// GetConsumerValSet returns all the consumer validators for chain `chainID` +// GetConsumerValSet returns all the consumer validators for chain with `consumerId` func (k Keeper) GetConsumerValSet( ctx sdk.Context, - chainID string, + consumerId string, ) ([]types.ConsensusValidator, error) { - return k.getValSet(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, chainID)) + return k.getValSet(ctx, k.GetConsumerChainConsensusValidatorsKey(ctx, consumerId)) } // DiffValidators compares the current and the next epoch's consumer validators and returns the `ValidatorUpdate` diff @@ -121,8 +121,8 @@ func DiffValidators( return updates } -// 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.ConsensusValidator, error) { +// CreateConsumerValidator creates a consumer validator for `consumerId` from the given staking `validator` +func (k Keeper) CreateConsumerValidator(ctx sdk.Context, consumerId string, validator stakingtypes.Validator) (types.ConsensusValidator, error) { valAddr, err := sdk.ValAddressFromBech32(validator.GetOperator()) if err != nil { return types.ConsensusValidator{}, err @@ -138,7 +138,7 @@ func (k Keeper) CreateConsumerValidator(ctx sdk.Context, chainID string, validat validator, err) } - consumerPublicKey, found := k.GetValidatorConsumerPubKey(ctx, chainID, types.NewProviderConsAddress(consAddr)) + consumerPublicKey, found := k.GetValidatorConsumerPubKey(ctx, consumerId, types.NewProviderConsAddress(consAddr)) if !found { consumerPublicKey, err = validator.TmConsPublicKey() if err != nil { @@ -147,7 +147,7 @@ func (k Keeper) CreateConsumerValidator(ctx sdk.Context, chainID string, validat } height := ctx.BlockHeight() - if v, found := k.GetConsumerValidator(ctx, chainID, types.ProviderConsAddress{Address: consAddr}); found { + if v, found := k.GetConsumerValidator(ctx, consumerId, types.ProviderConsAddress{Address: consAddr}); found { // if validator was already a consumer validator, then do not update the height set the first time // the validator became a consumer validator height = v.JoinHeight @@ -165,7 +165,7 @@ func (k Keeper) CreateConsumerValidator(ctx sdk.Context, chainID string, validat // the filtered set. func (k Keeper) FilterValidators( ctx sdk.Context, - chainID string, + consumerId string, bondedValidators []stakingtypes.Validator, predicate func(providerAddr types.ProviderConsAddress) bool, ) []types.ConsensusValidator { @@ -177,7 +177,7 @@ func (k Keeper) FilterValidators( } if predicate(types.NewProviderConsAddress(consAddr)) { - nextValidator, err := k.CreateConsumerValidator(ctx, chainID, val) + nextValidator, err := k.CreateConsumerValidator(ctx, consumerId, 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", diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index c1db6c2328..f1c85d4b47 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -519,9 +519,9 @@ func SlashAcksKey(consumerId string) []byte { return append([]byte{mustGetKeyPrefix(SlashAcksKeyName)}, []byte(consumerId)...) } -// InitChainHeightKey returns the key under which the block height for a given chain ID is stored -func InitChainHeightKey(chainID string) []byte { - return append([]byte{mustGetKeyPrefix(InitChainHeightKeyName)}, []byte(chainID)...) +// InitChainHeightKey returns the key under which the block height for a given consumer id is stored +func InitChainHeightKey(consumerId string) []byte { + return append([]byte{mustGetKeyPrefix(InitChainHeightKeyName)}, []byte(consumerId)...) } // PendingVSCsKey returns the key under which @@ -727,8 +727,8 @@ func ConsumerAddrsToPruneV2KeyPrefix() byte { // ConsumerAddrsToPruneV2Key returns the key for storing the consumer validators // addresses that need to be pruned. -func ConsumerAddrsToPruneV2Key(chainID string, pruneTs time.Time) []byte { - return ChainIdAndTsKey(ConsumerAddrsToPruneV2KeyPrefix(), chainID, pruneTs) +func ConsumerAddrsToPruneV2Key(consumerId string, pruneTs time.Time) []byte { + return ConsumerIdAndTsKey(ConsumerAddrsToPruneV2KeyPrefix(), consumerId, pruneTs) } // LastProviderConsensusValsPrefix returns the key prefix for storing the last validator set sent to the consensus engine of the provider chain @@ -736,7 +736,7 @@ func LastProviderConsensusValsPrefix() []byte { return []byte{mustGetKeyPrefix(LastProviderConsensusValsKeyName)} } -// MinStakeKey returns the key used to store the minimum stake required to validate on consumer chain `chainID` +// MinStakeKey returns the key used to store the minimum stake required to validate on consumer chain with `consumerId` func MinStakeKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(MinStakeKeyName), consumerId) } @@ -802,9 +802,9 @@ func ClientIdToConsumerIdKey(clientId string) []byte { return ccvtypes.AppendMany( // Append the prefix []byte{mustGetKeyPrefix(ClientIdToConsumerIdKeyName)}, - // Append the chainID length + // Append the client id length sdk.Uint64ToBigEndian(uint64(clientIdLength)), - // Append the chainID + // Append the client id []byte(clientId), ) } @@ -819,10 +819,10 @@ func ClientIdToConsumerIdKey(clientId string) []byte { // Generic helpers section // -// ChainIdAndTsKey returns the key with the following format: -// bytePrefix | len(chainID) | chainID | timestamp -func ChainIdAndTsKey(prefix byte, chainID string, timestamp time.Time) []byte { - partialKey := ConsumerIdWithLenKey(prefix, chainID) +// ConsumerIdAndTsKey returns the key with the following format: +// bytePrefix | len(consumerId) | consumerId | timestamp +func ConsumerIdAndTsKey(prefix byte, consumerId string, timestamp time.Time) []byte { + partialKey := ConsumerIdWithLenKey(prefix, consumerId) timeBz := sdk.FormatTimeBytes(timestamp) return ccvtypes.AppendMany( // Append the partialKey @@ -838,27 +838,27 @@ func ConsumerIdWithLenKey(prefix byte, consumerId string) []byte { return ccvtypes.AppendMany( // Append the prefix []byte{prefix}, - // Append the chainID length + // Append the consumer id length sdk.Uint64ToBigEndian(uint64(len(consumerId))), - // Append the chainID + // Append the consumer id []byte(consumerId), ) } -// ParseChainIdAndTsKey returns the chain ID and time for a ChainIdAndTs key -func ParseChainIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { +// ParseConsumerIdAndTsKey returns the consumer id and time for a ConsumerIdIdAndTs key +func ParseConsumerIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { return "", time.Time{}, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) } - chainIdL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) - chainID := string(bz[prefixL+8 : prefixL+8+int(chainIdL)]) - timestamp, err := sdk.ParseTimeBytes(bz[prefixL+8+int(chainIdL):]) + consumerIdL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) + consumerId := string(bz[prefixL+8 : prefixL+8+int(consumerIdL)]) + timestamp, err := sdk.ParseTimeBytes(bz[prefixL+8+int(consumerIdL):]) if err != nil { return "", time.Time{}, err } - return chainID, timestamp, nil + return consumerId, timestamp, nil } // ChainIdAndUintIdKey returns the key with the following format: diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index e0a4da3b49..08549b90df 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -230,12 +230,12 @@ func TestChainIdAndTsKeyAndParse(t *testing.T) { } for _, test := range tests { - key := providertypes.ChainIdAndTsKey(test.prefix, test.chainID, test.timestamp) + key := providertypes.ConsumerIdAndTsKey(test.prefix, test.chainID, test.timestamp) require.NotEmpty(t, key) // Expected bytes = prefix + chainID length + chainID + time bytes expectedLen := 1 + 8 + len(test.chainID) + len(sdk.FormatTimeBytes(time.Time{})) require.Equal(t, expectedLen, len(key)) - parsedID, parsedTime, err := providertypes.ParseChainIdAndTsKey(test.prefix, key) + parsedID, parsedTime, err := providertypes.ParseConsumerIdAndTsKey(test.prefix, key) require.Equal(t, test.chainID, parsedID) require.Equal(t, test.timestamp.UTC(), parsedTime.UTC()) require.NoError(t, err) From c7461ed29782bee018dd9e527776fbcf92f96701 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 13 Aug 2024 11:03:01 +0200 Subject: [PATCH 25/41] updated based on comments Co-authored-by: bernd-m <43466467+bermuell@users.noreply.github.com> --- .../ccv/provider/v1/provider.proto | 6 - .../ccv/provider/v1/tx.proto | 8 +- tests/integration/setup.go | 3 +- testutil/keeper/unit_test_helpers.go | 12 +- x/ccv/provider/client/cli/query.go | 28 + x/ccv/provider/client/cli/tx.go | 14 +- x/ccv/provider/handler.go | 12 + .../provider/keeper/consumer_equivocation.go | 22 +- x/ccv/provider/keeper/grpc_query.go | 47 +- x/ccv/provider/keeper/grpc_query_test.go | 59 +- x/ccv/provider/keeper/hooks.go | 4 +- x/ccv/provider/keeper/keeper.go | 226 ++----- x/ccv/provider/keeper/keeper_test.go | 205 ++++--- x/ccv/provider/keeper/key_assignment.go | 4 +- x/ccv/provider/keeper/key_assignment_test.go | 8 +- x/ccv/provider/keeper/legacy_proposal_test.go | 42 +- x/ccv/provider/keeper/msg_server.go | 69 ++- x/ccv/provider/keeper/msg_server_test.go | 48 +- x/ccv/provider/keeper/partial_set_security.go | 32 +- .../keeper/partial_set_security_test.go | 192 +++--- x/ccv/provider/keeper/permissionless.go | 563 +++++++++++++----- x/ccv/provider/keeper/permissionless_test.go | 163 +++-- x/ccv/provider/keeper/proposal.go | 92 ++- x/ccv/provider/keeper/proposal_test.go | 62 +- x/ccv/provider/keeper/relay.go | 20 +- x/ccv/provider/keeper/relay_test.go | 44 +- .../keeper/validator_set_update_test.go | 28 +- .../provider/migrations/v5/migration_test.go | 6 +- x/ccv/provider/migrations/v5/migrations.go | 7 +- x/ccv/provider/migrations/v6/migrations.go | 7 +- x/ccv/provider/types/keys.go | 197 +++--- x/ccv/provider/types/keys_test.go | 50 +- x/ccv/provider/types/msg.go | 57 +- x/ccv/provider/types/provider.pb.go | 480 ++++----------- x/ccv/provider/types/tx.pb.go | 291 +++++---- 35 files changed, 1614 insertions(+), 1494 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index e79d031f08..281d15b4fc 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -285,12 +285,6 @@ message ConsumerRemovalProposals { // AddressList contains a list of consensus addresses message AddressList { repeated bytes addresses = 1; } -// ChannelToChain is used to map a CCV channel ID to the consumer chainID -message ChannelToChain { - string channel_id = 1; - string chain_id = 2; -} - // ValidatorSetChangePackets is a pb list of ccv.ValidatorSetChangePacketData. message ValidatorSetChangePackets { repeated interchain_security.ccv.v1.ValidatorSetChangePacketData list = 1 diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index acee16bc7a..0e4aa1b9f0 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -261,12 +261,14 @@ message MsgRegisterConsumer { // ConsumerRegistrationRecord is the record that contains information for the registered chain message ConsumerRegistrationRecord { - // the title of the chain to-be-registered + // the title of the chain that is to be registered string title = 1; - // the description of the chain to-be-registered + // the description of the chain that is to be registered string description = 2; + // the metadata (e.g., GitHub repository URL) of the chain that is to be registered + string metadata = 3; // the chain id of the new consumer chain - string chain_id = 3; + string chain_id = 4; } // MsgRegisterConsumerResponse defines response type for MsgRegisterConsumer diff --git a/tests/integration/setup.go b/tests/integration/setup.go index eeb980200f..11ce3eaf11 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -167,8 +167,7 @@ func (suite *CCVTestSuite) SetupTest() { suite.registerPacketSniffer(bundle.Chain) // check that TopN is correctly set for the consumer - topN, found := providerKeeper.GetTopN(suite.providerCtx(), bundle.Chain.ChainID) - suite.Require().True(found) + topN := providerKeeper.GetTopN(suite.providerCtx(), bundle.Chain.ChainID) suite.Require().Equal(bundle.TopN, topN) } diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index 3ad6b3d67b..a627893831 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -231,10 +231,10 @@ func SetupForStoppingConsumerChain(t *testing.T, ctx sdk.Context, gomock.InOrder(expectations...) - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, GetTestRegistrationRecord()) - providerKeeper.SetConsumerIdToInitializationRecord(ctx, consumerId, GetTestInitializationRecord()) - providerKeeper.SetConsumerIdToUpdateRecord(ctx, consumerId, GetTestUpdateRecord()) - providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Initialized) + providerKeeper.SetConsumerRegistrationRecord(ctx, consumerId, GetTestRegistrationRecord()) + providerKeeper.SetConsumerInitializationRecord(ctx, consumerId, GetTestInitializationRecord()) + providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, GetTestUpdateRecord()) + providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) err := providerKeeper.CreateConsumerClient(ctx, consumerId) require.NoError(t, err) @@ -261,8 +261,8 @@ func TestProviderStateIsCleanedAfterConsumerChainIsStopped(t *testing.T, ctx sdk require.Empty(t, acks) // in case the chain was successfully stopped, it should not contain a Top N associated to it - _, found = providerKeeper.GetTopN(ctx, consumerId) - require.False(t, found) + topN := providerKeeper.GetTopN(ctx, consumerId) + require.Zero(t, topN) // test key assignment state is cleaned require.Empty(t, providerKeeper.GetAllValidatorConsumerPubKeys(ctx, &consumerId)) diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index d344e5efce..b58c230612 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -40,6 +40,7 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand(CmdConsumerChainsValidatorHasToValidate()) cmd.AddCommand(CmdValidatorConsumerCommissionRate()) cmd.AddCommand(CmdBlocksUntilNextEpoch()) + cmd.AddCommand(CmdConsumerIdFromClientId()) return cmd } @@ -596,3 +597,30 @@ func CmdBlocksUntilNextEpoch() *cobra.Command { return cmd } + +func CmdConsumerIdFromClientId() *cobra.Command { + cmd := &cobra.Command{ + Use: "consumer-id-from-client-id [client-id]", + Short: "Query the the consumer id of the chain associated with the provided client id", + 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) + + req := &types.QueryConsumerIdFromClientIdRequest{ClientId: args[0]} + res, err := queryClient.QueryConsumerIdFromClientId(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/ccv/provider/client/cli/tx.go b/x/ccv/provider/client/cli/tx.go index 9dfbd741fb..c81d92f68c 100644 --- a/x/ccv/provider/client/cli/tx.go +++ b/x/ccv/provider/client/cli/tx.go @@ -224,9 +224,9 @@ Note that the one that signs this message is the owner of this consumer chain. T changed by updating the consumer chain. Example: -%s tx provider register-cosumer [path/to/registration-record.json] --from node0 --home ../node0 --chain-id $CID +%s tx provider register-consumer [path/to/registration-record.json] --from node0 --home ../node0 --chain-id $CID `, version.AppName)), - Args: cobra.ExactArgs(3), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -277,9 +277,9 @@ func NewInitializeConsumerCmd() *cobra.Command { Note that only the owner of the chain can initialize it. Example: -%s tx provider initialize-cosumer [consumer-id] [path/to/initialization-record.json] --from node0 --home ../node0 --chain-id $CID +%s tx provider initialize-consumer [consumer-id] [path/to/initialization-record.json] --from node0 --home ../node0 --chain-id $CID `, version.AppName)), - Args: cobra.ExactArgs(3), + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -331,9 +331,9 @@ func NewUpdateConsumerCmd() *cobra.Command { Note that only the owner of the chain can initialize it. Example: -%s tx provider update-cosumer [consumer-id] [path/to/update-record.json] --from node0 --home ../node0 --chain-id $CID +%s tx provider update-consumer [consumer-id] [path/to/update-record.json] --from node0 --home ../node0 --chain-id $CID `, version.AppName)), - Args: cobra.ExactArgs(3), + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -385,7 +385,7 @@ func NewRemoveConsumerCmd() *cobra.Command { Stop time is parsed by using the layout and the value (see https://pkg.go.dev/time#Parse). Example: -%s tx provider remove-cosumer [consumer-id] [stop-time-layout] [stop-time-value] --from node0 --home ../node0 --chain-id $CID +%s tx provider remove-consumer [consumer-id] [stop-time-layout] [stop-time-value] --from node0 --home ../node0 --chain-id $CID `, version.AppName)), Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/x/ccv/provider/handler.go b/x/ccv/provider/handler.go index 78e17257de..81d3a9a065 100644 --- a/x/ccv/provider/handler.go +++ b/x/ccv/provider/handler.go @@ -36,6 +36,18 @@ func NewHandler(k *keeper.Keeper) baseapp.MsgServiceHandler { case *types.MsgSetConsumerCommissionRate: res, err := msgServer.SetConsumerCommissionRate(ctx, msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgRegisterConsumer: + res, err := msgServer.RegisterConsumer(ctx, msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgInitializeConsumer: + res, err := msgServer.InitializeConsumer(ctx, msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgUpdateConsumer: + res, err := msgServer.UpdateConsumer(ctx, msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgRemoveConsumer: + res, err := msgServer.RemoveConsumer(ctx, msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } diff --git a/x/ccv/provider/keeper/consumer_equivocation.go b/x/ccv/provider/keeper/consumer_equivocation.go index 1f058cfe27..79b3fa4f93 100644 --- a/x/ccv/provider/keeper/consumer_equivocation.go +++ b/x/ccv/provider/keeper/consumer_equivocation.go @@ -58,17 +58,13 @@ func (k Keeper) HandleConsumerDoubleVoting( } // get the chainId of this consumer chain to verify the double-voting evidence - chainId, found := k.GetConsumerIdToRegistrationRecord(ctx, consumerId) - if !found { - return errorsmod.Wrapf( - ccvtypes.ErrInvalidDoubleVotingEvidence, - "could not find the chain id of the consumer chain with consuemr id: %s", - consumerId, - ) + chainId, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + if err != nil { + return err } // verifies the double voting evidence using the consumer chain public key - if err := k.VerifyDoubleVotingEvidence(*evidence, chainId.ChainId, pubkey); err != nil { + if err = k.VerifyDoubleVotingEvidence(*evidence, chainId.ChainId, pubkey); err != nil { return err } @@ -79,10 +75,10 @@ func (k Keeper) HandleConsumerDoubleVoting( types.NewConsumerConsAddress(sdk.ConsAddress(evidence.VoteA.ValidatorAddress.Bytes())), ) - if err := k.SlashValidator(ctx, providerAddr); err != nil { + if err = k.SlashValidator(ctx, providerAddr); err != nil { return err } - if err := k.JailAndTombstoneValidator(ctx, providerAddr); err != nil { + if err = k.JailAndTombstoneValidator(ctx, providerAddr); err != nil { return err } @@ -305,9 +301,9 @@ func headerToLightBlock(h ibctmtypes.Header) (*tmtypes.LightBlock, error) { func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { chainId := misbehaviour.Header1.Header.ChainID - registrationRecord, found := k.GetConsumerIdToRegistrationRecord(ctx, consumerId) - if !found { - return fmt.Errorf("cannot find registration record of consumer chain (consumerId): %s", consumerId) + registrationRecord, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + if err != nil { + return err } else if registrationRecord.ChainId != chainId { return fmt.Errorf("incorrect misbheaviour for a different chain id (%s) than that of the consumer chain %s (consumerId): %s", chainId, diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 3afab65af8..98d6171233 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -25,15 +25,16 @@ func (k Keeper) QueryConsumerGenesis(c context.Context, req *types.QueryConsumer return nil, status.Errorf(codes.InvalidArgument, "empty request") } - if req.ConsumerId == "" { - return nil, status.Errorf(codes.InvalidArgument, "invalid request: consumer id cannot be empty") + consumerId := req.ConsumerId + if err := types.ValidateConsumerId(consumerId); err != nil { + return nil, status.Error(codes.InvalidArgument, errorsmod.Wrap(types.ErrInvalidConsumerId, consumerId).Error()) } - gen, ok := k.GetConsumerGenesis(ctx, req.ConsumerId) + gen, ok := k.GetConsumerGenesis(ctx, consumerId) if !ok { return nil, status.Error( codes.NotFound, - errorsmod.Wrap(types.ErrUnknownConsumerId, req.ConsumerId).Error(), + errorsmod.Wrap(types.ErrUnknownConsumerId, consumerId).Error(), ) } @@ -66,11 +67,7 @@ func (k Keeper) GetConsumerChain(ctx sdk.Context, consumerId string) (types.Chai return types.Chain{}, fmt.Errorf("cannot find clientID for consumer (%s)", consumerId) } - topN, found := k.GetTopN(ctx, consumerId) - if !found { - k.Logger(ctx).Error("failed to get top N, treating as 0", "chain", consumerId) - topN = 0 - } + topN := k.GetTopN(ctx, consumerId) // Get the minimal power in the top N for the consumer chain minPowerInTopN, found := k.GetMinimumPowerInTopN(ctx, consumerId) @@ -79,9 +76,9 @@ func (k Keeper) GetConsumerChain(ctx sdk.Context, consumerId string) (types.Chai minPowerInTopN = -1 } - validatorSetCap, _ := k.GetValidatorSetCap(ctx, consumerId) + validatorSetCap := k.GetValidatorSetCap(ctx, consumerId) - validatorsPowerCap, _ := k.GetValidatorsPowerCap(ctx, consumerId) + validatorsPowerCap := k.GetValidatorsPowerCap(ctx, consumerId) allowlist := k.GetAllowList(ctx, consumerId) strAllowlist := make([]string, len(allowlist)) @@ -147,13 +144,18 @@ func (k Keeper) QueryValidatorConsumerAddr(goCtx context.Context, req *types.Que ctx := sdk.UnwrapSDKContext(goCtx) + consumerId := req.ConsumerId + if err := types.ValidateConsumerId(consumerId); err != nil { + return nil, status.Error(codes.InvalidArgument, errorsmod.Wrap(types.ErrInvalidConsumerId, consumerId).Error()) + } + providerAddrTmp, err := sdk.ConsAddressFromBech32(req.ProviderAddress) if err != nil { return nil, err } providerAddr := types.NewProviderConsAddress(providerAddrTmp) - consumerKey, found := k.GetValidatorConsumerPubKey(ctx, req.ConsumerId, providerAddr) + consumerKey, found := k.GetValidatorConsumerPubKey(ctx, consumerId, providerAddr) if !found { return &types.QueryValidatorConsumerAddrResponse{}, nil } @@ -242,15 +244,16 @@ func (k Keeper) QueryAllPairsValConAddrByConsumerChainID(goCtx context.Context, return nil, status.Error(codes.InvalidArgument, "empty request") } - if req.ConsumerId == "" { - return nil, status.Errorf(codes.InvalidArgument, "invalid request: consumer id cannot be empty") + consumerId := req.ConsumerId + if err := types.ValidateConsumerId(consumerId); err != nil { + return nil, status.Error(codes.InvalidArgument, errorsmod.Wrap(types.ErrInvalidConsumerId, consumerId).Error()) } // list of pairs valconsensus addr pairValConAddrs := []*types.PairValConAddrProviderAndConsumer{} ctx := sdk.UnwrapSDKContext(goCtx) - validatorConsumerPubKeys := k.GetAllValidatorConsumerPubKeys(ctx, &req.ConsumerId) + validatorConsumerPubKeys := k.GetAllValidatorConsumerPubKeys(ctx, &consumerId) for _, data := range validatorConsumerPubKeys { consumerAddr, err := ccvtypes.TMCryptoPublicKeyToConsAddr(*data.ConsumerKey) if err != nil { @@ -287,8 +290,8 @@ func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req * } consumerId := req.ConsumerId - if consumerId == "" { - return nil, status.Error(codes.InvalidArgument, "empty consumer id") + if err := types.ValidateConsumerId(consumerId); err != nil { + return nil, status.Error(codes.InvalidArgument, errorsmod.Wrap(types.ErrInvalidConsumerId, consumerId).Error()) } optedInVals := []string{} @@ -314,8 +317,8 @@ func (k Keeper) QueryConsumerValidators(goCtx context.Context, req *types.QueryC } consumerId := req.ConsumerId - if consumerId == "" { - return nil, status.Error(codes.InvalidArgument, "empty consumer id") + if err := types.ValidateConsumerId(consumerId); err != nil { + return nil, status.Error(codes.InvalidArgument, errorsmod.Wrap(types.ErrInvalidConsumerId, consumerId).Error()) } ctx := sdk.UnwrapSDKContext(goCtx) @@ -413,7 +416,7 @@ func (k Keeper) hasToValidate( if err != nil { return false, nil } - if topN, found := k.GetTopN(ctx, consumerId); found && topN > 0 { + if topN := k.GetTopN(ctx, consumerId); topN > 0 { // in a Top-N chain, we automatically opt in all validators that belong to the top N minPower, found := k.GetMinimumPowerInTopN(ctx, consumerId) if found { @@ -450,8 +453,8 @@ func (k Keeper) QueryValidatorConsumerCommissionRate(goCtx context.Context, req } consumerId := req.ConsumerId - if consumerId == "" { - return nil, status.Error(codes.InvalidArgument, "empty chainId") + if err := types.ValidateConsumerId(consumerId); err != nil { + return nil, status.Error(codes.InvalidArgument, errorsmod.Wrap(types.ErrInvalidConsumerId, consumerId).Error()) } consAddr, err := sdk.ConsAddressFromBech32(req.ProviderAddress) diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index 3806118159..d4186539fe 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -21,7 +21,7 @@ import ( ) func TestQueryAllPairsValConAddrByConsumerChainID(t *testing.T) { - chainID := consumer + consumerId := "0" providerConsAddress, err := sdk.ConsAddressFromBech32("cosmosvalcons1wpex7anfv3jhystyv3eq20r35a") require.NoError(t, err) @@ -34,9 +34,9 @@ func TestQueryAllPairsValConAddrByConsumerChainID(t *testing.T) { pk, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - pk.SetValidatorConsumerPubKey(ctx, chainID, providerAddr, consumerKey) + pk.SetValidatorConsumerPubKey(ctx, consumerId, providerAddr, consumerKey) - consumerPubKey, found := pk.GetValidatorConsumerPubKey(ctx, chainID, providerAddr) + consumerPubKey, found := pk.GetValidatorConsumerPubKey(ctx, consumerId, providerAddr) require.True(t, found, "consumer pubkey not found") require.NotEmpty(t, consumerPubKey, "consumer pubkey is empty") require.Equal(t, consumerPubKey, consumerKey) @@ -50,12 +50,11 @@ func TestQueryAllPairsValConAddrByConsumerChainID(t *testing.T) { require.Error(t, err) // Request with chainId is invalid - response, err := pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ConsumerId: "invalidChainId"}) - require.NoError(t, err) - require.Equal(t, []*types.PairValConAddrProviderAndConsumer{}, response.PairValConAddr) + response, err := pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ConsumerId: "invalidConsumerId"}) + require.Error(t, err) // Request is valid - response, err = pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ConsumerId: chainID}) + response, err = pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ConsumerId: consumerId}) require.NoError(t, err) expectedResult := types.PairValConAddrProviderAndConsumer{ @@ -68,20 +67,20 @@ func TestQueryAllPairsValConAddrByConsumerChainID(t *testing.T) { } func TestQueryConsumerChainOptedInValidators(t *testing.T) { - chainID := "chainID" - pk, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() + consumerId := "0" + req := types.QueryConsumerChainOptedInValidatorsRequest{ - ConsumerId: chainID, + ConsumerId: consumerId, } // error returned from not yet proposed or not yet registered chain _, err := pk.QueryConsumerChainOptedInValidators(ctx, &req) require.Error(t, err) - pk.SetProposedConsumerChain(ctx, chainID, 1) + pk.SetProposedConsumerChain(ctx, consumerId, 1) providerAddr1 := types.NewProviderConsAddress([]byte("providerAddr1")) providerAddr2 := types.NewProviderConsAddress([]byte("providerAddr2")) @@ -89,21 +88,21 @@ func TestQueryConsumerChainOptedInValidators(t *testing.T) { ValidatorsProviderAddresses: []string{providerAddr1.String(), providerAddr2.String()}, } - pk.SetOptedIn(ctx, chainID, providerAddr1) - pk.SetOptedIn(ctx, chainID, providerAddr2) + pk.SetOptedIn(ctx, consumerId, providerAddr1) + pk.SetOptedIn(ctx, consumerId, providerAddr2) res, err := pk.QueryConsumerChainOptedInValidators(ctx, &req) require.NoError(t, err) require.Equal(t, &expectedResponse, res) } func TestQueryConsumerValidators(t *testing.T) { - chainID := "chainID" - pk, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() + consumerId := "0" + req := types.QueryConsumerValidatorsRequest{ - ConsumerId: chainID, + ConsumerId: consumerId, } // error returned from not-started chain @@ -114,13 +113,13 @@ func TestQueryConsumerValidators(t *testing.T) { consumerKey1 := cryptotestutil.NewCryptoIdentityFromIntSeed(1).TMProtoCryptoPublicKey() consumerValidator1 := types.ConsensusValidator{ProviderConsAddr: providerAddr1.ToSdkConsAddr(), Power: 1, PublicKey: &consumerKey1} expectedCommissionRate1 := math.LegacyMustNewDecFromStr("0.123") - pk.SetConsumerCommissionRate(ctx, chainID, providerAddr1, expectedCommissionRate1) + pk.SetConsumerCommissionRate(ctx, consumerId, providerAddr1, expectedCommissionRate1) providerAddr2 := types.NewProviderConsAddress([]byte("providerAddr2")) consumerKey2 := cryptotestutil.NewCryptoIdentityFromIntSeed(2).TMProtoCryptoPublicKey() consumerValidator2 := types.ConsensusValidator{ProviderConsAddr: providerAddr2.ToSdkConsAddr(), Power: 2, PublicKey: &consumerKey2} expectedCommissionRate2 := math.LegacyMustNewDecFromStr("0.123") - pk.SetConsumerCommissionRate(ctx, chainID, providerAddr2, expectedCommissionRate2) + pk.SetConsumerCommissionRate(ctx, consumerId, providerAddr2, expectedCommissionRate2) expectedResponse := types.QueryConsumerValidatorsResponse{ Validators: []*types.QueryConsumerValidatorsValidator{ @@ -130,15 +129,15 @@ func TestQueryConsumerValidators(t *testing.T) { } // set up the client id so the chain looks like it "started" - pk.SetConsumerClientId(ctx, chainID, "clientID") - pk.SetConsumerValSet(ctx, chainID, []types.ConsensusValidator{consumerValidator1, consumerValidator2}) + pk.SetConsumerClientId(ctx, consumerId, "clientID") + pk.SetConsumerValSet(ctx, consumerId, []types.ConsensusValidator{consumerValidator1, consumerValidator2}) res, err := pk.QueryConsumerValidators(ctx, &req) require.NoError(t, err) require.Equal(t, &expectedResponse, res) // validator with no set consumer commission rate - pk.DeleteConsumerCommissionRate(ctx, chainID, providerAddr1) + pk.DeleteConsumerCommissionRate(ctx, consumerId, providerAddr1) expectedCommissionRate := math.LegacyMustNewDecFromStr("0.456") // because no consumer commission rate is set, the validator's set commission rate on the provider is used val := stakingtypes.Validator{Commission: stakingtypes.Commission{CommissionRates: stakingtypes.CommissionRates{Rate: expectedCommissionRate}}} @@ -197,14 +196,14 @@ func TestQueryConsumerChainsValidatorHasToValidate(t *testing.T) { } func TestQueryValidatorConsumerCommissionRate(t *testing.T) { - chainID := "chainID" + consumerId := "0" pk, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) req := types.QueryValidatorConsumerCommissionRateRequest{ - ConsumerId: chainID, + ConsumerId: consumerId, ProviderAddress: providerAddr.String(), } @@ -212,15 +211,15 @@ func TestQueryValidatorConsumerCommissionRate(t *testing.T) { _, err := pk.QueryValidatorConsumerCommissionRate(ctx, &req) require.Error(t, err) - pk.SetProposedConsumerChain(ctx, chainID, 1) + pk.SetProposedConsumerChain(ctx, consumerId, 1) // validator with set consumer commission rate expectedCommissionRate := math.LegacyMustNewDecFromStr("0.123") - pk.SetConsumerCommissionRate(ctx, chainID, providerAddr, expectedCommissionRate) + pk.SetConsumerCommissionRate(ctx, consumerId, providerAddr, expectedCommissionRate) res, _ := pk.QueryValidatorConsumerCommissionRate(ctx, &req) require.Equal(t, expectedCommissionRate, res.Rate) // validator with no set consumer commission rate - pk.DeleteConsumerCommissionRate(ctx, chainID, providerAddr) + pk.DeleteConsumerCommissionRate(ctx, consumerId, providerAddr) expectedCommissionRate = math.LegacyMustNewDecFromStr("0.456") // because no consumer commission rate is set, the validator's set commission rate on the provider is used @@ -285,9 +284,11 @@ func TestGetConsumerChain(t *testing.T) { clientID := fmt.Sprintf("client-%d", len(chainIDs)-i) topN := topNs[i] pk.SetConsumerClientId(ctx, chainID, clientID) - pk.SetTopN(ctx, chainID, topN) - pk.SetValidatorSetCap(ctx, chainID, validatorSetCaps[i]) - pk.SetValidatorsPowerCap(ctx, chainID, validatorPowerCaps[i]) + pk.SetConsumerUpdateRecord(ctx, chainID, types.ConsumerUpdateRecord{ + Top_N: topN, + ValidatorSetCap: validatorSetCaps[i], + ValidatorsPowerCap: validatorPowerCaps[i], + }) pk.SetMinimumPowerInTopN(ctx, chainID, expectedMinPowerInTopNs[i]) for _, addr := range allowlists[i] { pk.SetAllowlist(ctx, chainID, addr) diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index a72f60080f..f2989df08e 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -117,8 +117,8 @@ func (h Hooks) AfterProposalSubmission(goCtx context.Context, proposalID uint64) } // AfterProposalVotingPeriodEnded - call hook if registered -// After proposal voting ends, the consumer chainID in store is deleted. -// When a consumerAddition proposal passes, the consumer chainID is available in providerKeeper.GetAllPendingConsumerAdditionProps +// After proposal voting ends, the consumer consumerId in store is deleted. +// When a consumerAddition proposal passes, the consumer consumerId is available in providerKeeper.GetAllPendingConsumerAdditionProps // or providerKeeper.GetAllConsumerChains(ctx). func (h Hooks) AfterProposalVotingPeriodEnded(goCtx context.Context, proposalID uint64) error { ctx := sdk.UnwrapSDKContext(goCtx) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 0189ffb8d4..d6af0bde0a 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -218,7 +218,7 @@ func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, consumerId string, pro store.Set(types.ProposedConsumerChainKey(proposalID), []byte(consumerId)) } -// GetProposedConsumerChain returns the proposed chainID for the given consumerAddition proposal ID. +// GetProposedConsumerChain returns the proposed consumerId for the given consumerAddition proposal ID. // This method is only used for testing. func (k Keeper) GetProposedConsumerChain(ctx sdk.Context, proposalID uint64) (string, bool) { store := ctx.KVStore(k.storeKey) @@ -229,14 +229,14 @@ func (k Keeper) GetProposedConsumerChain(ctx sdk.Context, proposalID uint64) (st return "", false } -// DeleteProposedConsumerChainInStore deletes the consumer chainID from store +// DeleteProposedConsumerChainInStore deletes the consumer consumerId from store // which is in gov consumerAddition proposal func (k Keeper) DeleteProposedConsumerChainInStore(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(k.storeKey) store.Delete(types.ProposedConsumerChainKey(proposalID)) } -// GetAllProposedConsumerChainIDs returns the proposed chainID of all gov consumerAddition proposals that are still in the voting period. +// GetAllProposedConsumerChainIDs returns the proposed consumerId of all gov consumerAddition proposals that are still in the voting period. func (k Keeper) GetAllProposedConsumerChainIDs(ctx sdk.Context) []types.ProposedChain { store := ctx.KVStore(k.storeKey) iterator := storetypes.KVStorePrefixIterator(store, types.ProposedConsumerChainKeyPrefix()) @@ -274,7 +274,7 @@ func (k Keeper) GetAllPendingConsumerChainIDs(ctx sdk.Context) []string { // created IBC clients. Consumer chains with created clients are also referred to as registered. // // Note that the registered consumer chains are stored under keys with the following format: -// ConsumerIdToClientIdKeyPrefix | chainID +// ConsumerIdToClientIdKeyPrefix | consumerId // Thus, the returned array is in ascending order of chainIDs. func (k Keeper) GetAllRegisteredConsumerChainIDs(ctx sdk.Context) []string { chainIDs := []string{} @@ -284,7 +284,7 @@ func (k Keeper) GetAllRegisteredConsumerChainIDs(ctx sdk.Context) []string { defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - // remove 1 byte prefix from key to retrieve chainID + // remove 1 byte prefix from key to retrieve consumerId chainID := string(iterator.Key()[1:]) chainIDs = append(chainIDs, chainID) } @@ -314,14 +314,17 @@ func (k Keeper) DeleteChannelIdToConsumerId(ctx sdk.Context, channelId string) { store.Delete(types.ChannelToConsumerIdKey(channelId)) } -// GetAllChannelToChains gets all channel to chain mappings. If a mapping exists, +// GetAllChannelToConsumers gets all channel to chain mappings. If a mapping exists, // then the CCV channel to that consumer chain is established. // -// Note that mapping from CCV channel IDs to consumer chainIDs +// Note that mapping from CCV channel IDs to consumer IDs // is stored under keys with the following format: // ChannelIdToConsumerIdKeyPrefix | channelID // Thus, the returned array is in ascending order of channelIDs. -func (k Keeper) GetAllChannelToChains(ctx sdk.Context) (channels []types.ChannelToChain) { +func (k Keeper) GetAllChannelToConsumers(ctx sdk.Context) (channelsToConsumers []struct { + ChannelId string + ConsumerId string +}) { store := ctx.KVStore(k.storeKey) iterator := storetypes.KVStorePrefixIterator(store, types.ChannelIdToConsumerIdKeyPrefix()) defer iterator.Close() @@ -329,15 +332,18 @@ func (k Keeper) GetAllChannelToChains(ctx sdk.Context) (channels []types.Channel for ; iterator.Valid(); iterator.Next() { // remove prefix from key to retrieve channelID channelID := string(iterator.Key()[1:]) - chainID := string(iterator.Value()) - - channels = append(channels, types.ChannelToChain{ - ChannelId: channelID, - ChainId: chainID, + consumerId := string(iterator.Value()) + + channelsToConsumers = append(channelsToConsumers, struct { + ChannelId string + ConsumerId string + }{ + ChannelId: channelID, + ConsumerId: consumerId, }) } - return channels + return channelsToConsumers } func (k Keeper) SetConsumerGenesis(ctx sdk.Context, consumerId string, gen ccv.ConsumerGenesisState) error { @@ -745,52 +751,23 @@ func (k Keeper) GetAllRegisteredAndProposedChainIDs(ctx sdk.Context) []string { return allConsumerChains } -// SetTopN stores the N value associated to chain with `chainID` -func (k Keeper) SetTopN( - ctx sdk.Context, - consumerId string, - N uint32, -) { - store := ctx.KVStore(k.storeKey) - - buf := make([]byte, 4) - binary.BigEndian.PutUint32(buf, N) - - store.Set(types.TopNKey(consumerId), buf) -} - -// DeleteTopN removes the N value associated to chain with `chainID` -func (k Keeper) DeleteTopN( - ctx sdk.Context, - consumerId string, -) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.TopNKey(consumerId)) -} - -// GetTopN returns (N, true) if chain `chainID` has a top N associated, and (0, false) otherwise. +// GetTopN returns N if chain `consumerId` has a top N associated, and 0 otherwise. func (k Keeper) GetTopN( ctx sdk.Context, consumerId string, -) (uint32, bool) { - store := ctx.KVStore(k.storeKey) - buf := store.Get(types.TopNKey(consumerId)) - if buf == nil { - return 0, false - } - return binary.BigEndian.Uint32(buf), true +) uint32 { + updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + return updateRecord.Top_N } -// 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 `consumerId` is a Top-N chain (i.e., enforces at least one validator to validate chain `consumerId`) func (k Keeper) IsTopN(ctx sdk.Context, consumerId string) bool { - topN, found := k.GetTopN(ctx, consumerId) - return found && topN > 0 + return k.GetTopN(ctx, consumerId) > 0 } -// IsOptIn returns true if chain with `consumerId` is an Opt-In chain (i.e., no validator is forced to validate chain `chainID`) +// IsOptIn returns true if chain with `consumerId` is an Opt-In chain (i.e., no validator is forced to validate chain `consumerId`) func (k Keeper) IsOptIn(ctx sdk.Context, consumerId string) bool { - topN, found := k.GetTopN(ctx, consumerId) - return !found || topN == 0 + return k.GetTopN(ctx, consumerId) == 0 } func (k Keeper) SetOptedIn( @@ -820,7 +797,7 @@ func (k Keeper) IsOptedIn( return store.Get(types.OptedInKey(consumerId, providerAddr)) != nil } -// GetAllOptedIn returns all the opted-in validators on chain `chainID` +// GetAllOptedIn returns all the opted-in validators on chain `consumerId` func (k Keeper) GetAllOptedIn( ctx sdk.Context, consumerId string, @@ -837,7 +814,7 @@ func (k Keeper) GetAllOptedIn( return providerConsAddresses } -// DeleteAllOptedIn deletes all the opted-in validators for chain with `chainID` +// DeleteAllOptedIn deletes all the opted-in validators for chain with `consumerId` func (k Keeper) DeleteAllOptedIn( ctx sdk.Context, consumerId string, @@ -929,76 +906,22 @@ func (k Keeper) DeleteConsumerCommissionRate( store.Delete(types.ConsumerCommissionRateKey(consumerId, providerAddr)) } -// SetValidatorsPowerCap sets the power-cap value `p` associated to chain with `consumerId` -func (k Keeper) SetValidatorsPowerCap( - ctx sdk.Context, - consumerId string, - p uint32, -) { - store := ctx.KVStore(k.storeKey) - - buf := make([]byte, 4) - binary.BigEndian.PutUint32(buf, p) - - store.Set(types.ValidatorsPowerCapKey(consumerId), buf) -} - -// DeleteValidatorsPowerCap removes the power-cap value associated to chain with `consumerId` -func (k Keeper) DeleteValidatorsPowerCap( - ctx sdk.Context, - consumerId string, -) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.ValidatorsPowerCapKey(consumerId)) -} - // GetValidatorsPowerCap returns `(p, true)` if chain `consumerId` has power cap `p` associated with it, and (0, false) otherwise func (k Keeper) GetValidatorsPowerCap( ctx sdk.Context, consumerId string, -) (uint32, bool) { - store := ctx.KVStore(k.storeKey) - buf := store.Get(types.ValidatorsPowerCapKey(consumerId)) - if buf == nil { - return 0, false - } - return binary.BigEndian.Uint32(buf), true -} - -// SetValidatorSetCap stores the validator-set cap value `c` associated to chain with `consumerId` -func (k Keeper) SetValidatorSetCap( - ctx sdk.Context, - consumerId string, - c uint32, -) { - store := ctx.KVStore(k.storeKey) - - buf := make([]byte, 4) - binary.BigEndian.PutUint32(buf, c) - - store.Set(types.ValidatorSetCapKey(consumerId), buf) -} - -// DeleteValidatorSetCap removes the validator-set cap value associated to chain with `consumerId` -func (k Keeper) DeleteValidatorSetCap( - ctx sdk.Context, - consumerId string, -) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.ValidatorSetCapKey(consumerId)) +) uint32 { + updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + return updateRecord.ValidatorsPowerCap } // GetValidatorSetCap returns `(c, true)` if chain `consumerId` has validator-set cap `c` associated with it, and (0, false) otherwise func (k Keeper) GetValidatorSetCap( ctx sdk.Context, consumerId string, -) (uint32, bool) { - store := ctx.KVStore(k.storeKey) - buf := store.Get(types.ValidatorSetCapKey(consumerId)) - if buf == nil { - return 0, false - } - return binary.BigEndian.Uint32(buf), true +) uint32 { + updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + return updateRecord.ValidatorSetCap } // SetAllowlist allowlists validator with `providerAddr` address on chain `consumerId` @@ -1028,7 +951,7 @@ func (k Keeper) GetAllowList( return providerConsAddresses } -// IsAllowlisted returns `true` if validator with `providerAddr` has been allowlisted on chain `chainID` +// IsAllowlisted returns `true` if validator with `providerAddr` has been allowlisted on chain `consumerId` func (k Keeper) IsAllowlisted( ctx sdk.Context, consumerId string, @@ -1055,7 +978,7 @@ func (k Keeper) DeleteAllowlist(ctx sdk.Context, consumerId string) { } } -// IsAllowlistEmpty returns `true` if no validator is allowlisted on chain `chainID` +// IsAllowlistEmpty returns `true` if no validator is allowlisted on chain `consumerId` func (k Keeper) IsAllowlistEmpty(ctx sdk.Context, consumerId string) bool { store := ctx.KVStore(k.storeKey) iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdWithLenKey(types.AllowlistKeyPrefix(), consumerId)) @@ -1166,67 +1089,14 @@ func (k Keeper) DeleteMinimumPowerInTopN( store.Delete(types.MinimumPowerInTopNKey(consumerId)) } -// SetMinStake sets the minimum stake required for a validator to validate -// a given consumer chain. -func (k Keeper) SetMinStake( - ctx sdk.Context, - consumerId string, - minStake uint64, -) { - store := ctx.KVStore(k.storeKey) - - buf := make([]byte, 8) - binary.BigEndian.PutUint64(buf, minStake) - - store.Set(types.MinStakeKey(consumerId), buf) -} - // GetMinStake returns the minimum stake required for a validator to validate // a given consumer chain. func (k Keeper) GetMinStake( ctx sdk.Context, consumerId string, -) (uint64, bool) { - store := ctx.KVStore(k.storeKey) - buf := store.Get(types.MinStakeKey(consumerId)) - if buf == nil { - return 0, false - } - return binary.BigEndian.Uint64(buf), true -} - -// DeleteMinStake removes the minimum stake required for a validator to validate -// a given consumer chain. -func (k Keeper) DeleteMinStake( - ctx sdk.Context, - consumerId string, -) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.MinStakeKey(consumerId)) -} - -// SetInactiveValidatorsAllowed sets whether inactive validators are allowed to validate -// a given consumer chain. -func (k Keeper) SetInactiveValidatorsAllowed( - ctx sdk.Context, - consumerId string, - allowed bool, -) { - if allowed { - k.EnableInactiveValidators(ctx, consumerId) - } else { - k.DisableInactiveValidators(ctx, consumerId) - } -} - -// EnableInactiveValidators sets the flag to signal that inactive validators are allowed to validate -// a given consumer chain. -func (k Keeper) EnableInactiveValidators( - ctx sdk.Context, - consumerId string, -) { - store := ctx.KVStore(k.storeKey) - store.Set(types.AllowInactiveValidatorsKey(consumerId), []byte{}) +) uint64 { + updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + return updateRecord.MinStake } // AllowsInactiveValidators returns whether inactive validators are allowed to validate @@ -1235,18 +1105,8 @@ func (k Keeper) AllowsInactiveValidators( ctx sdk.Context, consumerId string, ) bool { - store := ctx.KVStore(k.storeKey) - return store.Has(types.AllowInactiveValidatorsKey(consumerId)) -} - -// DisableInactiveValidators removes the flag of whether inactive validators are allowed to validate -// a given consumer chain. -func (k Keeper) DisableInactiveValidators( - ctx sdk.Context, - consumerId string, -) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.AllowInactiveValidatorsKey(consumerId)) + updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + return updateRecord.AllowInactiveVals } func (k Keeper) UnbondingCanComplete(ctx sdk.Context, id uint64) error { diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index bfdac533dd..2032eb8b27 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -229,7 +229,7 @@ func TestGetAllRegisteredConsumerChainIDs(t *testing.T) { defer ctrl.Finish() chainIDs := []string{"chain-2", "chain-1", "chain-4", "chain-3"} - // GetAllRegisteredConsumerChainIDs iterates over chainID in lexicographical order + // GetAllRegisteredConsumerChainIDs iterates over consumerId in lexicographical order expectedChainIDs := []string{"chain-1", "chain-2", "chain-3", "chain-4"} for i, chainID := range chainIDs { @@ -242,25 +242,32 @@ func TestGetAllRegisteredConsumerChainIDs(t *testing.T) { require.Equal(t, expectedChainIDs, result) } -// TestGetAllChannelToChains tests GetAllChannelToChains behaviour correctness +// TestGetAllChannelToChains tests GetAllChannelToConsumers behaviour correctness func TestGetAllChannelToChains(t *testing.T) { pk, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainIDs := []string{"chain-2", "chain-1", "chain-4", "chain-3"} - expectedGetAllOrder := []types.ChannelToChain{} - for i, chainID := range chainIDs { - channelID := fmt.Sprintf("client-%d", len(chainIDs)-i) - pk.SetChannelToConsumerId(ctx, channelID, chainID) - expectedGetAllOrder = append(expectedGetAllOrder, types.ChannelToChain{ChainId: chainID, ChannelId: channelID}) + consumerIds := []string{"2", "1", "4", "3"} + var expectedGetAllOrder []struct { + ChannelId string + ConsumerId string + } + + for i, consumerId := range consumerIds { + channelID := fmt.Sprintf("client-%d", len(consumerIds)-i) + pk.SetChannelToConsumerId(ctx, channelID, consumerId) + expectedGetAllOrder = append(expectedGetAllOrder, struct { + ChannelId string + ConsumerId string + }{ConsumerId: consumerId, ChannelId: channelID}) } // sorting by channelID sort.Slice(expectedGetAllOrder, func(i, j int) bool { return expectedGetAllOrder[i].ChannelId < expectedGetAllOrder[j].ChannelId }) - result := pk.GetAllChannelToChains(ctx) - require.Len(t, result, len(chainIDs)) + result := pk.GetAllChannelToConsumers(ctx) + require.Len(t, result, len(consumerIds)) require.Equal(t, expectedGetAllOrder, result) } @@ -378,27 +385,28 @@ func TestTopN(t *testing.T) { defer ctrl.Finish() tests := []struct { - chainID string - N uint32 - isOptIn bool + consumerId string + N uint32 + isOptIn bool }{ - {chainID: "TopNChain1", N: 50, isOptIn: false}, - {chainID: "TopNChain2", N: 100, isOptIn: false}, - {chainID: "OptInChain", N: 0, isOptIn: true}, + {consumerId: "TopNChain1", N: 50, isOptIn: false}, + {consumerId: "TopNChain2", N: 100, isOptIn: false}, + {consumerId: "OptInChain", N: 0, isOptIn: true}, } for _, test := range tests { - providerKeeper.SetTopN(ctx, test.chainID, test.N) - topN, found := providerKeeper.GetTopN(ctx, test.chainID) + providerKeeper.SetConsumerUpdateRecord(ctx, test.consumerId, types.ConsumerUpdateRecord{ + Top_N: test.N, + }) + topN := providerKeeper.GetTopN(ctx, test.consumerId) require.Equal(t, test.N, topN) - require.True(t, found) if test.isOptIn { - require.True(t, providerKeeper.IsOptIn(ctx, test.chainID)) - require.False(t, providerKeeper.IsTopN(ctx, test.chainID)) + require.True(t, providerKeeper.IsOptIn(ctx, test.consumerId)) + require.False(t, providerKeeper.IsTopN(ctx, test.consumerId)) } else { - require.False(t, providerKeeper.IsOptIn(ctx, test.chainID)) - require.True(t, providerKeeper.IsTopN(ctx, test.chainID)) + require.False(t, providerKeeper.IsOptIn(ctx, test.consumerId)) + require.True(t, providerKeeper.IsTopN(ctx, test.consumerId)) } } } @@ -414,10 +422,10 @@ func TestGetAllOptedIn(t *testing.T) { } for _, expectedOptedInValidator := range expectedOptedInValidators { - providerKeeper.SetOptedIn(ctx, "chainID", expectedOptedInValidator) + providerKeeper.SetOptedIn(ctx, "consumerId", expectedOptedInValidator) } - actualOptedInValidators := providerKeeper.GetAllOptedIn(ctx, "chainID") + actualOptedInValidators := providerKeeper.GetAllOptedIn(ctx, "consumerId") // sort validators first to be able to compare sortOptedInValidators := func(addresses []types.ProviderConsAddress) { @@ -438,19 +446,19 @@ func TestOptedIn(t *testing.T) { optedInValidator1 := types.NewProviderConsAddress([]byte("providerAddr1")) optedInValidator2 := types.NewProviderConsAddress([]byte("providerAddr2")) - require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator1)) - providerKeeper.SetOptedIn(ctx, "chainID", optedInValidator1) - require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator1)) - providerKeeper.DeleteOptedIn(ctx, "chainID", optedInValidator1) - require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator1)) - - providerKeeper.SetOptedIn(ctx, "chainID", optedInValidator1) - providerKeeper.SetOptedIn(ctx, "chainID", optedInValidator2) - require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator1)) - require.True(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator2)) - providerKeeper.DeleteAllOptedIn(ctx, "chainID") - require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator1)) - require.False(t, providerKeeper.IsOptedIn(ctx, "chainID", optedInValidator2)) + require.False(t, providerKeeper.IsOptedIn(ctx, "consumerId", optedInValidator1)) + providerKeeper.SetOptedIn(ctx, "consumerId", optedInValidator1) + require.True(t, providerKeeper.IsOptedIn(ctx, "consumerId", optedInValidator1)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", optedInValidator1) + require.False(t, providerKeeper.IsOptedIn(ctx, "consumerId", optedInValidator1)) + + providerKeeper.SetOptedIn(ctx, "consumerId", optedInValidator1) + providerKeeper.SetOptedIn(ctx, "consumerId", optedInValidator2) + require.True(t, providerKeeper.IsOptedIn(ctx, "consumerId", optedInValidator1)) + require.True(t, providerKeeper.IsOptedIn(ctx, "consumerId", optedInValidator2)) + providerKeeper.DeleteAllOptedIn(ctx, "consumerId") + require.False(t, providerKeeper.IsOptedIn(ctx, "consumerId", optedInValidator1)) + require.False(t, providerKeeper.IsOptedIn(ctx, "consumerId", optedInValidator2)) } // TestConsumerCommissionRate tests the `SetConsumerCommissionRate`, `GetConsumerCommissionRate`, and `DeleteConsumerCommissionRate` methods @@ -461,31 +469,31 @@ func TestConsumerCommissionRate(t *testing.T) { providerAddr1 := types.NewProviderConsAddress([]byte("providerAddr1")) providerAddr2 := types.NewProviderConsAddress([]byte("providerAddr2")) - cr, found := providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr1) + cr, found := providerKeeper.GetConsumerCommissionRate(ctx, "consumerId", providerAddr1) require.False(t, found) require.Equal(t, math.LegacyZeroDec(), cr) - providerKeeper.SetConsumerCommissionRate(ctx, "chainID", providerAddr1, math.LegacyOneDec()) - cr, found = providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr1) + providerKeeper.SetConsumerCommissionRate(ctx, "consumerId", providerAddr1, math.LegacyOneDec()) + cr, found = providerKeeper.GetConsumerCommissionRate(ctx, "consumerId", providerAddr1) require.True(t, found) require.Equal(t, math.LegacyOneDec(), cr) - providerKeeper.SetConsumerCommissionRate(ctx, "chainID", providerAddr2, math.LegacyZeroDec()) - cr, found = providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr2) + providerKeeper.SetConsumerCommissionRate(ctx, "consumerId", providerAddr2, math.LegacyZeroDec()) + cr, found = providerKeeper.GetConsumerCommissionRate(ctx, "consumerId", providerAddr2) require.True(t, found) require.Equal(t, math.LegacyZeroDec(), cr) - provAddrs := providerKeeper.GetAllCommissionRateValidators(ctx, "chainID") + provAddrs := providerKeeper.GetAllCommissionRateValidators(ctx, "consumerId") require.Len(t, provAddrs, 2) for _, addr := range provAddrs { - providerKeeper.DeleteConsumerCommissionRate(ctx, "chainID", addr) + providerKeeper.DeleteConsumerCommissionRate(ctx, "consumerId", addr) } - _, found = providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr1) + _, found = providerKeeper.GetConsumerCommissionRate(ctx, "consumerId", providerAddr1) require.False(t, found) - _, found = providerKeeper.GetConsumerCommissionRate(ctx, "chainID", providerAddr2) + _, found = providerKeeper.GetConsumerCommissionRate(ctx, "consumerId", providerAddr2) require.False(t, found) } @@ -494,7 +502,7 @@ func TestAllowlist(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + chainID := "consumerId" // no validator was allowlisted and hence the allowlist is empty require.True(t, providerKeeper.IsAllowlistEmpty(ctx, chainID)) @@ -522,7 +530,7 @@ func TestDenylist(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + chainID := "consumerId" // no validator was denylisted and hence the denylist is empty require.True(t, providerKeeper.IsDenylistEmpty(ctx, chainID)) @@ -549,22 +557,25 @@ func TestDenylist(t *testing.T) { func TestAllowInactiveValidators(t *testing.T) { k, ctx, _, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - chainID := "chainID" + consumerId := "consumerId" // check that by default, AllowsInactiveValidators returns false - require.False(t, k.AllowsInactiveValidators(ctx, chainID)) + require.False(t, k.AllowsInactiveValidators(ctx, consumerId)) // set the chain to allow inactive validators - k.SetInactiveValidatorsAllowed(ctx, chainID, true) - + k.SetConsumerUpdateRecord(ctx, consumerId, types.ConsumerUpdateRecord{ + AllowInactiveVals: true, + }) // check that AllowsInactiveValidators returns true - require.True(t, k.AllowsInactiveValidators(ctx, chainID)) + require.True(t, k.AllowsInactiveValidators(ctx, consumerId)) // set the chain to not allow inactive validators - k.SetInactiveValidatorsAllowed(ctx, chainID, false) + k.SetConsumerUpdateRecord(ctx, consumerId, types.ConsumerUpdateRecord{ + AllowInactiveVals: false, + }) // check that AllowsInactiveValidators returns false - require.False(t, k.AllowsInactiveValidators(ctx, chainID)) + require.False(t, k.AllowsInactiveValidators(ctx, consumerId)) } // Tests setting, getting and deleting parameters that are stored per-consumer chain. @@ -579,49 +590,65 @@ func TestKeeperConsumerParams(t *testing.T) { tests := []struct { name string settingFunc func(sdk.Context, string, int64) - getFunc func(sdk.Context, string) (int64, bool) + getFunc func(sdk.Context, string) int64 deleteFunc func(sdk.Context, string) initialValue int64 updatedValue int64 }{ { - name: "Minimum Power In Top N", - settingFunc: func(ctx sdk.Context, id string, val int64) { k.SetMinimumPowerInTopN(ctx, id, val) }, - getFunc: func(ctx sdk.Context, id string) (int64, bool) { return k.GetMinimumPowerInTopN(ctx, id) }, + name: "Minimum Power In Top N", + settingFunc: func(ctx sdk.Context, id string, val int64) { k.SetMinimumPowerInTopN(ctx, id, val) }, + getFunc: func(ctx sdk.Context, id string) int64 { + minimumPowerInTopN, _ := k.GetMinimumPowerInTopN(ctx, id) + return minimumPowerInTopN + }, deleteFunc: func(ctx sdk.Context, id string) { k.DeleteMinimumPowerInTopN(ctx, id) }, initialValue: 1000, updatedValue: 2000, }, { - name: "Minimum Stake", - settingFunc: func(ctx sdk.Context, id string, val int64) { k.SetMinStake(ctx, id, uint64(val)) }, - getFunc: func(ctx sdk.Context, id string) (int64, bool) { - val, found := k.GetMinStake(ctx, id) - return int64(val), found + name: "Minimum Stake", + settingFunc: func(ctx sdk.Context, id string, val int64) { + k.SetConsumerUpdateRecord(ctx, id, + types.ConsumerUpdateRecord{ + MinStake: uint64(val), + }) }, - deleteFunc: func(ctx sdk.Context, id string) { k.DeleteMinStake(ctx, id) }, + getFunc: func(ctx sdk.Context, id string) int64 { + return int64(k.GetMinStake(ctx, id)) + }, + deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerUpdateRecord(ctx, id) }, initialValue: 1000, updatedValue: 2000, }, { - name: "Validator Set Cap", - settingFunc: func(ctx sdk.Context, id string, val int64) { k.SetValidatorSetCap(ctx, id, uint32(val)) }, - getFunc: func(ctx sdk.Context, id string) (int64, bool) { - val, found := k.GetValidatorSetCap(ctx, id) - return int64(val), found + name: "Validator Set Cap", + settingFunc: func(ctx sdk.Context, id string, val int64) { + k.SetConsumerUpdateRecord(ctx, id, + types.ConsumerUpdateRecord{ + ValidatorSetCap: uint32(val), + }) + }, + getFunc: func(ctx sdk.Context, id string) int64 { + return int64(k.GetValidatorSetCap(ctx, id)) }, - deleteFunc: func(ctx sdk.Context, id string) { k.DeleteValidatorSetCap(ctx, id) }, + deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerUpdateRecord(ctx, id) }, initialValue: 10, updatedValue: 200, }, { - name: "Validator Powers Cap", - settingFunc: func(ctx sdk.Context, id string, val int64) { k.SetValidatorsPowerCap(ctx, id, uint32(val)) }, - getFunc: func(ctx sdk.Context, id string) (int64, bool) { - val, found := k.GetValidatorsPowerCap(ctx, id) - return int64(val), found + name: "Validator Powers Cap", + settingFunc: func(ctx sdk.Context, id string, val int64) { + k.SetConsumerUpdateRecord(ctx, id, + types.ConsumerUpdateRecord{ + ValidatorsPowerCap: uint32(val), + }) }, - deleteFunc: func(ctx sdk.Context, id string) { k.DeleteValidatorsPowerCap(ctx, id) }, + getFunc: func(ctx sdk.Context, id string) int64 { + val := k.GetValidatorsPowerCap(ctx, id) + return int64(val) + }, + deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerUpdateRecord(ctx, id) }, initialValue: 10, updatedValue: 11, }, @@ -629,40 +656,38 @@ func TestKeeperConsumerParams(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - chainID := "chainID" + chainID := "consumerId" // Set initial value tt.settingFunc(ctx, chainID, int64(tt.initialValue)) // Retrieve and check initial value - actualValue, found := tt.getFunc(ctx, chainID) - require.True(t, found) + actualValue := tt.getFunc(ctx, chainID) require.EqualValues(t, tt.initialValue, actualValue) // Update value tt.settingFunc(ctx, chainID, int64(tt.updatedValue)) // Retrieve and check updated value - newActualValue, found := tt.getFunc(ctx, chainID) - require.True(t, found) + newActualValue := tt.getFunc(ctx, chainID) require.EqualValues(t, tt.updatedValue, newActualValue) - // Check non-existent chain ID - _, found = tt.getFunc(ctx, "not the chainID") - require.False(t, found) + // Check non-existent consumer id + res := tt.getFunc(ctx, "not the consumerId") + require.Zero(t, res) // Delete value tt.deleteFunc(ctx, chainID) // Check that value was deleted - _, found = tt.getFunc(ctx, chainID) - require.False(t, found) + res = tt.getFunc(ctx, chainID) + require.Zero(t, res) // Try deleting again tt.deleteFunc(ctx, chainID) // Check that the value is still deleted - _, found = tt.getFunc(ctx, chainID) - require.False(t, found) + res = tt.getFunc(ctx, chainID) + require.Zero(t, res) }) } } diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index fb9d11d3fc..77f07498b0 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -105,7 +105,7 @@ func (k Keeper) SetValidatorConsumerPubKey( // If consumerId is nil, it returns all the validators public keys assigned for all consumer chains // // Note that the validators public keys assigned for a consumer chain are stored under keys -// with the following format: ConsumerValidatorsBytePrefix | len(chainID) | chainID | providerAddress +// with the following format: ConsumerValidatorsBytePrefix | len(consumerId) | consumerId | providerAddress // Thus, the returned array is // - in ascending order of providerAddresses, if consumerId is not nil; // - in undetermined order, if consumerId is nil. @@ -352,7 +352,7 @@ func (k Keeper) ConsumeConsumerAddrsToPrune( return } -// GetAllConsumerAddrsToPrune gets all consumer addresses that can be eventually pruned for a given chainID. +// GetAllConsumerAddrsToPrune gets all consumer addresses that can be eventually pruned for a given consumerId. // // Note that the list of all consumer addresses is stored under keys with the following format: // ConsumerAddrsToPruneV2BytePrefix | len(consumerId) | consumerId | timestamp diff --git a/x/ccv/provider/keeper/key_assignment_test.go b/x/ccv/provider/keeper/key_assignment_test.go index 7dbec09f40..6068c8224d 100644 --- a/x/ccv/provider/keeper/key_assignment_test.go +++ b/x/ccv/provider/keeper/key_assignment_test.go @@ -24,7 +24,7 @@ import ( ccvtypes "github.com/cosmos/interchain-security/v5/x/ccv/types" ) -const ChainID = "chainID" +const ChainID = "consumerId" func TestValidatorConsumerPubKeyCRUD(t *testing.T) { chainID := consumer @@ -69,7 +69,7 @@ func TestGetAllValidatorConsumerPubKey(t *testing.T) { }, ) } - // select a chainID with more than two assignments + // select a consumerId with more than two assignments var chainID string for i := range chainIDs { chainID = chainIDs[i] @@ -149,7 +149,7 @@ func TestGetAllValidatorsByConsumerAddr(t *testing.T) { }, ) } - // select a chainID with more than two assignments + // select a consumerId with more than two assignments var chainID string for i := range chainIDs { chainID = chainIDs[i] @@ -261,7 +261,7 @@ func TestGetAllConsumerAddrsToPrune(t *testing.T) { }, ) } - // select a chainID with more than two assignments + // select a consumerId with more than two assignments var chainID string for i := range chainIDs { chainID = chainIDs[i] diff --git a/x/ccv/provider/keeper/legacy_proposal_test.go b/x/ccv/provider/keeper/legacy_proposal_test.go index 346be55d07..a8c0fcaafc 100644 --- a/x/ccv/provider/keeper/legacy_proposal_test.go +++ b/x/ccv/provider/keeper/legacy_proposal_test.go @@ -34,7 +34,7 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { // and appended to the pending proposals expAppendProp bool - // chainID of the consumer chain + // consumerId of the consumer chain // tests need to check that the CCV channel is not closed prematurely chainId string } @@ -53,12 +53,12 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { prop: providertypes.NewConsumerRemovalProposal( "title", "description", - "chainID", + "consumerId", now, ).(*providertypes.ConsumerRemovalProposal), blockTime: hourAfterNow, // After stop time. expAppendProp: true, - chainId: "chainID", + chainId: "consumerId", }, { description: "valid proposal - stop_time in the past", @@ -68,12 +68,12 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { prop: providertypes.NewConsumerRemovalProposal( "title", "description", - "chainID", + "consumerId", hourBeforeNow, ).(*providertypes.ConsumerRemovalProposal), blockTime: hourAfterNow, // After stop time. expAppendProp: true, - chainId: "chainID", + chainId: "consumerId", }, { description: "valid proposal - before stop_time in the future", @@ -83,12 +83,12 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { prop: providertypes.NewConsumerRemovalProposal( "title", "description", - "chainID", + "consumerId", hourAfterNow, ).(*providertypes.ConsumerRemovalProposal), blockTime: now, expAppendProp: true, - chainId: "chainID", + chainId: "consumerId", }, { description: "rejected valid proposal - consumer chain does not exist", @@ -96,12 +96,12 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { prop: providertypes.NewConsumerRemovalProposal( "title", "description", - "chainID-2", + "consumerId-2", hourAfterNow, ).(*providertypes.ConsumerRemovalProposal), blockTime: hourAfterNow, // After stop time. expAppendProp: false, - chainId: "chainID-2", + chainId: "consumerId-2", }, } @@ -159,14 +159,16 @@ func TestUpdateConsumer(t *testing.T) { providerKeeper.SetConsumerClientId(ctx, consumerId, "clientID") // set PSS-related fields to update them later on - providerKeeper.SetTopN(ctx, consumerId, 50) - providerKeeper.SetValidatorSetCap(ctx, consumerId, 10) - providerKeeper.SetValidatorsPowerCap(ctx, consumerId, 34) + providerKeeper.SetConsumerUpdateRecord(ctx, consumer, providertypes.ConsumerUpdateRecord{ + Top_N: 50, + ValidatorSetCap: 10, + ValidatorsPowerCap: 34, + MinStake: 100, + AllowInactiveVals: true, + }) providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr1"))) providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr2"))) providerKeeper.SetDenylist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("denylistedAddr1"))) - providerKeeper.SetMinStake(ctx, consumerId, 1000) - providerKeeper.SetInactiveValidatorsAllowed(ctx, consumerId, true) expectedTopN := uint32(75) expectedValidatorsPowerCap := uint32(67) @@ -186,16 +188,16 @@ func TestUpdateConsumer(t *testing.T) { AllowInactiveVals: expectedAllowInactiveValidators, } - providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Initialized) - providerKeeper.SetConsumerIdToUpdateRecord(ctx, consumerId, updateRecord) + providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) + providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, updateRecord) err := providerKeeper.UpdateConsumer(ctx, consumerId) require.NoError(t, err) - actualTopN, _ := providerKeeper.GetTopN(ctx, consumerId) + actualTopN := providerKeeper.GetTopN(ctx, consumerId) require.Equal(t, expectedTopN, actualTopN) - actualValidatorsPowerCap, _ := providerKeeper.GetValidatorsPowerCap(ctx, consumerId) + actualValidatorsPowerCap := providerKeeper.GetValidatorsPowerCap(ctx, consumerId) require.Equal(t, expectedValidatorsPowerCap, actualValidatorsPowerCap) - actualValidatorSetCap, _ := providerKeeper.GetValidatorSetCap(ctx, consumerId) + actualValidatorSetCap := providerKeeper.GetValidatorSetCap(ctx, consumerId) require.Equal(t, expectedValidatorSetCap, actualValidatorSetCap) allowlistedValidator, err := sdk.ConsAddressFromBech32(expectedAllowlistedValidator) @@ -208,7 +210,7 @@ func TestUpdateConsumer(t *testing.T) { require.Equal(t, 1, len(providerKeeper.GetDenyList(ctx, consumerId))) require.Equal(t, providertypes.NewProviderConsAddress(denylistedValidator), providerKeeper.GetDenyList(ctx, consumerId)[0]) - actualMinStake, _ := providerKeeper.GetMinStake(ctx, consumerId) + actualMinStake := providerKeeper.GetMinStake(ctx, consumerId) require.Equal(t, expectedMinStake, actualMinStake) actualAllowInactiveValidators := providerKeeper.AllowsInactiveValidators(ctx, consumerId) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index f278ef5680..f24ce7fc53 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -2,10 +2,7 @@ package keeper import ( "context" - "strconv" - errorsmod "cosmossdk.io/errors" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -98,7 +95,21 @@ func (k msgServer) RemoveConsumer( ctx := sdk.UnwrapSDKContext(goCtx) - k.Keeper.SetConsumerIdToStopTime(ctx, msg.ConsumerId, msg.StopTime) + consumerId := msg.ConsumerId + + phase, found := k.Keeper.GetConsumerPhase(ctx, consumerId) + if !found || phase != Launched { + return nil, errorsmod.Wrapf(types.ErrInvalidPhase, + "chain with consumer id: %s has to be in its launched phase", consumerId) + } + + previousStopTime, err := k.Keeper.GetConsumerStopTime(ctx, consumerId) + if err == nil { + k.Keeper.RemoveConsumerFromToBeStoppedConsumers(ctx, consumerId, previousStopTime) + } + + k.Keeper.SetConsumerStopTime(ctx, consumerId, msg.StopTime) + k.Keeper.AppendStopTimeForConsumerToBeStopped(ctx, consumerId, msg.StopTime) return &types.MsgRemoveConsumerResponse{}, nil } @@ -297,11 +308,14 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegisterConsumer) (*types.MsgRegisterConsumerResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - consumerId := strconv.FormatUint(k.Keeper.FetchAndIncrementConsumerId(ctx), 10) + consumerId := k.Keeper.FetchAndIncrementConsumerId(ctx) - k.Keeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, *msg.RegistrationRecord) - k.Keeper.SetConsumerIdToOwnerAddress(ctx, consumerId, msg.Signer) - k.Keeper.SetConsumerIdToPhase(ctx, consumerId, Registered) + err := k.Keeper.SetConsumerRegistrationRecord(ctx, consumerId, *msg.RegistrationRecord) + if err != nil { + return &types.MsgRegisterConsumerResponse{}, err + } + k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.Signer) + k.Keeper.SetConsumerPhase(ctx, consumerId, Registered) return &types.MsgRegisterConsumerResponse{ConsumerId: consumerId}, nil } @@ -310,25 +324,40 @@ func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegiste func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgInitializeConsumer) (*types.MsgInitializeConsumerResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + initGas := ctx.GasMeter().GasConsumed() + consumerId := msg.ConsumerId - phase, found := k.Keeper.GetConsumerIdToPhase(ctx, consumerId) + phase, found := k.Keeper.GetConsumerPhase(ctx, consumerId) if !found || (phase != Registered && phase != Initialized) { return nil, errorsmod.Wrapf(types.ErrInvalidPhase, "chain with consumer id: %s has to be in its registered or initialized phase", consumerId) } - ownerAddress, _ := k.Keeper.GetConsumerIdToOwnerAddress(ctx, consumerId) + ownerAddress := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) if k.GetAuthority() == msg.Authority { // message is executed as part of governance proposal and hence we change the owner address // to be the one of the module account address - k.Keeper.SetConsumerIdToOwnerAddress(ctx, consumerId, k.GetAuthority()) + k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, k.GetAuthority()) } else if msg.Authority != ownerAddress { return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Authority) } - k.Keeper.SetConsumerIdToInitializationRecord(ctx, consumerId, *msg.InitializationRecord) - k.Keeper.SetConsumerIdToPhase(ctx, consumerId, Initialized) + // if this is not the first initialization, remove the consumer id from the old spawn time + record, err := k.Keeper.GetConsumerInitializationRecord(ctx, consumerId) + if err == nil { + previousSpawnTime := record.SpawnTime + k.Keeper.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) + } + + k.Keeper.SetConsumerInitializationRecord(ctx, consumerId, *msg.InitializationRecord) + k.Keeper.SetConsumerPhase(ctx, consumerId, Initialized) + + k.Keeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, msg.InitializationRecord.SpawnTime) + + gasAfter := ctx.GasMeter().GasConsumed() + ctx.GasMeter().ConsumeGas(gasAfter-initGas, "initializing a chain has an additional cost during spawn time, "+ + "so charging double the gas here") return &types.MsgInitializeConsumerResponse{}, nil } @@ -336,12 +365,18 @@ func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgIniti // UpdateConsumer updates the record of a consumer chain func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateConsumer) (*types.MsgUpdateConsumerResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - ownerAddress, _ := k.Keeper.GetConsumerIdToOwnerAddress(ctx, msg.ConsumerId) + consumerId := msg.ConsumerId - if k.GetAuthority() != msg.Authority && msg.Authority != ownerAddress { - return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected %s, got %s", k.GetAuthority(), msg.Authority) + ownerAddress := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) + if k.GetAuthority() == msg.Authority { + // message is executed as part of governance proposal and hence we change the owner address + // to be the one of the module account address (e.g., a gov proposal with a single `MsgUpdateConsumer` might have + // led to this) + k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, k.GetAuthority()) + } else if msg.Authority != ownerAddress { + return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Authority) } - k.Keeper.SetConsumerIdToUpdateRecord(ctx, msg.ConsumerId, *msg.UpdateRecord) + k.Keeper.SetConsumerUpdateRecord(ctx, msg.ConsumerId, *msg.UpdateRecord) return &types.MsgUpdateConsumerResponse{}, nil } diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go index 1386fcdd9d..4a22401c22 100644 --- a/x/ccv/provider/keeper/msg_server_test.go +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -25,12 +25,12 @@ func TestRegisterConsumer(t *testing.T) { &providertypes.MsgRegisterConsumer{Signer: "signer", RegistrationRecord: &expectedRecord}) require.NoError(t, err) require.Equal(t, "0", response.ConsumerId) - actualRecord, found := providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "0") - require.True(t, found) + actualRecord, err := providerKeeper.GetConsumerRegistrationRecord(ctx, "0") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) - ownerAddress, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "0") + ownerAddress := providerKeeper.GetConsumerOwnerAddress(ctx, "0") require.Equal(t, "signer", ownerAddress) - phase, found := providerKeeper.GetConsumerIdToPhase(ctx, "0") + phase, found := providerKeeper.GetConsumerPhase(ctx, "0") require.True(t, found) require.Equal(t, providerkeeper.Registered, phase) @@ -44,12 +44,12 @@ func TestRegisterConsumer(t *testing.T) { require.NoError(t, err) // assert that the consumer id is different from the previously registered chain require.Equal(t, "1", response.ConsumerId) - actualRecord, found = providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "1") - require.True(t, found) + actualRecord, err = providerKeeper.GetConsumerRegistrationRecord(ctx, "1") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) - ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "1") + ownerAddress = providerKeeper.GetConsumerOwnerAddress(ctx, "1") require.Equal(t, "signer2", ownerAddress) - phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "1") + phase, found = providerKeeper.GetConsumerPhase(ctx, "1") require.True(t, found) require.Equal(t, providerkeeper.Registered, phase) @@ -69,7 +69,7 @@ func TestInitializeConsumer(t *testing.T) { InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) require.ErrorContains(t, err, "its registered or initialized phase") - providerKeeper.SetConsumerIdToPhase(ctx, "0", providerkeeper.Launched) + providerKeeper.SetConsumerPhase(ctx, "0", providerkeeper.Launched) _, err = msgServer.InitializeConsumer(ctx, &providertypes.MsgInitializeConsumer{ Authority: "signer", @@ -77,7 +77,7 @@ func TestInitializeConsumer(t *testing.T) { InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) require.ErrorContains(t, err, "its registered or initialized phase") - providerKeeper.SetConsumerIdToPhase(ctx, "0", providerkeeper.Stopped) + providerKeeper.SetConsumerPhase(ctx, "0", providerkeeper.Stopped) _, err = msgServer.InitializeConsumer(ctx, &providertypes.MsgInitializeConsumer{ Authority: "signer", @@ -125,12 +125,11 @@ func TestInitializeConsumer(t *testing.T) { ConsumerId: "0", InitializationRecord: &expectedRecord}) require.NoError(t, err) - actualRecord, found := providerKeeper.GetConsumerIdToInitializationRecord(ctx, "0") - require.True(t, found) + actualRecord, err := providerKeeper.GetConsumerInitializationRecord(ctx, "0") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) // verify that the owner of the consumer chain did NOT change - ownerAddress, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "0") - require.True(t, found) + ownerAddress := providerKeeper.GetConsumerOwnerAddress(ctx, "0") require.Equal(t, "signer", ownerAddress) // assert that we can re-initialize chain with consumer id "0" @@ -154,12 +153,11 @@ func TestInitializeConsumer(t *testing.T) { ConsumerId: "0", InitializationRecord: &expectedRecord}) require.NoError(t, err) - actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "0") - require.True(t, found) + actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "0") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) // verify that the owner of the consumer chain did NOT change - ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "0") - require.True(t, found) + ownerAddress = providerKeeper.GetConsumerOwnerAddress(ctx, "0") require.Equal(t, "signer", ownerAddress) // initialize chain with consumer id "1" but with a different owner (as part of a governance proposal) @@ -171,12 +169,11 @@ func TestInitializeConsumer(t *testing.T) { ConsumerId: "1", InitializationRecord: &expectedRecord}) require.NoError(t, err) - actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "1") - require.True(t, found) + actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "1") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) // verify that the owner of the consumer chain did NOT change - ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "1") - require.True(t, found) + ownerAddress = providerKeeper.GetConsumerOwnerAddress(ctx, "1") require.Equal(t, "signer2", ownerAddress) // second, reinitialize by with a gov proposal owner @@ -186,11 +183,10 @@ func TestInitializeConsumer(t *testing.T) { ConsumerId: "1", InitializationRecord: &expectedRecord}) require.NoError(t, err) - actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "1") - require.True(t, found) + actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "1") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) // verify that the owner of the consumer chain did change - ownerAddress, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "1") - require.True(t, found) + ownerAddress = providerKeeper.GetConsumerOwnerAddress(ctx, "1") require.Equal(t, providerKeeper.GetAuthority(), ownerAddress) } diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 2afd553eb6..0dc6ea28be 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -16,28 +16,32 @@ import ( // HandleOptIn prepares validator `providerAddr` to opt in to `consumerId` 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, consumerId string, providerAddr types.ProviderConsAddress, consumerKey string) error { - phase, found := k.GetConsumerIdToPhase(ctx, consumerId) + phase, found := k.GetConsumerPhase(ctx, consumerId) if !found || phase == Stopped { return errorsmod.Wrapf( types.ErrInvalidPhase, "opting in to an unknown (or stopped) consumer chain, with id: %s", consumerId) } - registrationRecord, found := k.GetConsumerIdToRegistrationRecord(ctx, consumerId) - if !found { + registrationRecord, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + if err != nil { return errorsmod.Wrapf( types.ErrUnknownConsumerId, - "opting in to an unknown consumer chain, with id: %s", consumerId) + "opting in to an unknown consumer chain, with id (%s): %s", consumerId, err.Error()) } - optedInToConsumerId, found := k.IsValidatorOptedInToChain(ctx, providerAddr, registrationRecord.ChainId) - if found && consumerId != optedInToConsumerId { + optedInToConsumerId, found := k.IsValidatorOptedInToChainId(ctx, providerAddr, registrationRecord.ChainId) + if found { return errorsmod.Wrapf(types.ErrAlreadyOptedIn, - "validator has already opted in to a chain (%s) with the same chain id (%s)", + "validator is already opted in to a chain (%s) with this chain id (%s)", optedInToConsumerId, registrationRecord.ChainId) } k.SetOptedIn(ctx, consumerId, providerAddr) + err = k.AppendOptedInConsumerId(ctx, providerAddr, consumerId) + if err != nil { + return err + } if consumerKey != "" { consumerTMPublicKey, err := k.ParseConsumerKey(consumerKey) @@ -70,7 +74,7 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, consumerId string, providerAddr ty "opting out of an unknown or not running consumer chain, with id: %s", consumerId) } - if topN, found := k.GetTopN(ctx, consumerId); found && topN > 0 { + if topN := k.GetTopN(ctx, consumerId); topN > 0 { // a validator cannot opt out from a Top N chain if the validator is in the Top N validators validator, err := k.stakingKeeper.GetValidatorByConsAddr(ctx, providerAddr.ToSdkConsAddr()) if err != nil { @@ -100,7 +104,7 @@ func (k Keeper) HandleOptOut(ctx sdk.Context, consumerId string, providerAddr ty } k.DeleteOptedIn(ctx, consumerId, providerAddr) - return nil + return k.RemoveOptedInConsumerId(ctx, providerAddr, consumerId) } // OptInTopNValidators opts in to `consumerId` all the `bondedValidators` that have at least `minPowerToOptIn` power @@ -187,12 +191,12 @@ func (k Keeper) ComputeMinPowerInTopN(ctx sdk.Context, bondedValidators []stakin // CapValidatorSet caps the provided `validators` if chain with `consumerId` is an Opt In chain with a validator-set cap. // If cap is `k`, `CapValidatorSet` returns the first `k` validators from `validators` with the highest power. func (k Keeper) CapValidatorSet(ctx sdk.Context, consumerId string, validators []types.ConsensusValidator) []types.ConsensusValidator { - if topN, found := k.GetTopN(ctx, consumerId); found && topN > 0 { + if k.GetTopN(ctx, consumerId) > 0 { // is a no-op if the chain is a Top N chain return validators } - if validatorSetCap, found := k.GetValidatorSetCap(ctx, consumerId); found && validatorSetCap != 0 && int(validatorSetCap) < len(validators) { + if validatorSetCap := k.GetValidatorSetCap(ctx, consumerId); validatorSetCap != 0 && int(validatorSetCap) < len(validators) { sort.Slice(validators, func(i, j int) bool { return validators[i].Power > validators[j].Power }) @@ -208,7 +212,7 @@ func (k Keeper) CapValidatorSet(ctx sdk.Context, consumerId string, validators [ // on the consumer chain have less power than the set validators-power cap. For example, if we have 10 validators and // the power cap is set to 5%, we need at least one validator to have more than 10% of the voting power on the consumer chain. func (k Keeper) CapValidatorsPower(ctx sdk.Context, consumerId string, validators []types.ConsensusValidator) []types.ConsensusValidator { - if p, found := k.GetValidatorsPowerCap(ctx, consumerId); found && p > 0 { + if p := k.GetValidatorsPowerCap(ctx, consumerId); p > 0 { return NoMoreThanPercentOfTheSum(validators, p) } else { // is a no-op if power cap is not set for `consumerId` @@ -332,8 +336,8 @@ func (k Keeper) CanValidateChain(ctx sdk.Context, consumerId string, providerAdd // FulfillsMinStake returns true if the validator `providerAddr` has enough stake to validate chain with `consumerId` // by checking its staked tokens against the minimum stake required to validate the chain. func (k Keeper) FulfillsMinStake(ctx sdk.Context, consumerId string, providerAddr types.ProviderConsAddress) bool { - minStake, found := k.GetMinStake(ctx, consumerId) - if !found { + minStake := k.GetMinStake(ctx, consumerId) + if minStake == 0 { return true } diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index fcc0accf14..fee602f456 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -36,11 +36,11 @@ func TestHandleOptIn(t *testing.T) { require.Error(t, providerKeeper.HandleOptIn(ctx, "unknownConsumerId", providerAddr, "")) // trying to opt in to a stopped consumer chain - providerKeeper.SetConsumerIdToPhase(ctx, "stoppedConsumerId", keeper.Stopped) + providerKeeper.SetConsumerPhase(ctx, "stoppedConsumerId", keeper.Stopped) require.Error(t, providerKeeper.HandleOptIn(ctx, "stoppedConsumerId", providerAddr, "")) - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId", keeper.Registered) - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "consumerId", types.ConsumerRegistrationRecord{ + providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Registered) + providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId", types.ConsumerRegistrationRecord{ ChainId: "chainId", }) require.False(t, providerKeeper.IsOptedIn(ctx, "consumerId", providerAddr)) @@ -50,12 +50,12 @@ func TestHandleOptIn(t *testing.T) { // validator tries to opt in to another chain with chain id ("chainId") while it is already opted in to // a different chain with the same chain id - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId2", keeper.Registered) - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "consumerId2", types.ConsumerRegistrationRecord{ + providerKeeper.SetConsumerPhase(ctx, "consumerId2", keeper.Registered) + providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId2", types.ConsumerRegistrationRecord{ ChainId: "chainId", }) err = providerKeeper.HandleOptIn(ctx, "consumerId2", providerAddr, "") - require.ErrorContains(t, err, "validator has already opted in to a chain") + require.ErrorContains(t, err, "validator is already opted in to a chain") } func TestHandleOptInWithConsumerKey(t *testing.T) { @@ -84,29 +84,29 @@ func TestHandleOptInWithConsumerKey(t *testing.T) { } gomock.InOrder(calls...) - providerKeeper.SetProposedConsumerChain(ctx, "chainID", 1) + providerKeeper.SetProposedConsumerChain(ctx, "consumerId", 1) // create a sample consumer key to assign to the `providerAddr` validator - // on the consumer chain with id `chainID` + // on the consumer chain with id `consumerId` consumerKey := "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}" expectedConsumerPubKey, err := providerKeeper.ParseConsumerKey(consumerKey) require.NoError(t, err) - providerKeeper.SetConsumerIdToPhase(ctx, "chainID", keeper.Registered) - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "chainID", types.ConsumerRegistrationRecord{ - ChainId: "chainID", + providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Registered) + providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId", types.ConsumerRegistrationRecord{ + ChainId: "consumerId", }) - err = providerKeeper.HandleOptIn(ctx, "chainID", providerAddr, consumerKey) + err = providerKeeper.HandleOptIn(ctx, "consumerId", providerAddr, consumerKey) require.NoError(t, err) - // assert that the consumeKey was assigned to `providerAddr` validator on chain with id `chainID` - actualConsumerPubKey, found := providerKeeper.GetValidatorConsumerPubKey(ctx, "chainID", providerAddr) + // assert that the consumeKey was assigned to `providerAddr` validator on chain with id `consumerId` + actualConsumerPubKey, found := providerKeeper.GetValidatorConsumerPubKey(ctx, "consumerId", providerAddr) require.True(t, found) require.Equal(t, expectedConsumerPubKey, actualConsumerPubKey) // assert that the `consumerAddr` to `providerAddr` association was set as well consumerAddr, _ := ccvtypes.TMCryptoPublicKeyToConsAddr(actualConsumerPubKey) - actualProviderConsAddr, found := providerKeeper.GetValidatorByConsumerAddr(ctx, "chainID", types.NewConsumerConsAddress(consumerAddr)) + actualProviderConsAddr, found := providerKeeper.GetValidatorByConsumerAddr(ctx, "consumerId", types.NewConsumerConsAddress(consumerAddr)) require.True(t, found) require.Equal(t, providerAddr, actualProviderConsAddr) } @@ -121,27 +121,29 @@ func TestHandleOptOut(t *testing.T) { require.Error(t, providerKeeper.HandleOptOut(ctx, "unknownChainID", providerAddr)) // set a consumer client so that the chain is considered running - providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") + providerKeeper.SetConsumerClientId(ctx, "consumerId", "clientID") // 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)) + providerKeeper.SetOptedIn(ctx, "consumerId", providerAddr) + require.True(t, providerKeeper.IsOptedIn(ctx, "consumerId", providerAddr)) + providerKeeper.HandleOptOut(ctx, "consumerId", providerAddr) + require.False(t, providerKeeper.IsOptedIn(ctx, "consumerId", providerAddr)) } func TestHandleOptOutFromTopNChain(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + consumerId := "consumerId" // set a consumer client so that the chain is considered running - providerKeeper.SetConsumerClientId(ctx, chainID, "clientID") + providerKeeper.SetConsumerClientId(ctx, consumerId, "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) + providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, types.ConsumerUpdateRecord{ + Top_N: 50, + }) valA := createStakingValidator(ctx, mocks, 1, 1, 1) // 10% of the total voting power (can opt out) valAConsAddr, _ := valA.GetConsAddr() mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, valAConsAddr).Return(valA, nil).AnyTimes() @@ -160,29 +162,33 @@ func TestHandleOptOutFromTopNChain(t *testing.T) { // initialize the minPowerInTopN correctly minPowerInTopN, err := providerKeeper.ComputeMinPowerInTopN(ctx, []stakingtypes.Validator{valA, valB, valC, valD}, 50) require.NoError(t, err) - providerKeeper.SetMinimumPowerInTopN(ctx, chainID, minPowerInTopN) + providerKeeper.SetMinimumPowerInTopN(ctx, consumerId, minPowerInTopN) // 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)) + providerKeeper.SetOptedIn(ctx, consumerId, types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.AppendOptedInConsumerId(ctx, types.NewProviderConsAddress(valAConsAddr), consumerId) + providerKeeper.SetOptedIn(ctx, consumerId, types.NewProviderConsAddress(valBConsAddr)) + providerKeeper.AppendOptedInConsumerId(ctx, types.NewProviderConsAddress(valBConsAddr), consumerId) + providerKeeper.SetOptedIn(ctx, consumerId, types.NewProviderConsAddress(valCConsAddr)) + providerKeeper.AppendOptedInConsumerId(ctx, types.NewProviderConsAddress(valCConsAddr), consumerId) + providerKeeper.SetOptedIn(ctx, consumerId, types.NewProviderConsAddress(valDConsAddr)) + providerKeeper.AppendOptedInConsumerId(ctx, types.NewProviderConsAddress(valDConsAddr), consumerId) // 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))) + require.NoError(t, providerKeeper.HandleOptOut(ctx, consumerId, types.NewProviderConsAddress(valAConsAddr))) + require.NoError(t, providerKeeper.HandleOptOut(ctx, consumerId, 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))) + require.Error(t, providerKeeper.HandleOptOut(ctx, consumerId, types.NewProviderConsAddress(valCConsAddr))) + require.Error(t, providerKeeper.HandleOptOut(ctx, consumerId, 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, 5) notFoundValidatorConsAddr, _ := notFoundValidator.GetConsAddr() mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, notFoundValidatorConsAddr). Return(stakingtypes.Validator{}, stakingtypes.ErrNoValidatorFound) - require.Error(t, providerKeeper.HandleOptOut(ctx, chainID, types.NewProviderConsAddress(notFoundValidatorConsAddr))) + require.Error(t, providerKeeper.HandleOptOut(ctx, consumerId, types.NewProviderConsAddress(notFoundValidatorConsAddr))) } func TestHandleSetConsumerCommissionRate(t *testing.T) { @@ -246,14 +252,14 @@ func TestOptInTopNValidators(t *testing.T) { valDConsAddr, _ := valD.GetConsAddr() // Start Test 1: opt in all validators with power >= 0 - providerKeeper.OptInTopNValidators(ctx, "chainID", []stakingtypes.Validator{valA, valB, valC, valD}, 0) + providerKeeper.OptInTopNValidators(ctx, "consumerId", []stakingtypes.Validator{valA, valB, valC, valD}, 0) expectedOptedInValidators := []types.ProviderConsAddress{ types.NewProviderConsAddress(valAConsAddr), types.NewProviderConsAddress(valBConsAddr), types.NewProviderConsAddress(valCConsAddr), types.NewProviderConsAddress(valDConsAddr), } - actualOptedInValidators := providerKeeper.GetAllOptedIn(ctx, "chainID") + actualOptedInValidators := providerKeeper.GetAllOptedIn(ctx, "consumerId") // sort validators first to be able to compare sortUpdates := func(addresses []types.ProviderConsAddress) { @@ -267,31 +273,31 @@ func TestOptInTopNValidators(t *testing.T) { 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)) - providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valDConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valBConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valCConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", 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") + providerKeeper.OptInTopNValidators(ctx, "consumerId", []stakingtypes.Validator{valA, valB, valC, valD}, 0) + actualOptedInValidators = providerKeeper.GetAllOptedIn(ctx, "consumerId") 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)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valBConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valCConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valDConsAddr)) // 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) + providerKeeper.OptInTopNValidators(ctx, "consumerId", []stakingtypes.Validator{valA, valB, valC, valD}, 2) expectedOptedInValidators = []types.ProviderConsAddress{ types.NewProviderConsAddress(valBConsAddr), types.NewProviderConsAddress(valCConsAddr), } - actualOptedInValidators = providerKeeper.GetAllOptedIn(ctx, "chainID") + actualOptedInValidators = providerKeeper.GetAllOptedIn(ctx, "consumerId") // sort validators first to be able to compare sortUpdates(expectedOptedInValidators) @@ -299,14 +305,14 @@ func TestOptInTopNValidators(t *testing.T) { 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)) - providerKeeper.DeleteOptedIn(ctx, "chainID", types.NewProviderConsAddress(valDConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valAConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valBConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valCConsAddr)) + providerKeeper.DeleteOptedIn(ctx, "consumerId", types.NewProviderConsAddress(valDConsAddr)) // 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")) + providerKeeper.OptInTopNValidators(ctx, "consumerId", []stakingtypes.Validator{valA, valB, valC, valD}, 4) + require.Empty(t, providerKeeper.GetAllOptedIn(ctx, "consumerId")) } func TestComputeMinPowerInTopN(t *testing.T) { @@ -377,7 +383,7 @@ func TestComputeMinPowerInTopN(t *testing.T) { require.Error(t, err) } -// TestCanValidateChain returns true if `validator` is opted in, in `chainID. +// TestCanValidateChain returns true if `validator` is opted in, in `consumerId. func TestCanValidateChain(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -387,24 +393,24 @@ func TestCanValidateChain(t *testing.T) { providerAddr := types.NewProviderConsAddress(consAddr) // with no allowlist or denylist, the validator has to be opted in, in order to consider it - require.False(t, providerKeeper.CanValidateChain(ctx, "chainID", providerAddr)) - providerKeeper.SetOptedIn(ctx, "chainID", types.NewProviderConsAddress(consAddr)) - require.True(t, providerKeeper.CanValidateChain(ctx, "chainID", providerAddr)) + require.False(t, providerKeeper.CanValidateChain(ctx, "consumerId", providerAddr)) + providerKeeper.SetOptedIn(ctx, "consumerId", types.NewProviderConsAddress(consAddr)) + require.True(t, providerKeeper.CanValidateChain(ctx, "consumerId", providerAddr)) // create an allow list but do not add the validator `providerAddr` to it validatorA := createStakingValidator(ctx, mocks, 1, 1, 2) consAddrA, _ := validatorA.GetConsAddr() - providerKeeper.SetAllowlist(ctx, "chainID", types.NewProviderConsAddress(consAddrA)) - require.False(t, providerKeeper.CanValidateChain(ctx, "chainID", providerAddr)) - providerKeeper.SetAllowlist(ctx, "chainID", types.NewProviderConsAddress(consAddr)) - require.True(t, providerKeeper.CanValidateChain(ctx, "chainID", providerAddr)) + providerKeeper.SetAllowlist(ctx, "consumerId", types.NewProviderConsAddress(consAddrA)) + require.False(t, providerKeeper.CanValidateChain(ctx, "consumerId", providerAddr)) + providerKeeper.SetAllowlist(ctx, "consumerId", types.NewProviderConsAddress(consAddr)) + require.True(t, providerKeeper.CanValidateChain(ctx, "consumerId", providerAddr)) // create a denylist but do not add validator `providerAddr` to it - providerKeeper.SetDenylist(ctx, "chainID", types.NewProviderConsAddress(consAddrA)) - require.True(t, providerKeeper.CanValidateChain(ctx, "chainID", providerAddr)) + providerKeeper.SetDenylist(ctx, "consumerId", types.NewProviderConsAddress(consAddrA)) + require.True(t, providerKeeper.CanValidateChain(ctx, "consumerId", providerAddr)) // add validator `providerAddr` to the denylist - providerKeeper.SetDenylist(ctx, "chainID", types.NewProviderConsAddress(consAddr)) - require.False(t, providerKeeper.CanValidateChain(ctx, "chainID", providerAddr)) + providerKeeper.SetDenylist(ctx, "consumerId", types.NewProviderConsAddress(consAddr)) + require.False(t, providerKeeper.CanValidateChain(ctx, "consumerId", providerAddr)) } func TestCapValidatorSet(t *testing.T) { @@ -430,27 +436,37 @@ func TestCapValidatorSet(t *testing.T) { } validators := []types.ConsensusValidator{validatorA, validatorB, validatorC} - consumerValidators := providerKeeper.CapValidatorSet(ctx, "chainID", validators) + consumerValidators := providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, validators, consumerValidators) - providerKeeper.SetValidatorSetCap(ctx, "chainID", 0) - consumerValidators = providerKeeper.CapValidatorSet(ctx, "chainID", validators) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + ValidatorSetCap: 0, + }) + consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, validators, consumerValidators) - providerKeeper.SetValidatorSetCap(ctx, "chainID", 100) - consumerValidators = providerKeeper.CapValidatorSet(ctx, "chainID", validators) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + ValidatorSetCap: 100, + }) + consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, validators, consumerValidators) - providerKeeper.SetValidatorSetCap(ctx, "chainID", 1) - consumerValidators = providerKeeper.CapValidatorSet(ctx, "chainID", validators) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + ValidatorSetCap: 1, + }) + consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, []types.ConsensusValidator{validatorC}, consumerValidators) - providerKeeper.SetValidatorSetCap(ctx, "chainID", 2) - consumerValidators = providerKeeper.CapValidatorSet(ctx, "chainID", validators) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + ValidatorSetCap: 2, + }) + consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, []types.ConsensusValidator{validatorC, validatorB}, consumerValidators) - providerKeeper.SetValidatorSetCap(ctx, "chainID", 3) - consumerValidators = providerKeeper.CapValidatorSet(ctx, "chainID", validators) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + ValidatorSetCap: 3, + }) + consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, []types.ConsensusValidator{validatorC, validatorB, validatorA}, consumerValidators) } @@ -498,13 +514,15 @@ func TestCapValidatorsPower(t *testing.T) { } // no capping takes place because validators power-cap is not set - cappedValidators := providerKeeper.CapValidatorsPower(ctx, "chainID", validators) + cappedValidators := providerKeeper.CapValidatorsPower(ctx, "consumerId", validators) sortValidators(validators) sortValidators(cappedValidators) require.Equal(t, validators, cappedValidators) - providerKeeper.SetValidatorsPowerCap(ctx, "chainID", 33) - cappedValidators = providerKeeper.CapValidatorsPower(ctx, "chainID", validators) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + ValidatorsPowerCap: 33, + }) + cappedValidators = providerKeeper.CapValidatorsPower(ctx, "consumerId", validators) sortValidators(expectedValidators) sortValidators(cappedValidators) require.Equal(t, expectedValidators, cappedValidators) @@ -763,9 +781,11 @@ func TestFulfillsMinStake(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - providerKeeper.SetMinStake(ctx, "chainID", tc.minStake) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + MinStake: tc.minStake, + }) for i, valAddr := range consAddrs { - result := providerKeeper.FulfillsMinStake(ctx, "chainID", valAddr) + result := providerKeeper.FulfillsMinStake(ctx, "consumerId", valAddr) require.Equal(t, tc.expectedFulfill[i], result) } }) @@ -785,7 +805,7 @@ func TestIfInactiveValsDisallowedProperty(t *testing.T) { // opt the validators in for _, valAddr := range consAddrs { - providerKeeper.SetOptedIn(ctx, "chainID", valAddr) + providerKeeper.SetOptedIn(ctx, "consumerId", valAddr) } // Randomly choose values for parameters @@ -795,14 +815,16 @@ func TestIfInactiveValsDisallowedProperty(t *testing.T) { // Set up the parameters in the provider keeper // do not allow inactive validators - providerKeeper.SetInactiveValidatorsAllowed(ctx, "chainID", false) - providerKeeper.SetMinStake(ctx, "chainID", minStake) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + MinStake: minStake, + AllowInactiveVals: false, + }) params := providerKeeper.GetParams(ctx) params.MaxProviderConsensusValidators = int64(maxProviderConsensusVals) providerKeeper.SetParams(ctx, params) // Compute the next validators - nextVals := providerKeeper.ComputeNextValidators(ctx, "chainID", vals) + nextVals := providerKeeper.ComputeNextValidators(ctx, "consumerId", vals) // Check that the length of nextVals is at most maxProviderConsensusVals require.LessOrEqual(r, len(nextVals), int(maxProviderConsensusVals), "The length of nextVals should be at most maxProviderConsensusVals") diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 5115f9d5fa..b9ec7669fe 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -1,12 +1,16 @@ package keeper import ( + "bytes" errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" "encoding/binary" + "encoding/gob" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + "sort" + "strconv" "time" ) @@ -14,21 +18,24 @@ import ( type ConsumerPhase byte const ( + // Registered phase indicates the phase in which a consumer chain has been assigned a unique consumer id. This consumer + // id can be used to interact with the consumer chain (e.g., when a validator opts in to a chain). A chain in this + // phase cannot yet launch. It has to be initialized first. Registered ConsumerPhase = iota + // Initialized phase indicates the phase in which a consumer chain has set all the needed parameters to launch but + // has not yet launched (e.g., because the `spawnTime` of the consumer chain has not yet been reached). Initialized + // TODO (PERMISSIONLESS) add this if the chain fails to launch + // Useful so we do not keep trying to launch failed chains + // FailedToLaunch phase indicates that the chain attempted but failed to launch (e.g., due to no validator opting in) + FailedToLaunch + // Launched phase corresponds to the phase in which a consumer chain is running and consuming a subset of the validator + // set of the provider. Launched + // Stopped phase corresponds to the phase in which a previously-launched chain has stopped. Stopped ) -var DefaultUpdateRecord = types.ConsumerUpdateRecord{ - OwnerAddress: "", - Top_N: 0, - ValidatorsPowerCap: 0, - ValidatorSetCap: 0, - Allowlist: []string{}, - Denylist: []string{}, -} - // setConsumerId sets the provided consumerId func (k Keeper) setConsumerId(ctx sdk.Context, consumerId uint64) { store := ctx.KVStore(k.storeKey) @@ -39,8 +46,8 @@ func (k Keeper) setConsumerId(ctx sdk.Context, consumerId uint64) { store.Set(types.ConsumerIdKey(), buf) } -// GetConsumerId returns the last registered consumer id -func (k Keeper) GetConsumerId(ctx sdk.Context) (uint64, bool) { +// getConsumerId returns the last registered consumer id +func (k Keeper) getConsumerId(ctx sdk.Context) (uint64, bool) { store := ctx.KVStore(k.storeKey) buf := store.Get(types.ConsumerIdKey()) if buf == nil { @@ -51,145 +58,120 @@ func (k Keeper) GetConsumerId(ctx sdk.Context) (uint64, bool) { // FetchAndIncrementConsumerId fetches the first consumer id that can be used and increments the // underlying consumer id -func (k Keeper) FetchAndIncrementConsumerId(ctx sdk.Context) uint64 { - consumerId, found := k.GetConsumerId(ctx) - if !found { - consumerId = 0 - } - +func (k Keeper) FetchAndIncrementConsumerId(ctx sdk.Context) string { + consumerId, _ := k.getConsumerId(ctx) k.setConsumerId(ctx, consumerId+1) - return consumerId + return strconv.FormatUint(consumerId, 10) } -// GetConsumerIdToRegistrationRecord returns the registration record associated with this consumer id -func (k Keeper) GetConsumerIdToRegistrationRecord(ctx sdk.Context, consumerId string) (types.ConsumerRegistrationRecord, bool) { +// GetConsumerRegistrationRecord returns the registration record associated with this consumer id +func (k Keeper) GetConsumerRegistrationRecord(ctx sdk.Context, consumerId string) (types.ConsumerRegistrationRecord, error) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.ConsumerIdToRegistrationRecordKey(consumerId)) if bz == nil { - return types.ConsumerRegistrationRecord{}, false + return types.ConsumerRegistrationRecord{}, fmt.Errorf("failed to retrieve registration record for consumer id (%s)", consumerId) } var record types.ConsumerRegistrationRecord if err := record.Unmarshal(bz); err != nil { - panic(fmt.Errorf("failed to unmarshal record: %w", err)) + return types.ConsumerRegistrationRecord{}, fmt.Errorf("failed to unmarshal registration record for consumer id (%s): %w", consumerId, err) } - return record, true + return record, nil } -// SetConsumerIdToRegistrationRecord sets the registration record associated with this consumer id -func (k Keeper) SetConsumerIdToRegistrationRecord(ctx sdk.Context, consumerId string, record types.ConsumerRegistrationRecord) { +// SetConsumerRegistrationRecord sets the registration record associated with this consumer id +func (k Keeper) SetConsumerRegistrationRecord(ctx sdk.Context, consumerId string, record types.ConsumerRegistrationRecord) error { store := ctx.KVStore(k.storeKey) bz, err := record.Marshal() if err != nil { - panic(fmt.Errorf("failed to marshal record (%+v): %w", record, err)) + return fmt.Errorf("failed to marshal registration record (%+v) for consumer id (%s): %w", record, consumerId, err) } store.Set(types.ConsumerIdToRegistrationRecordKey(consumerId), bz) + return nil } -// DeleteConsumerIdToRegistrationRecord deletes the registration record associated with this consumer id -func (k Keeper) DeleteConsumerIdToRegistrationRecord(ctx sdk.Context, consumerId string) { +// DeleteConsumerRegistrationRecord deletes the registration record associated with this consumer id +func (k Keeper) DeleteConsumerRegistrationRecord(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) store.Delete(types.ConsumerIdToRegistrationRecordKey(consumerId)) } -// GetConsumerIdToInitializationRecord returns the initialization record associated with this consumer id -func (k Keeper) GetConsumerIdToInitializationRecord(ctx sdk.Context, consumerId string) (types.ConsumerInitializationRecord, bool) { +// GetConsumerInitializationRecord returns the initialization record associated with this consumer id +func (k Keeper) GetConsumerInitializationRecord(ctx sdk.Context, consumerId string) (types.ConsumerInitializationRecord, error) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.ConsumerIdToInitializationRecordKey(consumerId)) if bz == nil { - return types.ConsumerInitializationRecord{}, false + return types.ConsumerInitializationRecord{}, fmt.Errorf("failed to retrieve initialization record for consumer id (%s)", consumerId) } var record types.ConsumerInitializationRecord if err := record.Unmarshal(bz); err != nil { - panic(fmt.Errorf("failed to unmarshal record: %w", err)) + return types.ConsumerInitializationRecord{}, fmt.Errorf("failed to unmarshal stop time for consumer id (%s): %w", consumerId, err) } - return record, true + return record, nil } -// SetConsumerIdToInitializationRecord sets the initialization record associated with this consumer id -func (k Keeper) SetConsumerIdToInitializationRecord(ctx sdk.Context, consumerId string, record types.ConsumerInitializationRecord) { +// SetConsumerInitializationRecord sets the initialization record associated with this consumer id +func (k Keeper) SetConsumerInitializationRecord(ctx sdk.Context, consumerId string, record types.ConsumerInitializationRecord) error { store := ctx.KVStore(k.storeKey) bz, err := record.Marshal() if err != nil { - panic(fmt.Errorf("failed to marshal record (%+v): %w", record, err)) + return fmt.Errorf("failed to marshal initialization record (%+v) for consumer id (%s): %w", record, consumerId, err) } store.Set(types.ConsumerIdToInitializationRecordKey(consumerId), bz) + return nil } -// DeleteConsumerIdToInitializationRecord deletes the initialization record associated with this consumer id -func (k Keeper) DeleteConsumerIdToInitializationRecord(ctx sdk.Context, consumerId string) { +// DeleteConsumerInitializationRecord deletes the initialization record associated with this consumer id +func (k Keeper) DeleteConsumerInitializationRecord(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) store.Delete(types.ConsumerIdToInitializationRecordKey(consumerId)) } -// GetConsumerIdToUpdateRecord returns the update record associated with this consumer id -func (k Keeper) GetConsumerIdToUpdateRecord(ctx sdk.Context, consumerId string) (types.ConsumerUpdateRecord, bool) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerIdToUpdateRecordKey(consumerId)) - if bz == nil { - return types.ConsumerUpdateRecord{}, false - } - var record types.ConsumerUpdateRecord - if err := record.Unmarshal(bz); err != nil { - panic(fmt.Errorf("failed to unmarshal record: %w", err)) - } - return record, true -} - -// GetConsumerIdToUpdateRecordOrDefault returns the update record associated with this consumer id or the default record -// if there is no update record associated with this consumer id -func (k Keeper) GetConsumerIdToUpdateRecordOrDefault(ctx sdk.Context, consumerId string, defaultRecord types.ConsumerUpdateRecord) types.ConsumerUpdateRecord { +// GetConsumerUpdateRecord returns the update record associated with this consumer id +func (k Keeper) GetConsumerUpdateRecord(ctx sdk.Context, consumerId string) (types.ConsumerUpdateRecord, error) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.ConsumerIdToUpdateRecordKey(consumerId)) if bz == nil { - return defaultRecord + return types.ConsumerUpdateRecord{}, fmt.Errorf("failed to retrieve update record for consumer id (%s)", consumerId) } var record types.ConsumerUpdateRecord if err := record.Unmarshal(bz); err != nil { - panic(fmt.Errorf("failed to unmarshal record: %w", err)) + return types.ConsumerUpdateRecord{}, fmt.Errorf("failed to unmarshal update record for consumer id (%s): %w", consumerId, err) } - return record + return record, nil } -// SetConsumerIdToUpdateRecord sets the update record associated with this consumer id -func (k Keeper) SetConsumerIdToUpdateRecord(ctx sdk.Context, consumerId string, record types.ConsumerUpdateRecord) { +// SetConsumerUpdateRecord sets the update record associated with this consumer id +func (k Keeper) SetConsumerUpdateRecord(ctx sdk.Context, consumerId string, record types.ConsumerUpdateRecord) error { store := ctx.KVStore(k.storeKey) bz, err := record.Marshal() if err != nil { - panic(fmt.Errorf("failed to marshal record (%+v): %w", record, err)) + return fmt.Errorf("failed to marshal update record (%+v) for consumer id (%s): %w", record, consumerId, err) } store.Set(types.ConsumerIdToUpdateRecordKey(consumerId), bz) + return nil } -// DeleteConsumerIdToUpdateRecord deletes the update record associated with this consumer id -func (k Keeper) DeleteConsumerIdToUpdateRecord(ctx sdk.Context, consumerId string) { +// DeleteConsumerUpdateRecord deletes the update record associated with this consumer id +func (k Keeper) DeleteConsumerUpdateRecord(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) store.Delete(types.ConsumerIdToUpdateRecordKey(consumerId)) } -// GetConsumerIdToOwnerAddress returns the owner address associated with this consumer id -func (k Keeper) GetConsumerIdToOwnerAddress(ctx sdk.Context, consumerId string) (string, bool) { - store := ctx.KVStore(k.storeKey) - buf := store.Get(types.ConsumerIdToOwnerAddressKey(consumerId)) - if buf == nil { - return "", false - } - return string(buf), true -} - -// SetConsumerIdToOwnerAddress sets the owner address associated with this consumer id -func (k Keeper) SetConsumerIdToOwnerAddress(ctx sdk.Context, consumerId string, ownerAddress string) { - store := ctx.KVStore(k.storeKey) - store.Set(types.ConsumerIdToOwnerAddressKey(consumerId), []byte(ownerAddress)) +// GetConsumerOwnerAddress returns the owner address associated with this consumer id +func (k Keeper) GetConsumerOwnerAddress(ctx sdk.Context, consumerId string) string { + updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + return updateRecord.OwnerAddress } -// DeleteConsumerIdToOwnerAddress deletes the owner address associated with this consumer id -func (k Keeper) DeleteConsumerIdToOwnerAddress(ctx sdk.Context, consumerId string) { - store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerIdToOwnerAddressKey(consumerId)) +// SetConsumerOwnerAddress sets the owner address associated with this consumer id +func (k Keeper) SetConsumerOwnerAddress(ctx sdk.Context, consumerId string, ownerAddress string) { + updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + updateRecord.OwnerAddress = ownerAddress + k.SetConsumerUpdateRecord(ctx, consumerId, updateRecord) } -// GetConsumerIdToPhase returns the phase associated with this consumer id -func (k Keeper) GetConsumerIdToPhase(ctx sdk.Context, consumerId string) (ConsumerPhase, bool) { +// GetConsumerPhase returns the phase associated with this consumer id +func (k Keeper) GetConsumerPhase(ctx sdk.Context, consumerId string) (ConsumerPhase, bool) { store := ctx.KVStore(k.storeKey) buf := store.Get(types.ConsumerIdToPhaseKey(consumerId)) if buf == nil { @@ -198,49 +180,296 @@ func (k Keeper) GetConsumerIdToPhase(ctx sdk.Context, consumerId string) (Consum return ConsumerPhase(buf[0]), true } -// SetConsumerIdToPhase sets the phase associated with this consumer id +// SetConsumerPhase sets the phase associated with this consumer id // TODO (PERMISSIONLESS): use this method when launching and when stopping a chain -func (k Keeper) SetConsumerIdToPhase(ctx sdk.Context, consumerId string, phase ConsumerPhase) { +func (k Keeper) SetConsumerPhase(ctx sdk.Context, consumerId string, phase ConsumerPhase) { store := ctx.KVStore(k.storeKey) store.Set(types.ConsumerIdToPhaseKey(consumerId), []byte{byte(phase)}) } -// DeleteConsumerIdToPhase deletes the phase associated with this consumer id -func (k Keeper) DeleteConsumerIdToPhase(ctx sdk.Context, consumerId string) { +// DeleteConsumerPhase deletes the phase associated with this consumer id +func (k Keeper) DeleteConsumerPhase(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) store.Delete(types.ConsumerIdToPhaseKey(consumerId)) } -// GetConsumerIdToStopTime returns the stop time associated with the to-be-stopped chain with consumer id -func (k Keeper) GetConsumerIdToStopTime(ctx sdk.Context, consumerId string) (time.Time, bool) { +// GetConsumerStopTime returns the stop time associated with the to-be-stopped chain with consumer id +func (k Keeper) GetConsumerStopTime(ctx sdk.Context, consumerId string) (time.Time, error) { store := ctx.KVStore(k.storeKey) buf := store.Get(types.ConsumerIdToStopTimeKey(consumerId)) if buf == nil { - return time.Time{}, false + return time.Time{}, fmt.Errorf("failed to retrieve stop time for consumer id (%s)", consumerId) } var time time.Time if err := time.UnmarshalBinary(buf); err != nil { - panic(fmt.Errorf("failed to unmarshal time: %w", err)) + return time, fmt.Errorf("failed to unmarshal stop time for consumer id (%s): %w", consumerId, err) } - return time, true + return time, nil } -// SetConsumerIdToStopTime sets the stop time associated with this consumer id -func (k Keeper) SetConsumerIdToStopTime(ctx sdk.Context, consumerId string, stopTime time.Time) { +// SetConsumerStopTime sets the stop time associated with this consumer id +func (k Keeper) SetConsumerStopTime(ctx sdk.Context, consumerId string, stopTime time.Time) error { store := ctx.KVStore(k.storeKey) buf, err := stopTime.MarshalBinary() if err != nil { - panic(fmt.Errorf("failed to marshal time: %w", err)) + return fmt.Errorf("failed to marshal stop time (%+v) for consumer id (%s): %w", stopTime, consumerId, err) } store.Set(types.ConsumerIdToStopTimeKey(consumerId), buf) + return nil } -// DeleteConsumerIdToStopTime deletes the stop time associated with this consumer id -func (k Keeper) DeleteConsumerIdToStopTime(ctx sdk.Context, consumerId string) { +// DeleteConsumerStopTime deletes the stop time associated with this consumer id +func (k Keeper) DeleteConsumerStopTime(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) store.Delete(types.ConsumerIdToStopTimeKey(consumerId)) } +// GetConsumersToBeLaunched +func (k Keeper) GetConsumersToBeLaunched(ctx sdk.Context, spawnTime time.Time) ([]string, error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.SpawnTimeToConsumerIdsKey(spawnTime)) + if bz == nil { + return []string{}, nil + } + + var consumerIds []string + buf := bytes.NewBuffer(bz) + dec := gob.NewDecoder(buf) + err := dec.Decode(&consumerIds) + return consumerIds, err +} + +// AppendSpawnTimeForConsumerToBeLaunched +func (k Keeper) AppendSpawnTimeForConsumerToBeLaunched(ctx sdk.Context, consumerId string, spawnTime time.Time) error { + store := ctx.KVStore(k.storeKey) + + consumerIds, err := k.GetConsumersToBeLaunched(ctx, spawnTime) + if err != nil { + return err + } + consumerIds = append(consumerIds, consumerId) + + // sort so that we avoid getting a consumer id in front of everyone else and delaying the appending of a chain + sort.Slice(consumerIds, func(i, j int) bool { + return consumerIds[i] < consumerIds[j] + }) + + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + err = enc.Encode(consumerIds) + if err != nil { + return err + } + + store.Set(types.SpawnTimeToConsumerIdsKey(spawnTime), buf.Bytes()) + return nil +} + +// RemoveConsumerFromToBeLaunchedConsumers +func (k Keeper) RemoveConsumerFromToBeLaunchedConsumers(ctx sdk.Context, consumerId string, spawnTime time.Time) error { + store := ctx.KVStore(k.storeKey) + + consumerIds, err := k.GetConsumersToBeLaunched(ctx, spawnTime) + if err != nil { + return err + } + + if len(consumerIds) == 0 { + return fmt.Errorf("no consumer ids for spawn time: %s", spawnTime.String()) + } + + // find the index of the consumer we want to remove + index := 0 + for i := 0; i < len(consumerIds); i = i + 1 { + if consumerIds[i] == consumerId { + index = i + break + } + } + if consumerIds[index] != consumerId { + return fmt.Errorf("failed to find consumer id (%s) in the chains to be launched", consumerId) + } + + if len(consumerIds) == 1 { + store.Delete(types.SpawnTimeToConsumerIdsKey(spawnTime)) + return nil + } + + updatedConsumerIds := append(consumerIds[:index], consumerIds[index+1:]...) + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + err = enc.Encode(updatedConsumerIds) + if err != nil { + return err + } + + store.Set(types.SpawnTimeToConsumerIdsKey(spawnTime), buf.Bytes()) + return nil +} + +// TODO (PERMISSIONLESS) merge the functions, they practicall do the same + +// GetConsumersToBeStopped +func (k Keeper) GetConsumersToBeStopped(ctx sdk.Context, stopTime time.Time) ([]string, error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.StopTimeToConsumerIdsKey(stopTime)) + if bz == nil { + return []string{}, nil + } + + var consumerIds []string + buf := bytes.NewBuffer(bz) + dec := gob.NewDecoder(buf) + err := dec.Decode(&consumerIds) + return consumerIds, err +} + +// AppendSpawnTimeForConsumerToBeStopped +func (k Keeper) AppendStopTimeForConsumerToBeStopped(ctx sdk.Context, consumerId string, stopTime time.Time) error { + store := ctx.KVStore(k.storeKey) + + consumerIds, err := k.GetConsumersToBeStopped(ctx, stopTime) + if err != nil { + return err + } + consumerIds = append(consumerIds, consumerId) + + // sort so that we avoid getting a consumer id in front of everyone else and delying the removal of a chain + sort.Slice(consumerIds, func(i, j int) bool { + return consumerIds[i] < consumerIds[j] + }) + + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + err = enc.Encode(consumerIds) + if err != nil { + return err + } + + store.Set(types.StopTimeToConsumerIdsKey(stopTime), buf.Bytes()) + return nil +} + +// RemoveConsumerFromToBeStoppedConsumers +func (k Keeper) RemoveConsumerFromToBeStoppedConsumers(ctx sdk.Context, consumerId string, stopTime time.Time) error { + store := ctx.KVStore(k.storeKey) + + consumerIds, err := k.GetConsumersToBeStopped(ctx, stopTime) + if err != nil { + return err + } + + if len(consumerIds) == 0 { + return fmt.Errorf("no consumer ids for stop time: %s", stopTime.String()) + } + + // find the index of the consumer we want to remove + index := 0 + for i := 0; i < len(consumerIds); i = i + 1 { + if consumerIds[i] == consumerId { + index = i + break + } + } + if consumerIds[index] != consumerId { + return fmt.Errorf("failed to find consumer id (%s) in the chains to be stopped", consumerId) + } + + if len(consumerIds) == 1 { + store.Delete(types.StopTimeToConsumerIdsKey(stopTime)) + return nil + } + + updatedConsumerIds := append(consumerIds[:index], consumerIds[index+1:]...) + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + err = enc.Encode(updatedConsumerIds) + if err != nil { + return err + } + + store.Set(types.StopTimeToConsumerIdsKey(stopTime), buf.Bytes()) + return nil +} + +// GetOptedInConsumerIds +func (k Keeper) GetOptedInConsumerIds(ctx sdk.Context, providerAddr types.ProviderConsAddress) ([]string, error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ProviderConsAddrToOptedInConsumerIdsKey(providerAddr)) + if bz == nil { + return []string{}, nil + } + + var consumerIds []string + buf := bytes.NewBuffer(bz) + dec := gob.NewDecoder(buf) + err := dec.Decode(&consumerIds) + return consumerIds, err +} + +// AppendOptedInConsumerId +func (k Keeper) AppendOptedInConsumerId(ctx sdk.Context, providerAddr types.ProviderConsAddress, consumerId string) error { + store := ctx.KVStore(k.storeKey) + + consumerIds, err := k.GetOptedInConsumerIds(ctx, providerAddr) + if err != nil { + return err + } + consumerIds = append(consumerIds, consumerId) + + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + err = enc.Encode(consumerIds) + if err != nil { + return err + } + + store.Set(types.ProviderConsAddrToOptedInConsumerIdsKey(providerAddr), buf.Bytes()) + return nil +} + +// RemoveOptedInConsumerId +func (k Keeper) RemoveOptedInConsumerId(ctx sdk.Context, providerAddr types.ProviderConsAddress, consumerId string) error { + store := ctx.KVStore(k.storeKey) + + consumerIds, err := k.GetOptedInConsumerIds(ctx, providerAddr) + if err != nil { + return err + } + + if len(consumerIds) == 0 { + return fmt.Errorf("no consumer ids for provider consensus address: %s", providerAddr.String()) + } + + // find the index of the consumer we want to remove + index := 0 + for i := 0; i < len(consumerIds); i = i + 1 { + if consumerIds[i] == consumerId { + index = i + break + } + } + if consumerIds[index] != consumerId { + return fmt.Errorf("failed to find consumer id (%s) from the opted-in chains", consumerId) + } + + if len(consumerIds) == 1 { + store.Delete(types.ProviderConsAddrToOptedInConsumerIdsKey(providerAddr)) + return nil + } + + updatedConsumerIds := append(consumerIds[:index], consumerIds[index+1:]...) + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + err = enc.Encode(updatedConsumerIds) + if err != nil { + return err + } + + store.Set(types.ProviderConsAddrToOptedInConsumerIdsKey(providerAddr), buf.Bytes()) + return nil +} + // GetClientIdToConsumerId returns the consumer id associated with this client id func (k Keeper) GetClientIdToConsumerId(ctx sdk.Context, clientId string) (string, bool) { store := ctx.KVStore(k.storeKey) @@ -265,34 +494,49 @@ func (k Keeper) DeleteClientIdToConsumerId(ctx sdk.Context, clientId string) { // GetInitializedConsumersReadyToLaunch returns the consumer ids of the pending initialized consumer chains // that are ready to launch, i.e., consumer clients to be created. -func (k Keeper) GetInitializedConsumersReadyToLaunch(ctx sdk.Context) []string { +func (k Keeper) GetInitializedConsumersReadyToLaunch(ctx sdk.Context, limit uint32) []string { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToInitializationRecordKeyPrefix()) - defer iterator.Close() - var consumerIds []string + spawnTimeToConsumerIdsKeyPrefix := types.SpawnTimeToConsumerIdsKeyPrefix() + iterator := storetypes.KVStorePrefixIterator(store, []byte{spawnTimeToConsumerIdsKeyPrefix}) + defer iterator.Close() + result := []string{} for ; iterator.Valid(); iterator.Next() { - // the `consumerId` resides in the whole key, but we skip the first byte (because it's the `ConsumerIdKey`) - // plus 8 more bytes for the `uint64` in the key that contains the length of the `consumerId` - consumerId := string(iterator.Key()[1+8:]) - - var record types.ConsumerInitializationRecord - err := record.Unmarshal(iterator.Value()) + spawnTime, err := types.ParseTime(types.SpawnTimeToConsumerIdsKeyPrefix(), iterator.Key()) if err != nil { - panic(fmt.Errorf("failed to unmarshal consumer record: %w for consumer id: %s", err, consumerId)) + k.Logger(ctx).Error("failed to parse spawn time", + "error", err) + continue + } + if spawnTime.After(ctx.BlockTime()) { + return result } // if current block time is equal to or after spawnTime, and the chain is initialized, we can launch the chain - phase, found := k.GetConsumerIdToPhase(ctx, consumerId) - if !ctx.BlockTime().Before(record.SpawnTime) && (found && phase == Initialized) { - consumerIds = append(consumerIds, consumerId) + consumerIds, err := k.GetConsumersToBeLaunched(ctx, spawnTime) + if err != nil { + k.Logger(ctx).Error("failed to retrieve consumers to launch", + "spawn time", spawnTime, + "error", err) + continue + } + if len(result)+len(consumerIds) >= int(limit) { + remainingConsumerIds := len(result) + len(consumerIds) - int(limit) + if len(consumerIds[:len(consumerIds)-remainingConsumerIds]) == 0 { + return result + } + return append(result, consumerIds[:len(consumerIds)-remainingConsumerIds]...) + } else { + result = append(result, consumerIds...) } } - return consumerIds + return result } +// LaunchConsumer launches the chain with the provided consumer id by creating the consumer client and the respective +// consumer genesis file func (k Keeper) LaunchConsumer(ctx sdk.Context, consumerId string) error { err := k.CreateConsumerClient(ctx, consumerId) if err != nil { @@ -314,24 +558,21 @@ func (k Keeper) LaunchConsumer(ctx sdk.Context, consumerId string) error { return nil } +// UpdateConsumer updates the chain with the provided consumer id func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { - phase, found := k.GetConsumerIdToPhase(ctx, consumerId) + phase, found := k.GetConsumerPhase(ctx, consumerId) if !found || phase == Stopped { return errorsmod.Wrapf(types.ErrInvalidPhase, "cannot update stopped or not existing chain: %s", consumerId) } - updateRecord, found := k.GetConsumerIdToUpdateRecord(ctx, consumerId) - if !found { + updateRecord, err := k.GetConsumerUpdateRecord(ctx, consumerId) + if err != nil { // TODO (permissionless) -- not really an invalid update record return errorsmod.Wrapf(types.ErrInvalidUpdateRecord, "did not find update record for chain: %s", consumerId) } - k.SetTopN(ctx, consumerId, updateRecord.Top_N) - k.SetValidatorsPowerCap(ctx, consumerId, updateRecord.ValidatorsPowerCap) - k.SetValidatorSetCap(ctx, consumerId, updateRecord.ValidatorSetCap) - k.DeleteAllowlist(ctx, consumerId) for _, address := range updateRecord.Allowlist { consAddr, err := sdk.ConsAddressFromBech32(address) @@ -352,7 +593,7 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { k.SetDenylist(ctx, consumerId, types.NewProviderConsAddress(consAddr)) } - oldTopN, found := k.GetTopN(ctx, consumerId) + oldTopN := k.GetTopN(ctx, consumerId) if !found { oldTopN = 0 k.Logger(ctx).Info("consumer chain top N not found, treating as 0", "consumerId", consumerId) @@ -377,64 +618,78 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { } } - k.SetMinStake(ctx, consumerId, updateRecord.MinStake) - k.SetInactiveValidatorsAllowed(ctx, consumerId, updateRecord.AllowInactiveVals) - return nil } // GetLaunchedConsumersReadyToStop returns the consumer ids of the pending launched consumer chains // that are ready to stop -func (k Keeper) GetLaunchedConsumersReadyToStop(ctx sdk.Context) []string { +func (k Keeper) GetLaunchedConsumersReadyToStop(ctx sdk.Context, limit uint32) []string { store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToStopTimeKeyNamePrefix()) - defer iterator.Close() - var consumerIds []string + stopTimeToConsumerIdsKeyPrefix := types.StopTimeToConsumerIdsKeyPrefix() + iterator := storetypes.KVStorePrefixIterator(store, []byte{stopTimeToConsumerIdsKeyPrefix}) + defer iterator.Close() + result := []string{} for ; iterator.Valid(); iterator.Next() { - // the `consumerId` resides in the whole key, but we skip the first byte (because it's the `ConsumerIdKey`) - // plus 8 more bytes for the `uint64` in the key that contains the length of the `consumerId` - consumerId := string(iterator.Key()[1+8:]) - - var stopTime time.Time - err := stopTime.UnmarshalBinary(iterator.Value()) + stopTime, err := types.ParseTime(types.StopTimeToConsumerIdsKeyPrefix(), iterator.Key()) if err != nil { - panic(fmt.Errorf("failed to unmarshal stop stopTime: %w for consumer id: %s", err, consumerId)) + k.Logger(ctx).Error("failed to parse stop time", + "error", err) + continue + } + if stopTime.After(ctx.BlockTime()) { + return result } - // if current block time is equal to or after stop stopTime, and the chain is launched we can stop the chain - phase, found := k.GetConsumerIdToPhase(ctx, consumerId) - if !ctx.BlockTime().Before(stopTime) && (found && phase == Launched) { - consumerIds = append(consumerIds, string(iterator.Key()[1+8:])) + consumerIds, err := k.GetConsumersToBeStopped(ctx, stopTime) + if err != nil { + k.Logger(ctx).Error("failed to retrieve consumers to stop", + "stop time", stopTime, + "error", err) + continue } + if len(result)+len(consumerIds) >= int(limit) { + remainingConsumerIds := len(result) + len(consumerIds) - int(limit) + if len(consumerIds[:len(consumerIds)-remainingConsumerIds]) == 0 { + return result + } + return append(result, consumerIds[:len(consumerIds)-remainingConsumerIds]...) + } else { + result = append(result, consumerIds...) + } + + consumerIds = append(consumerIds, string(iterator.Key()[1+8:])) } - return consumerIds + return result } -// IsValidatorOptedInToChain checks if the validator with `providerAddr` is opted into the chain with the specified `chainId`. +// IsValidatorOptedInToChainId checks if the validator with `providerAddr` is opted into the chain with the specified `chainId`. // It returns `found == true` and the corresponding chain's `consumerId` if the validator is opted in. Otherwise, it returns an empty string // for `consumerId` and `found == false`. -func (k Keeper) IsValidatorOptedInToChain(ctx sdk.Context, providerAddr types.ProviderConsAddress, chainId string) (consumerId string, found bool) { - store := ctx.KVStore(k.storeKey) - iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToRegistrationRecordKeyPrefix()) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - // the `currentConsumerId` resides in the whole key, but we skip the first byte (because it's the `ConsumerIdKey`) - // plus 8 more bytes for the `uint64` in the key that contains the length of the `currentConsumerId` - currentConsumerId := string(iterator.Key()[1+8:]) +func (k Keeper) IsValidatorOptedInToChainId(ctx sdk.Context, providerAddr types.ProviderConsAddress, chainId string) (string, bool) { + consumerIds, err := k.GetOptedInConsumerIds(ctx, providerAddr) + if err != nil { + k.Logger(ctx).Error("failed to retrieve the consumer ids this validator is opted in to", + "providerAddr", providerAddr, + "error", err) + return "", false + } - var record types.ConsumerRegistrationRecord - err := record.Unmarshal(iterator.Value()) + for _, consumerId := range consumerIds { + record, err := k.GetConsumerRegistrationRecord(ctx, consumerId) if err != nil { - panic(fmt.Errorf("failed to unmarshal registration record: %w for consumer id: %s", err, currentConsumerId)) + k.Logger(ctx).Error("cannot find registration record", + "consumerId", consumerId, + "error", err) + continue } - if record.ChainId == chainId && k.IsOptedIn(ctx, currentConsumerId, providerAddr) { - return currentConsumerId, true + if record.ChainId == chainId { + return consumerId, true } + } return "", false } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index aad177de61..bd5e28a3f8 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -10,27 +10,18 @@ import ( "time" ) -// TestConsumerId tests methods for retrieving and incrementing consumer id -func TestConsumerId(t *testing.T) { +func TestFetchAndIncrementConsumerId(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - consumerId, found := providerKeeper.GetConsumerId(ctx) - require.False(t, found) + consumerId := providerKeeper.FetchAndIncrementConsumerId(ctx) + require.Equal(t, "0", consumerId) consumerId = providerKeeper.FetchAndIncrementConsumerId(ctx) - require.Equal(t, uint64(0), consumerId) - - consumerId, found = providerKeeper.GetConsumerId(ctx) - require.True(t, found) - require.Equal(t, uint64(1), consumerId) + require.Equal(t, "1", consumerId) consumerId = providerKeeper.FetchAndIncrementConsumerId(ctx) - require.Equal(t, uint64(1), consumerId) - - consumerId, found = providerKeeper.GetConsumerId(ctx) - require.True(t, found) - require.Equal(t, uint64(2), consumerId) + require.Equal(t, "2", consumerId) } // TestClientIdToConsumerId tests the getter, setter, and deletion methods of the client id to consumer id methods @@ -63,17 +54,17 @@ func TestConsumerIdToRegistrationRecord(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - _, found := providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "consumerId") - require.False(t, found) + _, err := providerKeeper.GetConsumerRegistrationRecord(ctx, "consumerId") + require.Error(t, err) expectedRecord := providertypes.ConsumerRegistrationRecord{ Title: "title", Description: "description", ChainId: "chain_id", } - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "consumerId", expectedRecord) - actualRecord, found := providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "consumerId") - require.True(t, found) + providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId", expectedRecord) + actualRecord, err := providerKeeper.GetConsumerRegistrationRecord(ctx, "consumerId") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) // assert that overwriting the current registration record works @@ -82,14 +73,14 @@ func TestConsumerIdToRegistrationRecord(t *testing.T) { Description: "description 2", ChainId: "chain_id2", } - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "consumerId", expectedRecord) - actualRecord, found = providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "consumerId") - require.True(t, found) + providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId", expectedRecord) + actualRecord, err = providerKeeper.GetConsumerRegistrationRecord(ctx, "consumerId") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) - providerKeeper.DeleteConsumerIdToRegistrationRecord(ctx, "consumerId") - actualRecord, found = providerKeeper.GetConsumerIdToRegistrationRecord(ctx, "consumerId") - require.False(t, found) + providerKeeper.DeleteConsumerRegistrationRecord(ctx, "consumerId") + actualRecord, err = providerKeeper.GetConsumerRegistrationRecord(ctx, "consumerId") + require.Error(t, err) require.Equal(t, providertypes.ConsumerRegistrationRecord{}, actualRecord) } @@ -98,8 +89,8 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - _, found := providerKeeper.GetConsumerIdToInitializationRecord(ctx, "consumerId") - require.False(t, found) + _, err := providerKeeper.GetConsumerInitializationRecord(ctx, "consumerId") + require.Error(t, err) expectedRecord := providertypes.ConsumerInitializationRecord{ InitialHeight: types.Height{RevisionNumber: 1, RevisionHeight: 2}, @@ -114,9 +105,9 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { HistoricalEntries: 456, DistributionTransmissionChannel: "distribution_transmission_channel", } - providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId", expectedRecord) - actualRecord, found := providerKeeper.GetConsumerIdToInitializationRecord(ctx, "consumerId") - require.True(t, found) + providerKeeper.SetConsumerInitializationRecord(ctx, "consumerId", expectedRecord) + actualRecord, err := providerKeeper.GetConsumerInitializationRecord(ctx, "consumerId") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) // assert that overwriting the current initialization record works @@ -133,14 +124,14 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { HistoricalEntries: 789, DistributionTransmissionChannel: "distribution_transmission_channel2", } - providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId", expectedRecord) - actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "consumerId") - require.True(t, found) + providerKeeper.SetConsumerInitializationRecord(ctx, "consumerId", expectedRecord) + actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "consumerId") + require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) - providerKeeper.DeleteConsumerIdToInitializationRecord(ctx, "consumerId") - actualRecord, found = providerKeeper.GetConsumerIdToInitializationRecord(ctx, "consumerId") - require.False(t, found) + providerKeeper.DeleteConsumerInitializationRecord(ctx, "consumerId") + actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "consumerId") + require.Error(t, err) require.Equal(t, providertypes.ConsumerInitializationRecord{}, actualRecord) } @@ -149,23 +140,14 @@ func TestConsumerIdToOwnerAddress(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - _, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") - require.False(t, found) - - providerKeeper.SetConsumerIdToOwnerAddress(ctx, "consumerId", "owner_address") - address, found := providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") - require.True(t, found) + providerKeeper.SetConsumerOwnerAddress(ctx, "consumerId", "owner_address") + address := providerKeeper.GetConsumerOwnerAddress(ctx, "consumerId") require.Equal(t, "owner_address", address) // assert that overwriting the current owner address works - providerKeeper.SetConsumerIdToOwnerAddress(ctx, "consumerId", "owner_address2") - address, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") - require.True(t, found) + providerKeeper.SetConsumerOwnerAddress(ctx, "consumerId", "owner_address2") + address = providerKeeper.GetConsumerOwnerAddress(ctx, "consumerId") require.Equal(t, "owner_address2", address) - - providerKeeper.DeleteConsumerIdToOwnerAddress(ctx, "consumerId") - _, found = providerKeeper.GetConsumerIdToOwnerAddress(ctx, "consumerId") - require.False(t, found) } // TestConsumerIdToPhase tests the getter, setter, and deletion methods of the consumer id to phase methods @@ -173,16 +155,16 @@ func TestConsumerIdToPhase(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - _, found := providerKeeper.GetConsumerIdToPhase(ctx, "consumerId") + _, found := providerKeeper.GetConsumerPhase(ctx, "consumerId") require.False(t, found) - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId", keeper.Registered) - phase, found := providerKeeper.GetConsumerIdToPhase(ctx, "consumerId") + providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Registered) + phase, found := providerKeeper.GetConsumerPhase(ctx, "consumerId") require.True(t, found) require.Equal(t, keeper.Registered, phase) - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId", keeper.Launched) - phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "consumerId") + providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Launched) + phase, found = providerKeeper.GetConsumerPhase(ctx, "consumerId") require.True(t, found) require.Equal(t, keeper.Launched, phase) } @@ -192,18 +174,18 @@ func TestConsumerIdToStopTime(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - _, found := providerKeeper.GetConsumerIdToStopTime(ctx, "consumerId") - require.False(t, found) + _, err := providerKeeper.GetConsumerStopTime(ctx, "consumerId") + require.Error(t, err) expectedStopTime := time.Unix(1234, 56789) - providerKeeper.SetConsumerIdToStopTime(ctx, "consumerId", expectedStopTime) - actualStopTime, found := providerKeeper.GetConsumerIdToStopTime(ctx, "consumerId") - require.True(t, found) + providerKeeper.SetConsumerStopTime(ctx, "consumerId", expectedStopTime) + actualStopTime, err := providerKeeper.GetConsumerStopTime(ctx, "consumerId") + require.NoError(t, err) require.Equal(t, actualStopTime, expectedStopTime) - providerKeeper.DeleteConsumerIdToStopTime(ctx, "consumerId") - _, found = providerKeeper.GetConsumerIdToStopTime(ctx, "consumerId") - require.False(t, found) + providerKeeper.DeleteConsumerStopTime(ctx, "consumerId") + _, err = providerKeeper.GetConsumerStopTime(ctx, "consumerId") + require.Error(t, err) } // TestGetInitializedConsumersReadyToLaunch tests that the ready to-be-launched consumer chains are returned @@ -212,34 +194,32 @@ func TestGetInitializedConsumersReadyToLaunch(t *testing.T) { defer ctrl.Finish() // no chains to-be-launched exist - require.Empty(t, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) - - // set 3 initialization records with different spawn times - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId1", keeper.Initialized) - providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId1", - providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(10, 0)}) - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId2", keeper.Initialized) - providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId2", - providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(20, 0)}) - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId3", keeper.Initialized) - providerKeeper.SetConsumerIdToInitializationRecord(ctx, "consumerId3", - providertypes.ConsumerInitializationRecord{SpawnTime: time.Unix(30, 0)}) + require.Empty(t, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx, 5)) + + providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, "consumerId1", time.Unix(10, 0)) + providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, "consumerId2", time.Unix(20, 0)) + providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, "consumerId3", time.Unix(30, 0)) // time has not yet reached the spawn time of "consumerId1" ctx = ctx.WithBlockTime(time.Unix(9, 999999999)) - require.Empty(t, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) + require.Empty(t, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx, 3)) // time has reached the spawn time of "consumerId1" ctx = ctx.WithBlockTime(time.Unix(10, 0)) - require.Equal(t, []string{"consumerId1"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) + require.Equal(t, []string{"consumerId1"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx, 3)) // time has reached the spawn time of "consumerId1" and "consumerId2" ctx = ctx.WithBlockTime(time.Unix(20, 0)) - require.Equal(t, []string{"consumerId1", "consumerId2"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) + require.Equal(t, []string{"consumerId1", "consumerId2"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx, 3)) // time has reached the spawn time of all chains ctx = ctx.WithBlockTime(time.Unix(30, 0)) - require.Equal(t, []string{"consumerId1", "consumerId2", "consumerId3"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx)) + require.Equal(t, []string{"consumerId1", "consumerId2", "consumerId3"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx, 3)) + + // limit the number of returned consumer chains + require.Equal(t, []string{}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx, 0)) + require.Equal(t, []string{"consumerId1"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx, 1)) + require.Equal(t, []string{"consumerId1", "consumerId2"}, providerKeeper.GetInitializedConsumersReadyToLaunch(ctx, 2)) } func TestGetLaunchedConsumersReadyToStop(t *testing.T) { @@ -247,31 +227,27 @@ func TestGetLaunchedConsumersReadyToStop(t *testing.T) { defer ctrl.Finish() // no chains to-be-stopped exist - require.Empty(t, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + require.Empty(t, providerKeeper.GetLaunchedConsumersReadyToStop(ctx, 3)) - // set 3 initialization records with different spawn times - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId1", keeper.Launched) - providerKeeper.SetConsumerIdToStopTime(ctx, "consumerId1", time.Unix(10, 0)) - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId2", keeper.Launched) - providerKeeper.SetConsumerIdToStopTime(ctx, "consumerId2", time.Unix(20, 0)) - providerKeeper.SetConsumerIdToPhase(ctx, "consumerId3", keeper.Launched) - providerKeeper.SetConsumerIdToStopTime(ctx, "consumerId3", time.Unix(30, 0)) + providerKeeper.AppendStopTimeForConsumerToBeStopped(ctx, "consumerId1", time.Unix(10, 0)) + providerKeeper.AppendStopTimeForConsumerToBeStopped(ctx, "consumerId2", time.Unix(20, 0)) + providerKeeper.AppendStopTimeForConsumerToBeStopped(ctx, "consumerId3", time.Unix(30, 0)) // time has not yet reached the stop time of "consumerId1" ctx = ctx.WithBlockTime(time.Unix(9, 999999999)) - require.Empty(t, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + require.Empty(t, providerKeeper.GetLaunchedConsumersReadyToStop(ctx, 3)) // time has reached the stop time of "consumerId1" ctx = ctx.WithBlockTime(time.Unix(10, 0)) - require.Equal(t, []string{"consumerId1"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + require.Equal(t, []string{"consumerId1"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx, 3)) // time has reached the stop time of "consumerId1" and "consumerId2" ctx = ctx.WithBlockTime(time.Unix(20, 0)) - require.Equal(t, []string{"consumerId1", "consumerId2"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + require.Equal(t, []string{"consumerId1", "consumerId2"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx, 3)) // time has reached the stop time of all chains ctx = ctx.WithBlockTime(time.Unix(30, 0)) - require.Equal(t, []string{"consumerId1", "consumerId2", "consumerId3"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx)) + require.Equal(t, []string{"consumerId1", "consumerId2", "consumerId3"}, providerKeeper.GetLaunchedConsumersReadyToStop(ctx, 3)) } func TestIsValidatorOptedInToChain(t *testing.T) { @@ -280,15 +256,16 @@ func TestIsValidatorOptedInToChain(t *testing.T) { chainId := "chainId" providerAddr := providertypes.NewProviderConsAddress([]byte("providerAddr")) - _, found := providerKeeper.IsValidatorOptedInToChain(ctx, providerAddr, chainId) + _, found := providerKeeper.IsValidatorOptedInToChainId(ctx, providerAddr, chainId) require.False(t, found) expectedConsumerId := "consumerId" - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, expectedConsumerId, providertypes.ConsumerRegistrationRecord{ + providerKeeper.SetConsumerRegistrationRecord(ctx, expectedConsumerId, providertypes.ConsumerRegistrationRecord{ ChainId: chainId, }) providerKeeper.SetOptedIn(ctx, expectedConsumerId, providerAddr) - actualConsumerId, found := providerKeeper.IsValidatorOptedInToChain(ctx, providerAddr, chainId) + providerKeeper.AppendOptedInConsumerId(ctx, providerAddr, expectedConsumerId) + actualConsumerId, found := providerKeeper.IsValidatorOptedInToChainId(ctx, providerAddr, chainId) require.True(t, found) require.Equal(t, expectedConsumerId, actualConsumerId) } diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 0d6c94977f..bcb067da71 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -37,23 +37,21 @@ func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, proposal *typ // CreateConsumerClient will create the CCV client for the given consumer chain. The CCV channel must be built // on top of the CCV client to ensure connection with the right consumer chain. func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { - initializationRecord, found := k.GetConsumerIdToInitializationRecord(ctx, consumerId) - if !found { - return errorsmod.Wrapf(types.ErrNoInitializationRecord, - "initialization record for consumer chain: %s is missing", consumerId) + initializationRecord, err := k.GetConsumerInitializationRecord(ctx, consumerId) + if err != nil { + return err } - phase, found := k.GetConsumerIdToPhase(ctx, consumerId) + phase, found := k.GetConsumerPhase(ctx, consumerId) if !found || phase != Initialized { return errorsmod.Wrapf(types.ErrInvalidPhase, "cannot create client for consumer chain that is neither in the initialized phase: %s", consumerId) } // TODO (PERMISSIONLESS): make this a function ... GetChainId(consumerId) ... - registrationRecord, found := k.GetConsumerIdToRegistrationRecord(ctx, consumerId) - if !found { - return errorsmod.Wrapf(types.ErrNoChainId, - "the chain id for this consumer chain: %s is missing", consumerId) + registrationRecord, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + if err != nil { + return err } chainId := registrationRecord.ChainId @@ -165,14 +163,11 @@ func (k Keeper) StopConsumerChain(ctx sdk.Context, consumerId string, closeChan k.DeleteSlashAcks(ctx, consumerId) k.DeletePendingVSCPackets(ctx, consumerId) - k.DeleteTopN(ctx, consumerId) - k.DeleteValidatorsPowerCap(ctx, consumerId) - k.DeleteValidatorSetCap(ctx, consumerId) + k.DeleteConsumerRegistrationRecord(ctx, consumerId) + k.DeleteConsumerUpdateRecord(ctx, consumerId) + k.DeleteConsumerUpdateRecord(ctx, consumerId) k.DeleteAllowlist(ctx, consumerId) k.DeleteDenylist(ctx, consumerId) - k.DeleteMinStake(ctx, consumerId) - k.DisableInactiveValidators(ctx, consumerId) - k.DeleteAllOptedIn(ctx, consumerId) k.DeleteConsumerValSet(ctx, consumerId) @@ -189,13 +184,25 @@ func (k Keeper) MakeConsumerGenesis( ctx sdk.Context, consumerId string, ) (gen ccv.ConsumerGenesisState, nextValidatorsHash []byte, err error) { - initializationRecord, found := k.GetConsumerIdToInitializationRecord(ctx, consumerId) - if !found { + initializationRecord, err := k.GetConsumerInitializationRecord(ctx, consumerId) + if err != nil { return gen, nil, errorsmod.Wrapf(types.ErrNoInitializationRecord, "initialization record for consumer chain: %s is missing", consumerId) } - updateRecord := k.GetConsumerIdToUpdateRecordOrDefault(ctx, consumerId, DefaultUpdateRecord) + updateRecord, err := k.GetConsumerUpdateRecord(ctx, consumerId) + if err != nil { + updateRecord = types.ConsumerUpdateRecord{ + OwnerAddress: "", + Top_N: 0, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: []string{}, + Denylist: []string{}, + MinStake: 0, + AllowInactiveVals: false, + } + } providerUnbondingPeriod, err := k.stakingKeeper.UnbondingTime(ctx) if err != nil { @@ -291,7 +298,7 @@ func (k Keeper) MakeConsumerGenesis( // SetPendingConsumerAdditionProp stores a pending consumer addition proposal. // // Note that the pending consumer addition proposals are stored under keys with -// the following format: PendingCAPKeyPrefix | spawnTime | chainID +// the following format: PendingCAPKeyPrefix | spawnTime | consumerId // Thus, if multiple consumer addition proposal for the same chain will pass at // the same time, then only the last one will be stored. func (k Keeper) SetPendingConsumerAdditionProp(ctx sdk.Context, prop *types.ConsumerAdditionProposal) { @@ -329,16 +336,29 @@ func (k Keeper) GetPendingConsumerAdditionProp(ctx sdk.Context, spawnTime time.T // BeginBlockInit iterates over the initialized consumers chains and creates clients for chains // in which the spawn time has passed func (k Keeper) BeginBlockInit(ctx sdk.Context) { - for _, consumerId := range k.GetInitializedConsumersReadyToLaunch(ctx) { + // TODO (PERMISSIONLESS): we can parameterize the limit to 200 at a later stage + for _, consumerId := range k.GetInitializedConsumersReadyToLaunch(ctx, 200) { + record, err := k.GetConsumerInitializationRecord(ctx, consumerId) + if err != nil { + ctx.Logger().Error("could not retrieve initialization record", + "consumerId", consumerId, + "error", err) + continue + } + // Remove consumer to prevent re-trying launching this chain. + // We would only tru to re-launch this chain if a new `MsgInitializeConsumer` message is sent. + k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, record.SpawnTime) + cachedCtx, writeFn := ctx.CacheContext() - err := k.LaunchConsumer(cachedCtx, consumerId) + err = k.LaunchConsumer(cachedCtx, consumerId) if err != nil { ctx.Logger().Error("could not launch chain", "consumerId", consumerId, "error", err) continue } - k.SetConsumerIdToPhase(cachedCtx, consumerId, Launched) + k.SetConsumerPhase(cachedCtx, consumerId, Launched) + writeFn() } } @@ -376,9 +396,9 @@ func (k Keeper) GetConsumerAdditionPropsToExecute(ctx sdk.Context) (propsToExecu // GetAllPendingConsumerAdditionProps gets all pending consumer addition proposals. // // Note that the pending consumer addition proposals are stored under keys with the following format: -// PendingCAPKeyPrefix | spawnTime.UnixNano() | chainID +// PendingCAPKeyPrefix | spawnTime.UnixNano() | consumerId // Thus, the returned array is in spawnTime order. If two proposals have the same spawnTime, -// then they are ordered by chainID. +// then they are ordered by consumerId. func (k Keeper) GetAllPendingConsumerAdditionProps(ctx sdk.Context) (props []types.ConsumerAdditionProposal) { store := ctx.KVStore(k.storeKey) iterator := storetypes.KVStorePrefixIterator(store, types.PendingCAPKeyPrefix()) @@ -412,7 +432,7 @@ func (k Keeper) DeletePendingConsumerAdditionProps(ctx sdk.Context, proposals .. // SetPendingConsumerRemovalProp stores a pending consumer removal proposal. // // Note that the pending removal addition proposals are stored under keys with -// the following format: PendingCRPKeyPrefix | stopTime | chainID +// the following format: PendingCRPKeyPrefix | stopTime | consumerId // Thus, if multiple removal addition proposal for the same chain will pass at // the same time, then only the last one will be stored. func (k Keeper) SetPendingConsumerRemovalProp(ctx sdk.Context, prop *types.ConsumerRemovalProposal) { @@ -448,19 +468,24 @@ func (k Keeper) DeletePendingConsumerRemovalProps(ctx sdk.Context, proposals ... // BeginBlockCCR iterates over the pending consumer proposals and stop/removes the chain if the stop time has passed func (k Keeper) BeginBlockCCR(ctx sdk.Context) { - for _, consumerId := range k.GetLaunchedConsumersReadyToStop(ctx) { + // TODO (PERMISSIONLESS): parameterize the limit + for _, consumerId := range k.GetLaunchedConsumersReadyToStop(ctx, 200) { // stop consumer chain in a cached context to handle errors cachedCtx, writeFn := ctx.CacheContext() - stopTime, found := k.GetConsumerIdToStopTime(ctx, consumerId) - if !found { - ctx.Logger().Info("this chain (%s) is not meant to be stopped", consumerId) + stopTime, err := k.GetConsumerStopTime(ctx, consumerId) + if err != nil { + k.Logger(ctx).Info("chain could not be stopped", + "consumerId", consumerId, + "err", err.Error()) continue } - err := k.StopConsumerChain(cachedCtx, consumerId, true) + err = k.StopConsumerChain(cachedCtx, consumerId, true) if err != nil { - ctx.Logger().Info("consumer chain could not be stopped: %w", err) + k.Logger(ctx).Info("consumer chain could not be stopped", + "consumerId", consumerId, + "err", err.Error()) continue } // The cached context is created with a new EventManager so we merge the event @@ -468,7 +493,8 @@ func (k Keeper) BeginBlockCCR(ctx sdk.Context) { // TODO (PERMISSIONLESS): verify this here and in the initialized chains to launch ctx.EventManager().EmitEvents(cachedCtx.EventManager().Events()) - k.SetConsumerIdToPhase(cachedCtx, consumerId, Stopped) + k.SetConsumerPhase(cachedCtx, consumerId, Stopped) + k.RemoveConsumerFromToBeStoppedConsumers(ctx, consumerId, stopTime) writeFn() k.Logger(ctx).Info("executed consumer removal", @@ -516,7 +542,7 @@ func (k Keeper) BeginBlockCCR(ctx sdk.Context) { // GetAllPendingConsumerRemovalProps iterates through the pending consumer removal proposals. // // Note that the pending consumer removal proposals are stored under keys with the following format: -// PendingCRPKeyPrefix | stopTime.UnixNano() | chainID +// PendingCRPKeyPrefix | stopTime.UnixNano() | consumerId // Thus, the returned array is in stopTime order. func (k Keeper) GetAllPendingConsumerRemovalProps(ctx sdk.Context) (props []types.ConsumerRemovalProposal) { store := ctx.KVStore(k.storeKey) diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 65c1ca4738..de87f3fbeb 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -45,7 +45,7 @@ func TestCreateConsumerClient(t *testing.T) { { description: "No state mutation, new client should be created", setup: func(providerKeeper *providerkeeper.Keeper, ctx sdk.Context, mocks *testkeeper.MockedKeepers) { - providerKeeper.SetConsumerIdToPhase(ctx, "0", providerkeeper.Initialized) + providerKeeper.SetConsumerPhase(ctx, "0", providerkeeper.Initialized) // Valid client creation is asserted with mock expectations here testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, 1) // returns empty validator set @@ -58,7 +58,7 @@ func TestCreateConsumerClient(t *testing.T) { { description: "chain for this consumer id has already launched, and hence client was created, NO new one is created", setup: func(providerKeeper *providerkeeper.Keeper, ctx sdk.Context, mocks *testkeeper.MockedKeepers) { - providerKeeper.SetConsumerIdToPhase(ctx, "0", providerkeeper.Launched) + providerKeeper.SetConsumerPhase(ctx, "0", providerkeeper.Launched) // Expect none of the client creation related calls to happen mocks.MockStakingKeeper.EXPECT().UnbondingTime(gomock.Any()).Times(0) @@ -80,9 +80,9 @@ func TestCreateConsumerClient(t *testing.T) { tc.setup(&providerKeeper, ctx, &mocks) // Call method with same arbitrary values as defined above in mock expectations. - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "0", testkeeper.GetTestRegistrationRecord()) - providerKeeper.SetConsumerIdToInitializationRecord(ctx, "0", testkeeper.GetTestInitializationRecord()) - providerKeeper.SetConsumerIdToUpdateRecord(ctx, "0", testkeeper.GetTestUpdateRecord()) + providerKeeper.SetConsumerRegistrationRecord(ctx, "0", testkeeper.GetTestRegistrationRecord()) + providerKeeper.SetConsumerInitializationRecord(ctx, "0", testkeeper.GetTestInitializationRecord()) + providerKeeper.SetConsumerUpdateRecord(ctx, "0", testkeeper.GetTestUpdateRecord()) err := providerKeeper.CreateConsumerClient(ctx, "0") if tc.expClientCreated { @@ -322,7 +322,7 @@ func TestStopConsumerChain(t *testing.T) { err := providerKeeper.StopConsumerChain(ctx, consumerId, true) if tc.expErr { - require.Error(t, err) + require.Error(t, err, t) } else { require.NoError(t, err) } @@ -515,7 +515,7 @@ func TestMakeConsumerGenesis(t *testing.T) { // // Other setup not covered by custom template client state // - ctx = ctx.WithChainID("testchain1") // chainID is obtained from ctx + ctx = ctx.WithChainID("testchain1") // consumerId is obtained from ctx ctx = ctx.WithBlockHeight(5) // RevisionHeight obtained from ctx testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, 1) gomock.InOrder(testkeeper.GetMocksForMakeConsumerGenesis(ctx, &mocks, 1814400000000000)...) @@ -535,8 +535,8 @@ func TestMakeConsumerGenesis(t *testing.T) { HistoricalEntries: 10000, UnbondingPeriod: 1728000000000000, } - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, "0", registrationRecord) - providerKeeper.SetConsumerIdToInitializationRecord(ctx, "0", initializationRecord) + providerKeeper.SetConsumerRegistrationRecord(ctx, "0", registrationRecord) + providerKeeper.SetConsumerInitializationRecord(ctx, "0", initializationRecord) actualGenesis, _, err := providerKeeper.MakeConsumerGenesis(ctx, "0") require.NoError(t, err) @@ -794,15 +794,16 @@ func TestBeginBlockInit(t *testing.T) { // set up all the records for i, r := range registrationRecords { - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, fmt.Sprintf("%d", i), r) + providerKeeper.SetConsumerRegistrationRecord(ctx, fmt.Sprintf("%d", i), r) } for i, r := range initializationRecords { - providerKeeper.SetConsumerIdToInitializationRecord(ctx, fmt.Sprintf("%d", i), r) + providerKeeper.SetConsumerInitializationRecord(ctx, fmt.Sprintf("%d", i), r) // set up the chains in their initialized phase, hence they could launch - providerKeeper.SetConsumerIdToPhase(ctx, fmt.Sprintf("%d", i), providerkeeper.Initialized) + providerKeeper.SetConsumerPhase(ctx, fmt.Sprintf("%d", i), providerkeeper.Initialized) + providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, fmt.Sprintf("%d", i), r.SpawnTime) } for i, r := range updateRecords { - providerKeeper.SetConsumerIdToUpdateRecord(ctx, fmt.Sprintf("%d", i), r) + providerKeeper.SetConsumerUpdateRecord(ctx, fmt.Sprintf("%d", i), r) } // opt in a sample validator so the chain's proposal can successfully execute @@ -820,21 +821,21 @@ func TestBeginBlockInit(t *testing.T) { providerKeeper.BeginBlockInit(ctx) // first chain was successfully launched - phase, found := providerKeeper.GetConsumerIdToPhase(ctx, "0") + phase, found := providerKeeper.GetConsumerPhase(ctx, "0") require.True(t, found) require.Equal(t, providerkeeper.Launched, phase) _, found = providerKeeper.GetConsumerGenesis(ctx, "0") require.True(t, found) // second chain was successfully launched - phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "1") + phase, found = providerKeeper.GetConsumerPhase(ctx, "1") require.True(t, found) require.Equal(t, providerkeeper.Launched, phase) _, found = providerKeeper.GetConsumerGenesis(ctx, "1") require.True(t, found) // third chain was not launched because its spawn time has not passed - phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "2") + phase, found = providerKeeper.GetConsumerPhase(ctx, "2") require.True(t, found) require.Equal(t, providerkeeper.Initialized, phase) _, found = providerKeeper.GetConsumerGenesis(ctx, "2") @@ -842,7 +843,7 @@ func TestBeginBlockInit(t *testing.T) { // fourth chain corresponds to an Opt-In chain with one opted-in validator and hence the chain gets // successfully executed - phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "3") + phase, found = providerKeeper.GetConsumerPhase(ctx, "3") require.True(t, found) require.Equal(t, providerkeeper.Launched, phase) _, found = providerKeeper.GetConsumerGenesis(ctx, "3") @@ -850,7 +851,7 @@ func TestBeginBlockInit(t *testing.T) { // fifth chain corresponds to an Opt-In chain with no opted-in validators and hence the // chain launch is NOT successful - phase, found = providerKeeper.GetConsumerIdToPhase(ctx, "4") + phase, found = providerKeeper.GetConsumerPhase(ctx, "4") require.True(t, found) require.Equal(t, providerkeeper.Initialized, phase) _, found = providerKeeper.GetConsumerGenesis(ctx, "4") @@ -868,9 +869,12 @@ func TestBeginBlockCCR(t *testing.T) { chainIds := []string{"chain1", "chain2", "chain3"} consumerIds := []string{"consumerId1", "consumerId2", "consumerId3"} - providerKeeper.SetConsumerIdToStopTime(ctx, consumerIds[0], now.Add(-time.Hour)) - providerKeeper.SetConsumerIdToStopTime(ctx, consumerIds[1], now) - providerKeeper.SetConsumerIdToStopTime(ctx, consumerIds[2], now.Add(time.Hour)) + providerKeeper.SetConsumerStopTime(ctx, consumerIds[0], now.Add(-time.Hour)) + providerKeeper.AppendStopTimeForConsumerToBeStopped(ctx, consumerIds[0], now.Add(-time.Hour)) + providerKeeper.SetConsumerStopTime(ctx, consumerIds[1], now) + providerKeeper.AppendStopTimeForConsumerToBeStopped(ctx, consumerIds[1], now) + providerKeeper.SetConsumerStopTime(ctx, consumerIds[2], now.Add(time.Hour)) + providerKeeper.AppendStopTimeForConsumerToBeStopped(ctx, consumerIds[2], now.Add(time.Hour)) // // Mock expectations @@ -900,10 +904,10 @@ func TestBeginBlockCCR(t *testing.T) { registrationRecord := testkeeper.GetTestRegistrationRecord() registrationRecord.ChainId = chainIds[i] - providerKeeper.SetConsumerIdToRegistrationRecord(ctx, consumerId, registrationRecord) - providerKeeper.SetConsumerIdToInitializationRecord(ctx, consumerId, initializationRecord) - providerKeeper.SetConsumerIdToUpdateRecord(ctx, consumerId, testkeeper.GetTestUpdateRecord()) - providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Initialized) + providerKeeper.SetConsumerRegistrationRecord(ctx, consumerId, registrationRecord) + providerKeeper.SetConsumerInitializationRecord(ctx, consumerId, initializationRecord) + providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, testkeeper.GetTestUpdateRecord()) + providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) providerKeeper.SetClientIdToConsumerId(ctx, "clientID", consumerId) err := providerKeeper.CreateConsumerClient(ctx, consumerId) @@ -912,7 +916,7 @@ func TestBeginBlockCCR(t *testing.T) { require.NoError(t, err) // after we have created the consumer client, the chain is considered launched and hence we could later stop the chain - providerKeeper.SetConsumerIdToPhase(ctx, consumerId, providerkeeper.Launched) + providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Launched) } // @@ -922,14 +926,14 @@ func TestBeginBlockCCR(t *testing.T) { providerKeeper.BeginBlockCCR(ctx) // Only the 3rd (final) proposal is still stored as pending - phase, found := providerKeeper.GetConsumerIdToPhase(ctx, consumerIds[0]) + phase, found := providerKeeper.GetConsumerPhase(ctx, consumerIds[0]) require.True(t, found) require.Equal(t, providerkeeper.Stopped, phase) - phase, found = providerKeeper.GetConsumerIdToPhase(ctx, consumerIds[1]) + phase, found = providerKeeper.GetConsumerPhase(ctx, consumerIds[1]) require.True(t, found) require.Equal(t, providerkeeper.Stopped, phase) // third chain had a stopTime in the future and hence did not stop - phase, found = providerKeeper.GetConsumerIdToPhase(ctx, consumerIds[2]) + phase, found = providerKeeper.GetConsumerPhase(ctx, consumerIds[2]) require.True(t, found) require.Equal(t, providerkeeper.Launched, phase) } diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index cd11b9e9d1..5c037eb36c 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -51,7 +51,7 @@ func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) err packet.SourceChannel, ) } - k.Logger(ctx).Info("packet timeout, removing the consumer:", "chainID", chainID) + k.Logger(ctx).Info("packet timeout, removing the consumer:", "consumerId", chainID) // stop consumer chain and release unbondings return k.StopConsumerChain(ctx, chainID, false) } @@ -163,11 +163,11 @@ func (k Keeper) SendVSCPacketsToChain(ctx sdk.Context, chainID, channelID string // IBC client is expired! // leave the packet data stored to be sent once the client is upgraded // the client cannot expire during iteration (in the middle of a block) - k.Logger(ctx).Info("IBC client is expired, cannot send VSC, leaving packet data stored:", "chainID", chainID, "vscid", data.ValsetUpdateId) + k.Logger(ctx).Info("IBC client is expired, cannot send VSC, leaving packet data stored:", "consumerId", chainID, "vscid", data.ValsetUpdateId) return } // Not able to send packet over IBC! - k.Logger(ctx).Error("cannot send VSC, removing consumer:", "chainID", chainID, "vscid", data.ValsetUpdateId, "err", err.Error()) + k.Logger(ctx).Error("cannot send VSC, removing consumer:", "consumerId", chainID, "vscid", data.ValsetUpdateId, "err", err.Error()) // If this happens, most likely the consumer is malicious; remove it err := k.StopConsumerChain(ctx, chainID, true) if err != nil { @@ -197,7 +197,7 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { if err != nil { panic(fmt.Errorf("failed to get consumer validators: %w", err)) } - topN, _ := k.GetTopN(ctx, chainID) + topN := k.GetTopN(ctx, chainID) if topN > 0 { // in a Top-N chain, we automatically opt in all validators that belong to the top N @@ -231,7 +231,7 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { packet := ccv.NewValidatorSetChangePacketData(valUpdates, valUpdateID, k.ConsumeSlashAcks(ctx, chainID)) k.AppendPendingVSCPackets(ctx, chainID, packet) k.Logger(ctx).Info("VSCPacket enqueued:", - "chainID", chainID, + "consumerId", chainID, "vscID", valUpdateID, "len updates", len(valUpdates), ) @@ -297,7 +297,7 @@ func (k Keeper) OnRecvSlashPacket( if err := k.ValidateSlashPacket(ctx, chainID, packet, data); err != nil { k.Logger(ctx).Error("invalid slash packet", "error", err.Error(), - "chainID", chainID, + "consumerId", chainID, "consumer cons addr", sdk.ConsAddress(data.Validator.Address).String(), "vscID", data.ValsetUpdateId, "infractionType", data.Infraction, @@ -316,7 +316,7 @@ func (k Keeper) OnRecvSlashPacket( k.SetSlashLog(ctx, providerConsAddr) k.Logger(ctx).Info("SlashPacket received for double-signing", - "chainID", chainID, + "consumerId", chainID, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), "vscID", data.ValsetUpdateId, @@ -342,7 +342,7 @@ func (k Keeper) OnRecvSlashPacket( // Return bounce ack if meter is negative in value if meter.IsNegative() { k.Logger(ctx).Info("SlashPacket received, but meter is negative. Packet will be bounced", - "chainID", chainID, + "consumerId", chainID, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), "vscID", data.ValsetUpdateId, @@ -359,7 +359,7 @@ func (k Keeper) OnRecvSlashPacket( k.HandleSlashPacket(ctx, chainID, data) k.Logger(ctx).Info("slash packet received and handled", - "chainID", chainID, + "consumerId", chainID, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), "vscID", data.ValsetUpdateId, @@ -394,7 +394,7 @@ func (k Keeper) HandleSlashPacket(ctx sdk.Context, chainID string, data ccv.Slas providerConsAddr := k.GetProviderAddrFromConsumerAddr(ctx, chainID, consumerConsAddr) k.Logger(ctx).Debug("HandleSlashPacket", - "chainID", chainID, + "consumerId", chainID, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), "vscID", data.ValsetUpdateId, diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index e4c8f222e8..1c5927480e 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -104,31 +104,31 @@ func TestQueueVSCPacketsDoesNotResetConsumerValidatorsHeights(t *testing.T) { testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 2, []stakingtypes.Validator{valA, valB}, -1) // set a consumer client, so we have a consumer chain (i.e., `k.GetAllConsumerChains(ctx)` is non empty) - providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") + providerKeeper.SetConsumerClientId(ctx, "consumerId", "clientID") // opt in validator A and set as a consumer validator - providerKeeper.SetOptedIn(ctx, "chainID", providertypes.NewProviderConsAddress(valAConsAddr)) + providerKeeper.SetOptedIn(ctx, "consumerId", providertypes.NewProviderConsAddress(valAConsAddr)) consumerValidatorA := providertypes.ConsensusValidator{ ProviderConsAddr: valAConsAddr, Power: 1, PublicKey: &valAPubKey, JoinHeight: 123456789, } - providerKeeper.SetConsumerValidator(ctx, "chainID", consumerValidatorA) + providerKeeper.SetConsumerValidator(ctx, "consumerId", consumerValidatorA) // Opt in validator B. Note that validator B is not a consumer validator and hence would become a consumer // validator for the first time after the `QueueVSCPackets` call. - providerKeeper.SetOptedIn(ctx, "chainID", providertypes.NewProviderConsAddress(valBConsAddr)) + providerKeeper.SetOptedIn(ctx, "consumerId", providertypes.NewProviderConsAddress(valBConsAddr)) providerKeeper.QueueVSCPackets(ctx) // the height of consumer validator A should not be modified because A was already a consumer validator - cv, _ := providerKeeper.GetConsumerValidator(ctx, "chainID", providertypes.NewProviderConsAddress(valAConsAddr)) + cv, _ := providerKeeper.GetConsumerValidator(ctx, "consumerId", providertypes.NewProviderConsAddress(valAConsAddr)) require.Equal(t, consumerValidatorA.JoinHeight, cv.JoinHeight, "the consumer validator's height was erroneously modified") // the height of consumer validator B is set to be the same as the one of the current chain height because this // consumer validator becomes a consumer validator for the first time (i.e., was not a consumer validator in the previous epoch) - cv, _ = providerKeeper.GetConsumerValidator(ctx, "chainID", providertypes.NewProviderConsAddress(valBConsAddr)) + cv, _ = providerKeeper.GetConsumerValidator(ctx, "consumerId", providertypes.NewProviderConsAddress(valBConsAddr)) require.Equal(t, chainHeight, cv.JoinHeight, "the consumer validator's height was not correctly set") } @@ -538,7 +538,7 @@ func TestOnTimeoutPacketStopsChain(t *testing.T) { } err := providerKeeper.OnTimeoutPacket(ctx, packet) - testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, "chainID", "channelID") + testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, "consumerId", "channelID") require.NoError(t, err) } @@ -574,7 +574,7 @@ func TestOnAcknowledgementPacketWithAckError(t *testing.T) { err = providerKeeper.OnAcknowledgementPacket(ctx, packet, ackError) - testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, "chainID", "channelID") + testkeeper.TestProviderStateIsCleanedAfterConsumerChainIsStopped(t, ctx, providerKeeper, "consumerId", "channelID") require.NoError(t, err) } @@ -583,9 +583,11 @@ func TestEndBlockVSU(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + chainID := "consumerId" - providerKeeper.SetTopN(ctx, chainID, 100) + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", providertypes.ConsumerUpdateRecord{ + Top_N: 100, + }) // 10 blocks constitute an epoch params := providertypes.DefaultParams() @@ -736,21 +738,21 @@ func TestQueueVSCPacketsWithPowerCapping(t *testing.T) { testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 5, []stakingtypes.Validator{valA, valB, valC, valD, valE}, -1) // add a consumer chain - providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") + providerKeeper.SetConsumerClientId(ctx, "consumerId", "clientID") - providerKeeper.SetTopN(ctx, "chainID", 50) // would opt in E + providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", providertypes.ConsumerUpdateRecord{ + Top_N: 50, // would opt in E + ValidatorsPowerCap: 40, // set a power-capping of 40% + }) // opt in all validators - providerKeeper.SetOptedIn(ctx, "chainID", providertypes.NewProviderConsAddress(valAConsAddr)) - providerKeeper.SetOptedIn(ctx, "chainID", providertypes.NewProviderConsAddress(valBConsAddr)) - providerKeeper.SetOptedIn(ctx, "chainID", providertypes.NewProviderConsAddress(valCConsAddr)) - providerKeeper.SetOptedIn(ctx, "chainID", providertypes.NewProviderConsAddress(valDConsAddr)) + providerKeeper.SetOptedIn(ctx, "consumerId", providertypes.NewProviderConsAddress(valAConsAddr)) + providerKeeper.SetOptedIn(ctx, "consumerId", providertypes.NewProviderConsAddress(valBConsAddr)) + providerKeeper.SetOptedIn(ctx, "consumerId", providertypes.NewProviderConsAddress(valCConsAddr)) + providerKeeper.SetOptedIn(ctx, "consumerId", providertypes.NewProviderConsAddress(valDConsAddr)) // denylist validator D - providerKeeper.SetDenylist(ctx, "chainID", providertypes.NewProviderConsAddress(valDConsAddr)) - - // set a power-capping of 40% - providerKeeper.SetValidatorsPowerCap(ctx, "chainID", 40) + providerKeeper.SetDenylist(ctx, "consumerId", providertypes.NewProviderConsAddress(valDConsAddr)) // set max provider consensus vals to include all validators params := providerKeeper.GetParams(ctx) @@ -759,7 +761,7 @@ func TestQueueVSCPacketsWithPowerCapping(t *testing.T) { providerKeeper.QueueVSCPackets(ctx) - actualQueuedVSCPackets := providerKeeper.GetPendingVSCPackets(ctx, "chainID") + actualQueuedVSCPackets := providerKeeper.GetPendingVSCPackets(ctx, "consumerId") expectedQueuedVSCPackets := []ccv.ValidatorSetChangePacketData{ ccv.NewValidatorSetChangePacketData( []abci.ValidatorUpdate{ diff --git a/x/ccv/provider/keeper/validator_set_update_test.go b/x/ccv/provider/keeper/validator_set_update_test.go index e343093dad..9f078cc701 100644 --- a/x/ccv/provider/keeper/validator_set_update_test.go +++ b/x/ccv/provider/keeper/validator_set_update_test.go @@ -32,11 +32,11 @@ func TestConsumerValidator(t *testing.T) { PublicKey: &crypto.PublicKey{}, } - require.False(t, providerKeeper.IsConsumerValidator(ctx, "chainID", types.NewProviderConsAddress(validator.ProviderConsAddr))) - providerKeeper.SetConsumerValidator(ctx, "chainID", validator) - require.True(t, providerKeeper.IsConsumerValidator(ctx, "chainID", types.NewProviderConsAddress(validator.ProviderConsAddr))) - providerKeeper.DeleteConsumerValidator(ctx, "chainID", types.NewProviderConsAddress(validator.ProviderConsAddr)) - require.False(t, providerKeeper.IsConsumerValidator(ctx, "chainID", types.NewProviderConsAddress(validator.ProviderConsAddr))) + require.False(t, providerKeeper.IsConsumerValidator(ctx, "consumerId", types.NewProviderConsAddress(validator.ProviderConsAddr))) + providerKeeper.SetConsumerValidator(ctx, "consumerId", validator) + require.True(t, providerKeeper.IsConsumerValidator(ctx, "consumerId", types.NewProviderConsAddress(validator.ProviderConsAddr))) + providerKeeper.DeleteConsumerValidator(ctx, "consumerId", types.NewProviderConsAddress(validator.ProviderConsAddr)) + require.False(t, providerKeeper.IsConsumerValidator(ctx, "consumerId", types.NewProviderConsAddress(validator.ProviderConsAddr))) } func TestGetConsumerValSet(t *testing.T) { @@ -75,7 +75,7 @@ func TestGetConsumerValSet(t *testing.T) { } for _, expectedValidator := range expectedValidators { - providerKeeper.SetConsumerValidator(ctx, "chainID", + providerKeeper.SetConsumerValidator(ctx, "consumerId", types.ConsensusValidator{ ProviderConsAddr: expectedValidator.ProviderConsAddr, Power: expectedValidator.Power, @@ -83,7 +83,7 @@ func TestGetConsumerValSet(t *testing.T) { }) } - actualValidators, err := providerKeeper.GetConsumerValSet(ctx, "chainID") + actualValidators, err := providerKeeper.GetConsumerValSet(ctx, "consumerId") require.NoError(t, err) // sort validators first to be able to compare @@ -253,7 +253,7 @@ func TestSetConsumerValSet(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + chainID := "consumerId" currentValidators := []types.ConsensusValidator{ { @@ -306,7 +306,7 @@ func TestSetConsumerValSet(t *testing.T) { }, } - // set the `currentValidators` for chain `chainID` + // set the `currentValidators` for chain `consumerId` valSet, err := providerKeeper.GetConsumerValSet(ctx, chainID) require.NoError(t, err) require.Empty(t, valSet) @@ -338,7 +338,7 @@ func TestFilterValidatorsConsiderAll(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + chainID := "consumerId" // no consumer validators returned if we have no bonded validators considerAll := func(providerAddr types.ProviderConsAddress) bool { return true } @@ -378,7 +378,7 @@ func TestFilterValidatorsConsiderOnlyOptIn(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + chainID := "consumerId" // no consumer validators returned if we have no opted-in validators require.Empty(t, providerKeeper.FilterValidators(ctx, chainID, []stakingtypes.Validator{}, @@ -419,7 +419,7 @@ func TestFilterValidatorsConsiderOnlyOptIn(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.FilterValidators(ctx, "chainID", bondedValidators, + actualValidators := providerKeeper.FilterValidators(ctx, "consumerId", bondedValidators, func(providerAddr types.ProviderConsAddress) bool { return providerKeeper.IsOptedIn(ctx, chainID, providerAddr) }) @@ -438,7 +438,7 @@ func TestFilterValidatorsConsiderOnlyOptIn(t *testing.T) { // create a staking validator C that is not opted in, hence `expectedValidators` remains the same valC := createStakingValidator(ctx, mocks, 3, 3, 3) bondedValidators = []stakingtypes.Validator{valA, valB, valC} - actualValidators = providerKeeper.FilterValidators(ctx, "chainID", bondedValidators, + actualValidators = providerKeeper.FilterValidators(ctx, "consumerId", bondedValidators, func(providerAddr types.ProviderConsAddress) bool { return providerKeeper.IsOptedIn(ctx, chainID, providerAddr) }) @@ -452,7 +452,7 @@ func TestCreateConsumerValidator(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "chainID" + chainID := "consumerId" // create a validator which has set a consumer public key valA := createStakingValidator(ctx, mocks, 0, 1, 1) diff --git a/x/ccv/provider/migrations/v5/migration_test.go b/x/ccv/provider/migrations/v5/migration_test.go index 907aa1b019..dce390ad71 100644 --- a/x/ccv/provider/migrations/v5/migration_test.go +++ b/x/ccv/provider/migrations/v5/migration_test.go @@ -16,15 +16,13 @@ func TestMigrateParams(t *testing.T) { provKeeper.SetConsumerClientId(ctx, "chainID", "clientID") // initially top N should not exist - topN, found := provKeeper.GetTopN(ctx, "chainID") - require.False(t, found) + topN := provKeeper.GetTopN(ctx, "chainID") require.Zero(t, topN) // migrate MigrateTopNForRegisteredChains(ctx, provKeeper) // after migration, top N should be 95 - topN, found = provKeeper.GetTopN(ctx, "chainID") - require.True(t, found) + topN = provKeeper.GetTopN(ctx, "chainID") require.Equal(t, uint32(95), topN) } diff --git a/x/ccv/provider/migrations/v5/migrations.go b/x/ccv/provider/migrations/v5/migrations.go index 411efd49e1..33e4ce4c0d 100644 --- a/x/ccv/provider/migrations/v5/migrations.go +++ b/x/ccv/provider/migrations/v5/migrations.go @@ -2,6 +2,7 @@ package v5 import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" ) @@ -12,7 +13,11 @@ import ( func MigrateTopNForRegisteredChains(ctx sdk.Context, providerKeeper providerkeeper.Keeper) { // Set the topN of each chain to 95 for _, chainID := range providerKeeper.GetAllRegisteredConsumerChainIDs(ctx) { - providerKeeper.SetTopN(ctx, chainID, 95) + // TODO (PERMISSIONLESS): this migration already took place and does not make much sense in the Permissionless world + // living here for now and we should totally remove + providerKeeper.SetConsumerUpdateRecord(ctx, chainID, types.ConsumerUpdateRecord{ + Top_N: 95, + }) } } diff --git a/x/ccv/provider/migrations/v6/migrations.go b/x/ccv/provider/migrations/v6/migrations.go index 5829f29222..581f5aa4d4 100644 --- a/x/ccv/provider/migrations/v6/migrations.go +++ b/x/ccv/provider/migrations/v6/migrations.go @@ -23,11 +23,8 @@ func MigrateMinPowerInTopN(ctx sdk.Context, providerKeeper providerkeeper.Keeper for _, chain := range registeredConsumerChains { // get the top N - topN, found := providerKeeper.GetTopN(ctx, chain) - if !found { - providerKeeper.Logger(ctx).Error("failed to get top N", "chain", chain) - continue - } else if topN == 0 { + topN := providerKeeper.GetTopN(ctx, chain) + if topN == 0 { providerKeeper.Logger(ctx).Info("top N is 0, not setting minimal power", "chain", chain) } else { // set the minimal power in the top N diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index f1c85d4b47..3cd7267168 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -105,11 +105,11 @@ const ( OptedInKeyName = "OptedInKey" - TopNKeyName = "TopNKey" + DeprecatedTopNKeyName = "DeprecatedTopNKey" - ValidatorsPowerCapKeyName = "ValidatorsPowerCapKey" + DeprecatedValidatorsPowerCapKeyName = "DeprecatedValidatorsPowerCapKey" - ValidatorSetCapKeyName = "ValidatorSetCapKey" + DeprecatedValidatorSetCapKeyName = "DeprecatedValidatorSetCapKey" AllowlistKeyName = "AllowlistKey" @@ -123,9 +123,9 @@ const ( LastProviderConsensusValsKeyName = "LastProviderConsensusValsKey" - MinStakeKeyName = "MinStakeKey" + DeprecatedMinStakeKeyName = "DeprecatedMinStakeKey" - AllowInactiveValidatorsKeyName = "AllowInactiveValidatorsKey" + DeprecatedAllowInactiveValidatorsKeyName = "DeprecatedAllowInactiveValidatorsKey" ConsumerAddrsToPruneV2KeyName = "ConsumerAddrsToPruneV2Key" @@ -137,12 +137,16 @@ const ( ConsumerIdToUpdateRecordKeyName = "ConsumerIdToUpdateRecordKey" - ConsumerIdToOwnerAddressKeyName = "ConsumerIdToOwnerAddressKey" - ConsumerIdToPhaseKeyName = "ConsumerIdToPhaseKey" ConsumerIdToStopTimeKeyName = "ConsumerIdToStopTimeKey" + SpawnTimeToConsumerIdsKeyName = "SpawnTimeToConsumerIdsKeyName" + + StopTimeToConsumerIdsKeyName = "StopTimeToConsumerIdsKeyName" + + ProviderConsAddrToOptedInConsumerIdsKeyName = "ProviderConsAddrToOptedInConsumerIdsKeyName" + ClientIdToConsumerIdKeyName = "ClientIdToConsumerIdKey" ) @@ -287,18 +291,24 @@ func getKeyPrefixes() map[string]byte { // OptedInKey is the key for storing whether a validator is opted in to validate on a consumer chain OptedInKeyName: 32, - // TopNKey is the key for storing the mapping from a consumer chain to the N value of this chain, + // DeprecatedTopNKey is the key for 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 - TopNKeyName: 33, + // NOTE: This prefix is deprecated, but left in place to avoid state migrations + // [DEPRECATED] + DeprecatedTopNKeyName: 33, - // ValidatorsPowerCapKey is the key for storing the mapping from a consumer chain to the power-cap value of this chain, + // DeprecatedValidatorsPowerCapKey is the key for storing the mapping from a consumer chain to the power-cap value of this chain, // that corresponds to p% such that no validator can have more than p% of the voting power on the consumer chain. // Operates on a best-effort basis. - ValidatorsPowerCapKeyName: 34, + // NOTE: This prefix is deprecated, but left in place to avoid state migrations + // [DEPRECATED] + DeprecatedValidatorsPowerCapKeyName: 34, - // ValidatorSetCapKey is the key for storing the mapping from a consumer chain to the validator-set cap value + // DeprecatedValidatorSetCapKey is the key for storing the mapping from a consumer chain to the validator-set cap value // of this chain. - ValidatorSetCapKeyName: 35, + // NOTE: This prefix is deprecated, but left in place to avoid state migrations + // [DEPRECATED] + DeprecatedValidatorSetCapKeyName: 35, // AllowlistKey is the key for storing the mapping from a consumer chain to the set of validators that are // allowlisted. @@ -328,14 +338,18 @@ func getKeyPrefixes() map[string]byte { // sent to the consensus engine of the provider chain LastProviderConsensusValsKeyName: 42, - // MinStakeKey is the byte prefix for storing the mapping from consumer chains to the minimum stake required to be a validator on the consumer chain + // DeprecatedMinStakeKey is the byte prefix for storing the mapping from consumer chains to the minimum stake required to be a validator on the consumer chain // The minimum stake must be stored on the provider chain, not on the consumer chain itself, since it filters out // validators from the VSCPackets that we send to the consumer chain. - MinStakeKeyName: 43, + // NOTE: This prefix is deprecated, but left in place to avoid state migrations + // [DEPRECATED] + DeprecatedMinStakeKeyName: 43, - // AllowInactiveValidatorsKey is the byte prefix for storing the mapping from consumer chains to the boolean value + // DeprecatedAllowInactiveValidatorsKey is the byte prefix for storing the mapping from consumer chains to the boolean value // that determines whether inactive validators can validate on that chain - AllowInactiveValidatorsKeyName: 44, + // NOTE: This prefix is deprecated, but left in place to avoid state migrations + // [DEPRECATED] + DeprecatedAllowInactiveValidatorsKeyName: 44, // ConsumerIdKeyName is the key for storing the consumer id for the next registered consumer chain ConsumerIdKeyName: 45, @@ -349,17 +363,26 @@ func getKeyPrefixes() map[string]byte { // ConsumerIdToUpdateRecordKeyName is the key for storing the update record for the given consumer id ConsumerIdToUpdateRecordKeyName: 48, - // ConsumerIdToOwnerAddressKeyName is the key for storing the owner address for the given consumer id - ConsumerIdToOwnerAddressKeyName: 49, - // ConsumerIdToPhaseKeyName is the key for storing the phase of a consumer chain with the given consumer id - ConsumerIdToPhaseKeyName: 50, + ConsumerIdToPhaseKeyName: 49, // ConsumerIdToStopTimeKeyName is the key for storing the stop time of a consumer chain that is to be removed - ConsumerIdToStopTimeKeyName: 51, + ConsumerIdToStopTimeKeyName: 50, + + // SpawnTimeToConsumerIdKeyName is the key for storing pending initialized consumers that are to be launched. + // For a specific spawn time, it might store multiple consumer chain ids for chains that are to be launched. + SpawnTimeToConsumerIdsKeyName: 51, + + // StopTimeToConsumerIdKeyName is the key for storing pending launched consumers that are to be stopped. + // For a specific stop time, it might store multiple consumer chain ids for chains that are to be stopped. + StopTimeToConsumerIdsKeyName: 52, + + // ProviderConsAddrToOptedInConsumerIdsKeyName is the key for storing all the consumer ids that a validator + // is currently opted in to. + ProviderConsAddrToOptedInConsumerIdsKeyName: 53, // ClientIdToConsumerIdKeyName is the key for storing the consumer id for the given client id - ClientIdToConsumerIdKeyName: 52, + ClientIdToConsumerIdKeyName: 54, // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO TestPreserveBytePrefix() IN keys_test.go } @@ -641,22 +664,6 @@ func ConsumerValidatorKey(consumerId string, providerAddr []byte) []byte { return append(prefix, providerAddr...) } -// TopNKey returns the key used to store the Top N value per consumer chain. -// This value corresponds to the N% of the top validators that have to validate the consumer chain. -func TopNKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(TopNKeyName), consumerId) -} - -// ValidatorSetPowerKey returns the key of consumer `consumerId` -func ValidatorsPowerCapKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(ValidatorsPowerCapKeyName), consumerId) -} - -// ValidatorSetCapKey returns the key of consumer chain `chainID` -func ValidatorSetCapKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(ValidatorSetCapKeyName), consumerId) -} - // AllowlistKeyPrefix returns the key prefix for storing consumer chains allowlists func AllowlistKeyPrefix() byte { return mustGetKeyPrefix(AllowlistKeyName) @@ -736,38 +743,29 @@ func LastProviderConsensusValsPrefix() []byte { return []byte{mustGetKeyPrefix(LastProviderConsensusValsKeyName)} } -// MinStakeKey returns the key used to store the minimum stake required to validate on consumer chain with `consumerId` -func MinStakeKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(MinStakeKeyName), consumerId) -} - -func AllowInactiveValidatorsKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(AllowInactiveValidatorsKeyName), consumerId) -} - // ConsumerIdKey returns the key used to store the consumerId of the next registered chain func ConsumerIdKey() []byte { return []byte{mustGetKeyPrefix(ConsumerIdKeyName)} } // ConsumerIdToRegistrationRecordKeyPrefix returns the key prefix for storing consumer registration records -func ConsumerIdToRegistrationRecordKeyPrefix() []byte { - return []byte{mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName)} +func ConsumerIdToRegistrationRecordKeyPrefix() byte { + return mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName) } // ConsumerIdToRegistrationRecordKey returns the key used to store the registration record that corresponds to this consumer id func ConsumerIdToRegistrationRecordKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName), consumerId) + return ConsumerIdWithLenKey(ConsumerIdToRegistrationRecordKeyPrefix(), consumerId) } // ConsumerIdToInitializationRecordKeyPrefix returns the key prefix for storing consumer initialization records -func ConsumerIdToInitializationRecordKeyPrefix() []byte { - return []byte{mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName)} +func ConsumerIdToInitializationRecordKeyPrefix() byte { + return mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName) } // ConsumerIdToInitializationRecordKey returns the key used to store the initialization record that corresponds to this consumer id func ConsumerIdToInitializationRecordKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName), consumerId) + return ConsumerIdWithLenKey(ConsumerIdToInitializationRecordKeyPrefix(), consumerId) } // ConsumerIdToUpdateRecordKey returns the key used to store the update record that corresponds to this consumer id @@ -775,11 +773,6 @@ func ConsumerIdToUpdateRecordKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToUpdateRecordKeyName), consumerId) } -// ConsumerIdToOwnerAddressKey returns the key used to store the owner address that corresponds to this consumer id -func ConsumerIdToOwnerAddressKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToOwnerAddressKeyName), consumerId) -} - // ConsumerIdToPhaseKey returns the key used to store the phase that corresponds to this consumer id func ConsumerIdToPhaseKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToPhaseKeyName), consumerId) @@ -790,10 +783,62 @@ func ConsumerIdToStopTimeKey(consumerId string) []byte { return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToStopTimeKeyName), consumerId) } -// ConsumerIdToStopTimeKeyNamePrefix returns the key prefix for storing the stop times of consumer chains +// ConsumerIdToStopTimeKeyPrefix returns the key prefix for storing the stop times of consumer chains // that are about to be stopped -func ConsumerIdToStopTimeKeyNamePrefix() []byte { - return []byte{mustGetKeyPrefix(ConsumerIdToStopTimeKeyName)} +func ConsumerIdToStopTimeKeyPrefix() byte { + return mustGetKeyPrefix(ConsumerIdToStopTimeKeyName) +} + +// SpawnTimeToConsumerIdsKeyPrefix returns the key prefix for storing pending chains that are to be launched +func SpawnTimeToConsumerIdsKeyPrefix() byte { + return mustGetKeyPrefix(SpawnTimeToConsumerIdsKeyName) +} + +// SpawnTimeToConsumerIdsKey returns the key prefix for storing the spawn times of consumer chains +// that are about to be launched +func SpawnTimeToConsumerIdsKey(spawnTime time.Time) []byte { + return ccvtypes.AppendMany( + // append the prefix + []byte{SpawnTimeToConsumerIdsKeyPrefix()}, + // append the time + sdk.FormatTimeBytes(spawnTime), + ) +} + +// StopTimeToConsumerIdsKeyPrefix returns the key prefix for storing pending chains that are to be stopped +func StopTimeToConsumerIdsKeyPrefix() byte { + return mustGetKeyPrefix(StopTimeToConsumerIdsKeyName) +} + +// StopTimeToConsumerIdsKey returns the key prefix for storing the stop times of consumer chains +// that are about to be stopped +func StopTimeToConsumerIdsKey(spawnTime time.Time) []byte { + return ccvtypes.AppendMany( + // append the prefix + []byte{StopTimeToConsumerIdsKeyPrefix()}, + // append the time + sdk.FormatTimeBytes(spawnTime), + ) +} + +// ParseTime returns the marshalled time +func ParseTime(prefix byte, bz []byte) (time.Time, error) { + expectedPrefix := []byte{prefix} + prefixL := len(expectedPrefix) + if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { + return time.Time{}, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) + } + timestamp, err := sdk.ParseTimeBytes(bz[prefixL:]) + if err != nil { + return time.Time{}, err + } + return timestamp, nil +} + +// ProviderConsAddrToOptedInConsumerIdsKey returns the key for storing all the consumer ids that `providerAddr` +// has opted-in to +func ProviderConsAddrToOptedInConsumerIdsKey(providerAddr ProviderConsAddress) []byte { + return append([]byte{mustGetKeyPrefix(ProviderConsAddrToOptedInConsumerIdsKeyName)}, providerAddr.ToSdkConsAddr().Bytes()...) } // ClientIdToConsumerIdKey returns the consumer id that corresponds to this client id @@ -832,6 +877,22 @@ func ConsumerIdAndTsKey(prefix byte, consumerId string, timestamp time.Time) []b ) } +// ParseConsumerIdAndTsKey returns the consumer id and time for a ConsumerIdIdAndTs key +func ParseConsumerIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { + expectedPrefix := []byte{prefix} + prefixL := len(expectedPrefix) + if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { + return "", time.Time{}, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) + } + consumerIdL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) + consumerId := string(bz[prefixL+8 : prefixL+8+int(consumerIdL)]) + timestamp, err := sdk.ParseTimeBytes(bz[prefixL+8+int(consumerIdL):]) + if err != nil { + return "", time.Time{}, err + } + return consumerId, timestamp, nil +} + // ConsumerIdWithLenKey returns the key with the following format: // bytePrefix | len(consumerId) | consumerId func ConsumerIdWithLenKey(prefix byte, consumerId string) []byte { @@ -845,20 +906,16 @@ func ConsumerIdWithLenKey(prefix byte, consumerId string) []byte { ) } -// ParseConsumerIdAndTsKey returns the consumer id and time for a ConsumerIdIdAndTs key -func ParseConsumerIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { +// ParseConsumerIdWithLenKey returns the consumer id ConsumerIdWithLen key +func ParseConsumerIdWithLenKey(prefix byte, bz []byte) (string, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { - return "", time.Time{}, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) + return "", fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) } consumerIdL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) consumerId := string(bz[prefixL+8 : prefixL+8+int(consumerIdL)]) - timestamp, err := sdk.ParseTimeBytes(bz[prefixL+8+int(consumerIdL):]) - if err != nil { - return "", time.Time{}, err - } - return consumerId, timestamp, nil + return consumerId, nil } // ChainIdAndUintIdKey returns the key with the following format: diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 08549b90df..76b7e9eb15 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -41,11 +41,11 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(4), providertypes.SlashMeterReplenishTimeCandidateKey()[0]) i++ - require.Equal(t, uint8(5), providertypes.ConsumerIdToChannelIdKey("chainID")[0]) + require.Equal(t, byte(5), providertypes.ConsumerIdToChannelIdKey("chainID")[0]) i++ - require.Equal(t, uint8(6), providertypes.ChannelIdToConsumerIdKeyPrefix()[0]) + require.Equal(t, byte(6), providertypes.ChannelIdToConsumerIdKeyPrefix()[0]) i++ - require.Equal(t, uint8(7), providertypes.ConsumerIdToClientIdKeyPrefix()[0]) + require.Equal(t, byte(7), providertypes.ConsumerIdToClientIdKeyPrefix()[0]) i++ // reserve 8 as deprecated i++ @@ -98,11 +98,14 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(32), providertypes.OptedInKeyPrefix()) i++ - require.Equal(t, byte(33), providertypes.TopNKey("chainID")[0]) + // DEPRECATED + //require.Equal(t, byte(33), providertypes.TopNKey("chainID")[0]) i++ - require.Equal(t, byte(34), providertypes.ValidatorsPowerCapKey("chainID")[0]) + // DEPRECATED + //require.Equal(t, byte(34), providertypes.ValidatorsPowerCapKey("chainID")[0]) i++ - require.Equal(t, byte(35), providertypes.ValidatorSetCapKey("chainID")[0]) + // DEPRECATED + //require.Equal(t, byte(35), providertypes.ValidatorSetCapKey("chainID")[0]) i++ require.Equal(t, byte(36), providertypes.AllowlistKeyPrefix()) i++ @@ -118,25 +121,31 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(42), providertypes.LastProviderConsensusValsPrefix()[0]) i++ - require.Equal(t, byte(43), providertypes.MinStakeKey("chainID")[0]) + // DEPRECATED + //require.Equal(t, byte(43), providertypes.MinStakeKey("chainID")[0]) + i++ + // DEPRECATED + //require.Equal(t, byte(44), providertypes.AllowInactiveValidatorsKey("chainID")[0]) + i++ + require.Equal(t, byte(45), providertypes.ConsumerIdKey()[0]) i++ - require.Equal(t, byte(44), providertypes.AllowInactiveValidatorsKey("chainID")[0]) + require.Equal(t, byte(46), providertypes.ConsumerIdToRegistrationRecordKeyPrefix()) i++ - require.Equal(t, uint8(45), providertypes.ConsumerIdKey()[0]) + require.Equal(t, byte(47), providertypes.ConsumerIdToInitializationRecordKeyPrefix()) i++ - require.Equal(t, uint8(46), providertypes.ConsumerIdToRegistrationRecordKey("consumerId")[0]) + require.Equal(t, byte(48), providertypes.ConsumerIdToUpdateRecordKey("consumerId")[0]) i++ - require.Equal(t, uint8(47), providertypes.ConsumerIdToInitializationRecordKey("consumerId")[0]) + require.Equal(t, byte(49), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) i++ - require.Equal(t, uint8(48), providertypes.ConsumerIdToUpdateRecordKey("consumerId")[0]) + require.Equal(t, byte(50), providertypes.ConsumerIdToStopTimeKeyPrefix()) i++ - require.Equal(t, uint8(49), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) + require.Equal(t, byte(51), providertypes.SpawnTimeToConsumerIdsKeyPrefix()) i++ - require.Equal(t, uint8(50), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) + require.Equal(t, byte(52), providertypes.StopTimeToConsumerIdsKeyPrefix()) i++ - require.Equal(t, uint8(51), providertypes.ConsumerIdToStopTimeKey("consumerId")[0]) + require.Equal(t, byte(53), providertypes.ProviderConsAddrToOptedInConsumerIdsKey(providertypes.NewProviderConsAddress([]byte{0x05}))[0]) i++ - require.Equal(t, uint8(52), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, byte(54), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() @@ -192,9 +201,6 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.EquivocationEvidenceMinHeightKey("chainID"), providertypes.ProposedConsumerChainKey(1), providertypes.ConsumerValidatorKey("chainID", providertypes.NewProviderConsAddress([]byte{0x05}).Address.Bytes()), - providertypes.TopNKey("chainID"), - providertypes.ValidatorsPowerCapKey("chainID"), - providertypes.ValidatorSetCapKey("chainID"), providertypes.AllowlistKey("chainID", providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.DenylistKey("chainID", providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.OptedInKey("chainID", providertypes.NewProviderConsAddress([]byte{0x05})), @@ -202,16 +208,16 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.ConsumerCommissionRateKey("chainID", providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.MinimumPowerInTopNKey("chainID"), providertypes.ConsumerAddrsToPruneV2Key("chainID", time.Time{}), - providertypes.MinStakeKey("chainID"), - providertypes.AllowInactiveValidatorsKey("chainID"), providerkeeper.GetValidatorKey(types.LastProviderConsensusValsPrefix(), providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.ConsumerIdKey(), providertypes.ConsumerIdToRegistrationRecordKey("consumerId"), providertypes.ConsumerIdToInitializationRecordKey("consumerId"), providertypes.ConsumerIdToUpdateRecordKey("consumerId"), - providertypes.ConsumerIdToOwnerAddressKey("consumerId"), providertypes.ConsumerIdToPhaseKey("consumerId"), providertypes.ConsumerIdToStopTimeKey("consumerId"), + providertypes.SpawnTimeToConsumerIdsKey(time.Time{}), + providertypes.StopTimeToConsumerIdsKey(time.Time{}), + providertypes.ProviderConsAddrToOptedInConsumerIdsKey(providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.ClientIdToConsumerIdKey("clientId"), } } diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 68479ab899..626fc6d2f5 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -103,14 +103,8 @@ func (msg MsgAssignConsumerKey) GetSignBytes() []byte { // ValidateBasic implements the sdk.Msg interface. func (msg MsgAssignConsumerKey) ValidateBasic() error { - if strings.TrimSpace(msg.ConsumerId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerId, "consumerId cannot be blank") - } - // It is possible to assign keys for consumer chains that are not yet approved. - // This can only be done by a signing validator, but it is still sensible - // to limit the chainID size to prevent abuse. - if 128 < len(msg.ConsumerId) { - return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot exceed 128 length") + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err } _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { @@ -157,6 +151,9 @@ func (msg MsgSubmitConsumerMisbehaviour) ValidateBasic() error { if msg.Submitter == "" { return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, msg.Submitter) } + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err + } if err := msg.Misbehaviour.ValidateBasic(); err != nil { return err @@ -217,6 +214,10 @@ func (msg MsgSubmitConsumerDoubleVoting) ValidateBasic() error { return fmt.Errorf("invalid infraction block header, validator set is nil") } + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err + } + return nil } @@ -295,8 +296,12 @@ func (msg MsgInitializeConsumer) Route() string { return RouterKey } // ValidateBasic implements the sdk.Msg interface. func (msg MsgInitializeConsumer) ValidateBasic() error { + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err + } + // add checks - // TODO (PERMISSIONLESS) + // TODO (PERMISSIONLESS) spawnTime has to be in the future return nil } @@ -340,6 +345,7 @@ func (msg MsgUpdateConsumer) ValidateBasic() error { return err } + // TODO (PERMISSIONLESS): validate update record err := ValidatePSSFeatures(msg.UpdateRecord.Top_N, msg.UpdateRecord.ValidatorsPowerCap) if err != nil { return errorsmod.Wrapf(ErrInvalidUpdateRecord, "invalid PSS features: %s", err.Error()) @@ -387,12 +393,7 @@ func (msg MsgRemoveConsumer) ValidateBasic() error { if err := ValidateConsumerId(msg.ConsumerId); err != nil { return err } - - if msg.StopTime.IsZero() { - return errorsmod.Wrap(ErrInvalidConsumerRemoval, "spawn time cannot be zero") - } return nil - } // Type implements the sdk.Msg interface. @@ -443,14 +444,8 @@ func (msg MsgOptIn) GetSigners() []sdk.AccAddress { // ValidateBasic implements the sdk.Msg interface. func (msg MsgOptIn) ValidateBasic() error { - if strings.TrimSpace(msg.ConsumerId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerId, "consumer id cannot be blank") - } - // It is possible to opt in to validate on consumer chains that are not yet approved. - // This can only be done by a signing validator, but it is still sensible - // to limit the consumerId size to prevent abuse. - if 128 < len(msg.ConsumerId) { - return errorsmod.Wrapf(ErrInvalidConsumerId, "consumer id cannot exceed 128 length") + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err } _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { @@ -501,14 +496,8 @@ func (msg MsgOptOut) GetSignBytes() []byte { // ValidateBasic implements the sdk.Msg interface. func (msg MsgOptOut) ValidateBasic() error { - if strings.TrimSpace(msg.ConsumerId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot be blank") - } - // It is possible to assign keys for consumer chains that are not yet approved. - // This can only be done by a signing validator, but it is still sensible - // to limit the chainID size to prevent abuse. - if 128 < len(msg.ConsumerId) { - return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot exceed 128 length") + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err } _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { @@ -536,12 +525,8 @@ func (msg MsgSetConsumerCommissionRate) Type() string { } func (msg MsgSetConsumerCommissionRate) ValidateBasic() error { - if strings.TrimSpace(msg.ConsumerId) == "" { - return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot be blank") - } - - if 128 < len(msg.ConsumerId) { - return errorsmod.Wrapf(ErrInvalidConsumerId, "chainId cannot exceed 128 length") + if err := ValidateConsumerId(msg.ConsumerId); err != nil { + return err } _, err := sdk.ValAddressFromBech32(msg.ProviderAddr) if err != nil { diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index ce0e3447be..43135eff1e 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -899,59 +899,6 @@ func (m *AddressList) GetAddresses() [][]byte { return nil } -// ChannelToChain is used to map a CCV channel ID to the consumer chainID -type ChannelToChain struct { - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *ChannelToChain) Reset() { *m = ChannelToChain{} } -func (m *ChannelToChain) String() string { return proto.CompactTextString(m) } -func (*ChannelToChain) ProtoMessage() {} -func (*ChannelToChain) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{11} -} -func (m *ChannelToChain) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChannelToChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChannelToChain.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 *ChannelToChain) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChannelToChain.Merge(m, src) -} -func (m *ChannelToChain) XXX_Size() int { - return m.Size() -} -func (m *ChannelToChain) XXX_DiscardUnknown() { - xxx_messageInfo_ChannelToChain.DiscardUnknown(m) -} - -var xxx_messageInfo_ChannelToChain proto.InternalMessageInfo - -func (m *ChannelToChain) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *ChannelToChain) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - // ValidatorSetChangePackets is a pb list of ccv.ValidatorSetChangePacketData. type ValidatorSetChangePackets struct { List []types3.ValidatorSetChangePacketData `protobuf:"bytes,1,rep,name=list,proto3" json:"list"` @@ -961,7 +908,7 @@ func (m *ValidatorSetChangePackets) Reset() { *m = ValidatorSetChangePac func (m *ValidatorSetChangePackets) String() string { return proto.CompactTextString(m) } func (*ValidatorSetChangePackets) ProtoMessage() {} func (*ValidatorSetChangePackets) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{12} + return fileDescriptor_f22ec409a72b7b72, []int{11} } func (m *ValidatorSetChangePackets) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1007,7 +954,7 @@ func (m *KeyAssignmentReplacement) Reset() { *m = KeyAssignmentReplaceme func (m *KeyAssignmentReplacement) String() string { return proto.CompactTextString(m) } func (*KeyAssignmentReplacement) ProtoMessage() {} func (*KeyAssignmentReplacement) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{13} + return fileDescriptor_f22ec409a72b7b72, []int{12} } func (m *KeyAssignmentReplacement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1070,7 +1017,7 @@ func (m *ValidatorConsumerPubKey) Reset() { *m = ValidatorConsumerPubKey func (m *ValidatorConsumerPubKey) String() string { return proto.CompactTextString(m) } func (*ValidatorConsumerPubKey) ProtoMessage() {} func (*ValidatorConsumerPubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{14} + return fileDescriptor_f22ec409a72b7b72, []int{13} } func (m *ValidatorConsumerPubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1133,7 +1080,7 @@ func (m *ValidatorByConsumerAddr) Reset() { *m = ValidatorByConsumerAddr func (m *ValidatorByConsumerAddr) String() string { return proto.CompactTextString(m) } func (*ValidatorByConsumerAddr) ProtoMessage() {} func (*ValidatorByConsumerAddr) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{15} + return fileDescriptor_f22ec409a72b7b72, []int{14} } func (m *ValidatorByConsumerAddr) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1195,7 +1142,7 @@ func (m *ConsumerAddrsToPruneV2) Reset() { *m = ConsumerAddrsToPruneV2{} func (m *ConsumerAddrsToPruneV2) String() string { return proto.CompactTextString(m) } func (*ConsumerAddrsToPruneV2) ProtoMessage() {} func (*ConsumerAddrsToPruneV2) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{16} + return fileDescriptor_f22ec409a72b7b72, []int{15} } func (m *ConsumerAddrsToPruneV2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1268,7 +1215,7 @@ func (m *ConsensusValidator) Reset() { *m = ConsensusValidator{} } func (m *ConsensusValidator) String() string { return proto.CompactTextString(m) } func (*ConsensusValidator) ProtoMessage() {} func (*ConsensusValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{17} + return fileDescriptor_f22ec409a72b7b72, []int{16} } func (m *ConsensusValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1336,7 +1283,7 @@ func (m *ConsumerRewardsAllocation) Reset() { *m = ConsumerRewardsAlloca func (m *ConsumerRewardsAllocation) String() string { return proto.CompactTextString(m) } func (*ConsumerRewardsAllocation) ProtoMessage() {} func (*ConsumerRewardsAllocation) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{18} + return fileDescriptor_f22ec409a72b7b72, []int{17} } func (m *ConsumerRewardsAllocation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1384,7 +1331,6 @@ func init() { proto.RegisterType((*ConsumerAdditionProposals)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposals") proto.RegisterType((*ConsumerRemovalProposals)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposals") proto.RegisterType((*AddressList)(nil), "interchain_security.ccv.provider.v1.AddressList") - proto.RegisterType((*ChannelToChain)(nil), "interchain_security.ccv.provider.v1.ChannelToChain") proto.RegisterType((*ValidatorSetChangePackets)(nil), "interchain_security.ccv.provider.v1.ValidatorSetChangePackets") proto.RegisterType((*KeyAssignmentReplacement)(nil), "interchain_security.ccv.provider.v1.KeyAssignmentReplacement") proto.RegisterType((*ValidatorConsumerPubKey)(nil), "interchain_security.ccv.provider.v1.ValidatorConsumerPubKey") @@ -1399,130 +1345,128 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1965 bytes of a gzipped FileDescriptorProto + // 1935 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x39, 0x52, 0xec, 0x95, 0xa2, 0x92, 0x34, 0x53, 0x1b, - 0x6c, 0x5c, 0x2f, 0x23, 0x05, 0x05, 0x0c, 0xb7, 0x81, 0x21, 0x51, 0x4e, 0x2c, 0xa9, 0x71, 0xd8, - 0x95, 0xa0, 0x00, 0xe9, 0x61, 0x31, 0x9c, 0x1d, 0x91, 0x53, 0xed, 0xee, 0xac, 0x67, 0x86, 0x2b, - 0xf3, 0xd2, 0x73, 0x2f, 0x05, 0xd2, 0x5b, 0xd0, 0x4b, 0x73, 0x2c, 0x7a, 0xea, 0xa1, 0xe8, 0x1f, - 0xd0, 0x53, 0x50, 0xa0, 0x40, 0x2e, 0x05, 0x7a, 0x4a, 0x0a, 0xfb, 0xd0, 0x43, 0x81, 0x02, 0x3d, - 0xf5, 0x5a, 0xcc, 0xec, 0x07, 0x97, 0xfa, 0xb0, 0x69, 0x38, 0x17, 0x69, 0xf7, 0xbd, 0xdf, 0xfb, - 0xcd, 0x7b, 0x33, 0xef, 0xbd, 0x79, 0x4b, 0xb0, 0x4d, 0x03, 0x49, 0x38, 0xee, 0x23, 0x1a, 0x38, - 0x82, 0xe0, 0x01, 0xa7, 0x72, 0xd8, 0xc2, 0x38, 0x6a, 0x85, 0x9c, 0x45, 0xd4, 0x25, 0xbc, 0x15, - 0x6d, 0x65, 0xcf, 0x56, 0xc8, 0x99, 0x64, 0xf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, 0x85, 0x62, 0x5a, 0xca, 0x8c, 0x3b, 0xda, 0x16, 0xfe, 0x0c, 0x40, - 0x8c, 0x23, 0xed, 0x12, 0x1b, 0xc8, 0x94, 0xb1, 0x3c, 0x39, 0xe3, 0x32, 0xc6, 0xd1, 0x71, 0x6c, - 0x9d, 0x50, 0xfe, 0x1c, 0xdc, 0x94, 0x1c, 0x05, 0xe2, 0x94, 0xf0, 0x8b, 0xbc, 0x60, 0x72, 0xde, - 0xb7, 0x52, 0x8e, 0x71, 0xf2, 0xc7, 0xa0, 0x8e, 0x93, 0x04, 0x72, 0x38, 0x71, 0xa9, 0x90, 0x9c, - 0x76, 0x07, 0xca, 0xd6, 0x39, 0xe5, 0x08, 0xeb, 0x1c, 0xa9, 0xe8, 0x24, 0xa8, 0xa6, 0x38, 0x7b, - 0x0c, 0xf6, 0x61, 0x82, 0x82, 0x9f, 0x80, 0xef, 0x77, 0x3d, 0x86, 0xcf, 0x84, 0x72, 0xce, 0x19, - 0x63, 0xd2, 0x4b, 0xfb, 0x54, 0x08, 0xc5, 0x36, 0x5f, 0x37, 0x9a, 0x05, 0xfb, 0x56, 0x8c, 0xed, - 0x10, 0xbe, 0x97, 0x43, 0x1e, 0xe7, 0x80, 0xf0, 0x1e, 0x80, 0x7d, 0x2a, 0x24, 0xe3, 0x14, 0x23, - 0xcf, 0x21, 0x81, 0xe4, 0x94, 0x08, 0x73, 0x41, 0x9b, 0xaf, 0x8c, 0x34, 0x8f, 0x62, 0x05, 0x3c, - 0x00, 0xb7, 0xae, 0x5d, 0xd4, 0xc1, 0x7d, 0x14, 0x04, 0xc4, 0x33, 0x17, 0x75, 0x28, 0x35, 0xf7, - 0x9a, 0x35, 0xdb, 0x31, 0x0c, 0xae, 0x82, 0x19, 0xc9, 0x42, 0xe7, 0x89, 0xb9, 0x54, 0x37, 0x9a, - 0x0b, 0x76, 0x51, 0xb2, 0xf0, 0x09, 0x7c, 0x0f, 0xac, 0x45, 0xc8, 0xa3, 0x2e, 0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8, 0xa7, 0x6d, 0x39, 0x0a, 0x89, + 0x48, 0x6d, 0xc4, 0x1f, 0xfe, 0xfd, 0xa7, 0x77, 0x0d, 0x3b, 0x5d, 0x66, 0xef, 0xd3, 0xaf, 0x9e, + 0xd7, 0x8c, 0xaf, 0x9f, 0xd7, 0x8c, 0x7f, 0x3d, 0xaf, 0x19, 0x9f, 0xbf, 0xa8, 0xcd, 0x7c, 0xfd, + 0xa2, 0x36, 0xf3, 0xcf, 0x17, 0xb5, 0x99, 0xcf, 0x3e, 0xb8, 0x48, 0x3a, 0x3e, 0xb4, 0x3b, 0xd9, + 0x0f, 0x63, 0xd1, 0x8f, 0xdb, 0xcf, 0x26, 0x7f, 0x76, 0xd3, 0xeb, 0xf5, 0xe6, 0x75, 0x86, 0xbc, + 0xff, 0x5d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0x54, 0x79, 0x8c, 0xa7, 0x13, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -2237,43 +2181,6 @@ func (m *AddressList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ChannelToChain) 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 *ChannelToChain) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChannelToChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintProvider(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintProvider(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *ValidatorSetChangePackets) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2922,23 +2829,6 @@ func (m *AddressList) Size() (n int) { return n } -func (m *ChannelToChain) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovProvider(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovProvider(uint64(l)) - } - return n -} - func (m *ValidatorSetChangePackets) Size() (n int) { if m == nil { return 0 @@ -5337,120 +5227,6 @@ func (m *AddressList) Unmarshal(dAtA []byte) error { } return nil } -func (m *ChannelToChain) 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: ChannelToChain: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChannelToChain: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProvider - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProvider - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProvider - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProvider - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - 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 (m *ValidatorSetChangePackets) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 4d2f4be391..4e5a21cedf 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -1103,12 +1103,14 @@ func (m *MsgRegisterConsumer) GetRegistrationRecord() *ConsumerRegistrationRecor // ConsumerRegistrationRecord is the record that contains information for the registered chain type ConsumerRegistrationRecord struct { - // the title of the chain to-be-registered + // the title of the chain that is to be registered Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // the description of the chain to-be-registered + // the description of the chain that is to be registered Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the metadata (e.g., GitHub repository URL) of the chain that is to be registered + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // the chain id of the new consumer chain - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } func (m *ConsumerRegistrationRecord) Reset() { *m = ConsumerRegistrationRecord{} } @@ -1158,6 +1160,13 @@ func (m *ConsumerRegistrationRecord) GetDescription() string { return "" } +func (m *ConsumerRegistrationRecord) GetMetadata() string { + if m != nil { + return m.Metadata + } + return "" +} + func (m *ConsumerRegistrationRecord) GetChainId() string { if m != nil { return m.ChainId @@ -1502,125 +1511,126 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 1875 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4b, 0x6c, 0x24, 0x47, + // 1890 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4b, 0x6c, 0x24, 0x47, 0x19, 0x76, 0xfb, 0xb5, 0x9e, 0xdf, 0x8f, 0xb5, 0xcb, 0x36, 0x1e, 0xcf, 0x2e, 0x33, 0xde, 0x49, 0x48, 0xac, 0x25, 0xee, 0xce, 0x1a, 0xb2, 0x80, 0x05, 0x01, 0x3f, 0x16, 0xd6, 0x01, 0xef, 0x9a, 0xde, 0x65, 0x91, 0x40, 0x4a, 0xab, 0xa6, 0xbb, 0xb6, 0xa7, 0xb4, 0xd3, 0x5d, 0xad, 0xae, 0x9a, - 0x71, 0x86, 0x13, 0xca, 0x21, 0xca, 0x09, 0x05, 0x89, 0x03, 0xc7, 0x1c, 0xb8, 0x20, 0x05, 0x29, - 0x87, 0x70, 0xe6, 0x86, 0x72, 0x8a, 0x42, 0x4e, 0x28, 0x42, 0x0b, 0xda, 0x3d, 0x84, 0x33, 0x27, - 0x8e, 0xa8, 0x1e, 0xdd, 0x33, 0xe3, 0x19, 0xdb, 0x63, 0x6f, 0xc2, 0x21, 0x97, 0xd1, 0x54, 0xfd, - 0xdf, 0xff, 0xfd, 0x8f, 0xfe, 0xeb, 0xaf, 0x07, 0xbc, 0x44, 0x63, 0x41, 0x52, 0xbf, 0x8e, 0x69, - 0xec, 0x71, 0xe2, 0x37, 0x53, 0x2a, 0xda, 0x8e, 0xef, 0xb7, 0x9c, 0x24, 0x65, 0x2d, 0x1a, 0x90, - 0xd4, 0x69, 0xdd, 0x70, 0xc4, 0x1b, 0x76, 0x92, 0x32, 0xc1, 0xd0, 0x73, 0x03, 0xd0, 0xb6, 0xef, - 0xb7, 0xec, 0x0c, 0x6d, 0xb7, 0x6e, 0x94, 0x16, 0x70, 0x44, 0x63, 0xe6, 0xa8, 0x5f, 0xad, 0x57, - 0xba, 0x1a, 0x32, 0x16, 0x36, 0x88, 0x83, 0x13, 0xea, 0xe0, 0x38, 0x66, 0x02, 0x0b, 0xca, 0x62, - 0x6e, 0xa4, 0x15, 0x23, 0x55, 0xa3, 0x5a, 0xf3, 0xa1, 0x23, 0x68, 0x44, 0xb8, 0xc0, 0x51, 0x62, - 0x00, 0xe5, 0xe3, 0x80, 0xa0, 0x99, 0x2a, 0x06, 0x23, 0x5f, 0x3d, 0x2e, 0xc7, 0x71, 0xdb, 0x88, - 0x96, 0x42, 0x16, 0x32, 0xf5, 0xd7, 0x91, 0xff, 0x32, 0x05, 0x9f, 0xf1, 0x88, 0x71, 0x4f, 0x0b, - 0xf4, 0xc0, 0x88, 0x56, 0xf4, 0xc8, 0x89, 0x78, 0x28, 0x43, 0x8f, 0x78, 0x98, 0x79, 0x49, 0x6b, - 0xbe, 0xe3, 0xb3, 0x94, 0x38, 0x7e, 0x83, 0x92, 0x58, 0x48, 0xa9, 0xfe, 0x67, 0x00, 0x9b, 0xc3, - 0xa4, 0x32, 0x4f, 0x94, 0xd6, 0x71, 0x24, 0x69, 0x83, 0x86, 0x75, 0xa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3, 0xec, 0x28, 0x36, 0x45, 0x40, 0x38, 0x37, 0x05, 0x3e, 0xa3, 0x26, 0x4d, 0x7c, - 0x68, 0x11, 0x26, 0x64, 0xbb, 0xbd, 0xa3, 0x02, 0x99, 0x75, 0xc7, 0x05, 0x4b, 0xee, 0xa0, 0x97, - 0x61, 0xa9, 0x85, 0x1b, 0x34, 0xc0, 0x82, 0xa5, 0xdc, 0x4b, 0xd8, 0x11, 0x49, 0x3d, 0x1f, 0x27, - 0x2a, 0x92, 0x59, 0x17, 0x75, 0x64, 0x87, 0x52, 0xb4, 0x8b, 0x13, 0x74, 0x1d, 0x16, 0xf2, 0x59, - 0x8f, 0x13, 0xa1, 0xe0, 0xe3, 0x0a, 0x7e, 0x39, 0x17, 0xc8, 0x4f, 0x85, 0x13, 0x74, 0x15, 0x0a, - 0xb8, 0xd1, 0x60, 0x47, 0x0d, 0xca, 0x45, 0x71, 0x42, 0x75, 0xbd, 0xce, 0x04, 0x2a, 0xc1, 0x54, - 0x40, 0xe2, 0xb6, 0x12, 0x4e, 0x2a, 0x61, 0x3e, 0x46, 0x57, 0xa0, 0x10, 0xc9, 0xec, 0x09, 0xfc, - 0x88, 0x14, 0x2f, 0xad, 0x59, 0xeb, 0xe3, 0xee, 0x54, 0x44, 0xe3, 0x7b, 0x72, 0x8c, 0x6c, 0x58, - 0x54, 0x2c, 0x1e, 0x8d, 0xe5, 0x86, 0xdc, 0x22, 0x5e, 0x0b, 0x37, 0x78, 0x71, 0x6a, 0xcd, 0x5a, - 0x9f, 0x72, 0x17, 0x94, 0x68, 0xdf, 0x48, 0x1e, 0xe0, 0x06, 0x37, 0xed, 0xbd, 0xb7, 0x2a, 0xf2, - 0x9a, 0xf9, 0xab, 0x05, 0x8b, 0xaa, 0xf9, 0x87, 0x94, 0x0b, 0x59, 0x59, 0xa6, 0x6a, 0x3a, 0xa5, - 0x6b, 0x0d, 0x57, 0xba, 0x28, 0x81, 0xc5, 0x54, 0xb1, 0xe8, 0x3b, 0x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 0xff, 0xfb, 0xbf, 0xff, 0xd1, 0x7f, 0xfd, 0xf5, 0x30, 0xbc, 0x44, 0x63, 0x41, 0x52, 0xbf, 0x8e, + 0x69, 0xec, 0x71, 0xe2, 0x37, 0x53, 0x2a, 0xda, 0x8e, 0xef, 0xb7, 0x9c, 0x24, 0x65, 0x2d, 0x1a, + 0x90, 0xd4, 0x69, 0xdd, 0x70, 0xc4, 0x1b, 0x76, 0x92, 0x32, 0xc1, 0xd0, 0x73, 0x03, 0xd0, 0xb6, + 0xef, 0xb7, 0xec, 0x0c, 0x6d, 0xb7, 0x6e, 0x94, 0x16, 0x70, 0x44, 0x63, 0xe6, 0xa8, 0xbf, 0x5a, + 0xaf, 0x74, 0x35, 0x64, 0x2c, 0x6c, 0x10, 0x07, 0x27, 0xd4, 0xc1, 0x71, 0xcc, 0x04, 0x16, 0x94, + 0xc5, 0xdc, 0x48, 0x2b, 0x46, 0xaa, 0x46, 0xb5, 0xe6, 0x43, 0x47, 0xd0, 0x88, 0x70, 0x81, 0xa3, + 0xc4, 0x00, 0xca, 0xc7, 0x01, 0x41, 0x33, 0x55, 0x0c, 0x46, 0xbe, 0x7a, 0x5c, 0x8e, 0xe3, 0xb6, + 0x11, 0x2d, 0x85, 0x2c, 0x64, 0xea, 0xa7, 0x23, 0x7f, 0x65, 0x0a, 0x3e, 0xe3, 0x11, 0xe3, 0x9e, + 0x16, 0xe8, 0x81, 0x11, 0xad, 0xe8, 0x91, 0x13, 0xf1, 0x50, 0x86, 0x1e, 0xf1, 0x30, 0xf3, 0x92, + 0xd6, 0x7c, 0xc7, 0x67, 0x29, 0x71, 0xfc, 0x06, 0x25, 0xb1, 0x90, 0x52, 0xfd, 0xcb, 0x00, 0x36, + 0x87, 0x49, 0x65, 0x9e, 0x28, 0xad, 0xe3, 0x48, 0xd2, 0x06, 0x0d, 0xeb, 0x42, 0x53, 0x71, 0x47, + 0x90, 0x38, 0x20, 0x69, 0x44, 0xb5, 0x81, 0xce, 0x28, 0xf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a, 0xf6, 0x45, 0xb4, 0x72, 0x27, 0x22, 0x98, 0xd0, 0x57, 0xf0, + 0x8d, 0x61, 0x69, 0x14, 0xbc, 0xf4, 0xca, 0xb9, 0xe0, 0xb9, 0xb9, 0x04, 0x26, 0xcd, 0x65, 0xd8, + 0x3e, 0x07, 0xc1, 0xdd, 0xa6, 0x28, 0xdd, 0x3c, 0x1f, 0x3e, 0xb7, 0xf8, 0x07, 0x0b, 0x56, 0x4f, + 0xbe, 0xbb, 0x0e, 0xdd, 0x62, 0x4f, 0xa4, 0x28, 0xed, 0x3f, 0x33, 0x45, 0xe6, 0x6b, 0x69, 0xe2, + 0x97, 0x9f, 0xbd, 0x7f, 0xdd, 0xda, 0xf9, 0xe9, 0x87, 0x4f, 0xca, 0xd6, 0xc7, 0x4f, 0xca, 0xd6, + 0x3f, 0x9f, 0x94, 0xad, 0x77, 0x9e, 0x96, 0x47, 0x3e, 0x7e, 0x5a, 0x1e, 0xf9, 0xdb, 0xd3, 0xf2, + 0xc8, 0xcf, 0xbe, 0x13, 0x52, 0x51, 0x6f, 0xd6, 0x6c, 0x9f, 0x45, 0xe6, 0xff, 0x00, 0x4e, 0xc7, + 0xf8, 0x46, 0xfe, 0x8c, 0xdf, 0x7a, 0xc5, 0x79, 0xa3, 0xf7, 0x2d, 0x5f, 0xbd, 0x59, 0xd6, 0x26, + 0xd5, 0xa1, 0xe0, 0x6b, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x33, 0x75, 0x7d, 0xb2, 0x47, 0x19, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2930,6 +2940,13 @@ func (m *ConsumerRegistrationRecord) MarshalToSizedBuffer(dAtA []byte) (int, err copy(dAtA[i:], m.ChainId) i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- + dAtA[i] = 0x22 + } + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) + i-- dAtA[i] = 0x1a } if len(m.Description) > 0 { @@ -3546,6 +3563,10 @@ func (m *ConsumerRegistrationRecord) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -6173,6 +6194,38 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } From e86d44df98de4db581d3bf6f1f42bd0c4933cde3 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 14 Aug 2024 14:22:49 +0200 Subject: [PATCH 26/41] fixed integration tests --- Makefile | 6 +- tests/integration/common.go | 2 +- tests/integration/distribution.go | 60 ++++++------- tests/integration/double_vote.go | 55 ++++++------ tests/integration/expired_client.go | 10 +-- tests/integration/key_assignment.go | 32 +++---- tests/integration/misbehaviour.go | 44 +++++----- .../integration/partial_set_security_test.go | 5 +- tests/integration/setup.go | 44 +++++----- tests/integration/slashing.go | 10 +-- tests/integration/stop_consumer.go | 24 +++--- tests/mbt/driver/core.go | 6 +- testutil/ibc_testing/generic_setup.go | 46 ++++++---- x/ccv/provider/handler_test.go | 62 ++++++-------- x/ccv/provider/ibc_middleware.go | 6 +- x/ccv/provider/ibc_module_test.go | 17 ++-- x/ccv/provider/keeper/distribution.go | 20 +++-- x/ccv/provider/keeper/distribution_test.go | 2 +- x/ccv/provider/keeper/genesis.go | 28 +++---- x/ccv/provider/keeper/grpc_query.go | 4 +- x/ccv/provider/keeper/keeper.go | 33 ++++---- x/ccv/provider/keeper/keeper_test.go | 4 +- x/ccv/provider/keeper/key_assignment.go | 11 ++- x/ccv/provider/keeper/key_assignment_test.go | 84 +++++++++---------- x/ccv/provider/keeper/proposal.go | 1 + x/ccv/provider/keeper/relay.go | 6 +- x/ccv/provider/migrations/v5/migrations.go | 4 +- x/ccv/provider/migrations/v6/migrations.go | 2 +- 28 files changed, 320 insertions(+), 308 deletions(-) diff --git a/Makefile b/Makefile index 1e8eb8e5bc..ec2493c9b4 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,8 @@ install: go.sum go install -ldflags "$(democracyFlags)" ./cmd/interchain-security-cdd go install -ldflags "$(standaloneFlags)" ./cmd/interchain-security-sd -# run all tests: unit, integration, diff, and E2E -test: test-unit test-integration test-mbt test-e2e +# run all tests: unit, integration, and E2E +test: test-unit test-integration test-e2e # shortcut for local development test-dev: test-unit test-integration test-mbt @@ -271,4 +271,4 @@ build-docs-local: ############################################################################### e2e-traces: - cd tests/e2e; go test -timeout 30s -run ^TestWriteExamples -v \ No newline at end of file + cd tests/e2e; go test -timeout 30s -run ^TestWriteExamples -v diff --git a/tests/integration/common.go b/tests/integration/common.go index 46ef499d01..a2c5cd8d46 100644 --- a/tests/integration/common.go +++ b/tests/integration/common.go @@ -42,7 +42,7 @@ func (s *CCVTestSuite) getFirstBundle() icstestingutils.ConsumerBundle { } func (s *CCVTestSuite) getBundleByIdx(index int) icstestingutils.ConsumerBundle { - return *s.consumerBundles[ibctesting.GetChainID(2+index)] + return *s.consumerBundles[fmt.Sprintf("%d", 2+index)] } func (s *CCVTestSuite) providerCtx() sdk.Context { diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 8fecaccfc8..4c8b9fccf7 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -125,7 +125,7 @@ func (s *CCVTestSuite) TestRewardsDistribution() { // Save the consumer validators total outstanding rewards on the provider consumerValsOutstandingRewardsFunc := func(ctx sdk.Context) sdk.DecCoins { totalRewards := sdk.DecCoins{} - vals, err := providerKeeper.GetConsumerValSet(ctx, s.consumerChain.ChainID) + vals, err := providerKeeper.GetConsumerValSet(ctx, s.getFirstBundle().ConsumerId) s.Require().NoError(err) for _, v := range vals { @@ -160,7 +160,7 @@ func (s *CCVTestSuite) TestRewardsDistribution() { // Consumer allocations are distributed between the validators and the community pool. // The decimals resulting from the distribution are expected to remain in the consumer allocations. - rewardsAlloc := providerKeeper.GetConsumerRewardsAllocation(s.providerCtx(), s.consumerChain.ChainID) + rewardsAlloc := providerKeeper.GetConsumerRewardsAllocation(s.providerCtx(), s.getFirstBundle().ConsumerId) remainingAlloc := rewardsAlloc.Rewards.AmountOf(rewardsIBCdenom) s.Require().True(remainingAlloc.LTE(math.LegacyOneDec())) @@ -601,7 +601,7 @@ func (s *CCVTestSuite) TestIBCTransferMiddleware() { // update consumer allocation keeper.SetConsumerRewardsAllocation( ctx, - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, providertypes.ConsumerRewardsAllocation{ Rewards: sdk.NewDecCoins(sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(100_000))), }, @@ -668,7 +668,7 @@ func (s *CCVTestSuite) TestIBCTransferMiddleware() { rewardsPoolBalance := bankKeeper.GetAllBalances(s.providerCtx(), sdk.MustAccAddressFromBech32(data.Receiver)) // save the consumer's rewards allocated - consumerRewardsAllocations := providerKeeper.GetConsumerRewardsAllocation(s.providerCtx(), s.consumerChain.ChainID) + consumerRewardsAllocations := providerKeeper.GetConsumerRewardsAllocation(s.providerCtx(), s.getFirstBundle().ConsumerId) // execute middleware OnRecvPacket logic ack := cbs.OnRecvPacket(s.providerCtx(), packet, sdk.AccAddress{}) @@ -682,7 +682,7 @@ func (s *CCVTestSuite) TestIBCTransferMiddleware() { // compute the balance and allocation difference rewardsTransferred := bankKeeper.GetAllBalances(s.providerCtx(), sdk.MustAccAddressFromBech32(data.Receiver)). Sub(rewardsPoolBalance...) - rewardsAllocated := providerKeeper.GetConsumerRewardsAllocation(s.providerCtx(), s.consumerChain.ChainID). + rewardsAllocated := providerKeeper.GetConsumerRewardsAllocation(s.providerCtx(), s.getFirstBundle().ConsumerId). Rewards.Sub(consumerRewardsAllocations.Rewards) if !tc.expErr { @@ -739,11 +739,11 @@ func (s *CCVTestSuite) TestAllocateTokens() { // Allocate rewards evenly between consumers rewardsPerChain := totalRewards.QuoInt(math.NewInt(int64(len(s.consumerBundles)))) - for chainID := range s.consumerBundles { + for consumerId := range s.consumerBundles { // update consumer allocation providerKeeper.SetConsumerRewardsAllocation( providerCtx, - chainID, + consumerId, providertypes.ConsumerRewardsAllocation{ Rewards: sdk.NewDecCoinsFromCoins(rewardsPerChain...), }, @@ -797,7 +797,7 @@ func (s *CCVTestSuite) TestAllocateTokens() { // check that the total expected rewards are transferred to the distribution module account // store the decimal remainders in the consumer reward allocations - allocRemainderPerChain := providerKeeper.GetConsumerRewardsAllocation(providerCtx, s.consumerChain.ChainID).Rewards + allocRemainderPerChain := providerKeeper.GetConsumerRewardsAllocation(providerCtx, s.getFirstBundle().ConsumerId).Rewards // compute the total rewards distributed to the distribution module balance (validator outstanding rewards + community pool tax), totalRewardsDistributed := sdk.NewDecCoinsFromCoins(totalRewards...).Sub(allocRemainderPerChain.MulDec(math.LegacyNewDec(int64(consNum)))) @@ -843,7 +843,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { distributionKeeper := s.providerApp.GetTestDistributionKeeper() bankKeeper := s.providerApp.GetTestBankKeeper() - chainID := s.consumerChain.ChainID + consumerId := s.getFirstBundle().ConsumerId testCases := []struct { name string @@ -859,7 +859,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { expAllocated: nil, }, { - name: "consumer valset is empty - total voting power is zero", + name: "consumerId valset is empty - total voting power is zero", tokens: sdk.DecCoins{sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(100_000))}, rate: math.LegacyZeroDec(), expAllocated: nil, @@ -884,24 +884,24 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { s.Run(tc.name, func() { ctx, _ := s.providerCtx().CacheContext() - // increase the block height so validators are eligible for consumer rewards (see `IsEligibleForConsumerRewards`) + // increase the block height so validators are eligible for consumerId rewards (see `IsEligibleForConsumerRewards`) ctx = ctx.WithBlockHeight(providerKeeper.GetNumberOfEpochsToStartReceivingRewards(ctx)*providerKeeper.GetBlocksPerEpoch(ctx) + ctx.BlockHeight()) - // change the consumer valset - consuVals, err := providerKeeper.GetConsumerValSet(ctx, chainID) + // change the consumerId valset + consuVals, err := providerKeeper.GetConsumerValSet(ctx, consumerId) s.Require().NoError(err) - providerKeeper.DeleteConsumerValSet(ctx, chainID) - providerKeeper.SetConsumerValSet(ctx, chainID, consuVals[0:tc.consuValLen]) - consuVals, err = providerKeeper.GetConsumerValSet(ctx, chainID) + providerKeeper.DeleteConsumerValSet(ctx, consumerId) + providerKeeper.SetConsumerValSet(ctx, consumerId, consuVals[0:tc.consuValLen]) + consuVals, err = providerKeeper.GetConsumerValSet(ctx, consumerId) s.Require().NoError(err) - // set the same consumer commission rate for all consumer validators + // set the same consumerId commission rate for all consumerId validators for _, v := range consuVals { provAddr := providertypes.NewProviderConsAddress(sdk.ConsAddress(v.ProviderConsAddr)) err := providerKeeper.SetConsumerCommissionRate( ctx, - chainID, + consumerId, provAddr, tc.rate, ) @@ -911,7 +911,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { // allocate tokens res := providerKeeper.AllocateTokensToConsumerValidators( ctx, - chainID, + consumerId, tc.tokens, ) @@ -949,7 +949,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { s.Require().NoError(err) // check that the withdrawn coins is equal to the entire reward amount - // times the set consumer commission rate + // times the set consumerId commission rate commission := rewards.Rewards.MulDec(tc.rate) c, _ := commission.TruncateDecimal() s.Require().Equal(withdrawnCoins, c) @@ -981,7 +981,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidatorsWithDifferentValida distributionKeeper := s.providerApp.GetTestDistributionKeeper() bankKeeper := s.providerApp.GetTestBankKeeper() - chainID := s.consumerChain.ChainID + consumerId := s.getFirstBundle().ConsumerId tokens := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecFromIntWithPrec(math.NewInt(999), 2))} rate := math.LegacyOneDec() @@ -994,7 +994,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidatorsWithDifferentValida ctx = ctx.WithBlockHeight(providerKeeper.GetNumberOfEpochsToStartReceivingRewards(ctx)*providerKeeper.GetBlocksPerEpoch(ctx) + 1) // update the consumer validators - consuVals, err := providerKeeper.GetConsumerValSet(ctx, chainID) + consuVals, err := providerKeeper.GetConsumerValSet(ctx, consumerId) s.Require().NoError(err) // first 2 validators were consumer validators since block height 1 and hence get rewards consuVals[0].JoinHeight = 1 @@ -1003,11 +1003,11 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidatorsWithDifferentValida // have not been consumer validators for `GetNumberOfEpochsToStartReceivingRewards * GetBlocksPerEpoch` blocks consuVals[2].JoinHeight = 2 consuVals[3].JoinHeight = 2 - providerKeeper.SetConsumerValSet(ctx, chainID, consuVals) + providerKeeper.SetConsumerValSet(ctx, consumerId, consuVals) - providerKeeper.DeleteConsumerValSet(ctx, chainID) - providerKeeper.SetConsumerValSet(ctx, chainID, consuVals) - consuVals, err = providerKeeper.GetConsumerValSet(ctx, chainID) + providerKeeper.DeleteConsumerValSet(ctx, consumerId) + providerKeeper.SetConsumerValSet(ctx, consumerId, consuVals) + consuVals, err = providerKeeper.GetConsumerValSet(ctx, consumerId) s.Require().NoError(err) // set the same consumer commission rate for all consumer validators @@ -1015,7 +1015,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidatorsWithDifferentValida provAddr := providertypes.NewProviderConsAddress(sdk.ConsAddress(v.ProviderConsAddr)) err := providerKeeper.SetConsumerCommissionRate( ctx, - chainID, + consumerId, provAddr, rate, ) @@ -1025,7 +1025,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidatorsWithDifferentValida // allocate tokens res := providerKeeper.AllocateTokensToConsumerValidators( ctx, - chainID, + consumerId, tokens, ) @@ -1101,8 +1101,8 @@ func (s *CCVTestSuite) TestMultiConsumerRewardsDistribution() { // Iterate over the consumers and perform the reward distribution // to the provider - for chainID := range s.consumerBundles { - bundle := s.consumerBundles[chainID] + for consumerId := range s.consumerBundles { + bundle := s.consumerBundles[consumerId] consumerKeeper := bundle.App.GetConsumerKeeper() bankKeeper := bundle.App.GetTestBankKeeper() accountKeeper := bundle.App.GetTestAccountKeeper() diff --git a/tests/integration/double_vote.go b/tests/integration/double_vote.go index 2f275fd95c..b4c9f82c10 100644 --- a/tests/integration/double_vote.go +++ b/tests/integration/double_vote.go @@ -42,7 +42,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { equivocationEvidenceMinHeight := uint64(s.consumerCtx().BlockHeight() - 1) s.providerApp.GetProviderKeeper().SetEquivocationEvidenceMinHeight( s.providerCtx(), - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, equivocationEvidenceMinHeight, ) @@ -56,7 +56,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { s.consumerCtx().BlockTime(), consuValSet, consuSigner, - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, ) consuBadVote := testutil.MakeAndSignVote( @@ -65,7 +65,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { s.consumerCtx().BlockTime(), consuValSet, consuSigner, - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, ) // create two votes using the provider validator key @@ -75,7 +75,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { s.consumerCtx().BlockTime(), provValSet, provSigner, - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, ) provBadVote := testutil.MakeAndSignVote( @@ -84,7 +84,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { s.consumerCtx().BlockTime(), provValSet, provSigner, - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, ) // create two votes using the consumer validator key that both have @@ -95,7 +95,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { s.consumerCtx().BlockTime(), consuValSet, consuSigner, - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, ) consuVoteOld2 := testutil.MakeAndSignVote( @@ -104,15 +104,15 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { s.consumerCtx().BlockTime(), consuValSet, consuSigner, - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, ) testCases := []struct { - name string - ev *tmtypes.DuplicateVoteEvidence - chainID string - pubkey tmcrypto.PubKey - expPass bool + name string + ev *tmtypes.DuplicateVoteEvidence + consumerId string + pubkey tmcrypto.PubKey + expPass bool }{ { "cannot find consumer chain for the given chain ID - shouldn't pass", @@ -123,7 +123,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { TotalVotingPower: consuVal.VotingPower, Timestamp: s.consumerCtx().BlockTime(), }, - "chainID", + "consumerId", consuVal.PubKey, false, }, @@ -136,7 +136,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { TotalVotingPower: consuVal.VotingPower, Timestamp: s.consumerCtx().BlockTime(), }, - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, consuVal.PubKey, false, }, @@ -149,7 +149,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { TotalVotingPower: consuVal.VotingPower, Timestamp: s.consumerCtx().BlockTime(), }, - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, consuVal.PubKey, false, }, @@ -162,7 +162,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { TotalVotingPower: consuVal.VotingPower, Timestamp: s.consumerCtx().BlockTime(), }, - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, provVal.PubKey, false, }, @@ -176,7 +176,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { TotalVotingPower: consuVal.VotingPower, Timestamp: s.consumerCtx().BlockTime(), }, - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, consuVal.PubKey, false, }, @@ -193,7 +193,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { TotalVotingPower: consuVal.VotingPower, Timestamp: s.consumerCtx().BlockTime(), }, - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, consuVal.PubKey, true, }, @@ -207,7 +207,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { TotalVotingPower: consuVal.VotingPower, Timestamp: s.consumerCtx().BlockTime(), }, - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, provVal.PubKey, true, }, @@ -216,7 +216,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { for _, tc := range testCases { s.Run(tc.name, func() { consuAddr := types.NewConsumerConsAddress(sdk.ConsAddress(tc.ev.VoteA.ValidatorAddress.Bytes())) - provAddr := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.consumerChain.ChainID, consuAddr) + provAddr := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.getFirstBundle().ConsumerId, consuAddr) validator, _ := s.providerApp.GetTestStakingKeeper().GetValidator(s.providerCtx(), provAddr.ToSdkConsAddr().Bytes()) initialTokens := math.LegacyNewDecFromInt(validator.GetTokens()) @@ -228,7 +228,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { // we remove the consumer key assigned to the validator otherwise // HandleConsumerDoubleVoting uses the consumer key to verify the signature if tc.ev.VoteA.ValidatorAddress.String() != consuVal.Address.String() { - s.providerApp.GetProviderKeeper().DeleteKeyAssignments(provCtx, s.consumerChain.ChainID) + s.providerApp.GetProviderKeeper().DeleteKeyAssignments(provCtx, s.getFirstBundle().ConsumerId) } // convert validator public key @@ -237,8 +237,8 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVoting() { err = s.providerApp.GetProviderKeeper().HandleConsumerDoubleVoting( provCtx, + tc.consumerId, tc.ev, - tc.chainID, pk, ) @@ -296,7 +296,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVotingSlashesUndelegationsAndRele s.consumerCtx().BlockTime(), consuValSet, consuSigner, - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, ) consuBadVote := testutil.MakeAndSignVote( @@ -305,7 +305,7 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVotingSlashesUndelegationsAndRele s.consumerCtx().BlockTime(), consuValSet, consuSigner, - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, ) // In order to create an evidence for a consumer chain, @@ -320,14 +320,13 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVotingSlashesUndelegationsAndRele Timestamp: s.consumerCtx().BlockTime(), } - chainID := s.consumerChain.ChainID pubKey := consuVal.PubKey consuAddr := types.NewConsumerConsAddress(sdk.ConsAddress(consuVal.Address.Bytes())) - provAddr := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.consumerChain.ChainID, consuAddr) + provAddr := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.getFirstBundle().ConsumerId, consuAddr) consuAddr2 := types.NewConsumerConsAddress(sdk.ConsAddress(consuVal2.Address.Bytes())) - provAddr2 := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.consumerChain.ChainID, consuAddr2) + provAddr2 := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.getFirstBundle().ConsumerId, consuAddr2) validator, err := s.providerApp.GetTestStakingKeeper().GetValidator(s.providerCtx(), provAddr.ToSdkConsAddr().Bytes()) s.Require().NoError(err) @@ -392,8 +391,8 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVotingSlashesUndelegationsAndRele // cause double voting err = s.providerApp.GetProviderKeeper().HandleConsumerDoubleVoting( s.providerCtx(), + s.getFirstBundle().ConsumerId, evidence, - chainID, pk, ) s.Require().NoError(err) diff --git a/tests/integration/expired_client.go b/tests/integration/expired_client.go index 5a55c75079..259979e351 100644 --- a/tests/integration/expired_client.go +++ b/tests/integration/expired_client.go @@ -36,7 +36,7 @@ func (s *CCVTestSuite) TestVSCPacketSendExpiredClient() { s.nextEpoch() // check that the packet was added to the list of pending VSC packets - packets := providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID) + packets := providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.getFirstBundle().ConsumerId) s.Require().NotEmpty(packets, "no pending VSC packets found") s.Require().Equal(1, len(packets), "unexpected number of pending VSC packets") @@ -44,7 +44,7 @@ func (s *CCVTestSuite) TestVSCPacketSendExpiredClient() { s.nextEpoch() // check that the packet is still in the list of pending VSC packets - packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID) + packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.getFirstBundle().ConsumerId) s.Require().NotEmpty(packets, "no pending VSC packets found") s.Require().Equal(1, len(packets), "unexpected number of pending VSC packets") @@ -55,7 +55,7 @@ func (s *CCVTestSuite) TestVSCPacketSendExpiredClient() { s.nextEpoch() // check that the packets are still in the list of pending VSC packets - packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID) + packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.getFirstBundle().ConsumerId) s.Require().NotEmpty(packets, "no pending VSC packets found") s.Require().Equal(2, len(packets), "unexpected number of pending VSC packets") @@ -66,7 +66,7 @@ func (s *CCVTestSuite) TestVSCPacketSendExpiredClient() { s.nextEpoch() // check that the packets are not in the list of pending VSC packets - packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID) + packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.getFirstBundle().ConsumerId) s.Require().Empty(packets, "unexpected pending VSC packets found") // check that validator updates work @@ -105,7 +105,7 @@ func (s *CCVTestSuite) TestConsumerPacketSendExpiredClient() { s.nextEpoch() // check that the packets are not in the list of pending VSC packets - providerPackets := providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID) + providerPackets := providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.getFirstBundle().ConsumerId) s.Require().Empty(providerPackets, "pending VSC packets found") // relay all VSC packet from provider to consumer diff --git a/tests/integration/key_assignment.go b/tests/integration/key_assignment.go index c6478d98ba..73defc1b57 100644 --- a/tests/integration/key_assignment.go +++ b/tests/integration/key_assignment.go @@ -24,14 +24,14 @@ func (s *CCVTestSuite) TestKeyAssignment() { "assignment during channel init", func(pk *providerkeeper.Keeper) error { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } // check that a VSCPacket is queued s.nextEpoch() - pendingPackets := pk.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID) + pendingPackets := pk.GetPendingVSCPackets(s.providerCtx(), s.getFirstBundle().ConsumerId) s.Require().Len(pendingPackets, 1) // establish CCV channel @@ -47,7 +47,7 @@ func (s *CCVTestSuite) TestKeyAssignment() { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } @@ -63,7 +63,7 @@ func (s *CCVTestSuite) TestKeyAssignment() { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } @@ -85,14 +85,14 @@ func (s *CCVTestSuite) TestKeyAssignment() { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } // same key assignment, but different validator validator2, _ := generateNewConsumerKey(s, 1) - err = pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator2, consumerKey) + err = pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator2, consumerKey) if err != nil { return err } @@ -108,13 +108,13 @@ func (s *CCVTestSuite) TestKeyAssignment() { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } // same key assignment, but different validator - err = pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err = pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } @@ -130,14 +130,14 @@ func (s *CCVTestSuite) TestKeyAssignment() { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } // same key assignment validator, consumerKey = generateNewConsumerKey(s, 0) - err = pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err = pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } @@ -153,7 +153,7 @@ func (s *CCVTestSuite) TestKeyAssignment() { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } @@ -161,7 +161,7 @@ func (s *CCVTestSuite) TestKeyAssignment() { // same key assignment validator2, _ := generateNewConsumerKey(s, 1) - err = pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator2, consumerKey) + err = pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator2, consumerKey) if err != nil { return err } @@ -177,14 +177,14 @@ func (s *CCVTestSuite) TestKeyAssignment() { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } s.nextEpoch() // same key assignment - err = pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err = pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } @@ -200,7 +200,7 @@ func (s *CCVTestSuite) TestKeyAssignment() { // key assignment validator, consumerKey := generateNewConsumerKey(s, 0) - err := pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err := pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } @@ -208,7 +208,7 @@ func (s *CCVTestSuite) TestKeyAssignment() { // same key assignment validator, consumerKey = generateNewConsumerKey(s, 0) - err = pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey) + err = pk.AssignConsumerKey(s.providerCtx(), s.getFirstBundle().ConsumerId, validator, consumerKey) if err != nil { return err } diff --git a/tests/integration/misbehaviour.go b/tests/integration/misbehaviour.go index 5924c90df1..127b3a23a3 100644 --- a/tests/integration/misbehaviour.go +++ b/tests/integration/misbehaviour.go @@ -34,7 +34,7 @@ func (s *CCVTestSuite) TestHandleConsumerMisbehaviour() { misb := &ibctmtypes.Misbehaviour{ ClientId: s.path.EndpointA.ClientID, Header1: s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime, @@ -46,7 +46,7 @@ func (s *CCVTestSuite) TestHandleConsumerMisbehaviour() { // create a different header by changing the header timestamp only // in order to create an equivocation, i.e. both headers have the same deterministic states Header2: s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(10*time.Second), @@ -61,13 +61,13 @@ func (s *CCVTestSuite) TestHandleConsumerMisbehaviour() { validator, _ := s.getValByIdx(0) initialTokens := math.LegacyNewDecFromInt(validator.GetTokens()) - err := s.providerApp.GetProviderKeeper().HandleConsumerMisbehaviour(s.providerCtx(), *misb) + err := s.providerApp.GetProviderKeeper().HandleConsumerMisbehaviour(s.providerCtx(), s.getFirstBundle().ConsumerId, *misb) s.NoError(err) // verify that validators are jailed, tombstoned, and slashed for _, v := range clientTMValset.Validators { consuAddr := sdk.ConsAddress(v.Address.Bytes()) - provAddr := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.consumerChain.ChainID, types.NewConsumerConsAddress(consuAddr)) + provAddr := s.providerApp.GetProviderKeeper().GetProviderAddrFromConsumerAddr(s.providerCtx(), s.getFirstBundle().ConsumerId, types.NewConsumerConsAddress(consuAddr)) val, err := s.providerApp.GetTestStakingKeeper().GetValidatorByConsAddr(s.providerCtx(), provAddr.Address) s.Require().NoError(err) s.Require().True(val.Jailed) @@ -102,7 +102,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { // create a consumer client header clientHeader := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime, @@ -144,7 +144,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { "incorrect valset - shouldn't pass", func() *ibctmtypes.Misbehaviour { clientHeader := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(time.Minute), @@ -155,7 +155,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { ) clientHeaderWithCorruptedValset := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(time.Hour), @@ -181,7 +181,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { "incorrect valset 2 - shouldn't pass", func() *ibctmtypes.Misbehaviour { clientHeader := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(time.Minute), @@ -192,7 +192,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { ) clientHeaderWithCorruptedSigs := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(time.Hour), @@ -220,7 +220,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { "incorrect signatures - shouldn't pass", func() *ibctmtypes.Misbehaviour { clientHeader := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(time.Minute), @@ -231,7 +231,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { ) clientHeaderWithCorruptedSigs := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(time.Hour), @@ -262,7 +262,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { // the resulting header contains invalid fields // i.e. ValidatorsHash, NextValidatorsHash. Header2: s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime, @@ -286,7 +286,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { Header1: clientHeader, // the resulting header contains a different BlockID Header2: s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(time.Minute), @@ -308,7 +308,7 @@ func (s *CCVTestSuite) TestGetByzantineValidators() { // create a valid header with a different hash // and commit round amnesiaHeader := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, altTime.Add(time.Minute), @@ -383,7 +383,7 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() { // create a valid client header clientHeader := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, headerTs, @@ -402,7 +402,7 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() { // create a conflicting client with different block ID using // to alternative validator set clientHeaderWithDiffBlockID := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, headerTs, @@ -419,7 +419,7 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() { // create a conflicting client header with insufficient voting power clientHeaderWithInsufficientVotingPower := s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+1), clientHeight, // use a different block time to change the header BlockID @@ -434,7 +434,7 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() { equivocationEvidenceMinHeight := clientHeight.RevisionHeight + 1 s.providerApp.GetProviderKeeper().SetEquivocationEvidenceMinHeight( s.providerCtx(), - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, equivocationEvidenceMinHeight, ) @@ -485,7 +485,7 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() { ClientId: s.path.EndpointA.ClientID, Header1: clientHeader, Header2: s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(clientHeight.RevisionHeight+2), clientHeight, headerTs, @@ -502,7 +502,7 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() { &ibctmtypes.Misbehaviour{ ClientId: s.path.EndpointA.ClientID, Header1: s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(equivocationEvidenceMinHeight-1), clientHeight, headerTs, @@ -512,7 +512,7 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() { altSigners, ), Header2: s.consumerChain.CreateTMClientHeader( - s.consumerChain.ChainID, + s.getFirstBundle().Chain.ChainID, int64(equivocationEvidenceMinHeight-1), clientHeight, headerTs, @@ -547,7 +547,7 @@ func (s *CCVTestSuite) TestCheckMisbehaviour() { for _, tc := range testCases { s.Run(tc.name, func() { - err := s.providerApp.GetProviderKeeper().CheckMisbehaviour(s.providerCtx(), *tc.misbehaviour) + err := s.providerApp.GetProviderKeeper().CheckMisbehaviour(s.providerCtx(), s.getFirstBundle().ConsumerId, *tc.misbehaviour) cs, ok := s.providerApp.GetIBCKeeper().ClientKeeper.GetClientState(s.providerCtx(), s.path.EndpointA.ClientID) s.Require().True(ok) // verify that the client wasn't frozen diff --git a/tests/integration/partial_set_security_test.go b/tests/integration/partial_set_security_test.go index ebc6336fee..8f226cfe91 100644 --- a/tests/integration/partial_set_security_test.go +++ b/tests/integration/partial_set_security_test.go @@ -1,6 +1,7 @@ package integration import ( + "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" "slices" "sort" "testing" @@ -151,7 +152,9 @@ func TestMinStake(t *testing.T) { // adjust parameters // set the minStake according to the test case - providerKeeper.SetMinStake(s.providerChain.GetContext(), s.consumerChain.ChainID, tc.minStake) + providerKeeper.SetConsumerUpdateRecord(s.providerChain.GetContext(), s.getFirstBundle().ConsumerId, types.ConsumerUpdateRecord{ + MinStake: tc.minStake, + }) // delegate and undelegate to trigger a vscupdate diff --git a/tests/integration/setup.go b/tests/integration/setup.go index 11ce3eaf11..fa95d24eb5 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -3,6 +3,7 @@ package integration import ( "context" "fmt" + "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" "testing" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" @@ -21,7 +22,6 @@ import ( icstestingutils "github.com/cosmos/interchain-security/v5/testutil/ibc_testing" testutil "github.com/cosmos/interchain-security/v5/testutil/integration" consumertypes "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types" - "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v5/x/ccv/types" ) @@ -60,7 +60,7 @@ type CCVTestSuite struct { // The transfer path to the first consumer among multiple. transferPath *ibctesting.Path - // A map from consumer chain ID to its consumer bundle. + // A map from consumer id to its consumer bundle. // The preferred way to access chains, apps, and paths when designing tests around multiple consumers. consumerBundles map[string]*icstestingutils.ConsumerBundle skippedTests map[string]bool @@ -149,34 +149,28 @@ func (suite *CCVTestSuite) SetupTest() { // 1. the consumer chain is added to the coordinator // 2. MakeGenesis is called on the provider chain // 3. ibc/testing sets the tendermint header for the consumer chain app - providerKeeper.SetPendingConsumerAdditionProp(suite.providerCtx(), &types.ConsumerAdditionProposal{ - ChainId: icstestingutils.FirstConsumerChainID, - }) - ps := providerKeeper.GetAllPendingConsumerAdditionProps(suite.providerCtx()) - preProposalKeyAssignment(suite, icstestingutils.FirstConsumerChainID) - // remove props so they don't interfere with the rest of the setup - // if not removed here, setupConsumerCallback will have 2 proposals for adding the first consumer chain - providerKeeper.DeletePendingConsumerAdditionProps(suite.providerCtx(), ps...) + providerKeeper.SetConsumerPhase(suite.providerCtx(), icstestingutils.FirstConsumerId, keeper.Initialized) + preProposalKeyAssignment(suite, icstestingutils.FirstConsumerId) // start consumer chains suite.consumerBundles = make(map[string]*icstestingutils.ConsumerBundle) for i := 0; i < icstestingutils.NumConsumers; i++ { bundle := suite.setupConsumerCallback(&suite.Suite, suite.coordinator, i) - suite.consumerBundles[bundle.Chain.ChainID] = bundle + suite.consumerBundles[bundle.ConsumerId] = bundle suite.registerPacketSniffer(bundle.Chain) // check that TopN is correctly set for the consumer - topN := providerKeeper.GetTopN(suite.providerCtx(), bundle.Chain.ChainID) + topN := providerKeeper.GetTopN(suite.providerCtx(), bundle.ConsumerId) suite.Require().Equal(bundle.TopN, topN) } // initialize each consumer chain with it's corresponding genesis state // stored on the provider. - for chainID := range suite.consumerBundles { + for consumerId := range suite.consumerBundles { consumerGenesisState, found := providerKeeper.GetConsumerGenesis( suite.providerCtx(), - chainID, + consumerId, ) suite.Require().True(found, "consumer genesis not found") @@ -185,7 +179,7 @@ func (suite *CCVTestSuite) SetupTest() { Provider: consumerGenesisState.Provider, NewChain: consumerGenesisState.NewChain, } - initConsumerChain(suite, chainID, &genesisState) + initConsumerChain(suite, consumerId, &genesisState) } // try updating all clients @@ -220,11 +214,11 @@ func (s *CCVTestSuite) getSentPacket(chain *ibctesting.TestChain, sequence uint6 // initConsumerChain initializes a consumer chain given a genesis state func initConsumerChain( s *CCVTestSuite, - chainID string, + consumerId string, genesisState *consumertypes.GenesisState, ) { providerKeeper := s.providerApp.GetProviderKeeper() - bundle := s.consumerBundles[chainID] + bundle := s.consumerBundles[consumerId] // run CCV module init genesis s.NotPanics(func() { @@ -248,7 +242,7 @@ func initConsumerChain( // Set provider endpoint's clientID for each consumer providerEndpointClientID, found := providerKeeper.GetConsumerClientId( s.providerCtx(), - chainID, + consumerId, ) s.Require().True(found, "provider endpoint clientID not found") bundle.Path.EndpointB.ClientID = providerEndpointClientID @@ -290,7 +284,7 @@ func initConsumerChain( err = bundle.Path.EndpointA.UpdateClient() s.Require().NoError(err) - if chainID == icstestingutils.FirstConsumerChainID { + if consumerId == "2" { //icstestingutils.FirstConsumerId { // Support tests that were written before multiple consumers were supported. firstBundle := s.getFirstBundle() s.consumerApp = firstBundle.App @@ -378,14 +372,14 @@ func (suite *CCVTestSuite) SetupAllTransferChannels() { suite.SetupTransferChannel() // setup all the remaining consumers transfer channels - for chainID := range suite.consumerBundles { + for consumerId := range suite.consumerBundles { // skip fist consumer - if chainID == suite.consumerChain.ChainID { + if consumerId == suite.getFirstBundle().ConsumerId { continue } // get the bundle for the chain ID - bundle := suite.consumerBundles[chainID] + bundle := suite.consumerBundles[consumerId] // setup the transfer channel suite.setupTransferChannel( bundle.TransferPath, @@ -422,9 +416,9 @@ func (s CCVTestSuite) validateEndpointsClientConfig(consumerBundle icstestinguti } // preProposalKeyAssignment assigns keys to all provider validators for -// the consumer with chainID before the chain is registered, i.e., +// the consumer with consumerId before the chain is registered, i.e., // before a client to the consumer is created -func preProposalKeyAssignment(s *CCVTestSuite, chainID string) { +func preProposalKeyAssignment(s *CCVTestSuite, consumerId string) { providerKeeper := s.providerApp.GetProviderKeeper() for _, val := range s.providerChain.Vals.Validators { @@ -444,7 +438,7 @@ func preProposalKeyAssignment(s *CCVTestSuite, chainID string) { // as a result, NewTestChainWithValSet in AddConsumer uses providerChain.Signers s.providerChain.Signers[tmPubKey.Address().String()] = privVal - err = providerKeeper.AssignConsumerKey(s.providerCtx(), chainID, validator, consumerKey) + err = providerKeeper.AssignConsumerKey(s.providerCtx(), consumerId, validator, consumerKey) s.Require().NoError(err) } } diff --git a/tests/integration/slashing.go b/tests/integration/slashing.go index eab288deb3..8156672a0d 100644 --- a/tests/integration/slashing.go +++ b/tests/integration/slashing.go @@ -57,7 +57,7 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { // map consumer consensus address to provider consensus address providerConsAddr, found := providerKeeper.GetValidatorByConsumerAddr( s.providerCtx(), - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, consumerConsAddr, ) s.Require().True(found) @@ -188,7 +188,7 @@ func (s *CCVTestSuite) TestRelayAndApplyDoubleSignPacket() { // map consumer consensus address to provider consensus address providerConsAddr, found := providerKeeper.GetValidatorByConsumerAddr( s.providerCtx(), - s.consumerChain.ChainID, + s.getFirstBundle().ConsumerId, consumerConsAddr) s.Require().True(found) @@ -307,7 +307,7 @@ func (suite *CCVTestSuite) TestHandleSlashPacketDowntime() { suite.Require().Equal(stakingtypes.Bonded, validator.GetStatus()) // set init VSC id for chain0 - providerKeeper.SetInitChainHeight(suite.providerCtx(), suite.consumerChain.ChainID, uint64(suite.providerCtx().BlockHeight())) + providerKeeper.SetInitChainHeight(suite.providerCtx(), suite.getFirstBundle().ConsumerId, uint64(suite.providerCtx().BlockHeight())) // set validator signing-info providerSlashingKeeper.SetValidatorSigningInfo( @@ -316,7 +316,7 @@ func (suite *CCVTestSuite) TestHandleSlashPacketDowntime() { slashingtypes.ValidatorSigningInfo{Address: consAddr.String()}, ) - providerKeeper.HandleSlashPacket(suite.providerCtx(), suite.consumerChain.ChainID, + providerKeeper.HandleSlashPacket(suite.providerCtx(), suite.getFirstBundle().ConsumerId, *ccv.NewSlashPacketData( abci.Validator{Address: tmVal.Address, Power: 0}, uint64(0), @@ -413,7 +413,7 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { suite.Require().NoError(err, "no error expected") suite.Require().Equal(ccv.SlashPacketHandledResult, ackResult, "expected successful ack") - providerKeeper.SetConsumerValidator(ctx, firstBundle.Chain.ChainID, providertypes.ConsensusValidator{ + providerKeeper.SetConsumerValidator(ctx, firstBundle.ConsumerId, providertypes.ConsensusValidator{ ProviderConsAddr: validAddress, }) diff --git a/tests/integration/stop_consumer.go b/tests/integration/stop_consumer.go index 763aa30296..c296026e0a 100644 --- a/tests/integration/stop_consumer.go +++ b/tests/integration/stop_consumer.go @@ -75,8 +75,8 @@ func (s *CCVTestSuite) TestStopConsumerChain() { }, { func(suite *CCVTestSuite) error { - providerKeeper.SetSlashAcks(s.providerCtx(), firstBundle.Chain.ChainID, []string{"validator-1", "validator-2", "validator-3"}) - providerKeeper.AppendPendingVSCPackets(s.providerCtx(), firstBundle.Chain.ChainID, ccv.ValidatorSetChangePacketData{ValsetUpdateId: 1}) + providerKeeper.SetSlashAcks(s.providerCtx(), firstBundle.ConsumerId, []string{"validator-1", "validator-2", "validator-3"}) + providerKeeper.AppendPendingVSCPackets(s.providerCtx(), firstBundle.ConsumerId, ccv.ValidatorSetChangePacketData{ValsetUpdateId: 1}) return nil }, }, @@ -88,11 +88,11 @@ func (s *CCVTestSuite) TestStopConsumerChain() { } // stop the consumer chain - err = providerKeeper.StopConsumerChain(s.providerCtx(), firstBundle.Chain.ChainID, true) + err = providerKeeper.StopConsumerChain(s.providerCtx(), firstBundle.ConsumerId, true) s.Require().NoError(err) // check all states are removed and the unbonding operation released - s.checkConsumerChainIsRemoved(firstBundle.Chain.ChainID, true) + s.checkConsumerChainIsRemoved(firstBundle.ConsumerId, true) } // TODO Simon: implement OnChanCloseConfirm in IBC-GO testing to close the consumer chain's channel end @@ -105,7 +105,7 @@ func (s *CCVTestSuite) TestStopConsumerOnChannelClosed() { providerKeeper := s.providerApp.GetProviderKeeper() // stop the consumer chain - err := providerKeeper.StopConsumerChain(s.providerCtx(), s.consumerChain.ChainID, true) + err := providerKeeper.StopConsumerChain(s.providerCtx(), s.getFirstBundle().ConsumerId, true) s.Require().NoError(err) err = s.path.EndpointA.UpdateClient() @@ -126,7 +126,7 @@ func (s *CCVTestSuite) TestStopConsumerOnChannelClosed() { // s.Require().False(found) } -func (s *CCVTestSuite) checkConsumerChainIsRemoved(chainID string, checkChannel bool) { +func (s *CCVTestSuite) checkConsumerChainIsRemoved(consumerId string, checkChannel bool) { channelID := s.path.EndpointB.ChannelID providerKeeper := s.providerApp.GetProviderKeeper() @@ -136,18 +136,18 @@ func (s *CCVTestSuite) checkConsumerChainIsRemoved(chainID string, checkChannel } // verify consumer chain's states are removed - _, found := providerKeeper.GetConsumerGenesis(s.providerCtx(), chainID) + _, found := providerKeeper.GetConsumerGenesis(s.providerCtx(), consumerId) s.Require().False(found) - _, found = providerKeeper.GetConsumerClientId(s.providerCtx(), chainID) + _, found = providerKeeper.GetConsumerClientId(s.providerCtx(), consumerId) s.Require().False(found) - _, found = providerKeeper.GetConsumerIdToChannelId(s.providerCtx(), chainID) + _, found = providerKeeper.GetConsumerIdToChannelId(s.providerCtx(), consumerId) s.Require().False(found) _, found = providerKeeper.GetChannelIdToConsumerId(s.providerCtx(), channelID) s.Require().False(found) - s.Require().Nil(providerKeeper.GetSlashAcks(s.providerCtx(), chainID)) - s.Require().Zero(providerKeeper.GetInitChainHeight(s.providerCtx(), chainID)) - s.Require().Empty(providerKeeper.GetPendingVSCPackets(s.providerCtx(), chainID)) + s.Require().Nil(providerKeeper.GetSlashAcks(s.providerCtx(), consumerId)) + s.Require().Zero(providerKeeper.GetInitChainHeight(s.providerCtx(), consumerId)) + s.Require().Empty(providerKeeper.GetPendingVSCPackets(s.providerCtx(), consumerId)) } diff --git a/tests/mbt/driver/core.go b/tests/mbt/driver/core.go index 2cd618096f..8d0332f504 100644 --- a/tests/mbt/driver/core.go +++ b/tests/mbt/driver/core.go @@ -220,7 +220,7 @@ func (s *Driver) getStateString() string { state.WriteString("\n") state.WriteString("Consumers Chains:\n") - chainIds := s.providerKeeper().GetAllRegisteredConsumerChainIDs(s.providerCtx()) + chainIds := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) state.WriteString(strings.Join(chainIds, ", ")) state.WriteString("\n\n") @@ -258,7 +258,7 @@ func (s *Driver) getChainStateString(chain ChainId) string { if !s.isProviderChain(chain) { // Check whether the chain is in the consumer chains on the provider - consumerChainIDs := s.providerKeeper().GetAllRegisteredConsumerChainIDs(s.providerCtx()) + consumerChainIDs := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) found := false for _, consumerChainID := range consumerChainIDs { @@ -366,7 +366,7 @@ func (s *Driver) endAndBeginBlock(chain ChainId, timeAdvancement time.Duration) } func (s *Driver) runningConsumerChainIDs() []ChainId { - consumerIDsOnProvider := s.providerKeeper().GetAllRegisteredConsumerChainIDs(s.providerCtx()) + consumerIDsOnProvider := s.providerKeeper().GetAllRegisteredConsumerIds(s.providerCtx()) consumersWithIntactChannel := make([]ChainId, 0) for _, consumerChainID := range consumerIDsOnProvider { diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index 3aaae5702f..c5503ab811 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -3,6 +3,7 @@ package ibc_testing import ( "encoding/json" "fmt" + "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" "testing" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" @@ -37,7 +38,7 @@ const ( ) var ( - FirstConsumerChainID string + FirstConsumerId string provChainID string democConsumerChainID string consumerTopNParams [NumConsumers]uint32 @@ -46,7 +47,7 @@ var ( func init() { // Disable revision format ibctesting.ChainIDSuffix = "" - FirstConsumerChainID = ibctesting.GetChainID(2) + FirstConsumerId = "2" provChainID = ibctesting.GetChainID(1) democConsumerChainID = ibctesting.GetChainID(5000) // TopN parameter values per consumer chain initiated @@ -57,6 +58,7 @@ func init() { // ConsumerBundle serves as a way to store useful in-mem consumer app chain state // and relevant IBC paths in the context of CCV integration testing. type ConsumerBundle struct { + ConsumerId string Chain *ibctesting.TestChain App testutil.ConsumerApp Path *ibctesting.Path @@ -138,20 +140,26 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( providerApp := providerChain.App.(Tp) providerKeeper := providerApp.GetProviderKeeper() - prop := testkeeper.GetTestConsumerAdditionProp() - prop.ChainId = chainID - prop.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient + registrationRecord := testkeeper.GetTestRegistrationRecord() + registrationRecord.ChainId = chainID + initializationRecord := testkeeper.GetTestInitializationRecord() // NOTE: we cannot use the time.Now() because the coordinator chooses a hardcoded start time // using time.Now() could set the spawn time to be too far in the past or too far in the future - prop.SpawnTime = coordinator.CurrentTime + initializationRecord.SpawnTime = coordinator.CurrentTime // 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: 2} + initializationRecord.InitialHeight = clienttypes.Height{RevisionNumber: 0, RevisionHeight: 2} - providerKeeper.SetPendingConsumerAdditionProp(providerChain.GetContext(), prop) - props := providerKeeper.GetAllPendingConsumerAdditionProps(providerChain.GetContext()) - s.Require().Len(props, 1, "unexpected len consumer addition proposals in AddConsumer") + updateRecord := testkeeper.GetTestUpdateRecord() + updateRecord.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient + + consumerId := fmt.Sprintf("%d", index+2) + providerKeeper.SetConsumerRegistrationRecord(providerChain.GetContext(), consumerId, registrationRecord) + providerKeeper.SetConsumerInitializationRecord(providerChain.GetContext(), consumerId, initializationRecord) + providerKeeper.SetConsumerUpdateRecord(providerChain.GetContext(), consumerId, updateRecord) + providerKeeper.SetConsumerPhase(providerChain.GetContext(), consumerId, keeper.Initialized) + providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(providerChain.GetContext(), consumerId, coordinator.CurrentTime) // opt-in all validators lastVals, err := providerApp.GetProviderKeeper().GetLastBondedValidators(providerChain.GetContext()) @@ -159,7 +167,8 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( for _, v := range lastVals { consAddr, _ := v.GetConsAddr() - providerKeeper.SetOptedIn(providerChain.GetContext(), chainID, providertypes.NewProviderConsAddress(consAddr)) + providerKeeper.SetOptedIn(providerChain.GetContext(), consumerId, providertypes.NewProviderConsAddress(consAddr)) + providerKeeper.AppendOptedInConsumerId(providerChain.GetContext(), providertypes.NewProviderConsAddress(consAddr), consumerId) } // commit the state on the provider chain @@ -169,8 +178,14 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( // get genesis state created by the provider consumerGenesisState, found := providerKeeper.GetConsumerGenesis( providerChain.GetContext(), - chainID, + consumerId, + ) + + foo, found := providerKeeper.GetConsumerClientId( + providerChain.GetContext(), + consumerId, ) + _ = foo s.Require().True(found, "consumer genesis not found in AddConsumer") @@ -201,8 +216,9 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( } return &ConsumerBundle{ - Chain: testChain, - App: consumerToReturn, - TopN: prop.Top_N, + ConsumerId: consumerId, + Chain: testChain, + App: consumerToReturn, + TopN: updateRecord.Top_N, } } diff --git a/x/ccv/provider/handler_test.go b/x/ccv/provider/handler_test.go index 9c14efe91b..7ea306f47e 100644 --- a/x/ccv/provider/handler_test.go +++ b/x/ccv/provider/handler_test.go @@ -46,18 +46,16 @@ func TestAssignConsensusKeyMsgHandling(t *testing.T) { testCases := []struct { name string // State-mutating setup specific to this test case - setup func(sdk.Context, keeper.Keeper, testkeeper.MockedKeepers) - expError bool - chainID string + setup func(sdk.Context, keeper.Keeper, testkeeper.MockedKeepers) + expError bool + consumerId string }{ { name: "success", setup: func(ctx sdk.Context, k keeper.Keeper, mocks testkeeper.MockedKeepers, ) { - k.SetPendingConsumerAdditionProp(ctx, &providertypes.ConsumerAdditionProposal{ - ChainId: "chainid", - }) + k.SetConsumerPhase(ctx, "consumerId", keeper.Initialized) gomock.InOrder( mocks.MockStakingKeeper.EXPECT().GetValidator( ctx, providerCryptoId.SDKValOpAddress(), @@ -67,11 +65,11 @@ func TestAssignConsensusKeyMsgHandling(t *testing.T) { ).Return(stakingtypes.Validator{}, stakingtypes.ErrNoValidatorFound), ) }, - expError: false, - chainID: "chainid", + expError: false, + consumerId: "consumerId", }, { - name: "fail: chain ID not registered", + name: "fail: consumer id does not correspond to a registered chain", setup: func(ctx sdk.Context, k keeper.Keeper, mocks testkeeper.MockedKeepers, ) { @@ -82,36 +80,33 @@ func TestAssignConsensusKeyMsgHandling(t *testing.T) { ).Return(providerCryptoId.SDKStakingValidator(), nil).Times(1), ) }, - expError: true, - chainID: "chainid", + expError: true, + consumerId: "consumerId", }, { name: "fail: missing validator", setup: func(ctx sdk.Context, k keeper.Keeper, mocks testkeeper.MockedKeepers, ) { - k.SetPendingConsumerAdditionProp(ctx, &providertypes.ConsumerAdditionProposal{ - ChainId: "chainid", - }) + k.SetConsumerPhase(ctx, "consumerId", keeper.Initialized) gomock.InOrder( mocks.MockStakingKeeper.EXPECT().GetValidator( ctx, providerCryptoId.SDKValOpAddress(), ).Return(stakingtypes.Validator{}, stakingtypes.ErrNoValidatorFound).Times(1), ) }, - expError: true, - chainID: "chainid", + expError: true, + consumerId: "consumerId", }, { name: "fail: consumer key in use by other validator", setup: func(ctx sdk.Context, k keeper.Keeper, mocks testkeeper.MockedKeepers, ) { - k.SetPendingConsumerAdditionProp(ctx, &providertypes.ConsumerAdditionProposal{ - ChainId: "chainid", - }) + k.SetConsumerPhase(ctx, "consumerId", keeper.Initialized) + // Use the consumer key already used by some other validator - k.SetValidatorByConsumerAddr(ctx, "chainid", consumerConsAddr, providerConsAddr2) + k.SetValidatorByConsumerAddr(ctx, "consumerId", consumerConsAddr, providerConsAddr2) gomock.InOrder( mocks.MockStakingKeeper.EXPECT().GetValidator( @@ -124,19 +119,18 @@ func TestAssignConsensusKeyMsgHandling(t *testing.T) { ).Return(stakingtypes.Validator{}, nil), ) }, - expError: true, - chainID: "chainid", + expError: true, + consumerId: "consumerId", }, { name: "fail: consumer key in use by the same validator", setup: func(ctx sdk.Context, k keeper.Keeper, mocks testkeeper.MockedKeepers, ) { - k.SetPendingConsumerAdditionProp(ctx, &providertypes.ConsumerAdditionProposal{ - ChainId: "chainid", - }) + k.SetConsumerPhase(ctx, "consumerId", keeper.Initialized) + // Use the consumer key already - k.SetValidatorByConsumerAddr(ctx, "chainid", consumerConsAddr, providerConsAddr) + k.SetValidatorByConsumerAddr(ctx, "consumerId", consumerConsAddr, providerConsAddr) gomock.InOrder( mocks.MockStakingKeeper.EXPECT().GetValidator( @@ -147,20 +141,18 @@ func TestAssignConsensusKeyMsgHandling(t *testing.T) { ).Return(stakingtypes.Validator{}, stakingtypes.ErrNoValidatorFound), ) }, - expError: true, - chainID: "chainid", + expError: true, + consumerId: "consumerId", }, { name: "fail: consumer key in use by other validator", setup: func(ctx sdk.Context, k keeper.Keeper, mocks testkeeper.MockedKeepers, ) { - k.SetPendingConsumerAdditionProp(ctx, &providertypes.ConsumerAdditionProposal{ - ChainId: "chainid", - }) + k.SetConsumerPhase(ctx, "consumerId", keeper.Initialized) // Use the consumer key already used by some other validator - k.SetValidatorByConsumerAddr(ctx, "chainid", consumerConsAddr, providerConsAddr2) + k.SetValidatorByConsumerAddr(ctx, "consumerId", consumerConsAddr, providerConsAddr2) gomock.InOrder( mocks.MockStakingKeeper.EXPECT().GetValidator( @@ -173,8 +165,8 @@ func TestAssignConsensusKeyMsgHandling(t *testing.T) { ).Return(stakingtypes.Validator{}, stakingtypes.ErrNoValidatorFound), ) }, - expError: true, - chainID: "chainid", + expError: true, + consumerId: "consumerId", }, } @@ -184,7 +176,7 @@ func TestAssignConsensusKeyMsgHandling(t *testing.T) { tc.setup(ctx, k, mocks) - msg, err := providertypes.NewMsgAssignConsumerKey(tc.chainID, + msg, err := providertypes.NewMsgAssignConsumerKey(tc.consumerId, providerCryptoId.SDKValOpAddress(), consumerKey, providerCryptoId.SDKStakingValidator().OperatorAddress, ) diff --git a/x/ccv/provider/ibc_middleware.go b/x/ccv/provider/ibc_middleware.go index d9d816ab93..3872fd5fbe 100644 --- a/x/ccv/provider/ibc_middleware.go +++ b/x/ccv/provider/ibc_middleware.go @@ -122,7 +122,7 @@ func (im IBCMiddleware) OnRecvPacket( // deserialized without checking errors. if ack.Success() { // execute the middleware logic only if the sender is a consumer chain - consumerID, err := im.keeper.IdentifyConsumerChainIDFromIBCPacket(ctx, packet) + consumerId, err := im.keeper.IdentifyConsumerIdFromIBCPacket(ctx, packet) if err != nil { return ack } @@ -144,13 +144,13 @@ func (im IBCMiddleware) OnRecvPacket( // and if so, adds it to the consumer chain rewards allocation, // otherwise the prohibited coin just stays in the pool forever. if im.keeper.ConsumerRewardDenomExists(ctx, coinDenom) { - alloc := im.keeper.GetConsumerRewardsAllocation(ctx, consumerID) + alloc := im.keeper.GetConsumerRewardsAllocation(ctx, consumerId) alloc.Rewards = alloc.Rewards.Add( sdk.NewDecCoinsFromCoins(sdk.Coin{ Denom: coinDenom, Amount: coinAmt, })...) - im.keeper.SetConsumerRewardsAllocation(ctx, consumerID, alloc) + im.keeper.SetConsumerRewardsAllocation(ctx, consumerId, alloc) } } diff --git a/x/ccv/provider/ibc_module_test.go b/x/ccv/provider/ibc_module_test.go index 49ddb2901b..2d778daf00 100644 --- a/x/ccv/provider/ibc_module_test.go +++ b/x/ccv/provider/ibc_module_test.go @@ -96,8 +96,8 @@ func TestOnChanOpenTry(t *testing.T) { "unexpected client ID mapped to chain ID", func(params *params, keeper *providerkeeper.Keeper) { keeper.SetConsumerClientId( params.ctx, - "consumerChainID", - "invalidClientID", + "consumerId", + "invalidClientId", ) }, false, }, @@ -106,7 +106,7 @@ func TestOnChanOpenTry(t *testing.T) { func(params *params, keeper *providerkeeper.Keeper) { keeper.SetConsumerIdToChannelId( params.ctx, - "consumerChainID", + "consumerId", "some existing channel ID", ) }, false, @@ -122,7 +122,8 @@ func TestOnChanOpenTry(t *testing.T) { providerModule := provider.NewAppModule(&providerKeeper, *keeperParams.ParamsSubspace, keeperParams.StoreKey) providerKeeper.SetPort(ctx, ccv.ProviderPortID) - providerKeeper.SetConsumerClientId(ctx, "consumerChainID", "clientIDToConsumer") + providerKeeper.SetConsumerClientId(ctx, "consumerId", "clientIdToConsumer") + providerKeeper.SetClientIdToConsumerId(ctx, "clientIdToConsumer", "consumerId") // Instantiate valid params as default. Individual test cases mutate these as needed. params := params{ @@ -145,9 +146,9 @@ func TestOnChanOpenTry(t *testing.T) { mocks.MockScopedKeeper.EXPECT().ClaimCapability( params.ctx, params.chanCap, host.ChannelCapabilityPath(params.portID, params.channelID)).AnyTimes(), mocks.MockConnectionKeeper.EXPECT().GetConnection(ctx, "connectionIDToConsumer").Return( - conntypes.ConnectionEnd{ClientId: "clientIDToConsumer"}, true, + conntypes.ConnectionEnd{ClientId: "clientIdToConsumer"}, true, ).AnyTimes(), - mocks.MockClientKeeper.EXPECT().GetClientState(ctx, "clientIDToConsumer").Return( + mocks.MockClientKeeper.EXPECT().GetClientState(ctx, "clientIdToConsumer").Return( &ibctmtypes.ClientState{ChainId: "consumerChainID"}, true, ).AnyTimes(), mocks.MockAccountKeeper.EXPECT().GetModuleAccount(ctx, providertypes.ConsumerRewardsPool).Return(&moduleAcct).AnyTimes(), @@ -170,13 +171,13 @@ func TestOnChanOpenTry(t *testing.T) { require.NoError(t, err) md := &ccv.HandshakeMetadata{} err = md.Unmarshal([]byte(metadata)) - require.NoError(t, err) + require.NoError(t, err, tc.name) require.Equal(t, moduleAcct.BaseAccount.Address, md.ProviderFeePoolAddr, "returned dist account metadata must match expected") require.Equal(t, ccv.Version, md.Version, "returned ccv version metadata must match expected") ctrl.Finish() } else { - require.Error(t, err) + require.Error(t, err, tc.name) } } } diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index d0d99dd0ab..13698cde32 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -75,7 +75,7 @@ func (k Keeper) AllocateTokens(ctx sdk.Context) { } // Iterate over all registered consumer chains - for _, consumerChainID := range k.GetAllRegisteredConsumerChainIDs(ctx) { + for _, consumerChainID := range k.GetAllRegisteredConsumerIds(ctx) { // note that it's possible that no rewards are collected even though the // reward pool isn't empty. This can happen if the reward pool holds some tokens @@ -304,9 +304,9 @@ func (k Keeper) ComputeConsumerTotalVotingPower(ctx sdk.Context, consumerId stri return } -// IdentifyConsumerChainIDFromIBCPacket checks if the packet destination matches a registered consumer chain. +// IdentifyConsumerIdFromIBCPacket checks if the packet destination matches a registered consumer chain. // If so, it returns the consumer chain ID, otherwise an error. -func (k Keeper) IdentifyConsumerChainIDFromIBCPacket(ctx sdk.Context, packet channeltypes.Packet) (string, error) { +func (k Keeper) IdentifyConsumerIdFromIBCPacket(ctx sdk.Context, packet channeltypes.Packet) (string, error) { channel, ok := k.channelKeeper.GetChannel(ctx, packet.DestinationPort, packet.DestinationChannel) if !ok { return "", errorsmod.Wrapf(channeltypes.ErrChannelNotFound, "channel not found for channel ID: %s", packet.DestinationChannel) @@ -315,17 +315,21 @@ func (k Keeper) IdentifyConsumerChainIDFromIBCPacket(ctx sdk.Context, packet cha return "", errorsmod.Wrap(channeltypes.ErrTooManyConnectionHops, "must have direct connection to consumer chain") } connectionID := channel.ConnectionHops[0] - _, tmClient, err := k.getUnderlyingClient(ctx, connectionID) + clientId, _, err := k.getUnderlyingClient(ctx, connectionID) if err != nil { return "", err } - chainID := tmClient.ChainId - if _, ok := k.GetConsumerIdToChannelId(ctx, chainID); !ok { - return "", errorsmod.Wrapf(types.ErrUnknownConsumerChannelId, "no CCV channel found for chain with ID: %s", chainID) + consumerId, found := k.GetClientIdToConsumerId(ctx, clientId) + if !found { + return "", errorsmod.Wrapf(types.ErrUnknownConsumerId, "no consumer id for client with id: %s", clientId) } - return chainID, nil + if _, ok := k.GetConsumerIdToChannelId(ctx, consumerId); !ok { + return "", errorsmod.Wrapf(types.ErrUnknownConsumerChannelId, "no CCV channel found for chain with ID: %s", consumerId) + } + + return consumerId, nil } // HandleSetConsumerCommissionRate sets a per-consumer chain commission rate for the given provider address diff --git a/x/ccv/provider/keeper/distribution_test.go b/x/ccv/provider/keeper/distribution_test.go index 624febc22b..57ff82bc95 100644 --- a/x/ccv/provider/keeper/distribution_test.go +++ b/x/ccv/provider/keeper/distribution_test.go @@ -225,7 +225,7 @@ func TestIdentifyConsumerChainIDFromIBCPacket(t *testing.T) { defer ctrl.Finish() tc.expectedCalls(ctx, mocks, tc.packet) - _, err := keeper.IdentifyConsumerChainIDFromIBCPacket( + _, err := keeper.IdentifyConsumerIdFromIBCPacket( ctx, tc.packet, ) diff --git a/x/ccv/provider/keeper/genesis.go b/x/ccv/provider/keeper/genesis.go index cc284448a6..0c01cef1e9 100644 --- a/x/ccv/provider/keeper/genesis.go +++ b/x/ccv/provider/keeper/genesis.go @@ -129,45 +129,45 @@ func (k Keeper) InitGenesisValUpdates(ctx sdk.Context) []abci.ValidatorUpdate { // ExportGenesis returns the CCV provider module's exported genesis func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { // get a list of all registered consumer chains - registeredChainIDs := k.GetAllRegisteredConsumerChainIDs(ctx) + registeredConsumerIds := k.GetAllRegisteredConsumerIds(ctx) // export states for each consumer chains var consumerStates []types.ConsumerState - for _, chainID := range registeredChainIDs { + for _, consumerId := range registeredConsumerIds { // no need for the second return value of GetConsumerClientId - // as GetAllRegisteredConsumerChainIDs already iterated through + // as GetAllRegisteredConsumerIds already iterated through // the entire prefix range - clientID, _ := k.GetConsumerClientId(ctx, chainID) - gen, found := k.GetConsumerGenesis(ctx, chainID) + clientId, _ := k.GetConsumerClientId(ctx, consumerId) + gen, found := k.GetConsumerGenesis(ctx, consumerId) if !found { - panic(fmt.Errorf("cannot find genesis for consumer chain %s with client %s", chainID, clientID)) + panic(fmt.Errorf("cannot find genesis for consumer chain %s with client %s", consumerId, clientId)) } // initial consumer chain states cs := types.ConsumerState{ - ChainId: chainID, - ClientId: clientID, + ChainId: consumerId, + ClientId: clientId, ConsumerGenesis: gen, } // try to find channel id for the current consumer chain - channelId, found := k.GetConsumerIdToChannelId(ctx, chainID) + channelId, found := k.GetConsumerIdToChannelId(ctx, consumerId) if found { cs.ChannelId = channelId - cs.InitialHeight, found = k.GetInitChainHeight(ctx, chainID) + cs.InitialHeight, found = k.GetInitChainHeight(ctx, consumerId) if !found { - panic(fmt.Errorf("cannot find init height for consumer chain %s", chainID)) + panic(fmt.Errorf("cannot find init height for consumer chain %s", consumerId)) } - cs.SlashDowntimeAck = k.GetSlashAcks(ctx, chainID) + cs.SlashDowntimeAck = k.GetSlashAcks(ctx, consumerId) } - cs.PendingValsetChanges = k.GetPendingVSCPackets(ctx, chainID) + cs.PendingValsetChanges = k.GetPendingVSCPackets(ctx, consumerId) consumerStates = append(consumerStates, cs) } // ConsumerAddrsToPrune are added only for registered consumer chains consumerAddrsToPrune := []types.ConsumerAddrsToPruneV2{} - for _, chainID := range registeredChainIDs { + for _, chainID := range registeredConsumerIds { consumerAddrsToPrune = append(consumerAddrsToPrune, k.GetAllConsumerAddrsToPrune(ctx, chainID)...) } diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 98d6171233..1619c253d2 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -49,7 +49,7 @@ func (k Keeper) QueryConsumerChains(goCtx context.Context, req *types.QueryConsu ctx := sdk.UnwrapSDKContext(goCtx) chains := []*types.Chain{} - for _, chainID := range k.GetAllRegisteredConsumerChainIDs(ctx) { + for _, chainID := range k.GetAllRegisteredConsumerIds(ctx) { c, err := k.GetConsumerChain(ctx, chainID) if err != nil { return nil, status.Error(codes.Internal, err.Error()) @@ -389,7 +389,7 @@ func (k Keeper) QueryConsumerChainsValidatorHasToValidate(goCtx context.Context, // 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 _, consumerChainID := range k.GetAllRegisteredConsumerChainIDs(ctx) { + for _, consumerChainID := range k.GetAllRegisteredConsumerIds(ctx) { if hasToValidate, err := k.hasToValidate(ctx, provAddr, consumerChainID); err == nil && hasToValidate { consumersToValidate = append(consumersToValidate, consumerChainID) } diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index d6af0bde0a..b5def5cfe6 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -270,14 +270,14 @@ func (k Keeper) GetAllPendingConsumerChainIDs(ctx sdk.Context) []string { return chainIDs } -// GetAllRegisteredConsumerChainIDs gets all of the consumer chain IDs, for which the provider module +// GetAllRegisteredConsumerIds gets all of the consumer chain IDs, for which the provider module // created IBC clients. Consumer chains with created clients are also referred to as registered. // // Note that the registered consumer chains are stored under keys with the following format: // ConsumerIdToClientIdKeyPrefix | consumerId // Thus, the returned array is in ascending order of chainIDs. -func (k Keeper) GetAllRegisteredConsumerChainIDs(ctx sdk.Context) []string { - chainIDs := []string{} +func (k Keeper) GetAllRegisteredConsumerIds(ctx sdk.Context) []string { + consumerIds := []string{} store := ctx.KVStore(k.storeKey) iterator := storetypes.KVStorePrefixIterator(store, types.ConsumerIdToClientIdKeyPrefix()) @@ -285,11 +285,11 @@ func (k Keeper) GetAllRegisteredConsumerChainIDs(ctx sdk.Context) []string { for ; iterator.Valid(); iterator.Next() { // remove 1 byte prefix from key to retrieve consumerId - chainID := string(iterator.Key()[1:]) - chainIDs = append(chainIDs, chainID) + consumerId := string(iterator.Key()[1:]) + consumerIds = append(consumerIds, consumerId) } - return chainIDs + return consumerIds } // SetChannelToConsumerId sets the mapping from the CCV channel id to the consumer id. @@ -385,21 +385,26 @@ func (k Keeper) VerifyConsumerChain(ctx sdk.Context, channelID string, connectio return errorsmod.Wrap(channeltypes.ErrTooManyConnectionHops, "must have direct connection to provider chain") } connectionID := connectionHops[0] - clientID, tmClient, err := k.getUnderlyingClient(ctx, connectionID) + clientId, _, err := k.getUnderlyingClient(ctx, connectionID) if err != nil { return err } - ccvClientId, found := k.GetConsumerClientId(ctx, tmClient.ChainId) + + consumerId, found := k.GetClientIdToConsumerId(ctx, clientId) + if !found { + return errorsmod.Wrapf(ccv.ErrConsumerChainNotFound, "cannot find consumer id associated with client id: %s", clientId) + } + ccvClientId, found := k.GetConsumerClientId(ctx, consumerId) if !found { - return errorsmod.Wrapf(ccv.ErrClientNotFound, "cannot find client for consumer chain %s", tmClient.ChainId) + return errorsmod.Wrapf(ccv.ErrClientNotFound, "cannot find client for consumer chain %s", consumerId) } - if ccvClientId != clientID { - return errorsmod.Wrapf(types.ErrInvalidConsumerClient, "CCV channel must be built on top of CCV client. expected %s, got %s", ccvClientId, clientID) + if ccvClientId != clientId { + return errorsmod.Wrapf(types.ErrInvalidConsumerClient, "CCV channel must be built on top of CCV client. expected %s, got %s", ccvClientId, clientId) } // Verify that there isn't already a CCV channel for the consumer chain - if prevChannel, ok := k.GetConsumerIdToChannelId(ctx, tmClient.ChainId); ok { - return errorsmod.Wrapf(ccv.ErrDuplicateChannel, "CCV channel with ID: %s already created for consumer chain %s", prevChannel, tmClient.ChainId) + if prevChannel, ok := k.GetConsumerIdToChannelId(ctx, consumerId); ok { + return errorsmod.Wrapf(ccv.ErrDuplicateChannel, "CCV channel with ID: %s already created for consumer chain %s", prevChannel, consumerId) } return nil } @@ -740,7 +745,7 @@ func (k Keeper) BondDenom(ctx sdk.Context) (string, error) { func (k Keeper) GetAllRegisteredAndProposedChainIDs(ctx sdk.Context) []string { allConsumerChains := []string{} - allConsumerChains = append(allConsumerChains, k.GetAllRegisteredConsumerChainIDs(ctx)...) + allConsumerChains = append(allConsumerChains, k.GetAllRegisteredConsumerIds(ctx)...) proposedChains := k.GetAllProposedConsumerChainIDs(ctx) for _, proposedChain := range proposedChains { allConsumerChains = append(allConsumerChains, proposedChain.ChainID) diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 2032eb8b27..5f0ad1eccb 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -229,7 +229,7 @@ func TestGetAllRegisteredConsumerChainIDs(t *testing.T) { defer ctrl.Finish() chainIDs := []string{"chain-2", "chain-1", "chain-4", "chain-3"} - // GetAllRegisteredConsumerChainIDs iterates over consumerId in lexicographical order + // GetAllRegisteredConsumerIds iterates over consumerId in lexicographical order expectedChainIDs := []string{"chain-1", "chain-2", "chain-3", "chain-4"} for i, chainID := range chainIDs { @@ -237,7 +237,7 @@ func TestGetAllRegisteredConsumerChainIDs(t *testing.T) { pk.SetConsumerClientId(ctx, chainID, clientID) } - result := pk.GetAllRegisteredConsumerChainIDs(ctx) + result := pk.GetAllRegisteredConsumerIds(ctx) require.Len(t, result, len(chainIDs)) require.Equal(t, expectedChainIDs, result) } diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index 77f07498b0..99a2702a64 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -403,9 +403,9 @@ func (k Keeper) AssignConsumerKey( validator stakingtypes.Validator, consumerKey tmprotocrypto.PublicKey, ) error { - // check that the consumer chain is either registered or that - // a ConsumerAdditionProposal was submitted. - if !k.IsConsumerProposedOrRegistered(ctx, consumerId) { + phase, found := k.GetConsumerPhase(ctx, consumerId) + if !found || (phase != Registered && phase != Initialized && phase != Launched) { + //check that the consumer chain is either registered, initialized, or launched return errorsmod.Wrapf( types.ErrUnknownConsumerId, consumerId, ) @@ -459,9 +459,8 @@ func (k Keeper) AssignConsumerKey( } oldConsumerAddr := types.NewConsumerConsAddress(oldConsumerAddrTmp) - // check whether the consumer chain is already registered, - // i.e., a client to the consumer was already created - if _, consumerRegistered := k.GetConsumerClientId(ctx, consumerId); consumerRegistered { + // check whether the consumer chain has already launched (i.e., a client to the consumer was already created) + if phase == Launched { // mark the old consumer address as prunable once UnbondingPeriod elapses; // note: this state is removed on EndBlock unbondingPeriod, err := k.stakingKeeper.UnbondingTime(ctx) diff --git a/x/ccv/provider/keeper/key_assignment_test.go b/x/ccv/provider/keeper/key_assignment_test.go index 6068c8224d..eb9cef9fca 100644 --- a/x/ccv/provider/keeper/key_assignment_test.go +++ b/x/ccv/provider/keeper/key_assignment_test.go @@ -342,7 +342,7 @@ func checkCorrectPruningProperty(ctx sdk.Context, k providerkeeper.Keeper, chain } func TestAssignConsensusKeyForConsumerChain(t *testing.T) { - chainID := ChainID + consumerId := "0" providerIdentities := []*cryptotestutil.CryptoIdentity{ cryptotestutil.NewCryptoIdentityFromIntSeed(0), cryptotestutil.NewCryptoIdentityFromIntSeed(1), @@ -359,26 +359,26 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { doActions func(sdk.Context, providerkeeper.Keeper) }{ /* - 0. Consumer not registered: Assign PK0->CK0 and error - 1. Consumer registered: Assign PK0->CK0 and retrieve PK0->CK0 - 2. Consumer registered: Assign PK0->CK0, PK0->CK1 and retrieve PK0->CK1 - 3. Consumer registered: Assign PK0->CK0, PK1->CK0 and error - 4. Consumer registered: Assign PK1->PK0 and error - 5. Consumer proposed: Assign Assign PK0->CK0 and retrieve PK0->CK0 - 6. Consumer proposed: Assign PK0->CK0, PK0->CK1 and retrieve PK0->CK1 - 7. Consumer proposed: Assign PK0->CK0, PK1->CK0 and error - 8. Consumer proposed: Assign PK1->PK0 and error + 0. Consumer not in the right phase: Assign PK0->CK0 and error + 1. Consumer launched: Assign PK0->CK0 and retrieve PK0->CK0 + 2. Consumer launched: Assign PK0->CK0, PK0->CK1 and retrieve PK0->CK1 + 3. Consumer launched: Assign PK0->CK0, PK1->CK0 and error + 4. Consumer launched: Assign PK1->PK0 and error + 5. Consumer registered: Assign PK0->CK0 and retrieve PK0->CK0 + 6. Consumer registered: Assign PK0->CK0, PK0->CK1 and retrieve PK0->CK1 + 7. Consumer registered: Assign PK0->CK0, PK1->CK0 and error + 8. Consumer registered: Assign PK1->PK0 and error */ { name: "0", mockSetup: func(ctx sdk.Context, k providerkeeper.Keeper, mocks testkeeper.MockedKeepers) {}, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - err := k.AssignConsumerKey(ctx, chainID, + err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.Error(t, err) - _, found := k.GetValidatorByConsumerAddr(ctx, chainID, + _, found := k.GetValidatorByConsumerAddr(ctx, consumerId, consumerIdentities[0].ConsumerConsAddress()) require.False(t, found) }, @@ -393,13 +393,13 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerClientId(ctx, chainID, "") - err := k.AssignConsumerKey(ctx, chainID, + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Launched) + err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.NoError(t, err) - providerAddr, found := k.GetValidatorByConsumerAddr(ctx, chainID, + providerAddr, found := k.GetValidatorByConsumerAddr(ctx, consumerId, consumerIdentities[0].ConsumerConsAddress()) require.True(t, found) require.Equal(t, providerIdentities[0].ProviderConsAddress(), providerAddr) @@ -420,18 +420,18 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(sdkCtx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerClientId(sdkCtx, chainID, "") - err := k.AssignConsumerKey(sdkCtx, chainID, + k.SetConsumerPhase(sdkCtx, consumerId, providerkeeper.Launched) + err := k.AssignConsumerKey(sdkCtx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.NoError(t, err) - err = k.AssignConsumerKey(sdkCtx, chainID, + err = k.AssignConsumerKey(sdkCtx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[1].TMProtoCryptoPublicKey(), ) require.NoError(t, err) - providerAddr, found := k.GetValidatorByConsumerAddr(sdkCtx, chainID, + providerAddr, found := k.GetValidatorByConsumerAddr(sdkCtx, consumerId, consumerIdentities[1].ConsumerConsAddress()) require.True(t, found) require.Equal(t, providerIdentities[0].ProviderConsAddress(), providerAddr) @@ -450,18 +450,18 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerClientId(ctx, chainID, "") - err := k.AssignConsumerKey(ctx, chainID, + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Launched) + err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.NoError(t, err) - err = k.AssignConsumerKey(ctx, chainID, + err = k.AssignConsumerKey(ctx, consumerId, providerIdentities[1].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.Error(t, err) - providerAddr, found := k.GetValidatorByConsumerAddr(ctx, chainID, + providerAddr, found := k.GetValidatorByConsumerAddr(ctx, consumerId, consumerIdentities[0].ConsumerConsAddress()) require.True(t, found) require.Equal(t, providerIdentities[0].ProviderConsAddress(), providerAddr) @@ -477,8 +477,8 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerClientId(ctx, chainID, "") - err := k.AssignConsumerKey(ctx, chainID, + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Launched) + err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[1].SDKStakingValidator(), providerIdentities[0].TMProtoCryptoPublicKey(), ) @@ -495,13 +495,13 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetProposedConsumerChain(ctx, chainID, 0) - err := k.AssignConsumerKey(ctx, chainID, + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Registered) + err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.NoError(t, err) - providerAddr, found := k.GetValidatorByConsumerAddr(ctx, chainID, + providerAddr, found := k.GetValidatorByConsumerAddr(ctx, consumerId, consumerIdentities[0].ConsumerConsAddress()) require.True(t, found) require.Equal(t, providerIdentities[0].ProviderConsAddress(), providerAddr) @@ -520,18 +520,18 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetProposedConsumerChain(ctx, chainID, 0) - err := k.AssignConsumerKey(ctx, chainID, + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Registered) + err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.NoError(t, err) - err = k.AssignConsumerKey(ctx, chainID, + err = k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[1].TMProtoCryptoPublicKey(), ) require.NoError(t, err) - providerAddr, found := k.GetValidatorByConsumerAddr(ctx, chainID, + providerAddr, found := k.GetValidatorByConsumerAddr(ctx, consumerId, consumerIdentities[1].ConsumerConsAddress()) require.True(t, found) require.Equal(t, providerIdentities[0].ProviderConsAddress(), providerAddr) @@ -550,18 +550,18 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetProposedConsumerChain(ctx, chainID, 0) - err := k.AssignConsumerKey(ctx, chainID, + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Registered) + err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.NoError(t, err) - err = k.AssignConsumerKey(ctx, chainID, + err = k.AssignConsumerKey(ctx, consumerId, providerIdentities[1].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), ) require.Error(t, err) - providerAddr, found := k.GetValidatorByConsumerAddr(ctx, chainID, + providerAddr, found := k.GetValidatorByConsumerAddr(ctx, consumerId, consumerIdentities[0].ConsumerConsAddress()) require.True(t, found) require.Equal(t, providerIdentities[0].ProviderConsAddress(), providerAddr) @@ -577,8 +577,8 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetProposedConsumerChain(ctx, chainID, 0) - err := k.AssignConsumerKey(ctx, chainID, + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Registered) + err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[1].SDKStakingValidator(), providerIdentities[0].TMProtoCryptoPublicKey(), ) @@ -593,7 +593,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { tc.mockSetup(ctx, k, mocks) tc.doActions(ctx, k) - require.True(t, checkCorrectPruningProperty(ctx, k, chainID)) + require.True(t, checkCorrectPruningProperty(ctx, k, consumerId)) ctrl.Finish() }) @@ -613,9 +613,7 @@ func TestCannotReassignDefaultKeyAssignment(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - providerKeeper.SetPendingConsumerAdditionProp(ctx, &types.ConsumerAdditionProposal{ - ChainId: "chain", - }) + providerKeeper.SetConsumerPhase(ctx, "consumerId", providerkeeper.Registered) // Mock that the validator is validating with the single key, as confirmed by provider's staking keeper gomock.InOrder( @@ -625,7 +623,7 @@ func TestCannotReassignDefaultKeyAssignment(t *testing.T) { ) // AssignConsumerKey should return an error if we try to re-assign the already existing default key assignment - err := providerKeeper.AssignConsumerKey(ctx, "chain", cId.SDKStakingValidator(), cId.TMProtoCryptoPublicKey()) + err := providerKeeper.AssignConsumerKey(ctx, "consumerId", cId.SDKStakingValidator(), cId.TMProtoCryptoPublicKey()) require.Error(t, err) // Confirm we're not returning an error for some other reason diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index bcb067da71..c4d1295347 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -94,6 +94,7 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { return err } k.SetConsumerClientId(ctx, consumerId, clientID) + k.SetClientIdToConsumerId(ctx, clientID, consumerId) k.Logger(ctx).Info("consumer chain registered (client created)", "consumer id", consumerId, diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 5c037eb36c..6c6e6f5ef9 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -136,7 +136,7 @@ func (k Keeper) BlocksUntilNextEpoch(ctx sdk.Context) int64 { // If the CCV channel is not established for a consumer chain, // the updates will remain queued until the channel is established func (k Keeper) SendVSCPackets(ctx sdk.Context) { - for _, chainID := range k.GetAllRegisteredConsumerChainIDs(ctx) { + for _, chainID := range k.GetAllRegisteredConsumerIds(ctx) { // check if CCV channel is established and send if channelID, found := k.GetConsumerIdToChannelId(ctx, chainID); found { k.SendVSCPacketsToChain(ctx, chainID, channelID) @@ -192,7 +192,7 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { panic(fmt.Errorf("failed to get last validators: %w", err)) } - for _, chainID := range k.GetAllRegisteredConsumerChainIDs(ctx) { + for _, chainID := range k.GetAllRegisteredConsumerIds(ctx) { currentValidators, err := k.GetConsumerValSet(ctx, chainID) if err != nil { panic(fmt.Errorf("failed to get consumer validators: %w", err)) @@ -266,7 +266,7 @@ func (k Keeper) EndBlockCIS(ctx sdk.Context) { k.Logger(ctx).Debug("vscID was mapped to block height", "vscID", valUpdateID, "height", blockHeight) // prune previous consumer validator addresses that are no longer needed - for _, chainID := range k.GetAllRegisteredConsumerChainIDs(ctx) { + for _, chainID := range k.GetAllRegisteredConsumerIds(ctx) { k.PruneKeyAssignments(ctx, chainID) } } diff --git a/x/ccv/provider/migrations/v5/migrations.go b/x/ccv/provider/migrations/v5/migrations.go index 33e4ce4c0d..75577014c4 100644 --- a/x/ccv/provider/migrations/v5/migrations.go +++ b/x/ccv/provider/migrations/v5/migrations.go @@ -12,10 +12,10 @@ import ( // and a migration to rewrite the proposal is needed. func MigrateTopNForRegisteredChains(ctx sdk.Context, providerKeeper providerkeeper.Keeper) { // Set the topN of each chain to 95 - for _, chainID := range providerKeeper.GetAllRegisteredConsumerChainIDs(ctx) { + for _, consumerId := range providerKeeper.GetAllRegisteredConsumerIds(ctx) { // TODO (PERMISSIONLESS): this migration already took place and does not make much sense in the Permissionless world // living here for now and we should totally remove - providerKeeper.SetConsumerUpdateRecord(ctx, chainID, types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, types.ConsumerUpdateRecord{ Top_N: 95, }) } diff --git a/x/ccv/provider/migrations/v6/migrations.go b/x/ccv/provider/migrations/v6/migrations.go index 581f5aa4d4..933c5b9853 100644 --- a/x/ccv/provider/migrations/v6/migrations.go +++ b/x/ccv/provider/migrations/v6/migrations.go @@ -19,7 +19,7 @@ func MigrateParams(ctx sdk.Context, paramsSubspace paramtypes.Subspace) { func MigrateMinPowerInTopN(ctx sdk.Context, providerKeeper providerkeeper.Keeper) { // we only get the registered consumer chains and not also the proposed consumer chains because // the minimal power is first set when the consumer chain addition proposal passes - registeredConsumerChains := providerKeeper.GetAllRegisteredConsumerChainIDs(ctx) + registeredConsumerChains := providerKeeper.GetAllRegisteredConsumerIds(ctx) for _, chain := range registeredConsumerChains { // get the top N From 60a6cee484e52b57df3afb73c46664348da46789 Mon Sep 17 00:00:00 2001 From: insumity Date: Thu, 15 Aug 2024 10:56:22 +0200 Subject: [PATCH 27/41] rebased to pick up the removal of legacy proposals (#2130) and re-introduced old messages so that existing proposals can deserialize --- .../ccv/provider/v1/tx.proto | 141 + tests/integration/provider_gov_hooks.go | 6 +- x/ccv/provider/keeper/hooks.go | 6 +- x/ccv/provider/types/codec.go | 4 + x/ccv/provider/types/errors.go | 68 +- x/ccv/provider/types/msg.go | 145 +- x/ccv/provider/types/tx.pb.go | 5608 ++++++++++++----- 7 files changed, 4292 insertions(+), 1686 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 0e4aa1b9f0..63050daee2 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -349,3 +349,144 @@ message ConsumerInitializationRecord { // MsgInitializeConsumerResponse defines response type for MsgRegisterConsumer message MsgInitializeConsumerResponse {} + + +// Keeping the old messages (`MsgConsumerAddition`, `MsgConsumerRemoval`, `MsgConsumerModification`) here so that +// existing proposals can be deserialized + +message MsgConsumerAddition { + option (cosmos.msg.v1.signer) = "authority"; + + // the proposed chain-id of the new consumer chain, must be different from all + // other consumer chain ids of the executing provider chain. + string chain_id = 1; + // the proposed initial height of new consumer chain. + // For a completely new chain, this will be {0,1}. However, it may be + // different if this is a chain that is converting to a consumer chain. + ibc.core.client.v1.Height initial_height = 2 [ (gogoproto.nullable) = false ]; + // The hash of the consumer chain genesis state without the consumer CCV + // module genesis params. It is used for off-chain confirmation of + // genesis.json validity by validators and other parties. + bytes genesis_hash = 3; + // The hash of the consumer chain binary that should be run by validators on + // chain initialization. It is used for off-chain confirmation of binary + // validity by validators and other parties. + bytes binary_hash = 4; + // spawn time is the time on the provider chain at which the consumer chain + // genesis is finalized and all validators will be responsible for starting + // their consumer chain validator node. + google.protobuf.Timestamp spawn_time = 5 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + google.protobuf.Duration unbonding_period = 6 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // Sent CCV related IBC packets will timeout after this duration + google.protobuf.Duration ccv_timeout_period = 7 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // Sent transfer related IBC packets will timeout after this duration + google.protobuf.Duration transfer_timeout_period = 8 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + string consumer_redistribution_fraction = 9; + // BlocksPerDistributionTransmission is the number of blocks between + // ibc-token-transfers from the consumer chain to the provider chain. On + // sending transmission event, `consumer_redistribution_fraction` of the + // accumulated tokens are sent to the consumer redistribution address. + int64 blocks_per_distribution_transmission = 10; + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + int64 historical_entries = 11; + // The ID of a token transfer channel used for the Reward Distribution + // sub-protocol. If DistributionTransmissionChannel == "", a new transfer + // channel is created on top of the same connection as the CCV channel. + // Note that transfer_channel_id is the ID of the channel end on the consumer + // chain. it is most relevant for chains performing a sovereign to consumer + // changeover in order to maintain the existing ibc transfer channel + string distribution_transmission_channel = 12; + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + uint32 top_N = 13; + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + uint32 validators_power_cap = 14; + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + uint32 validator_set_cap = 15; + // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate + // the consumer chain. + repeated string allowlist = 16; + // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. + repeated string denylist = 17; + // signer address + string authority = 18 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. + uint64 min_stake = 19; + // Corresponds to whether inactive validators are allowed to validate the consumer chain. + bool allow_inactive_vals = 20; +} + +// MsgConsumerAdditionResponse defines response type for MsgConsumerAddition messages +message MsgConsumerAdditionResponse {} + +message MsgConsumerRemoval { + option (cosmos.msg.v1.signer) = "authority"; + + // the chain-id of the consumer chain to be stopped + string chain_id = 1; + // the time on the provider chain at which all validators are responsible to + // stop their consumer chain validator node + google.protobuf.Timestamp stop_time = 2 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // signer address + string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgConsumerRemovalResponse defines response type for MsgConsumerRemoval messages +message MsgConsumerRemovalResponse {} + +// MsgConsumerModification message contains a governance proposal on the provider chain to +// modify a running consumer chain. If it passes, the consumer chain's +// parameters are updated. +// +// Note: this replaces ConsumerModificationProposal which is deprecated and will be removed soon +message MsgConsumerModification { + // the title of the proposal + string title = 1; + // the description of the proposal + string description = 2; + // the chain-id of the consumer chain to be modified + string chain_id = 3; + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + uint32 top_N = 4; + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + uint32 validators_power_cap = 5; + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + uint32 validator_set_cap = 6; + // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate + // the consumer chain. + repeated string allowlist = 7; + // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. + repeated string denylist = 8; + // signer address + string authority = 9 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +message MsgConsumerModificationResponse {} \ No newline at end of file diff --git a/tests/integration/provider_gov_hooks.go b/tests/integration/provider_gov_hooks.go index 813a62a671..ffa88f9da6 100644 --- a/tests/integration/provider_gov_hooks.go +++ b/tests/integration/provider_gov_hooks.go @@ -32,10 +32,10 @@ func (s *CCVTestSuite) TestAfterPropSubmissionAndVotingPeriodEnded() { providerKeeper.Hooks().AfterProposalSubmission(ctx, proposal.Id) // verify that the proposal ID is created - proposalIdOnProvider, ok := providerKeeper.GetProposedConsumerChain(ctx, proposal.Id) + consumerIdOnProvider, ok := providerKeeper.GetProposedConsumerChain(ctx, proposal.Id) s.Require().True(ok) - s.Require().NotEmpty(proposalIdOnProvider) - s.Require().Equal(addConsumerProp.ChainId, proposalIdOnProvider) + s.Require().NotEmpty(consumerIdOnProvider) + s.Require().Equal("0", consumerIdOnProvider) providerKeeper.Hooks().AfterProposalVotingPeriodEnded(ctx, proposal.Id) // verify that the proposal ID is deleted diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index f2989df08e..1d298fc2cf 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkgov "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -110,8 +109,9 @@ func (h Hooks) BeforeTokenizeShareRecordRemoved(_ context.Context, _ uint64) err // that maps the proposal ID to the consumer chain ID. func (h Hooks) AfterProposalSubmission(goCtx context.Context, proposalID uint64) error { ctx := sdk.UnwrapSDKContext(goCtx) - if p, ok := h.GetConsumerAdditionFromProp(ctx, proposalID); ok { - h.k.SetProposedConsumerChain(ctx, p.ChainId, proposalID) + if _, ok := h.GetConsumerAdditionFromProp(ctx, proposalID); ok { + consumerId := h.k.FetchAndIncrementConsumerId(ctx) + h.k.SetProposedConsumerChain(ctx, consumerId, proposalID) } return nil } diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index d1ca068cd1..89a9a24b58 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -31,6 +31,10 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgInitializeConsumer{}, &MsgUpdateConsumer{}, &MsgRemoveConsumer{}, + // keeping old messages (for now) so that existing proposals can be correctly deserialized + &MsgConsumerAddition{}, + &MsgConsumerRemoval{}, + &MsgConsumerModification{}, &MsgChangeRewardDenoms{}, &MsgUpdateParams{}, ) diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 1c13a2f3c7..2d2a7b4a98 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -6,37 +6,39 @@ import ( // Provider sentinel errors var ( - ErrInvalidConsumerAdditionProposal = errorsmod.Register(ModuleName, 1, "invalid consumer addition proposal") - ErrInvalidConsumerRemoval = errorsmod.Register(ModuleName, 2, "invalid consumer removal") - ErrUnknownConsumerId = errorsmod.Register(ModuleName, 3, "no consumer chain with this consumer id") - ErrUnknownConsumerChannelId = errorsmod.Register(ModuleName, 4, "no consumer chain with this channel id") - ErrInvalidConsumerConsensusPubKey = errorsmod.Register(ModuleName, 5, "empty consumer consensus public key") - ErrInvalidConsumerId = errorsmod.Register(ModuleName, 6, "invalid consumer id") - ErrConsumerKeyNotFound = errorsmod.Register(ModuleName, 7, "consumer key not found") - ErrNoValidatorConsumerAddress = errorsmod.Register(ModuleName, 8, "error getting validator consumer address") - ErrNoValidatorProviderAddress = errorsmod.Register(ModuleName, 9, "error getting validator provider address") - ErrConsumerKeyInUse = errorsmod.Register(ModuleName, 10, "consumer key is already in use by a validator") - ErrCannotAssignDefaultKeyAssignment = errorsmod.Register(ModuleName, 11, "cannot re-assign default key assignment") - ErrInvalidConsumerParams = errorsmod.Register(ModuleName, 12, "invalid consumer params") - ErrInvalidProviderAddress = errorsmod.Register(ModuleName, 13, "invalid provider address") - ErrInvalidConsumerRewardDenom = errorsmod.Register(ModuleName, 14, "invalid consumer reward denom") - ErrInvalidDepositorAddress = errorsmod.Register(ModuleName, 15, "invalid depositor address") - ErrInvalidConsumerClient = errorsmod.Register(ModuleName, 16, "ccv channel is not built on correct client") - ErrDuplicateConsumerChain = errorsmod.Register(ModuleName, 17, "consumer chain already exists") - ErrConsumerChainNotFound = errorsmod.Register(ModuleName, 18, "consumer chain not found") - ErrInvalidConsumerCommissionRate = errorsmod.Register(ModuleName, 19, "consumer commission rate is invalid") - ErrCannotOptOutFromTopN = errorsmod.Register(ModuleName, 20, "cannot opt out from a Top N chain") - ErrNoUnconfirmedVSCPacket = errorsmod.Register(ModuleName, 21, "no unconfirmed vsc packet for this chain id") - ErrInvalidUpdateRecord = errorsmod.Register(ModuleName, 22, "invalid consumer update record") - ErrNoUnbondingTime = errorsmod.Register(ModuleName, 23, "provider unbonding time not found") - ErrInvalidAddress = errorsmod.Register(ModuleName, 24, "invalid address") - ErrUnauthorized = errorsmod.Register(ModuleName, 25, "unauthorized") - ErrInvalidPhase = errorsmod.Register(ModuleName, 26, "cannot perform action in the current phase of consumer chain") - ErrNoInitializationRecord = errorsmod.Register(ModuleName, 27, "initialization record is missing") - ErrNoRegistrationRecord = errorsmod.Register(ModuleName, 28, "registration record is missing") - ErrNoChainId = errorsmod.Register(ModuleName, 29, "missing chain id for consumer chain") - ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 30, "missing consumer genesis") - ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 31, "invalid consumer genesis") - ErrNoConsumerId = errorsmod.Register(ModuleName, 32, "missing consumer id") - ErrAlreadyOptedIn = errorsmod.Register(ModuleName, 33, "already opted in to a chain with the same chain id") + ErrInvalidConsumerAdditionProposal = errorsmod.Register(ModuleName, 1, "invalid consumer addition proposal") + ErrInvalidConsumerRemoval = errorsmod.Register(ModuleName, 2, "invalid consumer removal") + ErrUnknownConsumerId = errorsmod.Register(ModuleName, 3, "no consumer chain with this consumer id") + ErrUnknownConsumerChannelId = errorsmod.Register(ModuleName, 4, "no consumer chain with this channel id") + ErrInvalidConsumerConsensusPubKey = errorsmod.Register(ModuleName, 5, "empty consumer consensus public key") + ErrInvalidConsumerId = errorsmod.Register(ModuleName, 6, "invalid consumer id") + ErrConsumerKeyNotFound = errorsmod.Register(ModuleName, 7, "consumer key not found") + ErrNoValidatorConsumerAddress = errorsmod.Register(ModuleName, 8, "error getting validator consumer address") + ErrNoValidatorProviderAddress = errorsmod.Register(ModuleName, 9, "error getting validator provider address") + ErrConsumerKeyInUse = errorsmod.Register(ModuleName, 10, "consumer key is already in use by a validator") + ErrCannotAssignDefaultKeyAssignment = errorsmod.Register(ModuleName, 11, "cannot re-assign default key assignment") + ErrInvalidConsumerParams = errorsmod.Register(ModuleName, 12, "invalid consumer params") + ErrInvalidProviderAddress = errorsmod.Register(ModuleName, 13, "invalid provider address") + ErrInvalidConsumerRewardDenom = errorsmod.Register(ModuleName, 14, "invalid consumer reward denom") + ErrInvalidDepositorAddress = errorsmod.Register(ModuleName, 15, "invalid depositor address") + ErrInvalidConsumerClient = errorsmod.Register(ModuleName, 16, "ccv channel is not built on correct client") + ErrDuplicateConsumerChain = errorsmod.Register(ModuleName, 17, "consumer chain already exists") + ErrConsumerChainNotFound = errorsmod.Register(ModuleName, 18, "consumer chain not found") + ErrInvalidConsumerCommissionRate = errorsmod.Register(ModuleName, 19, "consumer commission rate is invalid") + ErrCannotOptOutFromTopN = errorsmod.Register(ModuleName, 20, "cannot opt out from a Top N chain") + ErrNoUnconfirmedVSCPacket = errorsmod.Register(ModuleName, 21, "no unconfirmed vsc packet for this chain id") + ErrInvalidConsumerModificationProposal = errorsmod.Register(ModuleName, 22, "invalid consumer modification proposal") + ErrInvalidUpdateRecord = errorsmod.Register(ModuleName, 23, "invalid consumer update record") + ErrBlankConsumerChainID = errorsmod.Register(ModuleName, 24, "consumer chain id must not be blank") + ErrNoUnbondingTime = errorsmod.Register(ModuleName, 25, "provider unbonding time not found") + ErrInvalidAddress = errorsmod.Register(ModuleName, 26, "invalid address") + ErrUnauthorized = errorsmod.Register(ModuleName, 27, "unauthorized") + ErrInvalidPhase = errorsmod.Register(ModuleName, 28, "cannot perform action in the current phase of consumer chain") + ErrNoInitializationRecord = errorsmod.Register(ModuleName, 29, "initialization record is missing") + ErrNoRegistrationRecord = errorsmod.Register(ModuleName, 30, "registration record is missing") + ErrNoChainId = errorsmod.Register(ModuleName, 31, "missing chain id for consumer chain") + ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 32, "missing consumer genesis") + ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 33, "invalid consumer genesis") + ErrNoConsumerId = errorsmod.Register(ModuleName, 34, "missing consumer id") + ErrAlreadyOptedIn = errorsmod.Register(ModuleName, 35, "already opted in to a chain with the same chain id") ) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 626fc6d2f5..d91b54f0ec 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -43,6 +43,9 @@ var ( _ sdk.Msg = (*MsgInitializeConsumer)(nil) _ sdk.Msg = (*MsgUpdateConsumer)(nil) _ sdk.Msg = (*MsgRemoveConsumer)(nil) + _ sdk.Msg = (*MsgConsumerAddition)(nil) + _ sdk.Msg = (*MsgConsumerModification)(nil) + _ sdk.Msg = (*MsgConsumerRemoval)(nil) _ sdk.Msg = (*MsgOptIn)(nil) _ sdk.Msg = (*MsgOptOut)(nil) _ sdk.Msg = (*MsgSetConsumerCommissionRate)(nil) @@ -51,11 +54,13 @@ var ( _ sdk.HasValidateBasic = (*MsgChangeRewardDenoms)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerMisbehaviour)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerDoubleVoting)(nil) - // TODO (PERMISSIONLESS) add extensive checks, etc. _ sdk.HasValidateBasic = (*MsgRegisterConsumer)(nil) _ sdk.HasValidateBasic = (*MsgInitializeConsumer)(nil) _ sdk.HasValidateBasic = (*MsgUpdateConsumer)(nil) _ sdk.HasValidateBasic = (*MsgRemoveConsumer)(nil) + _ sdk.HasValidateBasic = (*MsgConsumerAddition)(nil) + _ sdk.HasValidateBasic = (*MsgConsumerModification)(nil) + _ sdk.HasValidateBasic = (*MsgConsumerRemoval)(nil) _ sdk.HasValidateBasic = (*MsgOptIn)(nil) _ sdk.HasValidateBasic = (*MsgOptOut)(nil) _ sdk.HasValidateBasic = (*MsgSetConsumerCommissionRate)(nil) @@ -413,6 +418,144 @@ func (msg MsgRemoveConsumer) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{valAddr.Bytes()} } +// Route implements the sdk.Msg interface. +func (msg MsgConsumerAddition) Route() string { return RouterKey } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgConsumerAddition) ValidateBasic() error { + if strings.TrimSpace(msg.ChainId) == "" { + return ErrBlankConsumerChainID + } + + if msg.InitialHeight.IsZero() { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "initial height cannot be zero") + } + + if len(msg.GenesisHash) == 0 { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "genesis hash cannot be empty") + } + if len(msg.BinaryHash) == 0 { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "binary hash cannot be empty") + } + + if msg.SpawnTime.IsZero() { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "spawn time cannot be zero") + } + + if err := ccvtypes.ValidateStringFraction(msg.ConsumerRedistributionFraction); err != nil { + return errorsmod.Wrapf(ErrInvalidConsumerAdditionProposal, "consumer redistribution fraction is invalid: %s", err) + } + + if err := ccvtypes.ValidatePositiveInt64(msg.BlocksPerDistributionTransmission); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "blocks per distribution transmission cannot be < 1") + } + + if err := ccvtypes.ValidateDistributionTransmissionChannel(msg.DistributionTransmissionChannel); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "distribution transmission channel") + } + + if err := ccvtypes.ValidatePositiveInt64(msg.HistoricalEntries); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "historical entries cannot be < 1") + } + + if err := ccvtypes.ValidateDuration(msg.CcvTimeoutPeriod); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "ccv timeout period cannot be zero") + } + + if err := ccvtypes.ValidateDuration(msg.TransferTimeoutPeriod); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "transfer timeout period cannot be zero") + } + + if err := ccvtypes.ValidateDuration(msg.UnbondingPeriod); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerAdditionProposal, "unbonding period cannot be zero") + } + + return nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgConsumerAddition) GetSignBytes() []byte { + bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +func (msg MsgConsumerAddition) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.Authority) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } + return []sdk.AccAddress{valAddr.Bytes()} +} + +// Route implements the sdk.Msg interface. +func (msg MsgConsumerModification) Route() string { return RouterKey } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgConsumerModification) ValidateBasic() error { + if strings.TrimSpace(msg.ChainId) == "" { + return ErrBlankConsumerChainID + } + + err := ValidatePSSFeatures(msg.Top_N, msg.ValidatorsPowerCap) + if err != nil { + return errorsmod.Wrapf(ErrInvalidConsumerModificationProposal, "invalid PSS features: %s", err.Error()) + } + + return nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgConsumerModification) GetSignBytes() []byte { + bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +func (msg MsgConsumerModification) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.Authority) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } + return []sdk.AccAddress{valAddr.Bytes()} +} + +// Route implements the sdk.Msg interface. +func (msg MsgConsumerRemoval) Route() string { return RouterKey } + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgConsumerRemoval) ValidateBasic() error { + if strings.TrimSpace(msg.ChainId) == "" { + return errorsmod.Wrap(ErrInvalidConsumerRemoval, "consumer chain id must not be blank") + } + + if msg.StopTime.IsZero() { + return errorsmod.Wrap(ErrInvalidConsumerRemoval, "spawn time cannot be zero") + } + return nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgConsumerRemoval) GetSignBytes() []byte { + bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +func (msg MsgConsumerRemoval) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.Authority) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } + return []sdk.AccAddress{valAddr.Bytes()} +} + // NewMsgOptIn creates a new NewMsgOptIn instance. func NewMsgOptIn(consumerId string, providerValidatorAddress sdk.ValAddress, consumerConsensusPubKey, signer string) (*MsgOptIn, error) { return &MsgOptIn{ diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 4e5a21cedf..5502400c98 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -1476,750 +1476,1225 @@ func (m *MsgInitializeConsumerResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInitializeConsumerResponse proto.InternalMessageInfo -func init() { - proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") - proto.RegisterType((*MsgAssignConsumerKeyResponse)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKeyResponse") - proto.RegisterType((*MsgSubmitConsumerMisbehaviour)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour") - proto.RegisterType((*MsgSubmitConsumerMisbehaviourResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviourResponse") - proto.RegisterType((*MsgSubmitConsumerDoubleVoting)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting") - proto.RegisterType((*MsgSubmitConsumerDoubleVotingResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVotingResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgRemoveConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumer") - proto.RegisterType((*MsgRemoveConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumerResponse") - proto.RegisterType((*MsgChangeRewardDenoms)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenoms") - proto.RegisterType((*MsgChangeRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenomsResponse") - proto.RegisterType((*MsgOptIn)(nil), "interchain_security.ccv.provider.v1.MsgOptIn") - proto.RegisterType((*MsgOptInResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptInResponse") - proto.RegisterType((*MsgOptOut)(nil), "interchain_security.ccv.provider.v1.MsgOptOut") - proto.RegisterType((*MsgOptOutResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptOutResponse") - proto.RegisterType((*MsgSetConsumerCommissionRate)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRate") - proto.RegisterType((*MsgSetConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRateResponse") - proto.RegisterType((*MsgUpdateConsumer)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumer") - proto.RegisterType((*ConsumerUpdateRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerUpdateRecord") - proto.RegisterType((*MsgUpdateConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumerResponse") - proto.RegisterType((*MsgRegisterConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumer") - proto.RegisterType((*ConsumerRegistrationRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerRegistrationRecord") - proto.RegisterType((*MsgRegisterConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumerResponse") - proto.RegisterType((*MsgInitializeConsumer)(nil), "interchain_security.ccv.provider.v1.MsgInitializeConsumer") - proto.RegisterType((*ConsumerInitializationRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerInitializationRecord") - proto.RegisterType((*MsgInitializeConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgInitializeConsumerResponse") +type MsgConsumerAddition struct { + // the proposed chain-id of the new consumer chain, must be different from all + // other consumer chain ids of the executing provider chain. + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the proposed initial height of new consumer chain. + // For a completely new chain, this will be {0,1}. However, it may be + // different if this is a chain that is converting to a consumer chain. + InitialHeight types1.Height `protobuf:"bytes,2,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` + // The hash of the consumer chain genesis state without the consumer CCV + // module genesis params. It is used for off-chain confirmation of + // genesis.json validity by validators and other parties. + GenesisHash []byte `protobuf:"bytes,3,opt,name=genesis_hash,json=genesisHash,proto3" json:"genesis_hash,omitempty"` + // The hash of the consumer chain binary that should be run by validators on + // chain initialization. It is used for off-chain confirmation of binary + // validity by validators and other parties. + BinaryHash []byte `protobuf:"bytes,4,opt,name=binary_hash,json=binaryHash,proto3" json:"binary_hash,omitempty"` + // spawn time is the time on the provider chain at which the consumer chain + // genesis is finalized and all validators will be responsible for starting + // their consumer chain validator node. + SpawnTime time.Time `protobuf:"bytes,5,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + UnbondingPeriod time.Duration `protobuf:"bytes,6,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` + // Sent CCV related IBC packets will timeout after this duration + CcvTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` + // Sent transfer related IBC packets will timeout after this duration + TransferTimeoutPeriod time.Duration `protobuf:"bytes,8,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + ConsumerRedistributionFraction string `protobuf:"bytes,9,opt,name=consumer_redistribution_fraction,json=consumerRedistributionFraction,proto3" json:"consumer_redistribution_fraction,omitempty"` + // BlocksPerDistributionTransmission is the number of blocks between + // ibc-token-transfers from the consumer chain to the provider chain. On + // sending transmission event, `consumer_redistribution_fraction` of the + // accumulated tokens are sent to the consumer redistribution address. + BlocksPerDistributionTransmission int64 `protobuf:"varint,10,opt,name=blocks_per_distribution_transmission,json=blocksPerDistributionTransmission,proto3" json:"blocks_per_distribution_transmission,omitempty"` + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + HistoricalEntries int64 `protobuf:"varint,11,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"` + // The ID of a token transfer channel used for the Reward Distribution + // sub-protocol. If DistributionTransmissionChannel == "", a new transfer + // channel is created on top of the same connection as the CCV channel. + // Note that transfer_channel_id is the ID of the channel end on the consumer + // chain. it is most relevant for chains performing a sovereign to consumer + // changeover in order to maintain the existing ibc transfer channel + DistributionTransmissionChannel string `protobuf:"bytes,12,opt,name=distribution_transmission_channel,json=distributionTransmissionChannel,proto3" json:"distribution_transmission_channel,omitempty"` + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + Top_N uint32 `protobuf:"varint,13,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + ValidatorsPowerCap uint32 `protobuf:"varint,14,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + ValidatorSetCap uint32 `protobuf:"varint,15,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate + // the consumer chain. + Allowlist []string `protobuf:"bytes,16,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. + Denylist []string `protobuf:"bytes,17,rep,name=denylist,proto3" json:"denylist,omitempty"` + // signer address + Authority string `protobuf:"bytes,18,opt,name=authority,proto3" json:"authority,omitempty"` + // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. + MinStake uint64 `protobuf:"varint,19,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` + // Corresponds to whether inactive validators are allowed to validate the consumer chain. + AllowInactiveVals bool `protobuf:"varint,20,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` } -func init() { - proto.RegisterFile("interchain_security/ccv/provider/v1/tx.proto", fileDescriptor_43221a4391e9fbf4) +func (m *MsgConsumerAddition) Reset() { *m = MsgConsumerAddition{} } +func (m *MsgConsumerAddition) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerAddition) ProtoMessage() {} +func (*MsgConsumerAddition) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{27} } - -var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 1890 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4b, 0x6c, 0x24, 0x47, - 0x19, 0x76, 0xfb, 0xb5, 0x9e, 0xdf, 0x8f, 0xb5, 0xcb, 0x36, 0x1e, 0xcf, 0x2e, 0x33, 0xde, 0x49, - 0x48, 0xac, 0x25, 0xee, 0xce, 0x1a, 0xb2, 0x80, 0x05, 0x01, 0x3f, 0x16, 0xd6, 0x01, 0xef, 0x9a, - 0xde, 0x65, 0x91, 0x40, 0x4a, 0xab, 0xa6, 0xbb, 0xb6, 0xa7, 0xb4, 0xd3, 0x5d, 0xad, 0xae, 0x9a, - 0x71, 0x86, 0x13, 0xca, 0x21, 0x8a, 0x84, 0x84, 0x82, 0xc4, 0x81, 0x63, 0x0e, 0x5c, 0x90, 0x82, - 0x94, 0x43, 0x38, 0x73, 0x43, 0x39, 0x45, 0x21, 0x27, 0x14, 0xa1, 0x05, 0xed, 0x1e, 0xc2, 0x99, - 0x13, 0x47, 0x54, 0x8f, 0xee, 0x99, 0xf1, 0x8c, 0xed, 0xb1, 0x37, 0xe1, 0xc0, 0xc5, 0x9a, 0xaa, - 0xff, 0xfb, 0xbf, 0xff, 0xd1, 0x7f, 0xfd, 0xf5, 0x30, 0xbc, 0x44, 0x63, 0x41, 0x52, 0xbf, 0x8e, - 0x69, 0xec, 0x71, 0xe2, 0x37, 0x53, 0x2a, 0xda, 0x8e, 0xef, 0xb7, 0x9c, 0x24, 0x65, 0x2d, 0x1a, - 0x90, 0xd4, 0x69, 0xdd, 0x70, 0xc4, 0x1b, 0x76, 0x92, 0x32, 0xc1, 0xd0, 0x73, 0x03, 0xd0, 0xb6, - 0xef, 0xb7, 0xec, 0x0c, 0x6d, 0xb7, 0x6e, 0x94, 0x16, 0x70, 0x44, 0x63, 0xe6, 0xa8, 0xbf, 0x5a, - 0xaf, 0x74, 0x35, 0x64, 0x2c, 0x6c, 0x10, 0x07, 0x27, 0xd4, 0xc1, 0x71, 0xcc, 0x04, 0x16, 0x94, - 0xc5, 0xdc, 0x48, 0x2b, 0x46, 0xaa, 0x46, 0xb5, 0xe6, 0x43, 0x47, 0xd0, 0x88, 0x70, 0x81, 0xa3, - 0xc4, 0x00, 0xca, 0xc7, 0x01, 0x41, 0x33, 0x55, 0x0c, 0x46, 0xbe, 0x7a, 0x5c, 0x8e, 0xe3, 0xb6, - 0x11, 0x2d, 0x85, 0x2c, 0x64, 0xea, 0xa7, 0x23, 0x7f, 0x65, 0x0a, 0x3e, 0xe3, 0x11, 0xe3, 0x9e, - 0x16, 0xe8, 0x81, 0x11, 0xad, 0xe8, 0x91, 0x13, 0xf1, 0x50, 0x86, 0x1e, 0xf1, 0x30, 0xf3, 0x92, - 0xd6, 0x7c, 0xc7, 0x67, 0x29, 0x71, 0xfc, 0x06, 0x25, 0xb1, 0x90, 0x52, 0xfd, 0xcb, 0x00, 0x36, - 0x87, 0x49, 0x65, 0x9e, 0x28, 0xad, 0xe3, 0x48, 0xd2, 0x06, 0x0d, 0xeb, 0x42, 0x53, 0x71, 0x47, - 0x90, 0x38, 0x20, 0x69, 0x44, 0xb5, 0x81, 0xce, 0x28, 0xf3, 0xa2, 0x4b, 0x2e, 0xda, 0x09, 0xe1, - 0x0e, 0x91, 0x7c, 0xb1, 0x4f, 0x34, 0xa0, 0xfa, 0xa9, 0x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xca, 0xb9, 0xe0, 0xb9, 0xb9, 0x04, 0x26, 0xcd, 0x65, 0xd8, - 0x3e, 0x07, 0xc1, 0xdd, 0xa6, 0x28, 0xdd, 0x3c, 0x1f, 0x3e, 0xb7, 0xf8, 0x07, 0x0b, 0x56, 0x4f, - 0xbe, 0xbb, 0x0e, 0xdd, 0x62, 0x4f, 0xa4, 0x28, 0xed, 0x3f, 0x33, 0x45, 0xe6, 0x6b, 0x69, 0xe2, - 0x97, 0x9f, 0xbd, 0x7f, 0xdd, 0xda, 0xf9, 0xe9, 0x87, 0x4f, 0xca, 0xd6, 0xc7, 0x4f, 0xca, 0xd6, - 0x3f, 0x9f, 0x94, 0xad, 0x77, 0x9e, 0x96, 0x47, 0x3e, 0x7e, 0x5a, 0x1e, 0xf9, 0xdb, 0xd3, 0xf2, - 0xc8, 0xcf, 0xbe, 0x13, 0x52, 0x51, 0x6f, 0xd6, 0x6c, 0x9f, 0x45, 0xe6, 0xff, 0x00, 0x4e, 0xc7, - 0xf8, 0x46, 0xfe, 0x8c, 0xdf, 0x7a, 0xc5, 0x79, 0xa3, 0xf7, 0x2d, 0x5f, 0xbd, 0x59, 0xd6, 0x26, - 0xd5, 0xa1, 0xe0, 0x6b, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x33, 0x75, 0x7d, 0xb2, 0x47, 0x19, - 0x00, 0x00, +func (m *MsgConsumerAddition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConsumerAddition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConsumerAddition.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 *MsgConsumerAddition) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerAddition.Merge(m, src) +} +func (m *MsgConsumerAddition) XXX_Size() int { + return m.Size() +} +func (m *MsgConsumerAddition) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerAddition.DiscardUnknown(m) } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +var xxx_messageInfo_MsgConsumerAddition proto.InternalMessageInfo -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) - SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) - SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) - RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) - InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) - UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) - RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) - OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) - SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) +func (m *MsgConsumerAddition) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" } -type msgClient struct { - cc grpc1.ClientConn +func (m *MsgConsumerAddition) GetInitialHeight() types1.Height { + if m != nil { + return m.InitialHeight + } + return types1.Height{} } -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} +func (m *MsgConsumerAddition) GetGenesisHash() []byte { + if m != nil { + return m.GenesisHash + } + return nil } -func (c *msgClient) AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) { - out := new(MsgAssignConsumerKeyResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetBinaryHash() []byte { + if m != nil { + return m.BinaryHash } - return out, nil + return nil } -func (c *msgClient) SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) { - out := new(MsgSubmitConsumerMisbehaviourResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetSpawnTime() time.Time { + if m != nil { + return m.SpawnTime } - return out, nil + return time.Time{} } -func (c *msgClient) SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) { - out := new(MsgSubmitConsumerDoubleVotingResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetUnbondingPeriod() time.Duration { + if m != nil { + return m.UnbondingPeriod } - return out, nil + return 0 } -func (c *msgClient) RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) { - out := new(MsgRegisterConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RegisterConsumer", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetCcvTimeoutPeriod() time.Duration { + if m != nil { + return m.CcvTimeoutPeriod } - return out, nil + return 0 } -func (c *msgClient) InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) { - out := new(MsgInitializeConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetTransferTimeoutPeriod() time.Duration { + if m != nil { + return m.TransferTimeoutPeriod } - return out, nil + return 0 } -func (c *msgClient) UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) { - out := new(MsgUpdateConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetConsumerRedistributionFraction() string { + if m != nil { + return m.ConsumerRedistributionFraction } - return out, nil + return "" } -func (c *msgClient) RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) { - out := new(MsgRemoveConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetBlocksPerDistributionTransmission() int64 { + if m != nil { + return m.BlocksPerDistributionTransmission } - return out, nil + return 0 } -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetHistoricalEntries() int64 { + if m != nil { + return m.HistoricalEntries } - return out, nil + return 0 } -func (c *msgClient) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) { - out := new(MsgOptInResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptIn", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetDistributionTransmissionChannel() string { + if m != nil { + return m.DistributionTransmissionChannel } - return out, nil + return "" } -func (c *msgClient) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) { - out := new(MsgOptOutResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptOut", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetTop_N() uint32 { + if m != nil { + return m.Top_N } - return out, nil + return 0 } -func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) { - out := new(MsgSetConsumerCommissionRateResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgConsumerAddition) GetValidatorsPowerCap() uint32 { + if m != nil { + return m.ValidatorsPowerCap } - return out, nil + return 0 } -// MsgServer is the server API for Msg service. -type MsgServer interface { - AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) - SubmitConsumerMisbehaviour(context.Context, *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) - SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) - RegisterConsumer(context.Context, *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) - InitializeConsumer(context.Context, *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) - UpdateConsumer(context.Context, *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) - RemoveConsumer(context.Context, *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) - OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) - SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) +func (m *MsgConsumerAddition) GetValidatorSetCap() uint32 { + if m != nil { + return m.ValidatorSetCap + } + return 0 } -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { +func (m *MsgConsumerAddition) GetAllowlist() []string { + if m != nil { + return m.Allowlist + } + return nil } -func (*UnimplementedMsgServer) AssignConsumerKey(ctx context.Context, req *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AssignConsumerKey not implemented") +func (m *MsgConsumerAddition) GetDenylist() []string { + if m != nil { + return m.Denylist + } + return nil } -func (*UnimplementedMsgServer) SubmitConsumerMisbehaviour(ctx context.Context, req *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerMisbehaviour not implemented") + +func (m *MsgConsumerAddition) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" } -func (*UnimplementedMsgServer) SubmitConsumerDoubleVoting(ctx context.Context, req *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerDoubleVoting not implemented") + +func (m *MsgConsumerAddition) GetMinStake() uint64 { + if m != nil { + return m.MinStake + } + return 0 } -func (*UnimplementedMsgServer) RegisterConsumer(ctx context.Context, req *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterConsumer not implemented") + +func (m *MsgConsumerAddition) GetAllowInactiveVals() bool { + if m != nil { + return m.AllowInactiveVals + } + return false } -func (*UnimplementedMsgServer) InitializeConsumer(ctx context.Context, req *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitializeConsumer not implemented") + +// MsgConsumerAdditionResponse defines response type for MsgConsumerAddition messages +type MsgConsumerAdditionResponse struct { } -func (*UnimplementedMsgServer) UpdateConsumer(ctx context.Context, req *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateConsumer not implemented") + +func (m *MsgConsumerAdditionResponse) Reset() { *m = MsgConsumerAdditionResponse{} } +func (m *MsgConsumerAdditionResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerAdditionResponse) ProtoMessage() {} +func (*MsgConsumerAdditionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{28} } -func (*UnimplementedMsgServer) RemoveConsumer(ctx context.Context, req *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveConsumer not implemented") +func (m *MsgConsumerAdditionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +func (m *MsgConsumerAdditionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConsumerAdditionResponse.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 (*UnimplementedMsgServer) OptIn(ctx context.Context, req *MsgOptIn) (*MsgOptInResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OptIn not implemented") +func (m *MsgConsumerAdditionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerAdditionResponse.Merge(m, src) } -func (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*MsgOptOutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OptOut not implemented") +func (m *MsgConsumerAdditionResponse) XXX_Size() int { + return m.Size() } -func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") +func (m *MsgConsumerAdditionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerAdditionResponse.DiscardUnknown(m) } -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) +var xxx_messageInfo_MsgConsumerAdditionResponse proto.InternalMessageInfo + +type MsgConsumerRemoval struct { + // the chain-id of the consumer chain to be stopped + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the time on the provider chain at which all validators are responsible to + // stop their consumer chain validator node + StopTime time.Time `protobuf:"bytes,2,opt,name=stop_time,json=stopTime,proto3,stdtime" json:"stop_time"` + // signer address + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` } -func _Msg_AssignConsumerKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAssignConsumerKey) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).AssignConsumerKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AssignConsumerKey(ctx, req.(*MsgAssignConsumerKey)) +func (m *MsgConsumerRemoval) Reset() { *m = MsgConsumerRemoval{} } +func (m *MsgConsumerRemoval) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerRemoval) ProtoMessage() {} +func (*MsgConsumerRemoval) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{29} +} +func (m *MsgConsumerRemoval) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConsumerRemoval) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConsumerRemoval.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *MsgConsumerRemoval) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerRemoval.Merge(m, src) +} +func (m *MsgConsumerRemoval) XXX_Size() int { + return m.Size() +} +func (m *MsgConsumerRemoval) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerRemoval.DiscardUnknown(m) } -func _Msg_SubmitConsumerMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitConsumerMisbehaviour) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, req.(*MsgSubmitConsumerMisbehaviour)) +var xxx_messageInfo_MsgConsumerRemoval proto.InternalMessageInfo + +func (m *MsgConsumerRemoval) GetChainId() string { + if m != nil { + return m.ChainId } - return interceptor(ctx, in, info, handler) + return "" } -func _Msg_SubmitConsumerDoubleVoting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitConsumerDoubleVoting) - if err := dec(in); err != nil { - return nil, err +func (m *MsgConsumerRemoval) GetStopTime() time.Time { + if m != nil { + return m.StopTime } - if interceptor == nil { - return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, in) + return time.Time{} +} + +func (m *MsgConsumerRemoval) GetAuthority() string { + if m != nil { + return m.Authority } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", + return "" +} + +// MsgConsumerRemovalResponse defines response type for MsgConsumerRemoval messages +type MsgConsumerRemovalResponse struct { +} + +func (m *MsgConsumerRemovalResponse) Reset() { *m = MsgConsumerRemovalResponse{} } +func (m *MsgConsumerRemovalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerRemovalResponse) ProtoMessage() {} +func (*MsgConsumerRemovalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{30} +} +func (m *MsgConsumerRemovalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConsumerRemovalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConsumerRemovalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, req.(*MsgSubmitConsumerDoubleVoting)) +} +func (m *MsgConsumerRemovalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerRemovalResponse.Merge(m, src) +} +func (m *MsgConsumerRemovalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConsumerRemovalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerRemovalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConsumerRemovalResponse proto.InternalMessageInfo + +// MsgConsumerModification message contains a governance proposal on the provider chain to +// modify a running consumer chain. If it passes, the consumer chain's +// parameters are updated. +// +// Note: this replaces ConsumerModificationProposal which is deprecated and will be removed soon +type MsgConsumerModification struct { + // the title of the proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the chain-id of the consumer chain to be modified + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + Top_N uint32 `protobuf:"varint,4,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + ValidatorsPowerCap uint32 `protobuf:"varint,5,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + ValidatorSetCap uint32 `protobuf:"varint,6,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate + // the consumer chain. + Allowlist []string `protobuf:"bytes,7,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. + Denylist []string `protobuf:"bytes,8,rep,name=denylist,proto3" json:"denylist,omitempty"` + // signer address + Authority string `protobuf:"bytes,9,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgConsumerModification) Reset() { *m = MsgConsumerModification{} } +func (m *MsgConsumerModification) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerModification) ProtoMessage() {} +func (*MsgConsumerModification) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{31} +} +func (m *MsgConsumerModification) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConsumerModification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConsumerModification.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *MsgConsumerModification) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerModification.Merge(m, src) +} +func (m *MsgConsumerModification) XXX_Size() int { + return m.Size() +} +func (m *MsgConsumerModification) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerModification.DiscardUnknown(m) } -func _Msg_RegisterConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterConsumer) - if err := dec(in); err != nil { - return nil, err +var xxx_messageInfo_MsgConsumerModification proto.InternalMessageInfo + +func (m *MsgConsumerModification) GetTitle() string { + if m != nil { + return m.Title } - if interceptor == nil { - return srv.(MsgServer).RegisterConsumer(ctx, in) + return "" +} + +func (m *MsgConsumerModification) GetDescription() string { + if m != nil { + return m.Description } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/RegisterConsumer", + return "" +} + +func (m *MsgConsumerModification) GetChainId() string { + if m != nil { + return m.ChainId } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterConsumer(ctx, req.(*MsgRegisterConsumer)) + return "" +} + +func (m *MsgConsumerModification) GetTop_N() uint32 { + if m != nil { + return m.Top_N } - return interceptor(ctx, in, info, handler) + return 0 } -func _Msg_InitializeConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgInitializeConsumer) - if err := dec(in); err != nil { - return nil, err +func (m *MsgConsumerModification) GetValidatorsPowerCap() uint32 { + if m != nil { + return m.ValidatorsPowerCap } - if interceptor == nil { - return srv.(MsgServer).InitializeConsumer(ctx, in) + return 0 +} + +func (m *MsgConsumerModification) GetValidatorSetCap() uint32 { + if m != nil { + return m.ValidatorSetCap } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", + return 0 +} + +func (m *MsgConsumerModification) GetAllowlist() []string { + if m != nil { + return m.Allowlist } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).InitializeConsumer(ctx, req.(*MsgInitializeConsumer)) + return nil +} + +func (m *MsgConsumerModification) GetDenylist() []string { + if m != nil { + return m.Denylist } - return interceptor(ctx, in, info, handler) + return nil } -func _Msg_UpdateConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateConsumer) - if err := dec(in); err != nil { - return nil, err +func (m *MsgConsumerModification) GetAuthority() string { + if m != nil { + return m.Authority } - if interceptor == nil { - return srv.(MsgServer).UpdateConsumer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateConsumer(ctx, req.(*MsgUpdateConsumer)) + return "" +} + +type MsgConsumerModificationResponse struct { +} + +func (m *MsgConsumerModificationResponse) Reset() { *m = MsgConsumerModificationResponse{} } +func (m *MsgConsumerModificationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerModificationResponse) ProtoMessage() {} +func (*MsgConsumerModificationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{32} +} +func (m *MsgConsumerModificationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConsumerModificationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConsumerModificationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *MsgConsumerModificationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerModificationResponse.Merge(m, src) +} +func (m *MsgConsumerModificationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConsumerModificationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerModificationResponse.DiscardUnknown(m) } -func _Msg_RemoveConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRemoveConsumer) - if err := dec(in); err != nil { +var xxx_messageInfo_MsgConsumerModificationResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") + proto.RegisterType((*MsgAssignConsumerKeyResponse)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKeyResponse") + proto.RegisterType((*MsgSubmitConsumerMisbehaviour)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour") + proto.RegisterType((*MsgSubmitConsumerMisbehaviourResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviourResponse") + proto.RegisterType((*MsgSubmitConsumerDoubleVoting)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting") + proto.RegisterType((*MsgSubmitConsumerDoubleVotingResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVotingResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgRemoveConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumer") + proto.RegisterType((*MsgRemoveConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumerResponse") + proto.RegisterType((*MsgChangeRewardDenoms)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenoms") + proto.RegisterType((*MsgChangeRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenomsResponse") + proto.RegisterType((*MsgOptIn)(nil), "interchain_security.ccv.provider.v1.MsgOptIn") + proto.RegisterType((*MsgOptInResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptInResponse") + proto.RegisterType((*MsgOptOut)(nil), "interchain_security.ccv.provider.v1.MsgOptOut") + proto.RegisterType((*MsgOptOutResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptOutResponse") + proto.RegisterType((*MsgSetConsumerCommissionRate)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRate") + proto.RegisterType((*MsgSetConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRateResponse") + proto.RegisterType((*MsgUpdateConsumer)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumer") + proto.RegisterType((*ConsumerUpdateRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerUpdateRecord") + proto.RegisterType((*MsgUpdateConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumerResponse") + proto.RegisterType((*MsgRegisterConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumer") + proto.RegisterType((*ConsumerRegistrationRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerRegistrationRecord") + proto.RegisterType((*MsgRegisterConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumerResponse") + proto.RegisterType((*MsgInitializeConsumer)(nil), "interchain_security.ccv.provider.v1.MsgInitializeConsumer") + proto.RegisterType((*ConsumerInitializationRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerInitializationRecord") + proto.RegisterType((*MsgInitializeConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgInitializeConsumerResponse") + proto.RegisterType((*MsgConsumerAddition)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAddition") + proto.RegisterType((*MsgConsumerAdditionResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAdditionResponse") + proto.RegisterType((*MsgConsumerRemoval)(nil), "interchain_security.ccv.provider.v1.MsgConsumerRemoval") + proto.RegisterType((*MsgConsumerRemovalResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerRemovalResponse") + proto.RegisterType((*MsgConsumerModification)(nil), "interchain_security.ccv.provider.v1.MsgConsumerModification") + proto.RegisterType((*MsgConsumerModificationResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerModificationResponse") +} + +func init() { + proto.RegisterFile("interchain_security/ccv/provider/v1/tx.proto", fileDescriptor_43221a4391e9fbf4) +} + +var fileDescriptor_43221a4391e9fbf4 = []byte{ + // 2086 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x6c, 0x24, 0x47, + 0x15, 0x76, 0xfb, 0x77, 0xa6, 0xfc, 0xb3, 0x76, 0xd9, 0xc6, 0xe3, 0x59, 0xc7, 0xe3, 0x9d, 0x84, + 0xc4, 0x0a, 0x71, 0x4f, 0xd6, 0x90, 0x05, 0x2c, 0x08, 0xf8, 0x67, 0x61, 0x1d, 0xf0, 0xae, 0xe9, + 0x5d, 0x16, 0x09, 0xa4, 0xb4, 0x6a, 0xba, 0x6b, 0x7b, 0x4a, 0x3b, 0xdd, 0xd5, 0xea, 0xaa, 0x19, + 0xc7, 0x9c, 0x50, 0x0e, 0x51, 0x24, 0x24, 0x14, 0x24, 0x0e, 0x1c, 0x73, 0xe0, 0x82, 0x14, 0xa4, + 0x1c, 0xc2, 0x85, 0x0b, 0x37, 0x94, 0x53, 0x14, 0x72, 0x42, 0x2b, 0xb4, 0xa0, 0xdd, 0x43, 0x38, + 0x73, 0xe2, 0x88, 0xea, 0xa7, 0x7b, 0x7a, 0x7e, 0x3c, 0xee, 0x19, 0x7b, 0x23, 0xc4, 0x65, 0x34, + 0x55, 0xef, 0xbd, 0xaf, 0xde, 0x7b, 0xf5, 0xde, 0xab, 0x57, 0xd5, 0xe0, 0x15, 0x12, 0x70, 0x1c, + 0x39, 0x35, 0x44, 0x02, 0x9b, 0x61, 0xa7, 0x11, 0x11, 0x7e, 0x5a, 0x71, 0x9c, 0x66, 0x25, 0x8c, + 0x68, 0x93, 0xb8, 0x38, 0xaa, 0x34, 0xaf, 0x57, 0xf8, 0x5b, 0x66, 0x18, 0x51, 0x4e, 0xe1, 0xf3, + 0x3d, 0xb8, 0x4d, 0xc7, 0x69, 0x9a, 0x31, 0xb7, 0xd9, 0xbc, 0x5e, 0x5c, 0x40, 0x3e, 0x09, 0x68, + 0x45, 0xfe, 0x2a, 0xb9, 0xe2, 0x9a, 0x47, 0xa9, 0x57, 0xc7, 0x15, 0x14, 0x92, 0x0a, 0x0a, 0x02, + 0xca, 0x11, 0x27, 0x34, 0x60, 0x9a, 0x5a, 0xd2, 0x54, 0x39, 0xaa, 0x36, 0x1e, 0x54, 0x38, 0xf1, + 0x31, 0xe3, 0xc8, 0x0f, 0x35, 0xc3, 0x7a, 0x27, 0x83, 0xdb, 0x88, 0x24, 0x82, 0xa6, 0xaf, 0x76, + 0xd2, 0x51, 0x70, 0xaa, 0x49, 0x4b, 0x1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xe0, 0xae, 0x18, 0x43, 0x13, 0x2c, 0x4a, 0x14, 0x9b, 0x04, 0xe2, 0x40, 0x6e, + 0x62, 0xbb, 0x89, 0xea, 0xac, 0x90, 0xdb, 0x30, 0x36, 0x73, 0xd6, 0x82, 0x24, 0x1d, 0x6a, 0xca, + 0x7d, 0x54, 0x67, 0xba, 0xbc, 0xb7, 0x47, 0x45, 0x12, 0x33, 0x7f, 0x31, 0xc0, 0xa2, 0x2c, 0xfe, + 0x1e, 0x61, 0x5c, 0x44, 0x96, 0x8e, 0x9a, 0x56, 0xe8, 0x1a, 0xd9, 0x42, 0x17, 0x86, 0x60, 0x31, + 0x92, 0x28, 0xea, 0xce, 0x11, 0x07, 0x85, 0x3a, 0xda, 0xbe, 0x33, 0x50, 0x50, 0x58, 0x29, 0x1c, + 0x1d, 0x1a, 0x30, 0xea, 0x9a, 0xdb, 0x99, 0x4e, 0x27, 0xc9, 0x2f, 0x0d, 0x50, 0x3c, 0x5b, 0x1e, + 0x2e, 0x81, 0x09, 0x4e, 0x78, 0x1d, 0xeb, 0xd8, 0x50, 0x03, 0xb8, 0x01, 0xa6, 0x5d, 0xcc, 0x9c, + 0x88, 0x84, 0x82, 0x55, 0xc7, 0x78, 0x7a, 0x4a, 0xec, 0x92, 0x8f, 0x39, 0x72, 0x11, 0x47, 0xba, + 0x84, 0x27, 0x63, 0xb8, 0x0a, 0x72, 0xca, 0x20, 0xe2, 0xaa, 0x04, 0xb7, 0xa6, 0xe4, 0xf8, 0xd0, + 0x2d, 0xbf, 0x0e, 0xae, 0xf6, 0xf0, 0x6a, 0xec, 0xf5, 0x73, 0x0b, 0x72, 0xf9, 0x3f, 0xea, 0xd4, + 0x3d, 0x0c, 0x08, 0x27, 0xa8, 0x4e, 0x7e, 0xfe, 0x05, 0xa4, 0x73, 0x13, 0x2c, 0x93, 0x78, 0xb9, + 0xb6, 0x1d, 0x54, 0x69, 0xbd, 0x3b, 0xd0, 0x0e, 0x1e, 0xb6, 0x21, 0xe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af, + 0xda, 0x95, 0xd6, 0xe2, 0x5b, 0xc9, 0x47, 0xe9, 0xe6, 0x6b, 0x95, 0xb7, 0xda, 0xbf, 0x4c, 0xcb, + 0x2f, 0x70, 0xd5, 0x49, 0xd9, 0xae, 0x7c, 0xf5, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0x58, + 0x9f, 0x20, 0x15, 0x20, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) + SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) + SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) + RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) + InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) + UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) + RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) + OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) { + out := new(MsgAssignConsumerKeyResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(MsgServer).RemoveConsumer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RemoveConsumer(ctx, req.(*MsgRemoveConsumer)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { +func (c *msgClient) SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) { + out := new(MsgSubmitConsumerMisbehaviourResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Msg_OptIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgOptIn) - if err := dec(in); err != nil { +func (c *msgClient) SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) { + out := new(MsgSubmitConsumerDoubleVotingResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(MsgServer).OptIn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptIn", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).OptIn(ctx, req.(*MsgOptIn)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Msg_OptOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgOptOut) - if err := dec(in); err != nil { +func (c *msgClient) RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) { + out := new(MsgRegisterConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RegisterConsumer", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(MsgServer).OptOut(ctx, in) + return out, nil +} + +func (c *msgClient) InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) { + out := new(MsgInitializeConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptOut", + return out, nil +} + +func (c *msgClient) UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) { + out := new(MsgUpdateConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).OptOut(ctx, req.(*MsgOptOut)) + return out, nil +} + +func (c *msgClient) RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) { + out := new(MsgRemoveConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetConsumerCommissionRate) - if err := dec(in); err != nil { +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(MsgServer).SetConsumerCommissionRate(ctx, in) + return out, nil +} + +func (c *msgClient) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) { + out := new(MsgOptInResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptIn", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", + return out, nil +} + +func (c *msgClient) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) { + out := new(MsgOptOutResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptOut", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetConsumerCommissionRate(ctx, req.(*MsgSetConsumerCommissionRate)) + return out, nil +} + +func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) { + out := new(MsgSetConsumerCommissionRateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "interchain_security.ccv.provider.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AssignConsumerKey", - Handler: _Msg_AssignConsumerKey_Handler, - }, - { - MethodName: "SubmitConsumerMisbehaviour", - Handler: _Msg_SubmitConsumerMisbehaviour_Handler, - }, - { - MethodName: "SubmitConsumerDoubleVoting", - Handler: _Msg_SubmitConsumerDoubleVoting_Handler, - }, - { - MethodName: "RegisterConsumer", - Handler: _Msg_RegisterConsumer_Handler, - }, - { - MethodName: "InitializeConsumer", - Handler: _Msg_InitializeConsumer_Handler, - }, - { - MethodName: "UpdateConsumer", - Handler: _Msg_UpdateConsumer_Handler, - }, - { - MethodName: "RemoveConsumer", - Handler: _Msg_RemoveConsumer_Handler, - }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "OptIn", - Handler: _Msg_OptIn_Handler, - }, - { - MethodName: "OptOut", - Handler: _Msg_OptOut_Handler, - }, - { - MethodName: "SetConsumerCommissionRate", - Handler: _Msg_SetConsumerCommissionRate_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "interchain_security/ccv/provider/v1/tx.proto", +// MsgServer is the server API for Msg service. +type MsgServer interface { + AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) + SubmitConsumerMisbehaviour(context.Context, *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) + SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) + RegisterConsumer(context.Context, *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) + InitializeConsumer(context.Context, *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) + UpdateConsumer(context.Context, *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) + RemoveConsumer(context.Context, *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) + OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) } -func (m *MsgAssignConsumerKey) 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 +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { } -func (m *MsgAssignConsumerKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (*UnimplementedMsgServer) AssignConsumerKey(ctx context.Context, req *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AssignConsumerKey not implemented") +} +func (*UnimplementedMsgServer) SubmitConsumerMisbehaviour(ctx context.Context, req *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerMisbehaviour not implemented") +} +func (*UnimplementedMsgServer) SubmitConsumerDoubleVoting(ctx context.Context, req *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerDoubleVoting not implemented") +} +func (*UnimplementedMsgServer) RegisterConsumer(ctx context.Context, req *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterConsumer not implemented") +} +func (*UnimplementedMsgServer) InitializeConsumer(ctx context.Context, req *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitializeConsumer not implemented") +} +func (*UnimplementedMsgServer) UpdateConsumer(ctx context.Context, req *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConsumer not implemented") +} +func (*UnimplementedMsgServer) RemoveConsumer(ctx context.Context, req *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveConsumer not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) OptIn(ctx context.Context, req *MsgOptIn) (*MsgOptInResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptIn not implemented") +} +func (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*MsgOptOutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptOut not implemented") +} +func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") } -func (m *MsgAssignConsumerKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_AssignConsumerKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAssignConsumerKey) + if err := dec(in); err != nil { + return nil, err } - if len(m.ConsumerKey) > 0 { - i -= len(m.ConsumerKey) - copy(dAtA[i:], m.ConsumerKey) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerKey))) - i-- - dAtA[i] = 0x1a + if interceptor == nil { + return srv.(MsgServer).AssignConsumerKey(ctx, in) } - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) - i-- - dAtA[i] = 0x12 + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- - dAtA[i] = 0xa + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AssignConsumerKey(ctx, req.(*MsgAssignConsumerKey)) } - return len(dAtA) - i, nil + return interceptor(ctx, in, info, handler) } -func (m *MsgAssignConsumerKeyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_SubmitConsumerMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitConsumerMisbehaviour) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *MsgAssignConsumerKeyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgAssignConsumerKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil + if interceptor == nil { + return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, req.(*MsgSubmitConsumerMisbehaviour)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgSubmitConsumerMisbehaviour) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_SubmitConsumerDoubleVoting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitConsumerDoubleVoting) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *MsgSubmitConsumerMisbehaviour) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if interceptor == nil { + return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, req.(*MsgSubmitConsumerDoubleVoting)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgSubmitConsumerMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Misbehaviour != nil { - { - size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a +func _Msg_RegisterConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterConsumer) + if err := dec(in); err != nil { + return nil, err } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(MsgServer).RegisterConsumer(ctx, in) } - if len(m.Submitter) > 0 { - i -= len(m.Submitter) - copy(dAtA[i:], m.Submitter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Submitter))) - i-- - dAtA[i] = 0xa + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/RegisterConsumer", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterConsumer(ctx, req.(*MsgRegisterConsumer)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgSubmitConsumerMisbehaviourResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_InitializeConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgInitializeConsumer) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(MsgServer).InitializeConsumer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InitializeConsumer(ctx, req.(*MsgInitializeConsumer)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgSubmitConsumerMisbehaviourResponse) MarshalTo(dAtA []byte) (int, error) { +func _Msg_UpdateConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateConsumer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateConsumer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateConsumer(ctx, req.(*MsgUpdateConsumer)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveConsumer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveConsumer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveConsumer(ctx, req.(*MsgRemoveConsumer)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_OptIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgOptIn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).OptIn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptIn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).OptIn(ctx, req.(*MsgOptIn)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_OptOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgOptOut) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).OptOut(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptOut", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).OptOut(ctx, req.(*MsgOptOut)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetConsumerCommissionRate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, req.(*MsgSetConsumerCommissionRate)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "interchain_security.ccv.provider.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AssignConsumerKey", + Handler: _Msg_AssignConsumerKey_Handler, + }, + { + MethodName: "SubmitConsumerMisbehaviour", + Handler: _Msg_SubmitConsumerMisbehaviour_Handler, + }, + { + MethodName: "SubmitConsumerDoubleVoting", + Handler: _Msg_SubmitConsumerDoubleVoting_Handler, + }, + { + MethodName: "RegisterConsumer", + Handler: _Msg_RegisterConsumer_Handler, + }, + { + MethodName: "InitializeConsumer", + Handler: _Msg_InitializeConsumer_Handler, + }, + { + MethodName: "UpdateConsumer", + Handler: _Msg_UpdateConsumer_Handler, + }, + { + MethodName: "RemoveConsumer", + Handler: _Msg_RemoveConsumer_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "OptIn", + Handler: _Msg_OptIn_Handler, + }, + { + MethodName: "OptOut", + Handler: _Msg_OptOut_Handler, + }, + { + MethodName: "SetConsumerCommissionRate", + Handler: _Msg_SetConsumerCommissionRate_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "interchain_security/ccv/provider/v1/tx.proto", +} + +func (m *MsgAssignConsumerKey) 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 *MsgAssignConsumerKey) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSubmitConsumerMisbehaviourResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAssignConsumerKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + if len(m.ConsumerKey) > 0 { + i -= len(m.ConsumerKey) + copy(dAtA[i:], m.ConsumerKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *MsgSubmitConsumerDoubleVoting) Marshal() (dAtA []byte, err error) { +func (m *MsgAssignConsumerKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2229,31 +2704,42 @@ func (m *MsgSubmitConsumerDoubleVoting) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSubmitConsumerDoubleVoting) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAssignConsumerKeyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAssignConsumerKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.InfractionBlockHeader != nil { - { - size, err := m.InfractionBlockHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 + return len(dAtA) - i, nil +} + +func (m *MsgSubmitConsumerMisbehaviour) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - if m.DuplicateVoteEvidence != nil { + return dAtA[:n], nil +} + +func (m *MsgSubmitConsumerMisbehaviour) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitConsumerMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Misbehaviour != nil { { - size, err := m.DuplicateVoteEvidence.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2280,7 +2766,7 @@ func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *MsgSubmitConsumerDoubleVotingResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgSubmitConsumerMisbehaviourResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2290,12 +2776,12 @@ func (m *MsgSubmitConsumerDoubleVotingResponse) Marshal() (dAtA []byte, err erro return dAtA[:n], nil } -func (m *MsgSubmitConsumerDoubleVotingResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerMisbehaviourResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSubmitConsumerDoubleVotingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerMisbehaviourResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2303,7 +2789,7 @@ func (m *MsgSubmitConsumerDoubleVotingResponse) MarshalToSizedBuffer(dAtA []byte return len(dAtA) - i, nil } -func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { +func (m *MsgSubmitConsumerDoubleVoting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2313,7 +2799,91 @@ func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSubmitConsumerDoubleVoting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.InfractionBlockHeader != nil { + { + size, err := m.InfractionBlockHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.DuplicateVoteEvidence != nil { + { + size, err := m.DuplicateVoteEvidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Submitter) > 0 { + i -= len(m.Submitter) + copy(dAtA[i:], m.Submitter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Submitter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitConsumerDoubleVotingResponse) 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 *MsgSubmitConsumerDoubleVotingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitConsumerDoubleVotingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } @@ -3171,202 +3741,391 @@ func (m *MsgInitializeConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgConsumerAddition) 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 *MsgAssignConsumerKey) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgConsumerAddition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConsumerAddition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ProviderAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.AllowInactiveVals { + i-- + if m.AllowInactiveVals { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 } - l = len(m.ConsumerKey) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.MinStake != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 } - return n -} - -func (m *MsgAssignConsumerKeyResponse) Size() (n int) { - if m == nil { - return 0 + if len(m.Denylist) > 0 { + for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denylist[iNdEx]) + copy(dAtA[i:], m.Denylist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } } - var l int - _ = l - return n -} - -func (m *MsgSubmitConsumerMisbehaviour) Size() (n int) { - if m == nil { - return 0 + if len(m.Allowlist) > 0 { + for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Allowlist[iNdEx]) + copy(dAtA[i:], m.Allowlist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } } - var l int - _ = l - l = len(m.Submitter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.ValidatorSetCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) + i-- + dAtA[i] = 0x78 } - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.ValidatorsPowerCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) + i-- + dAtA[i] = 0x70 } - if m.Misbehaviour != nil { - l = m.Misbehaviour.Size() - n += 1 + l + sovTx(uint64(l)) + if m.Top_N != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) + i-- + dAtA[i] = 0x68 } - return n -} - -func (m *MsgSubmitConsumerMisbehaviourResponse) Size() (n int) { - if m == nil { - return 0 + if len(m.DistributionTransmissionChannel) > 0 { + i -= len(m.DistributionTransmissionChannel) + copy(dAtA[i:], m.DistributionTransmissionChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) + i-- + dAtA[i] = 0x62 } - var l int - _ = l - return n -} - -func (m *MsgSubmitConsumerDoubleVoting) Size() (n int) { - if m == nil { - return 0 + if m.HistoricalEntries != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.HistoricalEntries)) + i-- + dAtA[i] = 0x58 } - var l int - _ = l - l = len(m.Submitter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.BlocksPerDistributionTransmission != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) + i-- + dAtA[i] = 0x50 } - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.ConsumerRedistributionFraction) > 0 { + i -= len(m.ConsumerRedistributionFraction) + copy(dAtA[i:], m.ConsumerRedistributionFraction) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) + i-- + dAtA[i] = 0x4a } - if m.DuplicateVoteEvidence != nil { - l = m.DuplicateVoteEvidence.Size() - n += 1 + l + sovTx(uint64(l)) + n14, err14 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) + if err14 != nil { + return 0, err14 } - if m.InfractionBlockHeader != nil { - l = m.InfractionBlockHeader.Size() - n += 1 + l + sovTx(uint64(l)) + i -= n14 + i = encodeVarintTx(dAtA, i, uint64(n14)) + i-- + dAtA[i] = 0x42 + n15, err15 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + if err15 != nil { + return 0, err15 } - return n -} - -func (m *MsgSubmitConsumerDoubleVotingResponse) Size() (n int) { - if m == nil { - return 0 + i -= n15 + i = encodeVarintTx(dAtA, i, uint64(n15)) + i-- + dAtA[i] = 0x3a + n16, err16 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err16 != nil { + return 0, err16 } - var l int - _ = l - return n -} - -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 + i -= n16 + i = encodeVarintTx(dAtA, i, uint64(n16)) + i-- + dAtA[i] = 0x32 + n17, err17 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) + if err17 != nil { + return 0, err17 } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + i -= n17 + i = encodeVarintTx(dAtA, i, uint64(n17)) + i-- + dAtA[i] = 0x2a + if len(m.BinaryHash) > 0 { + i -= len(m.BinaryHash) + copy(dAtA[i:], m.BinaryHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.BinaryHash))) + i-- + dAtA[i] = 0x22 } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n + if len(m.GenesisHash) > 0 { + i -= len(m.GenesisHash) + copy(dAtA[i:], m.GenesisHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisHash))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgConsumerAdditionResponse) 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 *MsgConsumerAdditionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConsumerAdditionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgRemoveConsumer) Size() (n int) { - if m == nil { - return 0 +func (m *MsgConsumerRemoval) 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 *MsgConsumerRemoval) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConsumerRemoval) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x1a } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) - n += 1 + l + sovTx(uint64(l)) - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + n19, err19 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) + if err19 != nil { + return 0, err19 } - return n + i -= n19 + i = encodeVarintTx(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0x12 + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgRemoveConsumerResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgConsumerRemovalResponse) 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 *MsgConsumerRemovalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConsumerRemovalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgChangeRewardDenoms) Size() (n int) { - if m == nil { - return 0 +func (m *MsgConsumerModification) 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 *MsgConsumerModification) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConsumerModification) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.DenomsToAdd) > 0 { - for _, s := range m.DenomsToAdd { - l = len(s) - n += 1 + l + sovTx(uint64(l)) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x4a + } + if len(m.Denylist) > 0 { + for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denylist[iNdEx]) + copy(dAtA[i:], m.Denylist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x42 } } - if len(m.DenomsToRemove) > 0 { - for _, s := range m.DenomsToRemove { - l = len(s) - n += 1 + l + sovTx(uint64(l)) + if len(m.Allowlist) > 0 { + for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Allowlist[iNdEx]) + copy(dAtA[i:], m.Allowlist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0x3a } } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.ValidatorSetCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) + i-- + dAtA[i] = 0x30 } - return n + if m.ValidatorsPowerCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) + i-- + dAtA[i] = 0x28 + } + if m.Top_N != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) + i-- + dAtA[i] = 0x20 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgChangeRewardDenomsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgConsumerModificationResponse) 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 *MsgConsumerModificationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConsumerModificationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgOptIn) Size() (n int) { +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgAssignConsumerKey) Size() (n int) { if m == nil { return 0 } @@ -3391,7 +4150,7 @@ func (m *MsgOptIn) Size() (n int) { return n } -func (m *MsgOptInResponse) Size() (n int) { +func (m *MsgAssignConsumerKeyResponse) Size() (n int) { if m == nil { return 0 } @@ -3400,28 +4159,28 @@ func (m *MsgOptInResponse) Size() (n int) { return n } -func (m *MsgOptOut) Size() (n int) { +func (m *MsgSubmitConsumerMisbehaviour) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ConsumerId) + l = len(m.Submitter) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ProviderAddr) + l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Signer) - if l > 0 { + if m.Misbehaviour != nil { + l = m.Misbehaviour.Size() n += 1 + l + sovTx(uint64(l)) } return n } -func (m *MsgOptOutResponse) Size() (n int) { +func (m *MsgSubmitConsumerMisbehaviourResponse) Size() (n int) { if m == nil { return 0 } @@ -3430,13 +4189,13 @@ func (m *MsgOptOutResponse) Size() (n int) { return n } -func (m *MsgSetConsumerCommissionRate) Size() (n int) { +func (m *MsgSubmitConsumerDoubleVoting) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ProviderAddr) + l = len(m.Submitter) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3444,10 +4203,194 @@ func (m *MsgSetConsumerCommissionRate) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Rate.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.Signer) - if l > 0 { + if m.DuplicateVoteEvidence != nil { + l = m.DuplicateVoteEvidence.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.InfractionBlockHeader != nil { + l = m.InfractionBlockHeader.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitConsumerDoubleVotingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveConsumer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) + n += 1 + l + sovTx(uint64(l)) + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRemoveConsumerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgChangeRewardDenoms) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DenomsToAdd) > 0 { + for _, s := range m.DenomsToAdd { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.DenomsToRemove) > 0 { + for _, s := range m.DenomsToRemove { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgChangeRewardDenomsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgOptIn) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgOptInResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgOptOut) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgOptOutResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetConsumerCommissionRate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Rate.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n @@ -3646,25 +4589,1415 @@ func (m *ConsumerInitializationRecord) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - return n -} + return n +} + +func (m *MsgInitializeConsumerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConsumerAddition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.InitialHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.GenesisHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BinaryHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) + n += 1 + l + sovTx(uint64(l)) + l = len(m.ConsumerRedistributionFraction) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BlocksPerDistributionTransmission != 0 { + n += 1 + sovTx(uint64(m.BlocksPerDistributionTransmission)) + } + if m.HistoricalEntries != 0 { + n += 1 + sovTx(uint64(m.HistoricalEntries)) + } + l = len(m.DistributionTransmissionChannel) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Top_N != 0 { + n += 1 + sovTx(uint64(m.Top_N)) + } + if m.ValidatorsPowerCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) + } + if m.ValidatorSetCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorSetCap)) + } + if len(m.Allowlist) > 0 { + for _, s := range m.Allowlist { + l = len(s) + n += 2 + l + sovTx(uint64(l)) + } + } + if len(m.Denylist) > 0 { + for _, s := range m.Denylist { + l = len(s) + n += 2 + l + sovTx(uint64(l)) + } + } + l = len(m.Authority) + if l > 0 { + n += 2 + l + sovTx(uint64(l)) + } + if m.MinStake != 0 { + n += 2 + sovTx(uint64(m.MinStake)) + } + if m.AllowInactiveVals { + n += 3 + } + return n +} + +func (m *MsgConsumerAdditionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConsumerRemoval) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) + n += 1 + l + sovTx(uint64(l)) + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgConsumerRemovalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgConsumerModification) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Top_N != 0 { + n += 1 + sovTx(uint64(m.Top_N)) + } + if m.ValidatorsPowerCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) + } + if m.ValidatorSetCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorSetCap)) + } + if len(m.Allowlist) > 0 { + for _, s := range m.Allowlist { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.Denylist) > 0 { + for _, s := range m.Denylist { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgConsumerModificationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAssignConsumerKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAssignConsumerKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Submitter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Misbehaviour == nil { + m.Misbehaviour = &_07_tendermint.Misbehaviour{} + } + if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Submitter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DuplicateVoteEvidence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DuplicateVoteEvidence == nil { + m.DuplicateVoteEvidence = &types.DuplicateVoteEvidence{} + } + if err := m.DuplicateVoteEvidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InfractionBlockHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InfractionBlockHeader == nil { + m.InfractionBlockHeader = &_07_tendermint.Header{} + } + if err := m.InfractionBlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRemoveConsumer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRemoveConsumerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChangeRewardDenoms: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChangeRewardDenoms: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomsToAdd", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomsToAdd = append(m.DenomsToAdd, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomsToRemove", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomsToRemove = append(m.DenomsToRemove, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func (m *MsgInitializeConsumerResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - return n + return nil } +func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { +func (m *MsgOptIn) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3687,10 +6020,10 @@ func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgAssignConsumerKey: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOptIn: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAssignConsumerKey: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOptIn: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3842,7 +6175,7 @@ func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { +func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3865,10 +6198,10 @@ func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOptInResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOptInResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3892,7 +6225,7 @@ func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { +func (m *MsgOptOut) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3915,15 +6248,15 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOptOut: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOptOut: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3951,11 +6284,11 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Submitter = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3983,13 +6316,13 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3999,27 +6332,23 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Misbehaviour == nil { - m.Misbehaviour = &_07_tendermint.Misbehaviour{} - } - if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4042,7 +6371,7 @@ func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { +func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4065,10 +6394,10 @@ func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOptOutResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOptOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -4092,7 +6421,7 @@ func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { +func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4115,15 +6444,15 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetConsumerCommissionRate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetConsumerCommissionRate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4151,7 +6480,7 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Submitter = string(dAtA[iNdEx:postIndex]) + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -4187,9 +6516,9 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DuplicateVoteEvidence", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4199,33 +6528,31 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.DuplicateVoteEvidence == nil { - m.DuplicateVoteEvidence = &types.DuplicateVoteEvidence{} - } - if err := m.DuplicateVoteEvidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InfractionBlockHeader", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4235,27 +6562,23 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.InfractionBlockHeader == nil { - m.InfractionBlockHeader = &_07_tendermint.Header{} - } - if err := m.InfractionBlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4278,7 +6601,7 @@ func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4301,10 +6624,10 @@ func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -4328,7 +6651,7 @@ func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4351,10 +6674,10 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4391,9 +6714,9 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4403,75 +6726,60 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdateRecord", wireType) } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.UpdateRecord == nil { + m.UpdateRecord = &ConsumerUpdateRecord{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + if err := m.UpdateRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4493,7 +6801,7 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { +func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4516,15 +6824,15 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveConsumer: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerUpdateRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerUpdateRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4552,13 +6860,70 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Top_N |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) + } + m.ValidatorsPowerCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorsPowerCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) + } + m.ValidatorSetCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorSetCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4568,28 +6933,27 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4617,8 +6981,47 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) + } + m.MinStake = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinStake |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowInactiveVals = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4640,7 +7043,7 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4663,10 +7066,10 @@ func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveConsumerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -4690,7 +7093,7 @@ func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4713,15 +7116,15 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgChangeRewardDenoms: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeRewardDenoms: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomsToAdd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4749,45 +7152,13 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DenomsToAdd = append(m.DenomsToAdd, string(dAtA[iNdEx:postIndex])) + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomsToRemove", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DenomsToRemove = append(m.DenomsToRemove, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationRecord", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4797,74 +7168,28 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.RegistrationRecord == nil { + m.RegistrationRecord = &ConsumerRegistrationRecord{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + if err := m.RegistrationRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4886,7 +7211,7 @@ func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptIn) Unmarshal(dAtA []byte) error { +func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4909,15 +7234,15 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptIn: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerRegistrationRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptIn: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerRegistrationRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4945,11 +7270,11 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4977,11 +7302,11 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5009,11 +7334,11 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerKey = string(dAtA[iNdEx:postIndex]) + m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5041,7 +7366,7 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5064,7 +7389,7 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5087,12 +7412,44 @@ func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptInResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptInResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -5114,7 +7471,7 @@ func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptOut) Unmarshal(dAtA []byte) error { +func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5137,15 +7494,15 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptOut: wiretype end group for non-group") + return fmt.Errorf("proto: MsgInitializeConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptOut: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgInitializeConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5173,11 +7530,11 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5205,13 +7562,13 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitializationRecord", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5221,23 +7578,27 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + if m.InitializationRecord == nil { + m.InitializationRecord = &ConsumerInitializationRecord{} + } + if err := m.InitializationRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -5260,7 +7621,7 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { +func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5283,67 +7644,118 @@ func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptOutResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerInitializationRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerInitializationRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { return ErrInvalidLengthTx } - if (iNdEx + skippy) > l { + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx + m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) + if m.GenesisHash == nil { + m.GenesisHash = []byte{} } - if iNdEx >= l { + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) + if m.BinaryHash == nil { + m.BinaryHash = []byte{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5353,29 +7765,30 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5385,29 +7798,30 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5417,31 +7831,30 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5451,127 +7864,28 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateConsumer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateConsumer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5599,13 +7913,13 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) } - var stringLen uint64 + m.BlocksPerDistributionTransmission = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5615,29 +7929,35 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) } - if postIndex > l { - return io.ErrUnexpectedEOF + m.HistoricalEntries = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistoricalEntries |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateRecord", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5647,28 +7967,74 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.UpdateRecord == nil { - m.UpdateRecord = &ConsumerUpdateRecord{} + m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgInitializeConsumerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - if err := m.UpdateRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgInitializeConsumerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInitializeConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -5690,7 +8056,7 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5713,15 +8079,15 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConsumerUpdateRecord: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerAddition: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConsumerUpdateRecord: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerAddition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5749,13 +8115,13 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) } - m.Top_N = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5765,16 +8131,30 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Top_N |= uint32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) } - m.ValidatorsPowerCap = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5784,16 +8164,31 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ValidatorsPowerCap |= uint32(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) + if m.GenesisHash == nil { + m.GenesisHash = []byte{} + } + iNdEx = postIndex case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) } - m.ValidatorSetCap = 0 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5803,16 +8198,31 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ValidatorSetCap |= uint32(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) + if m.BinaryHash == nil { + m.BinaryHash = []byte{} + } + iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5822,29 +8232,30 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5854,29 +8265,30 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) } - m.MinStake = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5886,16 +8298,30 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinStake |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -5905,115 +8331,28 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.AllowInactiveVals = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateConsumerResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { + postIndex := iNdEx + msglen + if postIndex < 0 { return ErrInvalidLengthTx } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterConsumer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterConsumer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6041,13 +8380,51 @@ func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) + } + m.BlocksPerDistributionTransmission = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) + } + m.HistoricalEntries = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistoricalEntries |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegistrationRecord", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6057,81 +8434,84 @@ func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.RegistrationRecord == nil { - m.RegistrationRecord = &ConsumerRegistrationRecord{} - } - if err := m.RegistrationRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx + m.Top_N = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Top_N |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx + m.ValidatorsPowerCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorsPowerCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { - return io.ErrUnexpectedEOF + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.ValidatorSetCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorSetCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConsumerRegistrationRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsumerRegistrationRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 16: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6159,11 +8539,11 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Title = string(dAtA[iNdEx:postIndex]) + m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6191,11 +8571,11 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 3: + case 18: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6223,13 +8603,13 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) } - var stringLen uint64 + m.MinStake = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6239,24 +8619,31 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.MinStake |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) } - if postIndex > l { - return io.ErrUnexpectedEOF + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex + m.AllowInactiveVals = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -6278,7 +8665,7 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterConsumerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6301,44 +8688,12 @@ func (m *MsgRegisterConsumerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterConsumerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerAdditionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerAdditionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -6360,7 +8715,7 @@ func (m *MsgRegisterConsumerResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6383,15 +8738,15 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgInitializeConsumer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerRemoval: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInitializeConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerRemoval: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6419,13 +8774,13 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6435,29 +8790,30 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitializationRecord", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6467,28 +8823,74 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.InitializationRecord == nil { - m.InitializationRecord = &ConsumerInitializationRecord{} - } - if err := m.InitializationRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConsumerRemovalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConsumerRemovalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConsumerRemovalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -6510,7 +8912,7 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6533,17 +8935,17 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConsumerInitializationRecord: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerModification: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConsumerInitializationRecord: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerModification: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6553,30 +8955,29 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6586,31 +8987,29 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) - if m.GenesisHash == nil { - m.GenesisHash = []byte{} - } + m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6620,31 +9019,29 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) - if m.BinaryHash == nil { - m.BinaryHash = []byte{} - } + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } - var msglen int + m.Top_N = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6654,30 +9051,16 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Top_N |= uint32(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } - var msglen int + m.ValidatorsPowerCap = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6687,30 +9070,16 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.ValidatorsPowerCap |= uint32(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) } - var msglen int + m.ValidatorSetCap = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6720,30 +9089,16 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.ValidatorSetCap |= uint32(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6753,28 +9108,27 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6802,49 +9156,11 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) + m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) - } - m.BlocksPerDistributionTransmission = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) - } - m.HistoricalEntries = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HistoricalEntries |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6872,7 +9188,7 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6895,7 +9211,7 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgInitializeConsumerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerModificationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6918,10 +9234,10 @@ func (m *MsgInitializeConsumerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgInitializeConsumerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerModificationResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInitializeConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerModificationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From 3e1b72652d733fcffe2ff654a46e3fd429bd9acc Mon Sep 17 00:00:00 2001 From: insumity Date: Mon, 19 Aug 2024 11:42:33 +0200 Subject: [PATCH 28/41] changes messages to only have MsgCreateConsumer and MsgUpdateConsumer and modified protos so that we are backward-compatible --- .../ccv/provider/v1/provider.proto | 113 +- .../ccv/provider/v1/query.proto | 81 +- .../ccv/provider/v1/tx.proto | 443 +- .../integration/partial_set_security_test.go | 2 +- testutil/ibc_testing/generic_setup.go | 22 +- testutil/keeper/unit_test_helpers.go | 23 +- x/ccv/provider/client/cli/tx.go | 118 +- x/ccv/provider/handler.go | 7 +- .../provider/keeper/consumer_equivocation.go | 12 +- x/ccv/provider/keeper/genesis_test.go | 4 +- x/ccv/provider/keeper/grpc_query_test.go | 2 +- x/ccv/provider/keeper/keeper.go | 10 +- x/ccv/provider/keeper/keeper_test.go | 24 +- x/ccv/provider/keeper/key_assignment.go | 2 +- x/ccv/provider/keeper/key_assignment_test.go | 10 +- x/ccv/provider/keeper/legacy_proposal.go | 2 +- x/ccv/provider/keeper/legacy_proposal_test.go | 76 +- x/ccv/provider/keeper/msg_server.go | 90 +- x/ccv/provider/keeper/msg_server_test.go | 220 +- x/ccv/provider/keeper/partial_set_security.go | 8 +- .../keeper/partial_set_security_test.go | 36 +- x/ccv/provider/keeper/permissionless.go | 162 +- x/ccv/provider/keeper/permissionless_test.go | 64 +- x/ccv/provider/keeper/proposal.go | 28 +- x/ccv/provider/keeper/proposal_test.go | 84 +- x/ccv/provider/keeper/relay_test.go | 4 +- x/ccv/provider/migrations/v5/migrations.go | 2 +- x/ccv/provider/types/codec.go | 3 +- x/ccv/provider/types/keys.go | 80 +- x/ccv/provider/types/keys_test.go | 30 +- x/ccv/provider/types/legacy_proposal.go | 4 +- x/ccv/provider/types/legacy_proposal_test.go | 17 +- x/ccv/provider/types/msg.go | 96 +- x/ccv/provider/types/provider.pb.go | 2218 ++++- x/ccv/provider/types/query.pb.go | 672 +- x/ccv/provider/types/query.pb.gw.go | 787 +- x/ccv/provider/types/tx.pb.go | 7500 +++++++---------- 37 files changed, 7226 insertions(+), 5830 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 281d15b4fc..7cea738272 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -21,6 +21,7 @@ import "amino/amino.proto"; // These schemas can change with proper consideration of compatibility or migration. // +// WARNING: This message is deprecated in favor of `MsgCreateConsumer`. // ConsumerAdditionProposal is a governance proposal on the provider chain to // spawn a new consumer chain. If it passes, then all validators on the provider // chain are expected to validate the consumer chain at spawn time or get @@ -112,6 +113,7 @@ message ConsumerAdditionProposal { bool allow_inactive_vals = 21; } +// WARNING: This message is deprecated in favor of `MsgRemoveConsumer`. // ConsumerRemovalProposal is a governance proposal on the provider chain to // remove (and stop) a consumer chain. If it passes, all the consumer chain's // state is removed from the provider chain. The outstanding unbonding operation @@ -124,14 +126,15 @@ message ConsumerRemovalProposal { string title = 1; // the description of the proposal string description = 2; - // the consumer id of the consumer chain to be stopped - string consumer_id = 3; + // the chain-id of the consumer chain to be stopped + string chain_id = 3; // the time on the provider chain at which all validators are responsible to // stop their consumer chain validator node google.protobuf.Timestamp stop_time = 4 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; } +// WARNING: This message is deprecated in favor of `MsgUpdateConsumer`. // ConsumerModificationProposal is a governance proposal on the provider chain to modify parameters of a running // consumer chain. If it passes, the consumer chain's state is updated to take into account the newest params. message ConsumerModificationProposal { @@ -139,8 +142,8 @@ message ConsumerModificationProposal { string title = 1; // the description of the proposal string description = 2; - // the consumer id of the consumer chain to be modified - string consumer_id = 3; + // the chain-id of the consumer chain to be modified + string chain_id = 3; // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. @@ -285,6 +288,13 @@ message ConsumerRemovalProposals { // AddressList contains a list of consensus addresses message AddressList { repeated bytes addresses = 1; } +// WARNING: This message is deprecated and is not used. +// ChannelToChain is used to map a CCV channel ID to the consumer chainID +message ChannelToChain { + string channel_id = 1; + string chain_id = 2; +} + // ValidatorSetChangePackets is a pb list of ccv.ValidatorSetChangePacketData. message ValidatorSetChangePackets { repeated interchain_security.ccv.v1.ValidatorSetChangePacketData list = 1 @@ -356,3 +366,98 @@ message ConsumerRewardsAllocation { (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" ]; } + +// ConsumerMetadata contains general information about the registered chain +message ConsumerMetadata { + // the name of the chain + string name = 1; + // the description of the chain + string description = 2; + // the metadata (e.g., GitHub repository URL) of the chain + string metadata = 3; +} + +// ConsumerInitializationParameters are the parameters needed to launch a chain +message ConsumerInitializationParameters { + // ---------- ---------- ---------- + // Following fields are used when the consumer chain launches and are not needed by the provider afterwards. + // ---------- ---------- ---------- + + // the proposed initial height of new consumer chain. + // For a completely new chain, this will be {0,1}. However, it may be + // different if this is a chain that is converting to a consumer chain. + ibc.core.client.v1.Height initial_height = 1 [ (gogoproto.nullable) = false ]; + // The hash of the consumer chain genesis state without the consumer CCV + // module genesis params. It is used for off-chain confirmation of + // genesis.json validity by validators and other parties. + bytes genesis_hash = 2; + // The hash of the consumer chain binary that should be run by validators on + // chain initialization. It is used for off-chain confirmation of binary + // validity by validators and other parties. + bytes binary_hash = 3; + // spawn time is the time on the provider chain at which the consumer chain + // genesis is finalized and all validators will be responsible for starting + // their consumer chain validator node. + google.protobuf.Timestamp spawn_time = 4 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + google.protobuf.Duration unbonding_period = 5 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + + // ---------- ---------- ---------- + // Following fields are used to construct the consumer genesis of the to-be-launched consumer chain + // and are set up as params on the consumer chain. Those params can then be directly modified by the consumer chain. + // ---------- ---------- ---------- + + // Sent CCV related IBC packets will timeout after this duration + google.protobuf.Duration ccv_timeout_period = 6 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // Sent transfer related IBC packets will timeout after this duration + google.protobuf.Duration transfer_timeout_period = 7 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + string consumer_redistribution_fraction = 8; + // BlocksPerDistributionTransmission is the number of blocks between + // ibc-token-transfers from the consumer chain to the provider chain. On + // sending transmission event, `consumer_redistribution_fraction` of the + // accumulated tokens are sent to the consumer redistribution address. + int64 blocks_per_distribution_transmission = 9; + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + int64 historical_entries = 10; + // The ID of a token transfer channel used for the Reward Distribution + // sub-protocol. If DistributionTransmissionChannel == "", a new transfer + // channel is created on top of the same connection as the CCV channel. + // Note that transfer_channel_id is the ID of the channel end on the consumer + // chain. it is most relevant for chains performing a sovereign to consumer + // changeover in order to maintain the existing ibc transfer channel + string distribution_transmission_channel = 11; +} + + +// PowerShapingParameters contains parameters that shape the validator set that we send to the consumer chain +message PowerShapingParameters { + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + uint32 top_N = 2; + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + uint32 validators_power_cap = 3; + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + uint32 validator_set_cap = 4; + // corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate the consumer chain + repeated string allowlist = 6; + // corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain + repeated string denylist = 7; + // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. + uint64 min_stake = 8; + // Corresponds to whether inactive validators are allowed to validate the consumer chain. + bool allow_inactive_vals = 9; +} diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 1f45a8144c..1568772025 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -17,8 +17,13 @@ service Query { // whose proposal has been accepted rpc QueryConsumerGenesis(QueryConsumerGenesisRequest) returns (QueryConsumerGenesisResponse) { - option (google.api.http).get = - "/interchain_security/ccv/provider/consumer_genesis/{consumer_id}"; + option (google.api.http) = { + // [DEPRECATED] use the {consumer_id} endpoint instead. + get: "/interchain_security/ccv/provider/consumer_genesis/{chain_id}"; + additional_bindings { + get: "/interchain_security/ccv/provider/consumer_genesis/{consumer_id}"; + } + }; } // ConsumerChains queries active consumer chains supported by the provider @@ -90,8 +95,13 @@ service Query { rpc QueryAllPairsValConAddrByConsumerChainID ( QueryAllPairsValConAddrByConsumerChainIDRequest) returns (QueryAllPairsValConAddrByConsumerChainIDResponse) { - option (google.api.http).get = - "/interchain_security/ccv/provider/{consumer_id}"; + option (google.api.http) = { + // [DEPRECATED] use the {consumer_id} endpoint instead. + get: "/interchain_security/ccv/provider/{chain_id}"; + additional_bindings { + get: "/interchain_security/ccv/provider/{consumer_id}"; + } + }; } // QueryParams returns all current values of provider parameters @@ -106,8 +116,13 @@ service Query { rpc QueryConsumerChainOptedInValidators( QueryConsumerChainOptedInValidatorsRequest) returns (QueryConsumerChainOptedInValidatorsResponse) { - option (google.api.http).get = - "/interchain_security/ccv/provider/opted_in_validators/{consumer_id}"; + option (google.api.http) = { + // [DEPRECATED] use the {consumer_id} endpoint instead. + get: "/interchain_security/ccv/provider/opted_in_validators/{chain_id}"; + additional_bindings { + get: "/interchain_security/ccv/provider/opted_in_validators/{consumer_id}"; + } + }; } // QueryConsumerChainsValidatorHasToValidate returns a list of consumer chains @@ -124,8 +139,13 @@ service Query { rpc QueryValidatorConsumerCommissionRate( QueryValidatorConsumerCommissionRateRequest) returns (QueryValidatorConsumerCommissionRateResponse) { - option (google.api.http).get = - "/interchain_security/ccv/provider/consumer_commission_rate/{consumer_id}/{provider_address}"; + option (google.api.http) = { + // [DEPRECATED] use the {consumer_id} endpoint instead. + get: "/interchain_security/ccv/provider/consumer_commission_rate/{chain_id}/{provider_address}"; + additional_bindings { + get: "/interchain_security/ccv/provider/consumer_commission_rate/{consumer_id}/{provider_address}"; + } + }; } // QueryConsumerValidators returns the latest set consumer-validator set for a given chainID @@ -133,8 +153,13 @@ service Query { // because a VSCPacket could be delayed to be delivered on the consumer chain. rpc QueryConsumerValidators(QueryConsumerValidatorsRequest) returns (QueryConsumerValidatorsResponse) { - option (google.api.http).get = - "/interchain_security/ccv/provider/consumer_validators/{consumer_id}"; + option (google.api.http) = { + // [DEPRECATED] use the {consumer_id} endpoint instead. + get: "/interchain_security/ccv/provider/consumer_validators/{chain_id}"; + additional_bindings { + get: "/interchain_security/ccv/provider/consumer_validators/{consumer_id}"; + } + }; } // QueryBlocksUntilNextEpoch returns the number of blocks until the next epoch @@ -154,7 +179,11 @@ service Query { } } -message QueryConsumerGenesisRequest { string consumer_id = 1; } +message QueryConsumerGenesisRequest { + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; + string consumer_id = 2; +} message QueryConsumerGenesisResponse { interchain_security.ccv.v1.ConsumerGenesisState genesis_state = 1 @@ -200,10 +229,12 @@ message Chain { message QueryValidatorConsumerAddrRequest { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // The id of the consumer chain - string consumer_id = 1; + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; // The consensus address of the validator on the provider chain string provider_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + // The id of the consumer chain + string consumer_id = 3; } message QueryValidatorConsumerAddrResponse { @@ -214,10 +245,12 @@ message QueryValidatorConsumerAddrResponse { message QueryValidatorProviderAddrRequest { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // The id of the provider chain - string chain_id = 1; + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; // The consensus address of the validator on the consumer chain string consumer_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + // The id of the consumer chain + string consumer_id = 3; } message QueryValidatorProviderAddrResponse { @@ -258,8 +291,10 @@ message ProposedChain { } message QueryAllPairsValConAddrByConsumerChainIDRequest { + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; // The id of the consumer chain - string consumer_id = 1; + string consumer_id = 2; } message QueryAllPairsValConAddrByConsumerChainIDResponse { @@ -281,7 +316,9 @@ message QueryParamsResponse { } message QueryConsumerChainOptedInValidatorsRequest { - string consumer_id = 1; + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; + string consumer_id = 2; } message QueryConsumerChainOptedInValidatorsResponse { @@ -290,7 +327,9 @@ message QueryConsumerChainOptedInValidatorsResponse { } message QueryConsumerValidatorsRequest { - string consumer_id = 1; + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; + string consumer_id = 2; } message QueryConsumerValidatorsValidator { @@ -321,9 +360,11 @@ message QueryConsumerChainsValidatorHasToValidateResponse { } message QueryValidatorConsumerCommissionRateRequest { - string consumer_id = 1; - // The consensus address of the validator on the provider chain + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; + // The consensus address of the validator on the provider chain string provider_address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + string consumer_id = 3; } message QueryValidatorConsumerCommissionRateResponse { diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 63050daee2..980c462cc8 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -23,14 +23,22 @@ service Msg { rpc AssignConsumerKey(MsgAssignConsumerKey) returns (MsgAssignConsumerKeyResponse); rpc SubmitConsumerMisbehaviour(MsgSubmitConsumerMisbehaviour) returns (MsgSubmitConsumerMisbehaviourResponse); rpc SubmitConsumerDoubleVoting(MsgSubmitConsumerDoubleVoting) returns (MsgSubmitConsumerDoubleVotingResponse); - rpc RegisterConsumer(MsgRegisterConsumer) returns (MsgRegisterConsumerResponse); - rpc InitializeConsumer(MsgInitializeConsumer) returns (MsgInitializeConsumerResponse); + rpc ConsumerAddition(MsgConsumerAddition) returns (MsgConsumerAdditionResponse) { + option deprecated = true; + }; + rpc ConsumerRemoval(MsgConsumerRemoval) returns (MsgConsumerRemovalResponse) { + option deprecated = true; + }; + rpc CreateConsumer(MsgCreateConsumer) returns (MsgCreateConsumerResponse); rpc UpdateConsumer(MsgUpdateConsumer) returns (MsgUpdateConsumerResponse); rpc RemoveConsumer(MsgRemoveConsumer) returns (MsgRemoveConsumerResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); rpc OptIn(MsgOptIn) returns (MsgOptInResponse); rpc OptOut(MsgOptOut) returns (MsgOptOutResponse); rpc SetConsumerCommissionRate(MsgSetConsumerCommissionRate) returns (MsgSetConsumerCommissionRateResponse); + rpc ConsumerModification(MsgConsumerModification) returns (MsgConsumerModificationResponse) { + option deprecated = true; + } } @@ -40,8 +48,8 @@ message MsgAssignConsumerKey { option (gogoproto.goproto_getters) = false; - // The consumer id of the consumer chain to assign a consensus public key to - string consumer_id = 1; + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; // The validator address on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // The consensus public key to use on the consumer. @@ -51,6 +59,9 @@ message MsgAssignConsumerKey { // Tx signer address string signer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // the consumer id of the consumer chain to assign a consensus public key to + string consumer_id = 5; } message MsgAssignConsumerKeyResponse {} @@ -64,11 +75,11 @@ message MsgSubmitConsumerMisbehaviour { option (gogoproto.goproto_getters) = false; string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // the consumer id of the consumer chain where the misbehaviour occurred - string consumer_id = 2; // The Misbehaviour of the consumer chain wrapping // two conflicting IBC headers - ibc.lightclients.tendermint.v1.Misbehaviour misbehaviour = 3; + ibc.lightclients.tendermint.v1.Misbehaviour misbehaviour = 2; + // the consumer id of the consumer chain where the misbehaviour occurred + string consumer_id = 3; } message MsgSubmitConsumerMisbehaviourResponse {} @@ -82,13 +93,13 @@ message MsgSubmitConsumerDoubleVoting { option (gogoproto.goproto_getters) = false; string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // the consumer id of the consumer chain where the double-voting took place - string consumer_id = 2; // The equivocation of the consumer chain wrapping // an evidence of a validator that signed two conflicting votes - tendermint.types.DuplicateVoteEvidence duplicate_vote_evidence = 3; + tendermint.types.DuplicateVoteEvidence duplicate_vote_evidence = 2; // The light client header of the infraction block - ibc.lightclients.tendermint.v1.Header infraction_block_header = 4; + ibc.lightclients.tendermint.v1.Header infraction_block_header = 3; + // the consumer id of the consumer chain where the double-voting took place + string consumer_id = 4; } message MsgSubmitConsumerDoubleVotingResponse {} @@ -106,6 +117,109 @@ message MsgUpdateParams { message MsgUpdateParamsResponse {} +// [DEPRECATED] Use `MsgCreateConsumer` instead +message MsgConsumerAddition { + option (cosmos.msg.v1.signer) = "authority"; + + // the proposed chain-id of the new consumer chain, must be different from all + // other consumer chain ids of the executing provider chain. + string chain_id = 1; + // the proposed initial height of new consumer chain. + // For a completely new chain, this will be {0,1}. However, it may be + // different if this is a chain that is converting to a consumer chain. + ibc.core.client.v1.Height initial_height = 2 [ (gogoproto.nullable) = false ]; + // The hash of the consumer chain genesis state without the consumer CCV + // module genesis params. It is used for off-chain confirmation of + // genesis.json validity by validators and other parties. + bytes genesis_hash = 3; + // The hash of the consumer chain binary that should be run by validators on + // chain initialization. It is used for off-chain confirmation of binary + // validity by validators and other parties. + bytes binary_hash = 4; + // spawn time is the time on the provider chain at which the consumer chain + // genesis is finalized and all validators will be responsible for starting + // their consumer chain validator node. + google.protobuf.Timestamp spawn_time = 5 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + google.protobuf.Duration unbonding_period = 6 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // Sent CCV related IBC packets will timeout after this duration + google.protobuf.Duration ccv_timeout_period = 7 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // Sent transfer related IBC packets will timeout after this duration + google.protobuf.Duration transfer_timeout_period = 8 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + string consumer_redistribution_fraction = 9; + // BlocksPerDistributionTransmission is the number of blocks between + // ibc-token-transfers from the consumer chain to the provider chain. On + // sending transmission event, `consumer_redistribution_fraction` of the + // accumulated tokens are sent to the consumer redistribution address. + int64 blocks_per_distribution_transmission = 10; + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + int64 historical_entries = 11; + // The ID of a token transfer channel used for the Reward Distribution + // sub-protocol. If DistributionTransmissionChannel == "", a new transfer + // channel is created on top of the same connection as the CCV channel. + // Note that transfer_channel_id is the ID of the channel end on the consumer + // chain. it is most relevant for chains performing a sovereign to consumer + // changeover in order to maintain the existing ibc transfer channel + string distribution_transmission_channel = 12; + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + uint32 top_N = 13; + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + uint32 validators_power_cap = 14; + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + uint32 validator_set_cap = 15; + // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate + // the consumer chain. + repeated string allowlist = 16; + // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. + repeated string denylist = 17; + // signer address + string authority = 18 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. + uint64 min_stake = 19; + // Corresponds to whether inactive validators are allowed to validate the consumer chain. + bool allow_inactive_vals = 20; +} + +// MsgConsumerAdditionResponse defines response type for MsgConsumerAddition messages +message MsgConsumerAdditionResponse {} + +// [DEPRECATED] Use `MsgRemoveConsumer` instead +message MsgConsumerRemoval { + option (cosmos.msg.v1.signer) = "authority"; + + // the chain-id of the consumer chain to be stopped + string chain_id = 1; + // the time on the provider chain at which all validators are responsible to + // stop their consumer chain validator node + google.protobuf.Timestamp stop_time = 2 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // signer address + string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgConsumerRemovalResponse defines response type for MsgConsumerRemoval messages +message MsgConsumerRemovalResponse {} + + // MsgRemoveConsumer defines the message used to remove (and stop) a consumer chain. // If it passes, all the consumer chain's state is eventually removed from the provider chain. message MsgRemoveConsumer { @@ -147,8 +261,8 @@ message MsgOptIn { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "signer"; - // the consumer id of the consumer chain to opt in to - string consumer_id = 1; + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; // the validator address on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // (optional) The consensus public key to use on the consumer in json string format corresponding to proto-any, @@ -158,7 +272,8 @@ message MsgOptIn { string consumer_key = 3; // signer address string signer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - + // the consumer id of the consumer chain to opt in to + string consumer_id = 5; } message MsgOptInResponse {} @@ -167,13 +282,14 @@ message MsgOptOut { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "signer"; - // the consumer id of the consumer chain to opt out from - string consumer_id = 1; + // [DEPRECATED] use `consumer_id` instead + string chain_id = 1 [deprecated = true]; // the validator address on the provider string provider_addr = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // signer address string signer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - + // the consumer id of the consumer chain to opt out from + string consumer_id = 4; } message MsgOptOutResponse {} @@ -187,8 +303,8 @@ message MsgSetConsumerCommissionRate { // The validator address on the provider string provider_addr = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - // The consumer id of the consumer chain to set a commission rate - string consumer_id = 2; + // [DEPRECATED] use `consumer_id` instead + string chain_id = 2 [deprecated = true]; // The rate to charge delegators on the consumer chain, as a fraction // TODO: migrate rate from sdk.Dec to math.LegacyDec string rate = 3 [ @@ -198,295 +314,96 @@ message MsgSetConsumerCommissionRate { ]; // signer address string signer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // the consumer id of the consumer chain to set the commission rate + string consumer_id = 5; } message MsgSetConsumerCommissionRateResponse {} -// MsgUpdateConsumer defines the message used to modify a running consumer chain. -// If it passes, the consumer chain's parameters are updated. -message MsgUpdateConsumer { +// [DEPRECATED] Use `MsgUpdateConsumer` instead +message MsgConsumerModification { option (cosmos.msg.v1.signer) = "authority"; - // signer address - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // the consumer id of the consumer chain to be updated - string consumer_id = 2; - - ConsumerUpdateRecord update_record = 3; -} - -// ConsumerUpdateRecord is the record that contains parameters to modify in the to-be-updated chain -message ConsumerUpdateRecord { - // - string owner_address = 1; + // the title of the proposal + string title = 1; + // the description of the proposal + string description = 2; + // the chain-id of the consumer chain to be modified + string chain_id = 3; // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - uint32 top_N = 2; + uint32 top_N = 4; // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - uint32 validators_power_cap = 3; + uint32 validators_power_cap = 5; // Corresponds to the maximum number of validators that can validate a consumer chain. // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - uint32 validator_set_cap = 4; + uint32 validator_set_cap = 6; // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate // the consumer chain. - repeated string allowlist = 5; + repeated string allowlist = 7; // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - repeated string denylist = 6; + repeated string denylist = 8; + // signer address + string authority = 9 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - uint64 min_stake = 7; + uint64 min_stake = 10; // Corresponds to whether inactive validators are allowed to validate the consumer chain. - bool allow_inactive_vals = 8; + bool allow_inactive_vals = 11; } -// MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages -message MsgUpdateConsumerResponse {} +message MsgConsumerModificationResponse {} -// MsgRegisterConsumer defines the message that registers a consumer chain -message MsgRegisterConsumer { +// MsgCreateConsumer defines the message that creates a consumer chain +message MsgCreateConsumer { option (cosmos.msg.v1.signer) = "signer"; // signer address string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - ConsumerRegistrationRecord registration_record = 2; -} - -// ConsumerRegistrationRecord is the record that contains information for the registered chain -message ConsumerRegistrationRecord { - // the title of the chain that is to be registered - string title = 1; - // the description of the chain that is to be registered - string description = 2; - // the metadata (e.g., GitHub repository URL) of the chain that is to be registered - string metadata = 3; // the chain id of the new consumer chain - string chain_id = 4; -} + string chain_id = 2; -// MsgRegisterConsumerResponse defines response type for MsgRegisterConsumer -message MsgRegisterConsumerResponse { - string consumer_id = 1; -} + ConsumerMetadata metadata = 3; -// MsgInitializeConsumer defines the message that initializes the consumer chain with the given consumer id -message MsgInitializeConsumer { - option (cosmos.msg.v1.signer) = "authority"; + ConsumerInitializationParameters initialization_parameters = 4; - // signer address - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // consumer id of the to-be-initialized consumer chain - string consumer_id = 2; - - ConsumerInitializationRecord initialization_record = 3; + PowerShapingParameters power_shaping_parameters = 5; } -// ConsumerInitializationRecord is the record that contains information for the to-be-initialized chain -message ConsumerInitializationRecord { - // ---------- ---------- ---------- - // Following fields are used when the consumer chain launches and are not needed by the provider afterwards. - // ---------- ---------- ---------- - - // the proposed initial height of new consumer chain. - // For a completely new chain, this will be {0,1}. However, it may be - // different if this is a chain that is converting to a consumer chain. - ibc.core.client.v1.Height initial_height = 1 [ (gogoproto.nullable) = false ]; - // The hash of the consumer chain genesis state without the consumer CCV - // module genesis params. It is used for off-chain confirmation of - // genesis.json validity by validators and other parties. - bytes genesis_hash = 2; - // The hash of the consumer chain binary that should be run by validators on - // chain initialization. It is used for off-chain confirmation of binary - // validity by validators and other parties. - bytes binary_hash = 3; - // spawn time is the time on the provider chain at which the consumer chain - // genesis is finalized and all validators will be responsible for starting - // their consumer chain validator node. - google.protobuf.Timestamp spawn_time = 4 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - // Unbonding period for the consumer, - // which should be smaller than that of the provider in general. - google.protobuf.Duration unbonding_period = 5 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - - - // ---------- ---------- ---------- - // Following fields are used to construct the consumer genesis of the to-be-launched consumer chain - // and are set up as params on the consumer chain. Those params can then be directly modified by the consumer chain. - // ---------- ---------- ---------- - - // Sent CCV related IBC packets will timeout after this duration - google.protobuf.Duration ccv_timeout_period = 6 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - // Sent transfer related IBC packets will timeout after this duration - google.protobuf.Duration transfer_timeout_period = 7 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - // The fraction of tokens allocated to the consumer redistribution address - // during distribution events. The fraction is a string representing a - // decimal number. For example "0.75" would represent 75%. - string consumer_redistribution_fraction = 8; - // BlocksPerDistributionTransmission is the number of blocks between - // ibc-token-transfers from the consumer chain to the provider chain. On - // sending transmission event, `consumer_redistribution_fraction` of the - // accumulated tokens are sent to the consumer redistribution address. - int64 blocks_per_distribution_transmission = 9; - // The number of historical info entries to persist in store. - // This param is a part of the cosmos sdk staking module. In the case of - // a ccv enabled consumer chain, the ccv module acts as the staking module. - int64 historical_entries = 10; - // The ID of a token transfer channel used for the Reward Distribution - // sub-protocol. If DistributionTransmissionChannel == "", a new transfer - // channel is created on top of the same connection as the CCV channel. - // Note that transfer_channel_id is the ID of the channel end on the consumer - // chain. it is most relevant for chains performing a sovereign to consumer - // changeover in order to maintain the existing ibc transfer channel - string distribution_transmission_channel = 11; +// MsgCreateConsumerResponse defines response type for MsgCreateConsumer +message MsgCreateConsumerResponse { + string consumer_id = 1; } -// MsgInitializeConsumerResponse defines response type for MsgRegisterConsumer -message MsgInitializeConsumerResponse {} - - -// Keeping the old messages (`MsgConsumerAddition`, `MsgConsumerRemoval`, `MsgConsumerModification`) here so that -// existing proposals can be deserialized - -message MsgConsumerAddition { - option (cosmos.msg.v1.signer) = "authority"; - - // the proposed chain-id of the new consumer chain, must be different from all - // other consumer chain ids of the executing provider chain. - string chain_id = 1; - // the proposed initial height of new consumer chain. - // For a completely new chain, this will be {0,1}. However, it may be - // different if this is a chain that is converting to a consumer chain. - ibc.core.client.v1.Height initial_height = 2 [ (gogoproto.nullable) = false ]; - // The hash of the consumer chain genesis state without the consumer CCV - // module genesis params. It is used for off-chain confirmation of - // genesis.json validity by validators and other parties. - bytes genesis_hash = 3; - // The hash of the consumer chain binary that should be run by validators on - // chain initialization. It is used for off-chain confirmation of binary - // validity by validators and other parties. - bytes binary_hash = 4; - // spawn time is the time on the provider chain at which the consumer chain - // genesis is finalized and all validators will be responsible for starting - // their consumer chain validator node. - google.protobuf.Timestamp spawn_time = 5 - [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +// MsgUpdateConsumer defines the message used to modify a consumer chain. +message MsgUpdateConsumer { + option (cosmos.msg.v1.signer) = "signer"; - // Unbonding period for the consumer, - // which should be smaller than that of the provider in general. - google.protobuf.Duration unbonding_period = 6 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - // Sent CCV related IBC packets will timeout after this duration - google.protobuf.Duration ccv_timeout_period = 7 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - // Sent transfer related IBC packets will timeout after this duration - google.protobuf.Duration transfer_timeout_period = 8 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - // The fraction of tokens allocated to the consumer redistribution address - // during distribution events. The fraction is a string representing a - // decimal number. For example "0.75" would represent 75%. - string consumer_redistribution_fraction = 9; - // BlocksPerDistributionTransmission is the number of blocks between - // ibc-token-transfers from the consumer chain to the provider chain. On - // sending transmission event, `consumer_redistribution_fraction` of the - // accumulated tokens are sent to the consumer redistribution address. - int64 blocks_per_distribution_transmission = 10; - // The number of historical info entries to persist in store. - // This param is a part of the cosmos sdk staking module. In the case of - // a ccv enabled consumer chain, the ccv module acts as the staking module. - int64 historical_entries = 11; - // The ID of a token transfer channel used for the Reward Distribution - // sub-protocol. If DistributionTransmissionChannel == "", a new transfer - // channel is created on top of the same connection as the CCV channel. - // Note that transfer_channel_id is the ID of the channel end on the consumer - // chain. it is most relevant for chains performing a sovereign to consumer - // changeover in order to maintain the existing ibc transfer channel - string distribution_transmission_channel = 12; - // Corresponds to the percentage of validators that have to validate the chain under the Top N case. - // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power - // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. - // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - uint32 top_N = 13; - // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if - // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the - // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only - // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need - // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - uint32 validators_power_cap = 14; - // Corresponds to the maximum number of validators that can validate a consumer chain. - // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - uint32 validator_set_cap = 15; - // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate - // the consumer chain. - repeated string allowlist = 16; - // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - repeated string denylist = 17; // signer address - string authority = 18 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - uint64 min_stake = 19; - // Corresponds to whether inactive validators are allowed to validate the consumer chain. - bool allow_inactive_vals = 20; -} + string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -// MsgConsumerAdditionResponse defines response type for MsgConsumerAddition messages -message MsgConsumerAdditionResponse {} + // the consumer id of the consumer chain to be updated + string consumer_id = 2; -message MsgConsumerRemoval { - option (cosmos.msg.v1.signer) = "authority"; + // the new owner of the consumer when updated + string owner_address = 3; - // the chain-id of the consumer chain to be stopped - string chain_id = 1; - // the time on the provider chain at which all validators are responsible to - // stop their consumer chain validator node - google.protobuf.Timestamp stop_time = 2 - [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - // signer address - string authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -} + // the metadata of the consumer when updated + ConsumerMetadata metadata = 4; -// MsgConsumerRemovalResponse defines response type for MsgConsumerRemoval messages -message MsgConsumerRemovalResponse {} + // initialization parameters can only be updated before a chain has launched + ConsumerInitializationParameters initialization_parameters = 5; -// MsgConsumerModification message contains a governance proposal on the provider chain to -// modify a running consumer chain. If it passes, the consumer chain's -// parameters are updated. -// -// Note: this replaces ConsumerModificationProposal which is deprecated and will be removed soon -message MsgConsumerModification { - // the title of the proposal - string title = 1; - // the description of the proposal - string description = 2; - // the chain-id of the consumer chain to be modified - string chain_id = 3; - // Corresponds to the percentage of validators that have to validate the chain under the Top N case. - // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power - // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. - // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - uint32 top_N = 4; - // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if - // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the - // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only - // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need - // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - uint32 validators_power_cap = 5; - // Corresponds to the maximum number of validators that can validate a consumer chain. - // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - uint32 validator_set_cap = 6; - // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate - // the consumer chain. - repeated string allowlist = 7; - // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - repeated string denylist = 8; - // signer address - string authority = 9 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // the power-shaping parameters of the consumer when updated + PowerShapingParameters power_shaping_parameters = 6; } -message MsgConsumerModificationResponse {} \ No newline at end of file +// MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages +message MsgUpdateConsumerResponse {} \ No newline at end of file diff --git a/tests/integration/partial_set_security_test.go b/tests/integration/partial_set_security_test.go index 8f226cfe91..e99ce6f44a 100644 --- a/tests/integration/partial_set_security_test.go +++ b/tests/integration/partial_set_security_test.go @@ -152,7 +152,7 @@ func TestMinStake(t *testing.T) { // adjust parameters // set the minStake according to the test case - providerKeeper.SetConsumerUpdateRecord(s.providerChain.GetContext(), s.getFirstBundle().ConsumerId, types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(s.providerChain.GetContext(), s.getFirstBundle().ConsumerId, types.PowerShapingParameters{ MinStake: tc.minStake, }) diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index c5503ab811..53a1687980 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -140,24 +140,24 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( providerApp := providerChain.App.(Tp) providerKeeper := providerApp.GetProviderKeeper() - registrationRecord := testkeeper.GetTestRegistrationRecord() - registrationRecord.ChainId = chainID + consumerMetadata := testkeeper.GetTestConsumerMetadata() - initializationRecord := testkeeper.GetTestInitializationRecord() + initializationParameters := testkeeper.GetTestInitializationParameters() // NOTE: we cannot use the time.Now() because the coordinator chooses a hardcoded start time // using time.Now() could set the spawn time to be too far in the past or too far in the future - initializationRecord.SpawnTime = coordinator.CurrentTime + initializationParameters.SpawnTime = coordinator.CurrentTime // NOTE: the initial height passed to CreateConsumerClient // must be the height on the consumer when InitGenesis is called - initializationRecord.InitialHeight = clienttypes.Height{RevisionNumber: 0, RevisionHeight: 2} + initializationParameters.InitialHeight = clienttypes.Height{RevisionNumber: 0, RevisionHeight: 2} - updateRecord := testkeeper.GetTestUpdateRecord() - updateRecord.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient + powerShapingParameters := testkeeper.GetTestPowerShapingParameters() + powerShapingParameters.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient consumerId := fmt.Sprintf("%d", index+2) - providerKeeper.SetConsumerRegistrationRecord(providerChain.GetContext(), consumerId, registrationRecord) - providerKeeper.SetConsumerInitializationRecord(providerChain.GetContext(), consumerId, initializationRecord) - providerKeeper.SetConsumerUpdateRecord(providerChain.GetContext(), consumerId, updateRecord) + providerKeeper.SetConsumerChainId(providerChain.GetContext(), consumerId, chainID) + providerKeeper.SetConsumerMetadata(providerChain.GetContext(), consumerId, consumerMetadata) + providerKeeper.SetConsumerInitializationParameters(providerChain.GetContext(), consumerId, initializationParameters) + providerKeeper.SetConsumerPowerShapingParameters(providerChain.GetContext(), consumerId, powerShapingParameters) providerKeeper.SetConsumerPhase(providerChain.GetContext(), consumerId, keeper.Initialized) providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(providerChain.GetContext(), consumerId, coordinator.CurrentTime) @@ -219,6 +219,6 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( ConsumerId: consumerId, Chain: testChain, App: consumerToReturn, - TopN: updateRecord.Top_N, + TopN: powerShapingParameters.Top_N, } } diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index a627893831..3c55fc59ec 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -231,9 +231,10 @@ func SetupForStoppingConsumerChain(t *testing.T, ctx sdk.Context, gomock.InOrder(expectations...) - providerKeeper.SetConsumerRegistrationRecord(ctx, consumerId, GetTestRegistrationRecord()) - providerKeeper.SetConsumerInitializationRecord(ctx, consumerId, GetTestInitializationRecord()) - providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, GetTestUpdateRecord()) + providerKeeper.SetConsumerChainId(ctx, consumerId, "chainID") + providerKeeper.SetConsumerMetadata(ctx, consumerId, GetTestConsumerMetadata()) + providerKeeper.SetConsumerInitializationParameters(ctx, consumerId, GetTestInitializationParameters()) + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, GetTestPowerShapingParameters()) providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) err := providerKeeper.CreateConsumerClient(ctx, consumerId) @@ -272,16 +273,16 @@ func TestProviderStateIsCleanedAfterConsumerChainIsStopped(t *testing.T, ctx sdk require.Zero(t, providerKeeper.GetEquivocationEvidenceMinHeight(ctx, consumerId)) } -func GetTestRegistrationRecord() providertypes.ConsumerRegistrationRecord { - return providertypes.ConsumerRegistrationRecord{ - Title: "title", +func GetTestConsumerMetadata() providertypes.ConsumerMetadata { + return providertypes.ConsumerMetadata{ + Name: "chain name", Description: "description", - ChainId: "chainID", + Metadata: "metadata", } } -func GetTestInitializationRecord() providertypes.ConsumerInitializationRecord { - return providertypes.ConsumerInitializationRecord{ +func GetTestInitializationParameters() providertypes.ConsumerInitializationParameters { + return providertypes.ConsumerInitializationParameters{ InitialHeight: clienttypes.NewHeight(4, 5), GenesisHash: []byte("gen_hash"), BinaryHash: []byte("bin_hash"), @@ -296,8 +297,8 @@ func GetTestInitializationRecord() providertypes.ConsumerInitializationRecord { } } -func GetTestUpdateRecord() providertypes.ConsumerUpdateRecord { - return providertypes.ConsumerUpdateRecord{ +func GetTestPowerShapingParameters() providertypes.PowerShapingParameters { + return providertypes.PowerShapingParameters{ Top_N: 0, ValidatorsPowerCap: 0, ValidatorSetCap: 0, diff --git a/x/ccv/provider/client/cli/tx.go b/x/ccv/provider/client/cli/tx.go index c81d92f68c..90624498a4 100644 --- a/x/ccv/provider/client/cli/tx.go +++ b/x/ccv/provider/client/cli/tx.go @@ -37,8 +37,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(NewAssignConsumerKeyCmd()) cmd.AddCommand(NewSubmitConsumerMisbehaviourCmd()) cmd.AddCommand(NewSubmitConsumerDoubleVotingCmd()) - cmd.AddCommand(NewRegisterConsumerCmd()) - cmd.AddCommand(NewInitializeConsumerCmd()) + cmd.AddCommand(NewCreateConsumerCmd()) cmd.AddCommand(NewUpdateConsumerCmd()) cmd.AddCommand(NewRemoveConsumerCmd()) cmd.AddCommand(NewOptInCmd()) @@ -214,19 +213,19 @@ Example: return cmd } -func NewRegisterConsumerCmd() *cobra.Command { +func NewCreateConsumerCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "register-consumer [path/to/registration-record.json]", - Short: "register a consumer chain", + Use: "create-consumer [chain-id] [path/to/metadata.json] [path/to/initialization-parameters.json] [path/to/power-shaping-parameters.json]", + Short: "create a consumer chain", Long: strings.TrimSpace( - fmt.Sprintf(`Register a consumer chain to get back the assigned consumer id of this chain. + fmt.Sprintf(`Create a consumer chain and get the assigned consumer id of this chain. Note that the one that signs this message is the owner of this consumer chain. The owner can be later changed by updating the consumer chain. Example: -%s tx provider register-consumer [path/to/registration-record.json] --from node0 --home ../node0 --chain-id $CID +%s tx provider create-consumer [chain-id] [path/to/metadata.json] [path/to/initialization-parameters.json] [path/to/power-shaping-parameters.json] --from node0 --home ../node0 --chain-id $CID `, version.AppName)), - Args: cobra.ExactArgs(1), + Args: cobra.ExactArgs(4), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -240,74 +239,41 @@ Example: txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) signer := clientCtx.GetFromAddress().String() - registrationRecord := types.ConsumerRegistrationRecord{} - registrationRecordJson, err := os.ReadFile(args[0]) - if err != nil { - return err - } - if err := json.Unmarshal(registrationRecordJson, ®istrationRecord); err != nil { - return fmt.Errorf("registration record unmarshalling failed: %w", err) - } - msg, err := types.NewMsgRegisterConsumer(signer, registrationRecord) + chainId := args[0] + + metadata := types.ConsumerMetadata{} + metadataJson, err := os.ReadFile(args[1]) if err != nil { return err } - if err := msg.ValidateBasic(); err != nil { - return err + if err = json.Unmarshal(metadataJson, &metadata); err != nil { + return fmt.Errorf("metadata unmarshalling failed: %w", err) } - return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - _ = cmd.MarkFlagRequired(flags.FlagFrom) - - return cmd -} - -func NewInitializeConsumerCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "initialize-consumer [consumer-id] [path/to/initialization-record.json]", - Short: "initialize a consumer chain", - Long: strings.TrimSpace( - fmt.Sprintf(`Initialize a consumer chain to get it ready to launch -Note that only the owner of the chain can initialize it. - -Example: -%s tx provider initialize-consumer [consumer-id] [path/to/initialization-record.json] --from node0 --home ../node0 --chain-id $CID -`, version.AppName)), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) + initializationParameters := types.ConsumerInitializationParameters{} + initializationParametersJson, err := os.ReadFile(args[2]) if err != nil { return err } - - txf, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) - if err != nil { - return err + if err = json.Unmarshal(initializationParametersJson, &initializationParameters); err != nil { + return fmt.Errorf("initialization parameters unmarshalling failed: %w", err) } - txf = txf.WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) - signer := clientCtx.GetFromAddress().String() - consumerId := args[0] - initializationRecord := types.ConsumerInitializationRecord{} - initializationRecordJson, err := os.ReadFile(args[1]) + powerShapingParameters := types.PowerShapingParameters{} + powerShapingParametersJson, err := os.ReadFile(args[3]) if err != nil { return err } - if err := json.Unmarshal(initializationRecordJson, &initializationRecord); err != nil { - return fmt.Errorf("initialization record unmarshalling failed: %w", err) + if err = json.Unmarshal(powerShapingParametersJson, &powerShapingParameters); err != nil { + return fmt.Errorf("power-shaping parameters unmarshalling failed: %w", err) } - msg, err := types.NewMsgInitializeConsumer(signer, consumerId, initializationRecord) + msg, err := types.NewMsgCreateConsumer(signer, chainId, metadata, initializationParameters, powerShapingParameters) if err != nil { return err } - if err := msg.ValidateBasic(); err != nil { + if err = msg.ValidateBasic(); err != nil { return err } @@ -324,16 +290,16 @@ Example: func NewUpdateConsumerCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "update-consumer [consumer-id] [path/to/update-record.json]", + Use: "update-consumer [consumer-id] [owner-address] [path/to/metadata.json] [path/to/initialization-parameters.json] [path/to/power-shaping-parameters.json]", Short: "update a consumer chain", Long: strings.TrimSpace( - fmt.Sprintf(`Update a consumer chain to change its running parameters (e.g., the allow list). + fmt.Sprintf(`Update a consumer chain to change its parameters (e.g., spawn time, allow list, etc.). Note that only the owner of the chain can initialize it. Example: -%s tx provider update-consumer [consumer-id] [path/to/update-record.json] --from node0 --home ../node0 --chain-id $CID +%s tx provider update-consumer [consumer-id] [owner-address] [path/to/metadata.json] [path/to/initialization-parameters.json] [path/to/power-shaping-parameters.json] --from node0 --home ../node0 --chain-id $CID `, version.AppName)), - Args: cobra.ExactArgs(2), + Args: cobra.ExactArgs(5), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -348,16 +314,36 @@ Example: signer := clientCtx.GetFromAddress().String() consumerId := args[0] - updateRecord := types.ConsumerUpdateRecord{} - updateRecordJson, err := os.ReadFile(args[1]) + ownerAddress := args[1] + + metadata := types.ConsumerMetadata{} + metadataJson, err := os.ReadFile(args[2]) + if err != nil { + return err + } + if err = json.Unmarshal(metadataJson, &metadata); err != nil { + return fmt.Errorf("metadata unmarshalling failed: %w", err) + } + + initializationParameters := types.ConsumerInitializationParameters{} + initializationParametersJson, err := os.ReadFile(args[3]) + if err != nil { + return err + } + if err = json.Unmarshal(initializationParametersJson, &initializationParameters); err != nil { + return fmt.Errorf("initialization parameters unmarshalling failed: %w", err) + } + + powerShapingParameters := types.PowerShapingParameters{} + powerShapingParametersJson, err := os.ReadFile(args[4]) if err != nil { return err } - if err := json.Unmarshal(updateRecordJson, &updateRecord); err != nil { - return fmt.Errorf("update record unmarshalling failed: %w", err) + if err = json.Unmarshal(powerShapingParametersJson, &powerShapingParameters); err != nil { + return fmt.Errorf("power-shaping parameters unmarshalling failed: %w", err) } - msg, err := types.NewMsgUpdateConsumer(signer, consumerId, updateRecord) + msg, err := types.NewMsgUpdateConsumer(signer, consumerId, ownerAddress, metadata, initializationParameters, powerShapingParameters) if err != nil { return err } diff --git a/x/ccv/provider/handler.go b/x/ccv/provider/handler.go index 81d3a9a065..937fcb1805 100644 --- a/x/ccv/provider/handler.go +++ b/x/ccv/provider/handler.go @@ -36,11 +36,8 @@ func NewHandler(k *keeper.Keeper) baseapp.MsgServiceHandler { case *types.MsgSetConsumerCommissionRate: res, err := msgServer.SetConsumerCommissionRate(ctx, msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRegisterConsumer: - res, err := msgServer.RegisterConsumer(ctx, msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgInitializeConsumer: - res, err := msgServer.InitializeConsumer(ctx, msg) + case *types.MsgCreateConsumer: + res, err := msgServer.CreateConsumer(ctx, msg) return sdk.WrapServiceResult(ctx, res, err) case *types.MsgUpdateConsumer: res, err := msgServer.UpdateConsumer(ctx, msg) diff --git a/x/ccv/provider/keeper/consumer_equivocation.go b/x/ccv/provider/keeper/consumer_equivocation.go index 79b3fa4f93..1d4ff5e2e7 100644 --- a/x/ccv/provider/keeper/consumer_equivocation.go +++ b/x/ccv/provider/keeper/consumer_equivocation.go @@ -58,13 +58,13 @@ func (k Keeper) HandleConsumerDoubleVoting( } // get the chainId of this consumer chain to verify the double-voting evidence - chainId, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + chainId, err := k.GetConsumerChainId(ctx, consumerId) if err != nil { return err } // verifies the double voting evidence using the consumer chain public key - if err = k.VerifyDoubleVotingEvidence(*evidence, chainId.ChainId, pubkey); err != nil { + if err = k.VerifyDoubleVotingEvidence(*evidence, chainId, pubkey); err != nil { return err } @@ -301,13 +301,13 @@ func headerToLightBlock(h ibctmtypes.Header) (*tmtypes.LightBlock, error) { func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehaviour ibctmtypes.Misbehaviour) error { chainId := misbehaviour.Header1.Header.ChainID - registrationRecord, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + consumerChainId, err := k.GetConsumerChainId(ctx, consumerId) if err != nil { return err - } else if registrationRecord.ChainId != chainId { - return fmt.Errorf("incorrect misbheaviour for a different chain id (%s) than that of the consumer chain %s (consumerId): %s", + } else if consumerChainId != chainId { + return fmt.Errorf("incorrect misbehaviour for a different chain id (%s) than that of the consumer chain %s (consumerId): %s", chainId, - registrationRecord.ChainId, + consumerChainId, consumerId) } diff --git a/x/ccv/provider/keeper/genesis_test.go b/x/ccv/provider/keeper/genesis_test.go index c93e28501b..8f305f1197 100644 --- a/x/ccv/provider/keeper/genesis_test.go +++ b/x/ccv/provider/keeper/genesis_test.go @@ -67,8 +67,8 @@ func TestInitAndExportGenesis(t *testing.T) { SpawnTime: oneHourFromNow, }}, []providertypes.ConsumerRemovalProposal{{ - ConsumerId: cChainIDs[0], - StopTime: oneHourFromNow, + ChainId: cChainIDs[0], + StopTime: oneHourFromNow, }}, params, []providertypes.ValidatorConsumerPubKey{ diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index d4186539fe..1473138fba 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -284,7 +284,7 @@ func TestGetConsumerChain(t *testing.T) { clientID := fmt.Sprintf("client-%d", len(chainIDs)-i) topN := topNs[i] pk.SetConsumerClientId(ctx, chainID, clientID) - pk.SetConsumerUpdateRecord(ctx, chainID, types.ConsumerUpdateRecord{ + pk.SetConsumerPowerShapingParameters(ctx, chainID, types.PowerShapingParameters{ Top_N: topN, ValidatorSetCap: validatorSetCaps[i], ValidatorsPowerCap: validatorPowerCaps[i], diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index b5def5cfe6..0d11f7ae12 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -761,7 +761,7 @@ func (k Keeper) GetTopN( ctx sdk.Context, consumerId string, ) uint32 { - updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) return updateRecord.Top_N } @@ -916,7 +916,7 @@ func (k Keeper) GetValidatorsPowerCap( ctx sdk.Context, consumerId string, ) uint32 { - updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) return updateRecord.ValidatorsPowerCap } @@ -925,7 +925,7 @@ func (k Keeper) GetValidatorSetCap( ctx sdk.Context, consumerId string, ) uint32 { - updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) return updateRecord.ValidatorSetCap } @@ -1100,7 +1100,7 @@ func (k Keeper) GetMinStake( ctx sdk.Context, consumerId string, ) uint64 { - updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) return updateRecord.MinStake } @@ -1110,7 +1110,7 @@ func (k Keeper) AllowsInactiveValidators( ctx sdk.Context, consumerId string, ) bool { - updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) + updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) return updateRecord.AllowInactiveVals } diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 5f0ad1eccb..5419d8be30 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -395,7 +395,7 @@ func TestTopN(t *testing.T) { } for _, test := range tests { - providerKeeper.SetConsumerUpdateRecord(ctx, test.consumerId, types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, test.consumerId, types.PowerShapingParameters{ Top_N: test.N, }) topN := providerKeeper.GetTopN(ctx, test.consumerId) @@ -563,14 +563,14 @@ func TestAllowInactiveValidators(t *testing.T) { require.False(t, k.AllowsInactiveValidators(ctx, consumerId)) // set the chain to allow inactive validators - k.SetConsumerUpdateRecord(ctx, consumerId, types.ConsumerUpdateRecord{ + k.SetConsumerPowerShapingParameters(ctx, consumerId, types.PowerShapingParameters{ AllowInactiveVals: true, }) // check that AllowsInactiveValidators returns true require.True(t, k.AllowsInactiveValidators(ctx, consumerId)) // set the chain to not allow inactive validators - k.SetConsumerUpdateRecord(ctx, consumerId, types.ConsumerUpdateRecord{ + k.SetConsumerPowerShapingParameters(ctx, consumerId, types.PowerShapingParameters{ AllowInactiveVals: false, }) @@ -609,38 +609,38 @@ func TestKeeperConsumerParams(t *testing.T) { { name: "Minimum Stake", settingFunc: func(ctx sdk.Context, id string, val int64) { - k.SetConsumerUpdateRecord(ctx, id, - types.ConsumerUpdateRecord{ + k.SetConsumerPowerShapingParameters(ctx, id, + types.PowerShapingParameters{ MinStake: uint64(val), }) }, getFunc: func(ctx sdk.Context, id string) int64 { return int64(k.GetMinStake(ctx, id)) }, - deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerUpdateRecord(ctx, id) }, + deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerPowerShapingParameters(ctx, id) }, initialValue: 1000, updatedValue: 2000, }, { name: "Validator Set Cap", settingFunc: func(ctx sdk.Context, id string, val int64) { - k.SetConsumerUpdateRecord(ctx, id, - types.ConsumerUpdateRecord{ + k.SetConsumerPowerShapingParameters(ctx, id, + types.PowerShapingParameters{ ValidatorSetCap: uint32(val), }) }, getFunc: func(ctx sdk.Context, id string) int64 { return int64(k.GetValidatorSetCap(ctx, id)) }, - deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerUpdateRecord(ctx, id) }, + deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerPowerShapingParameters(ctx, id) }, initialValue: 10, updatedValue: 200, }, { name: "Validator Powers Cap", settingFunc: func(ctx sdk.Context, id string, val int64) { - k.SetConsumerUpdateRecord(ctx, id, - types.ConsumerUpdateRecord{ + k.SetConsumerPowerShapingParameters(ctx, id, + types.PowerShapingParameters{ ValidatorsPowerCap: uint32(val), }) }, @@ -648,7 +648,7 @@ func TestKeeperConsumerParams(t *testing.T) { val := k.GetValidatorsPowerCap(ctx, id) return int64(val) }, - deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerUpdateRecord(ctx, id) }, + deleteFunc: func(ctx sdk.Context, id string) { k.DeleteConsumerPowerShapingParameters(ctx, id) }, initialValue: 10, updatedValue: 11, }, diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index 99a2702a64..3d13c5b02c 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -404,7 +404,7 @@ func (k Keeper) AssignConsumerKey( consumerKey tmprotocrypto.PublicKey, ) error { phase, found := k.GetConsumerPhase(ctx, consumerId) - if !found || (phase != Registered && phase != Initialized && phase != Launched) { + if !found || phase == Stopped { //check that the consumer chain is either registered, initialized, or launched return errorsmod.Wrapf( types.ErrUnknownConsumerId, consumerId, diff --git a/x/ccv/provider/keeper/key_assignment_test.go b/x/ccv/provider/keeper/key_assignment_test.go index eb9cef9fca..290b8a6048 100644 --- a/x/ccv/provider/keeper/key_assignment_test.go +++ b/x/ccv/provider/keeper/key_assignment_test.go @@ -495,7 +495,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerPhase(ctx, consumerId, providerkeeper.Registered) + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), @@ -520,7 +520,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerPhase(ctx, consumerId, providerkeeper.Registered) + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), @@ -550,7 +550,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerPhase(ctx, consumerId, providerkeeper.Registered) + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), @@ -577,7 +577,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerPhase(ctx, consumerId, providerkeeper.Registered) + k.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) err := k.AssignConsumerKey(ctx, consumerId, providerIdentities[1].SDKStakingValidator(), providerIdentities[0].TMProtoCryptoPublicKey(), @@ -613,7 +613,7 @@ func TestCannotReassignDefaultKeyAssignment(t *testing.T) { providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - providerKeeper.SetConsumerPhase(ctx, "consumerId", providerkeeper.Registered) + providerKeeper.SetConsumerPhase(ctx, "consumerId", providerkeeper.Initialized) // Mock that the validator is validating with the single key, as confirmed by provider's staking keeper gomock.InOrder( diff --git a/x/ccv/provider/keeper/legacy_proposal.go b/x/ccv/provider/keeper/legacy_proposal.go index e36874a142..074b611e47 100644 --- a/x/ccv/provider/keeper/legacy_proposal.go +++ b/x/ccv/provider/keeper/legacy_proposal.go @@ -50,7 +50,7 @@ func (k Keeper) HandleLegacyConsumerRemovalProposal(ctx sdk.Context, p *types.Co k.SetPendingConsumerRemovalProp(ctx, p) k.Logger(ctx).Info("consumer removal proposal enqueued", - "consumer id", p.ConsumerId, + "chain id", p.ChainId, "title", p.Title, "stop time", p.StopTime.UTC(), ) diff --git a/x/ccv/provider/keeper/legacy_proposal_test.go b/x/ccv/provider/keeper/legacy_proposal_test.go index a8c0fcaafc..7f8a08d90b 100644 --- a/x/ccv/provider/keeper/legacy_proposal_test.go +++ b/x/ccv/provider/keeper/legacy_proposal_test.go @@ -117,12 +117,12 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { // Note: when expAppendProp is false, no mocks are setup, // meaning no external keeper methods are allowed to be called. if tc.expAppendProp { - testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks, tc.prop.ConsumerId) + testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks, tc.prop.ChainId) // Valid client creation is asserted with mock expectations here gomock.InOrder(testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) } - tc.setupMocks(ctx, providerKeeper, tc.prop.ConsumerId) + tc.setupMocks(ctx, providerKeeper, tc.prop.ChainId) err := providerKeeper.HandleLegacyConsumerRemovalProposal(ctx, tc.prop) @@ -130,7 +130,7 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { require.NoError(t, err) // Proposal should be stored as pending - found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ConsumerId, tc.prop.StopTime) + found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ChainId, tc.prop.StopTime) require.True(t, found) // confirm that the channel was not closed @@ -140,7 +140,7 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { require.Error(t, err) // Expect no pending proposal to exist - found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ConsumerId, tc.prop.StopTime) + found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ChainId, tc.prop.StopTime) require.False(t, found) } @@ -148,71 +148,3 @@ func TestHandleLegacyConsumerRemovalProposal(t *testing.T) { ctrl.Finish() } } - -func TestUpdateConsumer(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - consumerId := "0" - - // set up a consumer client, so it seems that chain is running - providerKeeper.SetConsumerClientId(ctx, consumerId, "clientID") - - // set PSS-related fields to update them later on - providerKeeper.SetConsumerUpdateRecord(ctx, consumer, providertypes.ConsumerUpdateRecord{ - Top_N: 50, - ValidatorSetCap: 10, - ValidatorsPowerCap: 34, - MinStake: 100, - AllowInactiveVals: true, - }) - providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr1"))) - providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr2"))) - providerKeeper.SetDenylist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("denylistedAddr1"))) - - expectedTopN := uint32(75) - expectedValidatorsPowerCap := uint32(67) - expectedValidatorSetCap := uint32(20) - expectedAllowlistedValidator := "cosmosvalcons1wpex7anfv3jhystyv3eq20r35a" - expectedDenylistedValidator := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" - expectedMinStake := uint64(0) - expectedAllowInactiveValidators := false - - updateRecord := providertypes.ConsumerUpdateRecord{ - Top_N: expectedTopN, - ValidatorsPowerCap: expectedValidatorsPowerCap, - ValidatorSetCap: expectedValidatorSetCap, - Allowlist: []string{expectedAllowlistedValidator}, - Denylist: []string{expectedDenylistedValidator}, - MinStake: expectedMinStake, - AllowInactiveVals: expectedAllowInactiveValidators, - } - - providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) - providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, updateRecord) - err := providerKeeper.UpdateConsumer(ctx, consumerId) - require.NoError(t, err) - - actualTopN := providerKeeper.GetTopN(ctx, consumerId) - require.Equal(t, expectedTopN, actualTopN) - actualValidatorsPowerCap := providerKeeper.GetValidatorsPowerCap(ctx, consumerId) - require.Equal(t, expectedValidatorsPowerCap, actualValidatorsPowerCap) - actualValidatorSetCap := providerKeeper.GetValidatorSetCap(ctx, consumerId) - require.Equal(t, expectedValidatorSetCap, actualValidatorSetCap) - - allowlistedValidator, err := sdk.ConsAddressFromBech32(expectedAllowlistedValidator) - require.NoError(t, err) - require.Equal(t, 1, len(providerKeeper.GetAllowList(ctx, consumerId))) - require.Equal(t, providertypes.NewProviderConsAddress(allowlistedValidator), providerKeeper.GetAllowList(ctx, consumerId)[0]) - - denylistedValidator, err := sdk.ConsAddressFromBech32(expectedDenylistedValidator) - require.NoError(t, err) - require.Equal(t, 1, len(providerKeeper.GetDenyList(ctx, consumerId))) - require.Equal(t, providertypes.NewProviderConsAddress(denylistedValidator), providerKeeper.GetDenyList(ctx, consumerId)[0]) - - actualMinStake := providerKeeper.GetMinStake(ctx, consumerId) - require.Equal(t, expectedMinStake, actualMinStake) - - actualAllowInactiveValidators := providerKeeper.AllowsInactiveValidators(ctx, consumerId) - require.Equal(t, expectedAllowInactiveValidators, actualAllowInactiveValidators) -} diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index f24ce7fc53..c296a06f6c 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -3,6 +3,7 @@ package keeper import ( "context" errorsmod "cosmossdk.io/errors" + "fmt" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -304,62 +305,47 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M return &types.MsgSetConsumerCommissionRateResponse{}, nil } -// RegisterConsumer registers a consumer chain -func (k msgServer) RegisterConsumer(goCtx context.Context, msg *types.MsgRegisterConsumer) (*types.MsgRegisterConsumerResponse, error) { +// CreateConsumer creates a consumer chain +func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateConsumer) (*types.MsgCreateConsumerResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + initGas := ctx.GasMeter().GasConsumed() consumerId := k.Keeper.FetchAndIncrementConsumerId(ctx) - err := k.Keeper.SetConsumerRegistrationRecord(ctx, consumerId, *msg.RegistrationRecord) - if err != nil { - return &types.MsgRegisterConsumerResponse{}, err - } k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.Signer) - k.Keeper.SetConsumerPhase(ctx, consumerId, Registered) - - return &types.MsgRegisterConsumerResponse{ConsumerId: consumerId}, nil -} - -// InitializeConsumer initializes a consumer chain -func (k msgServer) InitializeConsumer(goCtx context.Context, msg *types.MsgInitializeConsumer) (*types.MsgInitializeConsumerResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) + k.Keeper.SetConsumerChainId(ctx, consumerId, msg.ChainId) - initGas := ctx.GasMeter().GasConsumed() - - consumerId := msg.ConsumerId - - phase, found := k.Keeper.GetConsumerPhase(ctx, consumerId) - if !found || (phase != Registered && phase != Initialized) { - return nil, errorsmod.Wrapf(types.ErrInvalidPhase, - "chain with consumer id: %s has to be in its registered or initialized phase", consumerId) + err := k.Keeper.SetConsumerMetadata(ctx, consumerId, *msg.Metadata) + if err != nil { + return &types.MsgCreateConsumerResponse{}, err } - ownerAddress := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) - if k.GetAuthority() == msg.Authority { - // message is executed as part of governance proposal and hence we change the owner address - // to be the one of the module account address - k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, k.GetAuthority()) - } else if msg.Authority != ownerAddress { - return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Authority) + err = k.Keeper.SetConsumerInitializationParameters(ctx, consumerId, *msg.InitializationParameters) + if err != nil { + return &types.MsgCreateConsumerResponse{}, err } - // if this is not the first initialization, remove the consumer id from the old spawn time - record, err := k.Keeper.GetConsumerInitializationRecord(ctx, consumerId) - if err == nil { - previousSpawnTime := record.SpawnTime - k.Keeper.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) + err = k.Keeper.SetConsumerPowerShapingParameters(ctx, consumerId, *msg.PowerShapingParameters) + if err != nil { + return &types.MsgCreateConsumerResponse{}, err } - k.Keeper.SetConsumerInitializationRecord(ctx, consumerId, *msg.InitializationRecord) + k.Keeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, msg.InitializationParameters.SpawnTime) + k.Keeper.SetConsumerPhase(ctx, consumerId, Initialized) - k.Keeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, msg.InitializationRecord.SpawnTime) + //// if this is not the first initialization, remove the consumer id from the old spawn time + //record, err := k.Keeper.GetConsumerInitializationParameters(ctx, consumerId) + //if err == nil { + // previousSpawnTime := record.SpawnTime + // k.Keeper.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) + //} gasAfter := ctx.GasMeter().GasConsumed() - ctx.GasMeter().ConsumeGas(gasAfter-initGas, "initializing a chain has an additional cost during spawn time, "+ + ctx.GasMeter().ConsumeGas(gasAfter-initGas, "creating a chain has an additional cost during spawn time, "+ "so charging double the gas here") - return &types.MsgInitializeConsumerResponse{}, nil + return &types.MsgCreateConsumerResponse{ConsumerId: consumerId}, nil } // UpdateConsumer updates the record of a consumer chain @@ -367,16 +353,34 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon ctx := sdk.UnwrapSDKContext(goCtx) consumerId := msg.ConsumerId - ownerAddress := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) - if k.GetAuthority() == msg.Authority { + ownerAddress, err := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) + if err != nil { + // TODO (PERMISSIONLESS): fix the error message + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidConsumerId, "cannot retrieve owner address %s", ownerAddress) + } + if k.GetAuthority() == msg.Signer { // message is executed as part of governance proposal and hence we change the owner address // to be the one of the module account address (e.g., a gov proposal with a single `MsgUpdateConsumer` might have // led to this) k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, k.GetAuthority()) - } else if msg.Authority != ownerAddress { - return nil, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Authority) + } else if msg.Signer != ownerAddress { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Signer) } - k.Keeper.SetConsumerUpdateRecord(ctx, msg.ConsumerId, *msg.UpdateRecord) + k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, *msg.Metadata) + k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, *msg.InitializationParameters) + k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, *msg.PowerShapingParameters) return &types.MsgUpdateConsumerResponse{}, nil } + +func (k msgServer) ConsumerAddition(_ context.Context, _ *types.MsgConsumerAddition) (*types.MsgConsumerAdditionResponse, error) { + return nil, fmt.Errorf("`MsgConsumerAddition` is deprecated. Use `MsgCreateConsumer`.") +} + +func (k msgServer) ConsumerModification(_ context.Context, _ *types.MsgConsumerModification) (*types.MsgConsumerModificationResponse, error) { + return nil, fmt.Errorf("`MsgConsumerModification` is deprecated. Use `MsgUpdateConsumer` instead") +} + +func (k msgServer) ConsumerRemoval(_ context.Context, _ *types.MsgConsumerRemoval) (*types.MsgConsumerRemovalResponse, error) { + return nil, fmt.Errorf("`MsgConsumerRemoval` is deprecated. Use `MsgRemoveConsumer` instead") +} diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go index 4a22401c22..d072969d0b 100644 --- a/x/ccv/provider/keeper/msg_server_test.go +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -1,192 +1,124 @@ package keeper_test import ( - "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" "github.com/stretchr/testify/require" "testing" - "time" ) -func TestRegisterConsumer(t *testing.T) { +func TestCreateConsumer(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) - expectedRecord := providertypes.ConsumerRegistrationRecord{ - Title: "title", + consumerMetadata := providertypes.ConsumerMetadata{ + Name: "chain name", Description: "description", - ChainId: "chain_id", } - response, err := msgServer.RegisterConsumer(ctx, - &providertypes.MsgRegisterConsumer{Signer: "signer", RegistrationRecord: &expectedRecord}) + response, err := msgServer.CreateConsumer(ctx, + &providertypes.MsgCreateConsumer{Signer: "signer", ChainId: "chainId", Metadata: &consumerMetadata, + InitializationParameters: &providertypes.ConsumerInitializationParameters{}, + PowerShapingParameters: &providertypes.PowerShapingParameters{}}) require.NoError(t, err) require.Equal(t, "0", response.ConsumerId) - actualRecord, err := providerKeeper.GetConsumerRegistrationRecord(ctx, "0") + actualMetadata, err := providerKeeper.GetConsumerMetadata(ctx, "0") require.NoError(t, err) - require.Equal(t, expectedRecord, actualRecord) - ownerAddress := providerKeeper.GetConsumerOwnerAddress(ctx, "0") + require.Equal(t, consumerMetadata, actualMetadata) + ownerAddress, err := providerKeeper.GetConsumerOwnerAddress(ctx, "0") require.Equal(t, "signer", ownerAddress) phase, found := providerKeeper.GetConsumerPhase(ctx, "0") require.True(t, found) - require.Equal(t, providerkeeper.Registered, phase) + require.Equal(t, providerkeeper.Initialized, phase) - expectedRecord = providertypes.ConsumerRegistrationRecord{ - Title: "title2", + consumerMetadata = providertypes.ConsumerMetadata{ + Name: "chain name", Description: "description2", - ChainId: "chain_id2", } - response, err = msgServer.RegisterConsumer(ctx, - &providertypes.MsgRegisterConsumer{Signer: "signer2", RegistrationRecord: &expectedRecord}) + response, err = msgServer.CreateConsumer(ctx, + &providertypes.MsgCreateConsumer{Signer: "signer2", ChainId: "chainId", Metadata: &consumerMetadata, + InitializationParameters: &providertypes.ConsumerInitializationParameters{}, + PowerShapingParameters: &providertypes.PowerShapingParameters{}}) require.NoError(t, err) // assert that the consumer id is different from the previously registered chain require.Equal(t, "1", response.ConsumerId) - actualRecord, err = providerKeeper.GetConsumerRegistrationRecord(ctx, "1") + actualMetadata, err = providerKeeper.GetConsumerMetadata(ctx, "1") require.NoError(t, err) - require.Equal(t, expectedRecord, actualRecord) - ownerAddress = providerKeeper.GetConsumerOwnerAddress(ctx, "1") + require.Equal(t, consumerMetadata, actualMetadata) + ownerAddress, err = providerKeeper.GetConsumerOwnerAddress(ctx, "1") require.Equal(t, "signer2", ownerAddress) phase, found = providerKeeper.GetConsumerPhase(ctx, "1") require.True(t, found) - require.Equal(t, providerkeeper.Registered, phase) - + require.Equal(t, providerkeeper.Initialized, phase) } -func TestInitializeConsumer(t *testing.T) { +func TestUpdateConsumer(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) - - // initializing a chain with no phase, or a chain that is launched or stopped should give an error - _, err := msgServer.InitializeConsumer(ctx, - &providertypes.MsgInitializeConsumer{ - Authority: "signer", - ConsumerId: "0", - InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) - require.ErrorContains(t, err, "its registered or initialized phase") - - providerKeeper.SetConsumerPhase(ctx, "0", providerkeeper.Launched) - _, err = msgServer.InitializeConsumer(ctx, - &providertypes.MsgInitializeConsumer{ - Authority: "signer", - ConsumerId: "0", - InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) - require.ErrorContains(t, err, "its registered or initialized phase") - - providerKeeper.SetConsumerPhase(ctx, "0", providerkeeper.Stopped) - _, err = msgServer.InitializeConsumer(ctx, - &providertypes.MsgInitializeConsumer{ - Authority: "signer", - ConsumerId: "0", - InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) - require.ErrorContains(t, err, "its registered or initialized phase") - - // register chains with consumers ids "0" and "1" - _, _ = msgServer.RegisterConsumer(ctx, - &providertypes.MsgRegisterConsumer{ - Signer: "signer", - RegistrationRecord: &providertypes.ConsumerRegistrationRecord{}}) - - _, _ = msgServer.RegisterConsumer(ctx, - &providertypes.MsgRegisterConsumer{ - Signer: "signer2", - RegistrationRecord: &providertypes.ConsumerRegistrationRecord{}}) - - // assert that you CANNOT initialize a consumer chain that you do NOT own - _, err = msgServer.InitializeConsumer(ctx, - &providertypes.MsgInitializeConsumer{ - Authority: "signer2", - ConsumerId: "0", - InitializationRecord: &providertypes.ConsumerInitializationRecord{}}) - require.ErrorContains(t, err, "expected owner") - - // initialize chain with consumer id "0" - expectedRecord := providertypes.ConsumerInitializationRecord{ - InitialHeight: types.Height{RevisionNumber: 1, RevisionHeight: 2}, - GenesisHash: []byte{0, 1}, - BinaryHash: []byte{2, 3}, - SpawnTime: time.Unix(1, 2).UTC(), - UnbondingPeriod: 3456, - CcvTimeoutPeriod: 789, - TransferTimeoutPeriod: 101112, - ConsumerRedistributionFraction: "consumer_redistribution_fraction", - BlocksPerDistributionTransmission: 123, - HistoricalEntries: 456, - DistributionTransmissionChannel: "distribution_transmission_channel", + consumerId := "0" + + // set up a consumer client, so it seems that chain is running + providerKeeper.SetConsumerClientId(ctx, consumerId, "clientID") + + // set PSS-related fields to update them later on + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumer, providertypes.PowerShapingParameters{ + Top_N: 50, + ValidatorSetCap: 10, + ValidatorsPowerCap: 34, + MinStake: 100, + AllowInactiveVals: true, + }) + providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr1"))) + providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr2"))) + providerKeeper.SetDenylist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("denylistedAddr1"))) + + expectedTopN := uint32(75) + expectedValidatorsPowerCap := uint32(67) + expectedValidatorSetCap := uint32(20) + expectedAllowlistedValidator := "cosmosvalcons1wpex7anfv3jhystyv3eq20r35a" + expectedDenylistedValidator := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" + expectedMinStake := uint64(0) + expectedAllowInactiveValidators := false + + updateRecord := providertypes.PowerShapingParameters{ + Top_N: expectedTopN, + ValidatorsPowerCap: expectedValidatorsPowerCap, + ValidatorSetCap: expectedValidatorSetCap, + Allowlist: []string{expectedAllowlistedValidator}, + Denylist: []string{expectedDenylistedValidator}, + MinStake: expectedMinStake, + AllowInactiveVals: expectedAllowInactiveValidators, } - _, err = msgServer.InitializeConsumer(ctx, - &providertypes.MsgInitializeConsumer{ - Authority: "signer", - ConsumerId: "0", - InitializationRecord: &expectedRecord}) - require.NoError(t, err) - actualRecord, err := providerKeeper.GetConsumerInitializationRecord(ctx, "0") + providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, updateRecord) + err := providerKeeper.UpdateConsumer(ctx, consumerId) require.NoError(t, err) - require.Equal(t, expectedRecord, actualRecord) - // verify that the owner of the consumer chain did NOT change - ownerAddress := providerKeeper.GetConsumerOwnerAddress(ctx, "0") - require.Equal(t, "signer", ownerAddress) - // assert that we can re-initialize chain with consumer id "0" - expectedRecord = providertypes.ConsumerInitializationRecord{ - InitialHeight: types.Height{RevisionNumber: 2, RevisionHeight: 3}, - GenesisHash: []byte{2, 3}, - BinaryHash: []byte{4, 5}, - SpawnTime: time.Unix(2, 3).UTC(), - UnbondingPeriod: 789, - CcvTimeoutPeriod: 101112, - TransferTimeoutPeriod: 131415, - ConsumerRedistributionFraction: "consumer_redistribution_fraction2", - BlocksPerDistributionTransmission: 456, - HistoricalEntries: 789, - DistributionTransmissionChannel: "distribution_transmission_channel2", - } + actualTopN := providerKeeper.GetTopN(ctx, consumerId) + require.Equal(t, expectedTopN, actualTopN) + actualValidatorsPowerCap := providerKeeper.GetValidatorsPowerCap(ctx, consumerId) + require.Equal(t, expectedValidatorsPowerCap, actualValidatorsPowerCap) + actualValidatorSetCap := providerKeeper.GetValidatorSetCap(ctx, consumerId) + require.Equal(t, expectedValidatorSetCap, actualValidatorSetCap) - _, err = msgServer.InitializeConsumer(ctx, - &providertypes.MsgInitializeConsumer{ - Authority: "signer", - ConsumerId: "0", - InitializationRecord: &expectedRecord}) - require.NoError(t, err) - actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "0") + allowlistedValidator, err := sdk.ConsAddressFromBech32(expectedAllowlistedValidator) require.NoError(t, err) - require.Equal(t, expectedRecord, actualRecord) - // verify that the owner of the consumer chain did NOT change - ownerAddress = providerKeeper.GetConsumerOwnerAddress(ctx, "0") - require.Equal(t, "signer", ownerAddress) - - // initialize chain with consumer id "1" but with a different owner (as part of a governance proposal) + require.Equal(t, 1, len(providerKeeper.GetAllowList(ctx, consumerId))) + require.Equal(t, providertypes.NewProviderConsAddress(allowlistedValidator), providerKeeper.GetAllowList(ctx, consumerId)[0]) - // first verify that the current owner can initialize the chain - _, err = msgServer.InitializeConsumer(ctx, - &providertypes.MsgInitializeConsumer{ - Authority: "signer2", - ConsumerId: "1", - InitializationRecord: &expectedRecord}) + denylistedValidator, err := sdk.ConsAddressFromBech32(expectedDenylistedValidator) require.NoError(t, err) - actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "1") - require.NoError(t, err) - require.Equal(t, expectedRecord, actualRecord) - // verify that the owner of the consumer chain did NOT change - ownerAddress = providerKeeper.GetConsumerOwnerAddress(ctx, "1") - require.Equal(t, "signer2", ownerAddress) + require.Equal(t, 1, len(providerKeeper.GetDenyList(ctx, consumerId))) + require.Equal(t, providertypes.NewProviderConsAddress(denylistedValidator), providerKeeper.GetDenyList(ctx, consumerId)[0]) - // second, reinitialize by with a gov proposal owner - _, err = msgServer.InitializeConsumer(ctx, - &providertypes.MsgInitializeConsumer{ - Authority: providerKeeper.GetAuthority(), - ConsumerId: "1", - InitializationRecord: &expectedRecord}) - require.NoError(t, err) - actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "1") - require.NoError(t, err) - require.Equal(t, expectedRecord, actualRecord) - // verify that the owner of the consumer chain did change - ownerAddress = providerKeeper.GetConsumerOwnerAddress(ctx, "1") - require.Equal(t, providerKeeper.GetAuthority(), ownerAddress) + actualMinStake := providerKeeper.GetMinStake(ctx, consumerId) + require.Equal(t, expectedMinStake, actualMinStake) + + actualAllowInactiveValidators := providerKeeper.AllowsInactiveValidators(ctx, consumerId) + require.Equal(t, expectedAllowInactiveValidators, actualAllowInactiveValidators) } diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index 0dc6ea28be..c834d2b492 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -23,18 +23,18 @@ func (k Keeper) HandleOptIn(ctx sdk.Context, consumerId string, providerAddr typ "opting in to an unknown (or stopped) consumer chain, with id: %s", consumerId) } - registrationRecord, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + chainId, err := k.GetConsumerChainId(ctx, consumerId) if err != nil { + // TODO (PERMISSIONLESS): fix error types return errorsmod.Wrapf( types.ErrUnknownConsumerId, "opting in to an unknown consumer chain, with id (%s): %s", consumerId, err.Error()) } - - optedInToConsumerId, found := k.IsValidatorOptedInToChainId(ctx, providerAddr, registrationRecord.ChainId) + optedInToConsumerId, found := k.IsValidatorOptedInToChainId(ctx, providerAddr, chainId) if found { return errorsmod.Wrapf(types.ErrAlreadyOptedIn, "validator is already opted in to a chain (%s) with this chain id (%s)", - optedInToConsumerId, registrationRecord.ChainId) + optedInToConsumerId, chainId) } k.SetOptedIn(ctx, consumerId, providerAddr) diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index fee602f456..fdfa7d554e 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -39,10 +39,8 @@ func TestHandleOptIn(t *testing.T) { providerKeeper.SetConsumerPhase(ctx, "stoppedConsumerId", keeper.Stopped) require.Error(t, providerKeeper.HandleOptIn(ctx, "stoppedConsumerId", providerAddr, "")) - providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Registered) - providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId", types.ConsumerRegistrationRecord{ - ChainId: "chainId", - }) + providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Initialized) + providerKeeper.SetConsumerChainId(ctx, "consumerId", "chainId") require.False(t, providerKeeper.IsOptedIn(ctx, "consumerId", providerAddr)) err := providerKeeper.HandleOptIn(ctx, "consumerId", providerAddr, "") require.NoError(t, err) @@ -50,10 +48,8 @@ func TestHandleOptIn(t *testing.T) { // validator tries to opt in to another chain with chain id ("chainId") while it is already opted in to // a different chain with the same chain id - providerKeeper.SetConsumerPhase(ctx, "consumerId2", keeper.Registered) - providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId2", types.ConsumerRegistrationRecord{ - ChainId: "chainId", - }) + providerKeeper.SetConsumerPhase(ctx, "consumerId2", keeper.Initialized) + providerKeeper.SetConsumerChainId(ctx, "consumerId2", "chainId") err = providerKeeper.HandleOptIn(ctx, "consumerId2", providerAddr, "") require.ErrorContains(t, err, "validator is already opted in to a chain") } @@ -92,10 +88,8 @@ func TestHandleOptInWithConsumerKey(t *testing.T) { expectedConsumerPubKey, err := providerKeeper.ParseConsumerKey(consumerKey) require.NoError(t, err) - providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Registered) - providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId", types.ConsumerRegistrationRecord{ - ChainId: "consumerId", - }) + providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Initialized) + providerKeeper.SetConsumerChainId(ctx, "consumerId", "consumerId") err = providerKeeper.HandleOptIn(ctx, "consumerId", providerAddr, consumerKey) require.NoError(t, err) @@ -141,7 +135,7 @@ func TestHandleOptOutFromTopNChain(t *testing.T) { // set the chain as Top 50 and create 4 validators with 10%, 20%, 30%, and 40% of the total voting power // respectively - providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, types.PowerShapingParameters{ Top_N: 50, }) valA := createStakingValidator(ctx, mocks, 1, 1, 1) // 10% of the total voting power (can opt out) @@ -439,31 +433,31 @@ func TestCapValidatorSet(t *testing.T) { consumerValidators := providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, validators, consumerValidators) - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", types.PowerShapingParameters{ ValidatorSetCap: 0, }) consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, validators, consumerValidators) - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", types.PowerShapingParameters{ ValidatorSetCap: 100, }) consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, validators, consumerValidators) - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", types.PowerShapingParameters{ ValidatorSetCap: 1, }) consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, []types.ConsensusValidator{validatorC}, consumerValidators) - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", types.PowerShapingParameters{ ValidatorSetCap: 2, }) consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) require.Equal(t, []types.ConsensusValidator{validatorC, validatorB}, consumerValidators) - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", types.PowerShapingParameters{ ValidatorSetCap: 3, }) consumerValidators = providerKeeper.CapValidatorSet(ctx, "consumerId", validators) @@ -519,7 +513,7 @@ func TestCapValidatorsPower(t *testing.T) { sortValidators(cappedValidators) require.Equal(t, validators, cappedValidators) - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", types.PowerShapingParameters{ ValidatorsPowerCap: 33, }) cappedValidators = providerKeeper.CapValidatorsPower(ctx, "consumerId", validators) @@ -781,7 +775,7 @@ func TestFulfillsMinStake(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", types.PowerShapingParameters{ MinStake: tc.minStake, }) for i, valAddr := range consAddrs { @@ -815,7 +809,7 @@ func TestIfInactiveValsDisallowedProperty(t *testing.T) { // Set up the parameters in the provider keeper // do not allow inactive validators - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", types.PowerShapingParameters{ MinStake: minStake, AllowInactiveVals: false, }) diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index b9ec7669fe..83c306fb19 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -21,10 +21,9 @@ const ( // Registered phase indicates the phase in which a consumer chain has been assigned a unique consumer id. This consumer // id can be used to interact with the consumer chain (e.g., when a validator opts in to a chain). A chain in this // phase cannot yet launch. It has to be initialized first. - Registered ConsumerPhase = iota // Initialized phase indicates the phase in which a consumer chain has set all the needed parameters to launch but // has not yet launched (e.g., because the `spawnTime` of the consumer chain has not yet been reached). - Initialized + Initialized ConsumerPhase = iota // TODO (PERMISSIONLESS) add this if the chain fails to launch // Useful so we do not keep trying to launch failed chains // FailedToLaunch phase indicates that the chain attempted but failed to launch (e.g., due to no validator opting in) @@ -64,110 +63,141 @@ func (k Keeper) FetchAndIncrementConsumerId(ctx sdk.Context) string { return strconv.FormatUint(consumerId, 10) } -// GetConsumerRegistrationRecord returns the registration record associated with this consumer id -func (k Keeper) GetConsumerRegistrationRecord(ctx sdk.Context, consumerId string) (types.ConsumerRegistrationRecord, error) { +// GetConsumerChainId returns the chain id associated with this consumer id +func (k Keeper) GetConsumerChainId(ctx sdk.Context, consumerId string) (string, error) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerIdToRegistrationRecordKey(consumerId)) + bz := store.Get(types.ConsumerIdToChainIdKey(consumerId)) if bz == nil { - return types.ConsumerRegistrationRecord{}, fmt.Errorf("failed to retrieve registration record for consumer id (%s)", consumerId) + return "", fmt.Errorf("failed to retrieve chain id for consumer id (%s)", consumerId) } - var record types.ConsumerRegistrationRecord - if err := record.Unmarshal(bz); err != nil { - return types.ConsumerRegistrationRecord{}, fmt.Errorf("failed to unmarshal registration record for consumer id (%s): %w", consumerId, err) + return string(bz), nil +} + +// SetConsumerChainId sets the chain id associated with this consumer id +func (k Keeper) SetConsumerChainId(ctx sdk.Context, consumerId string, chainId string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ConsumerIdToChainIdKey(consumerId), []byte(chainId)) +} + +// DeleteConsumerChainId deletes the chain id associated with this consumer id +func (k Keeper) DeleteConsumerChainId(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToChainIdKey(consumerId)) +} + +// GetConsumerOwnerAddress returns the owner address associated with this consumer id +func (k Keeper) GetConsumerOwnerAddress(ctx sdk.Context, consumerId string) (string, error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ConsumerIdToOwnerAddressKey(consumerId)) + if bz == nil { + return "", fmt.Errorf("failed to retrieve owner address for consumer id (%s)", consumerId) } - return record, nil + return string(bz), nil } -// SetConsumerRegistrationRecord sets the registration record associated with this consumer id -func (k Keeper) SetConsumerRegistrationRecord(ctx sdk.Context, consumerId string, record types.ConsumerRegistrationRecord) error { +// SetConsumerOwnerAddress sets the chain id associated with this consumer id +func (k Keeper) SetConsumerOwnerAddress(ctx sdk.Context, consumerId string, chainId string) { store := ctx.KVStore(k.storeKey) - bz, err := record.Marshal() + store.Set(types.ConsumerIdToOwnerAddressKey(consumerId), []byte(chainId)) +} + +// DeleteConsumerOwnerAddress deletes the owner address associated with this consumer id +func (k Keeper) DeleteConsumerOwnerAddress(ctx sdk.Context, consumerId string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerIdToOwnerAddressKey(consumerId)) +} + +// GetConsumerMetadata returns the registration record associated with this consumer id +func (k Keeper) GetConsumerMetadata(ctx sdk.Context, consumerId string) (types.ConsumerMetadata, error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ConsumerIdToMetadataKey(consumerId)) + if bz == nil { + return types.ConsumerMetadata{}, fmt.Errorf("failed to retrieve metadata for consumer id (%s)", consumerId) + } + var metadata types.ConsumerMetadata + if err := metadata.Unmarshal(bz); err != nil { + return types.ConsumerMetadata{}, fmt.Errorf("failed to unmarshal metadata for consumer id (%s): %w", consumerId, err) + } + return metadata, nil +} + +// SetConsumerMetadata sets the registration record associated with this consumer id +func (k Keeper) SetConsumerMetadata(ctx sdk.Context, consumerId string, metadata types.ConsumerMetadata) error { + store := ctx.KVStore(k.storeKey) + bz, err := metadata.Marshal() if err != nil { - return fmt.Errorf("failed to marshal registration record (%+v) for consumer id (%s): %w", record, consumerId, err) + return fmt.Errorf("failed to marshal registration metadata (%+v) for consumer id (%s): %w", metadata, consumerId, err) } - store.Set(types.ConsumerIdToRegistrationRecordKey(consumerId), bz) + store.Set(types.ConsumerIdToMetadataKey(consumerId), bz) return nil } -// DeleteConsumerRegistrationRecord deletes the registration record associated with this consumer id -func (k Keeper) DeleteConsumerRegistrationRecord(ctx sdk.Context, consumerId string) { +// DeleteConsumerMetadata deletes the metadata associated with this consumer id +func (k Keeper) DeleteConsumerMetadata(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerIdToRegistrationRecordKey(consumerId)) + store.Delete(types.ConsumerIdToMetadataKey(consumerId)) } -// GetConsumerInitializationRecord returns the initialization record associated with this consumer id -func (k Keeper) GetConsumerInitializationRecord(ctx sdk.Context, consumerId string) (types.ConsumerInitializationRecord, error) { +// GetConsumerInitializationParameters returns the initialization parameters associated with this consumer id +func (k Keeper) GetConsumerInitializationParameters(ctx sdk.Context, consumerId string) (types.ConsumerInitializationParameters, error) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerIdToInitializationRecordKey(consumerId)) + bz := store.Get(types.ConsumerIdToInitializationParametersKey(consumerId)) if bz == nil { - return types.ConsumerInitializationRecord{}, fmt.Errorf("failed to retrieve initialization record for consumer id (%s)", consumerId) + return types.ConsumerInitializationParameters{}, fmt.Errorf("failed to retrieve initialization parameters for consumer id (%s)", consumerId) } - var record types.ConsumerInitializationRecord + var record types.ConsumerInitializationParameters if err := record.Unmarshal(bz); err != nil { - return types.ConsumerInitializationRecord{}, fmt.Errorf("failed to unmarshal stop time for consumer id (%s): %w", consumerId, err) + return types.ConsumerInitializationParameters{}, fmt.Errorf("failed to unmarshal stop time for consumer id (%s): %w", consumerId, err) } return record, nil } -// SetConsumerInitializationRecord sets the initialization record associated with this consumer id -func (k Keeper) SetConsumerInitializationRecord(ctx sdk.Context, consumerId string, record types.ConsumerInitializationRecord) error { +// SetConsumerInitializationParameters sets the initialization parameters associated with this consumer id +func (k Keeper) SetConsumerInitializationParameters(ctx sdk.Context, consumerId string, record types.ConsumerInitializationParameters) error { store := ctx.KVStore(k.storeKey) bz, err := record.Marshal() if err != nil { return fmt.Errorf("failed to marshal initialization record (%+v) for consumer id (%s): %w", record, consumerId, err) } - store.Set(types.ConsumerIdToInitializationRecordKey(consumerId), bz) + store.Set(types.ConsumerIdToInitializationParametersKey(consumerId), bz) return nil } -// DeleteConsumerInitializationRecord deletes the initialization record associated with this consumer id -func (k Keeper) DeleteConsumerInitializationRecord(ctx sdk.Context, consumerId string) { +// DeleteConsumerInitializationParameters deletes the initialization parameters associated with this consumer id +func (k Keeper) DeleteConsumerInitializationParameters(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerIdToInitializationRecordKey(consumerId)) + store.Delete(types.ConsumerIdToInitializationParametersKey(consumerId)) } -// GetConsumerUpdateRecord returns the update record associated with this consumer id -func (k Keeper) GetConsumerUpdateRecord(ctx sdk.Context, consumerId string) (types.ConsumerUpdateRecord, error) { +// GetConsumerPowerShapingParameters returns the power-shaping parameters associated with this consumer id +func (k Keeper) GetConsumerPowerShapingParameters(ctx sdk.Context, consumerId string) (types.PowerShapingParameters, error) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ConsumerIdToUpdateRecordKey(consumerId)) + bz := store.Get(types.ConsumerIdToPowerShapingParametersKey(consumerId)) if bz == nil { - return types.ConsumerUpdateRecord{}, fmt.Errorf("failed to retrieve update record for consumer id (%s)", consumerId) + return types.PowerShapingParameters{}, fmt.Errorf("failed to retrieve power-shaping parameters for consumer id (%s)", consumerId) } - var record types.ConsumerUpdateRecord + var record types.PowerShapingParameters if err := record.Unmarshal(bz); err != nil { - return types.ConsumerUpdateRecord{}, fmt.Errorf("failed to unmarshal update record for consumer id (%s): %w", consumerId, err) + return types.PowerShapingParameters{}, fmt.Errorf("failed to unmarshal power-shaping parameters for consumer id (%s): %w", consumerId, err) } return record, nil } -// SetConsumerUpdateRecord sets the update record associated with this consumer id -func (k Keeper) SetConsumerUpdateRecord(ctx sdk.Context, consumerId string, record types.ConsumerUpdateRecord) error { +// SetConsumerPowerShapingParameters sets the power-shaping parameters associated with this consumer id +func (k Keeper) SetConsumerPowerShapingParameters(ctx sdk.Context, consumerId string, parameters types.PowerShapingParameters) error { store := ctx.KVStore(k.storeKey) - bz, err := record.Marshal() + bz, err := parameters.Marshal() if err != nil { - return fmt.Errorf("failed to marshal update record (%+v) for consumer id (%s): %w", record, consumerId, err) + return fmt.Errorf("failed to marshal power-shaping parameters (%+v) for consumer id (%s): %w", parameters, consumerId, err) } - store.Set(types.ConsumerIdToUpdateRecordKey(consumerId), bz) + store.Set(types.ConsumerIdToPowerShapingParametersKey(consumerId), bz) return nil } -// DeleteConsumerUpdateRecord deletes the update record associated with this consumer id -func (k Keeper) DeleteConsumerUpdateRecord(ctx sdk.Context, consumerId string) { +// DeleteConsumerPowerShapingParameters deletes the power-shaping parameters associated with this consumer id +func (k Keeper) DeleteConsumerPowerShapingParameters(ctx sdk.Context, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ConsumerIdToUpdateRecordKey(consumerId)) -} - -// GetConsumerOwnerAddress returns the owner address associated with this consumer id -func (k Keeper) GetConsumerOwnerAddress(ctx sdk.Context, consumerId string) string { - updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) - return updateRecord.OwnerAddress -} - -// SetConsumerOwnerAddress sets the owner address associated with this consumer id -func (k Keeper) SetConsumerOwnerAddress(ctx sdk.Context, consumerId string, ownerAddress string) { - updateRecord, _ := k.GetConsumerUpdateRecord(ctx, consumerId) - updateRecord.OwnerAddress = ownerAddress - k.SetConsumerUpdateRecord(ctx, consumerId, updateRecord) + store.Delete(types.ConsumerIdToPowerShapingParametersKey(consumerId)) } // GetConsumerPhase returns the phase associated with this consumer id @@ -566,7 +596,7 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { "cannot update stopped or not existing chain: %s", consumerId) } - updateRecord, err := k.GetConsumerUpdateRecord(ctx, consumerId) + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) if err != nil { // TODO (permissionless) -- not really an invalid update record return errorsmod.Wrapf(types.ErrInvalidUpdateRecord, @@ -574,7 +604,7 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { } k.DeleteAllowlist(ctx, consumerId) - for _, address := range updateRecord.Allowlist { + for _, address := range powerShapingParameters.Allowlist { consAddr, err := sdk.ConsAddressFromBech32(address) if err != nil { continue @@ -584,7 +614,7 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { } k.DeleteDenylist(ctx, consumerId) - for _, address := range updateRecord.Denylist { + for _, address := range powerShapingParameters.Denylist { consAddr, err := sdk.ConsAddressFromBech32(address) if err != nil { continue @@ -600,14 +630,14 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { } // if the top N changes, we need to update the new minimum power in top N - if updateRecord.Top_N != oldTopN { - if updateRecord.Top_N > 0 { + if powerShapingParameters.Top_N != oldTopN { + if powerShapingParameters.Top_N > 0 { // if the chain receives a non-zero top N value, store the minimum power in the top N bondedValidators, err := k.GetLastBondedValidators(ctx) if err != nil { return err } - minPower, err := k.ComputeMinPowerInTopN(ctx, bondedValidators, updateRecord.Top_N) + minPower, err := k.ComputeMinPowerInTopN(ctx, bondedValidators, powerShapingParameters.Top_N) if err != nil { return err } @@ -678,15 +708,15 @@ func (k Keeper) IsValidatorOptedInToChainId(ctx sdk.Context, providerAddr types. } for _, consumerId := range consumerIds { - record, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + consumerChainId, err := k.GetConsumerChainId(ctx, consumerId) if err != nil { - k.Logger(ctx).Error("cannot find registration record", + k.Logger(ctx).Error("cannot find chain id", "consumerId", consumerId, "error", err) continue } - if record.ChainId == chainId { + if consumerChainId == chainId { return consumerId, true } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index bd5e28a3f8..b9cbe7d8ef 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -54,34 +54,36 @@ func TestConsumerIdToRegistrationRecord(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - _, err := providerKeeper.GetConsumerRegistrationRecord(ctx, "consumerId") + _, err := providerKeeper.GetConsumerMetadata(ctx, "consumerId") require.Error(t, err) - expectedRecord := providertypes.ConsumerRegistrationRecord{ - Title: "title", + expectedRecord := providertypes.ConsumerMetadata{ + Name: "name", Description: "description", - ChainId: "chain_id", + Metadata: "metadata", + //ChainId: "chain_id", } - providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId", expectedRecord) - actualRecord, err := providerKeeper.GetConsumerRegistrationRecord(ctx, "consumerId") + providerKeeper.SetConsumerMetadata(ctx, "consumerId", expectedRecord) + actualRecord, err := providerKeeper.GetConsumerMetadata(ctx, "consumerId") require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) // assert that overwriting the current registration record works - expectedRecord = providertypes.ConsumerRegistrationRecord{ - Title: "title 2", + expectedRecord = providertypes.ConsumerMetadata{ + Name: "name 2", Description: "description 2", - ChainId: "chain_id2", + Metadata: "metadata 2", + //ChainId: "chain_id2", } - providerKeeper.SetConsumerRegistrationRecord(ctx, "consumerId", expectedRecord) - actualRecord, err = providerKeeper.GetConsumerRegistrationRecord(ctx, "consumerId") + providerKeeper.SetConsumerMetadata(ctx, "consumerId", expectedRecord) + actualRecord, err = providerKeeper.GetConsumerMetadata(ctx, "consumerId") require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) - providerKeeper.DeleteConsumerRegistrationRecord(ctx, "consumerId") - actualRecord, err = providerKeeper.GetConsumerRegistrationRecord(ctx, "consumerId") + providerKeeper.DeleteConsumerMetadata(ctx, "consumerId") + actualRecord, err = providerKeeper.GetConsumerMetadata(ctx, "consumerId") require.Error(t, err) - require.Equal(t, providertypes.ConsumerRegistrationRecord{}, actualRecord) + require.Equal(t, providertypes.ConsumerMetadata{}, actualRecord) } // TestConsumerIdToInitializationRecord tests the getter, setter, and deletion methods of the consumer id to initialization record methods @@ -89,10 +91,10 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - _, err := providerKeeper.GetConsumerInitializationRecord(ctx, "consumerId") + _, err := providerKeeper.GetConsumerInitializationParameters(ctx, "consumerId") require.Error(t, err) - expectedRecord := providertypes.ConsumerInitializationRecord{ + expectedRecord := providertypes.ConsumerInitializationParameters{ InitialHeight: types.Height{RevisionNumber: 1, RevisionHeight: 2}, GenesisHash: []byte{0, 1}, BinaryHash: []byte{2, 3}, @@ -105,13 +107,13 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { HistoricalEntries: 456, DistributionTransmissionChannel: "distribution_transmission_channel", } - providerKeeper.SetConsumerInitializationRecord(ctx, "consumerId", expectedRecord) - actualRecord, err := providerKeeper.GetConsumerInitializationRecord(ctx, "consumerId") + providerKeeper.SetConsumerInitializationParameters(ctx, "consumerId", expectedRecord) + actualRecord, err := providerKeeper.GetConsumerInitializationParameters(ctx, "consumerId") require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) // assert that overwriting the current initialization record works - expectedRecord = providertypes.ConsumerInitializationRecord{ + expectedRecord = providertypes.ConsumerInitializationParameters{ InitialHeight: types.Height{RevisionNumber: 2, RevisionHeight: 3}, GenesisHash: []byte{2, 3}, BinaryHash: []byte{4, 5}, @@ -124,15 +126,15 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { HistoricalEntries: 789, DistributionTransmissionChannel: "distribution_transmission_channel2", } - providerKeeper.SetConsumerInitializationRecord(ctx, "consumerId", expectedRecord) - actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "consumerId") + providerKeeper.SetConsumerInitializationParameters(ctx, "consumerId", expectedRecord) + actualRecord, err = providerKeeper.GetConsumerInitializationParameters(ctx, "consumerId") require.NoError(t, err) require.Equal(t, expectedRecord, actualRecord) - providerKeeper.DeleteConsumerInitializationRecord(ctx, "consumerId") - actualRecord, err = providerKeeper.GetConsumerInitializationRecord(ctx, "consumerId") + providerKeeper.DeleteConsumerInitializationParameters(ctx, "consumerId") + actualRecord, err = providerKeeper.GetConsumerInitializationParameters(ctx, "consumerId") require.Error(t, err) - require.Equal(t, providertypes.ConsumerInitializationRecord{}, actualRecord) + require.Equal(t, providertypes.ConsumerInitializationParameters{}, actualRecord) } // TestConsumerIdToOwnerAddress tests the getter, setter, and deletion methods of the owner address to registration record methods @@ -141,12 +143,14 @@ func TestConsumerIdToOwnerAddress(t *testing.T) { defer ctrl.Finish() providerKeeper.SetConsumerOwnerAddress(ctx, "consumerId", "owner_address") - address := providerKeeper.GetConsumerOwnerAddress(ctx, "consumerId") + address, err := providerKeeper.GetConsumerOwnerAddress(ctx, "consumerId") + require.NoError(t, err) require.Equal(t, "owner_address", address) // assert that overwriting the current owner address works providerKeeper.SetConsumerOwnerAddress(ctx, "consumerId", "owner_address2") - address = providerKeeper.GetConsumerOwnerAddress(ctx, "consumerId") + address, err = providerKeeper.GetConsumerOwnerAddress(ctx, "consumerId") + require.NoError(t, err) require.Equal(t, "owner_address2", address) } @@ -158,10 +162,10 @@ func TestConsumerIdToPhase(t *testing.T) { _, found := providerKeeper.GetConsumerPhase(ctx, "consumerId") require.False(t, found) - providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Registered) + providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Initialized) phase, found := providerKeeper.GetConsumerPhase(ctx, "consumerId") require.True(t, found) - require.Equal(t, keeper.Registered, phase) + require.Equal(t, keeper.Initialized, phase) providerKeeper.SetConsumerPhase(ctx, "consumerId", keeper.Launched) phase, found = providerKeeper.GetConsumerPhase(ctx, "consumerId") @@ -260,9 +264,7 @@ func TestIsValidatorOptedInToChain(t *testing.T) { require.False(t, found) expectedConsumerId := "consumerId" - providerKeeper.SetConsumerRegistrationRecord(ctx, expectedConsumerId, providertypes.ConsumerRegistrationRecord{ - ChainId: chainId, - }) + providerKeeper.SetConsumerChainId(ctx, expectedConsumerId, chainId) providerKeeper.SetOptedIn(ctx, expectedConsumerId, providerAddr) providerKeeper.AppendOptedInConsumerId(ctx, providerAddr, expectedConsumerId) actualConsumerId, found := providerKeeper.IsValidatorOptedInToChainId(ctx, providerAddr, chainId) diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index c4d1295347..600950a8e3 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -37,7 +37,7 @@ func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, proposal *typ // CreateConsumerClient will create the CCV client for the given consumer chain. The CCV channel must be built // on top of the CCV client to ensure connection with the right consumer chain. func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { - initializationRecord, err := k.GetConsumerInitializationRecord(ctx, consumerId) + initializationRecord, err := k.GetConsumerInitializationParameters(ctx, consumerId) if err != nil { return err } @@ -49,11 +49,10 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { } // TODO (PERMISSIONLESS): make this a function ... GetChainId(consumerId) ... - registrationRecord, err := k.GetConsumerRegistrationRecord(ctx, consumerId) + chainId, err := k.GetConsumerChainId(ctx, consumerId) if err != nil { return err } - chainId := registrationRecord.ChainId // Set minimum height for equivocation evidence from this consumer chain k.SetEquivocationEvidenceMinHeight(ctx, consumerId, initializationRecord.InitialHeight.RevisionHeight) @@ -164,9 +163,9 @@ func (k Keeper) StopConsumerChain(ctx sdk.Context, consumerId string, closeChan k.DeleteSlashAcks(ctx, consumerId) k.DeletePendingVSCPackets(ctx, consumerId) - k.DeleteConsumerRegistrationRecord(ctx, consumerId) - k.DeleteConsumerUpdateRecord(ctx, consumerId) - k.DeleteConsumerUpdateRecord(ctx, consumerId) + k.DeleteConsumerMetadata(ctx, consumerId) + k.DeleteConsumerPowerShapingParameters(ctx, consumerId) + k.DeleteConsumerPowerShapingParameters(ctx, consumerId) k.DeleteAllowlist(ctx, consumerId) k.DeleteDenylist(ctx, consumerId) k.DeleteAllOptedIn(ctx, consumerId) @@ -185,16 +184,15 @@ func (k Keeper) MakeConsumerGenesis( ctx sdk.Context, consumerId string, ) (gen ccv.ConsumerGenesisState, nextValidatorsHash []byte, err error) { - initializationRecord, err := k.GetConsumerInitializationRecord(ctx, consumerId) + initializationRecord, err := k.GetConsumerInitializationParameters(ctx, consumerId) if err != nil { return gen, nil, errorsmod.Wrapf(types.ErrNoInitializationRecord, "initialization record for consumer chain: %s is missing", consumerId) } - updateRecord, err := k.GetConsumerUpdateRecord(ctx, consumerId) + updateRecord, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) if err != nil { - updateRecord = types.ConsumerUpdateRecord{ - OwnerAddress: "", + updateRecord = types.PowerShapingParameters{ Top_N: 0, ValidatorsPowerCap: 0, ValidatorSetCap: 0, @@ -339,7 +337,7 @@ func (k Keeper) GetPendingConsumerAdditionProp(ctx sdk.Context, spawnTime time.T func (k Keeper) BeginBlockInit(ctx sdk.Context) { // TODO (PERMISSIONLESS): we can parameterize the limit to 200 at a later stage for _, consumerId := range k.GetInitializedConsumersReadyToLaunch(ctx, 200) { - record, err := k.GetConsumerInitializationRecord(ctx, consumerId) + record, err := k.GetConsumerInitializationParameters(ctx, consumerId) if err != nil { ctx.Logger().Error("could not retrieve initialization record", "consumerId", consumerId, @@ -347,7 +345,7 @@ func (k Keeper) BeginBlockInit(ctx sdk.Context) { continue } // Remove consumer to prevent re-trying launching this chain. - // We would only tru to re-launch this chain if a new `MsgInitializeConsumer` message is sent. + // We would only try to re-launch this chain if a new `MsgUpdateConsumer` message is sent. k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, record.SpawnTime) cachedCtx, writeFn := ctx.CacheContext() @@ -443,7 +441,7 @@ func (k Keeper) SetPendingConsumerRemovalProp(ctx sdk.Context, prop *types.Consu // An error here would indicate something is very wrong panic(fmt.Errorf("failed to marshal consumer removal proposal: %w", err)) } - store.Set(types.PendingCRPKey(prop.StopTime, prop.ConsumerId), bz) + store.Set(types.PendingCRPKey(prop.StopTime, prop.ChainId), bz) } // PendingConsumerRemovalPropExists checks whether a pending consumer removal proposal @@ -463,7 +461,7 @@ func (k Keeper) DeletePendingConsumerRemovalProps(ctx sdk.Context, proposals ... store := ctx.KVStore(k.storeKey) for _, p := range proposals { - store.Delete(types.PendingCRPKey(p.StopTime, p.ConsumerId)) + store.Delete(types.PendingCRPKey(p.StopTime, p.ChainId)) } } @@ -569,6 +567,6 @@ func (k Keeper) GetAllPendingConsumerRemovalProps(ctx sdk.Context) (props []type // from a given consumer removal proposal in a cached context func (k Keeper) StopConsumerChainInCachedCtx(ctx sdk.Context, p types.ConsumerRemovalProposal) (cc sdk.Context, writeCache func(), err error) { cc, writeCache = ctx.CacheContext() - err = k.StopConsumerChain(cc, p.ConsumerId, true) + err = k.StopConsumerChain(cc, p.ChainId, true) return } diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index de87f3fbeb..2ca1f4dae9 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -80,9 +80,10 @@ func TestCreateConsumerClient(t *testing.T) { tc.setup(&providerKeeper, ctx, &mocks) // Call method with same arbitrary values as defined above in mock expectations. - providerKeeper.SetConsumerRegistrationRecord(ctx, "0", testkeeper.GetTestRegistrationRecord()) - providerKeeper.SetConsumerInitializationRecord(ctx, "0", testkeeper.GetTestInitializationRecord()) - providerKeeper.SetConsumerUpdateRecord(ctx, "0", testkeeper.GetTestUpdateRecord()) + providerKeeper.SetConsumerChainId(ctx, "0", "chainID") + providerKeeper.SetConsumerMetadata(ctx, "0", testkeeper.GetTestConsumerMetadata()) + providerKeeper.SetConsumerInitializationParameters(ctx, "0", testkeeper.GetTestInitializationParameters()) + providerKeeper.SetConsumerPowerShapingParameters(ctx, "0", testkeeper.GetTestPowerShapingParameters()) err := providerKeeper.CreateConsumerClient(ctx, "0") if tc.expClientCreated { @@ -415,11 +416,11 @@ func TestGetAllConsumerRemovalProps(t *testing.T) { now := time.Now().UTC() props := []providertypes.ConsumerRemovalProposal{ - {ConsumerId: "chain-2", StopTime: now}, - {ConsumerId: "chain-1", StopTime: now.Add(2 * time.Hour)}, - {ConsumerId: "chain-4", StopTime: now.Add(-time.Hour)}, - {ConsumerId: "chain-3", StopTime: now.Add(4 * time.Hour)}, - {ConsumerId: "chain-1", StopTime: now}, + {ChainId: "chain-2", StopTime: now}, + {ChainId: "chain-1", StopTime: now.Add(2 * time.Hour)}, + {ChainId: "chain-4", StopTime: now.Add(-time.Hour)}, + {ChainId: "chain-3", StopTime: now.Add(4 * time.Hour)}, + {ChainId: "chain-1", StopTime: now}, } expectedGetAllOrder := props // sorting by StopTime.UnixNano() @@ -429,7 +430,7 @@ func TestGetAllConsumerRemovalProps(t *testing.T) { cmpTimestamps := bytes.Compare(sdk.Uint64ToBigEndian(tsi), sdk.Uint64ToBigEndian(tsj)) if cmpTimestamps == 0 { // proposals with same StopTime - return expectedGetAllOrder[i].ConsumerId < expectedGetAllOrder[j].ConsumerId + return expectedGetAllOrder[i].ChainId < expectedGetAllOrder[j].ChainId } return cmpTimestamps == -1 }) @@ -521,13 +522,12 @@ func TestMakeConsumerGenesis(t *testing.T) { gomock.InOrder(testkeeper.GetMocksForMakeConsumerGenesis(ctx, &mocks, 1814400000000000)...) // matches params from jsonString - registrationRecord := providertypes.ConsumerRegistrationRecord{ - Title: "title", - Description: "desc", - ChainId: "testchain1", + consumerMetadata := providertypes.ConsumerMetadata{ + Name: "name", + Description: "description", } - initializationRecord := providertypes.ConsumerInitializationRecord{ + initializationParameters := providertypes.ConsumerInitializationParameters{ BlocksPerDistributionTransmission: 1000, CcvTimeoutPeriod: 2419200000000000, TransferTimeoutPeriod: 3600000000000, @@ -535,8 +535,9 @@ func TestMakeConsumerGenesis(t *testing.T) { HistoricalEntries: 10000, UnbondingPeriod: 1728000000000000, } - providerKeeper.SetConsumerRegistrationRecord(ctx, "0", registrationRecord) - providerKeeper.SetConsumerInitializationRecord(ctx, "0", initializationRecord) + providerKeeper.SetConsumerChainId(ctx, "0", "testchain1") + providerKeeper.SetConsumerMetadata(ctx, "0", consumerMetadata) + providerKeeper.SetConsumerInitializationParameters(ctx, "0", initializationParameters) actualGenesis, _, err := providerKeeper.MakeConsumerGenesis(ctx, "0") require.NoError(t, err) @@ -650,34 +651,31 @@ func TestBeginBlockInit(t *testing.T) { ctx = ctx.WithBlockTime(now) // initialize registration, initialization, and update records - registrationRecords := []providertypes.ConsumerRegistrationRecord{ + consumerMetadata := []providertypes.ConsumerMetadata{ { - Title: "title", + Name: "name", Description: "spawn time passed", - ChainId: "chain0", }, { - Title: "title", + Name: "title", Description: "spawn time passed", - ChainId: "chain1", }, { - Title: "title", + Name: "title", Description: "spawn time not passed", - ChainId: "chain2", }, { - Title: "title", + Name: "title", Description: "opt-in chain with at least one validator opted in", - ChainId: "chain3", }, { - Title: "title", + Name: "title", Description: "opt-in chain with no validator opted in", - ChainId: "chain4", }, } - initializationRecords := []providertypes.ConsumerInitializationRecord{ + chainIds := []string{"chain0", "chain1", "chain2", "chain3", "chain4"} + + initializationParameters := []providertypes.ConsumerInitializationParameters{ { InitialHeight: clienttypes.NewHeight(3, 4), GenesisHash: []byte{}, @@ -744,7 +742,7 @@ func TestBeginBlockInit(t *testing.T) { DistributionTransmissionChannel: "", }, } - updateRecords := []providertypes.ConsumerUpdateRecord{ + powerShapingParameters := []providertypes.PowerShapingParameters{ { Top_N: 50, ValidatorsPowerCap: 0, @@ -793,17 +791,21 @@ func TestBeginBlockInit(t *testing.T) { gomock.InOrder(expectedCalls...) // set up all the records - for i, r := range registrationRecords { - providerKeeper.SetConsumerRegistrationRecord(ctx, fmt.Sprintf("%d", i), r) + for i, chainId := range chainIds { + providerKeeper.SetConsumerChainId(ctx, fmt.Sprintf("%d", i), chainId) + } + + for i, r := range consumerMetadata { + providerKeeper.SetConsumerMetadata(ctx, fmt.Sprintf("%d", i), r) } - for i, r := range initializationRecords { - providerKeeper.SetConsumerInitializationRecord(ctx, fmt.Sprintf("%d", i), r) + for i, r := range initializationParameters { + providerKeeper.SetConsumerInitializationParameters(ctx, fmt.Sprintf("%d", i), r) // set up the chains in their initialized phase, hence they could launch providerKeeper.SetConsumerPhase(ctx, fmt.Sprintf("%d", i), providerkeeper.Initialized) providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, fmt.Sprintf("%d", i), r.SpawnTime) } - for i, r := range updateRecords { - providerKeeper.SetConsumerUpdateRecord(ctx, fmt.Sprintf("%d", i), r) + for i, r := range powerShapingParameters { + providerKeeper.SetConsumerPowerShapingParameters(ctx, fmt.Sprintf("%d", i), r) } // opt in a sample validator so the chain's proposal can successfully execute @@ -899,14 +901,14 @@ func TestBeginBlockCCR(t *testing.T) { // for i, consumerId := range consumerIds { // Setup a valid consumer chain for each consumerId - initializationRecord := testkeeper.GetTestInitializationRecord() + initializationRecord := testkeeper.GetTestInitializationParameters() initializationRecord.InitialHeight = clienttypes.NewHeight(2, 3) - registrationRecord := testkeeper.GetTestRegistrationRecord() - registrationRecord.ChainId = chainIds[i] + registrationRecord := testkeeper.GetTestConsumerMetadata() - providerKeeper.SetConsumerRegistrationRecord(ctx, consumerId, registrationRecord) - providerKeeper.SetConsumerInitializationRecord(ctx, consumerId, initializationRecord) - providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, testkeeper.GetTestUpdateRecord()) + providerKeeper.SetConsumerChainId(ctx, consumerId, chainIds[i]) + providerKeeper.SetConsumerMetadata(ctx, consumerId, registrationRecord) + providerKeeper.SetConsumerInitializationParameters(ctx, consumerId, initializationRecord) + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, testkeeper.GetTestPowerShapingParameters()) providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) providerKeeper.SetClientIdToConsumerId(ctx, "clientID", consumerId) diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index 1c5927480e..db8c991d7f 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -585,7 +585,7 @@ func TestEndBlockVSU(t *testing.T) { chainID := "consumerId" - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", providertypes.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", providertypes.PowerShapingParameters{ Top_N: 100, }) @@ -740,7 +740,7 @@ func TestQueueVSCPacketsWithPowerCapping(t *testing.T) { // add a consumer chain providerKeeper.SetConsumerClientId(ctx, "consumerId", "clientID") - providerKeeper.SetConsumerUpdateRecord(ctx, "consumerId", providertypes.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, "consumerId", providertypes.PowerShapingParameters{ Top_N: 50, // would opt in E ValidatorsPowerCap: 40, // set a power-capping of 40% }) diff --git a/x/ccv/provider/migrations/v5/migrations.go b/x/ccv/provider/migrations/v5/migrations.go index 75577014c4..1dca37bbae 100644 --- a/x/ccv/provider/migrations/v5/migrations.go +++ b/x/ccv/provider/migrations/v5/migrations.go @@ -15,7 +15,7 @@ func MigrateTopNForRegisteredChains(ctx sdk.Context, providerKeeper providerkeep for _, consumerId := range providerKeeper.GetAllRegisteredConsumerIds(ctx) { // TODO (PERMISSIONLESS): this migration already took place and does not make much sense in the Permissionless world // living here for now and we should totally remove - providerKeeper.SetConsumerUpdateRecord(ctx, consumerId, types.ConsumerUpdateRecord{ + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, types.PowerShapingParameters{ Top_N: 95, }) } diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index 89a9a24b58..ada89c947c 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -27,8 +27,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgAssignConsumerKey{}, - &MsgRegisterConsumer{}, - &MsgInitializeConsumer{}, + &MsgCreateConsumer{}, &MsgUpdateConsumer{}, &MsgRemoveConsumer{}, // keeping old messages (for now) so that existing proposals can be correctly deserialized diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 3cd7267168..66b85f004f 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -131,11 +131,15 @@ const ( ConsumerIdKeyName = "ConsumerIdKey" - ConsumerIdToRegistrationRecordKeyName = "ConsumerIdToRegistrationRecordKey" + ConsumerIdToChainIdKeyName = "ConsumerIdToChainIdKey" - ConsumerIdToInitializationRecordKeyName = "ConsumerIdToInitializationRecordKey" + ConsumerIdToOwnerAddressKeyName = "ConsumerIdToOwnerAddress" - ConsumerIdToUpdateRecordKeyName = "ConsumerIdToUpdateRecordKey" + ConsumerIdToConsumerMetadataKeyName = "ConsumerIdToMetadataKey" + + ConsumerIdToInitializationParametersKeyName = "ConsumerIdToInitializationParametersKey" + + ConsumerIdToPowerShapingParameters = "ConsumerIdToPowerShapingParametersKey" ConsumerIdToPhaseKeyName = "ConsumerIdToPhaseKey" @@ -354,35 +358,41 @@ func getKeyPrefixes() map[string]byte { // ConsumerIdKeyName is the key for storing the consumer id for the next registered consumer chain ConsumerIdKeyName: 45, - // ConsumerIdToRegistrationRecordKeyName is the key for storing the registration record for the given consumer id - ConsumerIdToRegistrationRecordKeyName: 46, + // ConsumerIdToChainIdKeyName is the key for storing the chain id for the given consumer id + ConsumerIdToChainIdKeyName: 46, + + // ConsumerIdToOwnerAddressKeyName is the key for storing the owner address for the given consumer id + ConsumerIdToOwnerAddressKeyName: 47, + + // ConsumerIdToConsumerMetadataKeyName is the key for storing the metadata for the given consumer id + ConsumerIdToConsumerMetadataKeyName: 48, - // ConsumerIdToInitializationRecordKeyName is the key for storing the initialization record for the given consumer id - ConsumerIdToInitializationRecordKeyName: 47, + // ConsumerIdToInitializationParametersKeyName is the key for storing the initialization parameters for the given consumer id + ConsumerIdToInitializationParametersKeyName: 49, - // ConsumerIdToUpdateRecordKeyName is the key for storing the update record for the given consumer id - ConsumerIdToUpdateRecordKeyName: 48, + // ConsumerIdToPowerShapingParameters is the key for storing the power-shaping parameters for the given consumer id + ConsumerIdToPowerShapingParameters: 50, // ConsumerIdToPhaseKeyName is the key for storing the phase of a consumer chain with the given consumer id - ConsumerIdToPhaseKeyName: 49, + ConsumerIdToPhaseKeyName: 51, // ConsumerIdToStopTimeKeyName is the key for storing the stop time of a consumer chain that is to be removed - ConsumerIdToStopTimeKeyName: 50, + ConsumerIdToStopTimeKeyName: 52, // SpawnTimeToConsumerIdKeyName is the key for storing pending initialized consumers that are to be launched. // For a specific spawn time, it might store multiple consumer chain ids for chains that are to be launched. - SpawnTimeToConsumerIdsKeyName: 51, + SpawnTimeToConsumerIdsKeyName: 53, // StopTimeToConsumerIdKeyName is the key for storing pending launched consumers that are to be stopped. // For a specific stop time, it might store multiple consumer chain ids for chains that are to be stopped. - StopTimeToConsumerIdsKeyName: 52, + StopTimeToConsumerIdsKeyName: 54, // ProviderConsAddrToOptedInConsumerIdsKeyName is the key for storing all the consumer ids that a validator // is currently opted in to. - ProviderConsAddrToOptedInConsumerIdsKeyName: 53, + ProviderConsAddrToOptedInConsumerIdsKeyName: 55, // ClientIdToConsumerIdKeyName is the key for storing the consumer id for the given client id - ClientIdToConsumerIdKeyName: 54, + ClientIdToConsumerIdKeyName: 56, // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO TestPreserveBytePrefix() IN keys_test.go } @@ -748,29 +758,39 @@ func ConsumerIdKey() []byte { return []byte{mustGetKeyPrefix(ConsumerIdKeyName)} } -// ConsumerIdToRegistrationRecordKeyPrefix returns the key prefix for storing consumer registration records -func ConsumerIdToRegistrationRecordKeyPrefix() byte { - return mustGetKeyPrefix(ConsumerIdToRegistrationRecordKeyName) +// ConsumerIdToChainIdKey returns the key used to store the chain id of this consumer id +func ConsumerIdToChainIdKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToChainIdKeyName), consumerId) +} + +// ConsumerIdToOwnerAddressKey returns the owner address of this consumer id +func ConsumerIdToOwnerAddressKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToOwnerAddressKeyName), consumerId) +} + +// ConsumerIdToMetadataKeyPrefix returns the key prefix for storing consumer metadata +func ConsumerIdToMetadataKeyPrefix() byte { + return mustGetKeyPrefix(ConsumerIdToConsumerMetadataKeyName) } -// ConsumerIdToRegistrationRecordKey returns the key used to store the registration record that corresponds to this consumer id -func ConsumerIdToRegistrationRecordKey(consumerId string) []byte { - return ConsumerIdWithLenKey(ConsumerIdToRegistrationRecordKeyPrefix(), consumerId) +// ConsumerIdToMetadataKey returns the key used to store the metadata that corresponds to this consumer id +func ConsumerIdToMetadataKey(consumerId string) []byte { + return ConsumerIdWithLenKey(ConsumerIdToMetadataKeyPrefix(), consumerId) } -// ConsumerIdToInitializationRecordKeyPrefix returns the key prefix for storing consumer initialization records -func ConsumerIdToInitializationRecordKeyPrefix() byte { - return mustGetKeyPrefix(ConsumerIdToInitializationRecordKeyName) +// ConsumerIdToInitializationParametersKeyPrefix returns the key prefix for storing consumer initialization records +func ConsumerIdToInitializationParametersKeyPrefix() byte { + return mustGetKeyPrefix(ConsumerIdToInitializationParametersKeyName) } -// ConsumerIdToInitializationRecordKey returns the key used to store the initialization record that corresponds to this consumer id -func ConsumerIdToInitializationRecordKey(consumerId string) []byte { - return ConsumerIdWithLenKey(ConsumerIdToInitializationRecordKeyPrefix(), consumerId) +// ConsumerIdToInitializationParametersKey returns the key used to store the initialization record that corresponds to this consumer id +func ConsumerIdToInitializationParametersKey(consumerId string) []byte { + return ConsumerIdWithLenKey(ConsumerIdToInitializationParametersKeyPrefix(), consumerId) } -// ConsumerIdToUpdateRecordKey returns the key used to store the update record that corresponds to this consumer id -func ConsumerIdToUpdateRecordKey(consumerId string) []byte { - return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToUpdateRecordKeyName), consumerId) +// ConsumerIdToPowerShapingParametersKey returns the key used to store the update record that corresponds to this consumer id +func ConsumerIdToPowerShapingParametersKey(consumerId string) []byte { + return ConsumerIdWithLenKey(mustGetKeyPrefix(ConsumerIdToPowerShapingParameters), consumerId) } // ConsumerIdToPhaseKey returns the key used to store the phase that corresponds to this consumer id diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 76b7e9eb15..9c7b53b7b1 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -129,23 +129,27 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(45), providertypes.ConsumerIdKey()[0]) i++ - require.Equal(t, byte(46), providertypes.ConsumerIdToRegistrationRecordKeyPrefix()) + require.Equal(t, byte(46), providertypes.ConsumerIdToChainIdKey("consumerId")[0]) i++ - require.Equal(t, byte(47), providertypes.ConsumerIdToInitializationRecordKeyPrefix()) + require.Equal(t, byte(47), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) i++ - require.Equal(t, byte(48), providertypes.ConsumerIdToUpdateRecordKey("consumerId")[0]) + require.Equal(t, byte(48), providertypes.ConsumerIdToMetadataKeyPrefix()) i++ - require.Equal(t, byte(49), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) + require.Equal(t, byte(49), providertypes.ConsumerIdToInitializationParametersKeyPrefix()) i++ - require.Equal(t, byte(50), providertypes.ConsumerIdToStopTimeKeyPrefix()) + require.Equal(t, byte(50), providertypes.ConsumerIdToPowerShapingParametersKey("consumerId")[0]) i++ - require.Equal(t, byte(51), providertypes.SpawnTimeToConsumerIdsKeyPrefix()) + require.Equal(t, byte(51), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) i++ - require.Equal(t, byte(52), providertypes.StopTimeToConsumerIdsKeyPrefix()) + require.Equal(t, byte(52), providertypes.ConsumerIdToStopTimeKeyPrefix()) i++ - require.Equal(t, byte(53), providertypes.ProviderConsAddrToOptedInConsumerIdsKey(providertypes.NewProviderConsAddress([]byte{0x05}))[0]) + require.Equal(t, byte(53), providertypes.SpawnTimeToConsumerIdsKeyPrefix()) i++ - require.Equal(t, byte(54), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, byte(54), providertypes.StopTimeToConsumerIdsKeyPrefix()) + i++ + require.Equal(t, byte(55), providertypes.ProviderConsAddrToOptedInConsumerIdsKey(providertypes.NewProviderConsAddress([]byte{0x05}))[0]) + i++ + require.Equal(t, byte(56), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() @@ -210,9 +214,11 @@ func getAllFullyDefinedKeys() [][]byte { providertypes.ConsumerAddrsToPruneV2Key("chainID", time.Time{}), providerkeeper.GetValidatorKey(types.LastProviderConsensusValsPrefix(), providertypes.NewProviderConsAddress([]byte{0x05})), providertypes.ConsumerIdKey(), - providertypes.ConsumerIdToRegistrationRecordKey("consumerId"), - providertypes.ConsumerIdToInitializationRecordKey("consumerId"), - providertypes.ConsumerIdToUpdateRecordKey("consumerId"), + providertypes.ConsumerIdToChainIdKey("consumerId"), + providertypes.ConsumerIdToOwnerAddressKey("consumerId"), + providertypes.ConsumerIdToMetadataKey("consumerId"), + providertypes.ConsumerIdToInitializationParametersKey("consumerId"), + providertypes.ConsumerIdToPowerShapingParametersKey("consumerId"), providertypes.ConsumerIdToPhaseKey("consumerId"), providertypes.ConsumerIdToStopTimeKey("consumerId"), providertypes.SpawnTimeToConsumerIdsKey(time.Time{}), diff --git a/x/ccv/provider/types/legacy_proposal.go b/x/ccv/provider/types/legacy_proposal.go index 47cfaa3728..6802ef71c4 100644 --- a/x/ccv/provider/types/legacy_proposal.go +++ b/x/ccv/provider/types/legacy_proposal.go @@ -212,7 +212,7 @@ func NewConsumerRemovalProposal(title, description, chainID string, stopTime tim return &ConsumerRemovalProposal{ Title: title, Description: description, - ConsumerId: chainID, + ChainId: chainID, StopTime: stopTime, } } @@ -229,7 +229,7 @@ func (sccp *ConsumerRemovalProposal) ValidateBasic() error { return err } - if strings.TrimSpace(sccp.ConsumerId) == "" { + if strings.TrimSpace(sccp.ChainId) == "" { return errorsmod.Wrap(ErrInvalidConsumerRemoval, "consumer chain id must not be blank") } diff --git a/x/ccv/provider/types/legacy_proposal_test.go b/x/ccv/provider/types/legacy_proposal_test.go index 77c4e977c8..2a772753f2 100644 --- a/x/ccv/provider/types/legacy_proposal_test.go +++ b/x/ccv/provider/types/legacy_proposal_test.go @@ -544,13 +544,13 @@ func TestChangeRewardDenomsProposalValidateBasic(t *testing.T) { func TestConsumerModificationProposalValidateBasic(t *testing.T) { testCases := []struct { - name string - updateRecord types.ConsumerUpdateRecord - expPass bool + name string + powerShapingParameters types.PowerShapingParameters + expPass bool }{ { "success", - types.ConsumerUpdateRecord{ + types.PowerShapingParameters{ Top_N: 50, ValidatorsPowerCap: 100, ValidatorSetCap: 34, @@ -563,7 +563,7 @@ func TestConsumerModificationProposalValidateBasic(t *testing.T) { }, { "top N is invalid", - types.ConsumerUpdateRecord{ + types.PowerShapingParameters{ Top_N: 10, ValidatorsPowerCap: 0, ValidatorSetCap: 0, @@ -574,7 +574,7 @@ func TestConsumerModificationProposalValidateBasic(t *testing.T) { }, { "validators power cap is invalid", - types.ConsumerUpdateRecord{ + types.PowerShapingParameters{ Top_N: 50, ValidatorsPowerCap: 101, ValidatorSetCap: 0, @@ -587,7 +587,7 @@ func TestConsumerModificationProposalValidateBasic(t *testing.T) { }, { "valid proposal", - types.ConsumerUpdateRecord{ + types.PowerShapingParameters{ Top_N: 54, ValidatorsPowerCap: 92, ValidatorSetCap: 0, @@ -601,7 +601,8 @@ func TestConsumerModificationProposalValidateBasic(t *testing.T) { } for _, tc := range testCases { - msg, _ := types.NewMsgUpdateConsumer("", "0", tc.updateRecord) + // TODO (PERMISSIONLESS) add more tests + msg, _ := types.NewMsgUpdateConsumer("", "0", "new owner", types.ConsumerMetadata{}, types.ConsumerInitializationParameters{}, tc.powerShapingParameters) err := msg.ValidateBasic() if tc.expPass { require.NoError(t, err, "valid case: %s should not return error. got %w", tc.name, err) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index d91b54f0ec..102dfa0d81 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -25,8 +25,7 @@ const ( TypeMsgAssignConsumerKey = "assign_consumer_key" TypeMsgSubmitConsumerMisbehaviour = "submit_consumer_misbehaviour" TypeMsgSubmitConsumerDoubleVoting = "submit_consumer_double_vote" - TypeMsgRegisterConsumer = "register_consumer" - TypeMsgInitializeConsumer = "initialize_consumer" + TypeMsgCreateConsumer = "create_consumer" TypeMsgUpdateConsumer = "update_consumer" TypeMsgRemoveConsumer = "remove_consumer" TypeMsgOptIn = "opt_in" @@ -39,8 +38,7 @@ var ( _ sdk.Msg = (*MsgChangeRewardDenoms)(nil) _ sdk.Msg = (*MsgSubmitConsumerMisbehaviour)(nil) _ sdk.Msg = (*MsgSubmitConsumerDoubleVoting)(nil) - _ sdk.Msg = (*MsgRegisterConsumer)(nil) - _ sdk.Msg = (*MsgInitializeConsumer)(nil) + _ sdk.Msg = (*MsgCreateConsumer)(nil) _ sdk.Msg = (*MsgUpdateConsumer)(nil) _ sdk.Msg = (*MsgRemoveConsumer)(nil) _ sdk.Msg = (*MsgConsumerAddition)(nil) @@ -54,8 +52,7 @@ var ( _ sdk.HasValidateBasic = (*MsgChangeRewardDenoms)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerMisbehaviour)(nil) _ sdk.HasValidateBasic = (*MsgSubmitConsumerDoubleVoting)(nil) - _ sdk.HasValidateBasic = (*MsgRegisterConsumer)(nil) - _ sdk.HasValidateBasic = (*MsgInitializeConsumer)(nil) + _ sdk.HasValidateBasic = (*MsgCreateConsumer)(nil) _ sdk.HasValidateBasic = (*MsgUpdateConsumer)(nil) _ sdk.HasValidateBasic = (*MsgRemoveConsumer)(nil) _ sdk.HasValidateBasic = (*MsgConsumerAddition)(nil) @@ -242,38 +239,42 @@ func (msg MsgSubmitConsumerDoubleVoting) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{addr} } -// NewMsgRegisterConsumer creates a new MsgRegisterConsumer instance -func NewMsgRegisterConsumer(signer string, registrationRecord ConsumerRegistrationRecord) (*MsgRegisterConsumer, error) { - return &MsgRegisterConsumer{ - Signer: signer, - RegistrationRecord: ®istrationRecord, +// NewMsgCreateConsumer creates a new MsgCreateConsumer instance +func NewMsgCreateConsumer(signer string, chainId string, metadata ConsumerMetadata, + initializationParameters ConsumerInitializationParameters, powerShapingParameters PowerShapingParameters) (*MsgCreateConsumer, error) { + return &MsgCreateConsumer{ + Signer: signer, + ChainId: chainId, + Metadata: &metadata, + InitializationParameters: &initializationParameters, + PowerShapingParameters: &powerShapingParameters, }, nil } // Type implements the sdk.Msg interface. -func (msg MsgRegisterConsumer) Type() string { - return TypeMsgRegisterConsumer +func (msg MsgCreateConsumer) Type() string { + return TypeMsgCreateConsumer } // Route implements the sdk.Msg interface. -func (msg MsgRegisterConsumer) Route() string { return RouterKey } +func (msg MsgCreateConsumer) Route() string { return RouterKey } // ValidateBasic implements the sdk.Msg interface. -func (msg MsgRegisterConsumer) ValidateBasic() error { +func (msg MsgCreateConsumer) ValidateBasic() error { // add checks // TODO (PERMISSIONLESS) return nil } // Type implements the sdk.Msg interface. -func (msg MsgRegisterConsumer) GetSignBytes() []byte { +func (msg MsgCreateConsumer) GetSignBytes() []byte { bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } // GetSigners implements the sdk.Msg interface. It returns the address(es) that // must sign over msg.GetSignBytes(). -func (msg MsgRegisterConsumer) GetSigners() []sdk.AccAddress { +func (msg MsgCreateConsumer) GetSigners() []sdk.AccAddress { valAddr, err := sdk.ValAddressFromBech32(msg.Signer) if err != nil { // same behavior as in cosmos-sdk @@ -282,57 +283,16 @@ func (msg MsgRegisterConsumer) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{valAddr.Bytes()} } -// NewMsgInitializeConsumer creates a new MsgInitializeConsumer instance -func NewMsgInitializeConsumer(signer string, consumerId string, initializationRecord ConsumerInitializationRecord) (*MsgInitializeConsumer, error) { - return &MsgInitializeConsumer{ - Authority: signer, - ConsumerId: consumerId, - InitializationRecord: &initializationRecord, - }, nil -} - -// Type implements the sdk.Msg interface. -func (msg MsgInitializeConsumer) Type() string { - return TypeMsgInitializeConsumer -} - -// Route implements the sdk.Msg interface. -func (msg MsgInitializeConsumer) Route() string { return RouterKey } - -// ValidateBasic implements the sdk.Msg interface. -func (msg MsgInitializeConsumer) ValidateBasic() error { - if err := ValidateConsumerId(msg.ConsumerId); err != nil { - return err - } - - // add checks - // TODO (PERMISSIONLESS) spawnTime has to be in the future - return nil -} - -// Type implements the sdk.Msg interface. -func (msg MsgInitializeConsumer) GetSignBytes() []byte { - bz := ccvtypes.ModuleCdc.MustMarshalJSON(&msg) - return sdk.MustSortJSON(bz) -} - -// GetSigners implements the sdk.Msg interface. It returns the address(es) that -// must sign over msg.GetSignBytes(). -func (msg MsgInitializeConsumer) GetSigners() []sdk.AccAddress { - valAddr, err := sdk.ValAddressFromBech32(msg.Authority) - if err != nil { - // same behavior as in cosmos-sdk - panic(err) - } - return []sdk.AccAddress{valAddr.Bytes()} -} - // NewMsgUpdateConsumer creates a new MsgUpdateConsumer instance -func NewMsgUpdateConsumer(signer string, consumerId string, updateRecord ConsumerUpdateRecord) (*MsgUpdateConsumer, error) { +func NewMsgUpdateConsumer(signer string, consumerId string, ownerAddress string, metadata ConsumerMetadata, + initializationParameters ConsumerInitializationParameters, powerShapingParameters PowerShapingParameters) (*MsgUpdateConsumer, error) { return &MsgUpdateConsumer{ - Authority: signer, - ConsumerId: consumerId, - UpdateRecord: &updateRecord, + Signer: signer, + ConsumerId: consumerId, + OwnerAddress: ownerAddress, + Metadata: &metadata, + InitializationParameters: &initializationParameters, + PowerShapingParameters: &powerShapingParameters, }, nil } @@ -351,7 +311,7 @@ func (msg MsgUpdateConsumer) ValidateBasic() error { } // TODO (PERMISSIONLESS): validate update record - err := ValidatePSSFeatures(msg.UpdateRecord.Top_N, msg.UpdateRecord.ValidatorsPowerCap) + err := ValidatePSSFeatures(msg.PowerShapingParameters.Top_N, msg.PowerShapingParameters.ValidatorsPowerCap) if err != nil { return errorsmod.Wrapf(ErrInvalidUpdateRecord, "invalid PSS features: %s", err.Error()) } @@ -368,7 +328,7 @@ func (msg MsgUpdateConsumer) GetSignBytes() []byte { // GetSigners implements the sdk.Msg interface. It returns the address(es) that // must sign over msg.GetSignBytes(). func (msg MsgUpdateConsumer) GetSigners() []sdk.AccAddress { - valAddr, err := sdk.ValAddressFromBech32(msg.Authority) + valAddr, err := sdk.ValAddressFromBech32(msg.Signer) if err != nil { // same behavior as in cosmos-sdk panic(err) diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 43135eff1e..249ff07881 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -37,6 +37,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// WARNING: This message is deprecated in favor of `MsgCreateConsumer`. // ConsumerAdditionProposal is a governance proposal on the provider chain to // spawn a new consumer chain. If it passes, then all validators on the provider // chain are expected to validate the consumer chain at spawn time or get @@ -151,6 +152,7 @@ func (m *ConsumerAdditionProposal) XXX_DiscardUnknown() { var xxx_messageInfo_ConsumerAdditionProposal proto.InternalMessageInfo +// WARNING: This message is deprecated in favor of `MsgRemoveConsumer`. // ConsumerRemovalProposal is a governance proposal on the provider chain to // remove (and stop) a consumer chain. If it passes, all the consumer chain's // state is removed from the provider chain. The outstanding unbonding operation @@ -161,8 +163,8 @@ type ConsumerRemovalProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // the description of the proposal Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the consumer id of the consumer chain to be stopped - ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // the chain-id of the consumer chain to be stopped + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // the time on the provider chain at which all validators are responsible to // stop their consumer chain validator node StopTime time.Time `protobuf:"bytes,4,opt,name=stop_time,json=stopTime,proto3,stdtime" json:"stop_time"` @@ -215,9 +217,9 @@ func (m *ConsumerRemovalProposal) GetDescription() string { return "" } -func (m *ConsumerRemovalProposal) GetConsumerId() string { +func (m *ConsumerRemovalProposal) GetChainId() string { if m != nil { - return m.ConsumerId + return m.ChainId } return "" } @@ -229,6 +231,7 @@ func (m *ConsumerRemovalProposal) GetStopTime() time.Time { return time.Time{} } +// WARNING: This message is deprecated in favor of `MsgUpdateConsumer`. // ConsumerModificationProposal is a governance proposal on the provider chain to modify parameters of a running // consumer chain. If it passes, the consumer chain's state is updated to take into account the newest params. type ConsumerModificationProposal struct { @@ -236,8 +239,8 @@ type ConsumerModificationProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // the description of the proposal Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the consumer id of the consumer chain to be modified - ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // the chain-id of the consumer chain to be modified + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. @@ -310,9 +313,9 @@ func (m *ConsumerModificationProposal) GetDescription() string { return "" } -func (m *ConsumerModificationProposal) GetConsumerId() string { +func (m *ConsumerModificationProposal) GetChainId() string { if m != nil { - return m.ConsumerId + return m.ChainId } return "" } @@ -899,6 +902,60 @@ func (m *AddressList) GetAddresses() [][]byte { return nil } +// WARNING: This message is deprecated and is not used. +// ChannelToChain is used to map a CCV channel ID to the consumer chainID +type ChannelToChain struct { + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *ChannelToChain) Reset() { *m = ChannelToChain{} } +func (m *ChannelToChain) String() string { return proto.CompactTextString(m) } +func (*ChannelToChain) ProtoMessage() {} +func (*ChannelToChain) Descriptor() ([]byte, []int) { + return fileDescriptor_f22ec409a72b7b72, []int{11} +} +func (m *ChannelToChain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChannelToChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChannelToChain.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 *ChannelToChain) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelToChain.Merge(m, src) +} +func (m *ChannelToChain) XXX_Size() int { + return m.Size() +} +func (m *ChannelToChain) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelToChain.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelToChain proto.InternalMessageInfo + +func (m *ChannelToChain) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *ChannelToChain) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + // ValidatorSetChangePackets is a pb list of ccv.ValidatorSetChangePacketData. type ValidatorSetChangePackets struct { List []types3.ValidatorSetChangePacketData `protobuf:"bytes,1,rep,name=list,proto3" json:"list"` @@ -908,7 +965,7 @@ func (m *ValidatorSetChangePackets) Reset() { *m = ValidatorSetChangePac func (m *ValidatorSetChangePackets) String() string { return proto.CompactTextString(m) } func (*ValidatorSetChangePackets) ProtoMessage() {} func (*ValidatorSetChangePackets) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{11} + return fileDescriptor_f22ec409a72b7b72, []int{12} } func (m *ValidatorSetChangePackets) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -954,7 +1011,7 @@ func (m *KeyAssignmentReplacement) Reset() { *m = KeyAssignmentReplaceme func (m *KeyAssignmentReplacement) String() string { return proto.CompactTextString(m) } func (*KeyAssignmentReplacement) ProtoMessage() {} func (*KeyAssignmentReplacement) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{12} + return fileDescriptor_f22ec409a72b7b72, []int{13} } func (m *KeyAssignmentReplacement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1017,7 +1074,7 @@ func (m *ValidatorConsumerPubKey) Reset() { *m = ValidatorConsumerPubKey func (m *ValidatorConsumerPubKey) String() string { return proto.CompactTextString(m) } func (*ValidatorConsumerPubKey) ProtoMessage() {} func (*ValidatorConsumerPubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{13} + return fileDescriptor_f22ec409a72b7b72, []int{14} } func (m *ValidatorConsumerPubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1080,7 +1137,7 @@ func (m *ValidatorByConsumerAddr) Reset() { *m = ValidatorByConsumerAddr func (m *ValidatorByConsumerAddr) String() string { return proto.CompactTextString(m) } func (*ValidatorByConsumerAddr) ProtoMessage() {} func (*ValidatorByConsumerAddr) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{14} + return fileDescriptor_f22ec409a72b7b72, []int{15} } func (m *ValidatorByConsumerAddr) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1142,7 +1199,7 @@ func (m *ConsumerAddrsToPruneV2) Reset() { *m = ConsumerAddrsToPruneV2{} func (m *ConsumerAddrsToPruneV2) String() string { return proto.CompactTextString(m) } func (*ConsumerAddrsToPruneV2) ProtoMessage() {} func (*ConsumerAddrsToPruneV2) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{15} + return fileDescriptor_f22ec409a72b7b72, []int{16} } func (m *ConsumerAddrsToPruneV2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1215,7 +1272,7 @@ func (m *ConsensusValidator) Reset() { *m = ConsensusValidator{} } func (m *ConsensusValidator) String() string { return proto.CompactTextString(m) } func (*ConsensusValidator) ProtoMessage() {} func (*ConsensusValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{16} + return fileDescriptor_f22ec409a72b7b72, []int{17} } func (m *ConsensusValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1283,7 +1340,7 @@ func (m *ConsumerRewardsAllocation) Reset() { *m = ConsumerRewardsAlloca func (m *ConsumerRewardsAllocation) String() string { return proto.CompactTextString(m) } func (*ConsumerRewardsAllocation) ProtoMessage() {} func (*ConsumerRewardsAllocation) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{17} + return fileDescriptor_f22ec409a72b7b72, []int{18} } func (m *ConsumerRewardsAllocation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1319,247 +1376,591 @@ func (m *ConsumerRewardsAllocation) GetRewards() github_com_cosmos_cosmos_sdk_ty return nil } -func init() { - proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") - proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") - proto.RegisterType((*ConsumerModificationProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerModificationProposal") - proto.RegisterType((*EquivocationProposal)(nil), "interchain_security.ccv.provider.v1.EquivocationProposal") - proto.RegisterType((*ChangeRewardDenomsProposal)(nil), "interchain_security.ccv.provider.v1.ChangeRewardDenomsProposal") - proto.RegisterType((*GlobalSlashEntry)(nil), "interchain_security.ccv.provider.v1.GlobalSlashEntry") - proto.RegisterType((*Params)(nil), "interchain_security.ccv.provider.v1.Params") - proto.RegisterType((*SlashAcks)(nil), "interchain_security.ccv.provider.v1.SlashAcks") - proto.RegisterType((*ConsumerAdditionProposals)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposals") - proto.RegisterType((*ConsumerRemovalProposals)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposals") - proto.RegisterType((*AddressList)(nil), "interchain_security.ccv.provider.v1.AddressList") - proto.RegisterType((*ValidatorSetChangePackets)(nil), "interchain_security.ccv.provider.v1.ValidatorSetChangePackets") - proto.RegisterType((*KeyAssignmentReplacement)(nil), "interchain_security.ccv.provider.v1.KeyAssignmentReplacement") - proto.RegisterType((*ValidatorConsumerPubKey)(nil), "interchain_security.ccv.provider.v1.ValidatorConsumerPubKey") - proto.RegisterType((*ValidatorByConsumerAddr)(nil), "interchain_security.ccv.provider.v1.ValidatorByConsumerAddr") - proto.RegisterType((*ConsumerAddrsToPruneV2)(nil), "interchain_security.ccv.provider.v1.ConsumerAddrsToPruneV2") - proto.RegisterType((*ConsensusValidator)(nil), "interchain_security.ccv.provider.v1.ConsensusValidator") - proto.RegisterType((*ConsumerRewardsAllocation)(nil), "interchain_security.ccv.provider.v1.ConsumerRewardsAllocation") +// ConsumerMetadata contains general information about the registered chain +type ConsumerMetadata struct { + // the name of the chain + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // the description of the chain + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the metadata (e.g., GitHub repository URL) of the chain + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func init() { - proto.RegisterFile("interchain_security/ccv/provider/v1/provider.proto", fileDescriptor_f22ec409a72b7b72) +func (m *ConsumerMetadata) Reset() { *m = ConsumerMetadata{} } +func (m *ConsumerMetadata) String() string { return proto.CompactTextString(m) } +func (*ConsumerMetadata) ProtoMessage() {} +func (*ConsumerMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_f22ec409a72b7b72, []int{19} +} +func (m *ConsumerMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsumerMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsumerMetadata.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 *ConsumerMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerMetadata.Merge(m, src) +} +func (m *ConsumerMetadata) XXX_Size() int { + return m.Size() +} +func (m *ConsumerMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerMetadata.DiscardUnknown(m) } -var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1935 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x41, 0x8d, 0x14, 0x7b, 0xa5, 0x08, 0x24, 0xcd, 0xd4, - 0x06, 0x1b, 0xd7, 0xcb, 0x48, 0x41, 0x01, 0xc3, 0x6d, 0x60, 0x48, 0x94, 0x13, 0xdb, 0x6a, 0x1c, - 0x76, 0x25, 0x28, 0x40, 0x7a, 0x58, 0x0c, 0x67, 0x47, 0xe4, 0x54, 0xbb, 0x3b, 0xeb, 0x99, 0xe1, - 0xca, 0xbc, 0xf4, 0xdc, 0x4b, 0x81, 0xf4, 0x16, 0xf4, 0xd2, 0x1c, 0x8b, 0x9e, 0x7a, 0x28, 0xfa, - 0x07, 0xf4, 0x14, 0x14, 0x28, 0x90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f2, 0xc9, 0x89, 0xe6, 0x10, 0x47, 0xec, 0x50, 0xc1, 0xed, 0x14, 0x1d, 0x3b, 0x26, - 0xe0, 0x23, 0x70, 0xc3, 0x47, 0xcf, 0x9c, 0x2c, 0x99, 0x95, 0xe3, 0x24, 0x10, 0x43, 0xe1, 0x8c, - 0x1b, 0x79, 0x32, 0x1f, 0xd5, 0x7c, 0xf4, 0xac, 0x9b, 0xe0, 0x3a, 0x29, 0xec, 0x38, 0x43, 0x3d, - 0x2e, 0x96, 0x8a, 0xd5, 0xb9, 0xc7, 0xc5, 0xd2, 0x5c, 0x75, 0xfe, 0x71, 0xb1, 0x54, 0xaa, 0x96, - 0x9b, 0x3f, 0x04, 0x65, 0x5d, 0xd7, 0xbb, 0xf8, 0x54, 0xe8, 0xce, 0xee, 0xba, 0x9c, 0x08, 0x41, - 0x84, 0x69, 0x24, 0x9d, 0x3d, 0x15, 0x34, 0x25, 0xd8, 0xb8, 0xea, 0xab, 0x41, 0xc0, 0x4f, 0xc1, - 0x42, 0x48, 0xf4, 0x48, 0xab, 0x0d, 0x2b, 0x3b, 0x1f, 0x58, 0x53, 0x7c, 0xee, 0x59, 0x57, 0x11, - 0xda, 0x29, 0x5b, 0x93, 0x8f, 0xbf, 0x55, 0xce, 0x4d, 0x0c, 0x02, 0x1e, 0x9f, 0x5f, 0xf4, 0xa7, - 0xaf, 0xb5, 0xe8, 0x39, 0xbe, 0xf1, 0x9a, 0xb7, 0x41, 0x65, 0x37, 0x0e, 0xfb, 0x67, 0xea, 0xda, - 0xba, 0xb0, 0x2d, 0x8b, 0xf9, 0x6d, 0x61, 0x60, 0xe3, 0x38, 0x7f, 0x43, 0xea, 0x86, 0xdf, 0x45, - 0xf8, 0x94, 0x48, 0x01, 0x6d, 0x50, 0xd4, 0x37, 0x61, 0xec, 0xde, 0xdd, 0x2b, 0xdd, 0x8b, 0xb6, - 0xad, 0xab, 0x48, 0xf6, 0x91, 0x44, 0x49, 0xce, 0x6a, 0xae, 0xe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0xd1, 0x8f, 0xdb, 0xcf, 0x26, 0x7f, 0x76, 0xd3, 0xeb, 0xf5, 0xe6, 0x75, 0x86, 0xbc, - 0xff, 0x5d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0x54, 0x79, 0x8c, 0xa7, 0x13, 0x00, 0x00, +var xxx_messageInfo_ConsumerMetadata proto.InternalMessageInfo + +func (m *ConsumerMetadata) GetName() string { + if m != nil { + return m.Name + } + return "" } -func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *ConsumerMetadata) GetDescription() string { + if m != nil { + return m.Description } - return dAtA[:n], nil + return "" } -func (m *ConsumerAdditionProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *ConsumerMetadata) GetMetadata() string { + if m != nil { + return m.Metadata + } + return "" } -func (m *ConsumerAdditionProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AllowInactiveVals { - i-- - if m.AllowInactiveVals { - dAtA[i] = 1 - } else { - dAtA[i] = 0 +// ConsumerInitializationParameters are the parameters needed to launch a chain +type ConsumerInitializationParameters struct { + // the proposed initial height of new consumer chain. + // For a completely new chain, this will be {0,1}. However, it may be + // different if this is a chain that is converting to a consumer chain. + InitialHeight types.Height `protobuf:"bytes,1,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` + // The hash of the consumer chain genesis state without the consumer CCV + // module genesis params. It is used for off-chain confirmation of + // genesis.json validity by validators and other parties. + GenesisHash []byte `protobuf:"bytes,2,opt,name=genesis_hash,json=genesisHash,proto3" json:"genesis_hash,omitempty"` + // The hash of the consumer chain binary that should be run by validators on + // chain initialization. It is used for off-chain confirmation of binary + // validity by validators and other parties. + BinaryHash []byte `protobuf:"bytes,3,opt,name=binary_hash,json=binaryHash,proto3" json:"binary_hash,omitempty"` + // spawn time is the time on the provider chain at which the consumer chain + // genesis is finalized and all validators will be responsible for starting + // their consumer chain validator node. + SpawnTime time.Time `protobuf:"bytes,4,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + UnbondingPeriod time.Duration `protobuf:"bytes,5,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` + // Sent CCV related IBC packets will timeout after this duration + CcvTimeoutPeriod time.Duration `protobuf:"bytes,6,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` + // Sent transfer related IBC packets will timeout after this duration + TransferTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + ConsumerRedistributionFraction string `protobuf:"bytes,8,opt,name=consumer_redistribution_fraction,json=consumerRedistributionFraction,proto3" json:"consumer_redistribution_fraction,omitempty"` + // BlocksPerDistributionTransmission is the number of blocks between + // ibc-token-transfers from the consumer chain to the provider chain. On + // sending transmission event, `consumer_redistribution_fraction` of the + // accumulated tokens are sent to the consumer redistribution address. + BlocksPerDistributionTransmission int64 `protobuf:"varint,9,opt,name=blocks_per_distribution_transmission,json=blocksPerDistributionTransmission,proto3" json:"blocks_per_distribution_transmission,omitempty"` + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + HistoricalEntries int64 `protobuf:"varint,10,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"` + // The ID of a token transfer channel used for the Reward Distribution + // sub-protocol. If DistributionTransmissionChannel == "", a new transfer + // channel is created on top of the same connection as the CCV channel. + // Note that transfer_channel_id is the ID of the channel end on the consumer + // chain. it is most relevant for chains performing a sovereign to consumer + // changeover in order to maintain the existing ibc transfer channel + DistributionTransmissionChannel string `protobuf:"bytes,11,opt,name=distribution_transmission_channel,json=distributionTransmissionChannel,proto3" json:"distribution_transmission_channel,omitempty"` +} + +func (m *ConsumerInitializationParameters) Reset() { *m = ConsumerInitializationParameters{} } +func (m *ConsumerInitializationParameters) String() string { return proto.CompactTextString(m) } +func (*ConsumerInitializationParameters) ProtoMessage() {} +func (*ConsumerInitializationParameters) Descriptor() ([]byte, []int) { + return fileDescriptor_f22ec409a72b7b72, []int{20} +} +func (m *ConsumerInitializationParameters) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsumerInitializationParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsumerInitializationParameters.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa8 + return b[:n], nil } - if m.MinStake != 0 { - i = encodeVarintProvider(dAtA, i, uint64(m.MinStake)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa0 +} +func (m *ConsumerInitializationParameters) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerInitializationParameters.Merge(m, src) +} +func (m *ConsumerInitializationParameters) XXX_Size() int { + return m.Size() +} +func (m *ConsumerInitializationParameters) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerInitializationParameters.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsumerInitializationParameters proto.InternalMessageInfo + +func (m *ConsumerInitializationParameters) GetInitialHeight() types.Height { + if m != nil { + return m.InitialHeight } - if len(m.Denylist) > 0 { - for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denylist[iNdEx]) - copy(dAtA[i:], m.Denylist[iNdEx]) - i = encodeVarintProvider(dAtA, i, uint64(len(m.Denylist[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - } + return types.Height{} +} + +func (m *ConsumerInitializationParameters) GetGenesisHash() []byte { + if m != nil { + return m.GenesisHash } - if len(m.Allowlist) > 0 { - for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Allowlist[iNdEx]) - copy(dAtA[i:], m.Allowlist[iNdEx]) - i = encodeVarintProvider(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - } + return nil +} + +func (m *ConsumerInitializationParameters) GetBinaryHash() []byte { + if m != nil { + return m.BinaryHash } - if m.ValidatorSetCap != 0 { - i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorSetCap)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x88 + return nil +} + +func (m *ConsumerInitializationParameters) GetSpawnTime() time.Time { + if m != nil { + return m.SpawnTime } - if m.ValidatorsPowerCap != 0 { - i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorsPowerCap)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 + return time.Time{} +} + +func (m *ConsumerInitializationParameters) GetUnbondingPeriod() time.Duration { + if m != nil { + return m.UnbondingPeriod } - if m.Top_N != 0 { - i = encodeVarintProvider(dAtA, i, uint64(m.Top_N)) - i-- - dAtA[i] = 0x78 + return 0 +} + +func (m *ConsumerInitializationParameters) GetCcvTimeoutPeriod() time.Duration { + if m != nil { + return m.CcvTimeoutPeriod } - if len(m.DistributionTransmissionChannel) > 0 { - i -= len(m.DistributionTransmissionChannel) - copy(dAtA[i:], m.DistributionTransmissionChannel) - i = encodeVarintProvider(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) - i-- - dAtA[i] = 0x72 + return 0 +} + +func (m *ConsumerInitializationParameters) GetTransferTimeoutPeriod() time.Duration { + if m != nil { + return m.TransferTimeoutPeriod } - if m.HistoricalEntries != 0 { - i = encodeVarintProvider(dAtA, i, uint64(m.HistoricalEntries)) - i-- - dAtA[i] = 0x68 + return 0 +} + +func (m *ConsumerInitializationParameters) GetConsumerRedistributionFraction() string { + if m != nil { + return m.ConsumerRedistributionFraction + } + return "" +} + +func (m *ConsumerInitializationParameters) GetBlocksPerDistributionTransmission() int64 { + if m != nil { + return m.BlocksPerDistributionTransmission + } + return 0 +} + +func (m *ConsumerInitializationParameters) GetHistoricalEntries() int64 { + if m != nil { + return m.HistoricalEntries + } + return 0 +} + +func (m *ConsumerInitializationParameters) GetDistributionTransmissionChannel() string { + if m != nil { + return m.DistributionTransmissionChannel + } + return "" +} + +// PowerShapingParameters contains parameters that shape the validator set that we send to the consumer chain +type PowerShapingParameters struct { + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + Top_N uint32 `protobuf:"varint,2,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + ValidatorsPowerCap uint32 `protobuf:"varint,3,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + ValidatorSetCap uint32 `protobuf:"varint,4,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + // corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate the consumer chain + Allowlist []string `protobuf:"bytes,6,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + // corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain + Denylist []string `protobuf:"bytes,7,rep,name=denylist,proto3" json:"denylist,omitempty"` + // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. + MinStake uint64 `protobuf:"varint,8,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` + // Corresponds to whether inactive validators are allowed to validate the consumer chain. + AllowInactiveVals bool `protobuf:"varint,9,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` +} + +func (m *PowerShapingParameters) Reset() { *m = PowerShapingParameters{} } +func (m *PowerShapingParameters) String() string { return proto.CompactTextString(m) } +func (*PowerShapingParameters) ProtoMessage() {} +func (*PowerShapingParameters) Descriptor() ([]byte, []int) { + return fileDescriptor_f22ec409a72b7b72, []int{21} +} +func (m *PowerShapingParameters) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PowerShapingParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PowerShapingParameters.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 *PowerShapingParameters) XXX_Merge(src proto.Message) { + xxx_messageInfo_PowerShapingParameters.Merge(m, src) +} +func (m *PowerShapingParameters) XXX_Size() int { + return m.Size() +} +func (m *PowerShapingParameters) XXX_DiscardUnknown() { + xxx_messageInfo_PowerShapingParameters.DiscardUnknown(m) +} + +var xxx_messageInfo_PowerShapingParameters proto.InternalMessageInfo + +func (m *PowerShapingParameters) GetTop_N() uint32 { + if m != nil { + return m.Top_N + } + return 0 +} + +func (m *PowerShapingParameters) GetValidatorsPowerCap() uint32 { + if m != nil { + return m.ValidatorsPowerCap + } + return 0 +} + +func (m *PowerShapingParameters) GetValidatorSetCap() uint32 { + if m != nil { + return m.ValidatorSetCap + } + return 0 +} + +func (m *PowerShapingParameters) GetAllowlist() []string { + if m != nil { + return m.Allowlist + } + return nil +} + +func (m *PowerShapingParameters) GetDenylist() []string { + if m != nil { + return m.Denylist + } + return nil +} + +func (m *PowerShapingParameters) GetMinStake() uint64 { + if m != nil { + return m.MinStake + } + return 0 +} + +func (m *PowerShapingParameters) GetAllowInactiveVals() bool { + if m != nil { + return m.AllowInactiveVals + } + return false +} + +func init() { + proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") + proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") + proto.RegisterType((*ConsumerModificationProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerModificationProposal") + proto.RegisterType((*EquivocationProposal)(nil), "interchain_security.ccv.provider.v1.EquivocationProposal") + proto.RegisterType((*ChangeRewardDenomsProposal)(nil), "interchain_security.ccv.provider.v1.ChangeRewardDenomsProposal") + proto.RegisterType((*GlobalSlashEntry)(nil), "interchain_security.ccv.provider.v1.GlobalSlashEntry") + proto.RegisterType((*Params)(nil), "interchain_security.ccv.provider.v1.Params") + proto.RegisterType((*SlashAcks)(nil), "interchain_security.ccv.provider.v1.SlashAcks") + proto.RegisterType((*ConsumerAdditionProposals)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposals") + proto.RegisterType((*ConsumerRemovalProposals)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposals") + proto.RegisterType((*AddressList)(nil), "interchain_security.ccv.provider.v1.AddressList") + proto.RegisterType((*ChannelToChain)(nil), "interchain_security.ccv.provider.v1.ChannelToChain") + proto.RegisterType((*ValidatorSetChangePackets)(nil), "interchain_security.ccv.provider.v1.ValidatorSetChangePackets") + proto.RegisterType((*KeyAssignmentReplacement)(nil), "interchain_security.ccv.provider.v1.KeyAssignmentReplacement") + proto.RegisterType((*ValidatorConsumerPubKey)(nil), "interchain_security.ccv.provider.v1.ValidatorConsumerPubKey") + proto.RegisterType((*ValidatorByConsumerAddr)(nil), "interchain_security.ccv.provider.v1.ValidatorByConsumerAddr") + proto.RegisterType((*ConsumerAddrsToPruneV2)(nil), "interchain_security.ccv.provider.v1.ConsumerAddrsToPruneV2") + proto.RegisterType((*ConsensusValidator)(nil), "interchain_security.ccv.provider.v1.ConsensusValidator") + proto.RegisterType((*ConsumerRewardsAllocation)(nil), "interchain_security.ccv.provider.v1.ConsumerRewardsAllocation") + proto.RegisterType((*ConsumerMetadata)(nil), "interchain_security.ccv.provider.v1.ConsumerMetadata") + proto.RegisterType((*ConsumerInitializationParameters)(nil), "interchain_security.ccv.provider.v1.ConsumerInitializationParameters") + proto.RegisterType((*PowerShapingParameters)(nil), "interchain_security.ccv.provider.v1.PowerShapingParameters") +} + +func init() { + proto.RegisterFile("interchain_security/ccv/provider/v1/provider.proto", fileDescriptor_f22ec409a72b7b72) +} + +var fileDescriptor_f22ec409a72b7b72 = []byte{ + // 2104 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcf, 0x6f, 0x1b, 0xc7, + 0xf5, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x83, 0x1a, 0x3b, 0xf6, 0x4a, 0xd1, 0x97, 0xa4, 0x37, + 0x5f, 0x1b, 0x6c, 0x5c, 0x2f, 0x23, 0x05, 0x05, 0x0c, 0xb7, 0x81, 0x21, 0x51, 0x4e, 0x2c, 0xa9, + 0x71, 0xd8, 0x95, 0xa0, 0x00, 0xe9, 0x61, 0x31, 0xdc, 0x1d, 0x91, 0x53, 0xed, 0xee, 0xac, 0x67, + 0x86, 0x2b, 0xb3, 0x87, 0x9e, 0x8b, 0x02, 0x05, 0xd2, 0x9e, 0x82, 0x5e, 0x9a, 0x63, 0xd1, 0x53, + 0x0f, 0x45, 0xff, 0x80, 0x9e, 0x82, 0x02, 0x45, 0x73, 0xec, 0x29, 0x29, 0xec, 0x43, 0x0f, 0x05, + 0x7a, 0xed, 0xb5, 0x98, 0xd9, 0x1f, 0x5c, 0xea, 0x97, 0x69, 0x58, 0xee, 0x45, 0xda, 0x79, 0xef, + 0xf3, 0xde, 0xbc, 0x99, 0x79, 0xbf, 0x66, 0x08, 0x36, 0x48, 0x20, 0x30, 0x73, 0xfa, 0x88, 0x04, + 0x36, 0xc7, 0xce, 0x80, 0x11, 0x31, 0x6c, 0x39, 0x4e, 0xd4, 0x0a, 0x19, 0x8d, 0x88, 0x8b, 0x59, + 0x2b, 0x5a, 0xcf, 0xbe, 0xcd, 0x90, 0x51, 0x41, 0xe1, 0x3b, 0xe7, 0xc8, 0x98, 0x8e, 0x13, 0x99, + 0x19, 0x2e, 0x5a, 0x5f, 0xbd, 0x7d, 0x91, 0xe2, 0x68, 0xbd, 0x75, 0x42, 0x18, 0x8e, 0x75, 0xad, + 0x5e, 0xef, 0xd1, 0x1e, 0x55, 0x9f, 0x2d, 0xf9, 0x95, 0x50, 0xeb, 0x3d, 0x4a, 0x7b, 0x1e, 0x6e, + 0xa9, 0x51, 0x77, 0x70, 0xd4, 0x12, 0xc4, 0xc7, 0x5c, 0x20, 0x3f, 0x4c, 0x00, 0xb5, 0xd3, 0x00, + 0x77, 0xc0, 0x90, 0x20, 0x34, 0x48, 0x15, 0x90, 0xae, 0xd3, 0x72, 0x28, 0xc3, 0x2d, 0xc7, 0x23, + 0x38, 0x10, 0x72, 0xd6, 0xf8, 0x2b, 0x01, 0xb4, 0x24, 0xc0, 0x23, 0xbd, 0xbe, 0x88, 0xc9, 0xbc, + 0x25, 0x70, 0xe0, 0x62, 0xe6, 0x93, 0x18, 0x3c, 0x1a, 0x25, 0x02, 0x6b, 0x39, 0xbe, 0xc3, 0x86, + 0xa1, 0xa0, 0xad, 0x63, 0x3c, 0xe4, 0x09, 0xf7, 0x8e, 0x43, 0xb9, 0x4f, 0x79, 0x0b, 0xcb, 0xf5, + 0x07, 0x0e, 0x6e, 0x45, 0xeb, 0x5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0x6b, 0x6f, 0x18, 0x00, 0x00, +} + +func (m *ConsumerAdditionProposal) 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 *ConsumerAdditionProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsumerAdditionProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AllowInactiveVals { + i-- + if m.AllowInactiveVals { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if m.MinStake != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.MinStake)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if len(m.Denylist) > 0 { + for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denylist[iNdEx]) + copy(dAtA[i:], m.Denylist[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + } + if len(m.Allowlist) > 0 { + for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Allowlist[iNdEx]) + copy(dAtA[i:], m.Allowlist[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + } + if m.ValidatorSetCap != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorSetCap)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.ValidatorsPowerCap != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorsPowerCap)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.Top_N != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.Top_N)) + i-- + dAtA[i] = 0x78 + } + if len(m.DistributionTransmissionChannel) > 0 { + i -= len(m.DistributionTransmissionChannel) + copy(dAtA[i:], m.DistributionTransmissionChannel) + i = encodeVarintProvider(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) + i-- + dAtA[i] = 0x72 + } + if m.HistoricalEntries != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.HistoricalEntries)) + i-- + dAtA[i] = 0x68 } if m.BlocksPerDistributionTransmission != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) @@ -1681,10 +2082,10 @@ func (m *ConsumerRemovalProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintProvider(dAtA, i, uint64(n6)) i-- dAtA[i] = 0x22 - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintProvider(dAtA, i, uint64(len(m.ConsumerId))) + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintProvider(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0x1a } @@ -1773,10 +2174,10 @@ func (m *ConsumerModificationProposal) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x20 } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintProvider(dAtA, i, uint64(len(m.ConsumerId))) + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintProvider(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0x1a } @@ -2181,6 +2582,43 @@ func (m *AddressList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ChannelToChain) 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 *ChannelToChain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChannelToChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintProvider(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintProvider(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ValidatorSetChangePackets) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2497,10 +2935,228 @@ func (m *ConsumerRewardsAllocation) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarintProvider(dAtA []byte, offset int, v uint64) int { - offset -= sovProvider(v) - base := offset - for v >= 1<<7 { +func (m *ConsumerMetadata) 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 *ConsumerMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsumerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsumerInitializationParameters) 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 *ConsumerInitializationParameters) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsumerInitializationParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DistributionTransmissionChannel) > 0 { + i -= len(m.DistributionTransmissionChannel) + copy(dAtA[i:], m.DistributionTransmissionChannel) + i = encodeVarintProvider(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) + i-- + dAtA[i] = 0x5a + } + if m.HistoricalEntries != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.HistoricalEntries)) + i-- + dAtA[i] = 0x50 + } + if m.BlocksPerDistributionTransmission != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) + i-- + dAtA[i] = 0x48 + } + if len(m.ConsumerRedistributionFraction) > 0 { + i -= len(m.ConsumerRedistributionFraction) + copy(dAtA[i:], m.ConsumerRedistributionFraction) + i = encodeVarintProvider(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) + i-- + dAtA[i] = 0x42 + } + n17, err17 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) + if err17 != nil { + return 0, err17 + } + i -= n17 + i = encodeVarintProvider(dAtA, i, uint64(n17)) + i-- + dAtA[i] = 0x3a + n18, err18 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + if err18 != nil { + return 0, err18 + } + i -= n18 + i = encodeVarintProvider(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0x32 + n19, err19 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err19 != nil { + return 0, err19 + } + i -= n19 + i = encodeVarintProvider(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0x2a + n20, err20 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) + if err20 != nil { + return 0, err20 + } + i -= n20 + i = encodeVarintProvider(dAtA, i, uint64(n20)) + i-- + dAtA[i] = 0x22 + if len(m.BinaryHash) > 0 { + i -= len(m.BinaryHash) + copy(dAtA[i:], m.BinaryHash) + i = encodeVarintProvider(dAtA, i, uint64(len(m.BinaryHash))) + i-- + dAtA[i] = 0x1a + } + if len(m.GenesisHash) > 0 { + i -= len(m.GenesisHash) + copy(dAtA[i:], m.GenesisHash) + i = encodeVarintProvider(dAtA, i, uint64(len(m.GenesisHash))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProvider(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PowerShapingParameters) 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 *PowerShapingParameters) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AllowInactiveVals { + i-- + if m.AllowInactiveVals { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if m.MinStake != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.MinStake)) + i-- + dAtA[i] = 0x40 + } + if len(m.Denylist) > 0 { + for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denylist[iNdEx]) + copy(dAtA[i:], m.Denylist[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.Allowlist) > 0 { + for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Allowlist[iNdEx]) + copy(dAtA[i:], m.Allowlist[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if m.ValidatorSetCap != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorSetCap)) + i-- + dAtA[i] = 0x20 + } + if m.ValidatorsPowerCap != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorsPowerCap)) + i-- + dAtA[i] = 0x18 + } + if m.Top_N != 0 { + i = encodeVarintProvider(dAtA, i, uint64(m.Top_N)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func encodeVarintProvider(dAtA []byte, offset int, v uint64) int { + offset -= sovProvider(v) + base := offset + for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ @@ -2602,7 +3258,7 @@ func (m *ConsumerRemovalProposal) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } - l = len(m.ConsumerId) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovProvider(uint64(l)) } @@ -2625,7 +3281,7 @@ func (m *ConsumerModificationProposal) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } - l = len(m.ConsumerId) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovProvider(uint64(l)) } @@ -2829,6 +3485,23 @@ func (m *AddressList) Size() (n int) { return n } +func (m *ChannelToChain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + return n +} + func (m *ValidatorSetChangePackets) Size() (n int) { if m == nil { return 0 @@ -2963,49 +3636,147 @@ func (m *ConsumerRewardsAllocation) Size() (n int) { return n } -func sovProvider(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProvider(x uint64) (n int) { - return sovProvider(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func (m *ConsumerMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + return n } -func (m *ConsumerAdditionProposal) 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: ConsumerAdditionProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsumerAdditionProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider + +func (m *ConsumerInitializationParameters) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.InitialHeight.Size() + n += 1 + l + sovProvider(uint64(l)) + l = len(m.GenesisHash) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + l = len(m.BinaryHash) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) + n += 1 + l + sovProvider(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) + n += 1 + l + sovProvider(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) + n += 1 + l + sovProvider(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) + n += 1 + l + sovProvider(uint64(l)) + l = len(m.ConsumerRedistributionFraction) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + if m.BlocksPerDistributionTransmission != 0 { + n += 1 + sovProvider(uint64(m.BlocksPerDistributionTransmission)) + } + if m.HistoricalEntries != 0 { + n += 1 + sovProvider(uint64(m.HistoricalEntries)) + } + l = len(m.DistributionTransmissionChannel) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + return n +} + +func (m *PowerShapingParameters) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Top_N != 0 { + n += 1 + sovProvider(uint64(m.Top_N)) + } + if m.ValidatorsPowerCap != 0 { + n += 1 + sovProvider(uint64(m.ValidatorsPowerCap)) + } + if m.ValidatorSetCap != 0 { + n += 1 + sovProvider(uint64(m.ValidatorSetCap)) + } + if len(m.Allowlist) > 0 { + for _, s := range m.Allowlist { + l = len(s) + n += 1 + l + sovProvider(uint64(l)) + } + } + if len(m.Denylist) > 0 { + for _, s := range m.Denylist { + l = len(s) + n += 1 + l + sovProvider(uint64(l)) + } + } + if m.MinStake != 0 { + n += 1 + sovProvider(uint64(m.MinStake)) + } + if m.AllowInactiveVals { + n += 2 + } + return n +} + +func sovProvider(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozProvider(x uint64) (n int) { + return sovProvider(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ConsumerAdditionProposal) 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: ConsumerAdditionProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsumerAdditionProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3705,7 +4476,7 @@ func (m *ConsumerRemovalProposal) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3733,7 +4504,7 @@ func (m *ConsumerRemovalProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -3884,7 +4655,7 @@ func (m *ConsumerModificationProposal) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3912,7 +4683,7 @@ func (m *ConsumerModificationProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { @@ -5227,6 +5998,120 @@ func (m *AddressList) Unmarshal(dAtA []byte) error { } return nil } +func (m *ChannelToChain) 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: ChannelToChain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChannelToChain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + 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 (m *ValidatorSetChangePackets) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6145,6 +7030,747 @@ func (m *ConsumerRewardsAllocation) Unmarshal(dAtA []byte) error { } return nil } +func (m *ConsumerMetadata) 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: ConsumerMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsumerMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = string(dAtA[iNdEx:postIndex]) + 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 (m *ConsumerInitializationParameters) 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: ConsumerInitializationParameters: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsumerInitializationParameters: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", 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.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) + if m.GenesisHash == nil { + m.GenesisHash = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", 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.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) + if m.BinaryHash == nil { + m.BinaryHash = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) + } + m.BlocksPerDistributionTransmission = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) + } + m.HistoricalEntries = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistoricalEntries |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) + 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 (m *PowerShapingParameters) 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: PowerShapingParameters: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PowerShapingParameters: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + 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 ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Top_N |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) + } + m.ValidatorsPowerCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorsPowerCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) + } + m.ValidatorSetCap = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorSetCap |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) + } + m.MinStake = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinStake |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowInactiveVals = bool(v != 0) + 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 diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 9e5fe38c94..ea480a8713 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -38,7 +38,9 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type QueryConsumerGenesisRequest struct { - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryConsumerGenesisRequest) Reset() { *m = QueryConsumerGenesisRequest{} } @@ -74,6 +76,14 @@ func (m *QueryConsumerGenesisRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerGenesisRequest proto.InternalMessageInfo +// Deprecated: Do not use. +func (m *QueryConsumerGenesisRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + func (m *QueryConsumerGenesisRequest) GetConsumerId() string { if m != nil { return m.ConsumerId @@ -483,10 +493,12 @@ func (m *Chain) GetDenylist() []string { } type QueryValidatorConsumerAddrRequest struct { - // The id of the consumer chain - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. // 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"` + // The id of the consumer chain + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryValidatorConsumerAddrRequest) Reset() { *m = QueryValidatorConsumerAddrRequest{} } @@ -568,10 +580,12 @@ func (m *QueryValidatorConsumerAddrResponse) GetConsumerAddress() string { } type QueryValidatorProviderAddrRequest struct { - // The id of the provider chain - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. // The consensus address of the validator on the consumer chain ConsumerAddress string `protobuf:"bytes,2,opt,name=consumer_address,json=consumerAddress,proto3" json:"consumer_address,omitempty" yaml:"address"` + // The id of the consumer chain + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryValidatorProviderAddrRequest) Reset() { *m = QueryValidatorProviderAddrRequest{} } @@ -974,8 +988,10 @@ func (m *ProposedChain) GetProposalID() uint64 { } type QueryAllPairsValConAddrByConsumerChainIDRequest struct { + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. // The id of the consumer chain - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) Reset() { @@ -1015,6 +1031,14 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAllPairsValConAddrByConsumerChainIDRequest proto.InternalMessageInfo +// Deprecated: Do not use. +func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) GetConsumerId() string { if m != nil { return m.ConsumerId @@ -1213,7 +1237,9 @@ func (m *QueryParamsResponse) GetParams() Params { } type QueryConsumerChainOptedInValidatorsRequest struct { - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryConsumerChainOptedInValidatorsRequest) Reset() { @@ -1253,6 +1279,14 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerChainOptedInValidatorsRequest proto.InternalMessageInfo +// Deprecated: Do not use. +func (m *QueryConsumerChainOptedInValidatorsRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + func (m *QueryConsumerChainOptedInValidatorsRequest) GetConsumerId() string { if m != nil { return m.ConsumerId @@ -1310,7 +1344,9 @@ func (m *QueryConsumerChainOptedInValidatorsResponse) GetValidatorsProviderAddre } type QueryConsumerValidatorsRequest struct { - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryConsumerValidatorsRequest) Reset() { *m = QueryConsumerValidatorsRequest{} } @@ -1346,6 +1382,14 @@ func (m *QueryConsumerValidatorsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerValidatorsRequest proto.InternalMessageInfo +// Deprecated: Do not use. +func (m *QueryConsumerValidatorsRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + func (m *QueryConsumerValidatorsRequest) GetConsumerId() string { if m != nil { return m.ConsumerId @@ -1560,9 +1604,11 @@ func (m *QueryConsumerChainsValidatorHasToValidateResponse) GetConsumerChainIds( } type QueryValidatorConsumerCommissionRateRequest struct { - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. // 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"` + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *QueryValidatorConsumerCommissionRateRequest) Reset() { @@ -1602,9 +1648,10 @@ func (m *QueryValidatorConsumerCommissionRateRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryValidatorConsumerCommissionRateRequest proto.InternalMessageInfo -func (m *QueryValidatorConsumerCommissionRateRequest) GetConsumerId() string { +// Deprecated: Do not use. +func (m *QueryValidatorConsumerCommissionRateRequest) GetChainId() string { if m != nil { - return m.ConsumerId + return m.ChainId } return "" } @@ -1616,6 +1663,13 @@ func (m *QueryValidatorConsumerCommissionRateRequest) GetProviderAddress() strin return "" } +func (m *QueryValidatorConsumerCommissionRateRequest) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" +} + type QueryValidatorConsumerCommissionRateResponse struct { // The rate to charge delegators on the consumer chain, as a fraction Rate cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rate"` @@ -1876,137 +1930,142 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 2073 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x5a, 0xcb, 0x6f, 0xdc, 0xc6, - 0x19, 0x17, 0x57, 0x8f, 0x48, 0xa3, 0xd8, 0x4e, 0xc6, 0x6a, 0x2c, 0x53, 0xca, 0xae, 0x4c, 0xf7, - 0x21, 0xcb, 0x2e, 0x29, 0x29, 0x08, 0x9c, 0xb8, 0xf5, 0x63, 0x77, 0x65, 0xd9, 0x0b, 0xbf, 0x14, - 0x5a, 0x76, 0x01, 0xa7, 0x2d, 0x43, 0x91, 0xd3, 0x15, 0x61, 0x2e, 0x87, 0xe2, 0xcc, 0xae, 0xbd, - 0x30, 0x7c, 0x48, 0x0f, 0x6d, 0x2e, 0x05,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, 0x00, 0x00, + // 2151 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4d, 0x6c, 0xdc, 0xc6, + 0x15, 0x16, 0x77, 0x25, 0x45, 0x1a, 0xc5, 0x76, 0x32, 0x56, 0xe3, 0x35, 0x25, 0xef, 0x2a, 0x74, + 0xda, 0xca, 0xb2, 0x4b, 0x4a, 0x0a, 0x82, 0x24, 0x6e, 0x1d, 0x5b, 0xbb, 0xb2, 0xec, 0x85, 0x1d, + 0x5b, 0xa1, 0x65, 0xb7, 0x50, 0x9a, 0xd2, 0x14, 0x39, 0x5d, 0x11, 0xe6, 0x72, 0x28, 0x0e, 0xb5, + 0xf6, 0xc2, 0xf0, 0x21, 0x2d, 0x50, 0x24, 0x3d, 0x14, 0x06, 0x8a, 0x02, 0x3d, 0xe6, 0x52, 0xa0, + 0x87, 0x9e, 0x7a, 0x68, 0xd1, 0x5b, 0x8e, 0xb9, 0x35, 0x45, 0x2e, 0x45, 0x0b, 0xb8, 0x85, 0xdd, + 0x43, 0x51, 0xa0, 0x40, 0xeb, 0xf6, 0x5a, 0xa0, 0xe0, 0x70, 0xf8, 0x2b, 0xae, 0x96, 0xdc, 0x5d, + 0x20, 0xb7, 0xe5, 0xcc, 0x9b, 0x6f, 0xde, 0xdf, 0xbc, 0x79, 0xf3, 0x49, 0x40, 0x32, 0x2c, 0x17, + 0x39, 0xda, 0xae, 0x6a, 0x58, 0x0a, 0x41, 0xda, 0xbe, 0x63, 0xb8, 0x5d, 0x49, 0xd3, 0x3a, 0x92, + 0xed, 0xe0, 0x8e, 0xa1, 0x23, 0x47, 0xea, 0xac, 0x48, 0x7b, 0xfb, 0xc8, 0xe9, 0x8a, 0xb6, 0x83, + 0x5d, 0x0c, 0x4f, 0x67, 0x2c, 0x10, 0x35, 0xad, 0x23, 0x06, 0x0b, 0xc4, 0xce, 0x0a, 0x3f, 0xdf, + 0x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x9c, 0x52, 0xe0, 0xf6, 0xf5, 0xe1, 0x40, 0x06, 0xab, 0x01, 0xa1, 0x33, 0x86, 0xa9, 0x01, + 0xd9, 0x20, 0x61, 0x0d, 0xf8, 0x27, 0xc7, 0xfe, 0x80, 0x95, 0xc5, 0x86, 0xc0, 0x02, 0x7c, 0xdc, + 0x21, 0x8c, 0x0b, 0xbf, 0x31, 0x2c, 0x4c, 0xf1, 0x06, 0xb9, 0x07, 0x79, 0x03, 0xff, 0xc3, 0xa5, + 0xfe, 0x2f, 0x21, 0x49, 0xaf, 0xc0, 0x2b, 0xc5, 0x03, 0x9d, 0xc9, 0xf1, 0xf0, 0x57, 0x87, 0x07, + 0x2a, 0x6e, 0x75, 0x2c, 0x39, 0xa4, 0x87, 0x21, 0xc5, 0xf4, 0xa8, 0xfe, 0xed, 0xcf, 0x9e, 0x56, + 0xb9, 0xcf, 0x9f, 0x56, 0xb9, 0xbf, 0x3e, 0xad, 0x72, 0x8f, 0x9f, 0x55, 0xc7, 0x3e, 0x7f, 0x56, + 0x1d, 0xfb, 0xe3, 0xb3, 0xea, 0xd8, 0xf6, 0x85, 0x96, 0xe1, 0xee, 0xee, 0xef, 0x88, 0x1a, 0x6e, + 0xb3, 0xff, 0x5c, 0x89, 0xed, 0xf2, 0x8d, 0x70, 0x97, 0xce, 0x1b, 0xd2, 0x83, 0x54, 0x9b, 0xde, + 0xb5, 0x11, 0xd9, 0x99, 0xa4, 0x7f, 0x43, 0x7c, 0xfd, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x10, + 0xc1, 0x17, 0x89, 0x59, 0x24, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2754,6 +2813,13 @@ func (m *QueryConsumerGenesisRequest) MarshalToSizedBuffer(dAtA []byte) (int, er copy(dAtA[i:], m.ConsumerId) i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) 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 @@ -3063,6 +3129,13 @@ func (m *QueryValidatorConsumerAddrRequest) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x1a + } if len(m.ProviderAddress) > 0 { i -= len(m.ProviderAddress) copy(dAtA[i:], m.ProviderAddress) @@ -3070,10 +3143,10 @@ func (m *QueryValidatorConsumerAddrRequest) MarshalToSizedBuffer(dAtA []byte) (i i-- dAtA[i] = 0x12 } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) + 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 } @@ -3130,6 +3203,13 @@ func (m *QueryValidatorProviderAddrRequest) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x1a + } if len(m.ConsumerAddress) > 0 { i -= len(m.ConsumerAddress) copy(dAtA[i:], m.ConsumerAddress) @@ -3416,6 +3496,13 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) MarshalToSizedBuffer(d copy(dAtA[i:], m.ConsumerId) i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) 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 @@ -3588,6 +3675,13 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) MarshalToSizedBuffer(dAtA [ copy(dAtA[i:], m.ConsumerId) i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) 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 @@ -3650,6 +3744,13 @@ func (m *QueryConsumerValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, copy(dAtA[i:], m.ConsumerId) i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) 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 @@ -3831,6 +3932,13 @@ func (m *QueryValidatorConsumerCommissionRateRequest) MarshalToSizedBuffer(dAtA _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x1a + } if len(m.ProviderAddress) > 0 { i -= len(m.ProviderAddress) copy(dAtA[i:], m.ProviderAddress) @@ -3838,10 +3946,10 @@ func (m *QueryValidatorConsumerCommissionRateRequest) MarshalToSizedBuffer(dAtA i-- dAtA[i] = 0x12 } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) + 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 } @@ -4009,6 +4117,10 @@ func (m *QueryConsumerGenesisRequest) Size() (n int) { } var l int _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -4142,7 +4254,7 @@ func (m *QueryValidatorConsumerAddrRequest) Size() (n int) { } var l int _ = l - l = len(m.ConsumerId) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -4150,6 +4262,10 @@ func (m *QueryValidatorConsumerAddrRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -4180,6 +4296,10 @@ func (m *QueryValidatorProviderAddrRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -4292,6 +4412,10 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) Size() (n int) { } var l int _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -4361,6 +4485,10 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) Size() (n int) { } var l int _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -4389,6 +4517,10 @@ func (m *QueryConsumerValidatorsRequest) Size() (n int) { } var l int _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = len(m.ConsumerId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -4467,7 +4599,7 @@ func (m *QueryValidatorConsumerCommissionRateRequest) Size() (n int) { } var l int _ = l - l = len(m.ConsumerId) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -4475,6 +4607,10 @@ func (m *QueryValidatorConsumerCommissionRateRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -4572,6 +4708,38 @@ func (m *QueryConsumerGenesisRequest) Unmarshal(dAtA []byte) error { } 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 ConsumerId", wireType) } @@ -5398,7 +5566,7 @@ func (m *QueryValidatorConsumerAddrRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5426,7 +5594,7 @@ func (m *QueryValidatorConsumerAddrRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -5460,6 +5628,38 @@ func (m *QueryValidatorConsumerAddrRequest) Unmarshal(dAtA []byte) error { } m.ProviderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", 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.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5656,6 +5856,38 @@ func (m *QueryValidatorProviderAddrRequest) Unmarshal(dAtA []byte) error { } m.ConsumerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", 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.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -6327,6 +6559,38 @@ func (m *QueryAllPairsValConAddrByConsumerChainIDRequest) Unmarshal(dAtA []byte) } 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 ConsumerId", wireType) } @@ -6776,6 +7040,38 @@ func (m *QueryConsumerChainOptedInValidatorsRequest) Unmarshal(dAtA []byte) erro } 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 ConsumerId", wireType) } @@ -6940,6 +7236,38 @@ func (m *QueryConsumerValidatorsRequest) Unmarshal(dAtA []byte) error { } 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 ConsumerId", wireType) } @@ -7442,7 +7770,7 @@ func (m *QueryValidatorConsumerCommissionRateRequest) Unmarshal(dAtA []byte) err switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7470,7 +7798,7 @@ func (m *QueryValidatorConsumerCommissionRateRequest) Unmarshal(dAtA []byte) err if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -7504,6 +7832,38 @@ func (m *QueryValidatorConsumerCommissionRateRequest) Unmarshal(dAtA []byte) err } m.ProviderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", 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.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/ccv/provider/types/query.pb.gw.go b/x/ccv/provider/types/query.pb.gw.go index fc131975db..a533712da9 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -33,6 +33,10 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +var ( + filter_Query_QueryConsumerGenesis_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_Query_QueryConsumerGenesis_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryConsumerGenesisRequest var metadata runtime.ServerMetadata @@ -44,6 +48,78 @@ func request_Query_QueryConsumerGenesis_0(ctx context.Context, marshaler runtime _ = err ) + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerGenesis_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryConsumerGenesis(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryConsumerGenesis_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerGenesisRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerGenesis_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryConsumerGenesis(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryConsumerGenesis_1 = &utilities.DoubleArray{Encoding: map[string]int{"consumer_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryConsumerGenesis_1(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerGenesisRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + val, ok = pathParams["consumer_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") @@ -55,12 +131,19 @@ func request_Query_QueryConsumerGenesis_0(ctx context.Context, marshaler runtime return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerGenesis_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.QueryConsumerGenesis(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_QueryConsumerGenesis_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_QueryConsumerGenesis_1(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryConsumerGenesisRequest var metadata runtime.ServerMetadata @@ -82,6 +165,13 @@ func local_request_Query_QueryConsumerGenesis_0(ctx context.Context, marshaler r return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerGenesis_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.QueryConsumerGenesis(ctx, &protoReq) return msg, metadata, err @@ -267,6 +357,10 @@ func local_request_Query_QueryProposedConsumerChainIDs_0(ctx context.Context, ma } +var ( + filter_Query_QueryAllPairsValConAddrByConsumerChainID_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_Query_QueryAllPairsValConAddrByConsumerChainID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAllPairsValConAddrByConsumerChainIDRequest var metadata runtime.ServerMetadata @@ -278,6 +372,78 @@ func request_Query_QueryAllPairsValConAddrByConsumerChainID_0(ctx context.Contex _ = err ) + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllPairsValConAddrByConsumerChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAllPairsValConAddrByConsumerChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllPairsValConAddrByConsumerChainID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllPairsValConAddrByConsumerChainIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllPairsValConAddrByConsumerChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAllPairsValConAddrByConsumerChainID(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAllPairsValConAddrByConsumerChainID_1 = &utilities.DoubleArray{Encoding: map[string]int{"consumer_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryAllPairsValConAddrByConsumerChainID_1(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllPairsValConAddrByConsumerChainIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + val, ok = pathParams["consumer_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") @@ -289,12 +455,19 @@ func request_Query_QueryAllPairsValConAddrByConsumerChainID_0(ctx context.Contex return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllPairsValConAddrByConsumerChainID_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.QueryAllPairsValConAddrByConsumerChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_QueryAllPairsValConAddrByConsumerChainID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_QueryAllPairsValConAddrByConsumerChainID_1(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAllPairsValConAddrByConsumerChainIDRequest var metadata runtime.ServerMetadata @@ -316,6 +489,13 @@ func local_request_Query_QueryAllPairsValConAddrByConsumerChainID_0(ctx context. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllPairsValConAddrByConsumerChainID_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.QueryAllPairsValConAddrByConsumerChainID(ctx, &protoReq) return msg, metadata, err @@ -339,6 +519,10 @@ func local_request_Query_QueryParams_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_Query_QueryConsumerChainOptedInValidators_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + 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 @@ -350,6 +534,78 @@ func request_Query_QueryConsumerChainOptedInValidators_0(ctx context.Context, ma _ = err ) + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + 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.QueryConsumerChainOptedInValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +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 + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + 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.QueryConsumerChainOptedInValidators(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryConsumerChainOptedInValidators_1 = &utilities.DoubleArray{Encoding: map[string]int{"consumer_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryConsumerChainOptedInValidators_1(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 + + var ( + val string + ok bool + err error + _ = err + ) + val, ok = pathParams["consumer_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") @@ -361,12 +617,19 @@ func request_Query_QueryConsumerChainOptedInValidators_0(ctx context.Context, ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainOptedInValidators_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.QueryConsumerChainOptedInValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -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) { +func local_request_Query_QueryConsumerChainOptedInValidators_1(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 @@ -388,6 +651,13 @@ func local_request_Query_QueryConsumerChainOptedInValidators_0(ctx context.Conte return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerChainOptedInValidators_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.QueryConsumerChainOptedInValidators(ctx, &protoReq) return msg, metadata, err @@ -447,8 +717,200 @@ func local_request_Query_QueryConsumerChainsValidatorHasToValidate_0(ctx context } -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 ( + filter_Query_QueryValidatorConsumerCommissionRate_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain_id": 0, "provider_address": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +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 + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + val, ok = pathParams["provider_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider_address") + } + + protoReq.ProviderAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider_address", err) + } + + 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 + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + val, ok = pathParams["provider_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider_address") + } + + protoReq.ProviderAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider_address", err) + } + + 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 + +} + +var ( + filter_Query_QueryValidatorConsumerCommissionRate_1 = &utilities.DoubleArray{Encoding: map[string]int{"consumer_id": 0, "provider_address": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_QueryValidatorConsumerCommissionRate_1(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 + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["consumer_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") + } + + protoReq.ConsumerId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) + } + + val, ok = pathParams["provider_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider_address") + } + + protoReq.ProviderAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider_address", err) + } + + 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_1); 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_1(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 + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["consumer_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") + } + + protoReq.ConsumerId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) + } + + val, ok = pathParams["provider_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider_address") + } + + protoReq.ProviderAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider_address", err) + } + + 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_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryValidatorConsumerCommissionRate(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryConsumerValidators_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryConsumerValidators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerValidatorsRequest var metadata runtime.ServerMetadata var ( @@ -458,35 +920,31 @@ func request_Query_QueryValidatorConsumerCommissionRate_0(ctx context.Context, m _ = err ) - val, ok = pathParams["consumer_id"] + val, ok = pathParams["chain_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") } - protoReq.ConsumerId, err = runtime.String(val) + protoReq.ChainId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) } - val, ok = pathParams["provider_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider_address") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.ProviderAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider_address", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerValidators_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)) + msg, err := client.QueryConsumerValidators(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 +func local_request_Query_QueryConsumerValidators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConsumerValidatorsRequest var metadata runtime.ServerMetadata var ( @@ -496,34 +954,34 @@ func local_request_Query_QueryValidatorConsumerCommissionRate_0(ctx context.Cont _ = err ) - val, ok = pathParams["consumer_id"] + val, ok = pathParams["chain_id"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "consumer_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") } - protoReq.ConsumerId, err = runtime.String(val) + protoReq.ChainId, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) } - val, ok = pathParams["provider_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider_address") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.ProviderAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider_address", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerValidators_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.QueryValidatorConsumerCommissionRate(ctx, &protoReq) + msg, err := server.QueryConsumerValidators(ctx, &protoReq) return msg, metadata, err } -func request_Query_QueryConsumerValidators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +var ( + filter_Query_QueryConsumerValidators_1 = &utilities.DoubleArray{Encoding: map[string]int{"consumer_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryConsumerValidators_1(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryConsumerValidatorsRequest var metadata runtime.ServerMetadata @@ -545,12 +1003,19 @@ func request_Query_QueryConsumerValidators_0(ctx context.Context, marshaler runt return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerValidators_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.QueryConsumerValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_QueryConsumerValidators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_QueryConsumerValidators_1(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryConsumerValidatorsRequest var metadata runtime.ServerMetadata @@ -572,6 +1037,13 @@ func local_request_Query_QueryConsumerValidators_0(ctx context.Context, marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "consumer_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryConsumerValidators_1); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.QueryConsumerValidators(ctx, &protoReq) return msg, metadata, err @@ -678,6 +1150,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryConsumerGenesis_1, 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_QueryConsumerGenesis_1(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_QueryConsumerGenesis_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryConsumerChains_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -885,6 +1380,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryAllPairsValConAddrByConsumerChainID_1, 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_QueryAllPairsValConAddrByConsumerChainID_1(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_QueryAllPairsValConAddrByConsumerChainID_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -931,6 +1449,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryConsumerChainOptedInValidators_1, 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_QueryConsumerChainOptedInValidators_1(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_QueryConsumerChainOptedInValidators_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + 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() @@ -977,6 +1518,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryValidatorConsumerCommissionRate_1, 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_1(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_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryConsumerValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1000,6 +1564,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryConsumerValidators_1, 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_QueryConsumerValidators_1(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_QueryConsumerValidators_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryBlocksUntilNextEpoch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1107,6 +1694,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryConsumerGenesis_1, 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_QueryConsumerGenesis_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryConsumerGenesis_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryConsumerChains_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1287,6 +1894,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryAllPairsValConAddrByConsumerChainID_1, 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_QueryAllPairsValConAddrByConsumerChainID_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAllPairsValConAddrByConsumerChainID_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1327,6 +1954,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryConsumerChainOptedInValidators_1, 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_QueryConsumerChainOptedInValidators_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryConsumerChainOptedInValidators_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + 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() @@ -1367,6 +2014,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryValidatorConsumerCommissionRate_1, 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_1(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_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryConsumerValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1387,6 +2054,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryConsumerValidators_1, 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_QueryConsumerValidators_1(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryConsumerValidators_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryBlocksUntilNextEpoch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1431,7 +2118,9 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_QueryConsumerGenesis_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_genesis", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryConsumerGenesis_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_genesis", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryConsumerGenesis_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_genesis", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryConsumerChains_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "consumer_chains"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1449,17 +2138,25 @@ var ( pattern_Query_QueryProposedConsumerChainIDs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "proposed_consumer_chains"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryAllPairsValConAddrByConsumerChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"interchain_security", "ccv", "provider", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryAllPairsValConAddrByConsumerChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"interchain_security", "ccv", "provider", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAllPairsValConAddrByConsumerChainID_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"interchain_security", "ccv", "provider", "consumer_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_QueryConsumerChainOptedInValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "opted_in_validators", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryConsumerChainOptedInValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "opted_in_validators", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryConsumerChainOptedInValidators_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "opted_in_validators", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryConsumerChainsValidatorHasToValidate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_chains_per_validator", "provider_address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryValidatorConsumerCommissionRate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"interchain_security", "ccv", "provider", "consumer_commission_rate", "consumer_id", "provider_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryValidatorConsumerCommissionRate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"interchain_security", "ccv", "provider", "consumer_commission_rate", "chain_id", "provider_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryValidatorConsumerCommissionRate_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"interchain_security", "ccv", "provider", "consumer_commission_rate", "consumer_id", "provider_address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryConsumerValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_validators", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryConsumerValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_validators", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryConsumerValidators_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"interchain_security", "ccv", "provider", "consumer_validators", "consumer_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryBlocksUntilNextEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "blocks_until_next_epoch"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1469,6 +2166,8 @@ var ( var ( forward_Query_QueryConsumerGenesis_0 = runtime.ForwardResponseMessage + forward_Query_QueryConsumerGenesis_1 = runtime.ForwardResponseMessage + forward_Query_QueryConsumerChains_0 = runtime.ForwardResponseMessage forward_Query_QueryConsumerChainStarts_0 = runtime.ForwardResponseMessage @@ -1487,16 +2186,24 @@ var ( forward_Query_QueryAllPairsValConAddrByConsumerChainID_0 = runtime.ForwardResponseMessage + forward_Query_QueryAllPairsValConAddrByConsumerChainID_1 = runtime.ForwardResponseMessage + forward_Query_QueryParams_0 = runtime.ForwardResponseMessage forward_Query_QueryConsumerChainOptedInValidators_0 = runtime.ForwardResponseMessage + forward_Query_QueryConsumerChainOptedInValidators_1 = runtime.ForwardResponseMessage + forward_Query_QueryConsumerChainsValidatorHasToValidate_0 = runtime.ForwardResponseMessage forward_Query_QueryValidatorConsumerCommissionRate_0 = runtime.ForwardResponseMessage + forward_Query_QueryValidatorConsumerCommissionRate_1 = runtime.ForwardResponseMessage + forward_Query_QueryConsumerValidators_0 = runtime.ForwardResponseMessage + forward_Query_QueryConsumerValidators_1 = runtime.ForwardResponseMessage + forward_Query_QueryBlocksUntilNextEpoch_0 = runtime.ForwardResponseMessage forward_Query_QueryConsumerIdFromClientId_0 = runtime.ForwardResponseMessage diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 5502400c98..6747cfada7 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -43,8 +43,8 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgAssignConsumerKey struct { - // The consumer id of the consumer chain to assign a consensus public key to - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. // The validator address on the provider ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` // The consensus public key to use on the consumer. @@ -53,6 +53,8 @@ type MsgAssignConsumerKey struct { ConsumerKey string `protobuf:"bytes,3,opt,name=consumer_key,json=consumerKey,proto3" json:"consumer_key,omitempty"` // Tx signer address Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` + // the consumer id of the consumer chain to assign a consensus public key to + ConsumerId string `protobuf:"bytes,5,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *MsgAssignConsumerKey) Reset() { *m = MsgAssignConsumerKey{} } @@ -128,11 +130,11 @@ var xxx_messageInfo_MsgAssignConsumerKeyResponse proto.InternalMessageInfo // also known as a misbehaviour, observed on a consumer chain type MsgSubmitConsumerMisbehaviour struct { Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"` - // the consumer id of the consumer chain where the misbehaviour occurred - ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // The Misbehaviour of the consumer chain wrapping // two conflicting IBC headers - Misbehaviour *_07_tendermint.Misbehaviour `protobuf:"bytes,3,opt,name=misbehaviour,proto3" json:"misbehaviour,omitempty"` + Misbehaviour *_07_tendermint.Misbehaviour `protobuf:"bytes,2,opt,name=misbehaviour,proto3" json:"misbehaviour,omitempty"` + // the consumer id of the consumer chain where the misbehaviour occurred + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *MsgSubmitConsumerMisbehaviour) Reset() { *m = MsgSubmitConsumerMisbehaviour{} } @@ -208,13 +210,13 @@ var xxx_messageInfo_MsgSubmitConsumerMisbehaviourResponse proto.InternalMessageI // a double signing infraction observed on a consumer chain type MsgSubmitConsumerDoubleVoting struct { Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"` - // the consumer id of the consumer chain where the double-voting took place - ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // The equivocation of the consumer chain wrapping // an evidence of a validator that signed two conflicting votes - DuplicateVoteEvidence *types.DuplicateVoteEvidence `protobuf:"bytes,3,opt,name=duplicate_vote_evidence,json=duplicateVoteEvidence,proto3" json:"duplicate_vote_evidence,omitempty"` + DuplicateVoteEvidence *types.DuplicateVoteEvidence `protobuf:"bytes,2,opt,name=duplicate_vote_evidence,json=duplicateVoteEvidence,proto3" json:"duplicate_vote_evidence,omitempty"` // The light client header of the infraction block - InfractionBlockHeader *_07_tendermint.Header `protobuf:"bytes,4,opt,name=infraction_block_header,json=infractionBlockHeader,proto3" json:"infraction_block_header,omitempty"` + InfractionBlockHeader *_07_tendermint.Header `protobuf:"bytes,3,opt,name=infraction_block_header,json=infractionBlockHeader,proto3" json:"infraction_block_header,omitempty"` + // the consumer id of the consumer chain where the double-voting took place + ConsumerId string `protobuf:"bytes,4,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *MsgSubmitConsumerDoubleVoting) Reset() { *m = MsgSubmitConsumerDoubleVoting{} } @@ -377,30 +379,93 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo -// MsgRemoveConsumer defines the message used to remove (and stop) a consumer chain. -// If it passes, all the consumer chain's state is eventually removed from the provider chain. -type MsgRemoveConsumer struct { - // the consumer id of the consumer chain to be stopped - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - // the time on the provider chain at which all validators are responsible to - // stop their consumer chain validator node - StopTime time.Time `protobuf:"bytes,2,opt,name=stop_time,json=stopTime,proto3,stdtime" json:"stop_time"` +// [DEPRECATED] Use `MsgCreateConsumer` instead +type MsgConsumerAddition struct { + // the proposed chain-id of the new consumer chain, must be different from all + // other consumer chain ids of the executing provider chain. + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the proposed initial height of new consumer chain. + // For a completely new chain, this will be {0,1}. However, it may be + // different if this is a chain that is converting to a consumer chain. + InitialHeight types1.Height `protobuf:"bytes,2,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` + // The hash of the consumer chain genesis state without the consumer CCV + // module genesis params. It is used for off-chain confirmation of + // genesis.json validity by validators and other parties. + GenesisHash []byte `protobuf:"bytes,3,opt,name=genesis_hash,json=genesisHash,proto3" json:"genesis_hash,omitempty"` + // The hash of the consumer chain binary that should be run by validators on + // chain initialization. It is used for off-chain confirmation of binary + // validity by validators and other parties. + BinaryHash []byte `protobuf:"bytes,4,opt,name=binary_hash,json=binaryHash,proto3" json:"binary_hash,omitempty"` + // spawn time is the time on the provider chain at which the consumer chain + // genesis is finalized and all validators will be responsible for starting + // their consumer chain validator node. + SpawnTime time.Time `protobuf:"bytes,5,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + UnbondingPeriod time.Duration `protobuf:"bytes,6,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` + // Sent CCV related IBC packets will timeout after this duration + CcvTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` + // Sent transfer related IBC packets will timeout after this duration + TransferTimeoutPeriod time.Duration `protobuf:"bytes,8,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + ConsumerRedistributionFraction string `protobuf:"bytes,9,opt,name=consumer_redistribution_fraction,json=consumerRedistributionFraction,proto3" json:"consumer_redistribution_fraction,omitempty"` + // BlocksPerDistributionTransmission is the number of blocks between + // ibc-token-transfers from the consumer chain to the provider chain. On + // sending transmission event, `consumer_redistribution_fraction` of the + // accumulated tokens are sent to the consumer redistribution address. + BlocksPerDistributionTransmission int64 `protobuf:"varint,10,opt,name=blocks_per_distribution_transmission,json=blocksPerDistributionTransmission,proto3" json:"blocks_per_distribution_transmission,omitempty"` + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + HistoricalEntries int64 `protobuf:"varint,11,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"` + // The ID of a token transfer channel used for the Reward Distribution + // sub-protocol. If DistributionTransmissionChannel == "", a new transfer + // channel is created on top of the same connection as the CCV channel. + // Note that transfer_channel_id is the ID of the channel end on the consumer + // chain. it is most relevant for chains performing a sovereign to consumer + // changeover in order to maintain the existing ibc transfer channel + DistributionTransmissionChannel string `protobuf:"bytes,12,opt,name=distribution_transmission_channel,json=distributionTransmissionChannel,proto3" json:"distribution_transmission_channel,omitempty"` + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + Top_N uint32 `protobuf:"varint,13,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + ValidatorsPowerCap uint32 `protobuf:"varint,14,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + ValidatorSetCap uint32 `protobuf:"varint,15,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate + // the consumer chain. + Allowlist []string `protobuf:"bytes,16,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. + Denylist []string `protobuf:"bytes,17,rep,name=denylist,proto3" json:"denylist,omitempty"` // signer address - Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` + Authority string `protobuf:"bytes,18,opt,name=authority,proto3" json:"authority,omitempty"` + // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. + MinStake uint64 `protobuf:"varint,19,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` + // Corresponds to whether inactive validators are allowed to validate the consumer chain. + AllowInactiveVals bool `protobuf:"varint,20,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` } -func (m *MsgRemoveConsumer) Reset() { *m = MsgRemoveConsumer{} } -func (m *MsgRemoveConsumer) String() string { return proto.CompactTextString(m) } -func (*MsgRemoveConsumer) ProtoMessage() {} -func (*MsgRemoveConsumer) Descriptor() ([]byte, []int) { +func (m *MsgConsumerAddition) Reset() { *m = MsgConsumerAddition{} } +func (m *MsgConsumerAddition) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerAddition) ProtoMessage() {} +func (*MsgConsumerAddition) Descriptor() ([]byte, []int) { return fileDescriptor_43221a4391e9fbf4, []int{8} } -func (m *MsgRemoveConsumer) XXX_Unmarshal(b []byte) error { +func (m *MsgConsumerAddition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRemoveConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgConsumerAddition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRemoveConsumer.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgConsumerAddition.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -410,206 +475,174 @@ func (m *MsgRemoveConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgRemoveConsumer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRemoveConsumer.Merge(m, src) +func (m *MsgConsumerAddition) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerAddition.Merge(m, src) } -func (m *MsgRemoveConsumer) XXX_Size() int { +func (m *MsgConsumerAddition) XXX_Size() int { return m.Size() } -func (m *MsgRemoveConsumer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRemoveConsumer.DiscardUnknown(m) +func (m *MsgConsumerAddition) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerAddition.DiscardUnknown(m) } -var xxx_messageInfo_MsgRemoveConsumer proto.InternalMessageInfo +var xxx_messageInfo_MsgConsumerAddition proto.InternalMessageInfo -func (m *MsgRemoveConsumer) GetConsumerId() string { +func (m *MsgConsumerAddition) GetChainId() string { if m != nil { - return m.ConsumerId + return m.ChainId } return "" } -func (m *MsgRemoveConsumer) GetStopTime() time.Time { +func (m *MsgConsumerAddition) GetInitialHeight() types1.Height { if m != nil { - return m.StopTime + return m.InitialHeight } - return time.Time{} + return types1.Height{} } -func (m *MsgRemoveConsumer) GetAuthority() string { +func (m *MsgConsumerAddition) GetGenesisHash() []byte { if m != nil { - return m.Authority + return m.GenesisHash } - return "" + return nil } -// MsgRemoveConsumerResponse defines response type for MsgRemoveConsumer messages -type MsgRemoveConsumerResponse struct { +func (m *MsgConsumerAddition) GetBinaryHash() []byte { + if m != nil { + return m.BinaryHash + } + return nil } -func (m *MsgRemoveConsumerResponse) Reset() { *m = MsgRemoveConsumerResponse{} } -func (m *MsgRemoveConsumerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRemoveConsumerResponse) ProtoMessage() {} -func (*MsgRemoveConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{9} -} -func (m *MsgRemoveConsumerResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRemoveConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRemoveConsumerResponse.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 *MsgConsumerAddition) GetSpawnTime() time.Time { + if m != nil { + return m.SpawnTime } -} -func (m *MsgRemoveConsumerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRemoveConsumerResponse.Merge(m, src) -} -func (m *MsgRemoveConsumerResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRemoveConsumerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRemoveConsumerResponse.DiscardUnknown(m) + return time.Time{} } -var xxx_messageInfo_MsgRemoveConsumerResponse proto.InternalMessageInfo - -// ChangeRewardDenomsProposal is a governance proposal on the provider chain to -// mutate the set of denoms accepted by the provider as rewards. -// -// Note: this replaces ChangeRewardDenomsProposal which is deprecated and will be removed soon -type MsgChangeRewardDenoms struct { - // the list of consumer reward denoms to add - DenomsToAdd []string `protobuf:"bytes,1,rep,name=denoms_to_add,json=denomsToAdd,proto3" json:"denoms_to_add,omitempty"` - // the list of consumer reward denoms to remove - DenomsToRemove []string `protobuf:"bytes,2,rep,name=denoms_to_remove,json=denomsToRemove,proto3" json:"denoms_to_remove,omitempty"` - // signer address - Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` +func (m *MsgConsumerAddition) GetUnbondingPeriod() time.Duration { + if m != nil { + return m.UnbondingPeriod + } + return 0 } -func (m *MsgChangeRewardDenoms) Reset() { *m = MsgChangeRewardDenoms{} } -func (m *MsgChangeRewardDenoms) String() string { return proto.CompactTextString(m) } -func (*MsgChangeRewardDenoms) ProtoMessage() {} -func (*MsgChangeRewardDenoms) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{10} -} -func (m *MsgChangeRewardDenoms) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgChangeRewardDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChangeRewardDenoms.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 *MsgConsumerAddition) GetCcvTimeoutPeriod() time.Duration { + if m != nil { + return m.CcvTimeoutPeriod } + return 0 } -func (m *MsgChangeRewardDenoms) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChangeRewardDenoms.Merge(m, src) -} -func (m *MsgChangeRewardDenoms) XXX_Size() int { - return m.Size() -} -func (m *MsgChangeRewardDenoms) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChangeRewardDenoms.DiscardUnknown(m) + +func (m *MsgConsumerAddition) GetTransferTimeoutPeriod() time.Duration { + if m != nil { + return m.TransferTimeoutPeriod + } + return 0 } -var xxx_messageInfo_MsgChangeRewardDenoms proto.InternalMessageInfo +func (m *MsgConsumerAddition) GetConsumerRedistributionFraction() string { + if m != nil { + return m.ConsumerRedistributionFraction + } + return "" +} -func (m *MsgChangeRewardDenoms) GetDenomsToAdd() []string { +func (m *MsgConsumerAddition) GetBlocksPerDistributionTransmission() int64 { if m != nil { - return m.DenomsToAdd + return m.BlocksPerDistributionTransmission } - return nil + return 0 } -func (m *MsgChangeRewardDenoms) GetDenomsToRemove() []string { +func (m *MsgConsumerAddition) GetHistoricalEntries() int64 { if m != nil { - return m.DenomsToRemove + return m.HistoricalEntries } - return nil + return 0 } -func (m *MsgChangeRewardDenoms) GetAuthority() string { +func (m *MsgConsumerAddition) GetDistributionTransmissionChannel() string { if m != nil { - return m.Authority + return m.DistributionTransmissionChannel } return "" } -// MsgChangeRewardDenomsResponse defines response type for MsgChangeRewardDenoms messages -type MsgChangeRewardDenomsResponse struct { +func (m *MsgConsumerAddition) GetTop_N() uint32 { + if m != nil { + return m.Top_N + } + return 0 } -func (m *MsgChangeRewardDenomsResponse) Reset() { *m = MsgChangeRewardDenomsResponse{} } -func (m *MsgChangeRewardDenomsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgChangeRewardDenomsResponse) ProtoMessage() {} -func (*MsgChangeRewardDenomsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{11} +func (m *MsgConsumerAddition) GetValidatorsPowerCap() uint32 { + if m != nil { + return m.ValidatorsPowerCap + } + return 0 } -func (m *MsgChangeRewardDenomsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (m *MsgConsumerAddition) GetValidatorSetCap() uint32 { + if m != nil { + return m.ValidatorSetCap + } + return 0 } -func (m *MsgChangeRewardDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgChangeRewardDenomsResponse.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 *MsgConsumerAddition) GetAllowlist() []string { + if m != nil { + return m.Allowlist } + return nil } -func (m *MsgChangeRewardDenomsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgChangeRewardDenomsResponse.Merge(m, src) + +func (m *MsgConsumerAddition) GetDenylist() []string { + if m != nil { + return m.Denylist + } + return nil } -func (m *MsgChangeRewardDenomsResponse) XXX_Size() int { - return m.Size() + +func (m *MsgConsumerAddition) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" } -func (m *MsgChangeRewardDenomsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgChangeRewardDenomsResponse.DiscardUnknown(m) + +func (m *MsgConsumerAddition) GetMinStake() uint64 { + if m != nil { + return m.MinStake + } + return 0 } -var xxx_messageInfo_MsgChangeRewardDenomsResponse proto.InternalMessageInfo +func (m *MsgConsumerAddition) GetAllowInactiveVals() bool { + if m != nil { + return m.AllowInactiveVals + } + return false +} -type MsgOptIn struct { - // the consumer id of the consumer chain to opt in to - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - // the validator address on the provider - ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` - // (optional) The consensus public key to use on the consumer in json string format corresponding to proto-any, - // for example `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`. - // This field is optional and can remain empty (i.e., `consumer_key = ""`). A validator can always change the - // consumer public key at a later stage by issuing a `MsgAssignConsumerKey` message. - ConsumerKey string `protobuf:"bytes,3,opt,name=consumer_key,json=consumerKey,proto3" json:"consumer_key,omitempty"` - // signer address - Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +// MsgConsumerAdditionResponse defines response type for MsgConsumerAddition messages +type MsgConsumerAdditionResponse struct { } -func (m *MsgOptIn) Reset() { *m = MsgOptIn{} } -func (m *MsgOptIn) String() string { return proto.CompactTextString(m) } -func (*MsgOptIn) ProtoMessage() {} -func (*MsgOptIn) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{12} +func (m *MsgConsumerAdditionResponse) Reset() { *m = MsgConsumerAdditionResponse{} } +func (m *MsgConsumerAdditionResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerAdditionResponse) ProtoMessage() {} +func (*MsgConsumerAdditionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{9} } -func (m *MsgOptIn) XXX_Unmarshal(b []byte) error { +func (m *MsgConsumerAdditionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgOptIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgConsumerAdditionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgOptIn.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgConsumerAdditionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -619,33 +652,41 @@ func (m *MsgOptIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *MsgOptIn) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgOptIn.Merge(m, src) +func (m *MsgConsumerAdditionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerAdditionResponse.Merge(m, src) } -func (m *MsgOptIn) XXX_Size() int { +func (m *MsgConsumerAdditionResponse) XXX_Size() int { return m.Size() } -func (m *MsgOptIn) XXX_DiscardUnknown() { - xxx_messageInfo_MsgOptIn.DiscardUnknown(m) +func (m *MsgConsumerAdditionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerAdditionResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgOptIn proto.InternalMessageInfo +var xxx_messageInfo_MsgConsumerAdditionResponse proto.InternalMessageInfo -type MsgOptInResponse struct { +// [DEPRECATED] Use `MsgRemoveConsumer` instead +type MsgConsumerRemoval struct { + // the chain-id of the consumer chain to be stopped + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the time on the provider chain at which all validators are responsible to + // stop their consumer chain validator node + StopTime time.Time `protobuf:"bytes,2,opt,name=stop_time,json=stopTime,proto3,stdtime" json:"stop_time"` + // signer address + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` } -func (m *MsgOptInResponse) Reset() { *m = MsgOptInResponse{} } -func (m *MsgOptInResponse) String() string { return proto.CompactTextString(m) } -func (*MsgOptInResponse) ProtoMessage() {} -func (*MsgOptInResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{13} +func (m *MsgConsumerRemoval) Reset() { *m = MsgConsumerRemoval{} } +func (m *MsgConsumerRemoval) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerRemoval) ProtoMessage() {} +func (*MsgConsumerRemoval) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{10} } -func (m *MsgOptInResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgConsumerRemoval) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgOptInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgConsumerRemoval) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgOptInResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgConsumerRemoval.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -655,39 +696,55 @@ func (m *MsgOptInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *MsgOptInResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgOptInResponse.Merge(m, src) +func (m *MsgConsumerRemoval) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerRemoval.Merge(m, src) } -func (m *MsgOptInResponse) XXX_Size() int { +func (m *MsgConsumerRemoval) XXX_Size() int { return m.Size() } -func (m *MsgOptInResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgOptInResponse.DiscardUnknown(m) +func (m *MsgConsumerRemoval) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerRemoval.DiscardUnknown(m) } -var xxx_messageInfo_MsgOptInResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgConsumerRemoval proto.InternalMessageInfo -type MsgOptOut struct { - // the consumer id of the consumer chain to opt out from - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - // the validator address on the provider - ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` - // signer address - Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +func (m *MsgConsumerRemoval) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" } -func (m *MsgOptOut) Reset() { *m = MsgOptOut{} } -func (m *MsgOptOut) String() string { return proto.CompactTextString(m) } -func (*MsgOptOut) ProtoMessage() {} -func (*MsgOptOut) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{14} +func (m *MsgConsumerRemoval) GetStopTime() time.Time { + if m != nil { + return m.StopTime + } + return time.Time{} } -func (m *MsgOptOut) XXX_Unmarshal(b []byte) error { + +func (m *MsgConsumerRemoval) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// MsgConsumerRemovalResponse defines response type for MsgConsumerRemoval messages +type MsgConsumerRemovalResponse struct { +} + +func (m *MsgConsumerRemovalResponse) Reset() { *m = MsgConsumerRemovalResponse{} } +func (m *MsgConsumerRemovalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerRemovalResponse) ProtoMessage() {} +func (*MsgConsumerRemovalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{11} +} +func (m *MsgConsumerRemovalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgOptOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgConsumerRemovalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgOptOut.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgConsumerRemovalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -697,33 +754,42 @@ func (m *MsgOptOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *MsgOptOut) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgOptOut.Merge(m, src) +func (m *MsgConsumerRemovalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerRemovalResponse.Merge(m, src) } -func (m *MsgOptOut) XXX_Size() int { +func (m *MsgConsumerRemovalResponse) XXX_Size() int { return m.Size() } -func (m *MsgOptOut) XXX_DiscardUnknown() { - xxx_messageInfo_MsgOptOut.DiscardUnknown(m) +func (m *MsgConsumerRemovalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerRemovalResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgOptOut proto.InternalMessageInfo +var xxx_messageInfo_MsgConsumerRemovalResponse proto.InternalMessageInfo -type MsgOptOutResponse struct { +// MsgRemoveConsumer defines the message used to remove (and stop) a consumer chain. +// If it passes, all the consumer chain's state is eventually removed from the provider chain. +type MsgRemoveConsumer struct { + // the consumer id of the consumer chain to be stopped + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // the time on the provider chain at which all validators are responsible to + // stop their consumer chain validator node + StopTime time.Time `protobuf:"bytes,2,opt,name=stop_time,json=stopTime,proto3,stdtime" json:"stop_time"` + // signer address + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` } -func (m *MsgOptOutResponse) Reset() { *m = MsgOptOutResponse{} } -func (m *MsgOptOutResponse) String() string { return proto.CompactTextString(m) } -func (*MsgOptOutResponse) ProtoMessage() {} -func (*MsgOptOutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{15} +func (m *MsgRemoveConsumer) Reset() { *m = MsgRemoveConsumer{} } +func (m *MsgRemoveConsumer) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveConsumer) ProtoMessage() {} +func (*MsgRemoveConsumer) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{12} } -func (m *MsgOptOutResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgRemoveConsumer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgOptOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgRemoveConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgOptOutResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgRemoveConsumer.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -733,80 +799,55 @@ func (m *MsgOptOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgOptOutResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgOptOutResponse.Merge(m, src) +func (m *MsgRemoveConsumer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveConsumer.Merge(m, src) } -func (m *MsgOptOutResponse) XXX_Size() int { +func (m *MsgRemoveConsumer) XXX_Size() int { return m.Size() } -func (m *MsgOptOutResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgOptOutResponse.DiscardUnknown(m) +func (m *MsgRemoveConsumer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveConsumer.DiscardUnknown(m) } -var xxx_messageInfo_MsgOptOutResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgRemoveConsumer proto.InternalMessageInfo -// MsgSetConsumerCommissionRate allows validators to set -// a per-consumer chain commission rate -type MsgSetConsumerCommissionRate struct { - // The validator address on the provider - ProviderAddr string `protobuf:"bytes,1,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` - // The consumer id of the consumer chain to set a commission rate - ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - // The rate to charge delegators on the consumer chain, as a fraction - // TODO: migrate rate from sdk.Dec to math.LegacyDec - Rate cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=rate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rate"` - // signer address - Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +func (m *MsgRemoveConsumer) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" } -func (m *MsgSetConsumerCommissionRate) Reset() { *m = MsgSetConsumerCommissionRate{} } -func (m *MsgSetConsumerCommissionRate) String() string { return proto.CompactTextString(m) } -func (*MsgSetConsumerCommissionRate) ProtoMessage() {} -func (*MsgSetConsumerCommissionRate) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{16} -} -func (m *MsgSetConsumerCommissionRate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetConsumerCommissionRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetConsumerCommissionRate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil +func (m *MsgRemoveConsumer) GetStopTime() time.Time { + if m != nil { + return m.StopTime } -} -func (m *MsgSetConsumerCommissionRate) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetConsumerCommissionRate.Merge(m, src) -} -func (m *MsgSetConsumerCommissionRate) XXX_Size() int { - return m.Size() -} -func (m *MsgSetConsumerCommissionRate) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetConsumerCommissionRate.DiscardUnknown(m) + return time.Time{} } -var xxx_messageInfo_MsgSetConsumerCommissionRate proto.InternalMessageInfo +func (m *MsgRemoveConsumer) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} -type MsgSetConsumerCommissionRateResponse struct { +// MsgRemoveConsumerResponse defines response type for MsgRemoveConsumer messages +type MsgRemoveConsumerResponse struct { } -func (m *MsgSetConsumerCommissionRateResponse) Reset() { *m = MsgSetConsumerCommissionRateResponse{} } -func (m *MsgSetConsumerCommissionRateResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSetConsumerCommissionRateResponse) ProtoMessage() {} -func (*MsgSetConsumerCommissionRateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{17} +func (m *MsgRemoveConsumerResponse) Reset() { *m = MsgRemoveConsumerResponse{} } +func (m *MsgRemoveConsumerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveConsumerResponse) ProtoMessage() {} +func (*MsgRemoveConsumerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{13} } -func (m *MsgSetConsumerCommissionRateResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgRemoveConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgSetConsumerCommissionRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgRemoveConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgSetConsumerCommissionRateResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgRemoveConsumerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -816,40 +857,43 @@ func (m *MsgSetConsumerCommissionRateResponse) XXX_Marshal(b []byte, determinist return b[:n], nil } } -func (m *MsgSetConsumerCommissionRateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetConsumerCommissionRateResponse.Merge(m, src) +func (m *MsgRemoveConsumerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveConsumerResponse.Merge(m, src) } -func (m *MsgSetConsumerCommissionRateResponse) XXX_Size() int { +func (m *MsgRemoveConsumerResponse) XXX_Size() int { return m.Size() } -func (m *MsgSetConsumerCommissionRateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetConsumerCommissionRateResponse.DiscardUnknown(m) +func (m *MsgRemoveConsumerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveConsumerResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgSetConsumerCommissionRateResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgRemoveConsumerResponse proto.InternalMessageInfo -// MsgUpdateConsumer defines the message used to modify a running consumer chain. -// If it passes, the consumer chain's parameters are updated. -type MsgUpdateConsumer struct { +// ChangeRewardDenomsProposal is a governance proposal on the provider chain to +// mutate the set of denoms accepted by the provider as rewards. +// +// Note: this replaces ChangeRewardDenomsProposal which is deprecated and will be removed soon +type MsgChangeRewardDenoms struct { + // the list of consumer reward denoms to add + DenomsToAdd []string `protobuf:"bytes,1,rep,name=denoms_to_add,json=denomsToAdd,proto3" json:"denoms_to_add,omitempty"` + // the list of consumer reward denoms to remove + DenomsToRemove []string `protobuf:"bytes,2,rep,name=denoms_to_remove,json=denomsToRemove,proto3" json:"denoms_to_remove,omitempty"` // signer address - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // the consumer id of the consumer chain to be updated - ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - UpdateRecord *ConsumerUpdateRecord `protobuf:"bytes,3,opt,name=update_record,json=updateRecord,proto3" json:"update_record,omitempty"` + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` } -func (m *MsgUpdateConsumer) Reset() { *m = MsgUpdateConsumer{} } -func (m *MsgUpdateConsumer) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateConsumer) ProtoMessage() {} -func (*MsgUpdateConsumer) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{18} +func (m *MsgChangeRewardDenoms) Reset() { *m = MsgChangeRewardDenoms{} } +func (m *MsgChangeRewardDenoms) String() string { return proto.CompactTextString(m) } +func (*MsgChangeRewardDenoms) ProtoMessage() {} +func (*MsgChangeRewardDenoms) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{14} } -func (m *MsgUpdateConsumer) XXX_Unmarshal(b []byte) error { +func (m *MsgChangeRewardDenoms) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgChangeRewardDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateConsumer.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgChangeRewardDenoms.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -859,80 +903,55 @@ func (m *MsgUpdateConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgUpdateConsumer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateConsumer.Merge(m, src) +func (m *MsgChangeRewardDenoms) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChangeRewardDenoms.Merge(m, src) } -func (m *MsgUpdateConsumer) XXX_Size() int { +func (m *MsgChangeRewardDenoms) XXX_Size() int { return m.Size() } -func (m *MsgUpdateConsumer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateConsumer.DiscardUnknown(m) +func (m *MsgChangeRewardDenoms) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChangeRewardDenoms.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateConsumer proto.InternalMessageInfo +var xxx_messageInfo_MsgChangeRewardDenoms proto.InternalMessageInfo -func (m *MsgUpdateConsumer) GetAuthority() string { +func (m *MsgChangeRewardDenoms) GetDenomsToAdd() []string { if m != nil { - return m.Authority + return m.DenomsToAdd } - return "" + return nil } -func (m *MsgUpdateConsumer) GetConsumerId() string { +func (m *MsgChangeRewardDenoms) GetDenomsToRemove() []string { if m != nil { - return m.ConsumerId + return m.DenomsToRemove } - return "" + return nil } -func (m *MsgUpdateConsumer) GetUpdateRecord() *ConsumerUpdateRecord { +func (m *MsgChangeRewardDenoms) GetAuthority() string { if m != nil { - return m.UpdateRecord + return m.Authority } - return nil + return "" } -// ConsumerUpdateRecord is the record that contains parameters to modify in the to-be-updated chain -type ConsumerUpdateRecord struct { - // - OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` - // Corresponds to the percentage of validators that have to validate the chain under the Top N case. - // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power - // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. - // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - Top_N uint32 `protobuf:"varint,2,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` - // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if - // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the - // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only - // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need - // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - ValidatorsPowerCap uint32 `protobuf:"varint,3,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` - // Corresponds to the maximum number of validators that can validate a consumer chain. - // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - ValidatorSetCap uint32 `protobuf:"varint,4,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate - // the consumer chain. - Allowlist []string `protobuf:"bytes,5,rep,name=allowlist,proto3" json:"allowlist,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - Denylist []string `protobuf:"bytes,6,rep,name=denylist,proto3" json:"denylist,omitempty"` - // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - MinStake uint64 `protobuf:"varint,7,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` - // Corresponds to whether inactive validators are allowed to validate the consumer chain. - AllowInactiveVals bool `protobuf:"varint,8,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` +// MsgChangeRewardDenomsResponse defines response type for MsgChangeRewardDenoms messages +type MsgChangeRewardDenomsResponse struct { } -func (m *ConsumerUpdateRecord) Reset() { *m = ConsumerUpdateRecord{} } -func (m *ConsumerUpdateRecord) String() string { return proto.CompactTextString(m) } -func (*ConsumerUpdateRecord) ProtoMessage() {} -func (*ConsumerUpdateRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{19} +func (m *MsgChangeRewardDenomsResponse) Reset() { *m = MsgChangeRewardDenomsResponse{} } +func (m *MsgChangeRewardDenomsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChangeRewardDenomsResponse) ProtoMessage() {} +func (*MsgChangeRewardDenomsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{15} } -func (m *ConsumerUpdateRecord) XXX_Unmarshal(b []byte) error { +func (m *MsgChangeRewardDenomsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ConsumerUpdateRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgChangeRewardDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ConsumerUpdateRecord.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgChangeRewardDenomsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -942,90 +961,46 @@ func (m *ConsumerUpdateRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *ConsumerUpdateRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsumerUpdateRecord.Merge(m, src) +func (m *MsgChangeRewardDenomsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChangeRewardDenomsResponse.Merge(m, src) } -func (m *ConsumerUpdateRecord) XXX_Size() int { +func (m *MsgChangeRewardDenomsResponse) XXX_Size() int { return m.Size() } -func (m *ConsumerUpdateRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ConsumerUpdateRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsumerUpdateRecord proto.InternalMessageInfo - -func (m *ConsumerUpdateRecord) GetOwnerAddress() string { - if m != nil { - return m.OwnerAddress - } - return "" -} - -func (m *ConsumerUpdateRecord) GetTop_N() uint32 { - if m != nil { - return m.Top_N - } - return 0 -} - -func (m *ConsumerUpdateRecord) GetValidatorsPowerCap() uint32 { - if m != nil { - return m.ValidatorsPowerCap - } - return 0 -} - -func (m *ConsumerUpdateRecord) GetValidatorSetCap() uint32 { - if m != nil { - return m.ValidatorSetCap - } - return 0 -} - -func (m *ConsumerUpdateRecord) GetAllowlist() []string { - if m != nil { - return m.Allowlist - } - return nil -} - -func (m *ConsumerUpdateRecord) GetDenylist() []string { - if m != nil { - return m.Denylist - } - return nil -} - -func (m *ConsumerUpdateRecord) GetMinStake() uint64 { - if m != nil { - return m.MinStake - } - return 0 +func (m *MsgChangeRewardDenomsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChangeRewardDenomsResponse.DiscardUnknown(m) } -func (m *ConsumerUpdateRecord) GetAllowInactiveVals() bool { - if m != nil { - return m.AllowInactiveVals - } - return false -} +var xxx_messageInfo_MsgChangeRewardDenomsResponse proto.InternalMessageInfo -// MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages -type MsgUpdateConsumerResponse struct { +type MsgOptIn struct { + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. + // the validator address on the provider + ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` + // (optional) The consensus public key to use on the consumer in json string format corresponding to proto-any, + // for example `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`. + // This field is optional and can remain empty (i.e., `consumer_key = ""`). A validator can always change the + // consumer public key at a later stage by issuing a `MsgAssignConsumerKey` message. + ConsumerKey string `protobuf:"bytes,3,opt,name=consumer_key,json=consumerKey,proto3" json:"consumer_key,omitempty"` + // signer address + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` + // the consumer id of the consumer chain to opt in to + ConsumerId string `protobuf:"bytes,5,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } -func (m *MsgUpdateConsumerResponse) Reset() { *m = MsgUpdateConsumerResponse{} } -func (m *MsgUpdateConsumerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateConsumerResponse) ProtoMessage() {} -func (*MsgUpdateConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{20} +func (m *MsgOptIn) Reset() { *m = MsgOptIn{} } +func (m *MsgOptIn) String() string { return proto.CompactTextString(m) } +func (*MsgOptIn) ProtoMessage() {} +func (*MsgOptIn) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{16} } -func (m *MsgUpdateConsumerResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgOptIn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgOptIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateConsumerResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgOptIn.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1035,37 +1010,33 @@ func (m *MsgUpdateConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *MsgUpdateConsumerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateConsumerResponse.Merge(m, src) +func (m *MsgOptIn) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgOptIn.Merge(m, src) } -func (m *MsgUpdateConsumerResponse) XXX_Size() int { +func (m *MsgOptIn) XXX_Size() int { return m.Size() } -func (m *MsgUpdateConsumerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateConsumerResponse.DiscardUnknown(m) +func (m *MsgOptIn) XXX_DiscardUnknown() { + xxx_messageInfo_MsgOptIn.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateConsumerResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgOptIn proto.InternalMessageInfo -// MsgRegisterConsumer defines the message that registers a consumer chain -type MsgRegisterConsumer struct { - // signer address - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - RegistrationRecord *ConsumerRegistrationRecord `protobuf:"bytes,2,opt,name=registration_record,json=registrationRecord,proto3" json:"registration_record,omitempty"` +type MsgOptInResponse struct { } -func (m *MsgRegisterConsumer) Reset() { *m = MsgRegisterConsumer{} } -func (m *MsgRegisterConsumer) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterConsumer) ProtoMessage() {} -func (*MsgRegisterConsumer) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{21} +func (m *MsgOptInResponse) Reset() { *m = MsgOptInResponse{} } +func (m *MsgOptInResponse) String() string { return proto.CompactTextString(m) } +func (*MsgOptInResponse) ProtoMessage() {} +func (*MsgOptInResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{17} } -func (m *MsgRegisterConsumer) XXX_Unmarshal(b []byte) error { +func (m *MsgOptInResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRegisterConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgOptInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRegisterConsumer.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgOptInResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1075,56 +1046,41 @@ func (m *MsgRegisterConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgRegisterConsumer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterConsumer.Merge(m, src) +func (m *MsgOptInResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgOptInResponse.Merge(m, src) } -func (m *MsgRegisterConsumer) XXX_Size() int { +func (m *MsgOptInResponse) XXX_Size() int { return m.Size() } -func (m *MsgRegisterConsumer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterConsumer.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterConsumer proto.InternalMessageInfo - -func (m *MsgRegisterConsumer) GetSigner() string { - if m != nil { - return m.Signer - } - return "" +func (m *MsgOptInResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgOptInResponse.DiscardUnknown(m) } -func (m *MsgRegisterConsumer) GetRegistrationRecord() *ConsumerRegistrationRecord { - if m != nil { - return m.RegistrationRecord - } - return nil -} +var xxx_messageInfo_MsgOptInResponse proto.InternalMessageInfo -// ConsumerRegistrationRecord is the record that contains information for the registered chain -type ConsumerRegistrationRecord struct { - // the title of the chain that is to be registered - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // the description of the chain that is to be registered - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the metadata (e.g., GitHub repository URL) of the chain that is to be registered - Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - // the chain id of the new consumer chain - ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +type MsgOptOut struct { + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. + // the validator address on the provider + ProviderAddr string `protobuf:"bytes,2,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` + // signer address + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` + // the consumer id of the consumer chain to opt out from + ConsumerId string `protobuf:"bytes,4,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } -func (m *ConsumerRegistrationRecord) Reset() { *m = ConsumerRegistrationRecord{} } -func (m *ConsumerRegistrationRecord) String() string { return proto.CompactTextString(m) } -func (*ConsumerRegistrationRecord) ProtoMessage() {} -func (*ConsumerRegistrationRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{22} +func (m *MsgOptOut) Reset() { *m = MsgOptOut{} } +func (m *MsgOptOut) String() string { return proto.CompactTextString(m) } +func (*MsgOptOut) ProtoMessage() {} +func (*MsgOptOut) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{18} } -func (m *ConsumerRegistrationRecord) XXX_Unmarshal(b []byte) error { +func (m *MsgOptOut) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ConsumerRegistrationRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgOptOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ConsumerRegistrationRecord.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgOptOut.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1134,63 +1090,33 @@ func (m *ConsumerRegistrationRecord) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *ConsumerRegistrationRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsumerRegistrationRecord.Merge(m, src) +func (m *MsgOptOut) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgOptOut.Merge(m, src) } -func (m *ConsumerRegistrationRecord) XXX_Size() int { +func (m *MsgOptOut) XXX_Size() int { return m.Size() } -func (m *ConsumerRegistrationRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ConsumerRegistrationRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsumerRegistrationRecord proto.InternalMessageInfo - -func (m *ConsumerRegistrationRecord) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *ConsumerRegistrationRecord) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *ConsumerRegistrationRecord) GetMetadata() string { - if m != nil { - return m.Metadata - } - return "" +func (m *MsgOptOut) XXX_DiscardUnknown() { + xxx_messageInfo_MsgOptOut.DiscardUnknown(m) } -func (m *ConsumerRegistrationRecord) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} +var xxx_messageInfo_MsgOptOut proto.InternalMessageInfo -// MsgRegisterConsumerResponse defines response type for MsgRegisterConsumer -type MsgRegisterConsumerResponse struct { - ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` +type MsgOptOutResponse struct { } -func (m *MsgRegisterConsumerResponse) Reset() { *m = MsgRegisterConsumerResponse{} } -func (m *MsgRegisterConsumerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterConsumerResponse) ProtoMessage() {} -func (*MsgRegisterConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{23} +func (m *MsgOptOutResponse) Reset() { *m = MsgOptOutResponse{} } +func (m *MsgOptOutResponse) String() string { return proto.CompactTextString(m) } +func (*MsgOptOutResponse) ProtoMessage() {} +func (*MsgOptOutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{19} } -func (m *MsgRegisterConsumerResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgOptOutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRegisterConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgOptOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRegisterConsumerResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgOptOutResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1200,46 +1126,46 @@ func (m *MsgRegisterConsumerResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *MsgRegisterConsumerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterConsumerResponse.Merge(m, src) +func (m *MsgOptOutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgOptOutResponse.Merge(m, src) } -func (m *MsgRegisterConsumerResponse) XXX_Size() int { +func (m *MsgOptOutResponse) XXX_Size() int { return m.Size() } -func (m *MsgRegisterConsumerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterConsumerResponse.DiscardUnknown(m) +func (m *MsgOptOutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgOptOutResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgRegisterConsumerResponse proto.InternalMessageInfo - -func (m *MsgRegisterConsumerResponse) GetConsumerId() string { - if m != nil { - return m.ConsumerId - } - return "" -} +var xxx_messageInfo_MsgOptOutResponse proto.InternalMessageInfo -// MsgInitializeConsumer defines the message that initializes the consumer chain with the given consumer id -type MsgInitializeConsumer struct { +// MsgSetConsumerCommissionRate allows validators to set +// a per-consumer chain commission rate +type MsgSetConsumerCommissionRate struct { + // The validator address on the provider + ProviderAddr string `protobuf:"bytes,1,opt,name=provider_addr,json=providerAddr,proto3" json:"provider_addr,omitempty" yaml:"address"` + // [DEPRECATED] use `consumer_id` instead + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. + // The rate to charge delegators on the consumer chain, as a fraction + // TODO: migrate rate from sdk.Dec to math.LegacyDec + Rate cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=rate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rate"` // signer address - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // consumer id of the to-be-initialized consumer chain - ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` - InitializationRecord *ConsumerInitializationRecord `protobuf:"bytes,3,opt,name=initialization_record,json=initializationRecord,proto3" json:"initialization_record,omitempty"` + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` + // the consumer id of the consumer chain to set the commission rate + ConsumerId string `protobuf:"bytes,5,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } -func (m *MsgInitializeConsumer) Reset() { *m = MsgInitializeConsumer{} } -func (m *MsgInitializeConsumer) String() string { return proto.CompactTextString(m) } -func (*MsgInitializeConsumer) ProtoMessage() {} -func (*MsgInitializeConsumer) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{24} +func (m *MsgSetConsumerCommissionRate) Reset() { *m = MsgSetConsumerCommissionRate{} } +func (m *MsgSetConsumerCommissionRate) String() string { return proto.CompactTextString(m) } +func (*MsgSetConsumerCommissionRate) ProtoMessage() {} +func (*MsgSetConsumerCommissionRate) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{20} } -func (m *MsgInitializeConsumer) XXX_Unmarshal(b []byte) error { +func (m *MsgSetConsumerCommissionRate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgInitializeConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgSetConsumerCommissionRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgInitializeConsumer.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgSetConsumerCommissionRate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1249,98 +1175,101 @@ func (m *MsgInitializeConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *MsgInitializeConsumer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgInitializeConsumer.Merge(m, src) +func (m *MsgSetConsumerCommissionRate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetConsumerCommissionRate.Merge(m, src) } -func (m *MsgInitializeConsumer) XXX_Size() int { +func (m *MsgSetConsumerCommissionRate) XXX_Size() int { return m.Size() } -func (m *MsgInitializeConsumer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgInitializeConsumer.DiscardUnknown(m) +func (m *MsgSetConsumerCommissionRate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetConsumerCommissionRate.DiscardUnknown(m) } -var xxx_messageInfo_MsgInitializeConsumer proto.InternalMessageInfo +var xxx_messageInfo_MsgSetConsumerCommissionRate proto.InternalMessageInfo -func (m *MsgInitializeConsumer) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" +type MsgSetConsumerCommissionRateResponse struct { } -func (m *MsgInitializeConsumer) GetConsumerId() string { - if m != nil { - return m.ConsumerId - } - return "" +func (m *MsgSetConsumerCommissionRateResponse) Reset() { *m = MsgSetConsumerCommissionRateResponse{} } +func (m *MsgSetConsumerCommissionRateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetConsumerCommissionRateResponse) ProtoMessage() {} +func (*MsgSetConsumerCommissionRateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{21} } - -func (m *MsgInitializeConsumer) GetInitializationRecord() *ConsumerInitializationRecord { - if m != nil { - return m.InitializationRecord +func (m *MsgSetConsumerCommissionRateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetConsumerCommissionRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetConsumerCommissionRateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return nil +} +func (m *MsgSetConsumerCommissionRateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetConsumerCommissionRateResponse.Merge(m, src) +} +func (m *MsgSetConsumerCommissionRateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetConsumerCommissionRateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetConsumerCommissionRateResponse.DiscardUnknown(m) } -// ConsumerInitializationRecord is the record that contains information for the to-be-initialized chain -type ConsumerInitializationRecord struct { - // the proposed initial height of new consumer chain. - // For a completely new chain, this will be {0,1}. However, it may be - // different if this is a chain that is converting to a consumer chain. - InitialHeight types1.Height `protobuf:"bytes,1,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` - // The hash of the consumer chain genesis state without the consumer CCV - // module genesis params. It is used for off-chain confirmation of - // genesis.json validity by validators and other parties. - GenesisHash []byte `protobuf:"bytes,2,opt,name=genesis_hash,json=genesisHash,proto3" json:"genesis_hash,omitempty"` - // The hash of the consumer chain binary that should be run by validators on - // chain initialization. It is used for off-chain confirmation of binary - // validity by validators and other parties. - BinaryHash []byte `protobuf:"bytes,3,opt,name=binary_hash,json=binaryHash,proto3" json:"binary_hash,omitempty"` - // spawn time is the time on the provider chain at which the consumer chain - // genesis is finalized and all validators will be responsible for starting - // their consumer chain validator node. - SpawnTime time.Time `protobuf:"bytes,4,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` - // Unbonding period for the consumer, - // which should be smaller than that of the provider in general. - UnbondingPeriod time.Duration `protobuf:"bytes,5,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` - // Sent CCV related IBC packets will timeout after this duration - CcvTimeoutPeriod time.Duration `protobuf:"bytes,6,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` - // Sent transfer related IBC packets will timeout after this duration - TransferTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` - // The fraction of tokens allocated to the consumer redistribution address - // during distribution events. The fraction is a string representing a - // decimal number. For example "0.75" would represent 75%. - ConsumerRedistributionFraction string `protobuf:"bytes,8,opt,name=consumer_redistribution_fraction,json=consumerRedistributionFraction,proto3" json:"consumer_redistribution_fraction,omitempty"` - // BlocksPerDistributionTransmission is the number of blocks between - // ibc-token-transfers from the consumer chain to the provider chain. On - // sending transmission event, `consumer_redistribution_fraction` of the - // accumulated tokens are sent to the consumer redistribution address. - BlocksPerDistributionTransmission int64 `protobuf:"varint,9,opt,name=blocks_per_distribution_transmission,json=blocksPerDistributionTransmission,proto3" json:"blocks_per_distribution_transmission,omitempty"` - // The number of historical info entries to persist in store. - // This param is a part of the cosmos sdk staking module. In the case of - // a ccv enabled consumer chain, the ccv module acts as the staking module. - HistoricalEntries int64 `protobuf:"varint,10,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"` - // The ID of a token transfer channel used for the Reward Distribution - // sub-protocol. If DistributionTransmissionChannel == "", a new transfer - // channel is created on top of the same connection as the CCV channel. - // Note that transfer_channel_id is the ID of the channel end on the consumer - // chain. it is most relevant for chains performing a sovereign to consumer - // changeover in order to maintain the existing ibc transfer channel - DistributionTransmissionChannel string `protobuf:"bytes,11,opt,name=distribution_transmission_channel,json=distributionTransmissionChannel,proto3" json:"distribution_transmission_channel,omitempty"` +var xxx_messageInfo_MsgSetConsumerCommissionRateResponse proto.InternalMessageInfo + +// [DEPRECATED] Use `MsgUpdateConsumer` instead +type MsgConsumerModification struct { + // the title of the proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the chain-id of the consumer chain to be modified + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // Corresponds to the percentage of validators that have to validate the chain under the Top N case. + // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power + // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. + // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. + Top_N uint32 `protobuf:"varint,4,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if + // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the + // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only + // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need + // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. + ValidatorsPowerCap uint32 `protobuf:"varint,5,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + // Corresponds to the maximum number of validators that can validate a consumer chain. + // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. + ValidatorSetCap uint32 `protobuf:"varint,6,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate + // the consumer chain. + Allowlist []string `protobuf:"bytes,7,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. + Denylist []string `protobuf:"bytes,8,rep,name=denylist,proto3" json:"denylist,omitempty"` + // signer address + Authority string `protobuf:"bytes,9,opt,name=authority,proto3" json:"authority,omitempty"` + // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. + MinStake uint64 `protobuf:"varint,10,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` + // Corresponds to whether inactive validators are allowed to validate the consumer chain. + AllowInactiveVals bool `protobuf:"varint,11,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` } -func (m *ConsumerInitializationRecord) Reset() { *m = ConsumerInitializationRecord{} } -func (m *ConsumerInitializationRecord) String() string { return proto.CompactTextString(m) } -func (*ConsumerInitializationRecord) ProtoMessage() {} -func (*ConsumerInitializationRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{25} +func (m *MsgConsumerModification) Reset() { *m = MsgConsumerModification{} } +func (m *MsgConsumerModification) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerModification) ProtoMessage() {} +func (*MsgConsumerModification) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{22} } -func (m *ConsumerInitializationRecord) XXX_Unmarshal(b []byte) error { +func (m *MsgConsumerModification) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ConsumerInitializationRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgConsumerModification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ConsumerInitializationRecord.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgConsumerModification.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1350,111 +1279,110 @@ func (m *ConsumerInitializationRecord) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *ConsumerInitializationRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsumerInitializationRecord.Merge(m, src) +func (m *MsgConsumerModification) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerModification.Merge(m, src) } -func (m *ConsumerInitializationRecord) XXX_Size() int { +func (m *MsgConsumerModification) XXX_Size() int { return m.Size() } -func (m *ConsumerInitializationRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ConsumerInitializationRecord.DiscardUnknown(m) +func (m *MsgConsumerModification) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerModification.DiscardUnknown(m) } -var xxx_messageInfo_ConsumerInitializationRecord proto.InternalMessageInfo +var xxx_messageInfo_MsgConsumerModification proto.InternalMessageInfo -func (m *ConsumerInitializationRecord) GetInitialHeight() types1.Height { +func (m *MsgConsumerModification) GetTitle() string { if m != nil { - return m.InitialHeight + return m.Title } - return types1.Height{} + return "" } -func (m *ConsumerInitializationRecord) GetGenesisHash() []byte { +func (m *MsgConsumerModification) GetDescription() string { if m != nil { - return m.GenesisHash + return m.Description } - return nil + return "" } -func (m *ConsumerInitializationRecord) GetBinaryHash() []byte { +func (m *MsgConsumerModification) GetChainId() string { if m != nil { - return m.BinaryHash + return m.ChainId } - return nil + return "" } -func (m *ConsumerInitializationRecord) GetSpawnTime() time.Time { +func (m *MsgConsumerModification) GetTop_N() uint32 { if m != nil { - return m.SpawnTime + return m.Top_N } - return time.Time{} + return 0 } -func (m *ConsumerInitializationRecord) GetUnbondingPeriod() time.Duration { +func (m *MsgConsumerModification) GetValidatorsPowerCap() uint32 { if m != nil { - return m.UnbondingPeriod + return m.ValidatorsPowerCap } return 0 } -func (m *ConsumerInitializationRecord) GetCcvTimeoutPeriod() time.Duration { +func (m *MsgConsumerModification) GetValidatorSetCap() uint32 { if m != nil { - return m.CcvTimeoutPeriod + return m.ValidatorSetCap } return 0 } -func (m *ConsumerInitializationRecord) GetTransferTimeoutPeriod() time.Duration { +func (m *MsgConsumerModification) GetAllowlist() []string { if m != nil { - return m.TransferTimeoutPeriod + return m.Allowlist } - return 0 + return nil } -func (m *ConsumerInitializationRecord) GetConsumerRedistributionFraction() string { +func (m *MsgConsumerModification) GetDenylist() []string { if m != nil { - return m.ConsumerRedistributionFraction + return m.Denylist } - return "" + return nil } -func (m *ConsumerInitializationRecord) GetBlocksPerDistributionTransmission() int64 { +func (m *MsgConsumerModification) GetAuthority() string { if m != nil { - return m.BlocksPerDistributionTransmission + return m.Authority } - return 0 + return "" } -func (m *ConsumerInitializationRecord) GetHistoricalEntries() int64 { +func (m *MsgConsumerModification) GetMinStake() uint64 { if m != nil { - return m.HistoricalEntries + return m.MinStake } return 0 } -func (m *ConsumerInitializationRecord) GetDistributionTransmissionChannel() string { +func (m *MsgConsumerModification) GetAllowInactiveVals() bool { if m != nil { - return m.DistributionTransmissionChannel + return m.AllowInactiveVals } - return "" + return false } -// MsgInitializeConsumerResponse defines response type for MsgRegisterConsumer -type MsgInitializeConsumerResponse struct { +type MsgConsumerModificationResponse struct { } -func (m *MsgInitializeConsumerResponse) Reset() { *m = MsgInitializeConsumerResponse{} } -func (m *MsgInitializeConsumerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgInitializeConsumerResponse) ProtoMessage() {} -func (*MsgInitializeConsumerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{26} +func (m *MsgConsumerModificationResponse) Reset() { *m = MsgConsumerModificationResponse{} } +func (m *MsgConsumerModificationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConsumerModificationResponse) ProtoMessage() {} +func (*MsgConsumerModificationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{23} } -func (m *MsgInitializeConsumerResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgConsumerModificationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgInitializeConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgConsumerModificationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgInitializeConsumerResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgConsumerModificationResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1464,104 +1392,41 @@ func (m *MsgInitializeConsumerResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *MsgInitializeConsumerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgInitializeConsumerResponse.Merge(m, src) +func (m *MsgConsumerModificationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConsumerModificationResponse.Merge(m, src) } -func (m *MsgInitializeConsumerResponse) XXX_Size() int { +func (m *MsgConsumerModificationResponse) XXX_Size() int { return m.Size() } -func (m *MsgInitializeConsumerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgInitializeConsumerResponse.DiscardUnknown(m) +func (m *MsgConsumerModificationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConsumerModificationResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgInitializeConsumerResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgConsumerModificationResponse proto.InternalMessageInfo -type MsgConsumerAddition struct { - // the proposed chain-id of the new consumer chain, must be different from all - // other consumer chain ids of the executing provider chain. - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // the proposed initial height of new consumer chain. - // For a completely new chain, this will be {0,1}. However, it may be - // different if this is a chain that is converting to a consumer chain. - InitialHeight types1.Height `protobuf:"bytes,2,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` - // The hash of the consumer chain genesis state without the consumer CCV - // module genesis params. It is used for off-chain confirmation of - // genesis.json validity by validators and other parties. - GenesisHash []byte `protobuf:"bytes,3,opt,name=genesis_hash,json=genesisHash,proto3" json:"genesis_hash,omitempty"` - // The hash of the consumer chain binary that should be run by validators on - // chain initialization. It is used for off-chain confirmation of binary - // validity by validators and other parties. - BinaryHash []byte `protobuf:"bytes,4,opt,name=binary_hash,json=binaryHash,proto3" json:"binary_hash,omitempty"` - // spawn time is the time on the provider chain at which the consumer chain - // genesis is finalized and all validators will be responsible for starting - // their consumer chain validator node. - SpawnTime time.Time `protobuf:"bytes,5,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` - // Unbonding period for the consumer, - // which should be smaller than that of the provider in general. - UnbondingPeriod time.Duration `protobuf:"bytes,6,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` - // Sent CCV related IBC packets will timeout after this duration - CcvTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` - // Sent transfer related IBC packets will timeout after this duration - TransferTimeoutPeriod time.Duration `protobuf:"bytes,8,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` - // The fraction of tokens allocated to the consumer redistribution address - // during distribution events. The fraction is a string representing a - // decimal number. For example "0.75" would represent 75%. - ConsumerRedistributionFraction string `protobuf:"bytes,9,opt,name=consumer_redistribution_fraction,json=consumerRedistributionFraction,proto3" json:"consumer_redistribution_fraction,omitempty"` - // BlocksPerDistributionTransmission is the number of blocks between - // ibc-token-transfers from the consumer chain to the provider chain. On - // sending transmission event, `consumer_redistribution_fraction` of the - // accumulated tokens are sent to the consumer redistribution address. - BlocksPerDistributionTransmission int64 `protobuf:"varint,10,opt,name=blocks_per_distribution_transmission,json=blocksPerDistributionTransmission,proto3" json:"blocks_per_distribution_transmission,omitempty"` - // The number of historical info entries to persist in store. - // This param is a part of the cosmos sdk staking module. In the case of - // a ccv enabled consumer chain, the ccv module acts as the staking module. - HistoricalEntries int64 `protobuf:"varint,11,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty"` - // The ID of a token transfer channel used for the Reward Distribution - // sub-protocol. If DistributionTransmissionChannel == "", a new transfer - // channel is created on top of the same connection as the CCV channel. - // Note that transfer_channel_id is the ID of the channel end on the consumer - // chain. it is most relevant for chains performing a sovereign to consumer - // changeover in order to maintain the existing ibc transfer channel - DistributionTransmissionChannel string `protobuf:"bytes,12,opt,name=distribution_transmission_channel,json=distributionTransmissionChannel,proto3" json:"distribution_transmission_channel,omitempty"` - // Corresponds to the percentage of validators that have to validate the chain under the Top N case. - // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power - // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. - // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - Top_N uint32 `protobuf:"varint,13,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` - // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if - // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the - // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only - // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need - // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - ValidatorsPowerCap uint32 `protobuf:"varint,14,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` - // Corresponds to the maximum number of validators that can validate a consumer chain. - // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - ValidatorSetCap uint32 `protobuf:"varint,15,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate - // the consumer chain. - Allowlist []string `protobuf:"bytes,16,rep,name=allowlist,proto3" json:"allowlist,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - Denylist []string `protobuf:"bytes,17,rep,name=denylist,proto3" json:"denylist,omitempty"` +// MsgCreateConsumer defines the message that creates a consumer chain +type MsgCreateConsumer struct { // signer address - Authority string `protobuf:"bytes,18,opt,name=authority,proto3" json:"authority,omitempty"` - // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - MinStake uint64 `protobuf:"varint,19,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` - // Corresponds to whether inactive validators are allowed to validate the consumer chain. - AllowInactiveVals bool `protobuf:"varint,20,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + // the chain id of the new consumer chain + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Metadata *ConsumerMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + InitializationParameters *ConsumerInitializationParameters `protobuf:"bytes,4,opt,name=initialization_parameters,json=initializationParameters,proto3" json:"initialization_parameters,omitempty"` + PowerShapingParameters *PowerShapingParameters `protobuf:"bytes,5,opt,name=power_shaping_parameters,json=powerShapingParameters,proto3" json:"power_shaping_parameters,omitempty"` } -func (m *MsgConsumerAddition) Reset() { *m = MsgConsumerAddition{} } -func (m *MsgConsumerAddition) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerAddition) ProtoMessage() {} -func (*MsgConsumerAddition) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{27} +func (m *MsgCreateConsumer) Reset() { *m = MsgCreateConsumer{} } +func (m *MsgCreateConsumer) String() string { return proto.CompactTextString(m) } +func (*MsgCreateConsumer) ProtoMessage() {} +func (*MsgCreateConsumer) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{24} } -func (m *MsgConsumerAddition) XXX_Unmarshal(b []byte) error { +func (m *MsgCreateConsumer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgConsumerAddition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgCreateConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgConsumerAddition.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgCreateConsumer.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1571,174 +1436,205 @@ func (m *MsgConsumerAddition) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgConsumerAddition) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerAddition.Merge(m, src) +func (m *MsgCreateConsumer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateConsumer.Merge(m, src) } -func (m *MsgConsumerAddition) XXX_Size() int { +func (m *MsgCreateConsumer) XXX_Size() int { return m.Size() } -func (m *MsgConsumerAddition) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerAddition.DiscardUnknown(m) +func (m *MsgCreateConsumer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateConsumer.DiscardUnknown(m) } -var xxx_messageInfo_MsgConsumerAddition proto.InternalMessageInfo +var xxx_messageInfo_MsgCreateConsumer proto.InternalMessageInfo -func (m *MsgConsumerAddition) GetChainId() string { +func (m *MsgCreateConsumer) GetSigner() string { if m != nil { - return m.ChainId + return m.Signer } return "" } -func (m *MsgConsumerAddition) GetInitialHeight() types1.Height { +func (m *MsgCreateConsumer) GetChainId() string { if m != nil { - return m.InitialHeight + return m.ChainId } - return types1.Height{} + return "" } -func (m *MsgConsumerAddition) GetGenesisHash() []byte { +func (m *MsgCreateConsumer) GetMetadata() *ConsumerMetadata { if m != nil { - return m.GenesisHash + return m.Metadata } return nil } -func (m *MsgConsumerAddition) GetBinaryHash() []byte { +func (m *MsgCreateConsumer) GetInitializationParameters() *ConsumerInitializationParameters { if m != nil { - return m.BinaryHash + return m.InitializationParameters } return nil } -func (m *MsgConsumerAddition) GetSpawnTime() time.Time { +func (m *MsgCreateConsumer) GetPowerShapingParameters() *PowerShapingParameters { if m != nil { - return m.SpawnTime + return m.PowerShapingParameters } - return time.Time{} + return nil } -func (m *MsgConsumerAddition) GetUnbondingPeriod() time.Duration { - if m != nil { - return m.UnbondingPeriod - } - return 0 +// MsgCreateConsumerResponse defines response type for MsgCreateConsumer +type MsgCreateConsumerResponse struct { + ConsumerId string `protobuf:"bytes,1,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } -func (m *MsgConsumerAddition) GetCcvTimeoutPeriod() time.Duration { - if m != nil { - return m.CcvTimeoutPeriod - } - return 0 +func (m *MsgCreateConsumerResponse) Reset() { *m = MsgCreateConsumerResponse{} } +func (m *MsgCreateConsumerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateConsumerResponse) ProtoMessage() {} +func (*MsgCreateConsumerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{25} } - -func (m *MsgConsumerAddition) GetTransferTimeoutPeriod() time.Duration { - if m != nil { - return m.TransferTimeoutPeriod +func (m *MsgCreateConsumerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateConsumerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return 0 +} +func (m *MsgCreateConsumerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateConsumerResponse.Merge(m, src) +} +func (m *MsgCreateConsumerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateConsumerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateConsumerResponse.DiscardUnknown(m) } -func (m *MsgConsumerAddition) GetConsumerRedistributionFraction() string { +var xxx_messageInfo_MsgCreateConsumerResponse proto.InternalMessageInfo + +func (m *MsgCreateConsumerResponse) GetConsumerId() string { if m != nil { - return m.ConsumerRedistributionFraction + return m.ConsumerId } return "" } -func (m *MsgConsumerAddition) GetBlocksPerDistributionTransmission() int64 { - if m != nil { - return m.BlocksPerDistributionTransmission - } - return 0 +// MsgUpdateConsumer defines the message used to modify a consumer chain. +type MsgUpdateConsumer struct { + // signer address + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + // the consumer id of the consumer chain to be updated + ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` + // the new owner of the consumer when updated + OwnerAddress string `protobuf:"bytes,3,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + // the metadata of the consumer when updated + Metadata *ConsumerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + // initialization parameters can only be updated before a chain has launched + InitializationParameters *ConsumerInitializationParameters `protobuf:"bytes,5,opt,name=initialization_parameters,json=initializationParameters,proto3" json:"initialization_parameters,omitempty"` + // the power-shaping parameters of the consumer when updated + PowerShapingParameters *PowerShapingParameters `protobuf:"bytes,6,opt,name=power_shaping_parameters,json=powerShapingParameters,proto3" json:"power_shaping_parameters,omitempty"` } -func (m *MsgConsumerAddition) GetHistoricalEntries() int64 { - if m != nil { - return m.HistoricalEntries +func (m *MsgUpdateConsumer) Reset() { *m = MsgUpdateConsumer{} } +func (m *MsgUpdateConsumer) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateConsumer) ProtoMessage() {} +func (*MsgUpdateConsumer) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{26} +} +func (m *MsgUpdateConsumer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateConsumer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateConsumer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return 0 +} +func (m *MsgUpdateConsumer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateConsumer.Merge(m, src) +} +func (m *MsgUpdateConsumer) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateConsumer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateConsumer.DiscardUnknown(m) } -func (m *MsgConsumerAddition) GetDistributionTransmissionChannel() string { +var xxx_messageInfo_MsgUpdateConsumer proto.InternalMessageInfo + +func (m *MsgUpdateConsumer) GetSigner() string { if m != nil { - return m.DistributionTransmissionChannel + return m.Signer } return "" } -func (m *MsgConsumerAddition) GetTop_N() uint32 { +func (m *MsgUpdateConsumer) GetConsumerId() string { if m != nil { - return m.Top_N + return m.ConsumerId } - return 0 + return "" } -func (m *MsgConsumerAddition) GetValidatorsPowerCap() uint32 { +func (m *MsgUpdateConsumer) GetOwnerAddress() string { if m != nil { - return m.ValidatorsPowerCap + return m.OwnerAddress } - return 0 + return "" } -func (m *MsgConsumerAddition) GetValidatorSetCap() uint32 { +func (m *MsgUpdateConsumer) GetMetadata() *ConsumerMetadata { if m != nil { - return m.ValidatorSetCap + return m.Metadata } - return 0 + return nil } -func (m *MsgConsumerAddition) GetAllowlist() []string { +func (m *MsgUpdateConsumer) GetInitializationParameters() *ConsumerInitializationParameters { if m != nil { - return m.Allowlist + return m.InitializationParameters } return nil } -func (m *MsgConsumerAddition) GetDenylist() []string { +func (m *MsgUpdateConsumer) GetPowerShapingParameters() *PowerShapingParameters { if m != nil { - return m.Denylist + return m.PowerShapingParameters } return nil } -func (m *MsgConsumerAddition) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" +// MsgUpdateConsumerResponse defines response type for MsgUpdateConsumer messages +type MsgUpdateConsumerResponse struct { } -func (m *MsgConsumerAddition) GetMinStake() uint64 { - if m != nil { - return m.MinStake - } - return 0 -} - -func (m *MsgConsumerAddition) GetAllowInactiveVals() bool { - if m != nil { - return m.AllowInactiveVals - } - return false -} - -// MsgConsumerAdditionResponse defines response type for MsgConsumerAddition messages -type MsgConsumerAdditionResponse struct { -} - -func (m *MsgConsumerAdditionResponse) Reset() { *m = MsgConsumerAdditionResponse{} } -func (m *MsgConsumerAdditionResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerAdditionResponse) ProtoMessage() {} -func (*MsgConsumerAdditionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{28} +func (m *MsgUpdateConsumerResponse) Reset() { *m = MsgUpdateConsumerResponse{} } +func (m *MsgUpdateConsumerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateConsumerResponse) ProtoMessage() {} +func (*MsgUpdateConsumerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_43221a4391e9fbf4, []int{27} } -func (m *MsgConsumerAdditionResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateConsumerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgConsumerAdditionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateConsumerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgConsumerAdditionResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateConsumerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1748,844 +1644,635 @@ func (m *MsgConsumerAdditionResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *MsgConsumerAdditionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerAdditionResponse.Merge(m, src) +func (m *MsgUpdateConsumerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateConsumerResponse.Merge(m, src) } -func (m *MsgConsumerAdditionResponse) XXX_Size() int { +func (m *MsgUpdateConsumerResponse) XXX_Size() int { return m.Size() } -func (m *MsgConsumerAdditionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerAdditionResponse.DiscardUnknown(m) +func (m *MsgUpdateConsumerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateConsumerResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgConsumerAdditionResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateConsumerResponse proto.InternalMessageInfo -type MsgConsumerRemoval struct { - // the chain-id of the consumer chain to be stopped - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // the time on the provider chain at which all validators are responsible to - // stop their consumer chain validator node - StopTime time.Time `protobuf:"bytes,2,opt,name=stop_time,json=stopTime,proto3,stdtime" json:"stop_time"` - // signer address - Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` +func init() { + proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") + proto.RegisterType((*MsgAssignConsumerKeyResponse)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKeyResponse") + proto.RegisterType((*MsgSubmitConsumerMisbehaviour)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour") + proto.RegisterType((*MsgSubmitConsumerMisbehaviourResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviourResponse") + proto.RegisterType((*MsgSubmitConsumerDoubleVoting)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting") + proto.RegisterType((*MsgSubmitConsumerDoubleVotingResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVotingResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgConsumerAddition)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAddition") + proto.RegisterType((*MsgConsumerAdditionResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAdditionResponse") + proto.RegisterType((*MsgConsumerRemoval)(nil), "interchain_security.ccv.provider.v1.MsgConsumerRemoval") + proto.RegisterType((*MsgConsumerRemovalResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerRemovalResponse") + proto.RegisterType((*MsgRemoveConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumer") + proto.RegisterType((*MsgRemoveConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumerResponse") + proto.RegisterType((*MsgChangeRewardDenoms)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenoms") + proto.RegisterType((*MsgChangeRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenomsResponse") + proto.RegisterType((*MsgOptIn)(nil), "interchain_security.ccv.provider.v1.MsgOptIn") + proto.RegisterType((*MsgOptInResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptInResponse") + proto.RegisterType((*MsgOptOut)(nil), "interchain_security.ccv.provider.v1.MsgOptOut") + proto.RegisterType((*MsgOptOutResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptOutResponse") + proto.RegisterType((*MsgSetConsumerCommissionRate)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRate") + proto.RegisterType((*MsgSetConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRateResponse") + proto.RegisterType((*MsgConsumerModification)(nil), "interchain_security.ccv.provider.v1.MsgConsumerModification") + proto.RegisterType((*MsgConsumerModificationResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerModificationResponse") + proto.RegisterType((*MsgCreateConsumer)(nil), "interchain_security.ccv.provider.v1.MsgCreateConsumer") + proto.RegisterType((*MsgCreateConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgCreateConsumerResponse") + proto.RegisterType((*MsgUpdateConsumer)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumer") + proto.RegisterType((*MsgUpdateConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumerResponse") } -func (m *MsgConsumerRemoval) Reset() { *m = MsgConsumerRemoval{} } -func (m *MsgConsumerRemoval) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerRemoval) ProtoMessage() {} -func (*MsgConsumerRemoval) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{29} +func init() { + proto.RegisterFile("interchain_security/ccv/provider/v1/tx.proto", fileDescriptor_43221a4391e9fbf4) } -func (m *MsgConsumerRemoval) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +var fileDescriptor_43221a4391e9fbf4 = []byte{ + // 2045 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4b, 0x6c, 0x1c, 0x49, + 0xf9, 0x77, 0xcf, 0x8c, 0x9d, 0x99, 0x1a, 0x3f, 0xdb, 0xce, 0xba, 0x3d, 0x49, 0x3c, 0x8e, 0x77, + 0xff, 0xbb, 0x56, 0xfe, 0xeb, 0x9e, 0x8d, 0x21, 0x59, 0x08, 0xe1, 0xe1, 0x47, 0x20, 0x5e, 0x70, + 0xe2, 0x6d, 0x87, 0x20, 0x81, 0x44, 0xab, 0xa6, 0xbb, 0xd2, 0x53, 0xca, 0x74, 0x57, 0xab, 0xab, + 0x66, 0xbc, 0xe6, 0x84, 0xf6, 0x94, 0x63, 0x10, 0x17, 0x6e, 0xec, 0x01, 0x0e, 0x48, 0x80, 0xf6, + 0xb0, 0x27, 0x84, 0xc4, 0x75, 0x25, 0x2e, 0xcb, 0x9e, 0xd0, 0x1e, 0x02, 0x4a, 0x0e, 0xe1, 0xc2, + 0x85, 0x1b, 0x12, 0x07, 0x54, 0x8f, 0xee, 0xe9, 0x9e, 0x19, 0x3b, 0xed, 0x31, 0x04, 0x24, 0x2e, + 0x96, 0xbb, 0xbe, 0xdf, 0xf7, 0xfb, 0x5e, 0x55, 0xdf, 0xd7, 0xd5, 0x03, 0xde, 0xc4, 0x01, 0x43, + 0x91, 0xd3, 0x82, 0x38, 0xb0, 0x29, 0x72, 0x3a, 0x11, 0x66, 0x47, 0x0d, 0xc7, 0xe9, 0x36, 0xc2, + 0x88, 0x74, 0xb1, 0x8b, 0xa2, 0x46, 0xf7, 0x6a, 0x83, 0xbd, 0x67, 0x86, 0x11, 0x61, 0x44, 0x7f, + 0x75, 0x08, 0xda, 0x74, 0x9c, 0xae, 0x19, 0xa3, 0xcd, 0xee, 0xd5, 0xda, 0x1c, 0xf4, 0x71, 0x40, + 0x1a, 0xe2, 0xaf, 0xd4, 0xab, 0x5d, 0xf4, 0x08, 0xf1, 0xda, 0xa8, 0x01, 0x43, 0xdc, 0x80, 0x41, + 0x40, 0x18, 0x64, 0x98, 0x04, 0x54, 0x49, 0xeb, 0x4a, 0x2a, 0x9e, 0x9a, 0x9d, 0x07, 0x0d, 0x86, + 0x7d, 0x44, 0x19, 0xf4, 0x43, 0x05, 0x58, 0xee, 0x07, 0xb8, 0x9d, 0x48, 0x30, 0x28, 0xf9, 0x52, + 0xbf, 0x1c, 0x06, 0x47, 0x4a, 0xb4, 0xe0, 0x11, 0x8f, 0x88, 0x7f, 0x1b, 0xfc, 0xbf, 0x58, 0xc1, + 0x21, 0xd4, 0x27, 0xd4, 0x96, 0x02, 0xf9, 0xa0, 0x44, 0x8b, 0xf2, 0xa9, 0xe1, 0x53, 0x8f, 0x87, + 0xee, 0x53, 0x2f, 0xf6, 0x12, 0x37, 0x9d, 0x86, 0x43, 0x22, 0xd4, 0x70, 0xda, 0x18, 0x05, 0x8c, + 0x4b, 0xe5, 0x7f, 0x0a, 0xb0, 0x91, 0x27, 0x95, 0x49, 0xa2, 0xa4, 0x4e, 0x83, 0x93, 0xb6, 0xb1, + 0xd7, 0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xa9, 0xdc, 0xed, 0xfe, 0x58, 0x8a, 0xda, 0xee, + 0x99, 0x29, 0x12, 0x5f, 0x7f, 0xaa, 0x81, 0x85, 0xa1, 0x57, 0x95, 0x9b, 0xa7, 0xed, 0x08, 0x69, + 0xed, 0xda, 0xce, 0x59, 0xb4, 0x33, 0x4d, 0xa5, 0x36, 0xfe, 0xc3, 0xe7, 0x1f, 0x5e, 0xd1, 0xb6, + 0xbe, 0xf3, 0xf1, 0xd3, 0x65, 0xed, 0x93, 0xa7, 0xcb, 0xda, 0x9f, 0x9f, 0x2e, 0x6b, 0x8f, 0x9f, + 0x2d, 0x8f, 0x7d, 0xf2, 0x6c, 0x79, 0xec, 0x8f, 0xcf, 0x96, 0xc7, 0xbe, 0xfb, 0x65, 0x0f, 0xb3, + 0x56, 0xa7, 0x69, 0x3a, 0xc4, 0x57, 0x3f, 0x78, 0x36, 0x7a, 0xc6, 0xd7, 0x93, 0xdf, 0x2b, 0xbb, + 0xd7, 0x1a, 0xef, 0x65, 0x7f, 0xb4, 0x14, 0x3f, 0xcf, 0x34, 0x27, 0xc4, 0x47, 0xa4, 0xcf, 0xfd, + 0x33, 0x00, 0x00, 0xff, 0xff, 0x47, 0xa7, 0x69, 0x7d, 0x30, 0x1e, 0x00, 0x00, } -func (m *MsgConsumerRemoval) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConsumerRemoval.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) + SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) + SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) + ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) + ConsumerRemoval(ctx context.Context, in *MsgConsumerRemoval, opts ...grpc.CallOption) (*MsgConsumerRemovalResponse, error) + CreateConsumer(ctx context.Context, in *MsgCreateConsumer, opts ...grpc.CallOption) (*MsgCreateConsumerResponse, error) + UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) + RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) + OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) + ConsumerModification(ctx context.Context, in *MsgConsumerModification, opts ...grpc.CallOption) (*MsgConsumerModificationResponse, error) } -func (m *MsgConsumerRemoval) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerRemoval.Merge(m, src) + +type msgClient struct { + cc grpc1.ClientConn } -func (m *MsgConsumerRemoval) XXX_Size() int { - return m.Size() + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} } -func (m *MsgConsumerRemoval) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerRemoval.DiscardUnknown(m) + +func (c *msgClient) AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) { + out := new(MsgAssignConsumerKeyResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -var xxx_messageInfo_MsgConsumerRemoval proto.InternalMessageInfo +func (c *msgClient) SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) { + out := new(MsgSubmitConsumerMisbehaviourResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} -func (m *MsgConsumerRemoval) GetChainId() string { - if m != nil { - return m.ChainId +func (c *msgClient) SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) { + out := new(MsgSubmitConsumerDoubleVotingResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -func (m *MsgConsumerRemoval) GetStopTime() time.Time { - if m != nil { - return m.StopTime +// Deprecated: Do not use. +func (c *msgClient) ConsumerAddition(ctx context.Context, in *MsgConsumerAddition, opts ...grpc.CallOption) (*MsgConsumerAdditionResponse, error) { + out := new(MsgConsumerAdditionResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/ConsumerAddition", in, out, opts...) + if err != nil { + return nil, err } - return time.Time{} + return out, nil } -func (m *MsgConsumerRemoval) GetAuthority() string { - if m != nil { - return m.Authority +// Deprecated: Do not use. +func (c *msgClient) ConsumerRemoval(ctx context.Context, in *MsgConsumerRemoval, opts ...grpc.CallOption) (*MsgConsumerRemovalResponse, error) { + out := new(MsgConsumerRemovalResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/ConsumerRemoval", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -// MsgConsumerRemovalResponse defines response type for MsgConsumerRemoval messages -type MsgConsumerRemovalResponse struct { +func (c *msgClient) CreateConsumer(ctx context.Context, in *MsgCreateConsumer, opts ...grpc.CallOption) (*MsgCreateConsumerResponse, error) { + out := new(MsgCreateConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/CreateConsumer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgConsumerRemovalResponse) Reset() { *m = MsgConsumerRemovalResponse{} } -func (m *MsgConsumerRemovalResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerRemovalResponse) ProtoMessage() {} -func (*MsgConsumerRemovalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{30} +func (c *msgClient) UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) { + out := new(MsgUpdateConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgConsumerRemovalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (c *msgClient) RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) { + out := new(MsgRemoveConsumerResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgConsumerRemovalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConsumerRemovalResponse.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 (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err } + return out, nil } -func (m *MsgConsumerRemovalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerRemovalResponse.Merge(m, src) + +func (c *msgClient) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) { + out := new(MsgOptInResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptIn", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgConsumerRemovalResponse) XXX_Size() int { - return m.Size() + +func (c *msgClient) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) { + out := new(MsgOptOutResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptOut", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgConsumerRemovalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerRemovalResponse.DiscardUnknown(m) + +func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) { + out := new(MsgSetConsumerCommissionRateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -var xxx_messageInfo_MsgConsumerRemovalResponse proto.InternalMessageInfo +// Deprecated: Do not use. +func (c *msgClient) ConsumerModification(ctx context.Context, in *MsgConsumerModification, opts ...grpc.CallOption) (*MsgConsumerModificationResponse, error) { + out := new(MsgConsumerModificationResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/ConsumerModification", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} -// MsgConsumerModification message contains a governance proposal on the provider chain to -// modify a running consumer chain. If it passes, the consumer chain's -// parameters are updated. -// -// Note: this replaces ConsumerModificationProposal which is deprecated and will be removed soon -type MsgConsumerModification struct { - // the title of the proposal - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // the description of the proposal - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // the chain-id of the consumer chain to be modified - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // Corresponds to the percentage of validators that have to validate the chain under the Top N case. - // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power - // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. - // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - Top_N uint32 `protobuf:"varint,4,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` - // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if - // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the - // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only - // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need - // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - ValidatorsPowerCap uint32 `protobuf:"varint,5,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` - // Corresponds to the maximum number of validators that can validate a consumer chain. - // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - ValidatorSetCap uint32 `protobuf:"varint,6,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate - // the consumer chain. - Allowlist []string `protobuf:"bytes,7,rep,name=allowlist,proto3" json:"allowlist,omitempty"` - // Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain. - Denylist []string `protobuf:"bytes,8,rep,name=denylist,proto3" json:"denylist,omitempty"` - // signer address - Authority string `protobuf:"bytes,9,opt,name=authority,proto3" json:"authority,omitempty"` +// MsgServer is the server API for Msg service. +type MsgServer interface { + AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) + SubmitConsumerMisbehaviour(context.Context, *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) + SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) + ConsumerAddition(context.Context, *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) + ConsumerRemoval(context.Context, *MsgConsumerRemoval) (*MsgConsumerRemovalResponse, error) + CreateConsumer(context.Context, *MsgCreateConsumer) (*MsgCreateConsumerResponse, error) + UpdateConsumer(context.Context, *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) + RemoveConsumer(context.Context, *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) + OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) + SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) + ConsumerModification(context.Context, *MsgConsumerModification) (*MsgConsumerModificationResponse, error) } -func (m *MsgConsumerModification) Reset() { *m = MsgConsumerModification{} } -func (m *MsgConsumerModification) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerModification) ProtoMessage() {} -func (*MsgConsumerModification) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{31} +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { } -func (m *MsgConsumerModification) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (*UnimplementedMsgServer) AssignConsumerKey(ctx context.Context, req *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AssignConsumerKey not implemented") } -func (m *MsgConsumerModification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConsumerModification.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 (*UnimplementedMsgServer) SubmitConsumerMisbehaviour(ctx context.Context, req *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerMisbehaviour not implemented") } -func (m *MsgConsumerModification) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerModification.Merge(m, src) +func (*UnimplementedMsgServer) SubmitConsumerDoubleVoting(ctx context.Context, req *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerDoubleVoting not implemented") } -func (m *MsgConsumerModification) XXX_Size() int { - return m.Size() +func (*UnimplementedMsgServer) ConsumerAddition(ctx context.Context, req *MsgConsumerAddition) (*MsgConsumerAdditionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConsumerAddition not implemented") } -func (m *MsgConsumerModification) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerModification.DiscardUnknown(m) +func (*UnimplementedMsgServer) ConsumerRemoval(ctx context.Context, req *MsgConsumerRemoval) (*MsgConsumerRemovalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConsumerRemoval not implemented") +} +func (*UnimplementedMsgServer) CreateConsumer(ctx context.Context, req *MsgCreateConsumer) (*MsgCreateConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateConsumer not implemented") +} +func (*UnimplementedMsgServer) UpdateConsumer(ctx context.Context, req *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConsumer not implemented") +} +func (*UnimplementedMsgServer) RemoveConsumer(ctx context.Context, req *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveConsumer not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) OptIn(ctx context.Context, req *MsgOptIn) (*MsgOptInResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptIn not implemented") +} +func (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*MsgOptOutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptOut not implemented") +} +func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") +} +func (*UnimplementedMsgServer) ConsumerModification(ctx context.Context, req *MsgConsumerModification) (*MsgConsumerModificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConsumerModification not implemented") } -var xxx_messageInfo_MsgConsumerModification proto.InternalMessageInfo - -func (m *MsgConsumerModification) GetTitle() string { - if m != nil { - return m.Title - } - return "" +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) } -func (m *MsgConsumerModification) GetDescription() string { - if m != nil { - return m.Description +func _Msg_AssignConsumerKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAssignConsumerKey) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(MsgServer).AssignConsumerKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AssignConsumerKey(ctx, req.(*MsgAssignConsumerKey)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerModification) GetChainId() string { - if m != nil { - return m.ChainId +func _Msg_SubmitConsumerMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitConsumerMisbehaviour) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, req.(*MsgSubmitConsumerMisbehaviour)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerModification) GetTop_N() uint32 { - if m != nil { - return m.Top_N +func _Msg_SubmitConsumerDoubleVoting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitConsumerDoubleVoting) + if err := dec(in); err != nil { + return nil, err } - return 0 + if interceptor == nil { + return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, req.(*MsgSubmitConsumerDoubleVoting)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerModification) GetValidatorsPowerCap() uint32 { - if m != nil { - return m.ValidatorsPowerCap +func _Msg_ConsumerAddition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConsumerAddition) + if err := dec(in); err != nil { + return nil, err } - return 0 + if interceptor == nil { + return srv.(MsgServer).ConsumerAddition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/ConsumerAddition", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConsumerAddition(ctx, req.(*MsgConsumerAddition)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerModification) GetValidatorSetCap() uint32 { - if m != nil { - return m.ValidatorSetCap +func _Msg_ConsumerRemoval_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConsumerRemoval) + if err := dec(in); err != nil { + return nil, err } - return 0 + if interceptor == nil { + return srv.(MsgServer).ConsumerRemoval(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/ConsumerRemoval", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConsumerRemoval(ctx, req.(*MsgConsumerRemoval)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerModification) GetAllowlist() []string { - if m != nil { - return m.Allowlist +func _Msg_CreateConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateConsumer) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(MsgServer).CreateConsumer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/CreateConsumer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateConsumer(ctx, req.(*MsgCreateConsumer)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerModification) GetDenylist() []string { - if m != nil { - return m.Denylist +func _Msg_UpdateConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateConsumer) + if err := dec(in); err != nil { + return nil, err } - return nil + if interceptor == nil { + return srv.(MsgServer).UpdateConsumer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateConsumer(ctx, req.(*MsgUpdateConsumer)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerModification) GetAuthority() string { - if m != nil { - return m.Authority +func _Msg_RemoveConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveConsumer) + if err := dec(in); err != nil { + return nil, err } - return "" + if interceptor == nil { + return srv.(MsgServer).RemoveConsumer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveConsumer(ctx, req.(*MsgRemoveConsumer)) + } + return interceptor(ctx, in, info, handler) } -type MsgConsumerModificationResponse struct { +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgConsumerModificationResponse) Reset() { *m = MsgConsumerModificationResponse{} } -func (m *MsgConsumerModificationResponse) String() string { return proto.CompactTextString(m) } -func (*MsgConsumerModificationResponse) ProtoMessage() {} -func (*MsgConsumerModificationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{32} -} -func (m *MsgConsumerModificationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgConsumerModificationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgConsumerModificationResponse.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 *MsgConsumerModificationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgConsumerModificationResponse.Merge(m, src) -} -func (m *MsgConsumerModificationResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgConsumerModificationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgConsumerModificationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgConsumerModificationResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") - proto.RegisterType((*MsgAssignConsumerKeyResponse)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKeyResponse") - proto.RegisterType((*MsgSubmitConsumerMisbehaviour)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour") - proto.RegisterType((*MsgSubmitConsumerMisbehaviourResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviourResponse") - proto.RegisterType((*MsgSubmitConsumerDoubleVoting)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting") - proto.RegisterType((*MsgSubmitConsumerDoubleVotingResponse)(nil), "interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVotingResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgRemoveConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumer") - proto.RegisterType((*MsgRemoveConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRemoveConsumerResponse") - proto.RegisterType((*MsgChangeRewardDenoms)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenoms") - proto.RegisterType((*MsgChangeRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.MsgChangeRewardDenomsResponse") - proto.RegisterType((*MsgOptIn)(nil), "interchain_security.ccv.provider.v1.MsgOptIn") - proto.RegisterType((*MsgOptInResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptInResponse") - proto.RegisterType((*MsgOptOut)(nil), "interchain_security.ccv.provider.v1.MsgOptOut") - proto.RegisterType((*MsgOptOutResponse)(nil), "interchain_security.ccv.provider.v1.MsgOptOutResponse") - proto.RegisterType((*MsgSetConsumerCommissionRate)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRate") - proto.RegisterType((*MsgSetConsumerCommissionRateResponse)(nil), "interchain_security.ccv.provider.v1.MsgSetConsumerCommissionRateResponse") - proto.RegisterType((*MsgUpdateConsumer)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumer") - proto.RegisterType((*ConsumerUpdateRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerUpdateRecord") - proto.RegisterType((*MsgUpdateConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgUpdateConsumerResponse") - proto.RegisterType((*MsgRegisterConsumer)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumer") - proto.RegisterType((*ConsumerRegistrationRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerRegistrationRecord") - proto.RegisterType((*MsgRegisterConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumerResponse") - proto.RegisterType((*MsgInitializeConsumer)(nil), "interchain_security.ccv.provider.v1.MsgInitializeConsumer") - proto.RegisterType((*ConsumerInitializationRecord)(nil), "interchain_security.ccv.provider.v1.ConsumerInitializationRecord") - proto.RegisterType((*MsgInitializeConsumerResponse)(nil), "interchain_security.ccv.provider.v1.MsgInitializeConsumerResponse") - proto.RegisterType((*MsgConsumerAddition)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAddition") - proto.RegisterType((*MsgConsumerAdditionResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerAdditionResponse") - proto.RegisterType((*MsgConsumerRemoval)(nil), "interchain_security.ccv.provider.v1.MsgConsumerRemoval") - proto.RegisterType((*MsgConsumerRemovalResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerRemovalResponse") - proto.RegisterType((*MsgConsumerModification)(nil), "interchain_security.ccv.provider.v1.MsgConsumerModification") - proto.RegisterType((*MsgConsumerModificationResponse)(nil), "interchain_security.ccv.provider.v1.MsgConsumerModificationResponse") -} - -func init() { - proto.RegisterFile("interchain_security/ccv/provider/v1/tx.proto", fileDescriptor_43221a4391e9fbf4) -} - -var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 2086 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x4d, 0x6c, 0x24, 0x47, - 0x15, 0x76, 0xfb, 0x77, 0xa6, 0xfc, 0xb3, 0x76, 0xd9, 0xc6, 0xe3, 0x59, 0xc7, 0xe3, 0x9d, 0x84, - 0xc4, 0x0a, 0x71, 0x4f, 0xd6, 0x90, 0x05, 0x2c, 0x08, 0xf8, 0x67, 0x61, 0x1d, 0xf0, 0xae, 0xe9, - 0x5d, 0x16, 0x09, 0xa4, 0xb4, 0x6a, 0xba, 0x6b, 0x7b, 0x4a, 0x3b, 0xdd, 0xd5, 0xea, 0xaa, 0x19, - 0xc7, 0x9c, 0x50, 0x0e, 0x51, 0x24, 0x24, 0x14, 0x24, 0x0e, 0x1c, 0x73, 0xe0, 0x82, 0x14, 0xa4, - 0x1c, 0xc2, 0x85, 0x0b, 0x37, 0x94, 0x53, 0x14, 0x72, 0x42, 0x2b, 0xb4, 0xa0, 0xdd, 0x43, 0x38, - 0x73, 0xe2, 0x88, 0xea, 0xa7, 0x7b, 0x7a, 0x7e, 0x3c, 0xee, 0x19, 0x7b, 0x23, 0xc4, 0x65, 0x34, - 0x55, 0xef, 0xbd, 0xaf, 0xde, 0x7b, 0xf5, 0xde, 0xab, 0x57, 0xd5, 0xe0, 0x15, 0x12, 0x70, 0x1c, - 0x39, 0x35, 0x44, 0x02, 0x9b, 0x61, 0xa7, 0x11, 0x11, 0x7e, 0x5a, 0x71, 0x9c, 0x66, 0x25, 0x8c, - 0x68, 0x93, 0xb8, 0x38, 0xaa, 0x34, 0xaf, 0x57, 0xf8, 0x5b, 0x66, 0x18, 0x51, 0x4e, 0xe1, 0xf3, - 0x3d, 0xb8, 0x4d, 0xc7, 0x69, 0x9a, 0x31, 0xb7, 0xd9, 0xbc, 0x5e, 0x5c, 0x40, 0x3e, 0x09, 0x68, - 0x45, 0xfe, 0x2a, 0xb9, 0xe2, 0x9a, 0x47, 0xa9, 0x57, 0xc7, 0x15, 0x14, 0x92, 0x0a, 0x0a, 0x02, - 0xca, 0x11, 0x27, 0x34, 0x60, 0x9a, 0x5a, 0xd2, 0x54, 0x39, 0xaa, 0x36, 0x1e, 0x54, 0x38, 0xf1, - 0x31, 0xe3, 0xc8, 0x0f, 0x35, 0xc3, 0x7a, 0x27, 0x83, 0xdb, 0x88, 0x24, 0x82, 0xa6, 0xaf, 0x76, - 0xd2, 0x51, 0x70, 0xaa, 0x49, 0x4b, 0x1e, 0xf5, 0xa8, 0xfc, 0x5b, 0x11, 0xff, 0x62, 0x01, 0x87, - 0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, 0x6b, 0x95, 0xb7, 0xda, 0xbf, 0x4c, 0xcb, - 0x2f, 0x70, 0xd5, 0x49, 0xd9, 0xae, 0x7c, 0xf5, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0x58, - 0x9f, 0x20, 0x15, 0x20, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) - SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) - SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) - RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) - InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) - UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) - RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) - OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) - SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) { - out := new(MsgAssignConsumerKeyResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", in, out, opts...) - if err != nil { +func _Msg_OptIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgOptIn) + if err := dec(in); err != nil { return nil, err } - return out, nil -} - -func (c *msgClient) SubmitConsumerMisbehaviour(ctx context.Context, in *MsgSubmitConsumerMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitConsumerMisbehaviourResponse, error) { - out := new(MsgSubmitConsumerMisbehaviourResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", in, out, opts...) - if err != nil { - return nil, err + if interceptor == nil { + return srv.(MsgServer).OptIn(ctx, in) } - return out, nil -} - -func (c *msgClient) SubmitConsumerDoubleVoting(ctx context.Context, in *MsgSubmitConsumerDoubleVoting, opts ...grpc.CallOption) (*MsgSubmitConsumerDoubleVotingResponse, error) { - out := new(MsgSubmitConsumerDoubleVotingResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", in, out, opts...) - if err != nil { - return nil, err + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptIn", } - return out, nil -} - -func (c *msgClient) RegisterConsumer(ctx context.Context, in *MsgRegisterConsumer, opts ...grpc.CallOption) (*MsgRegisterConsumerResponse, error) { - out := new(MsgRegisterConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RegisterConsumer", in, out, opts...) - if err != nil { - return nil, err + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).OptIn(ctx, req.(*MsgOptIn)) } - return out, nil + return interceptor(ctx, in, info, handler) } -func (c *msgClient) InitializeConsumer(ctx context.Context, in *MsgInitializeConsumer, opts ...grpc.CallOption) (*MsgInitializeConsumerResponse, error) { - out := new(MsgInitializeConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", in, out, opts...) - if err != nil { +func _Msg_OptOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgOptOut) + if err := dec(in); err != nil { return nil, err } - return out, nil -} - -func (c *msgClient) UpdateConsumer(ctx context.Context, in *MsgUpdateConsumer, opts ...grpc.CallOption) (*MsgUpdateConsumerResponse, error) { - out := new(MsgUpdateConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", in, out, opts...) - if err != nil { - return nil, err + if interceptor == nil { + return srv.(MsgServer).OptOut(ctx, in) } - return out, nil -} - -func (c *msgClient) RemoveConsumer(ctx context.Context, in *MsgRemoveConsumer, opts ...grpc.CallOption) (*MsgRemoveConsumerResponse, error) { - out := new(MsgRemoveConsumerResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", in, out, opts...) - if err != nil { - return nil, err + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptOut", } - return out, nil -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).OptOut(ctx, req.(*MsgOptOut)) } - return out, nil + return interceptor(ctx, in, info, handler) } -func (c *msgClient) OptIn(ctx context.Context, in *MsgOptIn, opts ...grpc.CallOption) (*MsgOptInResponse, error) { - out := new(MsgOptInResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptIn", in, out, opts...) - if err != nil { +func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetConsumerCommissionRate) + if err := dec(in); err != nil { return nil, err } - return out, nil -} - -func (c *msgClient) OptOut(ctx context.Context, in *MsgOptOut, opts ...grpc.CallOption) (*MsgOptOutResponse, error) { - out := new(MsgOptOutResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/OptOut", in, out, opts...) - if err != nil { - return nil, err + if interceptor == nil { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, in) } - return out, nil -} - -func (c *msgClient) SetConsumerCommissionRate(ctx context.Context, in *MsgSetConsumerCommissionRate, opts ...grpc.CallOption) (*MsgSetConsumerCommissionRateResponse, error) { - out := new(MsgSetConsumerCommissionRateResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", in, out, opts...) - if err != nil { - return nil, err + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) - SubmitConsumerMisbehaviour(context.Context, *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) - SubmitConsumerDoubleVoting(context.Context, *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) - RegisterConsumer(context.Context, *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) - InitializeConsumer(context.Context, *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) - UpdateConsumer(context.Context, *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) - RemoveConsumer(context.Context, *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - OptIn(context.Context, *MsgOptIn) (*MsgOptInResponse, error) - OptOut(context.Context, *MsgOptOut) (*MsgOptOutResponse, error) - SetConsumerCommissionRate(context.Context, *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) AssignConsumerKey(ctx context.Context, req *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AssignConsumerKey not implemented") -} -func (*UnimplementedMsgServer) SubmitConsumerMisbehaviour(ctx context.Context, req *MsgSubmitConsumerMisbehaviour) (*MsgSubmitConsumerMisbehaviourResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerMisbehaviour not implemented") -} -func (*UnimplementedMsgServer) SubmitConsumerDoubleVoting(ctx context.Context, req *MsgSubmitConsumerDoubleVoting) (*MsgSubmitConsumerDoubleVotingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitConsumerDoubleVoting not implemented") -} -func (*UnimplementedMsgServer) RegisterConsumer(ctx context.Context, req *MsgRegisterConsumer) (*MsgRegisterConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterConsumer not implemented") -} -func (*UnimplementedMsgServer) InitializeConsumer(ctx context.Context, req *MsgInitializeConsumer) (*MsgInitializeConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitializeConsumer not implemented") -} -func (*UnimplementedMsgServer) UpdateConsumer(ctx context.Context, req *MsgUpdateConsumer) (*MsgUpdateConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateConsumer not implemented") -} -func (*UnimplementedMsgServer) RemoveConsumer(ctx context.Context, req *MsgRemoveConsumer) (*MsgRemoveConsumerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveConsumer not implemented") -} -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) OptIn(ctx context.Context, req *MsgOptIn) (*MsgOptInResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OptIn not implemented") -} -func (*UnimplementedMsgServer) OptOut(ctx context.Context, req *MsgOptOut) (*MsgOptOutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OptOut not implemented") -} -func (*UnimplementedMsgServer) SetConsumerCommissionRate(ctx context.Context, req *MsgSetConsumerCommissionRate) (*MsgSetConsumerCommissionRateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetConsumerCommissionRate not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetConsumerCommissionRate(ctx, req.(*MsgSetConsumerCommissionRate)) + } + return interceptor(ctx, in, info, handler) } -func _Msg_AssignConsumerKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgAssignConsumerKey) +func _Msg_ConsumerModification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConsumerModification) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AssignConsumerKey(ctx, in) + return srv.(MsgServer).ConsumerModification(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", + FullMethod: "/interchain_security.ccv.provider.v1.Msg/ConsumerModification", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AssignConsumerKey(ctx, req.(*MsgAssignConsumerKey)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SubmitConsumerMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitConsumerMisbehaviour) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitConsumerMisbehaviour(ctx, req.(*MsgSubmitConsumerMisbehaviour)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SubmitConsumerDoubleVoting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitConsumerDoubleVoting) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitConsumerDoubleVoting(ctx, req.(*MsgSubmitConsumerDoubleVoting)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RegisterConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterConsumer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterConsumer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/RegisterConsumer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterConsumer(ctx, req.(*MsgRegisterConsumer)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_InitializeConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgInitializeConsumer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).InitializeConsumer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/InitializeConsumer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).InitializeConsumer(ctx, req.(*MsgInitializeConsumer)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateConsumer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateConsumer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateConsumer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateConsumer(ctx, req.(*MsgUpdateConsumer)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RemoveConsumer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRemoveConsumer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RemoveConsumer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/RemoveConsumer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RemoveConsumer(ctx, req.(*MsgRemoveConsumer)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_OptIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgOptIn) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).OptIn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptIn", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).OptIn(ctx, req.(*MsgOptIn)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_OptOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgOptOut) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).OptOut(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/OptOut", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).OptOut(ctx, req.(*MsgOptOut)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SetConsumerCommissionRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetConsumerCommissionRate) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetConsumerCommissionRate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/SetConsumerCommissionRate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetConsumerCommissionRate(ctx, req.(*MsgSetConsumerCommissionRate)) + return srv.(MsgServer).ConsumerModification(ctx, req.(*MsgConsumerModification)) } return interceptor(ctx, in, info, handler) } @@ -2607,12 +2294,16 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_SubmitConsumerDoubleVoting_Handler, }, { - MethodName: "RegisterConsumer", - Handler: _Msg_RegisterConsumer_Handler, + MethodName: "ConsumerAddition", + Handler: _Msg_ConsumerAddition_Handler, + }, + { + MethodName: "ConsumerRemoval", + Handler: _Msg_ConsumerRemoval_Handler, }, { - MethodName: "InitializeConsumer", - Handler: _Msg_InitializeConsumer_Handler, + MethodName: "CreateConsumer", + Handler: _Msg_CreateConsumer_Handler, }, { MethodName: "UpdateConsumer", @@ -2638,6 +2329,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SetConsumerCommissionRate", Handler: _Msg_SetConsumerCommissionRate_Handler, }, + { + MethodName: "ConsumerModification", + Handler: _Msg_ConsumerModification_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/tx.proto", @@ -2663,6 +2358,13 @@ func (m *MsgAssignConsumerKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x2a + } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) @@ -2684,10 +2386,10 @@ func (m *MsgAssignConsumerKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0xa } @@ -2737,6 +2439,13 @@ func (m *MsgSubmitConsumerMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x1a + } if m.Misbehaviour != nil { { size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) @@ -2747,13 +2456,6 @@ func (m *MsgSubmitConsumerMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- dAtA[i] = 0x12 } if len(m.Submitter) > 0 { @@ -2809,6 +2511,13 @@ func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x22 + } if m.InfractionBlockHeader != nil { { size, err := m.InfractionBlockHeader.MarshalToSizedBuffer(dAtA[:i]) @@ -2819,7 +2528,7 @@ func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } if m.DuplicateVoteEvidence != nil { { @@ -2831,13 +2540,6 @@ func (m *MsgSubmitConsumerDoubleVoting) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- dAtA[i] = 0x12 } if len(m.Submitter) > 0 { @@ -2936,7 +2638,7 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *MsgRemoveConsumer) Marshal() (dAtA []byte, err error) { +func (m *MsgConsumerAddition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2946,42 +2648,172 @@ func (m *MsgRemoveConsumer) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRemoveConsumer) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConsumerAddition) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRemoveConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConsumerAddition) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.AllowInactiveVals { + i-- + if m.AllowInactiveVals { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if m.MinStake != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } if len(m.Authority) > 0 { i -= len(m.Authority) copy(dAtA[i:], m.Authority) i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- - dAtA[i] = 0x1a - } - n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintTx(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x12 - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.Denylist) > 0 { + for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denylist[iNdEx]) + copy(dAtA[i:], m.Denylist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + } + if len(m.Allowlist) > 0 { + for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Allowlist[iNdEx]) + copy(dAtA[i:], m.Allowlist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + } + if m.ValidatorSetCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) + i-- + dAtA[i] = 0x78 + } + if m.ValidatorsPowerCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) + i-- + dAtA[i] = 0x70 + } + if m.Top_N != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) + i-- + dAtA[i] = 0x68 + } + if len(m.DistributionTransmissionChannel) > 0 { + i -= len(m.DistributionTransmissionChannel) + copy(dAtA[i:], m.DistributionTransmissionChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) + i-- + dAtA[i] = 0x62 + } + if m.HistoricalEntries != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.HistoricalEntries)) + i-- + dAtA[i] = 0x58 + } + if m.BlocksPerDistributionTransmission != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) + i-- + dAtA[i] = 0x50 + } + if len(m.ConsumerRedistributionFraction) > 0 { + i -= len(m.ConsumerRedistributionFraction) + copy(dAtA[i:], m.ConsumerRedistributionFraction) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) + i-- + dAtA[i] = 0x4a + } + n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintTx(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x42 + n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x3a + n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x32 + n8, err8 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintTx(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x2a + if len(m.BinaryHash) > 0 { + i -= len(m.BinaryHash) + copy(dAtA[i:], m.BinaryHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.BinaryHash))) + i-- + dAtA[i] = 0x22 + } + if len(m.GenesisHash) > 0 { + i -= len(m.GenesisHash) + copy(dAtA[i:], m.GenesisHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisHash))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgRemoveConsumerResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgConsumerAdditionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2991,12 +2823,12 @@ func (m *MsgRemoveConsumerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRemoveConsumerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConsumerAdditionResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRemoveConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConsumerAdditionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3004,7 +2836,7 @@ func (m *MsgRemoveConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *MsgChangeRewardDenoms) Marshal() (dAtA []byte, err error) { +func (m *MsgConsumerRemoval) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3014,12 +2846,12 @@ func (m *MsgChangeRewardDenoms) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgChangeRewardDenoms) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConsumerRemoval) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgChangeRewardDenoms) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConsumerRemoval) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3031,28 +2863,25 @@ func (m *MsgChangeRewardDenoms) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.DenomsToRemove) > 0 { - for iNdEx := len(m.DenomsToRemove) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DenomsToRemove[iNdEx]) - copy(dAtA[i:], m.DenomsToRemove[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.DenomsToRemove[iNdEx]))) - i-- - dAtA[i] = 0x12 - } + n10, err10 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) + if err10 != nil { + return 0, err10 } - if len(m.DenomsToAdd) > 0 { - for iNdEx := len(m.DenomsToAdd) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DenomsToAdd[iNdEx]) - copy(dAtA[i:], m.DenomsToAdd[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.DenomsToAdd[iNdEx]))) - i-- - dAtA[i] = 0xa - } + i -= n10 + i = encodeVarintTx(dAtA, i, uint64(n10)) + i-- + dAtA[i] = 0x12 + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgChangeRewardDenomsResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgConsumerRemovalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3062,12 +2891,12 @@ func (m *MsgChangeRewardDenomsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgChangeRewardDenomsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConsumerRemovalResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgChangeRewardDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConsumerRemovalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3075,7 +2904,7 @@ func (m *MsgChangeRewardDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *MsgOptIn) Marshal() (dAtA []byte, err error) { +func (m *MsgRemoveConsumer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3085,37 +2914,31 @@ func (m *MsgOptIn) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgOptIn) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRemoveConsumer) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgOptIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRemoveConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - if len(m.ConsumerKey) > 0 { - i -= len(m.ConsumerKey) - copy(dAtA[i:], m.ConsumerKey) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerKey))) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0x1a } - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) - i-- - dAtA[i] = 0x12 + n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) + if err11 != nil { + return 0, err11 } + i -= n11 + i = encodeVarintTx(dAtA, i, uint64(n11)) + i-- + dAtA[i] = 0x12 if len(m.ConsumerId) > 0 { i -= len(m.ConsumerId) copy(dAtA[i:], m.ConsumerId) @@ -3126,7 +2949,7 @@ func (m *MsgOptIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgOptInResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgRemoveConsumerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3136,12 +2959,12 @@ func (m *MsgOptInResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgOptInResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRemoveConsumerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgOptInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRemoveConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3149,7 +2972,7 @@ func (m *MsgOptInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgOptOut) Marshal() (dAtA []byte, err error) { +func (m *MsgChangeRewardDenoms) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3159,41 +2982,45 @@ func (m *MsgOptOut) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgOptOut) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgChangeRewardDenoms) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgOptOut) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgChangeRewardDenoms) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0x1a } - if len(m.ProviderAddr) > 0 { - i -= len(m.ProviderAddr) - copy(dAtA[i:], m.ProviderAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) - i-- - dAtA[i] = 0x12 + if len(m.DenomsToRemove) > 0 { + for iNdEx := len(m.DenomsToRemove) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DenomsToRemove[iNdEx]) + copy(dAtA[i:], m.DenomsToRemove[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.DenomsToRemove[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- - dAtA[i] = 0xa + if len(m.DenomsToAdd) > 0 { + for iNdEx := len(m.DenomsToAdd) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DenomsToAdd[iNdEx]) + copy(dAtA[i:], m.DenomsToAdd[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.DenomsToAdd[iNdEx]))) + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } -func (m *MsgOptOutResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgChangeRewardDenomsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3203,12 +3030,12 @@ func (m *MsgOptOutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgOptOutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgChangeRewardDenomsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgOptOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgChangeRewardDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3216,7 +3043,7 @@ func (m *MsgOptOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgSetConsumerCommissionRate) Marshal() (dAtA []byte, err error) { +func (m *MsgOptIn) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3226,16 +3053,23 @@ func (m *MsgSetConsumerCommissionRate) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSetConsumerCommissionRate) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgOptIn) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgOptIn) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x2a + } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) @@ -3243,34 +3077,31 @@ func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, e i-- dAtA[i] = 0x22 } - { - size := m.Rate.Size() - i -= size - if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + if len(m.ConsumerKey) > 0 { + i -= len(m.ConsumerKey) + copy(dAtA[i:], m.ConsumerKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerKey))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.ProviderAddr) > 0 { i -= len(m.ProviderAddr) copy(dAtA[i:], m.ProviderAddr) i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) i-- + dAtA[i] = 0x12 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgSetConsumerCommissionRateResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgOptInResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3280,12 +3111,12 @@ func (m *MsgSetConsumerCommissionRateResponse) Marshal() (dAtA []byte, err error return dAtA[:n], nil } -func (m *MsgSetConsumerCommissionRateResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgOptInResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSetConsumerCommissionRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgOptInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3293,7 +3124,7 @@ func (m *MsgSetConsumerCommissionRateResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } -func (m *MsgUpdateConsumer) Marshal() (dAtA []byte, err error) { +func (m *MsgOptOut) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3303,46 +3134,48 @@ func (m *MsgUpdateConsumer) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateConsumer) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgOptOut) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgOptOut) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.UpdateRecord != nil { - { - size, err := m.UpdateRecord.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } if len(m.ConsumerId) > 0 { i -= len(m.ConsumerId) copy(dAtA[i:], m.ConsumerId) i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) i-- + dAtA[i] = 0x22 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- dAtA[i] = 0x12 } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ConsumerUpdateRecord) Marshal() (dAtA []byte, err error) { +func (m *MsgOptOutResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3352,75 +3185,20 @@ func (m *ConsumerUpdateRecord) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ConsumerUpdateRecord) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgOptOutResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ConsumerUpdateRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgOptOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AllowInactiveVals { - i-- - if m.AllowInactiveVals { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.MinStake != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) - i-- - dAtA[i] = 0x38 - } - if len(m.Denylist) > 0 { - for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denylist[iNdEx]) - copy(dAtA[i:], m.Denylist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Allowlist) > 0 { - for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Allowlist[iNdEx]) - copy(dAtA[i:], m.Allowlist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.ValidatorSetCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) - i-- - dAtA[i] = 0x20 - } - if m.ValidatorsPowerCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) - i-- - dAtA[i] = 0x18 - } - if m.Top_N != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) - i-- - dAtA[i] = 0x10 - } - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *MsgUpdateConsumerResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgSetConsumerCommissionRate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3430,20 +3208,58 @@ func (m *MsgUpdateConsumerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateConsumerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSetConsumerCommissionRate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSetConsumerCommissionRate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x2a + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + { + size := m.Rate.Size() + i -= size + if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.ProviderAddr) > 0 { + i -= len(m.ProviderAddr) + copy(dAtA[i:], m.ProviderAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderAddr))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *MsgRegisterConsumer) Marshal() (dAtA []byte, err error) { +func (m *MsgSetConsumerCommissionRateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3453,39 +3269,20 @@ func (m *MsgRegisterConsumer) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRegisterConsumer) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSetConsumerCommissionRateResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRegisterConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSetConsumerCommissionRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.RegistrationRecord != nil { - { - size, err := m.RegistrationRecord.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *ConsumerRegistrationRecord) Marshal() (dAtA []byte, err error) { +func (m *MsgConsumerModification) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3495,28 +3292,76 @@ func (m *ConsumerRegistrationRecord) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ConsumerRegistrationRecord) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConsumerModification) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ConsumerRegistrationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConsumerModification) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.AllowInactiveVals { + i-- + if m.AllowInactiveVals { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.MinStake != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) + i-- + dAtA[i] = 0x50 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x4a + } + if len(m.Denylist) > 0 { + for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denylist[iNdEx]) + copy(dAtA[i:], m.Denylist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Allowlist) > 0 { + for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Allowlist[iNdEx]) + copy(dAtA[i:], m.Allowlist[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if m.ValidatorSetCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) + i-- + dAtA[i] = 0x30 + } + if m.ValidatorsPowerCap != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) + i-- + dAtA[i] = 0x28 + } + if m.Top_N != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) + i-- + dAtA[i] = 0x20 + } if len(m.ChainId) > 0 { i -= len(m.ChainId) copy(dAtA[i:], m.ChainId) i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- - dAtA[i] = 0x22 - } - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) - i-- dAtA[i] = 0x1a } if len(m.Description) > 0 { @@ -3536,7 +3381,7 @@ func (m *ConsumerRegistrationRecord) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *MsgRegisterConsumerResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgConsumerModificationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3546,27 +3391,20 @@ func (m *MsgRegisterConsumerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRegisterConsumerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgConsumerModificationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRegisterConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgConsumerModificationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *MsgInitializeConsumer) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateConsumer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3576,19 +3414,19 @@ func (m *MsgInitializeConsumer) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgInitializeConsumer) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateConsumer) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgInitializeConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.InitializationRecord != nil { + if m.PowerShapingParameters != nil { { - size, err := m.InitializationRecord.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.PowerShapingParameters.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3596,26 +3434,50 @@ func (m *MsgInitializeConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } - if len(m.ConsumerId) > 0 { - i -= len(m.ConsumerId) - copy(dAtA[i:], m.ConsumerId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + if m.InitializationParameters != nil { + { + size, err := m.InitializationParameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0x12 } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ConsumerInitializationRecord) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateConsumerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3625,100 +3487,27 @@ func (m *ConsumerInitializationRecord) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ConsumerInitializationRecord) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateConsumerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ConsumerInitializationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.DistributionTransmissionChannel) > 0 { - i -= len(m.DistributionTransmissionChannel) - copy(dAtA[i:], m.DistributionTransmissionChannel) - i = encodeVarintTx(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) - i-- - dAtA[i] = 0x5a - } - if m.HistoricalEntries != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.HistoricalEntries)) - i-- - dAtA[i] = 0x50 - } - if m.BlocksPerDistributionTransmission != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) - i-- - dAtA[i] = 0x48 - } - if len(m.ConsumerRedistributionFraction) > 0 { - i -= len(m.ConsumerRedistributionFraction) - copy(dAtA[i:], m.ConsumerRedistributionFraction) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) - i-- - dAtA[i] = 0x42 - } - n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) - if err9 != nil { - return 0, err9 - } - i -= n9 - i = encodeVarintTx(dAtA, i, uint64(n9)) - i-- - dAtA[i] = 0x3a - n10, err10 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) - if err10 != nil { - return 0, err10 - } - i -= n10 - i = encodeVarintTx(dAtA, i, uint64(n10)) - i-- - dAtA[i] = 0x32 - n11, err11 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) - if err11 != nil { - return 0, err11 - } - i -= n11 - i = encodeVarintTx(dAtA, i, uint64(n11)) - i-- - dAtA[i] = 0x2a - n12, err12 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) - if err12 != nil { - return 0, err12 - } - i -= n12 - i = encodeVarintTx(dAtA, i, uint64(n12)) - i-- - dAtA[i] = 0x22 - if len(m.BinaryHash) > 0 { - i -= len(m.BinaryHash) - copy(dAtA[i:], m.BinaryHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.BinaryHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.GenesisHash) > 0 { - i -= len(m.GenesisHash) - copy(dAtA[i:], m.GenesisHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisHash))) + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) i-- - dAtA[i] = 0x12 - } - { - size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *MsgInitializeConsumerResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateConsumer) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3728,20 +3517,77 @@ func (m *MsgInitializeConsumerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgInitializeConsumerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateConsumer) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgInitializeConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.PowerShapingParameters != nil { + { + size, err := m.PowerShapingParameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.InitializationParameters != nil { + { + size, err := m.InitializationParameters.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *MsgConsumerAddition) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateConsumerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3751,436 +3597,233 @@ func (m *MsgConsumerAddition) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgConsumerAddition) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateConsumerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgConsumerAddition) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateConsumerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AllowInactiveVals { - i-- - if m.AllowInactiveVals { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa0 + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - if m.MinStake != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MinStake)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x98 + dAtA[offset] = uint8(v) + return base +} +func (m *MsgAssignConsumerKey) Size() (n int) { + if m == nil { + return 0 } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if len(m.Denylist) > 0 { - for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denylist[iNdEx]) - copy(dAtA[i:], m.Denylist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } + l = len(m.ProviderAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if len(m.Allowlist) > 0 { - for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Allowlist[iNdEx]) - copy(dAtA[i:], m.Allowlist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } + l = len(m.ConsumerKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if m.ValidatorSetCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) - i-- - dAtA[i] = 0x78 + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if m.ValidatorsPowerCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) - i-- - dAtA[i] = 0x70 + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if m.Top_N != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) - i-- - dAtA[i] = 0x68 + return n +} + +func (m *MsgAssignConsumerKeyResponse) Size() (n int) { + if m == nil { + return 0 } - if len(m.DistributionTransmissionChannel) > 0 { - i -= len(m.DistributionTransmissionChannel) - copy(dAtA[i:], m.DistributionTransmissionChannel) - i = encodeVarintTx(dAtA, i, uint64(len(m.DistributionTransmissionChannel))) - i-- - dAtA[i] = 0x62 - } - if m.HistoricalEntries != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.HistoricalEntries)) - i-- - dAtA[i] = 0x58 - } - if m.BlocksPerDistributionTransmission != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.BlocksPerDistributionTransmission)) - i-- - dAtA[i] = 0x50 - } - if len(m.ConsumerRedistributionFraction) > 0 { - i -= len(m.ConsumerRedistributionFraction) - copy(dAtA[i:], m.ConsumerRedistributionFraction) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerRedistributionFraction))) - i-- - dAtA[i] = 0x4a - } - n14, err14 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) - if err14 != nil { - return 0, err14 - } - i -= n14 - i = encodeVarintTx(dAtA, i, uint64(n14)) - i-- - dAtA[i] = 0x42 - n15, err15 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) - if err15 != nil { - return 0, err15 - } - i -= n15 - i = encodeVarintTx(dAtA, i, uint64(n15)) - i-- - dAtA[i] = 0x3a - n16, err16 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) - if err16 != nil { - return 0, err16 - } - i -= n16 - i = encodeVarintTx(dAtA, i, uint64(n16)) - i-- - dAtA[i] = 0x32 - n17, err17 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) - if err17 != nil { - return 0, err17 - } - i -= n17 - i = encodeVarintTx(dAtA, i, uint64(n17)) - i-- - dAtA[i] = 0x2a - if len(m.BinaryHash) > 0 { - i -= len(m.BinaryHash) - copy(dAtA[i:], m.BinaryHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.BinaryHash))) - i-- - dAtA[i] = 0x22 + var l int + _ = l + return n +} + +func (m *MsgSubmitConsumerMisbehaviour) Size() (n int) { + if m == nil { + return 0 } - if len(m.GenesisHash) > 0 { - i -= len(m.GenesisHash) - copy(dAtA[i:], m.GenesisHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisHash))) - i-- - dAtA[i] = 0x1a + var l int + _ = l + l = len(m.Submitter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - { - size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + if m.Misbehaviour != nil { + l = m.Misbehaviour.Size() + n += 1 + l + sovTx(uint64(l)) } - i-- - dAtA[i] = 0x12 - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - return len(dAtA) - i, nil + return n } -func (m *MsgConsumerAdditionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *MsgSubmitConsumerMisbehaviourResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *MsgConsumerAdditionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConsumerAdditionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - return len(dAtA) - i, nil + return n } -func (m *MsgConsumerRemoval) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *MsgSubmitConsumerDoubleVoting) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *MsgConsumerRemoval) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConsumerRemoval) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x1a + l = len(m.Submitter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - n19, err19 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StopTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime):]) - if err19 != nil { - return 0, err19 + if m.DuplicateVoteEvidence != nil { + l = m.DuplicateVoteEvidence.Size() + n += 1 + l + sovTx(uint64(l)) } - i -= n19 - i = encodeVarintTx(dAtA, i, uint64(n19)) - i-- - dAtA[i] = 0x12 - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa + if m.InfractionBlockHeader != nil { + l = m.InfractionBlockHeader.Size() + n += 1 + l + sovTx(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MsgConsumerRemovalResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MsgConsumerRemovalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return n } -func (m *MsgConsumerRemovalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *MsgSubmitConsumerDoubleVotingResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - return len(dAtA) - i, nil + return n } -func (m *MsgConsumerModification) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n } -func (m *MsgConsumerModification) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n } -func (m *MsgConsumerModification) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *MsgConsumerAddition) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x4a - } - if len(m.Denylist) > 0 { - for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denylist[iNdEx]) - copy(dAtA[i:], m.Denylist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denylist[iNdEx]))) - i-- - dAtA[i] = 0x42 - } - } - if len(m.Allowlist) > 0 { - for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Allowlist[iNdEx]) - copy(dAtA[i:], m.Allowlist[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) - i-- - dAtA[i] = 0x3a - } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if m.ValidatorSetCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorSetCap)) - i-- - dAtA[i] = 0x30 + l = m.InitialHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.GenesisHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if m.ValidatorsPowerCap != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ValidatorsPowerCap)) - i-- - dAtA[i] = 0x28 + l = len(m.BinaryHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if m.Top_N != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Top_N)) - i-- - dAtA[i] = 0x20 - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgConsumerModificationResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) + n += 1 + l + sovTx(uint64(l)) + l = len(m.ConsumerRedistributionFraction) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MsgConsumerModificationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgConsumerModificationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ + if m.BlocksPerDistributionTransmission != 0 { + n += 1 + sovTx(uint64(m.BlocksPerDistributionTransmission)) } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgAssignConsumerKey) Size() (n int) { - if m == nil { - return 0 + if m.HistoricalEntries != 0 { + n += 1 + sovTx(uint64(m.HistoricalEntries)) } - var l int - _ = l - l = len(m.ConsumerId) + l = len(m.DistributionTransmissionChannel) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ProviderAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.Top_N != 0 { + n += 1 + sovTx(uint64(m.Top_N)) } - l = len(m.ConsumerKey) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.ValidatorsPowerCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.ValidatorSetCap != 0 { + n += 1 + sovTx(uint64(m.ValidatorSetCap)) } - return n -} - -func (m *MsgAssignConsumerKeyResponse) Size() (n int) { - if m == nil { - return 0 + if len(m.Allowlist) > 0 { + for _, s := range m.Allowlist { + l = len(s) + n += 2 + l + sovTx(uint64(l)) + } } - var l int - _ = l - return n -} - -func (m *MsgSubmitConsumerMisbehaviour) Size() (n int) { - if m == nil { - return 0 + if len(m.Denylist) > 0 { + for _, s := range m.Denylist { + l = len(s) + n += 2 + l + sovTx(uint64(l)) + } } - var l int - _ = l - l = len(m.Submitter) + l = len(m.Authority) if l > 0 { - n += 1 + l + sovTx(uint64(l)) + n += 2 + l + sovTx(uint64(l)) } - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.MinStake != 0 { + n += 2 + sovTx(uint64(m.MinStake)) } - if m.Misbehaviour != nil { - l = m.Misbehaviour.Size() - n += 1 + l + sovTx(uint64(l)) + if m.AllowInactiveVals { + n += 3 } return n } -func (m *MsgSubmitConsumerMisbehaviourResponse) Size() (n int) { +func (m *MsgConsumerAdditionResponse) Size() (n int) { if m == nil { return 0 } @@ -4189,56 +3832,26 @@ func (m *MsgSubmitConsumerMisbehaviourResponse) Size() (n int) { return n } -func (m *MsgSubmitConsumerDoubleVoting) Size() (n int) { +func (m *MsgConsumerRemoval) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Submitter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ConsumerId) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.DuplicateVoteEvidence != nil { - l = m.DuplicateVoteEvidence.Size() - n += 1 + l + sovTx(uint64(l)) - } - if m.InfractionBlockHeader != nil { - l = m.InfractionBlockHeader.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitConsumerDoubleVotingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) + n += 1 + l + sovTx(uint64(l)) l = len(m.Authority) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) return n } -func (m *MsgUpdateParamsResponse) Size() (n int) { +func (m *MsgConsumerRemovalResponse) Size() (n int) { if m == nil { return 0 } @@ -4315,7 +3928,7 @@ func (m *MsgOptIn) Size() (n int) { } var l int _ = l - l = len(m.ConsumerId) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -4331,6 +3944,10 @@ func (m *MsgOptIn) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -4349,7 +3966,7 @@ func (m *MsgOptOut) Size() (n int) { } var l int _ = l - l = len(m.ConsumerId) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -4361,6 +3978,10 @@ func (m *MsgOptOut) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -4383,7 +4004,7 @@ func (m *MsgSetConsumerCommissionRate) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ConsumerId) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -4393,6 +4014,10 @@ func (m *MsgSetConsumerCommissionRate) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -4405,34 +4030,21 @@ func (m *MsgSetConsumerCommissionRateResponse) Size() (n int) { return n } -func (m *MsgUpdateConsumer) Size() (n int) { +func (m *MsgConsumerModification) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Authority) + l = len(m.Title) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ConsumerId) + l = len(m.Description) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.UpdateRecord != nil { - l = m.UpdateRecord.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *ConsumerUpdateRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OwnerAddress) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -4457,6 +4069,10 @@ func (m *ConsumerUpdateRecord) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } if m.MinStake != 0 { n += 1 + sovTx(uint64(m.MinStake)) } @@ -4466,1145 +4082,106 @@ func (m *ConsumerUpdateRecord) Size() (n int) { return n } -func (m *MsgUpdateConsumerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgRegisterConsumer) Size() (n int) { +func (m *MsgConsumerModificationResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.RegistrationRecord != nil { - l = m.RegistrationRecord.Size() - n += 1 + l + sovTx(uint64(l)) - } return n } -func (m *ConsumerRegistrationRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRegisterConsumerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgInitializeConsumer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ConsumerId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.InitializationRecord != nil { - l = m.InitializationRecord.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *ConsumerInitializationRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.InitialHeight.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.GenesisHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.BinaryHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) - n += 1 + l + sovTx(uint64(l)) - l = len(m.ConsumerRedistributionFraction) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.BlocksPerDistributionTransmission != 0 { - n += 1 + sovTx(uint64(m.BlocksPerDistributionTransmission)) - } - if m.HistoricalEntries != 0 { - n += 1 + sovTx(uint64(m.HistoricalEntries)) - } - l = len(m.DistributionTransmissionChannel) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgInitializeConsumerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgConsumerAddition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.InitialHeight.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.GenesisHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.BinaryHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) - n += 1 + l + sovTx(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) - n += 1 + l + sovTx(uint64(l)) - l = len(m.ConsumerRedistributionFraction) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.BlocksPerDistributionTransmission != 0 { - n += 1 + sovTx(uint64(m.BlocksPerDistributionTransmission)) - } - if m.HistoricalEntries != 0 { - n += 1 + sovTx(uint64(m.HistoricalEntries)) - } - l = len(m.DistributionTransmissionChannel) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Top_N != 0 { - n += 1 + sovTx(uint64(m.Top_N)) - } - if m.ValidatorsPowerCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) - } - if m.ValidatorSetCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorSetCap)) - } - if len(m.Allowlist) > 0 { - for _, s := range m.Allowlist { - l = len(s) - n += 2 + l + sovTx(uint64(l)) - } - } - if len(m.Denylist) > 0 { - for _, s := range m.Denylist { - l = len(s) - n += 2 + l + sovTx(uint64(l)) - } - } - l = len(m.Authority) - if l > 0 { - n += 2 + l + sovTx(uint64(l)) - } - if m.MinStake != 0 { - n += 2 + sovTx(uint64(m.MinStake)) - } - if m.AllowInactiveVals { - n += 3 - } - return n -} - -func (m *MsgConsumerAdditionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgConsumerRemoval) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StopTime) - n += 1 + l + sovTx(uint64(l)) - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgConsumerRemovalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgConsumerModification) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Top_N != 0 { - n += 1 + sovTx(uint64(m.Top_N)) - } - if m.ValidatorsPowerCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorsPowerCap)) - } - if m.ValidatorSetCap != 0 { - n += 1 + sovTx(uint64(m.ValidatorSetCap)) - } - if len(m.Allowlist) > 0 { - for _, s := range m.Allowlist { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.Denylist) > 0 { - for _, s := range m.Denylist { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgConsumerModificationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgAssignConsumerKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAssignConsumerKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Submitter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Misbehaviour == nil { - m.Misbehaviour = &_07_tendermint.Misbehaviour{} - } - if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Submitter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DuplicateVoteEvidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DuplicateVoteEvidence == nil { - m.DuplicateVoteEvidence = &types.DuplicateVoteEvidence{} - } - if err := m.DuplicateVoteEvidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InfractionBlockHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.InfractionBlockHeader == nil { - m.InfractionBlockHeader = &_07_tendermint.Header{} - } - if err := m.InfractionBlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } +func (m *MsgCreateConsumer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.InitializationParameters != nil { + l = m.InitializationParameters.Size() + n += 1 + l + sovTx(uint64(l)) } + if m.PowerShapingParameters != nil { + l = m.PowerShapingParameters.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *MsgCreateConsumerResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n } -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + +func (m *MsgUpdateConsumer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.InitializationParameters != nil { + l = m.InitializationParameters.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.PowerShapingParameters != nil { + l = m.PowerShapingParameters.Size() + n += 1 + l + sovTx(uint64(l)) } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF +func (m *MsgUpdateConsumerResponse) Size() (n int) { + if m == nil { + return 0 } - return nil + var l int + _ = l + return n } -func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAssignConsumerKey) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5627,15 +4204,15 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveConsumer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgAssignConsumerKey: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgAssignConsumerKey: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5663,44 +4240,11 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5725,114 +4269,14 @@ func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { if postIndex < 0 { return ErrInvalidLengthTx } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveConsumerResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if postIndex > l { + return io.ErrUnexpectedEOF } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgChangeRewardDenoms: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeRewardDenoms: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomsToAdd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5860,11 +4304,11 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DenomsToAdd = append(m.DenomsToAdd, string(dAtA[iNdEx:postIndex])) + m.ConsumerKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomsToRemove", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5892,11 +4336,11 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DenomsToRemove = append(m.DenomsToRemove, string(dAtA[iNdEx:postIndex])) + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5924,7 +4368,7 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5947,7 +4391,7 @@ func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5970,10 +4414,10 @@ func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgAssignConsumerKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -5997,7 +4441,7 @@ func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptIn) Unmarshal(dAtA []byte) error { +func (m *MsgSubmitConsumerMisbehaviour) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6020,15 +4464,15 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptIn: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptIn: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6056,13 +4500,13 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.Submitter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6072,59 +4516,31 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx + if m.Misbehaviour == nil { + m.Misbehaviour = &_07_tendermint.Misbehaviour{} } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.ConsumerKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6152,7 +4568,7 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6175,7 +4591,7 @@ func (m *MsgOptIn) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSubmitConsumerMisbehaviourResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6198,10 +4614,10 @@ func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptInResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptInResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSubmitConsumerMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -6225,7 +4641,7 @@ func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptOut) Unmarshal(dAtA []byte) error { +func (m *MsgSubmitConsumerDoubleVoting) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6248,15 +4664,15 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptOut: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptOut: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVoting: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Submitter", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6284,13 +4700,13 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.Submitter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DuplicateVoteEvidence", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6300,27 +4716,67 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) + if m.DuplicateVoteEvidence == nil { + m.DuplicateVoteEvidence = &types.DuplicateVoteEvidence{} + } + if err := m.DuplicateVoteEvidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InfractionBlockHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InfractionBlockHeader == nil { + m.InfractionBlockHeader = &_07_tendermint.Header{} + } + if err := m.InfractionBlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6348,7 +4804,7 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6371,7 +4827,7 @@ func (m *MsgOptOut) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSubmitConsumerDoubleVotingResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6394,10 +4850,10 @@ func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgOptOutResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgOptOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSubmitConsumerDoubleVotingResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -6421,7 +4877,7 @@ func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6444,79 +4900,15 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParams: 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 stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProviderAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6542,17 +4934,15 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { return ErrInvalidLengthTx } if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + return io.ErrUnexpectedEOF } + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6562,23 +4952,24 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -6601,7 +4992,7 @@ func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6624,10 +5015,10 @@ func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -6651,7 +5042,7 @@ func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6674,15 +5065,15 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateConsumer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerAddition: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerAddition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6710,13 +5101,13 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -6726,27 +5117,96 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateRecord", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) + if m.GenesisHash == nil { + m.GenesisHash = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) + if m.BinaryHash == nil { + m.BinaryHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6773,66 +5233,182 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.UpdateRecord == nil { - m.UpdateRecord = &ConsumerUpdateRecord{} + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF } - if err := m.UpdateRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthTx } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx } - if iNdEx >= l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConsumerUpdateRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsumerUpdateRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.BlocksPerDistributionTransmission = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) + } + m.HistoricalEntries = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HistoricalEntries |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6860,9 +5436,9 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } @@ -6881,7 +5457,7 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { break } } - case 3: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } @@ -6900,7 +5476,7 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { break } } - case 4: + case 15: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) } @@ -6919,7 +5495,7 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { break } } - case 5: + case 16: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } @@ -6951,7 +5527,7 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 6: + case 17: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } @@ -6983,7 +5559,39 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 7: + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 19: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) } @@ -7002,7 +5610,7 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { break } } - case 8: + case 20: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) } @@ -7043,7 +5651,7 @@ func (m *ConsumerUpdateRecord) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7066,10 +5674,10 @@ func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateConsumerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerAdditionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerAdditionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -7093,7 +5701,7 @@ func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7116,15 +5724,15 @@ func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterConsumer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerRemoval: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerRemoval: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7152,11 +5760,11 @@ func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegistrationRecord", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7183,13 +5791,42 @@ func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RegistrationRecord == nil { - m.RegistrationRecord = &ConsumerRegistrationRecord{} - } - if err := m.RegistrationRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -7211,7 +5848,7 @@ func (m *MsgRegisterConsumer) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerRemovalResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7234,47 +5871,65 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConsumerRegistrationRecord: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerRemovalResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConsumerRegistrationRecord: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerRemovalResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRemoveConsumer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: + 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: MsgRemoveConsumer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7302,13 +5957,13 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -7318,27 +5973,28 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Metadata = string(dAtA[iNdEx:postIndex]) + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7366,7 +6022,7 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7389,7 +6045,7 @@ func (m *ConsumerRegistrationRecord) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterConsumerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRemoveConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7412,44 +6068,12 @@ func (m *MsgRegisterConsumerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterConsumerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRemoveConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRemoveConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -7471,7 +6095,7 @@ func (m *MsgRegisterConsumerResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { +func (m *MsgChangeRewardDenoms) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7494,15 +6118,15 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgInitializeConsumer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgChangeRewardDenoms: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInitializeConsumer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgChangeRewardDenoms: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DenomsToAdd", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7530,11 +6154,11 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.DenomsToAdd = append(m.DenomsToAdd, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DenomsToRemove", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7562,13 +6186,13 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerId = string(dAtA[iNdEx:postIndex]) + m.DenomsToRemove = append(m.DenomsToRemove, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitializationRecord", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -7578,27 +6202,23 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.InitializationRecord == nil { - m.InitializationRecord = &ConsumerInitializationRecord{} - } - if err := m.InitializationRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7621,7 +6241,7 @@ func (m *MsgInitializeConsumer) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { +func (m *MsgChangeRewardDenomsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7644,184 +6264,67 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConsumerInitializationRecord: wiretype end group for non-group") + return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConsumerInitializationRecord: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgChangeRewardDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) - if m.GenesisHash == nil { - m.GenesisHash = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) - if m.BinaryHash == nil { - m.BinaryHash = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgOptIn) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 6: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgOptIn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgOptIn: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -7831,30 +6334,29 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -7864,28 +6366,27 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerKey", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7913,13 +6414,13 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) + m.ConsumerKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - m.BlocksPerDistributionTransmission = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -7929,33 +6430,27 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx } - m.HistoricalEntries = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HistoricalEntries |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx } - case 11: + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7983,7 +6478,7 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -8006,7 +6501,7 @@ func (m *ConsumerInitializationRecord) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgInitializeConsumerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgOptInResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8029,10 +6524,10 @@ func (m *MsgInitializeConsumerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgInitializeConsumerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOptInResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInitializeConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOptInResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -8056,7 +6551,7 @@ func (m *MsgInitializeConsumerResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { +func (m *MsgOptOut) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8079,10 +6574,10 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerAddition: wiretype end group for non-group") + return fmt.Errorf("proto: MsgOptOut: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerAddition: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgOptOut: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -8119,9 +6614,9 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8131,30 +6626,29 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenesisHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8164,31 +6658,161 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.GenesisHash = append(m.GenesisHash[:0], dAtA[iNdEx:postIndex]...) - if m.GenesisHash == nil { - m.GenesisHash = []byte{} - } + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BinaryHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgOptOutResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgOptOutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgOptOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetConsumerCommissionRate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetConsumerCommissionRate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetConsumerCommissionRate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderAddr", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8198,31 +6822,29 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.BinaryHash = append(m.BinaryHash[:0], dAtA[iNdEx:postIndex]...) - if m.BinaryHash == nil { - m.BinaryHash = []byte{} - } + m.ProviderAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpawnTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8232,30 +6854,29 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8265,30 +6886,31 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CcvTimeoutPeriod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8298,30 +6920,29 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransferTimeoutPeriod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8331,28 +6952,127 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 9: + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetConsumerCommissionRateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetConsumerCommissionRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgConsumerModification: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConsumerModification: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRedistributionFraction", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8380,13 +7100,13 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerRedistributionFraction = string(dAtA[iNdEx:postIndex]) + m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerDistributionTransmission", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - m.BlocksPerDistributionTransmission = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8396,33 +7116,27 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.BlocksPerDistributionTransmission |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistoricalEntries", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx } - m.HistoricalEntries = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HistoricalEntries |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx } - case 12: + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistributionTransmissionChannel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8450,9 +7164,9 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DistributionTransmissionChannel = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 13: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } @@ -8471,7 +7185,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { break } } - case 14: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } @@ -8490,7 +7204,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { break } } - case 15: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) } @@ -8509,7 +7223,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { break } } - case 16: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } @@ -8541,7 +7255,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 17: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } @@ -8573,7 +7287,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 18: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } @@ -8605,7 +7319,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 19: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) } @@ -8624,7 +7338,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { break } } - case 20: + case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) } @@ -8665,7 +7379,7 @@ func (m *MsgConsumerAddition) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { +func (m *MsgConsumerModificationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8688,10 +7402,10 @@ func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerAdditionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgConsumerModificationResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerAdditionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgConsumerModificationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -8715,7 +7429,7 @@ func (m *MsgConsumerAdditionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { +func (m *MsgCreateConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8738,13 +7452,45 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerRemoval: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerRemoval: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } @@ -8776,9 +7522,9 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { } m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StopTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8805,15 +7551,18 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StopTime, dAtA[iNdEx:postIndex]); err != nil { + if m.Metadata == nil { + m.Metadata = &ConsumerMetadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitializationParameters", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8823,23 +7572,63 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + if m.InitializationParameters == nil { + m.InitializationParameters = &ConsumerInitializationParameters{} + } + if err := m.InitializationParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PowerShapingParameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PowerShapingParameters == nil { + m.PowerShapingParameters = &PowerShapingParameters{} + } + if err := m.PowerShapingParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -8862,7 +7651,7 @@ func (m *MsgConsumerRemoval) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerRemovalResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreateConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8885,12 +7674,44 @@ func (m *MsgConsumerRemovalResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerRemovalResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerRemovalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -8912,7 +7733,7 @@ func (m *MsgConsumerRemovalResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8935,15 +7756,15 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerModification: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateConsumer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerModification: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateConsumer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8971,11 +7792,11 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Title = string(dAtA[iNdEx:postIndex]) + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9003,11 +7824,11 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.ConsumerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9035,70 +7856,13 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Top_N |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) - } - m.ValidatorsPowerCap = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorsPowerCap |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) - } - m.ValidatorSetCap = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorSetCap |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -9108,29 +7872,33 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) + if m.Metadata == nil { + m.Metadata = &ConsumerMetadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 8: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InitializationParameters", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -9140,29 +7908,33 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) + if m.InitializationParameters == nil { + m.InitializationParameters = &ConsumerInitializationParameters{} + } + if err := m.InitializationParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 9: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PowerShapingParameters", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -9172,23 +7944,27 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + if m.PowerShapingParameters == nil { + m.PowerShapingParameters = &PowerShapingParameters{} + } + if err := m.PowerShapingParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -9211,7 +7987,7 @@ func (m *MsgConsumerModification) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgConsumerModificationResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateConsumerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9234,10 +8010,10 @@ func (m *MsgConsumerModificationResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgConsumerModificationResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateConsumerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgConsumerModificationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateConsumerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From 06081be43489512a85e67984a3230cd75fb0a7ef Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 20 Aug 2024 13:42:53 +0200 Subject: [PATCH 29/41] cleaned up slightly a few things (mostly committing & pushing) so people can pick up the latest changes --- .../ccv/provider/v1/provider.proto | 14 +- .../ccv/provider/v1/tx.proto | 2 +- tests/integration/distribution.go | 10 +- tests/integration/setup.go | 2 +- x/ccv/provider/client/cli/query.go | 2 +- .../provider/keeper/consumer_equivocation.go | 4 +- x/ccv/provider/keeper/grpc_query.go | 27 +- x/ccv/provider/keeper/grpc_query_test.go | 4 +- x/ccv/provider/keeper/hooks.go | 1 + x/ccv/provider/keeper/keeper.go | 20 +- x/ccv/provider/keeper/msg_server.go | 45 +-- x/ccv/provider/keeper/msg_server_test.go | 4 +- .../keeper/partial_set_security_test.go | 4 +- x/ccv/provider/keeper/permissionless.go | 48 ++- x/ccv/provider/keeper/proposal.go | 14 +- x/ccv/provider/types/errors.go | 2 +- x/ccv/provider/types/msg.go | 6 +- x/ccv/provider/types/provider.pb.go | 50 ++-- x/ccv/provider/types/tx.pb.go | 277 +++++++++--------- 19 files changed, 287 insertions(+), 249 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 7cea738272..9ab6f79e19 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -442,22 +442,22 @@ message PowerShapingParameters { // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - uint32 top_N = 2; + uint32 top_N = 1; // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - uint32 validators_power_cap = 3; + uint32 validators_power_cap = 2; // Corresponds to the maximum number of validators that can validate a consumer chain. // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - uint32 validator_set_cap = 4; + uint32 validator_set_cap = 3; // corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate the consumer chain - repeated string allowlist = 6; + repeated string allowlist = 4; // corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain - repeated string denylist = 7; + repeated string denylist = 5; // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - uint64 min_stake = 8; + uint64 min_stake = 6; // Corresponds to whether inactive validators are allowed to validate the consumer chain. - bool allow_inactive_vals = 9; + bool allow_inactive_vals = 7; } diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 980c462cc8..6e780d903d 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -393,7 +393,7 @@ message MsgUpdateConsumer { string consumer_id = 2; // the new owner of the consumer when updated - string owner_address = 3; + string new_owner_address = 3; // the metadata of the consumer when updated ConsumerMetadata metadata = 4; diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 4c8b9fccf7..316b343f0a 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -859,7 +859,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { expAllocated: nil, }, { - name: "consumerId valset is empty - total voting power is zero", + name: "consumer valset is empty - total voting power is zero", tokens: sdk.DecCoins{sdk.NewDecCoin(sdk.DefaultBondDenom, math.NewInt(100_000))}, rate: math.LegacyZeroDec(), expAllocated: nil, @@ -884,11 +884,11 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { s.Run(tc.name, func() { ctx, _ := s.providerCtx().CacheContext() - // increase the block height so validators are eligible for consumerId rewards (see `IsEligibleForConsumerRewards`) + // increase the block height so validators are eligible for consumer rewards (see `IsEligibleForConsumerRewards`) ctx = ctx.WithBlockHeight(providerKeeper.GetNumberOfEpochsToStartReceivingRewards(ctx)*providerKeeper.GetBlocksPerEpoch(ctx) + ctx.BlockHeight()) - // change the consumerId valset + // change the consumer valset consuVals, err := providerKeeper.GetConsumerValSet(ctx, consumerId) s.Require().NoError(err) providerKeeper.DeleteConsumerValSet(ctx, consumerId) @@ -896,7 +896,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { consuVals, err = providerKeeper.GetConsumerValSet(ctx, consumerId) s.Require().NoError(err) - // set the same consumerId commission rate for all consumerId validators + // set the same consumer commission rate for all consumer validators for _, v := range consuVals { provAddr := providertypes.NewProviderConsAddress(sdk.ConsAddress(v.ProviderConsAddr)) err := providerKeeper.SetConsumerCommissionRate( @@ -949,7 +949,7 @@ func (s *CCVTestSuite) TestAllocateTokensToConsumerValidators() { s.Require().NoError(err) // check that the withdrawn coins is equal to the entire reward amount - // times the set consumerId commission rate + // times the set consumer commission rate commission := rewards.Rewards.MulDec(tc.rate) c, _ := commission.TruncateDecimal() s.Require().Equal(withdrawnCoins, c) diff --git a/tests/integration/setup.go b/tests/integration/setup.go index fa95d24eb5..20924e9b2e 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -284,7 +284,7 @@ func initConsumerChain( err = bundle.Path.EndpointA.UpdateClient() s.Require().NoError(err) - if consumerId == "2" { //icstestingutils.FirstConsumerId { + if consumerId == "2" { // Support tests that were written before multiple consumers were supported. firstBundle := s.getFirstBundle() s.consumerApp = firstBundle.App diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index b58c230612..34d715583c 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -601,7 +601,7 @@ func CmdBlocksUntilNextEpoch() *cobra.Command { func CmdConsumerIdFromClientId() *cobra.Command { cmd := &cobra.Command{ Use: "consumer-id-from-client-id [client-id]", - Short: "Query the the consumer id of the chain associated with the provided client id", + Short: "Query the consumer id of the chain associated with the provided client id", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) diff --git a/x/ccv/provider/keeper/consumer_equivocation.go b/x/ccv/provider/keeper/consumer_equivocation.go index 1d4ff5e2e7..c4c307b167 100644 --- a/x/ccv/provider/keeper/consumer_equivocation.go +++ b/x/ccv/provider/keeper/consumer_equivocation.go @@ -305,7 +305,7 @@ func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehavio if err != nil { return err } else if consumerChainId != chainId { - return fmt.Errorf("incorrect misbehaviour for a different chain id (%s) than that of the consumer chain %s (consumerId): %s", + return fmt.Errorf("incorrect misbehaviour for a different chain id (%s) than that of the consumer chain %s (consumerId: %s)", chainId, consumerChainId, consumerId) @@ -314,7 +314,7 @@ func (k Keeper) CheckMisbehaviour(ctx sdk.Context, consumerId string, misbehavio // check that the misbehaviour is for an ICS consumer chain clientId, found := k.GetConsumerClientId(ctx, consumerId) if !found { - return fmt.Errorf("incorrect misbehaviour with conflicting headers from a non-existent consumer chain (consumerId): %s", consumerId) + return fmt.Errorf("incorrect misbehaviour with conflicting headers from a non-existent consumer chain (consumerId: %s)", consumerId) } else if misbehaviour.ClientId != clientId { return fmt.Errorf("incorrect misbehaviour: expected client ID for consumer chain with id %s is %s got %s", consumerId, diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 1619c253d2..4345e91d74 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -23,6 +23,8 @@ func (k Keeper) QueryConsumerGenesis(c context.Context, req *types.QueryConsumer if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") + } else if req.ChainId != "" { + return nil, status.Errorf(codes.InvalidArgument, "ChainId has been deprecated. Use ConsumerId instead.") } consumerId := req.ConsumerId @@ -139,7 +141,9 @@ func (k Keeper) QueryConsumerChainStops(goCtx context.Context, req *types.QueryC func (k Keeper) QueryValidatorConsumerAddr(goCtx context.Context, req *types.QueryValidatorConsumerAddrRequest) (*types.QueryValidatorConsumerAddrResponse, error) { if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } else if req.ChainId != "" { + return nil, status.Errorf(codes.InvalidArgument, "ChainId has been deprecated. Use ConsumerId instead.") } ctx := sdk.UnwrapSDKContext(goCtx) @@ -172,7 +176,9 @@ func (k Keeper) QueryValidatorConsumerAddr(goCtx context.Context, req *types.Que func (k Keeper) QueryValidatorProviderAddr(goCtx context.Context, req *types.QueryValidatorProviderAddrRequest) (*types.QueryValidatorProviderAddrResponse, error) { if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } else if req.ChainId != "" { + return nil, status.Errorf(codes.InvalidArgument, "ChainId has been deprecated. Use ConsumerId instead.") } ctx := sdk.UnwrapSDKContext(goCtx) @@ -241,7 +247,9 @@ func (k Keeper) QueryProposedConsumerChainIDs(goCtx context.Context, req *types. func (k Keeper) QueryAllPairsValConAddrByConsumerChainID(goCtx context.Context, req *types.QueryAllPairsValConAddrByConsumerChainIDRequest) (*types.QueryAllPairsValConAddrByConsumerChainIDResponse, error) { if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } else if req.ChainId != "" { + return nil, status.Errorf(codes.InvalidArgument, "ChainId has been deprecated. Use ConsumerId instead.") } consumerId := req.ConsumerId @@ -286,7 +294,9 @@ func (k Keeper) QueryParams(goCtx context.Context, req *types.QueryParamsRequest // 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") + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } else if req.ChainId != "" { + return nil, status.Errorf(codes.InvalidArgument, "ChainId has been deprecated. Use ConsumerId instead.") } consumerId := req.ConsumerId @@ -313,9 +323,10 @@ func (k Keeper) QueryConsumerChainOptedInValidators(goCtx context.Context, req * // QueryConsumerValidators returns all validators that are consumer validators in a given consumer chain func (k Keeper) QueryConsumerValidators(goCtx context.Context, req *types.QueryConsumerValidatorsRequest) (*types.QueryConsumerValidatorsResponse, error) { if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } else if req.ChainId != "" { + return nil, status.Errorf(codes.InvalidArgument, "ChainId has been deprecated. Use ConsumerId instead.") } - consumerId := req.ConsumerId if err := types.ValidateConsumerId(consumerId); err != nil { return nil, status.Error(codes.InvalidArgument, errorsmod.Wrap(types.ErrInvalidConsumerId, consumerId).Error()) @@ -449,7 +460,9 @@ func (k Keeper) hasToValidate( // 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") + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } else if req.ChainId != "" { + return nil, status.Errorf(codes.InvalidArgument, "ChainId has been deprecated. Use ConsumerId instead.") } consumerId := req.ConsumerId diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index 1473138fba..3e589fe21c 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -45,11 +45,11 @@ func TestQueryAllPairsValConAddrByConsumerChainID(t *testing.T) { _, err = pk.QueryAllPairsValConAddrByConsumerChainID(ctx, nil) require.Error(t, err) - // Request with chainId is empty + // Request with empty consumer id _, err = pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{}) require.Error(t, err) - // Request with chainId is invalid + // Request with invalid consumer id response, err := pk.QueryAllPairsValConAddrByConsumerChainID(ctx, &types.QueryAllPairsValConAddrByConsumerChainIDRequest{ConsumerId: "invalidConsumerId"}) require.Error(t, err) diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index 1d298fc2cf..aa49adc81e 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -109,6 +109,7 @@ func (h Hooks) BeforeTokenizeShareRecordRemoved(_ context.Context, _ uint64) err // that maps the proposal ID to the consumer chain ID. func (h Hooks) AfterProposalSubmission(goCtx context.Context, proposalID uint64) error { ctx := sdk.UnwrapSDKContext(goCtx) + if _, ok := h.GetConsumerAdditionFromProp(ctx, proposalID); ok { consumerId := h.k.FetchAndIncrementConsumerId(ctx) h.k.SetProposedConsumerChain(ctx, consumerId, proposalID) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 0d11f7ae12..398dcbca7d 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -761,8 +761,8 @@ func (k Keeper) GetTopN( ctx sdk.Context, consumerId string, ) uint32 { - updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) - return updateRecord.Top_N + powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + return powerShapingParameters.Top_N } // IsTopN returns true if chain with `consumerId` is a Top-N chain (i.e., enforces at least one validator to validate chain `consumerId`) @@ -916,8 +916,8 @@ func (k Keeper) GetValidatorsPowerCap( ctx sdk.Context, consumerId string, ) uint32 { - updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) - return updateRecord.ValidatorsPowerCap + powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + return powerShapingParameters.ValidatorsPowerCap } // GetValidatorSetCap returns `(c, true)` if chain `consumerId` has validator-set cap `c` associated with it, and (0, false) otherwise @@ -925,8 +925,8 @@ func (k Keeper) GetValidatorSetCap( ctx sdk.Context, consumerId string, ) uint32 { - updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) - return updateRecord.ValidatorSetCap + powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + return powerShapingParameters.ValidatorSetCap } // SetAllowlist allowlists validator with `providerAddr` address on chain `consumerId` @@ -1100,8 +1100,8 @@ func (k Keeper) GetMinStake( ctx sdk.Context, consumerId string, ) uint64 { - updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) - return updateRecord.MinStake + powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + return powerShapingParameters.MinStake } // AllowsInactiveValidators returns whether inactive validators are allowed to validate @@ -1110,8 +1110,8 @@ func (k Keeper) AllowsInactiveValidators( ctx sdk.Context, consumerId string, ) bool { - updateRecord, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) - return updateRecord.AllowInactiveVals + powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + return powerShapingParameters.AllowInactiveVals } func (k Keeper) UnbondingCanComplete(ctx sdk.Context, id uint64) error { diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index c296a06f6c..a4eb7e1338 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -310,36 +310,11 @@ func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateCon ctx := sdk.UnwrapSDKContext(goCtx) initGas := ctx.GasMeter().GasConsumed() - consumerId := k.Keeper.FetchAndIncrementConsumerId(ctx) - - k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.Signer) - k.Keeper.SetConsumerChainId(ctx, consumerId, msg.ChainId) - - err := k.Keeper.SetConsumerMetadata(ctx, consumerId, *msg.Metadata) + consumerId, err := k.SetUpConsumer(ctx, msg.Signer, msg.ChainId, *msg.Metadata, *msg.InitializationParameters, *msg.PowerShapingParameters) if err != nil { return &types.MsgCreateConsumerResponse{}, err } - - err = k.Keeper.SetConsumerInitializationParameters(ctx, consumerId, *msg.InitializationParameters) - if err != nil { - return &types.MsgCreateConsumerResponse{}, err - } - - err = k.Keeper.SetConsumerPowerShapingParameters(ctx, consumerId, *msg.PowerShapingParameters) - if err != nil { - return &types.MsgCreateConsumerResponse{}, err - } - - k.Keeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, msg.InitializationParameters.SpawnTime) - - k.Keeper.SetConsumerPhase(ctx, consumerId, Initialized) - - //// if this is not the first initialization, remove the consumer id from the old spawn time - //record, err := k.Keeper.GetConsumerInitializationParameters(ctx, consumerId) - //if err == nil { - // previousSpawnTime := record.SpawnTime - // k.Keeper.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) - //} + k.PrepareConsumerForLaunch(ctx, consumerId, msg.InitializationParameters.SpawnTime) gasAfter := ctx.GasMeter().GasConsumed() ctx.GasMeter().ConsumeGas(gasAfter-initGas, "creating a chain has an additional cost during spawn time, "+ @@ -358,11 +333,21 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon // TODO (PERMISSIONLESS): fix the error message return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidConsumerId, "cannot retrieve owner address %s", ownerAddress) } + + if msg.PowerShapingParameters.Top_N > 0 && msg.Signer != k.GetAuthority() { + // TODO (PERMISSIONLESS): fix the error message + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidPhase, "an update to a Top N chain can only be done through a governance proposal") + } + if k.GetAuthority() == msg.Signer { // message is executed as part of governance proposal and hence we change the owner address - // to be the one of the module account address (e.g., a gov proposal with a single `MsgUpdateConsumer` might have + // to be the one of the gov module account address (e.g., a gov proposal with a single `MsgUpdateConsumer` might have // led to this) - k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, k.GetAuthority()) + if msg.PowerShapingParameters.Top_N == 0 { + k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) + } else { + k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, k.GetAuthority()) + } } else if msg.Signer != ownerAddress { return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Signer) } @@ -374,7 +359,7 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon } func (k msgServer) ConsumerAddition(_ context.Context, _ *types.MsgConsumerAddition) (*types.MsgConsumerAdditionResponse, error) { - return nil, fmt.Errorf("`MsgConsumerAddition` is deprecated. Use `MsgCreateConsumer`.") + return nil, fmt.Errorf("`MsgConsumerAddition` is deprecated. Use `MsgCreateConsumer`") } func (k msgServer) ConsumerModification(_ context.Context, _ *types.MsgConsumerModification) (*types.MsgConsumerModificationResponse, error) { diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go index d072969d0b..473ab8f1bf 100644 --- a/x/ccv/provider/keeper/msg_server_test.go +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -84,7 +84,7 @@ func TestUpdateConsumer(t *testing.T) { expectedMinStake := uint64(0) expectedAllowInactiveValidators := false - updateRecord := providertypes.PowerShapingParameters{ + powerShapingParameters := providertypes.PowerShapingParameters{ Top_N: expectedTopN, ValidatorsPowerCap: expectedValidatorsPowerCap, ValidatorSetCap: expectedValidatorSetCap, @@ -95,7 +95,7 @@ func TestUpdateConsumer(t *testing.T) { } providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) - providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, updateRecord) + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, powerShapingParameters) err := providerKeeper.UpdateConsumer(ctx, consumerId) require.NoError(t, err) diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index fdfa7d554e..aa6f7e3fcd 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -83,7 +83,7 @@ func TestHandleOptInWithConsumerKey(t *testing.T) { providerKeeper.SetProposedConsumerChain(ctx, "consumerId", 1) // create a sample consumer key to assign to the `providerAddr` validator - // on the consumer chain with id `consumerId` + // on the consumer chain with `consumerId` consumerKey := "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}" expectedConsumerPubKey, err := providerKeeper.ParseConsumerKey(consumerKey) require.NoError(t, err) @@ -93,7 +93,7 @@ func TestHandleOptInWithConsumerKey(t *testing.T) { err = providerKeeper.HandleOptIn(ctx, "consumerId", providerAddr, consumerKey) require.NoError(t, err) - // assert that the consumeKey was assigned to `providerAddr` validator on chain with id `consumerId` + // assert that the consumeKey was assigned to `providerAddr` validator on chain with `consumerId` actualConsumerPubKey, found := providerKeeper.GetValidatorConsumerPubKey(ctx, "consumerId", providerAddr) require.True(t, found) require.Equal(t, expectedConsumerPubKey, actualConsumerPubKey) diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 83c306fb19..42d0dbc34f 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -21,12 +21,11 @@ const ( // Registered phase indicates the phase in which a consumer chain has been assigned a unique consumer id. This consumer // id can be used to interact with the consumer chain (e.g., when a validator opts in to a chain). A chain in this // phase cannot yet launch. It has to be initialized first. + Registered ConsumerPhase = iota // Initialized phase indicates the phase in which a consumer chain has set all the needed parameters to launch but // has not yet launched (e.g., because the `spawnTime` of the consumer chain has not yet been reached). - Initialized ConsumerPhase = iota - // TODO (PERMISSIONLESS) add this if the chain fails to launch - // Useful so we do not keep trying to launch failed chains - // FailedToLaunch phase indicates that the chain attempted but failed to launch (e.g., due to no validator opting in) + Initialized + // FailedToLaunch phase indicates that the chain attempted but failed to launch (e.g., due to no validator opting in). FailedToLaunch // Launched phase corresponds to the phase in which a consumer chain is running and consuming a subset of the validator // set of the provider. @@ -599,7 +598,7 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) if err != nil { // TODO (permissionless) -- not really an invalid update record - return errorsmod.Wrapf(types.ErrInvalidUpdateRecord, + return errorsmod.Wrapf(types.ErrInvalidPowerShapingParametersRecord, "did not find update record for chain: %s", consumerId) } @@ -723,3 +722,42 @@ func (k Keeper) IsValidatorOptedInToChainId(ctx sdk.Context, providerAddr types. } return "", false } + +func (k Keeper) SetUpConsumer(ctx sdk.Context, signer string, chainId string, + metadata types.ConsumerMetadata, initializationParameters types.ConsumerInitializationParameters, + powerShapingParameters types.PowerShapingParameters, +) (string, error) { + consumerId := k.FetchAndIncrementConsumerId(ctx) + + k.SetConsumerOwnerAddress(ctx, consumerId, signer) + k.SetConsumerChainId(ctx, consumerId, chainId) + + err := k.SetConsumerMetadata(ctx, consumerId, metadata) + if err != nil { + return "", err + } + + err = k.SetConsumerInitializationParameters(ctx, consumerId, initializationParameters) + if err != nil { + return "", err + } + + err = k.SetConsumerPowerShapingParameters(ctx, consumerId, powerShapingParameters) + if err != nil { + return "", err + } + + k.SetConsumerPhase(ctx, consumerId, Initialized) + return consumerId, nil +} + +func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, spawnTime time.Time) { + // if this is not the first initialization, remove the consumer id from the old spawn time + initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId) + if err == nil { + previousSpawnTime := initializationParameters.SpawnTime + k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) + } + + k.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, spawnTime) +} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 600950a8e3..e553e4a738 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -45,10 +45,9 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { phase, found := k.GetConsumerPhase(ctx, consumerId) if !found || phase != Initialized { return errorsmod.Wrapf(types.ErrInvalidPhase, - "cannot create client for consumer chain that is neither in the initialized phase: %s", consumerId) + "cannot create client for consumer chain that is not in the Created phase: %s", consumerId) } - // TODO (PERMISSIONLESS): make this a function ... GetChainId(consumerId) ... chainId, err := k.GetConsumerChainId(ctx, consumerId) if err != nil { return err @@ -190,9 +189,9 @@ func (k Keeper) MakeConsumerGenesis( "initialization record for consumer chain: %s is missing", consumerId) } - updateRecord, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) if err != nil { - updateRecord = types.PowerShapingParameters{ + powerShapingParameters = types.PowerShapingParameters{ Top_N: 0, ValidatorsPowerCap: 0, ValidatorSetCap: 0, @@ -233,7 +232,7 @@ func (k Keeper) MakeConsumerGenesis( return gen, nil, errorsmod.Wrapf(stakingtypes.ErrNoValidatorFound, "error getting last bonded validators: %s", err) } - if updateRecord.Top_N > 0 { + if powerShapingParameters.Top_N > 0 { // get the consensus active validators // we do not want to base the power calculation for the top N // on inactive validators, too, since the top N will be a percentage of the active set power @@ -244,7 +243,7 @@ func (k Keeper) MakeConsumerGenesis( } // in a Top-N chain, we automatically opt in all validators that belong to the top N - minPower, err := k.ComputeMinPowerInTopN(ctx, activeValidators, updateRecord.Top_N) + minPower, err := k.ComputeMinPowerInTopN(ctx, activeValidators, powerShapingParameters.Top_N) if err != nil { return gen, nil, err } @@ -335,7 +334,7 @@ func (k Keeper) GetPendingConsumerAdditionProp(ctx sdk.Context, spawnTime time.T // BeginBlockInit iterates over the initialized consumers chains and creates clients for chains // in which the spawn time has passed func (k Keeper) BeginBlockInit(ctx sdk.Context) { - // TODO (PERMISSIONLESS): we can parameterize the limit to 200 at a later stage + // TODO (PERMISSIONLESS): we can parameterize the limit for _, consumerId := range k.GetInitializedConsumersReadyToLaunch(ctx, 200) { record, err := k.GetConsumerInitializationParameters(ctx, consumerId) if err != nil { @@ -503,6 +502,7 @@ func (k Keeper) BeginBlockCCR(ctx sdk.Context) { } } +// TODO (PERMISSIONLESS): leaving commented out because it might be used for migration //// GetConsumerRemovalPropsToExecute iterates over the pending consumer removal proposals //// and returns an ordered list of consumer removal proposals to be executed, //// ie. consumer chains to be stopped and removed from the provider chain. diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 2d2a7b4a98..c238c05f8a 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -28,7 +28,7 @@ var ( ErrCannotOptOutFromTopN = errorsmod.Register(ModuleName, 20, "cannot opt out from a Top N chain") ErrNoUnconfirmedVSCPacket = errorsmod.Register(ModuleName, 21, "no unconfirmed vsc packet for this chain id") ErrInvalidConsumerModificationProposal = errorsmod.Register(ModuleName, 22, "invalid consumer modification proposal") - ErrInvalidUpdateRecord = errorsmod.Register(ModuleName, 23, "invalid consumer update record") + ErrInvalidPowerShapingParametersRecord = errorsmod.Register(ModuleName, 23, "invalid consumer update record") ErrBlankConsumerChainID = errorsmod.Register(ModuleName, 24, "consumer chain id must not be blank") ErrNoUnbondingTime = errorsmod.Register(ModuleName, 25, "provider unbonding time not found") ErrInvalidAddress = errorsmod.Register(ModuleName, 26, "invalid address") diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 102dfa0d81..7e842928e9 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -289,7 +289,7 @@ func NewMsgUpdateConsumer(signer string, consumerId string, ownerAddress string, return &MsgUpdateConsumer{ Signer: signer, ConsumerId: consumerId, - OwnerAddress: ownerAddress, + NewOwnerAddress: ownerAddress, Metadata: &metadata, InitializationParameters: &initializationParameters, PowerShapingParameters: &powerShapingParameters, @@ -310,10 +310,10 @@ func (msg MsgUpdateConsumer) ValidateBasic() error { return err } - // TODO (PERMISSIONLESS): validate update record + // TODO (PERMISSIONLESS): validate parameters and everything else err := ValidatePSSFeatures(msg.PowerShapingParameters.Top_N, msg.PowerShapingParameters.ValidatorsPowerCap) if err != nil { - return errorsmod.Wrapf(ErrInvalidUpdateRecord, "invalid PSS features: %s", err.Error()) + return errorsmod.Wrapf(ErrInvalidPowerShapingParametersRecord, "invalid power-shaping parameters: %s", err.Error()) } return nil diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 249ff07881..6b72d79283 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -1603,24 +1603,24 @@ type PowerShapingParameters struct { // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - Top_N uint32 `protobuf:"varint,2,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + Top_N uint32 `protobuf:"varint,1,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - ValidatorsPowerCap uint32 `protobuf:"varint,3,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + ValidatorsPowerCap uint32 `protobuf:"varint,2,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` // Corresponds to the maximum number of validators that can validate a consumer chain. // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - ValidatorSetCap uint32 `protobuf:"varint,4,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + ValidatorSetCap uint32 `protobuf:"varint,3,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` // corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate the consumer chain - Allowlist []string `protobuf:"bytes,6,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + Allowlist []string `protobuf:"bytes,4,rep,name=allowlist,proto3" json:"allowlist,omitempty"` // corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain - Denylist []string `protobuf:"bytes,7,rep,name=denylist,proto3" json:"denylist,omitempty"` + Denylist []string `protobuf:"bytes,5,rep,name=denylist,proto3" json:"denylist,omitempty"` // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - MinStake uint64 `protobuf:"varint,8,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` + MinStake uint64 `protobuf:"varint,6,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` // Corresponds to whether inactive validators are allowed to validate the consumer chain. - AllowInactiveVals bool `protobuf:"varint,9,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` + AllowInactiveVals bool `protobuf:"varint,7,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` } func (m *PowerShapingParameters) Reset() { *m = PowerShapingParameters{} } @@ -1861,13 +1861,13 @@ var fileDescriptor_f22ec409a72b7b72 = []byte{ 0xc9, 0x1b, 0x4f, 0xf1, 0xea, 0xde, 0x78, 0x66, 0xae, 0xfc, 0x8d, 0x67, 0xf6, 0x0d, 0xbd, 0xf1, 0xcc, 0xfd, 0x4f, 0xde, 0x78, 0x4a, 0x57, 0xfa, 0xc6, 0x53, 0x7e, 0xbd, 0x37, 0x1e, 0xf0, 0x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marshal() (dAtA []byte, err error) { @@ -3110,12 +3110,12 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x48 + dAtA[i] = 0x38 } if m.MinStake != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.MinStake)) i-- - dAtA[i] = 0x40 + dAtA[i] = 0x30 } if len(m.Denylist) > 0 { for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { @@ -3123,7 +3123,7 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Denylist[iNdEx]) i = encodeVarintProvider(dAtA, i, uint64(len(m.Denylist[iNdEx]))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x2a } } if len(m.Allowlist) > 0 { @@ -3132,23 +3132,23 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Allowlist[iNdEx]) i = encodeVarintProvider(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x22 } } if m.ValidatorSetCap != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorSetCap)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 } if m.ValidatorsPowerCap != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorsPowerCap)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x10 } if m.Top_N != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.Top_N)) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -7590,7 +7590,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: PowerShapingParameters: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: + case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Top_N", wireType) } @@ -7609,7 +7609,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 3: + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } @@ -7628,7 +7628,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 4: + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) } @@ -7647,7 +7647,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 6: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } @@ -7679,7 +7679,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 7: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } @@ -7711,7 +7711,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 8: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) } @@ -7730,7 +7730,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 9: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) } diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 6747cfada7..1eeafac5ad 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -1535,7 +1535,7 @@ type MsgUpdateConsumer struct { // the consumer id of the consumer chain to be updated ConsumerId string `protobuf:"bytes,2,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` // the new owner of the consumer when updated - OwnerAddress string `protobuf:"bytes,3,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + NewOwnerAddress string `protobuf:"bytes,3,opt,name=new_owner_address,json=newOwnerAddress,proto3" json:"new_owner_address,omitempty"` // the metadata of the consumer when updated Metadata *ConsumerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` // initialization parameters can only be updated before a chain has launched @@ -1591,9 +1591,9 @@ func (m *MsgUpdateConsumer) GetConsumerId() string { return "" } -func (m *MsgUpdateConsumer) GetOwnerAddress() string { +func (m *MsgUpdateConsumer) GetNewOwnerAddress() string { if m != nil { - return m.OwnerAddress + return m.NewOwnerAddress } return "" } @@ -1692,135 +1692,136 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 2045 bytes of a gzipped FileDescriptorProto + // 2052 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4b, 0x6c, 0x1c, 0x49, - 0xf9, 0x77, 0xcf, 0x8c, 0x9d, 0x99, 0x1a, 0x3f, 0xdb, 0xce, 0xba, 0x3d, 0x49, 0x3c, 0x8e, 0x77, - 0xff, 0xbb, 0x56, 0xfe, 0xeb, 0x9e, 0x8d, 0x21, 0x59, 0x08, 0xe1, 0xe1, 0x47, 0x20, 0x5e, 0x70, - 0xe2, 0x6d, 0x87, 0x20, 0x81, 0x44, 0xab, 0xa6, 0xbb, 0xd2, 0x53, 0xca, 0x74, 0x57, 0xab, 0xab, - 0x66, 0xbc, 0xe6, 0x84, 0xf6, 0x94, 0x63, 0x10, 0x17, 0x6e, 0xec, 0x01, 0x0e, 0x48, 0x80, 0xf6, - 0xb0, 0x27, 0x84, 0xc4, 0x75, 0x25, 0x2e, 0xcb, 0x9e, 0xd0, 0x1e, 0x02, 0x4a, 0x0e, 0xe1, 0xc2, - 0x85, 0x1b, 0x12, 0x07, 0x54, 0x8f, 0xee, 0xe9, 0x9e, 0x19, 0x3b, 0xed, 0x31, 0x04, 0x24, 0x2e, - 0x96, 0xbb, 0xbe, 0xdf, 0xf7, 0xfb, 0x5e, 0x55, 0xdf, 0xd7, 0xd5, 0x03, 0xde, 0xc4, 0x01, 0x43, - 0x91, 0xd3, 0x82, 0x38, 0xb0, 0x29, 0x72, 0x3a, 0x11, 0x66, 0x47, 0x0d, 0xc7, 0xe9, 0x36, 0xc2, - 0x88, 0x74, 0xb1, 0x8b, 0xa2, 0x46, 0xf7, 0x6a, 0x83, 0xbd, 0x67, 0x86, 0x11, 0x61, 0x44, 0x7f, - 0x75, 0x08, 0xda, 0x74, 0x9c, 0xae, 0x19, 0xa3, 0xcd, 0xee, 0xd5, 0xda, 0x1c, 0xf4, 0x71, 0x40, - 0x1a, 0xe2, 0xaf, 0xd4, 0xab, 0x5d, 0xf4, 0x08, 0xf1, 0xda, 0xa8, 0x01, 0x43, 0xdc, 0x80, 0x41, - 0x40, 0x18, 0x64, 0x98, 0x04, 0x54, 0x49, 0xeb, 0x4a, 0x2a, 0x9e, 0x9a, 0x9d, 0x07, 0x0d, 0x86, - 0x7d, 0x44, 0x19, 0xf4, 0x43, 0x05, 0x58, 0xee, 0x07, 0xb8, 0x9d, 0x48, 0x30, 0x28, 0xf9, 0x52, - 0xbf, 0x1c, 0x06, 0x47, 0x4a, 0xb4, 0xe0, 0x11, 0x8f, 0x88, 0x7f, 0x1b, 0xfc, 0xbf, 0x58, 0xc1, - 0x21, 0xd4, 0x27, 0xd4, 0x96, 0x02, 0xf9, 0xa0, 0x44, 0x8b, 0xf2, 0xa9, 0xe1, 0x53, 0x8f, 0x87, - 0xee, 0x53, 0x2f, 0xf6, 0x12, 0x37, 0x9d, 0x86, 0x43, 0x22, 0xd4, 0x70, 0xda, 0x18, 0x05, 0x8c, - 0x4b, 0xe5, 0x7f, 0x0a, 0xb0, 0x91, 0x27, 0x95, 0x49, 0xa2, 0xa4, 0x4e, 0x83, 0x93, 0xb6, 0xb1, - 0xd7, 0x62, 0x92, 0x8a, 0x36, 0x18, 0x0a, 0x5c, 0x14, 0xf9, 0x58, 0x1a, 0xe8, 0x3d, 0xc5,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 0x92, 0x98, 0xf1, 0x24, + 0x31, 0xef, 0xc5, 0xa3, 0x68, 0xb3, 0xcc, 0x1d, 0x79, 0xfc, 0xe7, 0xba, 0x66, 0x55, 0x84, 0x1e, + 0x97, 0xe8, 0x77, 0xc1, 0x4c, 0x27, 0x68, 0x92, 0xc0, 0xc5, 0x81, 0x67, 0x87, 0x28, 0xc2, 0xc4, + 0x35, 0x26, 0x04, 0xd5, 0xe2, 0x00, 0xd5, 0xb6, 0x1a, 0x5a, 0x92, 0xe9, 0xa7, 0x9c, 0x69, 0x3a, + 0x51, 0xde, 0x17, 0xba, 0xfa, 0x5b, 0x40, 0x77, 0x9c, 0xae, 0x70, 0x89, 0x74, 0x58, 0xcc, 0x78, + 0x2e, 0x3f, 0xe3, 0x8c, 0xe3, 0x74, 0xef, 0x49, 0x6d, 0x45, 0xf9, 0x7d, 0xb0, 0xc0, 0x22, 0x18, + 0xd0, 0x07, 0x28, 0xea, 0xe7, 0x2d, 0xe7, 0xe7, 0xbd, 0x10, 0x73, 0x64, 0xc9, 0xef, 0x80, 0xe5, + 0xe4, 0xa0, 0x44, 0xc8, 0xc5, 0x94, 0x45, 0xb8, 0xd9, 0x11, 0xa7, 0x32, 0x3e, 0x57, 0x46, 0x45, + 0x6c, 0x82, 0xa5, 0x18, 0x67, 0x65, 0x60, 0xdf, 0x50, 0x28, 0x7d, 0x0f, 0xbc, 0x2c, 0xce, 0x31, + 0xe5, 0xce, 0xd9, 0x19, 0x26, 0x61, 0xda, 0xc7, 0x94, 0x72, 0x36, 0xb0, 0xac, 0xad, 0x16, 0xad, + 0x2b, 0x12, 0xbb, 0x8f, 0xa2, 0xed, 0x14, 0xf2, 0x5e, 0x0a, 0xa8, 0xaf, 0x01, 0xbd, 0x85, 0x29, + 0x23, 0x11, 0x76, 0x60, 0xdb, 0x46, 0x01, 0x8b, 0x30, 0xa2, 0x46, 0x55, 0xa8, 0xcf, 0xf6, 0x24, + 0xb7, 0xa5, 0x40, 0x7f, 0x13, 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, 0x4e, 0x87, 0x4f, 0x2c, 0xfe, 0x52, 0x03, 0x8b, 0xc7, 0xdf, 0xaa, 0x72, + 0xb7, 0xfb, 0x63, 0x29, 0x6a, 0x3b, 0x67, 0xa6, 0x48, 0x7c, 0xfd, 0x99, 0x06, 0xe6, 0x87, 0xde, + 0x58, 0x6e, 0x9d, 0xb6, 0x23, 0xa4, 0xb5, 0x6b, 0xdb, 0x67, 0xd1, 0xce, 0x34, 0x95, 0xda, 0xf8, + 0x8f, 0x3e, 0x79, 0xef, 0xaa, 0xb6, 0xf9, 0xdd, 0x0f, 0x9e, 0x2e, 0x69, 0x1f, 0x3e, 0x5d, 0xd2, + 0xfe, 0xf2, 0x74, 0x49, 0x7b, 0xfc, 0x6c, 0x69, 0xec, 0xc3, 0x67, 0x4b, 0x63, 0x7f, 0x7a, 0xb6, + 0x34, 0xf6, 0xbd, 0xaf, 0x78, 0x98, 0xb5, 0x3a, 0x4d, 0xd3, 0x21, 0xbe, 0xfa, 0xdd, 0xb3, 0xd1, + 0x33, 0xbe, 0x96, 0xfc, 0x6c, 0xd9, 0xbd, 0xde, 0x78, 0x3b, 0xfb, 0xdb, 0xa5, 0xf8, 0x95, 0xa6, + 0x39, 0x21, 0xbe, 0x25, 0x7d, 0xfe, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x69, 0xe1, 0x06, 0x71, + 0x37, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3563,10 +3564,10 @@ func (m *MsgUpdateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + if len(m.NewOwnerAddress) > 0 { + i -= len(m.NewOwnerAddress) + copy(dAtA[i:], m.NewOwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewOwnerAddress))) i-- dAtA[i] = 0x1a } @@ -4147,7 +4148,7 @@ func (m *MsgUpdateConsumer) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.OwnerAddress) + l = len(m.NewOwnerAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -7828,7 +7829,7 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NewOwnerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7856,7 +7857,7 @@ func (m *MsgUpdateConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + m.NewOwnerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { From da6e001f0ee4872f45ce3fd549bdfe31127c10d0 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 20 Aug 2024 18:03:21 +0200 Subject: [PATCH 30/41] fixed the CreateConsumer and UpdateConsumer logic and made most of the fields optional --- .../ccv/provider/v1/provider.proto | 46 +- .../ccv/provider/v1/tx.proto | 2 +- testutil/ibc_testing/generic_setup.go | 4 +- testutil/keeper/unit_test_helpers.go | 15 +- x/ccv/provider/keeper/msg_server.go | 89 ++- x/ccv/provider/keeper/msg_server_test.go | 8 +- x/ccv/provider/keeper/permissionless.go | 125 +++- x/ccv/provider/keeper/permissionless_test.go | 28 +- x/ccv/provider/keeper/proposal.go | 14 +- x/ccv/provider/keeper/proposal_test.go | 72 ++- x/ccv/provider/types/msg.go | 44 +- x/ccv/provider/types/provider.pb.go | 602 +++++++++++------- x/ccv/provider/types/tx.pb.go | 291 +++++---- 13 files changed, 855 insertions(+), 485 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 9ab6f79e19..28372dda79 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -386,22 +386,22 @@ message ConsumerInitializationParameters { // the proposed initial height of new consumer chain. // For a completely new chain, this will be {0,1}. However, it may be // different if this is a chain that is converting to a consumer chain. - ibc.core.client.v1.Height initial_height = 1 [ (gogoproto.nullable) = false ]; + ibc.core.client.v1.Height initial_height = 1 [ (gogoproto.nullable) = true ]; // The hash of the consumer chain genesis state without the consumer CCV // module genesis params. It is used for off-chain confirmation of // genesis.json validity by validators and other parties. - bytes genesis_hash = 2; + bytes genesis_hash = 2 [ (gogoproto.nullable) = true ]; // The hash of the consumer chain binary that should be run by validators on // chain initialization. It is used for off-chain confirmation of binary // validity by validators and other parties. - bytes binary_hash = 3; + bytes binary_hash = 3 [ (gogoproto.nullable) = true ]; // spawn time is the time on the provider chain at which the consumer chain // genesis is finalized and all validators will be responsible for starting // their consumer chain validator node. - google.protobuf.Timestamp spawn_time = 4 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + google.protobuf.Timestamp spawn_time = 4 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = true ]; // Unbonding period for the consumer, // which should be smaller than that of the provider in general. - google.protobuf.Duration unbonding_period = 5 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + google.protobuf.Duration unbonding_period = 5 [ (gogoproto.nullable) = true, (gogoproto.stdduration) = true ]; // ---------- ---------- ---------- @@ -410,54 +410,62 @@ message ConsumerInitializationParameters { // ---------- ---------- ---------- // Sent CCV related IBC packets will timeout after this duration - google.protobuf.Duration ccv_timeout_period = 6 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + google.protobuf.Duration ccv_timeout_period = 6 [ (gogoproto.nullable) = true, (gogoproto.stdduration) = true ]; // Sent transfer related IBC packets will timeout after this duration - google.protobuf.Duration transfer_timeout_period = 7 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + google.protobuf.Duration transfer_timeout_period = 7 [ (gogoproto.nullable) = true, (gogoproto.stdduration) = true ]; // The fraction of tokens allocated to the consumer redistribution address // during distribution events. The fraction is a string representing a // decimal number. For example "0.75" would represent 75%. - string consumer_redistribution_fraction = 8; + string consumer_redistribution_fraction = 8 [ (gogoproto.nullable) = true ]; // BlocksPerDistributionTransmission is the number of blocks between // ibc-token-transfers from the consumer chain to the provider chain. On // sending transmission event, `consumer_redistribution_fraction` of the // accumulated tokens are sent to the consumer redistribution address. - int64 blocks_per_distribution_transmission = 9; + int64 blocks_per_distribution_transmission = 9 [ (gogoproto.nullable) = true ]; // The number of historical info entries to persist in store. // This param is a part of the cosmos sdk staking module. In the case of // a ccv enabled consumer chain, the ccv module acts as the staking module. - int64 historical_entries = 10; + int64 historical_entries = 10 [ (gogoproto.nullable) = true ]; // The ID of a token transfer channel used for the Reward Distribution // sub-protocol. If DistributionTransmissionChannel == "", a new transfer // channel is created on top of the same connection as the CCV channel. // Note that transfer_channel_id is the ID of the channel end on the consumer // chain. it is most relevant for chains performing a sovereign to consumer // changeover in order to maintain the existing ibc transfer channel - string distribution_transmission_channel = 11; + string distribution_transmission_channel = 11 [ (gogoproto.nullable) = true ]; } - // PowerShapingParameters contains parameters that shape the validator set that we send to the consumer chain message PowerShapingParameters { // Corresponds to the percentage of validators that have to validate the chain under the Top N case. // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - uint32 top_N = 1; + uint32 top_N = 1 [ (gogoproto.nullable) = true ]; + // We cannot use `optional` for `top_N` due to having plugins `gocosmos` and `grpc-gateway` do not support it. + // To distinguish between a set `top_N` to 0 and one that is not, we introduce a new field. + bool is_top_N_set = 2 [ (gogoproto.nullable) = true ]; // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - uint32 validators_power_cap = 2; + uint32 validators_power_cap = 3 [ (gogoproto.nullable) = true ]; // Corresponds to the maximum number of validators that can validate a consumer chain. // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - uint32 validator_set_cap = 3; + uint32 validator_set_cap = 4 [ (gogoproto.nullable) = true ]; // corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate the consumer chain - repeated string allowlist = 4; + repeated string allowlist = 5 [ (gogoproto.nullable) = true ]; // corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain - repeated string denylist = 5; + repeated string denylist = 6 [ (gogoproto.nullable) = true ]; // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - uint64 min_stake = 6; + uint64 min_stake = 7 [ (gogoproto.nullable) = true ]; + // We cannot use `optional` for `min_stake` due to having plugins `gocosmos` and `grpc-gateway` do not support it. + // To distinguish between a set `min_stake` to 0 and one that is not, we introduce a new field. + bool is_min_stake_set = 8 [ (gogoproto.nullable) = true ]; // Corresponds to whether inactive validators are allowed to validate the consumer chain. - bool allow_inactive_vals = 7; + bool allow_inactive_vals = 9 [ (gogoproto.nullable) = true ]; + // We cannot use `optional` for `allow_inactive_vals` due to having plugins `gocosmos` and `grpc-gateway` do not support it. + // To distinguish between a set `allow_inactive_vals` to `false` and one that is not, we introduce a new field. + bool is_allow_inactive_vals_set = 10 [ (gogoproto.nullable) = true ]; } diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 6e780d903d..ea55cc5fe1 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -370,7 +370,7 @@ message MsgCreateConsumer { // the chain id of the new consumer chain string chain_id = 2; - ConsumerMetadata metadata = 3; + ConsumerMetadata metadata = 3 [ (gogoproto.nullable) = false ]; ConsumerInitializationParameters initialization_parameters = 4; diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index 53a1687980..ae24ba9a5b 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -145,10 +145,10 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( initializationParameters := testkeeper.GetTestInitializationParameters() // NOTE: we cannot use the time.Now() because the coordinator chooses a hardcoded start time // using time.Now() could set the spawn time to be too far in the past or too far in the future - initializationParameters.SpawnTime = coordinator.CurrentTime + initializationParameters.SpawnTime = &coordinator.CurrentTime // NOTE: the initial height passed to CreateConsumerClient // must be the height on the consumer when InitGenesis is called - initializationParameters.InitialHeight = clienttypes.Height{RevisionNumber: 0, RevisionHeight: 2} + initializationParameters.InitialHeight = &clienttypes.Height{RevisionNumber: 0, RevisionHeight: 2} powerShapingParameters := testkeeper.GetTestPowerShapingParameters() powerShapingParameters.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index 3c55fc59ec..a819ea50b8 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -282,18 +282,23 @@ func GetTestConsumerMetadata() providertypes.ConsumerMetadata { } func GetTestInitializationParameters() providertypes.ConsumerInitializationParameters { + initialHeight := clienttypes.NewHeight(4, 5) + spawnTime := time.Now() + ccvTimeoutPeriod := types.DefaultCCVTimeoutPeriod + transferTimeoutPeriod := types.DefaultTransferTimeoutPeriod + unbondingPeriod := types.DefaultConsumerUnbondingPeriod return providertypes.ConsumerInitializationParameters{ - InitialHeight: clienttypes.NewHeight(4, 5), + InitialHeight: &initialHeight, GenesisHash: []byte("gen_hash"), BinaryHash: []byte("bin_hash"), - SpawnTime: time.Now(), + SpawnTime: &spawnTime, ConsumerRedistributionFraction: types.DefaultConsumerRedistributeFrac, BlocksPerDistributionTransmission: types.DefaultBlocksPerDistributionTransmission, DistributionTransmissionChannel: "", HistoricalEntries: types.DefaultHistoricalEntries, - CcvTimeoutPeriod: types.DefaultCCVTimeoutPeriod, - TransferTimeoutPeriod: types.DefaultTransferTimeoutPeriod, - UnbondingPeriod: types.DefaultConsumerUnbondingPeriod, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, + UnbondingPeriod: &unbondingPeriod, } } diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index a4eb7e1338..6305d66ca5 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -4,12 +4,12 @@ import ( "context" errorsmod "cosmossdk.io/errors" "fmt" + tmtypes "github.com/cometbft/cometbft/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - tmtypes "github.com/cometbft/cometbft/types" + "time" "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v5/x/ccv/types" @@ -310,11 +310,35 @@ func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateCon ctx := sdk.UnwrapSDKContext(goCtx) initGas := ctx.GasMeter().GasConsumed() - consumerId, err := k.SetUpConsumer(ctx, msg.Signer, msg.ChainId, *msg.Metadata, *msg.InitializationParameters, *msg.PowerShapingParameters) - if err != nil { + consumerId := k.FetchAndIncrementConsumerId(ctx) + + k.SetConsumerOwnerAddress(ctx, consumerId, msg.Signer) + k.SetConsumerChainId(ctx, consumerId, msg.ChainId) + + if err := k.SetConsumerMetadata(ctx, consumerId, msg.Metadata); err != nil { return &types.MsgCreateConsumerResponse{}, err } - k.PrepareConsumerForLaunch(ctx, consumerId, msg.InitializationParameters.SpawnTime) + + // initialization parameters are optional and hence could be nil + if msg.InitializationParameters != nil { + if err := k.SetConsumerInitializationParameters(ctx, consumerId, *msg.InitializationParameters); err != nil { + return &types.MsgCreateConsumerResponse{}, err + } + } + + // power-shaping parameters are optional and hence could be null + if msg.PowerShapingParameters != nil { + if err := k.SetConsumerPowerShapingParameters(ctx, consumerId, *msg.PowerShapingParameters); err != nil { + return &types.MsgCreateConsumerResponse{}, err + } + } + + if k.CanLaunch(ctx, consumerId) { + k.SetConsumerPhase(ctx, consumerId, Initialized) + k.PrepareConsumerForLaunch(ctx, consumerId, nil, *msg.InitializationParameters.SpawnTime) + } else { + k.SetConsumerPhase(ctx, consumerId, Registered) + } gasAfter := ctx.GasMeter().GasConsumed() ctx.GasMeter().ConsumeGas(gasAfter-initGas, "creating a chain has an additional cost during spawn time, "+ @@ -330,31 +354,66 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon ownerAddress, err := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) if err != nil { - // TODO (PERMISSIONLESS): fix the error message + // TODO (PERMISSIONLESS): use a better error message return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidConsumerId, "cannot retrieve owner address %s", ownerAddress) } - if msg.PowerShapingParameters.Top_N > 0 && msg.Signer != k.GetAuthority() { - // TODO (PERMISSIONLESS): fix the error message + if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.IsTop_NSet && msg.PowerShapingParameters.Top_N > 0 && msg.Signer != k.GetAuthority() { + // TODO (PERMISSIONLESS): use a better error message return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidPhase, "an update to a Top N chain can only be done through a governance proposal") } if k.GetAuthority() == msg.Signer { - // message is executed as part of governance proposal and hence we change the owner address - // to be the one of the gov module account address (e.g., a gov proposal with a single `MsgUpdateConsumer` might have - // led to this) - if msg.PowerShapingParameters.Top_N == 0 { + // message is executed as part of governance proposal + if msg.PowerShapingParameters.IsTop_NSet && msg.PowerShapingParameters.Top_N == 0 { + // chain becomes an Opt In chain, hence we change the owner address k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) } else { + // message is executed as part of governance proposal and hence we change the owner address to be the one of + // the gov module account address (e.g., a gov proposal with a single `MsgUpdateConsumer` might have led to this) k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, k.GetAuthority()) } + } else if msg.Signer == ownerAddress { + k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) } else if msg.Signer != ownerAddress { return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Signer) } - k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, *msg.Metadata) - k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, *msg.InitializationParameters) - k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, *msg.PowerShapingParameters) + if msg.Metadata != nil { + if oldMetadata, err := k.Keeper.GetConsumerMetadata(ctx, msg.ConsumerId); err == nil { + k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, MergeConsumerMetadata(oldMetadata, *msg.Metadata)) + } else { + // TODO (PERMISSIONLESS): probably we should return an error + k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, *msg.Metadata) + } + } + + var previousSpawnTime *time.Time + if previousParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { + previousSpawnTime = previousParameters.SpawnTime + } + + if msg.InitializationParameters != nil { + if oldInitializationParameters, err := k.Keeper.GetConsumerInitializationParameters(ctx, msg.ConsumerId); err == nil { + k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, MergeConsumerInitializationParameters(oldInitializationParameters, *msg.InitializationParameters)) + } else { + k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, *msg.InitializationParameters) + } + } + + if msg.PowerShapingParameters != nil { + if oldPowerShapingParameters, err := k.Keeper.GetConsumerPowerShapingParameters(ctx, msg.ConsumerId); err == nil { + k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, MergePowerShapingParameters(oldPowerShapingParameters, *msg.PowerShapingParameters)) + } else { + k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, *msg.PowerShapingParameters) + } + } + + if k.CanLaunch(ctx, msg.ConsumerId) { + k.SetConsumerPhase(ctx, consumerId, Initialized) + k.PrepareConsumerForLaunch(ctx, consumerId, previousSpawnTime, *msg.InitializationParameters.SpawnTime) + } + return &types.MsgUpdateConsumerResponse{}, nil } diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go index 473ab8f1bf..9e8d738693 100644 --- a/x/ccv/provider/keeper/msg_server_test.go +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -20,7 +20,7 @@ func TestCreateConsumer(t *testing.T) { Description: "description", } response, err := msgServer.CreateConsumer(ctx, - &providertypes.MsgCreateConsumer{Signer: "signer", ChainId: "chainId", Metadata: &consumerMetadata, + &providertypes.MsgCreateConsumer{Signer: "signer", ChainId: "chainId", Metadata: consumerMetadata, InitializationParameters: &providertypes.ConsumerInitializationParameters{}, PowerShapingParameters: &providertypes.PowerShapingParameters{}}) require.NoError(t, err) @@ -32,14 +32,14 @@ func TestCreateConsumer(t *testing.T) { require.Equal(t, "signer", ownerAddress) phase, found := providerKeeper.GetConsumerPhase(ctx, "0") require.True(t, found) - require.Equal(t, providerkeeper.Initialized, phase) + require.Equal(t, providerkeeper.Registered, phase) consumerMetadata = providertypes.ConsumerMetadata{ Name: "chain name", Description: "description2", } response, err = msgServer.CreateConsumer(ctx, - &providertypes.MsgCreateConsumer{Signer: "signer2", ChainId: "chainId", Metadata: &consumerMetadata, + &providertypes.MsgCreateConsumer{Signer: "signer2", ChainId: "chainId", Metadata: consumerMetadata, InitializationParameters: &providertypes.ConsumerInitializationParameters{}, PowerShapingParameters: &providertypes.PowerShapingParameters{}}) require.NoError(t, err) @@ -52,7 +52,7 @@ func TestCreateConsumer(t *testing.T) { require.Equal(t, "signer2", ownerAddress) phase, found = providerKeeper.GetConsumerPhase(ctx, "1") require.True(t, found) - require.Equal(t, providerkeeper.Initialized, phase) + require.Equal(t, providerkeeper.Registered, phase) } func TestUpdateConsumer(t *testing.T) { diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 42d0dbc34f..b3b878cb4b 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -723,41 +723,114 @@ func (k Keeper) IsValidatorOptedInToChainId(ctx sdk.Context, providerAddr types. return "", false } -func (k Keeper) SetUpConsumer(ctx sdk.Context, signer string, chainId string, - metadata types.ConsumerMetadata, initializationParameters types.ConsumerInitializationParameters, - powerShapingParameters types.PowerShapingParameters, -) (string, error) { - consumerId := k.FetchAndIncrementConsumerId(ctx) +func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, previousSpawnTime *time.Time, spawnTime time.Time) { + if previousSpawnTime != nil { + // if this is not the first initialization, remove the consumer id from the old spawn time + k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, *previousSpawnTime) + } - k.SetConsumerOwnerAddress(ctx, consumerId, signer) - k.SetConsumerChainId(ctx, consumerId, chainId) + k.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, spawnTime) +} - err := k.SetConsumerMetadata(ctx, consumerId, metadata) - if err != nil { - return "", err - } +// CanLaunch checks on whether the consumer with `consumerId` has set all the initialization parameters set and hence +// is ready to launch +func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) bool { + if initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err != nil { + initialHeightSet := initializationParameters.InitialHeight != nil + genesisHashSet := initializationParameters.GenesisHash != nil + binaryHashSet := initializationParameters.BinaryHash != nil + spawnTimeSet := initializationParameters.SpawnTime != nil + unbondingPeriodSet := initializationParameters.UnbondingPeriod != nil - err = k.SetConsumerInitializationParameters(ctx, consumerId, initializationParameters) - if err != nil { - return "", err + ccvTimeoutPeriodSet := initializationParameters.CcvTimeoutPeriod != nil + transferTimeoutPeriodSet := initializationParameters.TransferTimeoutPeriod != nil + + // TODO (PERMISSIONLESS): we should verify we can parse this at some point + // and that the values below are not negative, etc. + consumerRedistributionFractionSet := initializationParameters.ConsumerRedistributionFraction != "" + blocksPerDistributionTransmissionSet := initializationParameters.BlocksPerDistributionTransmission > 0 + historicalEntriesSet := initializationParameters.HistoricalEntries > 0 + distributionTransmissionChannelSet := initializationParameters.DistributionTransmissionChannel != "" + return initialHeightSet && genesisHashSet && binaryHashSet && spawnTimeSet && unbondingPeriodSet && + ccvTimeoutPeriodSet && transferTimeoutPeriodSet && consumerRedistributionFractionSet && + blocksPerDistributionTransmissionSet && historicalEntriesSet && distributionTransmissionChannelSet } + return false +} - err = k.SetConsumerPowerShapingParameters(ctx, consumerId, powerShapingParameters) - if err != nil { - return "", err +// Could be done with reflect but we want to avoid using it ...?? +func MergeConsumerMetadata(oldMetadata types.ConsumerMetadata, newMetadata types.ConsumerMetadata) types.ConsumerMetadata { + if newMetadata.Name != "" { + oldMetadata.Name = newMetadata.Name + } + if newMetadata.Metadata != "" { + oldMetadata.Metadata = newMetadata.Metadata } + if newMetadata.Description != "" { + oldMetadata.Description = newMetadata.Description + } + return oldMetadata +} - k.SetConsumerPhase(ctx, consumerId, Initialized) - return consumerId, nil +func MergeConsumerInitializationParameters(oldInitializationParameters types.ConsumerInitializationParameters, newInitializationParameters types.ConsumerInitializationParameters) types.ConsumerInitializationParameters { + if newInitializationParameters.InitialHeight != nil { + oldInitializationParameters.InitialHeight = newInitializationParameters.InitialHeight + } + if newInitializationParameters.GenesisHash != nil { + oldInitializationParameters.GenesisHash = newInitializationParameters.GenesisHash + } + if newInitializationParameters.BinaryHash != nil { + oldInitializationParameters.GenesisHash = newInitializationParameters.GenesisHash + } + if newInitializationParameters.SpawnTime != nil { + oldInitializationParameters.SpawnTime = newInitializationParameters.SpawnTime + } + if newInitializationParameters.UnbondingPeriod != nil { + oldInitializationParameters.UnbondingPeriod = newInitializationParameters.UnbondingPeriod + } + if newInitializationParameters.CcvTimeoutPeriod != nil { + oldInitializationParameters.CcvTimeoutPeriod = newInitializationParameters.CcvTimeoutPeriod + } + if newInitializationParameters.TransferTimeoutPeriod != nil { + oldInitializationParameters.TransferTimeoutPeriod = newInitializationParameters.TransferTimeoutPeriod + } + if newInitializationParameters.ConsumerRedistributionFraction != "" { + oldInitializationParameters.ConsumerRedistributionFraction = newInitializationParameters.ConsumerRedistributionFraction + } + if newInitializationParameters.BlocksPerDistributionTransmission > 0 { + oldInitializationParameters.BlocksPerDistributionTransmission = newInitializationParameters.BlocksPerDistributionTransmission + } + if newInitializationParameters.HistoricalEntries > 0 { + oldInitializationParameters.HistoricalEntries = newInitializationParameters.HistoricalEntries + } + if newInitializationParameters.DistributionTransmissionChannel != "" { + oldInitializationParameters.DistributionTransmissionChannel = newInitializationParameters.DistributionTransmissionChannel + } + return oldInitializationParameters } -func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, spawnTime time.Time) { - // if this is not the first initialization, remove the consumer id from the old spawn time - initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId) - if err == nil { - previousSpawnTime := initializationParameters.SpawnTime - k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) +func MergePowerShapingParameters(oldPowerShapingParameters types.PowerShapingParameters, newPowerShapingParameters types.PowerShapingParameters) types.PowerShapingParameters { + if newPowerShapingParameters.IsTop_NSet { + oldPowerShapingParameters.Top_N = newPowerShapingParameters.Top_N + } + if newPowerShapingParameters.ValidatorsPowerCap > 0 { + oldPowerShapingParameters.ValidatorsPowerCap = newPowerShapingParameters.ValidatorsPowerCap + } + if newPowerShapingParameters.ValidatorSetCap > 0 { + oldPowerShapingParameters.ValidatorSetCap = newPowerShapingParameters.ValidatorSetCap + } + if newPowerShapingParameters.Allowlist != nil { + oldPowerShapingParameters.Allowlist = newPowerShapingParameters.Allowlist + } + if newPowerShapingParameters.Denylist != nil { + oldPowerShapingParameters.Denylist = newPowerShapingParameters.Denylist + } + if newPowerShapingParameters.IsMinStakeSet { + oldPowerShapingParameters.MinStake = newPowerShapingParameters.MinStake + } + if newPowerShapingParameters.IsAllowInactiveValsSet { + oldPowerShapingParameters.AllowInactiveVals = newPowerShapingParameters.AllowInactiveVals } - k.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, spawnTime) + return oldPowerShapingParameters } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index b9cbe7d8ef..20b96cbfe6 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -94,14 +94,18 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { _, err := providerKeeper.GetConsumerInitializationParameters(ctx, "consumerId") require.Error(t, err) + spawnTime := time.Unix(1, 2).UTC() + unbondingPeriod := time.Duration(3456) + ccvTimeoutPeriod := time.Duration(789) + transferTimeoutPeriod := time.Duration(101112) expectedRecord := providertypes.ConsumerInitializationParameters{ - InitialHeight: types.Height{RevisionNumber: 1, RevisionHeight: 2}, + InitialHeight: &types.Height{RevisionNumber: 1, RevisionHeight: 2}, GenesisHash: []byte{0, 1}, BinaryHash: []byte{2, 3}, - SpawnTime: time.Unix(1, 2).UTC(), - UnbondingPeriod: 3456, - CcvTimeoutPeriod: 789, - TransferTimeoutPeriod: 101112, + SpawnTime: &spawnTime, + UnbondingPeriod: &unbondingPeriod, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, ConsumerRedistributionFraction: "consumer_redistribution_fraction", BlocksPerDistributionTransmission: 123, HistoricalEntries: 456, @@ -113,14 +117,18 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { require.Equal(t, expectedRecord, actualRecord) // assert that overwriting the current initialization record works + spawnTime = time.Unix(2, 3).UTC() + unbondingPeriod = time.Duration(789) + ccvTimeoutPeriod = time.Duration(101112) + transferTimeoutPeriod = time.Duration(131415) expectedRecord = providertypes.ConsumerInitializationParameters{ - InitialHeight: types.Height{RevisionNumber: 2, RevisionHeight: 3}, + InitialHeight: &types.Height{RevisionNumber: 2, RevisionHeight: 3}, GenesisHash: []byte{2, 3}, BinaryHash: []byte{4, 5}, - SpawnTime: time.Unix(2, 3).UTC(), - UnbondingPeriod: 789, - CcvTimeoutPeriod: 101112, - TransferTimeoutPeriod: 131415, + SpawnTime: &spawnTime, + UnbondingPeriod: &unbondingPeriod, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, ConsumerRedistributionFraction: "consumer_redistribution_fraction2", BlocksPerDistributionTransmission: 456, HistoricalEntries: 789, diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index e553e4a738..7052e32457 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -62,14 +62,14 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { // Create client state by getting template client from parameters and filling in zeroed fields from proposal. clientState := k.GetTemplateClient(ctx) clientState.ChainId = chainId - clientState.LatestHeight = initializationRecord.InitialHeight + clientState.LatestHeight = *initializationRecord.InitialHeight - trustPeriod, err := ccv.CalculateTrustPeriod(consumerUnbondingPeriod, k.GetTrustingPeriodFraction(ctx)) + trustPeriod, err := ccv.CalculateTrustPeriod(*consumerUnbondingPeriod, k.GetTrustingPeriodFraction(ctx)) if err != nil { return err } clientState.TrustingPeriod = trustPeriod - clientState.UnbondingPeriod = consumerUnbondingPeriod + clientState.UnbondingPeriod = *consumerUnbondingPeriod consumerGen, validatorSetHash, err := k.MakeConsumerGenesis(ctx, consumerId) if err != nil { @@ -274,11 +274,11 @@ func (k Keeper) MakeConsumerGenesis( initializationRecord.BlocksPerDistributionTransmission, initializationRecord.DistributionTransmissionChannel, "", // providerFeePoolAddrStr, - initializationRecord.CcvTimeoutPeriod, - initializationRecord.TransferTimeoutPeriod, + *initializationRecord.CcvTimeoutPeriod, + *initializationRecord.TransferTimeoutPeriod, initializationRecord.ConsumerRedistributionFraction, initializationRecord.HistoricalEntries, - initializationRecord.UnbondingPeriod, + *initializationRecord.UnbondingPeriod, []string{}, []string{}, ccv.DefaultRetryDelayPeriod, @@ -345,7 +345,7 @@ func (k Keeper) BeginBlockInit(ctx sdk.Context) { } // Remove consumer to prevent re-trying launching this chain. // We would only try to re-launch this chain if a new `MsgUpdateConsumer` message is sent. - k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, record.SpawnTime) + k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, *record.SpawnTime) cachedCtx, writeFn := ctx.CacheContext() err = k.LaunchConsumer(cachedCtx, consumerId) diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 2ca1f4dae9..18a870f1a7 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -527,13 +527,16 @@ func TestMakeConsumerGenesis(t *testing.T) { Description: "description", } + ccvTimeoutPeriod := time.Duration(2419200000000000) + transferTimeoutPeriod := time.Duration(3600000000000) + unbondingPeriod := time.Duration(1728000000000000) initializationParameters := providertypes.ConsumerInitializationParameters{ BlocksPerDistributionTransmission: 1000, - CcvTimeoutPeriod: 2419200000000000, - TransferTimeoutPeriod: 3600000000000, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, ConsumerRedistributionFraction: "0.75", HistoricalEntries: 10000, - UnbondingPeriod: 1728000000000000, + UnbondingPeriod: &unbondingPeriod, } providerKeeper.SetConsumerChainId(ctx, "0", "testchain1") providerKeeper.SetConsumerMetadata(ctx, "0", consumerMetadata) @@ -675,67 +678,75 @@ func TestBeginBlockInit(t *testing.T) { } chainIds := []string{"chain0", "chain1", "chain2", "chain3", "chain4"} + initialHeight := clienttypes.NewHeight(3, 4) + spawnTimeMinus2Hours := now.Add(-time.Hour * 2).UTC() + spawnTimeMinus1Hour := now.Add(-time.Hour).UTC() + spawnTimeMinus1Minute := now.Add(-time.Minute).UTC() + spawnTimePlus1Hour := now.Add(time.Hour).UTC() + unbondingPeriod := time.Duration(100000000000) + ccvTimeoutPeriod := time.Duration(100000000000) + transferTimeoutPeriod := time.Duration(100000000000) initializationParameters := []providertypes.ConsumerInitializationParameters{ { - InitialHeight: clienttypes.NewHeight(3, 4), + InitialHeight: &initialHeight, GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: now.Add(-time.Hour * 2).UTC(), - UnbondingPeriod: 100000000000, - CcvTimeoutPeriod: 100000000000, - TransferTimeoutPeriod: 100000000000, + SpawnTime: &spawnTimeMinus2Hours, + UnbondingPeriod: &unbondingPeriod, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, DistributionTransmissionChannel: "", }, { - InitialHeight: clienttypes.NewHeight(3, 4), + InitialHeight: &initialHeight, GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: now.Add(-time.Hour * 1).UTC(), - UnbondingPeriod: 100000000000, - CcvTimeoutPeriod: 100000000000, - TransferTimeoutPeriod: 100000000000, + SpawnTime: &spawnTimeMinus1Hour, + UnbondingPeriod: &unbondingPeriod, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, DistributionTransmissionChannel: "", }, { - InitialHeight: clienttypes.NewHeight(3, 4), + InitialHeight: &initialHeight, GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: now.Add(time.Hour).UTC(), - UnbondingPeriod: 100000000000, - CcvTimeoutPeriod: 100000000000, - TransferTimeoutPeriod: 100000000000, + SpawnTime: &spawnTimePlus1Hour, + UnbondingPeriod: &unbondingPeriod, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, DistributionTransmissionChannel: "", }, { - InitialHeight: clienttypes.NewHeight(3, 4), + InitialHeight: &initialHeight, GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: now.Add(-time.Hour * 1).UTC(), - UnbondingPeriod: 100000000000, - CcvTimeoutPeriod: 100000000000, - TransferTimeoutPeriod: 100000000000, + SpawnTime: &spawnTimeMinus1Hour, + UnbondingPeriod: &unbondingPeriod, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, DistributionTransmissionChannel: "", }, { - InitialHeight: clienttypes.NewHeight(3, 4), + InitialHeight: &initialHeight, GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: now.Add(-time.Minute).UTC(), - UnbondingPeriod: 100000000000, - CcvTimeoutPeriod: 100000000000, - TransferTimeoutPeriod: 100000000000, + SpawnTime: &spawnTimeMinus1Minute, + UnbondingPeriod: &unbondingPeriod, + CcvTimeoutPeriod: &ccvTimeoutPeriod, + TransferTimeoutPeriod: &transferTimeoutPeriod, ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, @@ -802,7 +813,7 @@ func TestBeginBlockInit(t *testing.T) { providerKeeper.SetConsumerInitializationParameters(ctx, fmt.Sprintf("%d", i), r) // set up the chains in their initialized phase, hence they could launch providerKeeper.SetConsumerPhase(ctx, fmt.Sprintf("%d", i), providerkeeper.Initialized) - providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, fmt.Sprintf("%d", i), r.SpawnTime) + providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, fmt.Sprintf("%d", i), *r.SpawnTime) } for i, r := range powerShapingParameters { providerKeeper.SetConsumerPowerShapingParameters(ctx, fmt.Sprintf("%d", i), r) @@ -902,7 +913,8 @@ func TestBeginBlockCCR(t *testing.T) { for i, consumerId := range consumerIds { // Setup a valid consumer chain for each consumerId initializationRecord := testkeeper.GetTestInitializationParameters() - initializationRecord.InitialHeight = clienttypes.NewHeight(2, 3) + initialHeight := clienttypes.NewHeight(2, 3) + initializationRecord.InitialHeight = &initialHeight registrationRecord := testkeeper.GetTestConsumerMetadata() providerKeeper.SetConsumerChainId(ctx, consumerId, chainIds[i]) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 7e842928e9..60469cb841 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -3,6 +3,7 @@ package types import ( "encoding/json" "fmt" + cmttypes "github.com/cometbft/cometbft/types" "strconv" "strings" "time" @@ -245,7 +246,7 @@ func NewMsgCreateConsumer(signer string, chainId string, metadata ConsumerMetada return &MsgCreateConsumer{ Signer: signer, ChainId: chainId, - Metadata: &metadata, + Metadata: metadata, InitializationParameters: &initializationParameters, PowerShapingParameters: &powerShapingParameters, }, nil @@ -259,10 +260,47 @@ func (msg MsgCreateConsumer) Type() string { // Route implements the sdk.Msg interface. func (msg MsgCreateConsumer) Route() string { return RouterKey } +func verifyField(name string, field string, maxLength int) error { + if strings.TrimSpace(field) == "" { + return fmt.Errorf("%s cannot be empty", name) + } else if len(field) > maxLength { + return fmt.Errorf("%s is too long; got: %d, max: %d", name, len(field), maxLength) + } + return nil +} + +func VerifyConsumerMetadata(metadata ConsumerMetadata) error { + // TODO (PERMISSIONLESS): we can extend the lengths at some later stage and make them constant + if err := verifyField("name", metadata.Name, 100); err != nil { + return err + } + + if err := verifyField("description", metadata.Description, 20000); err != nil { + return err + } + + if err := verifyField("metadata", metadata.Metadata, 1000); err != nil { + return err + } + + return nil +} + // ValidateBasic implements the sdk.Msg interface. func (msg MsgCreateConsumer) ValidateBasic() error { - // add checks - // TODO (PERMISSIONLESS) + if err := verifyField("chain id", msg.ChainId, cmttypes.MaxChainIDLen); err != nil { + return err + } + + if err := VerifyConsumerMetadata(msg.Metadata); err != nil { + return err + } + + if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.IsTop_NSet && msg.PowerShapingParameters.Top_N > 0 { + return fmt.Errorf("cannot create a Top N chain through `MsgCreateConsumer`; " + + "first create the chain and then use `MsgUpdateConsumer` to make the chain Top N") + } + return nil } diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 6b72d79283..e3da76d268 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -1445,7 +1445,7 @@ type ConsumerInitializationParameters struct { // the proposed initial height of new consumer chain. // For a completely new chain, this will be {0,1}. However, it may be // different if this is a chain that is converting to a consumer chain. - InitialHeight types.Height `protobuf:"bytes,1,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` + InitialHeight *types.Height `protobuf:"bytes,1,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` // The hash of the consumer chain genesis state without the consumer CCV // module genesis params. It is used for off-chain confirmation of // genesis.json validity by validators and other parties. @@ -1457,14 +1457,14 @@ type ConsumerInitializationParameters struct { // spawn time is the time on the provider chain at which the consumer chain // genesis is finalized and all validators will be responsible for starting // their consumer chain validator node. - SpawnTime time.Time `protobuf:"bytes,4,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` + SpawnTime *time.Time `protobuf:"bytes,4,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time,omitempty"` // Unbonding period for the consumer, // which should be smaller than that of the provider in general. - UnbondingPeriod time.Duration `protobuf:"bytes,5,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` + UnbondingPeriod *time.Duration `protobuf:"bytes,5,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period,omitempty"` // Sent CCV related IBC packets will timeout after this duration - CcvTimeoutPeriod time.Duration `protobuf:"bytes,6,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` + CcvTimeoutPeriod *time.Duration `protobuf:"bytes,6,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period,omitempty"` // Sent transfer related IBC packets will timeout after this duration - TransferTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` + TransferTimeoutPeriod *time.Duration `protobuf:"bytes,7,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period,omitempty"` // The fraction of tokens allocated to the consumer redistribution address // during distribution events. The fraction is a string representing a // decimal number. For example "0.75" would represent 75%. @@ -1520,11 +1520,11 @@ func (m *ConsumerInitializationParameters) XXX_DiscardUnknown() { var xxx_messageInfo_ConsumerInitializationParameters proto.InternalMessageInfo -func (m *ConsumerInitializationParameters) GetInitialHeight() types.Height { +func (m *ConsumerInitializationParameters) GetInitialHeight() *types.Height { if m != nil { return m.InitialHeight } - return types.Height{} + return nil } func (m *ConsumerInitializationParameters) GetGenesisHash() []byte { @@ -1541,32 +1541,32 @@ func (m *ConsumerInitializationParameters) GetBinaryHash() []byte { return nil } -func (m *ConsumerInitializationParameters) GetSpawnTime() time.Time { +func (m *ConsumerInitializationParameters) GetSpawnTime() *time.Time { if m != nil { return m.SpawnTime } - return time.Time{} + return nil } -func (m *ConsumerInitializationParameters) GetUnbondingPeriod() time.Duration { +func (m *ConsumerInitializationParameters) GetUnbondingPeriod() *time.Duration { if m != nil { return m.UnbondingPeriod } - return 0 + return nil } -func (m *ConsumerInitializationParameters) GetCcvTimeoutPeriod() time.Duration { +func (m *ConsumerInitializationParameters) GetCcvTimeoutPeriod() *time.Duration { if m != nil { return m.CcvTimeoutPeriod } - return 0 + return nil } -func (m *ConsumerInitializationParameters) GetTransferTimeoutPeriod() time.Duration { +func (m *ConsumerInitializationParameters) GetTransferTimeoutPeriod() *time.Duration { if m != nil { return m.TransferTimeoutPeriod } - return 0 + return nil } func (m *ConsumerInitializationParameters) GetConsumerRedistributionFraction() string { @@ -1604,23 +1604,32 @@ type PowerShapingParameters struct { // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. Top_N uint32 `protobuf:"varint,1,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` + // We cannot use `optional` for `top_N` due to having plugins `gocosmos` and `grpc-gateway` do not support it. + // To distinguish between a set `top_N` to 0 and one that is not, we introduce a new field. + IsTop_NSet bool `protobuf:"varint,2,opt,name=is_top_N_set,json=isTopNSet,proto3" json:"is_top_N_set,omitempty"` // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - ValidatorsPowerCap uint32 `protobuf:"varint,2,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + ValidatorsPowerCap uint32 `protobuf:"varint,3,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` // Corresponds to the maximum number of validators that can validate a consumer chain. // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - ValidatorSetCap uint32 `protobuf:"varint,3,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + ValidatorSetCap uint32 `protobuf:"varint,4,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` // corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate the consumer chain - Allowlist []string `protobuf:"bytes,4,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + Allowlist []string `protobuf:"bytes,5,rep,name=allowlist,proto3" json:"allowlist,omitempty"` // corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain - Denylist []string `protobuf:"bytes,5,rep,name=denylist,proto3" json:"denylist,omitempty"` + Denylist []string `protobuf:"bytes,6,rep,name=denylist,proto3" json:"denylist,omitempty"` // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - MinStake uint64 `protobuf:"varint,6,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` + MinStake uint64 `protobuf:"varint,7,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` + // We cannot use `optional` for `min_stake` due to having plugins `gocosmos` and `grpc-gateway` do not support it. + // To distinguish between a set `min_stake` to 0 and one that is not, we introduce a new field. + IsMinStakeSet bool `protobuf:"varint,8,opt,name=is_min_stake_set,json=isMinStakeSet,proto3" json:"is_min_stake_set,omitempty"` // Corresponds to whether inactive validators are allowed to validate the consumer chain. - AllowInactiveVals bool `protobuf:"varint,7,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` + AllowInactiveVals bool `protobuf:"varint,9,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` + // We cannot use `optional` for `allow_inactive_vals` due to having plugins `gocosmos` and `grpc-gateway` do not support it. + // To distinguish between a set `allow_inactive_vals` to `false` and one that is not, we introduce a new field. + IsAllowInactiveValsSet bool `protobuf:"varint,10,opt,name=is_allow_inactive_vals_set,json=isAllowInactiveValsSet,proto3" json:"is_allow_inactive_vals_set,omitempty"` } func (m *PowerShapingParameters) Reset() { *m = PowerShapingParameters{} } @@ -1663,6 +1672,13 @@ func (m *PowerShapingParameters) GetTop_N() uint32 { return 0 } +func (m *PowerShapingParameters) GetIsTop_NSet() bool { + if m != nil { + return m.IsTop_NSet + } + return false +} + func (m *PowerShapingParameters) GetValidatorsPowerCap() uint32 { if m != nil { return m.ValidatorsPowerCap @@ -1698,6 +1714,13 @@ func (m *PowerShapingParameters) GetMinStake() uint64 { return 0 } +func (m *PowerShapingParameters) GetIsMinStakeSet() bool { + if m != nil { + return m.IsMinStakeSet + } + return false +} + func (m *PowerShapingParameters) GetAllowInactiveVals() bool { if m != nil { return m.AllowInactiveVals @@ -1705,6 +1728,13 @@ func (m *PowerShapingParameters) GetAllowInactiveVals() bool { return false } +func (m *PowerShapingParameters) GetIsAllowInactiveValsSet() bool { + if m != nil { + return m.IsAllowInactiveValsSet + } + return false +} + func init() { proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") @@ -1735,139 +1765,149 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 2104 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcf, 0x6f, 0x1b, 0xc7, - 0xf5, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x83, 0x1a, 0x3b, 0xf6, 0x4a, 0xd1, 0x97, 0xa4, 0x37, - 0x5f, 0x1b, 0x6c, 0x5c, 0x2f, 0x23, 0x05, 0x05, 0x0c, 0xb7, 0x81, 0x21, 0x51, 0x4e, 0x2c, 0xa9, - 0x71, 0xd8, 0x95, 0xa0, 0x00, 0xe9, 0x61, 0x31, 0xdc, 0x1d, 0x91, 0x53, 0xed, 0xee, 0xac, 0x67, - 0x86, 0x2b, 0xb3, 0x87, 0x9e, 0x8b, 0x02, 0x05, 0xd2, 0x9e, 0x82, 0x5e, 0x9a, 0x63, 0xd1, 0x53, - 0x0f, 0x45, 0xff, 0x80, 0x9e, 0x82, 0x02, 0x45, 0x73, 0xec, 0x29, 0x29, 0xec, 0x43, 0x0f, 0x05, - 0x7a, 0xed, 0xb5, 0x98, 0xd9, 0x1f, 0x5c, 0xea, 0x97, 0x69, 0x58, 0xee, 0x45, 0xda, 0x79, 0xef, - 0xf3, 0xde, 0xbc, 0x99, 0x79, 0xbf, 0x66, 0x08, 0x36, 0x48, 0x20, 0x30, 0x73, 0xfa, 0x88, 0x04, - 0x36, 0xc7, 0xce, 0x80, 0x11, 0x31, 0x6c, 0x39, 0x4e, 0xd4, 0x0a, 0x19, 0x8d, 0x88, 0x8b, 0x59, - 0x2b, 0x5a, 0xcf, 0xbe, 0xcd, 0x90, 0x51, 0x41, 0xe1, 0x3b, 0xe7, 0xc8, 0x98, 0x8e, 0x13, 0x99, - 0x19, 0x2e, 0x5a, 0x5f, 0xbd, 0x7d, 0x91, 0xe2, 0x68, 0xbd, 0x75, 0x42, 0x18, 0x8e, 0x75, 0xad, - 0x5e, 0xef, 0xd1, 0x1e, 0x55, 0x9f, 0x2d, 0xf9, 0x95, 0x50, 0xeb, 0x3d, 0x4a, 0x7b, 0x1e, 0x6e, - 0xa9, 0x51, 0x77, 0x70, 0xd4, 0x12, 0xc4, 0xc7, 0x5c, 0x20, 0x3f, 0x4c, 0x00, 0xb5, 0xd3, 0x00, - 0x77, 0xc0, 0x90, 0x20, 0x34, 0x48, 0x15, 0x90, 0xae, 0xd3, 0x72, 0x28, 0xc3, 0x2d, 0xc7, 0x23, - 0x38, 0x10, 0x72, 0xd6, 0xf8, 0x2b, 0x01, 0xb4, 0x24, 0xc0, 0x23, 0xbd, 0xbe, 0x88, 0xc9, 0xbc, - 0x25, 0x70, 0xe0, 0x62, 0xe6, 0x93, 0x18, 0x3c, 0x1a, 0x25, 0x02, 0x6b, 0x39, 0xbe, 0xc3, 0x86, - 0xa1, 0xa0, 0xad, 0x63, 0x3c, 0xe4, 0x09, 0xf7, 0x8e, 0x43, 0xb9, 0x4f, 0x79, 0x0b, 0xcb, 0xf5, - 0x07, 0x0e, 0x6e, 0x45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, 0xd9, 0xe3, 0x8b, 0x6f, 0x18, 0x00, 0x00, + // 2264 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xcd, 0x73, 0x1b, 0x49, + 0x15, 0xf7, 0x58, 0xb2, 0x2d, 0xb5, 0xfc, 0x21, 0x77, 0xb2, 0x89, 0xec, 0x35, 0xb2, 0x32, 0x4b, + 0x82, 0xd9, 0x10, 0x29, 0x76, 0x80, 0x4a, 0x05, 0xb6, 0x82, 0x23, 0x67, 0x37, 0x1f, 0xc4, 0x2b, + 0xc6, 0xc6, 0x5b, 0xb5, 0x1c, 0xa6, 0x5a, 0x33, 0x6d, 0xa9, 0xf1, 0xcc, 0xf4, 0xa4, 0xbb, 0x35, + 0x89, 0x38, 0x70, 0xe6, 0x42, 0xd5, 0x72, 0xdb, 0xe2, 0xc2, 0x1e, 0x29, 0x0e, 0x14, 0x07, 0x8a, + 0x3f, 0x80, 0xd3, 0x16, 0x55, 0x14, 0x7b, 0xe0, 0xc0, 0x69, 0x97, 0x4a, 0x0e, 0x1c, 0xa8, 0xe2, + 0xca, 0x95, 0xea, 0x9e, 0x9e, 0xd1, 0xc8, 0x96, 0x92, 0x71, 0x2d, 0x7b, 0x49, 0x34, 0xdd, 0xbf, + 0xf7, 0xeb, 0x7e, 0xdd, 0xef, 0xab, 0x9f, 0xc1, 0x0e, 0x09, 0x04, 0x66, 0x4e, 0x1f, 0x91, 0xc0, + 0xe6, 0xd8, 0x19, 0x30, 0x22, 0x86, 0x2d, 0xc7, 0x89, 0x5a, 0x21, 0xa3, 0x11, 0x71, 0x31, 0x6b, + 0x45, 0xdb, 0xe9, 0xef, 0x66, 0xc8, 0xa8, 0xa0, 0xf0, 0xad, 0x09, 0x32, 0x4d, 0xc7, 0x89, 0x9a, + 0x29, 0x2e, 0xda, 0x5e, 0xbf, 0x3a, 0x8d, 0x38, 0xda, 0x6e, 0x3d, 0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3, 0x44, 0x6a, 0x4b, 0x74, 0x20, 0x12, 0xc6, 0x72, + 0x7e, 0xc6, 0xaa, 0xe3, 0x44, 0x87, 0xb1, 0xb4, 0xa6, 0xfc, 0x09, 0xb8, 0x2c, 0x18, 0x0a, 0xf8, + 0x31, 0x66, 0xa7, 0x79, 0x41, 0x7e, 0xde, 0x37, 0x12, 0x8e, 0x71, 0xf2, 0x07, 0xa0, 0xe1, 0x68, + 0x03, 0xb2, 0x19, 0x76, 0x09, 0x17, 0x8c, 0x74, 0x07, 0x52, 0xd6, 0x3e, 0x66, 0xc8, 0x51, 0x36, + 0x52, 0x51, 0x46, 0x50, 0x4f, 0x70, 0xd6, 0x18, 0xec, 0x5d, 0x8d, 0x82, 0xef, 0x83, 0xaf, 0x77, + 0x3d, 0xea, 0x9c, 0x70, 0xb9, 0x39, 0x7b, 0x8c, 0x49, 0x2d, 0xed, 0x13, 0xce, 0x25, 0xdb, 0x62, + 0xc3, 0xd8, 0x2a, 0x58, 0x57, 0x62, 0x6c, 0x07, 0xb3, 0xbd, 0x0c, 0xf2, 0x30, 0x03, 0x84, 0x37, + 0x00, 0xec, 0x13, 0x2e, 0x28, 0x23, 0x0e, 0xf2, 0x6c, 0x1c, 0x08, 0x46, 0x30, 0xaf, 0x2d, 0x29, + 0xf1, 0xd5, 0xd1, 0xcc, 0xfd, 0x78, 0x02, 0x3e, 0x02, 0x57, 0xa6, 0x2e, 0x6a, 0x3b, 0x7d, 0x14, + 0x04, 0xd8, 0xab, 0x2d, 0x2b, 0x55, 0x36, 0xdd, 0x29, 0x6b, 0xb6, 0x63, 0x18, 0xbc, 0x00, 0xe6, + 0x04, 0x0d, 0xed, 0xfd, 0xda, 0x4a, 0xc3, 0xd8, 0x5a, 0xb2, 0x8a, 0x82, 0x86, 0xfb, 0xf0, 0x26, + 0xb8, 0x18, 0x21, 0x8f, 0xb8, 0x48, 0x50, 0xc6, 0xed, 0x90, 0x3e, 0xc3, 0xcc, 0x76, 0x50, 0x58, + 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1a, 0x94, 0x33, 0x12, 0x67, 0x5b, 0x07, 0xf0, + 0x07, 0x60, 0x9d, 0x70, 0x7b, 0x82, 0xa0, 0x5a, 0x0e, 0x64, 0x84, 0x2f, 0x11, 0x15, 0xd5, 0xc7, + 0xc4, 0x0f, 0xb0, 0xb8, 0xf7, 0xc1, 0xa7, 0x2f, 0xea, 0xc6, 0x67, 0x2f, 0xea, 0xc6, 0x3f, 0x5f, + 0xd4, 0x8d, 0x8f, 0x5e, 0xd6, 0x67, 0x3e, 0x7b, 0x59, 0x9f, 0xf9, 0xc7, 0xcb, 0xfa, 0xcc, 0x87, + 0xef, 0x9c, 0x0d, 0xe1, 0xa3, 0x14, 0x79, 0x23, 0xfd, 0x33, 0x46, 0xf4, 0x9d, 0xd6, 0xf3, 0xf1, + 0x3f, 0x92, 0xa8, 0xe8, 0xde, 0x9d, 0x57, 0x1e, 0x79, 0xeb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x9e, 0x31, 0xef, 0x01, 0x55, 0x19, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -3023,38 +3063,46 @@ func (m *ConsumerInitializationParameters) MarshalToSizedBuffer(dAtA []byte) (in i-- dAtA[i] = 0x42 } - n17, err17 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) - if err17 != nil { - return 0, err17 + if m.TransferTimeoutPeriod != nil { + n17, err17 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.TransferTimeoutPeriod):]) + if err17 != nil { + return 0, err17 + } + i -= n17 + i = encodeVarintProvider(dAtA, i, uint64(n17)) + i-- + dAtA[i] = 0x3a } - i -= n17 - i = encodeVarintProvider(dAtA, i, uint64(n17)) - i-- - dAtA[i] = 0x3a - n18, err18 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) - if err18 != nil { - return 0, err18 + if m.CcvTimeoutPeriod != nil { + n18, err18 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.CcvTimeoutPeriod):]) + if err18 != nil { + return 0, err18 + } + i -= n18 + i = encodeVarintProvider(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0x32 } - i -= n18 - i = encodeVarintProvider(dAtA, i, uint64(n18)) - i-- - dAtA[i] = 0x32 - n19, err19 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) - if err19 != nil { - return 0, err19 + if m.UnbondingPeriod != nil { + n19, err19 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.UnbondingPeriod):]) + if err19 != nil { + return 0, err19 + } + i -= n19 + i = encodeVarintProvider(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0x2a } - i -= n19 - i = encodeVarintProvider(dAtA, i, uint64(n19)) - i-- - dAtA[i] = 0x2a - n20, err20 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) - if err20 != nil { - return 0, err20 + if m.SpawnTime != nil { + n20, err20 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.SpawnTime):]) + if err20 != nil { + return 0, err20 + } + i -= n20 + i = encodeVarintProvider(dAtA, i, uint64(n20)) + i-- + dAtA[i] = 0x22 } - i -= n20 - i = encodeVarintProvider(dAtA, i, uint64(n20)) - i-- - dAtA[i] = 0x22 if len(m.BinaryHash) > 0 { i -= len(m.BinaryHash) copy(dAtA[i:], m.BinaryHash) @@ -3069,16 +3117,18 @@ func (m *ConsumerInitializationParameters) MarshalToSizedBuffer(dAtA []byte) (in i-- dAtA[i] = 0x12 } - { - size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.InitialHeight != nil { + { + size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProvider(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintProvider(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3102,6 +3152,16 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.IsAllowInactiveValsSet { + i-- + if m.IsAllowInactiveValsSet { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } if m.AllowInactiveVals { i-- if m.AllowInactiveVals { @@ -3110,12 +3170,22 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x38 + dAtA[i] = 0x48 + } + if m.IsMinStakeSet { + i-- + if m.IsMinStakeSet { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 } if m.MinStake != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.MinStake)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x38 } if len(m.Denylist) > 0 { for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { @@ -3123,7 +3193,7 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Denylist[iNdEx]) i = encodeVarintProvider(dAtA, i, uint64(len(m.Denylist[iNdEx]))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 } } if len(m.Allowlist) > 0 { @@ -3132,17 +3202,27 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Allowlist[iNdEx]) i = encodeVarintProvider(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } } if m.ValidatorSetCap != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorSetCap)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 } if m.ValidatorsPowerCap != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorsPowerCap)) i-- + dAtA[i] = 0x18 + } + if m.IsTop_NSet { + i-- + if m.IsTop_NSet { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- dAtA[i] = 0x10 } if m.Top_N != 0 { @@ -3663,8 +3743,10 @@ func (m *ConsumerInitializationParameters) Size() (n int) { } var l int _ = l - l = m.InitialHeight.Size() - n += 1 + l + sovProvider(uint64(l)) + if m.InitialHeight != nil { + l = m.InitialHeight.Size() + n += 1 + l + sovProvider(uint64(l)) + } l = len(m.GenesisHash) if l > 0 { n += 1 + l + sovProvider(uint64(l)) @@ -3673,14 +3755,22 @@ func (m *ConsumerInitializationParameters) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) - n += 1 + l + sovProvider(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) - n += 1 + l + sovProvider(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) - n += 1 + l + sovProvider(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) - n += 1 + l + sovProvider(uint64(l)) + if m.SpawnTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.SpawnTime) + n += 1 + l + sovProvider(uint64(l)) + } + if m.UnbondingPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.UnbondingPeriod) + n += 1 + l + sovProvider(uint64(l)) + } + if m.CcvTimeoutPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.CcvTimeoutPeriod) + n += 1 + l + sovProvider(uint64(l)) + } + if m.TransferTimeoutPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.TransferTimeoutPeriod) + n += 1 + l + sovProvider(uint64(l)) + } l = len(m.ConsumerRedistributionFraction) if l > 0 { n += 1 + l + sovProvider(uint64(l)) @@ -3707,6 +3797,9 @@ func (m *PowerShapingParameters) Size() (n int) { if m.Top_N != 0 { n += 1 + sovProvider(uint64(m.Top_N)) } + if m.IsTop_NSet { + n += 2 + } if m.ValidatorsPowerCap != 0 { n += 1 + sovProvider(uint64(m.ValidatorsPowerCap)) } @@ -3728,9 +3821,15 @@ func (m *PowerShapingParameters) Size() (n int) { if m.MinStake != 0 { n += 1 + sovProvider(uint64(m.MinStake)) } + if m.IsMinStakeSet { + n += 2 + } if m.AllowInactiveVals { n += 2 } + if m.IsAllowInactiveValsSet { + n += 2 + } return n } @@ -7234,6 +7333,9 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.InitialHeight == nil { + m.InitialHeight = &types.Height{} + } if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -7335,7 +7437,10 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { + if m.SpawnTime == nil { + m.SpawnTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7368,7 +7473,10 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + if m.UnbondingPeriod == nil { + m.UnbondingPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7401,7 +7509,10 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + if m.CcvTimeoutPeriod == nil { + m.CcvTimeoutPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7434,7 +7545,10 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + if m.TransferTimeoutPeriod == nil { + m.TransferTimeoutPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7610,6 +7724,26 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } } case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsTop_NSet", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsTop_NSet = bool(v != 0) + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } @@ -7628,7 +7762,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 3: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) } @@ -7647,7 +7781,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } @@ -7679,7 +7813,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } @@ -7711,7 +7845,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 6: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) } @@ -7730,7 +7864,27 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 7: + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsMinStakeSet", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsMinStakeSet = bool(v != 0) + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) } @@ -7750,6 +7904,26 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } } m.AllowInactiveVals = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsAllowInactiveValsSet", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsAllowInactiveValsSet = bool(v != 0) default: iNdEx = preIndex skippy, err := skipProvider(dAtA[iNdEx:]) diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 1eeafac5ad..bc8c466b3c 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -1410,7 +1410,7 @@ type MsgCreateConsumer struct { Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // the chain id of the new consumer chain ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Metadata *ConsumerMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata ConsumerMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata"` InitializationParameters *ConsumerInitializationParameters `protobuf:"bytes,4,opt,name=initialization_parameters,json=initializationParameters,proto3" json:"initialization_parameters,omitempty"` PowerShapingParameters *PowerShapingParameters `protobuf:"bytes,5,opt,name=power_shaping_parameters,json=powerShapingParameters,proto3" json:"power_shaping_parameters,omitempty"` } @@ -1462,11 +1462,11 @@ func (m *MsgCreateConsumer) GetChainId() string { return "" } -func (m *MsgCreateConsumer) GetMetadata() *ConsumerMetadata { +func (m *MsgCreateConsumer) GetMetadata() ConsumerMetadata { if m != nil { return m.Metadata } - return nil + return ConsumerMetadata{} } func (m *MsgCreateConsumer) GetInitializationParameters() *ConsumerInitializationParameters { @@ -1692,136 +1692,136 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 2052 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4b, 0x6c, 0x1c, 0x49, - 0x19, 0x76, 0xcf, 0x8c, 0x9d, 0x99, 0x1a, 0xc7, 0x8f, 0xb6, 0xb3, 0x6e, 0x4f, 0x12, 0x8f, 0x63, - 0x96, 0x5d, 0x2b, 0xac, 0x7b, 0x36, 0x86, 0x64, 0x21, 0x84, 0x87, 0x1f, 0x81, 0x78, 0xc1, 0xb1, - 0xb7, 0x1d, 0x82, 0x04, 0x12, 0xad, 0x9a, 0xee, 0x4a, 0x4f, 0x29, 0xd3, 0x5d, 0xad, 0xae, 0x9a, + // 2059 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4d, 0x6c, 0x1c, 0x49, + 0x15, 0x76, 0xcf, 0x8c, 0xbd, 0x33, 0x35, 0xfe, 0x6d, 0x3b, 0xeb, 0xf6, 0x24, 0xf1, 0x38, 0x66, + 0xd9, 0xb5, 0xc2, 0xba, 0x67, 0x63, 0x48, 0x16, 0x42, 0xf8, 0xf1, 0x4f, 0x20, 0x5e, 0x70, 0xec, + 0x6d, 0x87, 0xac, 0x04, 0x12, 0xad, 0x9a, 0xee, 0x4a, 0x4f, 0x29, 0xd3, 0x5d, 0xad, 0xae, 0x9a, 0xf1, 0x9a, 0x13, 0xda, 0x53, 0x8e, 0x41, 0x5c, 0xb8, 0xb1, 0x07, 0x38, 0x20, 0x01, 0xda, 0xc3, - 0x9e, 0x10, 0x12, 0xd7, 0x95, 0xb8, 0x2c, 0x7b, 0x42, 0x7b, 0x08, 0x28, 0x39, 0x2c, 0x17, 0x38, - 0x70, 0x43, 0xe2, 0x80, 0xea, 0xd1, 0x3d, 0xdd, 0x33, 0x63, 0xa7, 0x3d, 0x86, 0x80, 0xb4, 0x17, - 0xcb, 0x5d, 0xff, 0xf7, 0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, 0xe8, 0x77, 0xc1, 0x4c, 0x27, 0x68, 0x92, 0xc0, 0xc5, 0x81, 0x67, 0x87, 0x28, 0xc2, 0xc4, - 0x35, 0x26, 0x04, 0xd5, 0xe2, 0x00, 0xd5, 0xb6, 0x1a, 0x5a, 0x92, 0xe9, 0xa7, 0x9c, 0x69, 0x3a, - 0x51, 0xde, 0x17, 0xba, 0xfa, 0x5b, 0x40, 0x77, 0x9c, 0xae, 0x70, 0x89, 0x74, 0x58, 0xcc, 0x78, - 0x2e, 0x3f, 0xe3, 0x8c, 0xe3, 0x74, 0xef, 0x49, 0x6d, 0x45, 0xf9, 0x7d, 0xb0, 0xc0, 0x22, 0x18, - 0xd0, 0x07, 0x28, 0xea, 0xe7, 0x2d, 0xe7, 0xe7, 0xbd, 0x10, 0x73, 0x64, 0xc9, 0xef, 0x80, 0xe5, - 0xe4, 0xa0, 0x44, 0xc8, 0xc5, 0x94, 0x45, 0xb8, 0xd9, 0x11, 0xa7, 0x32, 0x3e, 0x57, 0x46, 0x45, - 0x6c, 0x82, 0xa5, 0x18, 0x67, 0x65, 0x60, 0xdf, 0x50, 0x28, 0x7d, 0x0f, 0xbc, 0x2c, 0xce, 0x31, - 0xe5, 0xce, 0xd9, 0x19, 0x26, 0x61, 0xda, 0xc7, 0x94, 0x72, 0x36, 0xb0, 0xac, 0xad, 0x16, 0xad, - 0x2b, 0x12, 0xbb, 0x8f, 0xa2, 0xed, 0x14, 0xf2, 0x5e, 0x0a, 0xa8, 0xaf, 0x01, 0xbd, 0x85, 0x29, - 0x23, 0x11, 0x76, 0x60, 0xdb, 0x46, 0x01, 0x8b, 0x30, 0xa2, 0x46, 0x55, 0xa8, 0xcf, 0xf6, 0x24, - 0xb7, 0xa5, 0x40, 0x7f, 0x13, 0x5c, 0x39, 0xd6, 0xa8, 0xed, 0xb4, 0x60, 0x10, 0xa0, 0xb6, 0x31, - 0x29, 0x42, 0xa9, 0xbb, 0xc7, 0xd8, 0xdc, 0x92, 0x30, 0x7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- 0x5e, 0xe6, 0x6a, 0xe2, 0xac, 0x67, 0x12, 0x55, 0xcc, 0x9d, 0xa8, 0x81, 0xd8, 0x2e, 0x81, 0xda, - 0xa0, 0xef, 0x49, 0x68, 0xbf, 0xd7, 0xc0, 0xec, 0x2e, 0xf5, 0xc4, 0x32, 0x8a, 0x41, 0xfd, 0x03, - 0x49, 0xeb, 0x1f, 0x48, 0xff, 0x4f, 0xf1, 0x5d, 0x04, 0x8b, 0x03, 0x01, 0x24, 0xe1, 0xfd, 0x5a, - 0x03, 0x17, 0x78, 0xf4, 0x2d, 0x18, 0x78, 0xc8, 0x42, 0x87, 0x30, 0x72, 0xb7, 0x51, 0x40, 0x7c, - 0xaa, 0xaf, 0x80, 0xf3, 0xae, 0xf8, 0xcf, 0x66, 0x84, 0xbf, 0x81, 0x1a, 0x9a, 0xd8, 0xa8, 0x55, - 0xb9, 0x78, 0x8f, 0x6c, 0xb8, 0xae, 0xbe, 0x0a, 0x66, 0x7a, 0x98, 0x48, 0x58, 0x30, 0x0a, 0x02, - 0x36, 0x15, 0xc3, 0xa4, 0xdd, 0xff, 0x58, 0x30, 0x75, 0xf1, 0x8e, 0x34, 0xe8, 0x6e, 0x12, 0xd0, - 0xdf, 0x34, 0x50, 0xde, 0xa5, 0xde, 0x5e, 0xc8, 0x76, 0x82, 0x4f, 0xc3, 0x3b, 0xb6, 0x0e, 0x66, - 0xe2, 0x70, 0x93, 0x1c, 0xfc, 0x41, 0x03, 0x15, 0xb9, 0xb8, 0xd7, 0x61, 0xff, 0xb5, 0x24, 0xf4, - 0x22, 0x2c, 0x8e, 0x16, 0x61, 0x29, 0x5f, 0x84, 0x73, 0xe2, 0x00, 0xca, 0x60, 0x92, 0x10, 0x7f, - 0x51, 0x10, 0x77, 0x0b, 0xde, 0x6d, 0x95, 0xfa, 0x16, 0xf1, 0x55, 0xdb, 0xb7, 0x20, 0x43, 0x83, - 0x61, 0x69, 0x39, 0xc3, 0x4a, 0xa7, 0xab, 0x30, 0x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, 0xb6, 0x03, 0x43, 0x63, 0x5a, + 0x60, 0xf4, 0x9e, 0xec, 0x80, 0x8b, 0xb6, 0x61, 0xa8, 0x5f, 0x05, 0x73, 0xc9, 0xaa, 0x4d, 0x11, + 0x13, 0xf0, 0x19, 0x01, 0x9f, 0x49, 0x04, 0x87, 0x88, 0x71, 0xec, 0x25, 0x50, 0x81, 0xed, 0x36, + 0x39, 0x6a, 0x63, 0xca, 0x8c, 0xd9, 0x95, 0xe2, 0x5a, 0xc5, 0xea, 0x2d, 0xe8, 0x35, 0x50, 0x76, + 0x51, 0x70, 0x2c, 0x84, 0x73, 0x42, 0x98, 0x3c, 0x67, 0xab, 0x8e, 0x9e, 0xbf, 0xea, 0x5c, 0x04, + 0x15, 0x9f, 0xd7, 0x17, 0x06, 0x1f, 0x22, 0x63, 0x7e, 0x45, 0x5b, 0x2b, 0x59, 0x65, 0x1f, 0x07, + 0x87, 0xfc, 0x59, 0x37, 0xc1, 0xbc, 0xb0, 0x6e, 0xe3, 0x80, 0xef, 0x6f, 0x17, 0xd9, 0x5d, 0xd8, + 0xa6, 0xc6, 0xc2, 0x8a, 0xb6, 0x56, 0xb6, 0xe6, 0x84, 0x68, 0x57, 0x49, 0xee, 0xc3, 0xf6, 0x60, + 0xdd, 0xb9, 0x0c, 0x2e, 0x0e, 0xa9, 0x2d, 0x49, 0xed, 0xf9, 0x8d, 0x06, 0xf4, 0x94, 0xdc, 0x42, + 0x3e, 0xe9, 0xc2, 0xf6, 0x69, 0xa5, 0x67, 0x13, 0x54, 0x28, 0xdf, 0x13, 0x71, 0xd9, 0x0b, 0x67, + 0xb8, 0xec, 0x65, 0xae, 0x26, 0xee, 0x7a, 0x26, 0x51, 0xc5, 0xdc, 0x89, 0x1a, 0x88, 0xed, 0x12, + 0xa8, 0x0d, 0xfa, 0x9e, 0x84, 0xf6, 0x5b, 0x0d, 0xcc, 0xed, 0x51, 0x4f, 0x2c, 0xa3, 0x18, 0xd4, + 0xdf, 0x90, 0xb4,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4, 0xbd, 0xab, 0xda, 0xd6, 0x5b, 0x1f, + 0x3c, 0x5d, 0xd6, 0x3e, 0x7c, 0xba, 0xac, 0xfd, 0xf9, 0xe9, 0xb2, 0xf6, 0xf8, 0xd9, 0xf2, 0xd8, + 0x87, 0xcf, 0x96, 0xc7, 0xfe, 0xf8, 0x6c, 0x79, 0xec, 0xbb, 0x5f, 0xf1, 0x30, 0x6b, 0x75, 0x9a, + 0xa6, 0x43, 0x7c, 0xf5, 0xeb, 0x67, 0xa3, 0x67, 0x7c, 0x3d, 0xf9, 0xf1, 0xb2, 0x7b, 0xbd, 0xf1, + 0x76, 0xf6, 0x17, 0x4c, 0xf1, 0x5b, 0x4d, 0x73, 0x42, 0x7c, 0x51, 0xfa, 0xfc, 0xbf, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x62, 0xac, 0x1d, 0xbf, 0x3d, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3449,18 +3449,16 @@ func (m *MsgCreateConsumer) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x1a + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a if len(m.ChainId) > 0 { i -= len(m.ChainId) copy(dAtA[i:], m.ChainId) @@ -4106,10 +4104,8 @@ func (m *MsgCreateConsumer) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovTx(uint64(l)) - } + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) if m.InitializationParameters != nil { l = m.InitializationParameters.Size() n += 1 + l + sovTx(uint64(l)) @@ -7552,9 +7548,6 @@ func (m *MsgCreateConsumer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Metadata == nil { - m.Metadata = &ConsumerMetadata{} - } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } From 55da06779871e6bd7db375e187c3e5c5070970d7 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 21 Aug 2024 11:59:38 +0200 Subject: [PATCH 31/41] fixed hooks and the code around proposalId to consumerId --- .../ccv/provider/v1/query.proto | 4 +- tests/integration/provider_gov_hooks.go | 32 +- testutil/keeper/unit_test_helpers.go | 10 +- x/ccv/provider/keeper/grpc_query_test.go | 10 +- x/ccv/provider/keeper/hooks.go | 46 ++- x/ccv/provider/keeper/hooks_test.go | 23 +- x/ccv/provider/keeper/keeper.go | 48 +-- x/ccv/provider/keeper/keeper_test.go | 50 +-- x/ccv/provider/keeper/key_assignment.go | 6 +- .../keeper/partial_set_security_test.go | 20 +- x/ccv/provider/keeper/permissionless.go | 6 +- x/ccv/provider/types/query.pb.go | 323 ++++++++++-------- 12 files changed, 347 insertions(+), 231 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 1568772025..1175d7002b 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -286,8 +286,10 @@ message QueryProposedChainIDsResponse { } message ProposedChain { - string chainID = 1; + // [DEPRECATED] use `consumer_id` instead + string chainID = 1 [deprecated = true]; uint64 proposalID = 2; + string consumer_id = 3; } message QueryAllPairsValConAddrByConsumerChainIDRequest { diff --git a/tests/integration/provider_gov_hooks.go b/tests/integration/provider_gov_hooks.go index ffa88f9da6..798887c14c 100644 --- a/tests/integration/provider_gov_hooks.go +++ b/tests/integration/provider_gov_hooks.go @@ -13,33 +13,45 @@ import ( testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" ) -// tests AfterProposalSubmission and AfterProposalVotingPeriodEnded hooks -// hooks require adding a proposal in the gov module and registering a consumer chain with the provider module +// TestAfterPropSubmissionAndVotingPeriodEnded tests AfterProposalSubmission and AfterProposalVotingPeriodEnded hooks +// require adding a proposal in the gov module and registering a consumer chain with the provider module func (s *CCVTestSuite) TestAfterPropSubmissionAndVotingPeriodEnded() { ctx := s.providerChain.GetContext() providerKeeper := s.providerApp.GetProviderKeeper() govKeeper := s.providerApp.GetTestGovKeeper() proposer := s.providerChain.SenderAccount - addConsumerProp := testkeeper.GetTestMsgConsumerAddition() + msgUpdateConsumer := testkeeper.GetTestMsgUpdateConsumer() - proposal, err := v1.NewProposal([]sdk.Msg{&addConsumerProp}, 1, time.Now(), time.Now().Add(1*time.Hour), "metadata", "title", "summary", proposer.GetAddress(), false) + proposal, err := v1.NewProposal([]sdk.Msg{&msgUpdateConsumer}, 1, time.Now(), time.Now().Add(1*time.Hour), "metadata", "title", "summary", proposer.GetAddress(), false) s.Require().NoError(err) err = govKeeper.SetProposal(ctx, proposal) s.Require().NoError(err) - providerKeeper.Hooks().AfterProposalSubmission(ctx, proposal.Id) + err = providerKeeper.Hooks().AfterProposalSubmission(ctx, proposal.Id) + s.Require().NoError(err) - // verify that the proposal ID is created - consumerIdOnProvider, ok := providerKeeper.GetProposedConsumerChain(ctx, proposal.Id) + // verify that the proposal id is created + consumerIdOnProvider, ok := providerKeeper.GetProposalIdToConsumerId(ctx, proposal.Id) s.Require().True(ok) s.Require().NotEmpty(consumerIdOnProvider) - s.Require().Equal("0", consumerIdOnProvider) + s.Require().Equal(msgUpdateConsumer.ConsumerId, consumerIdOnProvider) providerKeeper.Hooks().AfterProposalVotingPeriodEnded(ctx, proposal.Id) - // verify that the proposal ID is deleted - s.Require().Empty(providerKeeper.GetProposedConsumerChain(ctx, proposal.Id)) + // verify that the proposal id is deleted + s.Require().Empty(providerKeeper.GetProposalIdToConsumerId(ctx, proposal.Id)) + + // assert that a proposal with more than one `MsgUpdateConsumer` messages fails + proposal, err = v1.NewProposal([]sdk.Msg{&msgUpdateConsumer, &msgUpdateConsumer}, 1, time.Now(), time.Now().Add(1*time.Hour), "metadata", "title", "summary", proposer.GetAddress(), false) + s.Require().NoError(err) + + err = govKeeper.SetProposal(ctx, proposal) + s.Require().NoError(err) + + err = providerKeeper.Hooks().AfterProposalSubmission(ctx, proposal.Id) + s.Require().Error(err) + } func (s *CCVTestSuite) TestGetConsumerAdditionFromProp() { diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index a819ea50b8..fad02fd99a 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -340,9 +340,17 @@ func GetTestConsumerAdditionProp() *providertypes.ConsumerAdditionProposal { return prop } +func GetTestMsgUpdateConsumer() providertypes.MsgUpdateConsumer { + return providertypes.MsgUpdateConsumer{ + Signer: "signer", + ConsumerId: "consumerId", + NewOwnerAddress: "newOwnerAddress", + } +} + func GetTestMsgConsumerAddition() providertypes.MsgConsumerAddition { return providertypes.MsgConsumerAddition{ - ChainId: "a ChainID", + ChainId: "a ChainId", InitialHeight: clienttypes.NewHeight(4, 5), GenesisHash: []byte(base64.StdEncoding.EncodeToString([]byte("gen_hash"))), BinaryHash: []byte(base64.StdEncoding.EncodeToString([]byte("bin_hash"))), diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index 3e589fe21c..a4e9d5d24c 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "fmt" + "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" "testing" "github.com/golang/mock/gomock" @@ -80,7 +81,8 @@ func TestQueryConsumerChainOptedInValidators(t *testing.T) { _, err := pk.QueryConsumerChainOptedInValidators(ctx, &req) require.Error(t, err) - pk.SetProposedConsumerChain(ctx, consumerId, 1) + pk.FetchAndIncrementConsumerId(ctx) + pk.SetConsumerPhase(ctx, consumerId, keeper.Initialized) providerAddr1 := types.NewProviderConsAddress([]byte("providerAddr1")) providerAddr2 := types.NewProviderConsAddress([]byte("providerAddr2")) @@ -211,7 +213,9 @@ func TestQueryValidatorConsumerCommissionRate(t *testing.T) { _, err := pk.QueryValidatorConsumerCommissionRate(ctx, &req) require.Error(t, err) - pk.SetProposedConsumerChain(ctx, consumerId, 1) + pk.FetchAndIncrementConsumerId(ctx) + pk.SetConsumerPhase(ctx, consumerId, keeper.Initialized) + // validator with set consumer commission rate expectedCommissionRate := math.LegacyMustNewDecFromStr("0.123") pk.SetConsumerCommissionRate(ctx, consumerId, providerAddr, expectedCommissionRate) @@ -319,7 +323,7 @@ func TestGetConsumerChain(t *testing.T) { }) } - for i, chainID := range pk.GetAllRegisteredAndProposedChainIDs(ctx) { + for i, chainID := range pk.GetAllActiveConsumerIds(ctx) { c, err := pk.GetConsumerChain(ctx, chainID) require.NoError(t, err) require.Equal(t, expectedGetAllOrder[i], c) diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index aa49adc81e..b4ebfb919a 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -3,6 +3,7 @@ package keeper import ( "context" "cosmossdk.io/math" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" sdkgov "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -105,28 +106,49 @@ func (h Hooks) BeforeTokenizeShareRecordRemoved(_ context.Context, _ uint64) err // // AfterProposalSubmission - call hook if registered -// After a consumerAddition proposal submission, a record is created -// that maps the proposal ID to the consumer chain ID. -func (h Hooks) AfterProposalSubmission(goCtx context.Context, proposalID uint64) error { +// If an update consumer message exists in the proposal, a record is created that maps the proposal id to the consumer id +func (h Hooks) AfterProposalSubmission(goCtx context.Context, proposalId uint64) error { ctx := sdk.UnwrapSDKContext(goCtx) - if _, ok := h.GetConsumerAdditionFromProp(ctx, proposalID); ok { - consumerId := h.k.FetchAndIncrementConsumerId(ctx) - h.k.SetProposedConsumerChain(ctx, consumerId, proposalID) + p, err := h.k.govKeeper.Proposals.Get(ctx, proposalId) + if err != nil { + return fmt.Errorf("cannot retrieve proposal with id: %d", proposalId) } + + // a proposal can contain at most one `MsgUpdateConsumer` message + hasUpdateConsumerMsg := false + for _, msg := range p.GetMessages() { + sdkMsg, isUpdateConsumer := msg.GetCachedValue().(*providertypes.MsgUpdateConsumer) + if isUpdateConsumer { + if hasUpdateConsumerMsg { + return fmt.Errorf("proposal can contain at most one `MsgUpdateConsumer` message") + } + hasUpdateConsumerMsg = true + h.k.SetProposalIdToConsumerId(ctx, proposalId, sdkMsg.ConsumerId) + } + } + return nil } // AfterProposalVotingPeriodEnded - call hook if registered -// After proposal voting ends, the consumer consumerId in store is deleted. -// When a consumerAddition proposal passes, the consumer consumerId is available in providerKeeper.GetAllPendingConsumerAdditionProps -// or providerKeeper.GetAllConsumerChains(ctx). -func (h Hooks) AfterProposalVotingPeriodEnded(goCtx context.Context, proposalID uint64) error { +// After proposal voting ends, the consumer to proposal id record in store is deleted. +func (h Hooks) AfterProposalVotingPeriodEnded(goCtx context.Context, proposalId uint64) error { ctx := sdk.UnwrapSDKContext(goCtx) - if _, ok := h.GetConsumerAdditionFromProp(ctx, proposalID); ok { - h.k.DeleteProposedConsumerChainInStore(ctx, proposalID) + p, err := h.k.govKeeper.Proposals.Get(ctx, proposalId) + if err != nil { + return fmt.Errorf("cannot retrieve proposal with id: %d", proposalId) + } + + for _, msg := range p.GetMessages() { + _, isUpdateConsumer := msg.GetCachedValue().(*providertypes.MsgUpdateConsumer) + if isUpdateConsumer { + h.k.DeleteProposalIdToConsumerId(ctx, proposalId) + return nil + } } + return nil } diff --git a/x/ccv/provider/keeper/hooks_test.go b/x/ccv/provider/keeper/hooks_test.go index 2447b5edf3..8f7f90c948 100644 --- a/x/ccv/provider/keeper/hooks_test.go +++ b/x/ccv/provider/keeper/hooks_test.go @@ -1,13 +1,12 @@ package keeper_test import ( - "testing" - sdk "github.com/cosmos/cosmos-sdk/types" cryptotestutil "github.com/cosmos/interchain-security/v5/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" "github.com/golang/mock/gomock" + "testing" ) func TestValidatorConsensusKeyInUse(t *testing.T) { @@ -30,32 +29,40 @@ func TestValidatorConsensusKeyInUse(t *testing.T) { { name: "in use by another validator", setup: func(ctx sdk.Context, k providerkeeper.Keeper) { + k.FetchAndIncrementConsumerId(ctx) + k.SetConsumerPhase(ctx, "0", providerkeeper.Initialized) + // We are trying to add a new validator, but its address has already been used // by another validator - k.SetValidatorByConsumerAddr(ctx, "chainid", + k.SetValidatorByConsumerAddr(ctx, "0", newValidator.ConsumerConsAddress(), anotherValidator0.ProviderConsAddress(), ) - k.SetConsumerClientId(ctx, "chainid", "clientID") + k.SetConsumerClientId(ctx, "0", "clientId") }, expect: true, }, { name: "in use by one of several other validators", setup: func(ctx sdk.Context, k providerkeeper.Keeper) { + k.FetchAndIncrementConsumerId(ctx) + k.FetchAndIncrementConsumerId(ctx) + k.SetConsumerPhase(ctx, "0", providerkeeper.Initialized) + k.SetConsumerPhase(ctx, "1", providerkeeper.Initialized) + // We are trying to add a new validator, but its address has already been used // by another validator, of which there are several, across potentially several chains - k.SetValidatorByConsumerAddr(ctx, "chainid0", + k.SetValidatorByConsumerAddr(ctx, "0", newValidator.ConsumerConsAddress(), anotherValidator0.ProviderConsAddress(), ) - k.SetConsumerClientId(ctx, "chainid0", "clientID0") + k.SetConsumerClientId(ctx, "0", "clientId0") - k.SetValidatorByConsumerAddr(ctx, "chainid1", + k.SetValidatorByConsumerAddr(ctx, "1", anotherValidator1.ConsumerConsAddress(), anotherValidator1.ProviderConsAddress(), ) - k.SetConsumerClientId(ctx, "chainid1", "clientID1") + k.SetConsumerClientId(ctx, "1", "clientId1") }, expect: true, }, diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 398dcbca7d..6c13ad4fb0 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -211,32 +211,31 @@ func (k Keeper) DeleteConsumerIdToChannelId(ctx sdk.Context, consumerId string) store.Delete(types.ConsumerIdToChannelIdKey(consumerId)) } -// SetProposedConsumerChain stores a consumer id corresponding to a submitted consumer addition proposal +// SetProposalIdToConsumerId stores a consumer id corresponding to a proposal that contains a `MsgUpdateConsumer` mesage. // This consumer id is deleted once the voting period for the proposal ends. -func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, consumerId string, proposalID uint64) { +func (k Keeper) SetProposalIdToConsumerId(ctx sdk.Context, proposalId uint64, consumerId string) { store := ctx.KVStore(k.storeKey) - store.Set(types.ProposedConsumerChainKey(proposalID), []byte(consumerId)) + store.Set(types.ProposedConsumerChainKey(proposalId), []byte(consumerId)) } -// GetProposedConsumerChain returns the proposed consumerId for the given consumerAddition proposal ID. +// GetProposalIdToConsumerId returns the proposed consumer id for the given proposal id. // This method is only used for testing. -func (k Keeper) GetProposedConsumerChain(ctx sdk.Context, proposalID uint64) (string, bool) { +func (k Keeper) GetProposalIdToConsumerId(ctx sdk.Context, proposalId uint64) (string, bool) { store := ctx.KVStore(k.storeKey) - consumerChain := store.Get(types.ProposedConsumerChainKey(proposalID)) + consumerChain := store.Get(types.ProposedConsumerChainKey(proposalId)) if consumerChain != nil { return string(consumerChain), true } return "", false } -// DeleteProposedConsumerChainInStore deletes the consumer consumerId from store -// which is in gov consumerAddition proposal -func (k Keeper) DeleteProposedConsumerChainInStore(ctx sdk.Context, proposalID uint64) { +// DeleteProposalIdToConsumerId deletes the proposal to consumer id record from store +func (k Keeper) DeleteProposalIdToConsumerId(ctx sdk.Context, proposalId uint64) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ProposedConsumerChainKey(proposalID)) + store.Delete(types.ProposedConsumerChainKey(proposalId)) } -// GetAllProposedConsumerChainIDs returns the proposed consumerId of all gov consumerAddition proposals that are still in the voting period. +// GetAllProposedConsumerChainIDs returns the proposed consumer ids of all gov proposals that are still in the voting period func (k Keeper) GetAllProposedConsumerChainIDs(ctx sdk.Context) []types.ProposedChain { store := ctx.KVStore(k.storeKey) iterator := storetypes.KVStorePrefixIterator(store, types.ProposedConsumerChainKeyPrefix()) @@ -250,7 +249,7 @@ func (k Keeper) GetAllProposedConsumerChainIDs(ctx sdk.Context) []types.Proposed } proposedChains = append(proposedChains, types.ProposedChain{ - ChainID: string(iterator.Value()), + ConsumerId: string(iterator.Value()), ProposalID: proposalID, }) @@ -743,17 +742,24 @@ func (k Keeper) BondDenom(ctx sdk.Context) (string, error) { return k.stakingKeeper.BondDenom(ctx) } -func (k Keeper) GetAllRegisteredAndProposedChainIDs(ctx sdk.Context) []string { - allConsumerChains := []string{} - allConsumerChains = append(allConsumerChains, k.GetAllRegisteredConsumerIds(ctx)...) - proposedChains := k.GetAllProposedConsumerChainIDs(ctx) - for _, proposedChain := range proposedChains { - allConsumerChains = append(allConsumerChains, proposedChain.ChainID) +// GetAllActiveConsumerIds returns all the consumer ids of chains that are registered, initialized, or launched +func (k Keeper) GetAllActiveConsumerIds(ctx sdk.Context) []string { + latestConsumerId, found := k.GetConsumerId(ctx) + if !found { + return []string{} } - pendingChainIDs := k.GetAllPendingConsumerChainIDs(ctx) - allConsumerChains = append(allConsumerChains, pendingChainIDs...) - return allConsumerChains + consumerIds := []string{} + for i := uint64(0); i <= latestConsumerId; i++ { + consumerId := fmt.Sprintf("%d", i) + phase, foundPhase := k.GetConsumerPhase(ctx, consumerId) + if !foundPhase || (phase != Registered && phase != Initialized && phase != Launched) { + continue + } + consumerIds = append(consumerIds, consumerId) + } + + return consumerIds } // GetTopN returns N if chain `consumerId` has a top N associated, and 0 otherwise. diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 5419d8be30..d781164e5b 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -289,19 +289,19 @@ func TestSetProposedConsumerChains(t *testing.T) { defer ctrl.Finish() tests := []struct { - chainID string - proposalID uint64 + consumerId string + proposalId uint64 }{ - {chainID: "1", proposalID: 1}, - {chainID: "some other ID", proposalID: 12}, - {chainID: "some other other chain ID", proposalID: 123}, - {chainID: "", proposalID: 1234}, + {consumerId: "1", proposalId: 1}, + {consumerId: "some other ID", proposalId: 12}, + {consumerId: "some other other chain ID", proposalId: 123}, + {consumerId: "", proposalId: 1234}, } for _, test := range tests { - providerKeeper.SetProposedConsumerChain(ctx, test.chainID, test.proposalID) - cID, _ := providerKeeper.GetProposedConsumerChain(ctx, test.proposalID) - require.Equal(t, cID, test.chainID) + providerKeeper.SetProposalIdToConsumerId(ctx, test.proposalId, test.consumerId) + cID, _ := providerKeeper.GetProposalIdToConsumerId(ctx, test.proposalId) + require.Equal(t, cID, test.consumerId) } } @@ -310,23 +310,23 @@ func TestDeleteProposedConsumerChainInStore(t *testing.T) { defer ctrl.Finish() tests := []struct { - chainID string - proposalID uint64 - deleteProposalID uint64 + chainId string + proposalId uint64 + deleteProposalId uint64 ok bool }{ - {chainID: "1", proposalID: 1, deleteProposalID: 1, ok: true}, - {chainID: "", proposalID: 12, deleteProposalID: 12, ok: true}, - {chainID: "1", proposalID: 0, deleteProposalID: 1, ok: false}, + {chainId: "1", proposalId: 1, deleteProposalId: 1, ok: true}, + {chainId: "", proposalId: 12, deleteProposalId: 12, ok: true}, + {chainId: "1", proposalId: 0, deleteProposalId: 1, ok: false}, } for _, test := range tests { - providerKeeper.SetProposedConsumerChain(ctx, test.chainID, test.proposalID) - providerKeeper.DeleteProposedConsumerChainInStore(ctx, test.deleteProposalID) - cID, found := providerKeeper.GetProposedConsumerChain(ctx, test.proposalID) + providerKeeper.SetProposalIdToConsumerId(ctx, test.proposalId, test.chainId) + providerKeeper.DeleteProposalIdToConsumerId(ctx, test.deleteProposalId) + cID, found := providerKeeper.GetProposalIdToConsumerId(ctx, test.proposalId) if test.ok { require.False(t, found) } else { - require.Equal(t, cID, test.chainID) + require.Equal(t, cID, test.chainId) } } } @@ -338,21 +338,21 @@ func TestGetAllProposedConsumerChainIDs(t *testing.T) { {}, { { - ChainID: "1", + ConsumerId: "1", ProposalID: 1, }, }, { { - ChainID: "1", + ConsumerId: "1", ProposalID: 1, }, { - ChainID: "2", + ConsumerId: "2", ProposalID: 2, }, { - ChainID: "", + ConsumerId: "", ProposalID: 3, }, }, @@ -360,7 +360,7 @@ func TestGetAllProposedConsumerChainIDs(t *testing.T) { for _, test := range tests { for _, tc := range test { - providerKeeper.SetProposedConsumerChain(ctx, tc.ChainID, tc.ProposalID) + providerKeeper.SetProposalIdToConsumerId(ctx, tc.ProposalID, tc.ConsumerId) } chains := providerKeeper.GetAllProposedConsumerChainIDs(ctx) @@ -374,7 +374,7 @@ func TestGetAllProposedConsumerChainIDs(t *testing.T) { require.Equal(t, chains, test) for _, tc := range test { - providerKeeper.DeleteProposedConsumerChainInStore(ctx, tc.ProposalID) + providerKeeper.DeleteProposalIdToConsumerId(ctx, tc.ProposalID) } } } diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index 3d13c5b02c..2e3846feb4 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -548,7 +548,7 @@ func (k Keeper) DeleteKeyAssignments(ctx sdk.Context, consumerId string) { // IsConsumerProposedOrRegistered checks if a consumer chain is either registered, meaning either already running // or will run soon, or proposed its ConsumerAdditionProposal was submitted but the chain was not yet added to ICS yet. func (k Keeper) IsConsumerProposedOrRegistered(ctx sdk.Context, consumerId string) bool { - allConsumerChains := k.GetAllRegisteredAndProposedChainIDs(ctx) + allConsumerChains := k.GetAllActiveConsumerIds(ctx) for _, c := range allConsumerChains { if c == consumerId { return true @@ -577,8 +577,8 @@ func (k Keeper) ValidatorConsensusKeyInUse(ctx sdk.Context, valAddr sdk.ValAddre panic("could not get validator cons addr ") } - allConsumerChains := k.GetAllRegisteredAndProposedChainIDs(ctx) - for _, c := range allConsumerChains { + allConsumerIds := k.GetAllActiveConsumerIds(ctx) + for _, c := range allConsumerIds { if _, exist := k.GetValidatorByConsumerAddr(ctx, c, types.NewConsumerConsAddress(consensusAddr), diff --git a/x/ccv/provider/keeper/partial_set_security_test.go b/x/ccv/provider/keeper/partial_set_security_test.go index aa6f7e3fcd..c710e7f299 100644 --- a/x/ccv/provider/keeper/partial_set_security_test.go +++ b/x/ccv/provider/keeper/partial_set_security_test.go @@ -80,7 +80,7 @@ func TestHandleOptInWithConsumerKey(t *testing.T) { } gomock.InOrder(calls...) - providerKeeper.SetProposedConsumerChain(ctx, "consumerId", 1) + providerKeeper.SetProposalIdToConsumerId(ctx, 1, "consumerId") // create a sample consumer key to assign to the `providerAddr` validator // on the consumer chain with `consumerId` @@ -195,18 +195,20 @@ func TestHandleSetConsumerCommissionRate(t *testing.T) { require.Error(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, "unknownChainID", providerAddr, math.LegacyZeroDec())) // setup a pending consumer chain - chainID := "pendingChainID" - providerKeeper.SetPendingConsumerAdditionProp(ctx, &types.ConsumerAdditionProposal{ChainId: chainID}) + consumerId := "0" + providerKeeper.FetchAndIncrementConsumerId(ctx) + providerKeeper.SetConsumerPhase(ctx, consumerId, keeper.Initialized) + providerKeeper.SetPendingConsumerAdditionProp(ctx, &types.ConsumerAdditionProposal{ChainId: consumerId}) // check that there's no commission rate set for the validator yet - _, found := providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) + _, found := providerKeeper.GetConsumerCommissionRate(ctx, consumerId, providerAddr) require.False(t, found) mocks.MockStakingKeeper.EXPECT().MinCommissionRate(ctx).Return(math.LegacyZeroDec(), nil).Times(1) - require.NoError(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, chainID, providerAddr, math.LegacyOneDec())) + require.NoError(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, consumerId, providerAddr, math.LegacyOneDec())) // check that the commission rate is now set - cr, found := providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) + cr, found := providerKeeper.GetConsumerCommissionRate(ctx, consumerId, providerAddr) require.Equal(t, math.LegacyOneDec(), cr) require.True(t, found) @@ -217,16 +219,16 @@ func TestHandleSetConsumerCommissionRate(t *testing.T) { // try to set a rate slightly below the minimum require.Error(t, providerKeeper.HandleSetConsumerCommissionRate( ctx, - chainID, + consumerId, providerAddr, commissionRate.Sub(math.LegacyNewDec(1).Quo(math.LegacyNewDec(100)))), // 0.5 - 0.01 "commission rate should be rejected (below min), but is not", ) // set a valid commission equal to the minimum - require.NoError(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, chainID, providerAddr, commissionRate)) + require.NoError(t, providerKeeper.HandleSetConsumerCommissionRate(ctx, consumerId, providerAddr, commissionRate)) // check that the rate was set - cr, found = providerKeeper.GetConsumerCommissionRate(ctx, chainID, providerAddr) + cr, found = providerKeeper.GetConsumerCommissionRate(ctx, consumerId, providerAddr) require.Equal(t, commissionRate, cr) require.True(t, found) } diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index b3b878cb4b..e295b4b6e9 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -44,8 +44,8 @@ func (k Keeper) setConsumerId(ctx sdk.Context, consumerId uint64) { store.Set(types.ConsumerIdKey(), buf) } -// getConsumerId returns the last registered consumer id -func (k Keeper) getConsumerId(ctx sdk.Context) (uint64, bool) { +// GetConsumerId returns the last registered consumer id +func (k Keeper) GetConsumerId(ctx sdk.Context) (uint64, bool) { store := ctx.KVStore(k.storeKey) buf := store.Get(types.ConsumerIdKey()) if buf == nil { @@ -57,7 +57,7 @@ func (k Keeper) getConsumerId(ctx sdk.Context) (uint64, bool) { // FetchAndIncrementConsumerId fetches the first consumer id that can be used and increments the // underlying consumer id func (k Keeper) FetchAndIncrementConsumerId(ctx sdk.Context) string { - consumerId, _ := k.getConsumerId(ctx) + consumerId, _ := k.GetConsumerId(ctx) k.setConsumerId(ctx, consumerId+1) return strconv.FormatUint(consumerId, 10) } diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index ea480a8713..fe6f07fdea 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -936,8 +936,10 @@ func (m *QueryProposedChainIDsResponse) GetProposedChains() []ProposedChain { } type ProposedChain struct { - ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` + // [DEPRECATED] use `consumer_id` instead + ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` // Deprecated: Do not use. ProposalID uint64 `protobuf:"varint,2,opt,name=proposalID,proto3" json:"proposalID,omitempty"` + ConsumerId string `protobuf:"bytes,3,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"` } func (m *ProposedChain) Reset() { *m = ProposedChain{} } @@ -973,6 +975,7 @@ func (m *ProposedChain) XXX_DiscardUnknown() { var xxx_messageInfo_ProposedChain proto.InternalMessageInfo +// Deprecated: Do not use. func (m *ProposedChain) GetChainID() string { if m != nil { return m.ChainID @@ -987,6 +990,13 @@ func (m *ProposedChain) GetProposalID() uint64 { return 0 } +func (m *ProposedChain) GetConsumerId() string { + if m != nil { + return m.ConsumerId + } + return "" +} + type QueryAllPairsValConAddrByConsumerChainIDRequest struct { // [DEPRECATED] use `consumer_id` instead ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Deprecated: Do not use. @@ -1930,142 +1940,142 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 2151 bytes of a gzipped FileDescriptorProto + // 2154 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4d, 0x6c, 0xdc, 0xc6, - 0x15, 0x16, 0x77, 0x25, 0x45, 0x1a, 0xc5, 0x76, 0x32, 0x56, 0xe3, 0x35, 0x25, 0xef, 0x2a, 0x74, - 0xda, 0xca, 0xb2, 0x4b, 0x4a, 0x0a, 0x82, 0x24, 0x6e, 0x1d, 0x5b, 0xbb, 0xb2, 0xec, 0x85, 0x1d, - 0x5b, 0xa1, 0x65, 0xb7, 0x50, 0x9a, 0xd2, 0x14, 0x39, 0x5d, 0x11, 0xe6, 0x72, 0x28, 0x0e, 0xb5, - 0xf6, 0xc2, 0xf0, 0x21, 0x2d, 0x50, 0x24, 0x3d, 0x14, 0x06, 0x8a, 0x02, 0x3d, 0xe6, 0x52, 0xa0, - 0x87, 0x9e, 0x7a, 0x68, 0xd1, 0x5b, 0x8e, 0xb9, 0x35, 0x45, 0x2e, 0x45, 0x0b, 0xb8, 0x85, 0xdd, - 0x43, 0x51, 0xa0, 0x40, 0xeb, 0xf6, 0x5a, 0xa0, 0xe0, 0x70, 0xf8, 0x2b, 0xae, 0x96, 0xdc, 0x5d, + 0x15, 0x16, 0x77, 0x25, 0x45, 0x1a, 0xc5, 0x76, 0x32, 0x56, 0x63, 0x99, 0x92, 0x77, 0x15, 0x3a, + 0x6d, 0x65, 0xd9, 0x25, 0x25, 0x05, 0x41, 0x12, 0xb7, 0x8e, 0xad, 0x5d, 0x59, 0xf6, 0xc2, 0x8e, + 0xad, 0xd0, 0xb2, 0x5b, 0x28, 0x4d, 0x69, 0x8a, 0x9c, 0xae, 0x08, 0x73, 0x39, 0x14, 0x87, 0x5a, + 0x7b, 0x61, 0xf8, 0x90, 0x16, 0x28, 0x92, 0x1e, 0x0a, 0x03, 0x45, 0x81, 0x1e, 0x73, 0x29, 0xd0, + 0x43, 0x4f, 0x3d, 0xb4, 0xe8, 0x2d, 0xc7, 0xdc, 0x9a, 0x22, 0x97, 0xa2, 0x05, 0xdc, 0xc2, 0xee, + 0xa1, 0x28, 0x50, 0xa0, 0x75, 0x7b, 0x2d, 0x50,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83, 0xfd, 0x20, 0xf0, 0xfa, 0x80, - 0x9a, 0x65, 0x12, 0x2d, 0xfc, 0xbb, 0x23, 0x42, 0x63, 0x46, 0x5f, 0xa5, 0x46, 0x17, 0x4b, 0x0c, - 0x26, 0xe4, 0x01, 0x2a, 0x21, 0x87, 0x01, 0xff, 0xc7, 0x81, 0x13, 0xd9, 0x64, 0x0a, 0x81, 0xd7, - 0x06, 0x56, 0xfa, 0x20, 0x6b, 0xc3, 0x5f, 0x1f, 0x0d, 0x18, 0x73, 0xc0, 0x15, 0xea, 0x80, 0x35, - 0x78, 0x71, 0x00, 0x07, 0x60, 0x3b, 0x66, 0xff, 0xbf, 0x82, 0xb7, 0x68, 0xe6, 0xd3, 0x1f, 0x6e, - 0xe4, 0xd7, 0xfa, 0x30, 0xa6, 0x83, 0xbf, 0x32, 0x34, 0x0e, 0x33, 0x7c, 0x8d, 0x1a, 0xfe, 0x4d, - 0xf8, 0x76, 0x0e, 0xce, 0x3a, 0xa4, 0x79, 0x12, 0xad, 0x78, 0x86, 0xc9, 0xf1, 0xfe, 0x6f, 0x20, - 0x93, 0x33, 0xc8, 0x8d, 0x81, 0x4c, 0xce, 0xa2, 0x1d, 0x06, 0x33, 0x39, 0x71, 0x6f, 0xc3, 0xdf, - 0x73, 0xec, 0xa1, 0x90, 0x60, 0x1c, 0xe0, 0x3b, 0xf9, 0x55, 0xcc, 0x22, 0x32, 0xf8, 0x8b, 0x03, - 0xaf, 0x67, 0xa6, 0xbd, 0x45, 0x4d, 0x5b, 0x85, 0xcb, 0xfd, 0x4d, 0x73, 0x19, 0x80, 0xcf, 0x58, - 0xc3, 0x9f, 0x95, 0xd8, 0x7d, 0x78, 0x38, 0x85, 0x00, 0x6f, 0xe6, 0x57, 0x31, 0x17, 0x75, 0xc1, - 0x6f, 0x8e, 0x0e, 0x90, 0x39, 0xe1, 0x1a, 0x75, 0xc2, 0x65, 0xd8, 0xe8, 0xef, 0x04, 0x27, 0x44, - 0x8c, 0x72, 0xda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 0xcf, 0x9f, 0x55, 0xc6, 0xfe, 0xf8, 0xac, 0x32, 0xb6, 0x73, 0xa1, 0x69, 0xb8, 0x7b, 0x07, 0xbb, + 0xa2, 0x86, 0x5b, 0xec, 0xdf, 0x5b, 0x62, 0xbb, 0x7c, 0x23, 0xdc, 0xa5, 0xfd, 0x86, 0xf4, 0x20, + 0xd5, 0xa6, 0x77, 0x6c, 0x44, 0x76, 0x27, 0xe9, 0x1f, 0x1a, 0x5f, 0xff, 0x7f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xa1, 0xef, 0x28, 0x4e, 0x7e, 0x24, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3456,6 +3466,13 @@ func (m *ProposedChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ConsumerId) > 0 { + i -= len(m.ConsumerId) + copy(dAtA[i:], m.ConsumerId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsumerId))) + i-- + dAtA[i] = 0x1a + } if m.ProposalID != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ProposalID)) i-- @@ -4403,6 +4420,10 @@ func (m *ProposedChain) Size() (n int) { if m.ProposalID != 0 { n += 1 + sovQuery(uint64(m.ProposalID)) } + l = len(m.ConsumerId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -6508,6 +6529,38 @@ func (m *ProposedChain) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerId", 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.ConsumerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) From 81e51f0c641724e7677eb56bf6a343099bfe164b Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 22 Aug 2024 10:28:39 +0200 Subject: [PATCH 32/41] feat: extend consumer validator query to return commission rate (backport #2162) (#2165) * adapt #2162 changes for permissionless ICS * nits --------- Co-authored-by: kirdatatjana <116630536+kirdatatjana@users.noreply.github.com> --- tests/mbt/driver/setup.go | 5 ++++- x/ccv/provider/keeper/grpc_query.go | 2 +- x/ccv/provider/keeper/grpc_query_test.go | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/mbt/driver/setup.go b/tests/mbt/driver/setup.go index d9e658c030..adaa444167 100644 --- a/tests/mbt/driver/setup.go +++ b/tests/mbt/driver/setup.go @@ -12,6 +12,7 @@ import ( commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" ibctmtypes "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" ibctesting "github.com/cosmos/ibc-go/v8/testing" + "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" "github.com/stretchr/testify/require" @@ -388,7 +389,9 @@ func (s *Driver) ConfigureNewPath(consumerChain, providerChain *ibctesting.TestC require.NoError(s.t, err, "Error setting consumer genesis on provider for chain %v", consumerChain.ChainID) // set the top N percentage to 100 to simulate a full consumer - s.providerKeeper().SetTopN(providerChain.GetContext(), consumerChain.ChainID, 100) + s.providerKeeper().SetConsumerPowerShapingParameters(providerChain.GetContext(), consumerChain.ChainID, types.PowerShapingParameters{ + Top_N: 100, + }) // Client ID is set in InitGenesis and we treat it as a black box. So // must query it to use it with the endpoint. diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 4345e91d74..25774cf6f8 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -354,7 +354,7 @@ func (k Keeper) QueryConsumerValidators(goCtx context.Context, req *types.QueryC } var rate math.LegacyDec - consumerRate, found := k.GetConsumerCommissionRate(ctx, consumerChainID, types.NewProviderConsAddress(consAddr)) + consumerRate, found := k.GetConsumerCommissionRate(ctx, consumerId, types.NewProviderConsAddress(consAddr)) if found { rate = consumerRate } else { diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index a4e9d5d24c..f99b9e360f 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -2,9 +2,10 @@ package keeper_test import ( "fmt" - "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" "testing" + "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" From 18917377719af125ef7887d417b198edc5ccd237 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 21 Aug 2024 17:45:44 +0200 Subject: [PATCH 33/41] renamed some chainIds to consumerIds --- x/ccv/provider/client/cli/tx.go | 1 + x/ccv/provider/keeper/keeper.go | 2 +- x/ccv/provider/keeper/permissionless.go | 5 +- x/ccv/provider/keeper/proposal.go | 2 +- x/ccv/provider/keeper/relay.go | 104 ++++++++++++------------ 5 files changed, 57 insertions(+), 57 deletions(-) diff --git a/x/ccv/provider/client/cli/tx.go b/x/ccv/provider/client/cli/tx.go index 90624498a4..38f4724778 100644 --- a/x/ccv/provider/client/cli/tx.go +++ b/x/ccv/provider/client/cli/tx.go @@ -261,6 +261,7 @@ Example: } powerShapingParameters := types.PowerShapingParameters{} + powerShapingParametersJson, err := os.ReadFile(args[3]) if err != nil { return err diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 6c13ad4fb0..f834488a13 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -435,7 +435,7 @@ func (k Keeper) SetConsumerChain(ctx sdk.Context, channelID string) error { // Verify that there isn't already a CCV channel for the consumer chain chainID := tmClient.ChainId if prevChannelID, ok := k.GetConsumerIdToChannelId(ctx, consumerId); ok { - return errorsmod.Wrapf(ccv.ErrDuplicateChannel, "CCV channel with ID: %s already created for consumer chain %s", prevChannelID, chainID) + return errorsmod.Wrapf(ccv.ErrDuplicateChannel, "CCV channel with ID: %s already created for consumer chain with id %s", prevChannelID, consumerId) } // the CCV channel is established: diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index e295b4b6e9..8f76bea2ed 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -735,7 +735,7 @@ func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, pre // CanLaunch checks on whether the consumer with `consumerId` has set all the initialization parameters set and hence // is ready to launch func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) bool { - if initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err != nil { + if initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { initialHeightSet := initializationParameters.InitialHeight != nil genesisHashSet := initializationParameters.GenesisHash != nil binaryHashSet := initializationParameters.BinaryHash != nil @@ -750,10 +750,9 @@ func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) bool { consumerRedistributionFractionSet := initializationParameters.ConsumerRedistributionFraction != "" blocksPerDistributionTransmissionSet := initializationParameters.BlocksPerDistributionTransmission > 0 historicalEntriesSet := initializationParameters.HistoricalEntries > 0 - distributionTransmissionChannelSet := initializationParameters.DistributionTransmissionChannel != "" return initialHeightSet && genesisHashSet && binaryHashSet && spawnTimeSet && unbondingPeriodSet && ccvTimeoutPeriodSet && transferTimeoutPeriodSet && consumerRedistributionFractionSet && - blocksPerDistributionTransmissionSet && historicalEntriesSet && distributionTransmissionChannelSet + blocksPerDistributionTransmissionSet && historicalEntriesSet } return false } diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 7052e32457..fa73887891 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -45,7 +45,7 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { phase, found := k.GetConsumerPhase(ctx, consumerId) if !found || phase != Initialized { return errorsmod.Wrapf(types.ErrInvalidPhase, - "cannot create client for consumer chain that is not in the Created phase: %s", consumerId) + "cannot create client for consumer chain that is not in the Initialized phase: %s", consumerId) } chainId, err := k.GetConsumerChainId(ctx, consumerId) diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 6c6e6f5ef9..b0e8bb4e83 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -30,9 +30,9 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac "channelID", packet.SourceChannel, "error", err, ) - if chainID, ok := k.GetChannelIdToConsumerId(ctx, packet.SourceChannel); ok { + if consumerId, ok := k.GetChannelIdToConsumerId(ctx, packet.SourceChannel); ok { // stop consumer chain and release unbonding - return k.StopConsumerChain(ctx, chainID, false) + return k.StopConsumerChain(ctx, consumerId, false) } return errorsmod.Wrapf(providertypes.ErrUnknownConsumerChannelId, "recv ErrorAcknowledgement on unknown channel %s", packet.SourceChannel) } @@ -42,7 +42,7 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac // OnTimeoutPacket aborts the transaction if no chain exists for the destination channel, // otherwise it stops the chain func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) error { - chainID, found := k.GetChannelIdToConsumerId(ctx, packet.SourceChannel) + consumerId, found := k.GetChannelIdToConsumerId(ctx, packet.SourceChannel) if !found { k.Logger(ctx).Error("packet timeout, unknown channel:", "channelID", packet.SourceChannel) // abort transaction @@ -51,9 +51,9 @@ func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) err packet.SourceChannel, ) } - k.Logger(ctx).Info("packet timeout, removing the consumer:", "consumerId", chainID) + k.Logger(ctx).Info("packet timeout, removing the consumer:", "consumerId", consumerId) // stop consumer chain and release unbondings - return k.StopConsumerChain(ctx, chainID, false) + return k.StopConsumerChain(ctx, consumerId, false) } // EndBlockVSU contains the EndBlock logic needed for @@ -136,24 +136,24 @@ func (k Keeper) BlocksUntilNextEpoch(ctx sdk.Context) int64 { // If the CCV channel is not established for a consumer chain, // the updates will remain queued until the channel is established func (k Keeper) SendVSCPackets(ctx sdk.Context) { - for _, chainID := range k.GetAllRegisteredConsumerIds(ctx) { + for _, consumerId := range k.GetAllRegisteredConsumerIds(ctx) { // check if CCV channel is established and send - if channelID, found := k.GetConsumerIdToChannelId(ctx, chainID); found { - k.SendVSCPacketsToChain(ctx, chainID, channelID) + if channelID, found := k.GetConsumerIdToChannelId(ctx, consumerId); found { + k.SendVSCPacketsToChain(ctx, consumerId, channelID) } } } // SendVSCPacketsToChain sends all queued VSC packets to the specified chain -func (k Keeper) SendVSCPacketsToChain(ctx sdk.Context, chainID, channelID string) { - pendingPackets := k.GetPendingVSCPackets(ctx, chainID) +func (k Keeper) SendVSCPacketsToChain(ctx sdk.Context, consumerId, channelId string) { + pendingPackets := k.GetPendingVSCPackets(ctx, consumerId) for _, data := range pendingPackets { // send packet over IBC err := ccv.SendIBCPacket( ctx, k.scopedKeeper, k.channelKeeper, - channelID, // source channel id + channelId, // source channel id ccv.ProviderPortID, // source port id data.GetBytes(), k.GetCCVTimeoutPeriod(ctx), @@ -163,20 +163,20 @@ func (k Keeper) SendVSCPacketsToChain(ctx sdk.Context, chainID, channelID string // IBC client is expired! // leave the packet data stored to be sent once the client is upgraded // the client cannot expire during iteration (in the middle of a block) - k.Logger(ctx).Info("IBC client is expired, cannot send VSC, leaving packet data stored:", "consumerId", chainID, "vscid", data.ValsetUpdateId) + k.Logger(ctx).Info("IBC client is expired, cannot send VSC, leaving packet data stored:", "consumerId", consumerId, "vscid", data.ValsetUpdateId) return } // Not able to send packet over IBC! - k.Logger(ctx).Error("cannot send VSC, removing consumer:", "consumerId", chainID, "vscid", data.ValsetUpdateId, "err", err.Error()) + k.Logger(ctx).Error("cannot send VSC, removing consumer:", "consumerId", consumerId, "vscid", data.ValsetUpdateId, "err", err.Error()) // If this happens, most likely the consumer is malicious; remove it - err := k.StopConsumerChain(ctx, chainID, true) + err := k.StopConsumerChain(ctx, consumerId, true) if err != nil { panic(fmt.Errorf("consumer chain failed to stop: %w", err)) } return } } - k.DeletePendingVSCPackets(ctx, chainID) + k.DeletePendingVSCPackets(ctx, consumerId) } // QueueVSCPackets queues latest validator updates for every registered consumer chain @@ -192,12 +192,12 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { panic(fmt.Errorf("failed to get last validators: %w", err)) } - for _, chainID := range k.GetAllRegisteredConsumerIds(ctx) { - currentValidators, err := k.GetConsumerValSet(ctx, chainID) + for _, consumerId := range k.GetAllRegisteredConsumerIds(ctx) { + currentValidators, err := k.GetConsumerValSet(ctx, consumerId) if err != nil { panic(fmt.Errorf("failed to get consumer validators: %w", err)) } - topN := k.GetTopN(ctx, chainID) + topN := k.GetTopN(ctx, consumerId) if topN > 0 { // in a Top-N chain, we automatically opt in all validators that belong to the top N @@ -211,27 +211,27 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { minPower, err := k.ComputeMinPowerInTopN(ctx, activeValidators, topN) if err != nil { // we panic, since the only way to proceed would be to opt in all validators, which is not the intended behavior - panic(fmt.Errorf("failed to compute min power to opt in for chain %v: %w", chainID, err)) + panic(fmt.Errorf("failed to compute min power to opt in for chain %v: %w", consumerId, err)) } // set the minimal power of validators in the top N in the store - k.SetMinimumPowerInTopN(ctx, chainID, minPower) + k.SetMinimumPowerInTopN(ctx, consumerId, minPower) - k.OptInTopNValidators(ctx, chainID, activeValidators, minPower) + k.OptInTopNValidators(ctx, consumerId, activeValidators, minPower) } - nextValidators := k.ComputeNextValidators(ctx, chainID, bondedValidators) + nextValidators := k.ComputeNextValidators(ctx, consumerId, bondedValidators) valUpdates := DiffValidators(currentValidators, nextValidators) - k.SetConsumerValSet(ctx, chainID, nextValidators) + k.SetConsumerValSet(ctx, consumerId, nextValidators) // check whether there are changes in the validator set if len(valUpdates) != 0 { // construct validator set change packet data - packet := ccv.NewValidatorSetChangePacketData(valUpdates, valUpdateID, k.ConsumeSlashAcks(ctx, chainID)) - k.AppendPendingVSCPackets(ctx, chainID, packet) + packet := ccv.NewValidatorSetChangePacketData(valUpdates, valUpdateID, k.ConsumeSlashAcks(ctx, consumerId)) + k.AppendPendingVSCPackets(ctx, consumerId, packet) k.Logger(ctx).Info("VSCPacket enqueued:", - "consumerId", chainID, + "consumerId", consumerId, "vscID", valUpdateID, "len updates", len(valUpdates), ) @@ -266,8 +266,8 @@ func (k Keeper) EndBlockCIS(ctx sdk.Context) { k.Logger(ctx).Debug("vscID was mapped to block height", "vscID", valUpdateID, "height", blockHeight) // prune previous consumer validator addresses that are no longer needed - for _, chainID := range k.GetAllRegisteredConsumerIds(ctx) { - k.PruneKeyAssignments(ctx, chainID) + for _, consumerId := range k.GetAllRegisteredConsumerIds(ctx) { + k.PruneKeyAssignments(ctx, consumerId) } } @@ -279,7 +279,7 @@ func (k Keeper) OnRecvSlashPacket( data ccv.SlashPacketData, ) (ccv.PacketAckResult, error) { // check that the channel is established, panic if not - chainID, found := k.GetChannelIdToConsumerId(ctx, packet.DestinationChannel) + consumerId, found := k.GetChannelIdToConsumerId(ctx, packet.DestinationChannel) if !found { // SlashPacket packet was sent on a channel different than any of the established CCV channels; // this should never happen @@ -294,10 +294,10 @@ func (k Keeper) OnRecvSlashPacket( return nil, errorsmod.Wrapf(err, "error validating SlashPacket data") } - if err := k.ValidateSlashPacket(ctx, chainID, packet, data); err != nil { + if err := k.ValidateSlashPacket(ctx, consumerId, packet, data); err != nil { k.Logger(ctx).Error("invalid slash packet", "error", err.Error(), - "consumerId", chainID, + "consumerId", consumerId, "consumer cons addr", sdk.ConsAddress(data.Validator.Address).String(), "vscID", data.ValsetUpdateId, "infractionType", data.Infraction, @@ -308,15 +308,15 @@ func (k Keeper) OnRecvSlashPacket( // The slash packet validator address may be known only on the consumer chain, // in this case, it must be mapped back to the consensus address on the provider chain consumerConsAddr := providertypes.NewConsumerConsAddress(data.Validator.Address) - providerConsAddr := k.GetProviderAddrFromConsumerAddr(ctx, chainID, consumerConsAddr) + providerConsAddr := k.GetProviderAddrFromConsumerAddr(ctx, consumerId, consumerConsAddr) if data.Infraction == stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN { // getMappedInfractionHeight is already checked in ValidateSlashPacket - infractionHeight, _ := k.getMappedInfractionHeight(ctx, chainID, data.ValsetUpdateId) + infractionHeight, _ := k.getMappedInfractionHeight(ctx, consumerId, data.ValsetUpdateId) k.SetSlashLog(ctx, providerConsAddr) k.Logger(ctx).Info("SlashPacket received for double-signing", - "consumerId", chainID, + "consumerId", consumerId, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), "vscID", data.ValsetUpdateId, @@ -329,11 +329,11 @@ func (k Keeper) OnRecvSlashPacket( } // Check that the validator belongs to the consumer chain valset - if !k.IsConsumerValidator(ctx, chainID, providerConsAddr) { + if !k.IsConsumerValidator(ctx, consumerId, providerConsAddr) { k.Logger(ctx).Error("cannot jail validator %s that does not belong to consumer %s valset", - providerConsAddr.String(), chainID) + providerConsAddr.String(), consumerId) // drop packet but return a slash ack so that the consumer can send another slash packet - k.AppendSlashAck(ctx, chainID, consumerConsAddr.String()) + k.AppendSlashAck(ctx, consumerId, consumerConsAddr.String()) return ccv.SlashPacketHandledResult, nil } @@ -342,7 +342,7 @@ func (k Keeper) OnRecvSlashPacket( // Return bounce ack if meter is negative in value if meter.IsNegative() { k.Logger(ctx).Info("SlashPacket received, but meter is negative. Packet will be bounced", - "consumerId", chainID, + "consumerId", consumerId, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), "vscID", data.ValsetUpdateId, @@ -356,10 +356,10 @@ func (k Keeper) OnRecvSlashPacket( meter = meter.Sub(k.GetEffectiveValPower(ctx, providerConsAddr)) k.SetSlashMeter(ctx, meter) - k.HandleSlashPacket(ctx, chainID, data) + k.HandleSlashPacket(ctx, consumerId, data) k.Logger(ctx).Info("slash packet received and handled", - "consumerId", chainID, + "consumerId", consumerId, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), "vscID", data.ValsetUpdateId, @@ -373,14 +373,14 @@ func (k Keeper) OnRecvSlashPacket( // ValidateSlashPacket validates a recv slash packet before it is // handled or persisted in store. An error is returned if the packet is invalid, // and an error ack should be relayed to the sender. -func (k Keeper) ValidateSlashPacket(ctx sdk.Context, chainID string, +func (k Keeper) ValidateSlashPacket(ctx sdk.Context, consumerId string, packet channeltypes.Packet, data ccv.SlashPacketData, ) error { - _, found := k.getMappedInfractionHeight(ctx, chainID, data.ValsetUpdateId) + _, found := k.getMappedInfractionHeight(ctx, consumerId, data.ValsetUpdateId) // return error if we cannot find infraction height matching the validator update id if !found { return fmt.Errorf("cannot find infraction height matching "+ - "the validator update id %d for chain %s", data.ValsetUpdateId, chainID) + "the validator update id %d for chain %s", data.ValsetUpdateId, consumerId) } return nil @@ -388,13 +388,13 @@ func (k Keeper) ValidateSlashPacket(ctx sdk.Context, chainID string, // HandleSlashPacket potentially jails a misbehaving validator for a downtime infraction. // This method should NEVER be called with a double-sign infraction. -func (k Keeper) HandleSlashPacket(ctx sdk.Context, chainID string, data ccv.SlashPacketData) { +func (k Keeper) HandleSlashPacket(ctx sdk.Context, consumerId string, data ccv.SlashPacketData) { consumerConsAddr := providertypes.NewConsumerConsAddress(data.Validator.Address) // Obtain provider chain consensus address using the consumer chain consensus address - providerConsAddr := k.GetProviderAddrFromConsumerAddr(ctx, chainID, consumerConsAddr) + providerConsAddr := k.GetProviderAddrFromConsumerAddr(ctx, consumerId, consumerConsAddr) k.Logger(ctx).Debug("HandleSlashPacket", - "consumerId", chainID, + "consumerId", consumerId, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), "vscID", data.ValsetUpdateId, @@ -429,7 +429,7 @@ func (k Keeper) HandleSlashPacket(ctx sdk.Context, chainID string, data ccv.Slas return } - infractionHeight, found := k.getMappedInfractionHeight(ctx, chainID, data.ValsetUpdateId) + infractionHeight, found := k.getMappedInfractionHeight(ctx, consumerId, data.ValsetUpdateId) if !found { k.Logger(ctx).Error( "HandleSlashPacket - infraction height not found. But was found during slash packet validation", @@ -442,9 +442,9 @@ func (k Keeper) HandleSlashPacket(ctx sdk.Context, chainID string, data ccv.Slas // Note: the SlashPacket is for downtime infraction, as SlashPackets // for double-signing infractions are already dropped when received - // append the validator address to the slash ack for its chain id + // append the validator address to the slash ack for its consumer id // TODO: consumer cons address should be accepted here - k.AppendSlashAck(ctx, chainID, consumerConsAddr.String()) + k.AppendSlashAck(ctx, consumerId, consumerConsAddr.String()) // jail validator if !validator.IsJailed() { @@ -479,12 +479,12 @@ func (k Keeper) HandleSlashPacket(ctx sdk.Context, chainID string, data ccv.Slas ) } -// getMappedInfractionHeight gets the infraction height mapped from val set ID for the given chain ID +// getMappedInfractionHeight gets the infraction height mapped from val set ID for the given consumer id func (k Keeper) getMappedInfractionHeight(ctx sdk.Context, - chainID string, valsetUpdateID uint64, + consumerId string, valsetUpdateID uint64, ) (height uint64, found bool) { if valsetUpdateID == 0 { - return k.GetInitChainHeight(ctx, chainID) + return k.GetInitChainHeight(ctx, consumerId) } else { return k.GetValsetUpdateBlockHeight(ctx, valsetUpdateID) } From 22fcb6d569b272ee34806aa197cd3a0978db3258 Mon Sep 17 00:00:00 2001 From: insumity Date: Thu, 22 Aug 2024 14:28:40 +0200 Subject: [PATCH 34/41] took into account comments and also added safeguard to reject new proposals that still use deprecated messages (e.g., MsgConsumerAddition, etc.) --- .../ccv/provider/v1/provider.proto | 45 +- testutil/ibc_testing/generic_setup.go | 6 +- testutil/keeper/unit_test_helpers.go | 10 +- x/ccv/provider/client/cli/tx.go | 8 +- x/ccv/provider/keeper/hooks.go | 20 +- x/ccv/provider/keeper/keeper.go | 34 +- x/ccv/provider/keeper/msg_server.go | 42 +- x/ccv/provider/keeper/permissionless.go | 116 +--- x/ccv/provider/keeper/permissionless_test.go | 20 +- x/ccv/provider/keeper/proposal.go | 18 +- x/ccv/provider/keeper/proposal_test.go | 69 +- x/ccv/provider/types/codec.go | 4 - x/ccv/provider/types/errors.go | 72 ++- x/ccv/provider/types/keys.go | 37 +- x/ccv/provider/types/keys_test.go | 30 +- x/ccv/provider/types/legacy_proposal.go | 4 +- x/ccv/provider/types/legacy_proposal_test.go | 4 +- x/ccv/provider/types/msg.go | 218 +++++-- x/ccv/provider/types/provider.pb.go | 602 +++++++----------- 19 files changed, 589 insertions(+), 770 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 28372dda79..b6a08c5c03 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -386,22 +386,22 @@ message ConsumerInitializationParameters { // the proposed initial height of new consumer chain. // For a completely new chain, this will be {0,1}. However, it may be // different if this is a chain that is converting to a consumer chain. - ibc.core.client.v1.Height initial_height = 1 [ (gogoproto.nullable) = true ]; + ibc.core.client.v1.Height initial_height = 1 [ (gogoproto.nullable) = false ]; // The hash of the consumer chain genesis state without the consumer CCV // module genesis params. It is used for off-chain confirmation of // genesis.json validity by validators and other parties. - bytes genesis_hash = 2 [ (gogoproto.nullable) = true ]; + bytes genesis_hash = 2; // The hash of the consumer chain binary that should be run by validators on // chain initialization. It is used for off-chain confirmation of binary // validity by validators and other parties. - bytes binary_hash = 3 [ (gogoproto.nullable) = true ]; + bytes binary_hash = 3; // spawn time is the time on the provider chain at which the consumer chain // genesis is finalized and all validators will be responsible for starting // their consumer chain validator node. - google.protobuf.Timestamp spawn_time = 4 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = true ]; + google.protobuf.Timestamp spawn_time = 4 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; // Unbonding period for the consumer, // which should be smaller than that of the provider in general. - google.protobuf.Duration unbonding_period = 5 [ (gogoproto.nullable) = true, (gogoproto.stdduration) = true ]; + google.protobuf.Duration unbonding_period = 5 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; // ---------- ---------- ---------- @@ -410,29 +410,29 @@ message ConsumerInitializationParameters { // ---------- ---------- ---------- // Sent CCV related IBC packets will timeout after this duration - google.protobuf.Duration ccv_timeout_period = 6 [ (gogoproto.nullable) = true, (gogoproto.stdduration) = true ]; + google.protobuf.Duration ccv_timeout_period = 6 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; // Sent transfer related IBC packets will timeout after this duration - google.protobuf.Duration transfer_timeout_period = 7 [ (gogoproto.nullable) = true, (gogoproto.stdduration) = true ]; + google.protobuf.Duration transfer_timeout_period = 7 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; // The fraction of tokens allocated to the consumer redistribution address // during distribution events. The fraction is a string representing a // decimal number. For example "0.75" would represent 75%. - string consumer_redistribution_fraction = 8 [ (gogoproto.nullable) = true ]; + string consumer_redistribution_fraction = 8; // BlocksPerDistributionTransmission is the number of blocks between // ibc-token-transfers from the consumer chain to the provider chain. On // sending transmission event, `consumer_redistribution_fraction` of the // accumulated tokens are sent to the consumer redistribution address. - int64 blocks_per_distribution_transmission = 9 [ (gogoproto.nullable) = true ]; + int64 blocks_per_distribution_transmission = 9; // The number of historical info entries to persist in store. // This param is a part of the cosmos sdk staking module. In the case of // a ccv enabled consumer chain, the ccv module acts as the staking module. - int64 historical_entries = 10 [ (gogoproto.nullable) = true ]; + int64 historical_entries = 10; // The ID of a token transfer channel used for the Reward Distribution // sub-protocol. If DistributionTransmissionChannel == "", a new transfer // channel is created on top of the same connection as the CCV channel. // Note that transfer_channel_id is the ID of the channel end on the consumer // chain. it is most relevant for chains performing a sovereign to consumer // changeover in order to maintain the existing ibc transfer channel - string distribution_transmission_channel = 11 [ (gogoproto.nullable) = true ]; + string distribution_transmission_channel = 11; } // PowerShapingParameters contains parameters that shape the validator set that we send to the consumer chain @@ -441,31 +441,22 @@ message PowerShapingParameters { // For example, 53 corresponds to a Top 53% chain, meaning that the top 53% provider validators by voting power // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. - uint32 top_N = 1 [ (gogoproto.nullable) = true ]; - // We cannot use `optional` for `top_N` due to having plugins `gocosmos` and `grpc-gateway` do not support it. - // To distinguish between a set `top_N` to 0 and one that is not, we introduce a new field. - bool is_top_N_set = 2 [ (gogoproto.nullable) = true ]; + uint32 top_N = 1; // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - uint32 validators_power_cap = 3 [ (gogoproto.nullable) = true ]; + uint32 validators_power_cap = 2; // Corresponds to the maximum number of validators that can validate a consumer chain. // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - uint32 validator_set_cap = 4 [ (gogoproto.nullable) = true ]; + uint32 validator_set_cap = 3; // corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate the consumer chain - repeated string allowlist = 5 [ (gogoproto.nullable) = true ]; + repeated string allowlist = 4; // corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain - repeated string denylist = 6 [ (gogoproto.nullable) = true ]; + repeated string denylist = 5; // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - uint64 min_stake = 7 [ (gogoproto.nullable) = true ]; - // We cannot use `optional` for `min_stake` due to having plugins `gocosmos` and `grpc-gateway` do not support it. - // To distinguish between a set `min_stake` to 0 and one that is not, we introduce a new field. - bool is_min_stake_set = 8 [ (gogoproto.nullable) = true ]; + uint64 min_stake = 6; // Corresponds to whether inactive validators are allowed to validate the consumer chain. - bool allow_inactive_vals = 9 [ (gogoproto.nullable) = true ]; - // We cannot use `optional` for `allow_inactive_vals` due to having plugins `gocosmos` and `grpc-gateway` do not support it. - // To distinguish between a set `allow_inactive_vals` to `false` and one that is not, we introduce a new field. - bool is_allow_inactive_vals_set = 10 [ (gogoproto.nullable) = true ]; + bool allow_inactive_vals = 7; } diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index ae24ba9a5b..d9aa02d732 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -3,10 +3,10 @@ package ibc_testing import ( "encoding/json" "fmt" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" "testing" - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" ibctesting "github.com/cosmos/ibc-go/v8/testing" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" "github.com/stretchr/testify/require" @@ -145,10 +145,10 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( initializationParameters := testkeeper.GetTestInitializationParameters() // NOTE: we cannot use the time.Now() because the coordinator chooses a hardcoded start time // using time.Now() could set the spawn time to be too far in the past or too far in the future - initializationParameters.SpawnTime = &coordinator.CurrentTime + initializationParameters.SpawnTime = coordinator.CurrentTime // NOTE: the initial height passed to CreateConsumerClient // must be the height on the consumer when InitGenesis is called - initializationParameters.InitialHeight = &clienttypes.Height{RevisionNumber: 0, RevisionHeight: 2} + initializationParameters.InitialHeight = clienttypes.Height{RevisionNumber: 0, RevisionHeight: 2} powerShapingParameters := testkeeper.GetTestPowerShapingParameters() powerShapingParameters.Top_N = consumerTopNParams[index] // isn't used in CreateConsumerClient diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index fad02fd99a..ef8d3a747f 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -288,17 +288,17 @@ func GetTestInitializationParameters() providertypes.ConsumerInitializationParam transferTimeoutPeriod := types.DefaultTransferTimeoutPeriod unbondingPeriod := types.DefaultConsumerUnbondingPeriod return providertypes.ConsumerInitializationParameters{ - InitialHeight: &initialHeight, + InitialHeight: initialHeight, GenesisHash: []byte("gen_hash"), BinaryHash: []byte("bin_hash"), - SpawnTime: &spawnTime, + SpawnTime: spawnTime, ConsumerRedistributionFraction: types.DefaultConsumerRedistributeFrac, BlocksPerDistributionTransmission: types.DefaultBlocksPerDistributionTransmission, DistributionTransmissionChannel: "", HistoricalEntries: types.DefaultHistoricalEntries, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, - UnbondingPeriod: &unbondingPeriod, + CcvTimeoutPeriod: ccvTimeoutPeriod, + TransferTimeoutPeriod: transferTimeoutPeriod, + UnbondingPeriod: unbondingPeriod, } } diff --git a/x/ccv/provider/client/cli/tx.go b/x/ccv/provider/client/cli/tx.go index 38f4724778..4a7cef864f 100644 --- a/x/ccv/provider/client/cli/tx.go +++ b/x/ccv/provider/client/cli/tx.go @@ -215,7 +215,7 @@ Example: func NewCreateConsumerCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "create-consumer [chain-id] [path/to/metadata.json] [path/to/initialization-parameters.json] [path/to/power-shaping-parameters.json]", + Use: "create-consumer [chain-id] [metadata] [initialization-parameters] [power-shaping-parameters]", Short: "create a consumer chain", Long: strings.TrimSpace( fmt.Sprintf(`Create a consumer chain and get the assigned consumer id of this chain. @@ -270,7 +270,7 @@ Example: return fmt.Errorf("power-shaping parameters unmarshalling failed: %w", err) } - msg, err := types.NewMsgCreateConsumer(signer, chainId, metadata, initializationParameters, powerShapingParameters) + msg, err := types.NewMsgCreateConsumer(signer, chainId, metadata, &initializationParameters, &powerShapingParameters) if err != nil { return err } @@ -291,7 +291,7 @@ Example: func NewUpdateConsumerCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "update-consumer [consumer-id] [owner-address] [path/to/metadata.json] [path/to/initialization-parameters.json] [path/to/power-shaping-parameters.json]", + Use: "update-consumer [consumer-id] [owner-address] [metadata] [initialization-parameters] [power-shaping-parameters]", Short: "update a consumer chain", Long: strings.TrimSpace( fmt.Sprintf(`Update a consumer chain to change its parameters (e.g., spawn time, allow list, etc.). @@ -344,7 +344,7 @@ Example: return fmt.Errorf("power-shaping parameters unmarshalling failed: %w", err) } - msg, err := types.NewMsgUpdateConsumer(signer, consumerId, ownerAddress, metadata, initializationParameters, powerShapingParameters) + msg, err := types.NewMsgUpdateConsumer(signer, consumerId, ownerAddress, &metadata, &initializationParameters, &powerShapingParameters) if err != nil { return err } diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index b4ebfb919a..b8040fd355 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -115,17 +115,31 @@ func (h Hooks) AfterProposalSubmission(goCtx context.Context, proposalId uint64) return fmt.Errorf("cannot retrieve proposal with id: %d", proposalId) } - // a proposal can contain at most one `MsgUpdateConsumer` message hasUpdateConsumerMsg := false for _, msg := range p.GetMessages() { - sdkMsg, isUpdateConsumer := msg.GetCachedValue().(*providertypes.MsgUpdateConsumer) - if isUpdateConsumer { + sdkMsg, isMsgUpdateConsumer := msg.GetCachedValue().(*providertypes.MsgUpdateConsumer) + if isMsgUpdateConsumer { if hasUpdateConsumerMsg { return fmt.Errorf("proposal can contain at most one `MsgUpdateConsumer` message") } hasUpdateConsumerMsg = true h.k.SetProposalIdToConsumerId(ctx, proposalId, sdkMsg.ConsumerId) } + + // if the proposal contains a deprecated message, cancel the proposal + _, isMsgConsumerAddition := msg.GetCachedValue().(*providertypes.MsgConsumerAddition) + if isMsgConsumerAddition { + return fmt.Errorf("proposal cannot contain deprecated `MsgConsumerAddition`; use `MsgCreateConsumer` instead") + } + + _, isMsgConsumerModification := msg.GetCachedValue().(*providertypes.MsgConsumerModification) + if isMsgConsumerModification { + return fmt.Errorf("proposal cannot contain deprecated `MsgConsumerModification`; use `MsgUpdateConsumer` instead") + } + _, isMsgConsumerRemoval := msg.GetCachedValue().(*providertypes.MsgConsumerRemoval) + if isMsgConsumerRemoval { + return fmt.Errorf("proposal cannot contain deprecated `MsgConsumerRemoval`; use `MsgRemoveConsumer` instead") + } } return nil diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index f834488a13..46f641f660 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -767,7 +767,11 @@ func (k Keeper) GetTopN( ctx sdk.Context, consumerId string, ) uint32 { - powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + if err != nil { + k.Logger(ctx).Error("could not retrieve power shaping parameters", "error", err) + } + return powerShapingParameters.Top_N } @@ -917,21 +921,27 @@ func (k Keeper) DeleteConsumerCommissionRate( store.Delete(types.ConsumerCommissionRateKey(consumerId, providerAddr)) } -// GetValidatorsPowerCap returns `(p, true)` if chain `consumerId` has power cap `p` associated with it, and (0, false) otherwise +// GetValidatorsPowerCap returns the associated power cap of chain with `consumerId` and 0 if no power cap association is found func (k Keeper) GetValidatorsPowerCap( ctx sdk.Context, consumerId string, ) uint32 { - powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + if err != nil { + k.Logger(ctx).Error("could not retrieve power shaping parameters", "error", err) + } return powerShapingParameters.ValidatorsPowerCap } -// GetValidatorSetCap returns `(c, true)` if chain `consumerId` has validator-set cap `c` associated with it, and (0, false) otherwise +// GetValidatorSetCap returns the associated validator set cap of chain with `consumerId` and 0 if no set cap association is found func (k Keeper) GetValidatorSetCap( ctx sdk.Context, consumerId string, ) uint32 { - powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + if err != nil { + k.Logger(ctx).Error("could not retrieve power shaping parameters", "error", err) + } return powerShapingParameters.ValidatorSetCap } @@ -1101,22 +1111,28 @@ func (k Keeper) DeleteMinimumPowerInTopN( } // GetMinStake returns the minimum stake required for a validator to validate -// a given consumer chain. +// a given consumer chain. Returns 0 if min stake is not found for this consumer id. func (k Keeper) GetMinStake( ctx sdk.Context, consumerId string, ) uint64 { - powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + if err != nil { + k.Logger(ctx).Error("could not retrieve power shaping parameters", "error", err) + } return powerShapingParameters.MinStake } // AllowsInactiveValidators returns whether inactive validators are allowed to validate -// a given consumer chain. +// a given consumer chain. Returns false if flag on inactive validators is not found for this consumer id. func (k Keeper) AllowsInactiveValidators( ctx sdk.Context, consumerId string, ) bool { - powerShapingParameters, _ := k.GetConsumerPowerShapingParameters(ctx, consumerId) + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + if err != nil { + k.Logger(ctx).Error("could not retrieve power shaping parameters", "error", err) + } return powerShapingParameters.AllowInactiveVals } diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 6305d66ca5..8fd3b93857 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -335,7 +335,7 @@ func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateCon if k.CanLaunch(ctx, consumerId) { k.SetConsumerPhase(ctx, consumerId, Initialized) - k.PrepareConsumerForLaunch(ctx, consumerId, nil, *msg.InitializationParameters.SpawnTime) + k.PrepareConsumerForLaunch(ctx, consumerId, time.Time{}, msg.InitializationParameters.SpawnTime) } else { k.SetConsumerPhase(ctx, consumerId, Registered) } @@ -354,18 +354,16 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon ownerAddress, err := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) if err != nil { - // TODO (PERMISSIONLESS): use a better error message - return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidConsumerId, "cannot retrieve owner address %s", ownerAddress) + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrNoOwnerAddress, "cannot retrieve owner address %s", ownerAddress) } - if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.IsTop_NSet && msg.PowerShapingParameters.Top_N > 0 && msg.Signer != k.GetAuthority() { - // TODO (PERMISSIONLESS): use a better error message - return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidPhase, "an update to a Top N chain can only be done through a governance proposal") + if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.Top_N > 0 && msg.Signer != k.GetAuthority() { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidTransformToTopN, "an update to a Top N chain can only be done through a governance proposal") } - if k.GetAuthority() == msg.Signer { + if msg.Signer == k.GetAuthority() { // message is executed as part of governance proposal - if msg.PowerShapingParameters.IsTop_NSet && msg.PowerShapingParameters.Top_N == 0 { + if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.Top_N == 0 { // chain becomes an Opt In chain, hence we change the owner address k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) } else { @@ -375,43 +373,31 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon } } else if msg.Signer == ownerAddress { k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) - } else if msg.Signer != ownerAddress { + } else { + // else means that `msg.Signer != k.GetAuthority` && `msgSigner != ownerAddress` return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Signer) } if msg.Metadata != nil { - if oldMetadata, err := k.Keeper.GetConsumerMetadata(ctx, msg.ConsumerId); err == nil { - k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, MergeConsumerMetadata(oldMetadata, *msg.Metadata)) - } else { - // TODO (PERMISSIONLESS): probably we should return an error - k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, *msg.Metadata) - } + k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, *msg.Metadata) } - var previousSpawnTime *time.Time + var previousSpawnTime time.Time if previousParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { previousSpawnTime = previousParameters.SpawnTime } if msg.InitializationParameters != nil { - if oldInitializationParameters, err := k.Keeper.GetConsumerInitializationParameters(ctx, msg.ConsumerId); err == nil { - k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, MergeConsumerInitializationParameters(oldInitializationParameters, *msg.InitializationParameters)) - } else { - k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, *msg.InitializationParameters) - } + k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, *msg.InitializationParameters) } if msg.PowerShapingParameters != nil { - if oldPowerShapingParameters, err := k.Keeper.GetConsumerPowerShapingParameters(ctx, msg.ConsumerId); err == nil { - k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, MergePowerShapingParameters(oldPowerShapingParameters, *msg.PowerShapingParameters)) - } else { - k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, *msg.PowerShapingParameters) - } + k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, *msg.PowerShapingParameters) } - if k.CanLaunch(ctx, msg.ConsumerId) { + if k.CanLaunch(ctx, consumerId) { k.SetConsumerPhase(ctx, consumerId, Initialized) - k.PrepareConsumerForLaunch(ctx, consumerId, previousSpawnTime, *msg.InitializationParameters.SpawnTime) + k.PrepareConsumerForLaunch(ctx, consumerId, previousSpawnTime, msg.InitializationParameters.SpawnTime) } return &types.MsgUpdateConsumerResponse{}, nil diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 8f76bea2ed..631e070258 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -9,7 +9,6 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" - "sort" "strconv" "time" ) @@ -278,11 +277,6 @@ func (k Keeper) AppendSpawnTimeForConsumerToBeLaunched(ctx sdk.Context, consumer } consumerIds = append(consumerIds, consumerId) - // sort so that we avoid getting a consumer id in front of everyone else and delaying the appending of a chain - sort.Slice(consumerIds, func(i, j int) bool { - return consumerIds[i] < consumerIds[j] - }) - var buf bytes.Buffer enc := gob.NewEncoder(&buf) err = enc.Encode(consumerIds) @@ -336,7 +330,7 @@ func (k Keeper) RemoveConsumerFromToBeLaunchedConsumers(ctx sdk.Context, consume return nil } -// TODO (PERMISSIONLESS) merge the functions, they practicall do the same +// TODO (PERMISSIONLESS) merge the functions, they practically do the same // GetConsumersToBeStopped func (k Keeper) GetConsumersToBeStopped(ctx sdk.Context, stopTime time.Time) ([]string, error) { @@ -363,11 +357,6 @@ func (k Keeper) AppendStopTimeForConsumerToBeStopped(ctx sdk.Context, consumerId } consumerIds = append(consumerIds, consumerId) - // sort so that we avoid getting a consumer id in front of everyone else and delying the removal of a chain - sort.Slice(consumerIds, func(i, j int) bool { - return consumerIds[i] < consumerIds[j] - }) - var buf bytes.Buffer enc := gob.NewEncoder(&buf) err = enc.Encode(consumerIds) @@ -598,7 +587,7 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) if err != nil { // TODO (permissionless) -- not really an invalid update record - return errorsmod.Wrapf(types.ErrInvalidPowerShapingParametersRecord, + return errorsmod.Wrapf(types.ErrInvalidPowerShapingParameters, "did not find update record for chain: %s", consumerId) } @@ -687,8 +676,6 @@ func (k Keeper) GetLaunchedConsumersReadyToStop(ctx sdk.Context, limit uint32) [ } else { result = append(result, consumerIds...) } - - consumerIds = append(consumerIds, string(iterator.Key()[1+8:])) } return result @@ -723,113 +710,26 @@ func (k Keeper) IsValidatorOptedInToChainId(ctx sdk.Context, providerAddr types. return "", false } -func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, previousSpawnTime *time.Time, spawnTime time.Time) { - if previousSpawnTime != nil { - // if this is not the first initialization, remove the consumer id from the old spawn time - k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, *previousSpawnTime) - } +func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, previousSpawnTime time.Time, spawnTime time.Time) { + // if this is not the first initialization, remove the consumer id from the old spawn time + k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) k.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, spawnTime) } // CanLaunch checks on whether the consumer with `consumerId` has set all the initialization parameters set and hence // is ready to launch +// TODO (PERMISSIONLESS): could remove, all fields should be there because we validate the initialization parameters func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) bool { if initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { - initialHeightSet := initializationParameters.InitialHeight != nil genesisHashSet := initializationParameters.GenesisHash != nil binaryHashSet := initializationParameters.BinaryHash != nil - spawnTimeSet := initializationParameters.SpawnTime != nil - unbondingPeriodSet := initializationParameters.UnbondingPeriod != nil - - ccvTimeoutPeriodSet := initializationParameters.CcvTimeoutPeriod != nil - transferTimeoutPeriodSet := initializationParameters.TransferTimeoutPeriod != nil - // TODO (PERMISSIONLESS): we should verify we can parse this at some point - // and that the values below are not negative, etc. consumerRedistributionFractionSet := initializationParameters.ConsumerRedistributionFraction != "" blocksPerDistributionTransmissionSet := initializationParameters.BlocksPerDistributionTransmission > 0 historicalEntriesSet := initializationParameters.HistoricalEntries > 0 - return initialHeightSet && genesisHashSet && binaryHashSet && spawnTimeSet && unbondingPeriodSet && - ccvTimeoutPeriodSet && transferTimeoutPeriodSet && consumerRedistributionFractionSet && - blocksPerDistributionTransmissionSet && historicalEntriesSet + return genesisHashSet && binaryHashSet && + consumerRedistributionFractionSet && blocksPerDistributionTransmissionSet && historicalEntriesSet } return false } - -// Could be done with reflect but we want to avoid using it ...?? -func MergeConsumerMetadata(oldMetadata types.ConsumerMetadata, newMetadata types.ConsumerMetadata) types.ConsumerMetadata { - if newMetadata.Name != "" { - oldMetadata.Name = newMetadata.Name - } - if newMetadata.Metadata != "" { - oldMetadata.Metadata = newMetadata.Metadata - } - if newMetadata.Description != "" { - oldMetadata.Description = newMetadata.Description - } - return oldMetadata -} - -func MergeConsumerInitializationParameters(oldInitializationParameters types.ConsumerInitializationParameters, newInitializationParameters types.ConsumerInitializationParameters) types.ConsumerInitializationParameters { - if newInitializationParameters.InitialHeight != nil { - oldInitializationParameters.InitialHeight = newInitializationParameters.InitialHeight - } - if newInitializationParameters.GenesisHash != nil { - oldInitializationParameters.GenesisHash = newInitializationParameters.GenesisHash - } - if newInitializationParameters.BinaryHash != nil { - oldInitializationParameters.GenesisHash = newInitializationParameters.GenesisHash - } - if newInitializationParameters.SpawnTime != nil { - oldInitializationParameters.SpawnTime = newInitializationParameters.SpawnTime - } - if newInitializationParameters.UnbondingPeriod != nil { - oldInitializationParameters.UnbondingPeriod = newInitializationParameters.UnbondingPeriod - } - if newInitializationParameters.CcvTimeoutPeriod != nil { - oldInitializationParameters.CcvTimeoutPeriod = newInitializationParameters.CcvTimeoutPeriod - } - if newInitializationParameters.TransferTimeoutPeriod != nil { - oldInitializationParameters.TransferTimeoutPeriod = newInitializationParameters.TransferTimeoutPeriod - } - if newInitializationParameters.ConsumerRedistributionFraction != "" { - oldInitializationParameters.ConsumerRedistributionFraction = newInitializationParameters.ConsumerRedistributionFraction - } - if newInitializationParameters.BlocksPerDistributionTransmission > 0 { - oldInitializationParameters.BlocksPerDistributionTransmission = newInitializationParameters.BlocksPerDistributionTransmission - } - if newInitializationParameters.HistoricalEntries > 0 { - oldInitializationParameters.HistoricalEntries = newInitializationParameters.HistoricalEntries - } - if newInitializationParameters.DistributionTransmissionChannel != "" { - oldInitializationParameters.DistributionTransmissionChannel = newInitializationParameters.DistributionTransmissionChannel - } - return oldInitializationParameters -} - -func MergePowerShapingParameters(oldPowerShapingParameters types.PowerShapingParameters, newPowerShapingParameters types.PowerShapingParameters) types.PowerShapingParameters { - if newPowerShapingParameters.IsTop_NSet { - oldPowerShapingParameters.Top_N = newPowerShapingParameters.Top_N - } - if newPowerShapingParameters.ValidatorsPowerCap > 0 { - oldPowerShapingParameters.ValidatorsPowerCap = newPowerShapingParameters.ValidatorsPowerCap - } - if newPowerShapingParameters.ValidatorSetCap > 0 { - oldPowerShapingParameters.ValidatorSetCap = newPowerShapingParameters.ValidatorSetCap - } - if newPowerShapingParameters.Allowlist != nil { - oldPowerShapingParameters.Allowlist = newPowerShapingParameters.Allowlist - } - if newPowerShapingParameters.Denylist != nil { - oldPowerShapingParameters.Denylist = newPowerShapingParameters.Denylist - } - if newPowerShapingParameters.IsMinStakeSet { - oldPowerShapingParameters.MinStake = newPowerShapingParameters.MinStake - } - if newPowerShapingParameters.IsAllowInactiveValsSet { - oldPowerShapingParameters.AllowInactiveVals = newPowerShapingParameters.AllowInactiveVals - } - - return oldPowerShapingParameters -} diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index 20b96cbfe6..4c9d11ff74 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -99,13 +99,13 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { ccvTimeoutPeriod := time.Duration(789) transferTimeoutPeriod := time.Duration(101112) expectedRecord := providertypes.ConsumerInitializationParameters{ - InitialHeight: &types.Height{RevisionNumber: 1, RevisionHeight: 2}, + InitialHeight: types.Height{RevisionNumber: 1, RevisionHeight: 2}, GenesisHash: []byte{0, 1}, BinaryHash: []byte{2, 3}, - SpawnTime: &spawnTime, - UnbondingPeriod: &unbondingPeriod, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, + SpawnTime: spawnTime, + UnbondingPeriod: unbondingPeriod, + CcvTimeoutPeriod: ccvTimeoutPeriod, + TransferTimeoutPeriod: transferTimeoutPeriod, ConsumerRedistributionFraction: "consumer_redistribution_fraction", BlocksPerDistributionTransmission: 123, HistoricalEntries: 456, @@ -122,13 +122,13 @@ func TestConsumerIdToInitializationRecord(t *testing.T) { ccvTimeoutPeriod = time.Duration(101112) transferTimeoutPeriod = time.Duration(131415) expectedRecord = providertypes.ConsumerInitializationParameters{ - InitialHeight: &types.Height{RevisionNumber: 2, RevisionHeight: 3}, + InitialHeight: types.Height{RevisionNumber: 2, RevisionHeight: 3}, GenesisHash: []byte{2, 3}, BinaryHash: []byte{4, 5}, - SpawnTime: &spawnTime, - UnbondingPeriod: &unbondingPeriod, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, + SpawnTime: spawnTime, + UnbondingPeriod: unbondingPeriod, + CcvTimeoutPeriod: ccvTimeoutPeriod, + TransferTimeoutPeriod: transferTimeoutPeriod, ConsumerRedistributionFraction: "consumer_redistribution_fraction2", BlocksPerDistributionTransmission: 456, HistoricalEntries: 789, diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index fa73887891..d13ad3d2bd 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -62,14 +62,14 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, consumerId string) error { // Create client state by getting template client from parameters and filling in zeroed fields from proposal. clientState := k.GetTemplateClient(ctx) clientState.ChainId = chainId - clientState.LatestHeight = *initializationRecord.InitialHeight + clientState.LatestHeight = initializationRecord.InitialHeight - trustPeriod, err := ccv.CalculateTrustPeriod(*consumerUnbondingPeriod, k.GetTrustingPeriodFraction(ctx)) + trustPeriod, err := ccv.CalculateTrustPeriod(consumerUnbondingPeriod, k.GetTrustingPeriodFraction(ctx)) if err != nil { return err } clientState.TrustingPeriod = trustPeriod - clientState.UnbondingPeriod = *consumerUnbondingPeriod + clientState.UnbondingPeriod = consumerUnbondingPeriod consumerGen, validatorSetHash, err := k.MakeConsumerGenesis(ctx, consumerId) if err != nil { @@ -185,8 +185,8 @@ func (k Keeper) MakeConsumerGenesis( ) (gen ccv.ConsumerGenesisState, nextValidatorsHash []byte, err error) { initializationRecord, err := k.GetConsumerInitializationParameters(ctx, consumerId) if err != nil { - return gen, nil, errorsmod.Wrapf(types.ErrNoInitializationRecord, - "initialization record for consumer chain: %s is missing", consumerId) + return gen, nil, errorsmod.Wrapf(types.ErrInvalidConsumerInitializationParameters, + "initialization record for consumer id: %s is missing", consumerId) } powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) @@ -274,11 +274,11 @@ func (k Keeper) MakeConsumerGenesis( initializationRecord.BlocksPerDistributionTransmission, initializationRecord.DistributionTransmissionChannel, "", // providerFeePoolAddrStr, - *initializationRecord.CcvTimeoutPeriod, - *initializationRecord.TransferTimeoutPeriod, + initializationRecord.CcvTimeoutPeriod, + initializationRecord.TransferTimeoutPeriod, initializationRecord.ConsumerRedistributionFraction, initializationRecord.HistoricalEntries, - *initializationRecord.UnbondingPeriod, + initializationRecord.UnbondingPeriod, []string{}, []string{}, ccv.DefaultRetryDelayPeriod, @@ -345,7 +345,7 @@ func (k Keeper) BeginBlockInit(ctx sdk.Context) { } // Remove consumer to prevent re-trying launching this chain. // We would only try to re-launch this chain if a new `MsgUpdateConsumer` message is sent. - k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, *record.SpawnTime) + k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, record.SpawnTime) cachedCtx, writeFn := ctx.CacheContext() err = k.LaunchConsumer(cachedCtx, consumerId) diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 18a870f1a7..1c16c4efd7 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -532,11 +532,11 @@ func TestMakeConsumerGenesis(t *testing.T) { unbondingPeriod := time.Duration(1728000000000000) initializationParameters := providertypes.ConsumerInitializationParameters{ BlocksPerDistributionTransmission: 1000, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, + CcvTimeoutPeriod: ccvTimeoutPeriod, + TransferTimeoutPeriod: transferTimeoutPeriod, ConsumerRedistributionFraction: "0.75", HistoricalEntries: 10000, - UnbondingPeriod: &unbondingPeriod, + UnbondingPeriod: unbondingPeriod, } providerKeeper.SetConsumerChainId(ctx, "0", "testchain1") providerKeeper.SetConsumerMetadata(ctx, "0", consumerMetadata) @@ -678,75 +678,67 @@ func TestBeginBlockInit(t *testing.T) { } chainIds := []string{"chain0", "chain1", "chain2", "chain3", "chain4"} - initialHeight := clienttypes.NewHeight(3, 4) - spawnTimeMinus2Hours := now.Add(-time.Hour * 2).UTC() - spawnTimeMinus1Hour := now.Add(-time.Hour).UTC() - spawnTimeMinus1Minute := now.Add(-time.Minute).UTC() - spawnTimePlus1Hour := now.Add(time.Hour).UTC() - unbondingPeriod := time.Duration(100000000000) - ccvTimeoutPeriod := time.Duration(100000000000) - transferTimeoutPeriod := time.Duration(100000000000) initializationParameters := []providertypes.ConsumerInitializationParameters{ { - InitialHeight: &initialHeight, + InitialHeight: clienttypes.NewHeight(3, 4), GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: &spawnTimeMinus2Hours, - UnbondingPeriod: &unbondingPeriod, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, + SpawnTime: now.Add(-time.Hour * 2).UTC(), + UnbondingPeriod: time.Duration(100000000000), + CcvTimeoutPeriod: time.Duration(100000000000), + TransferTimeoutPeriod: time.Duration(100000000000), ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, DistributionTransmissionChannel: "", }, { - InitialHeight: &initialHeight, + InitialHeight: clienttypes.NewHeight(3, 4), GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: &spawnTimeMinus1Hour, - UnbondingPeriod: &unbondingPeriod, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, + SpawnTime: now.Add(-time.Hour).UTC(), + UnbondingPeriod: time.Duration(100000000000), + CcvTimeoutPeriod: time.Duration(100000000000), + TransferTimeoutPeriod: time.Duration(100000000000), ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, DistributionTransmissionChannel: "", }, { - InitialHeight: &initialHeight, + InitialHeight: clienttypes.NewHeight(3, 4), GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: &spawnTimePlus1Hour, - UnbondingPeriod: &unbondingPeriod, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, + SpawnTime: now.Add(time.Hour).UTC(), + UnbondingPeriod: time.Duration(100000000000), + CcvTimeoutPeriod: time.Duration(100000000000), + TransferTimeoutPeriod: time.Duration(100000000000), ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, DistributionTransmissionChannel: "", }, { - InitialHeight: &initialHeight, + InitialHeight: clienttypes.NewHeight(3, 4), GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: &spawnTimeMinus1Hour, - UnbondingPeriod: &unbondingPeriod, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, + SpawnTime: now.Add(-time.Hour).UTC(), + UnbondingPeriod: time.Duration(100000000000), + CcvTimeoutPeriod: time.Duration(100000000000), + TransferTimeoutPeriod: time.Duration(100000000000), ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, DistributionTransmissionChannel: "", }, { - InitialHeight: &initialHeight, + InitialHeight: clienttypes.NewHeight(3, 4), GenesisHash: []byte{}, BinaryHash: []byte{}, - SpawnTime: &spawnTimeMinus1Minute, - UnbondingPeriod: &unbondingPeriod, - CcvTimeoutPeriod: &ccvTimeoutPeriod, - TransferTimeoutPeriod: &transferTimeoutPeriod, + SpawnTime: now.Add(-time.Minute).UTC(), + UnbondingPeriod: time.Duration(100000000000), + CcvTimeoutPeriod: time.Duration(100000000000), + TransferTimeoutPeriod: time.Duration(100000000000), ConsumerRedistributionFraction: "0.75", BlocksPerDistributionTransmission: 10, HistoricalEntries: 10000, @@ -813,7 +805,7 @@ func TestBeginBlockInit(t *testing.T) { providerKeeper.SetConsumerInitializationParameters(ctx, fmt.Sprintf("%d", i), r) // set up the chains in their initialized phase, hence they could launch providerKeeper.SetConsumerPhase(ctx, fmt.Sprintf("%d", i), providerkeeper.Initialized) - providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, fmt.Sprintf("%d", i), *r.SpawnTime) + providerKeeper.AppendSpawnTimeForConsumerToBeLaunched(ctx, fmt.Sprintf("%d", i), r.SpawnTime) } for i, r := range powerShapingParameters { providerKeeper.SetConsumerPowerShapingParameters(ctx, fmt.Sprintf("%d", i), r) @@ -913,8 +905,7 @@ func TestBeginBlockCCR(t *testing.T) { for i, consumerId := range consumerIds { // Setup a valid consumer chain for each consumerId initializationRecord := testkeeper.GetTestInitializationParameters() - initialHeight := clienttypes.NewHeight(2, 3) - initializationRecord.InitialHeight = &initialHeight + initializationRecord.InitialHeight = clienttypes.NewHeight(2, 3) registrationRecord := testkeeper.GetTestConsumerMetadata() providerKeeper.SetConsumerChainId(ctx, consumerId, chainIds[i]) diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index ada89c947c..18915de7e7 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -30,10 +30,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgCreateConsumer{}, &MsgUpdateConsumer{}, &MsgRemoveConsumer{}, - // keeping old messages (for now) so that existing proposals can be correctly deserialized - &MsgConsumerAddition{}, - &MsgConsumerRemoval{}, - &MsgConsumerModification{}, &MsgChangeRewardDenoms{}, &MsgUpdateParams{}, ) diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index c238c05f8a..5373091029 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -6,39 +6,41 @@ import ( // Provider sentinel errors var ( - ErrInvalidConsumerAdditionProposal = errorsmod.Register(ModuleName, 1, "invalid consumer addition proposal") - ErrInvalidConsumerRemoval = errorsmod.Register(ModuleName, 2, "invalid consumer removal") - ErrUnknownConsumerId = errorsmod.Register(ModuleName, 3, "no consumer chain with this consumer id") - ErrUnknownConsumerChannelId = errorsmod.Register(ModuleName, 4, "no consumer chain with this channel id") - ErrInvalidConsumerConsensusPubKey = errorsmod.Register(ModuleName, 5, "empty consumer consensus public key") - ErrInvalidConsumerId = errorsmod.Register(ModuleName, 6, "invalid consumer id") - ErrConsumerKeyNotFound = errorsmod.Register(ModuleName, 7, "consumer key not found") - ErrNoValidatorConsumerAddress = errorsmod.Register(ModuleName, 8, "error getting validator consumer address") - ErrNoValidatorProviderAddress = errorsmod.Register(ModuleName, 9, "error getting validator provider address") - ErrConsumerKeyInUse = errorsmod.Register(ModuleName, 10, "consumer key is already in use by a validator") - ErrCannotAssignDefaultKeyAssignment = errorsmod.Register(ModuleName, 11, "cannot re-assign default key assignment") - ErrInvalidConsumerParams = errorsmod.Register(ModuleName, 12, "invalid consumer params") - ErrInvalidProviderAddress = errorsmod.Register(ModuleName, 13, "invalid provider address") - ErrInvalidConsumerRewardDenom = errorsmod.Register(ModuleName, 14, "invalid consumer reward denom") - ErrInvalidDepositorAddress = errorsmod.Register(ModuleName, 15, "invalid depositor address") - ErrInvalidConsumerClient = errorsmod.Register(ModuleName, 16, "ccv channel is not built on correct client") - ErrDuplicateConsumerChain = errorsmod.Register(ModuleName, 17, "consumer chain already exists") - ErrConsumerChainNotFound = errorsmod.Register(ModuleName, 18, "consumer chain not found") - ErrInvalidConsumerCommissionRate = errorsmod.Register(ModuleName, 19, "consumer commission rate is invalid") - ErrCannotOptOutFromTopN = errorsmod.Register(ModuleName, 20, "cannot opt out from a Top N chain") - ErrNoUnconfirmedVSCPacket = errorsmod.Register(ModuleName, 21, "no unconfirmed vsc packet for this chain id") - ErrInvalidConsumerModificationProposal = errorsmod.Register(ModuleName, 22, "invalid consumer modification proposal") - ErrInvalidPowerShapingParametersRecord = errorsmod.Register(ModuleName, 23, "invalid consumer update record") - ErrBlankConsumerChainID = errorsmod.Register(ModuleName, 24, "consumer chain id must not be blank") - ErrNoUnbondingTime = errorsmod.Register(ModuleName, 25, "provider unbonding time not found") - ErrInvalidAddress = errorsmod.Register(ModuleName, 26, "invalid address") - ErrUnauthorized = errorsmod.Register(ModuleName, 27, "unauthorized") - ErrInvalidPhase = errorsmod.Register(ModuleName, 28, "cannot perform action in the current phase of consumer chain") - ErrNoInitializationRecord = errorsmod.Register(ModuleName, 29, "initialization record is missing") - ErrNoRegistrationRecord = errorsmod.Register(ModuleName, 30, "registration record is missing") - ErrNoChainId = errorsmod.Register(ModuleName, 31, "missing chain id for consumer chain") - ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 32, "missing consumer genesis") - ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 33, "invalid consumer genesis") - ErrNoConsumerId = errorsmod.Register(ModuleName, 34, "missing consumer id") - ErrAlreadyOptedIn = errorsmod.Register(ModuleName, 35, "already opted in to a chain with the same chain id") + ErrInvalidConsumerAdditionProposal = errorsmod.Register(ModuleName, 1, "invalid consumer addition proposal") + ErrInvalidConsumerRemovalProp = errorsmod.Register(ModuleName, 2, "invalid consumer removal proposal") + ErrUnknownConsumerId = errorsmod.Register(ModuleName, 3, "no consumer chain with this consumer id") + ErrUnknownConsumerChannelId = errorsmod.Register(ModuleName, 4, "no consumer chain with this channel id") + ErrInvalidConsumerConsensusPubKey = errorsmod.Register(ModuleName, 5, "empty consumer consensus public key") + ErrInvalidConsumerId = errorsmod.Register(ModuleName, 6, "invalid consumer id") + ErrConsumerKeyNotFound = errorsmod.Register(ModuleName, 7, "consumer key not found") + ErrNoValidatorConsumerAddress = errorsmod.Register(ModuleName, 8, "error getting validator consumer address") + ErrNoValidatorProviderAddress = errorsmod.Register(ModuleName, 9, "error getting validator provider address") + ErrConsumerKeyInUse = errorsmod.Register(ModuleName, 10, "consumer key is already in use by a validator") + ErrCannotAssignDefaultKeyAssignment = errorsmod.Register(ModuleName, 11, "cannot re-assign default key assignment") + ErrInvalidConsumerParams = errorsmod.Register(ModuleName, 12, "invalid consumer params") + ErrInvalidProviderAddress = errorsmod.Register(ModuleName, 13, "invalid provider address") + ErrInvalidConsumerRewardDenom = errorsmod.Register(ModuleName, 14, "invalid consumer reward denom") + ErrInvalidDepositorAddress = errorsmod.Register(ModuleName, 15, "invalid depositor address") + ErrInvalidConsumerClient = errorsmod.Register(ModuleName, 16, "ccv channel is not built on correct client") + ErrDuplicateConsumerChain = errorsmod.Register(ModuleName, 17, "consumer chain already exists") + ErrConsumerChainNotFound = errorsmod.Register(ModuleName, 18, "consumer chain not found") + ErrInvalidConsumerCommissionRate = errorsmod.Register(ModuleName, 19, "consumer commission rate is invalid") + ErrCannotOptOutFromTopN = errorsmod.Register(ModuleName, 20, "cannot opt out from a Top N chain") + ErrNoUnconfirmedVSCPacket = errorsmod.Register(ModuleName, 21, "no unconfirmed vsc packet for this chain id") + ErrInvalidConsumerModificationProposal = errorsmod.Register(ModuleName, 22, "invalid consumer modification proposal") + ErrNoUnbondingTime = errorsmod.Register(ModuleName, 23, "provider unbonding time not found") + ErrInvalidAddress = errorsmod.Register(ModuleName, 24, "invalid address") + ErrUnauthorized = errorsmod.Register(ModuleName, 25, "unauthorized") + ErrBlankConsumerChainID = errorsmod.Register(ModuleName, 26, "consumer chain id must not be blank") + ErrInvalidPhase = errorsmod.Register(ModuleName, 27, "cannot perform action in the current phase of consumer chain") + ErrInvalidPowerShapingParameters = errorsmod.Register(ModuleName, 28, "invalid power shaping parameters") + ErrInvalidConsumerInitializationParameters = errorsmod.Register(ModuleName, 29, "invalid consumer initialization parameters") + ErrNoRegistrationRecord = errorsmod.Register(ModuleName, 30, "registration record is missing") + ErrNoChainId = errorsmod.Register(ModuleName, 31, "missing chain id for consumer chain") + ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 32, "missing consumer genesis") + ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 33, "invalid consumer genesis") + ErrNoConsumerId = errorsmod.Register(ModuleName, 34, "missing consumer id") + ErrAlreadyOptedIn = errorsmod.Register(ModuleName, 35, "already opted in to a chain with the same chain id") + ErrNoOwnerAddress = errorsmod.Register(ModuleName, 36, "missing owner address") + ErrInvalidTransformToTopN = errorsmod.Register(ModuleName, 37, "invalid transform to Top N chain") ) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 66b85f004f..b9bf842a43 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -342,57 +342,44 @@ func getKeyPrefixes() map[string]byte { // sent to the consensus engine of the provider chain LastProviderConsensusValsKeyName: 42, - // DeprecatedMinStakeKey is the byte prefix for storing the mapping from consumer chains to the minimum stake required to be a validator on the consumer chain - // The minimum stake must be stored on the provider chain, not on the consumer chain itself, since it filters out - // validators from the VSCPackets that we send to the consumer chain. - // NOTE: This prefix is deprecated, but left in place to avoid state migrations - // [DEPRECATED] - DeprecatedMinStakeKeyName: 43, - - // DeprecatedAllowInactiveValidatorsKey is the byte prefix for storing the mapping from consumer chains to the boolean value - // that determines whether inactive validators can validate on that chain - // NOTE: This prefix is deprecated, but left in place to avoid state migrations - // [DEPRECATED] - DeprecatedAllowInactiveValidatorsKeyName: 44, - // ConsumerIdKeyName is the key for storing the consumer id for the next registered consumer chain - ConsumerIdKeyName: 45, + ConsumerIdKeyName: 43, // ConsumerIdToChainIdKeyName is the key for storing the chain id for the given consumer id - ConsumerIdToChainIdKeyName: 46, + ConsumerIdToChainIdKeyName: 44, // ConsumerIdToOwnerAddressKeyName is the key for storing the owner address for the given consumer id - ConsumerIdToOwnerAddressKeyName: 47, + ConsumerIdToOwnerAddressKeyName: 45, // ConsumerIdToConsumerMetadataKeyName is the key for storing the metadata for the given consumer id - ConsumerIdToConsumerMetadataKeyName: 48, + ConsumerIdToConsumerMetadataKeyName: 46, // ConsumerIdToInitializationParametersKeyName is the key for storing the initialization parameters for the given consumer id - ConsumerIdToInitializationParametersKeyName: 49, + ConsumerIdToInitializationParametersKeyName: 47, // ConsumerIdToPowerShapingParameters is the key for storing the power-shaping parameters for the given consumer id - ConsumerIdToPowerShapingParameters: 50, + ConsumerIdToPowerShapingParameters: 48, // ConsumerIdToPhaseKeyName is the key for storing the phase of a consumer chain with the given consumer id - ConsumerIdToPhaseKeyName: 51, + ConsumerIdToPhaseKeyName: 49, // ConsumerIdToStopTimeKeyName is the key for storing the stop time of a consumer chain that is to be removed - ConsumerIdToStopTimeKeyName: 52, + ConsumerIdToStopTimeKeyName: 50, // SpawnTimeToConsumerIdKeyName is the key for storing pending initialized consumers that are to be launched. // For a specific spawn time, it might store multiple consumer chain ids for chains that are to be launched. - SpawnTimeToConsumerIdsKeyName: 53, + SpawnTimeToConsumerIdsKeyName: 51, // StopTimeToConsumerIdKeyName is the key for storing pending launched consumers that are to be stopped. // For a specific stop time, it might store multiple consumer chain ids for chains that are to be stopped. - StopTimeToConsumerIdsKeyName: 54, + StopTimeToConsumerIdsKeyName: 52, // ProviderConsAddrToOptedInConsumerIdsKeyName is the key for storing all the consumer ids that a validator // is currently opted in to. - ProviderConsAddrToOptedInConsumerIdsKeyName: 55, + ProviderConsAddrToOptedInConsumerIdsKeyName: 53, // ClientIdToConsumerIdKeyName is the key for storing the consumer id for the given client id - ClientIdToConsumerIdKeyName: 56, + ClientIdToConsumerIdKeyName: 54, // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO TestPreserveBytePrefix() IN keys_test.go } diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 9c7b53b7b1..f3ecb4da6c 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -121,35 +121,29 @@ func TestPreserveBytePrefix(t *testing.T) { i++ require.Equal(t, byte(42), providertypes.LastProviderConsensusValsPrefix()[0]) i++ - // DEPRECATED - //require.Equal(t, byte(43), providertypes.MinStakeKey("chainID")[0]) - i++ - // DEPRECATED - //require.Equal(t, byte(44), providertypes.AllowInactiveValidatorsKey("chainID")[0]) - i++ - require.Equal(t, byte(45), providertypes.ConsumerIdKey()[0]) + require.Equal(t, byte(43), providertypes.ConsumerIdKey()[0]) i++ - require.Equal(t, byte(46), providertypes.ConsumerIdToChainIdKey("consumerId")[0]) + require.Equal(t, byte(44), providertypes.ConsumerIdToChainIdKey("consumerId")[0]) i++ - require.Equal(t, byte(47), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) + require.Equal(t, byte(45), providertypes.ConsumerIdToOwnerAddressKey("consumerId")[0]) i++ - require.Equal(t, byte(48), providertypes.ConsumerIdToMetadataKeyPrefix()) + require.Equal(t, byte(46), providertypes.ConsumerIdToMetadataKeyPrefix()) i++ - require.Equal(t, byte(49), providertypes.ConsumerIdToInitializationParametersKeyPrefix()) + require.Equal(t, byte(47), providertypes.ConsumerIdToInitializationParametersKeyPrefix()) i++ - require.Equal(t, byte(50), providertypes.ConsumerIdToPowerShapingParametersKey("consumerId")[0]) + require.Equal(t, byte(48), providertypes.ConsumerIdToPowerShapingParametersKey("consumerId")[0]) i++ - require.Equal(t, byte(51), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) + require.Equal(t, byte(49), providertypes.ConsumerIdToPhaseKey("consumerId")[0]) i++ - require.Equal(t, byte(52), providertypes.ConsumerIdToStopTimeKeyPrefix()) + require.Equal(t, byte(50), providertypes.ConsumerIdToStopTimeKeyPrefix()) i++ - require.Equal(t, byte(53), providertypes.SpawnTimeToConsumerIdsKeyPrefix()) + require.Equal(t, byte(51), providertypes.SpawnTimeToConsumerIdsKeyPrefix()) i++ - require.Equal(t, byte(54), providertypes.StopTimeToConsumerIdsKeyPrefix()) + require.Equal(t, byte(52), providertypes.StopTimeToConsumerIdsKeyPrefix()) i++ - require.Equal(t, byte(55), providertypes.ProviderConsAddrToOptedInConsumerIdsKey(providertypes.NewProviderConsAddress([]byte{0x05}))[0]) + require.Equal(t, byte(53), providertypes.ProviderConsAddrToOptedInConsumerIdsKey(providertypes.NewProviderConsAddress([]byte{0x05}))[0]) i++ - require.Equal(t, byte(56), providertypes.ClientIdToConsumerIdKey("clientId")[0]) + require.Equal(t, byte(54), providertypes.ClientIdToConsumerIdKey("clientId")[0]) i++ prefixes := providertypes.GetAllKeyPrefixes() diff --git a/x/ccv/provider/types/legacy_proposal.go b/x/ccv/provider/types/legacy_proposal.go index 6802ef71c4..f29f3b6c07 100644 --- a/x/ccv/provider/types/legacy_proposal.go +++ b/x/ccv/provider/types/legacy_proposal.go @@ -230,11 +230,11 @@ func (sccp *ConsumerRemovalProposal) ValidateBasic() error { } if strings.TrimSpace(sccp.ChainId) == "" { - return errorsmod.Wrap(ErrInvalidConsumerRemoval, "consumer chain id must not be blank") + return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "consumer chain id must not be blank") } if sccp.StopTime.IsZero() { - return errorsmod.Wrap(ErrInvalidConsumerRemoval, "spawn time cannot be zero") + return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "spawn time cannot be zero") } return nil } diff --git a/x/ccv/provider/types/legacy_proposal_test.go b/x/ccv/provider/types/legacy_proposal_test.go index 2a772753f2..757699c263 100644 --- a/x/ccv/provider/types/legacy_proposal_test.go +++ b/x/ccv/provider/types/legacy_proposal_test.go @@ -542,7 +542,7 @@ func TestChangeRewardDenomsProposalValidateBasic(t *testing.T) { } } -func TestConsumerModificationProposalValidateBasic(t *testing.T) { +func TestMsgUpdateConsumerValidateBasic(t *testing.T) { testCases := []struct { name string powerShapingParameters types.PowerShapingParameters @@ -602,7 +602,7 @@ func TestConsumerModificationProposalValidateBasic(t *testing.T) { for _, tc := range testCases { // TODO (PERMISSIONLESS) add more tests - msg, _ := types.NewMsgUpdateConsumer("", "0", "new owner", types.ConsumerMetadata{}, types.ConsumerInitializationParameters{}, tc.powerShapingParameters) + msg, _ := types.NewMsgUpdateConsumer("", "0", "new owner", nil, nil, &tc.powerShapingParameters) err := msg.ValidateBasic() if tc.expPass { require.NoError(t, err, "valid case: %s should not return error. got %w", tc.name, err) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 60469cb841..aff600b1b4 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -42,9 +42,6 @@ var ( _ sdk.Msg = (*MsgCreateConsumer)(nil) _ sdk.Msg = (*MsgUpdateConsumer)(nil) _ sdk.Msg = (*MsgRemoveConsumer)(nil) - _ sdk.Msg = (*MsgConsumerAddition)(nil) - _ sdk.Msg = (*MsgConsumerModification)(nil) - _ sdk.Msg = (*MsgConsumerRemoval)(nil) _ sdk.Msg = (*MsgOptIn)(nil) _ sdk.Msg = (*MsgOptOut)(nil) _ sdk.Msg = (*MsgSetConsumerCommissionRate)(nil) @@ -56,9 +53,6 @@ var ( _ sdk.HasValidateBasic = (*MsgCreateConsumer)(nil) _ sdk.HasValidateBasic = (*MsgUpdateConsumer)(nil) _ sdk.HasValidateBasic = (*MsgRemoveConsumer)(nil) - _ sdk.HasValidateBasic = (*MsgConsumerAddition)(nil) - _ sdk.HasValidateBasic = (*MsgConsumerModification)(nil) - _ sdk.HasValidateBasic = (*MsgConsumerRemoval)(nil) _ sdk.HasValidateBasic = (*MsgOptIn)(nil) _ sdk.HasValidateBasic = (*MsgOptOut)(nil) _ sdk.HasValidateBasic = (*MsgSetConsumerCommissionRate)(nil) @@ -242,13 +236,13 @@ func (msg MsgSubmitConsumerDoubleVoting) GetSigners() []sdk.AccAddress { // NewMsgCreateConsumer creates a new MsgCreateConsumer instance func NewMsgCreateConsumer(signer string, chainId string, metadata ConsumerMetadata, - initializationParameters ConsumerInitializationParameters, powerShapingParameters PowerShapingParameters) (*MsgCreateConsumer, error) { + initializationParameters *ConsumerInitializationParameters, powerShapingParameters *PowerShapingParameters) (*MsgCreateConsumer, error) { return &MsgCreateConsumer{ Signer: signer, ChainId: chainId, Metadata: metadata, - InitializationParameters: &initializationParameters, - PowerShapingParameters: &powerShapingParameters, + InitializationParameters: initializationParameters, + PowerShapingParameters: powerShapingParameters, }, nil } @@ -260,45 +254,30 @@ func (msg MsgCreateConsumer) Type() string { // Route implements the sdk.Msg interface. func (msg MsgCreateConsumer) Route() string { return RouterKey } -func verifyField(name string, field string, maxLength int) error { - if strings.TrimSpace(field) == "" { - return fmt.Errorf("%s cannot be empty", name) - } else if len(field) > maxLength { - return fmt.Errorf("%s is too long; got: %d, max: %d", name, len(field), maxLength) - } - return nil -} - -func VerifyConsumerMetadata(metadata ConsumerMetadata) error { - // TODO (PERMISSIONLESS): we can extend the lengths at some later stage and make them constant - if err := verifyField("name", metadata.Name, 100); err != nil { - return err - } - - if err := verifyField("description", metadata.Description, 20000); err != nil { - return err - } - - if err := verifyField("metadata", metadata.Metadata, 1000); err != nil { - return err - } - - return nil -} - // ValidateBasic implements the sdk.Msg interface. func (msg MsgCreateConsumer) ValidateBasic() error { - if err := verifyField("chain id", msg.ChainId, cmttypes.MaxChainIDLen); err != nil { + if err := ValidateField("chain id", msg.ChainId, cmttypes.MaxChainIDLen); err != nil { return err } - if err := VerifyConsumerMetadata(msg.Metadata); err != nil { + if err := ValidateConsumerMetadata(msg.Metadata); err != nil { return err } - if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.IsTop_NSet && msg.PowerShapingParameters.Top_N > 0 { - return fmt.Errorf("cannot create a Top N chain through `MsgCreateConsumer`; " + - "first create the chain and then use `MsgUpdateConsumer` to make the chain Top N") + if msg.InitializationParameters != nil { + if err := ValidateInitializationParameters(*msg.InitializationParameters); err != nil { + return err + } + } + + if msg.PowerShapingParameters != nil { + if msg.PowerShapingParameters.Top_N > 0 { + return fmt.Errorf("cannot create a Top N chain through `MsgCreateConsumer`; " + + "first create the chain and then use `MsgUpdateConsumer` to make the chain Top N") + } + if err := ValidatePowerShapingParameters(*msg.PowerShapingParameters); err != nil { + return err + } } return nil @@ -322,15 +301,15 @@ func (msg MsgCreateConsumer) GetSigners() []sdk.AccAddress { } // NewMsgUpdateConsumer creates a new MsgUpdateConsumer instance -func NewMsgUpdateConsumer(signer string, consumerId string, ownerAddress string, metadata ConsumerMetadata, - initializationParameters ConsumerInitializationParameters, powerShapingParameters PowerShapingParameters) (*MsgUpdateConsumer, error) { +func NewMsgUpdateConsumer(signer string, consumerId string, ownerAddress string, metadata *ConsumerMetadata, + initializationParameters *ConsumerInitializationParameters, powerShapingParameters *PowerShapingParameters) (*MsgUpdateConsumer, error) { return &MsgUpdateConsumer{ Signer: signer, ConsumerId: consumerId, NewOwnerAddress: ownerAddress, - Metadata: &metadata, - InitializationParameters: &initializationParameters, - PowerShapingParameters: &powerShapingParameters, + Metadata: metadata, + InitializationParameters: initializationParameters, + PowerShapingParameters: powerShapingParameters, }, nil } @@ -348,10 +327,27 @@ func (msg MsgUpdateConsumer) ValidateBasic() error { return err } - // TODO (PERMISSIONLESS): validate parameters and everything else - err := ValidatePSSFeatures(msg.PowerShapingParameters.Top_N, msg.PowerShapingParameters.ValidatorsPowerCap) - if err != nil { - return errorsmod.Wrapf(ErrInvalidPowerShapingParametersRecord, "invalid power-shaping parameters: %s", err.Error()) + const maxNewOwnerAddress = 500 + if err := ValidateField("new owner address", msg.NewOwnerAddress, maxNewOwnerAddress); err != nil { + return err + } + + if msg.Metadata != nil { + if err := ValidateConsumerMetadata(*msg.Metadata); err != nil { + return err + } + } + + if msg.InitializationParameters != nil { + if err := ValidateInitializationParameters(*msg.InitializationParameters); err != nil { + return err + } + } + + if msg.PowerShapingParameters != nil { + if err := ValidatePowerShapingParameters(*msg.PowerShapingParameters); err != nil { + return err + } } return nil @@ -528,11 +524,11 @@ func (msg MsgConsumerRemoval) Route() string { return RouterKey } // ValidateBasic implements the sdk.Msg interface. func (msg MsgConsumerRemoval) ValidateBasic() error { if strings.TrimSpace(msg.ChainId) == "" { - return errorsmod.Wrap(ErrInvalidConsumerRemoval, "consumer chain id must not be blank") + return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "consumer chain id must not be blank") } if msg.StopTime.IsZero() { - return errorsmod.Wrap(ErrInvalidConsumerRemoval, "spawn time cannot be zero") + return errorsmod.Wrap(ErrInvalidConsumerRemovalProp, "spawn time cannot be zero") } return nil } @@ -743,3 +739,123 @@ func ValidateConsumerId(consumerId string) error { return nil } + +// ValidateField validates that `field` is not empty and has at most `maxLength` characters +func ValidateField(nameOfTheField string, field string, maxLength int) error { + if strings.TrimSpace(field) == "" { + return fmt.Errorf("%s cannot be empty", nameOfTheField) + } else if len(field) > maxLength { + return fmt.Errorf("%s is too long; got: %d, max: %d", nameOfTheField, len(field), maxLength) + } + return nil +} + +// ValidateConsumerMetadata validates that all the provided metadata are in the expected range +func ValidateConsumerMetadata(metadata ConsumerMetadata) error { + const maxNameLength = 100 + const maxDescriptionLength = 50000 + const maxMetadataLength = 1000 + + if err := ValidateField("name", metadata.Name, maxNameLength); err != nil { + return err + } + + if err := ValidateField("description", metadata.Description, maxDescriptionLength); err != nil { + return err + } + + if err := ValidateField("metadata", metadata.Metadata, maxMetadataLength); err != nil { + return err + } + + return nil +} + +// ValidatePowerShapingParameters validates that all the provided power-shaping parameters are in the expected range +func ValidatePowerShapingParameters(powerShapingParameters PowerShapingParameters) error { + const maxAllowlistLength = 500 + const maxDenylistLength = 500 + + // Top N corresponds to the top N% of validators that have to validate the consumer chain and can only be 0 (for an + // Opt In chain) or in the range [50, 100] (for a Top N chain). + if powerShapingParameters.Top_N != 0 && (powerShapingParameters.Top_N < 50 || powerShapingParameters.Top_N > 100) { + return fmt.Errorf("parameter Top N can either be 0 or in the range [50, 100]") + } + + if powerShapingParameters.ValidatorsPowerCap != 0 && powerShapingParameters.ValidatorsPowerCap > 100 { + return fmt.Errorf("validators' power cap has to be in the range [1, 100]") + } + + if len(powerShapingParameters.Allowlist) > maxAllowlistLength { + return fmt.Errorf("allowlist cannot exceed length: %d", maxAllowlistLength) + } + + if len(powerShapingParameters.Denylist) > maxDenylistLength { + return fmt.Errorf("denylist cannot exceed length: %d", maxDenylistLength) + } + + return nil +} + +// ValidateInitializationParameters validates that all the provided parameters are in the expected range +func ValidateInitializationParameters(initializationParameters ConsumerInitializationParameters) error { + const maxGenesisHashLength = 1000 + const maxBinaryHashLength = 1000 + const maxConsumerRedistributionFractionLength = 50 + const maxDistributionTransmissionChannelLength = 1000 + + if initializationParameters.InitialHeight.IsZero() { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "initial height cannot be zero") + } + + if len(initializationParameters.GenesisHash) == 0 { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "genesis hash cannot be empty") + } else if len(initializationParameters.GenesisHash) > maxGenesisHashLength { + return errorsmod.Wrapf(ErrInvalidConsumerInitializationParameters, "genesis hash cannot exceed %d bytes", maxGenesisHashLength) + } + + if len(initializationParameters.BinaryHash) == 0 { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "binary hash cannot be empty") + } else if len(initializationParameters.BinaryHash) > maxBinaryHashLength { + return errorsmod.Wrapf(ErrInvalidConsumerInitializationParameters, "binary hash cannot exceed %d bytes", maxBinaryHashLength) + } + + if initializationParameters.SpawnTime.IsZero() { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "spawn time cannot be zero") + } + + if err := ccvtypes.ValidateStringFraction(initializationParameters.ConsumerRedistributionFraction); err != nil { + return errorsmod.Wrapf(ErrInvalidConsumerInitializationParameters, "consumer redistribution fraction is invalid: %s", err.Error()) + } else if err := ValidateField("consumer redistribution fraction", initializationParameters.ConsumerRedistributionFraction, maxConsumerRedistributionFractionLength); err != nil { + return errorsmod.Wrapf(ErrInvalidConsumerInitializationParameters, "consumer redistribution fraction is invalid: %s", err.Error()) + } + + if err := ccvtypes.ValidatePositiveInt64(initializationParameters.BlocksPerDistributionTransmission); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "blocks per distribution transmission has to be positive") + } + + if err := ccvtypes.ValidateDistributionTransmissionChannel(initializationParameters.DistributionTransmissionChannel); err != nil { + return errorsmod.Wrapf(ErrInvalidConsumerInitializationParameters, "distribution transmission channel is invalid: %s", err.Error()) + } else if len(initializationParameters.DistributionTransmissionChannel) > maxDistributionTransmissionChannelLength { + // note that the distribution transmission channel can be the empty string (i.e., "") and hence we only check its max length here + return errorsmod.Wrapf(ErrInvalidConsumerInitializationParameters, "distribution transmission channel exceeds %d length", maxDistributionTransmissionChannelLength) + } + + if err := ccvtypes.ValidatePositiveInt64(initializationParameters.HistoricalEntries); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "historical entries has to be positive") + } + + if err := ccvtypes.ValidateDuration(initializationParameters.CcvTimeoutPeriod); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "ccv timeout period cannot be zero") + } + + if err := ccvtypes.ValidateDuration(initializationParameters.TransferTimeoutPeriod); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "transfer timeout period cannot be zero") + } + + if err := ccvtypes.ValidateDuration(initializationParameters.UnbondingPeriod); err != nil { + return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "unbonding period cannot be zero") + } + + return nil +} diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index e3da76d268..6b72d79283 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -1445,7 +1445,7 @@ type ConsumerInitializationParameters struct { // the proposed initial height of new consumer chain. // For a completely new chain, this will be {0,1}. However, it may be // different if this is a chain that is converting to a consumer chain. - InitialHeight *types.Height `protobuf:"bytes,1,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` + InitialHeight types.Height `protobuf:"bytes,1,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height"` // The hash of the consumer chain genesis state without the consumer CCV // module genesis params. It is used for off-chain confirmation of // genesis.json validity by validators and other parties. @@ -1457,14 +1457,14 @@ type ConsumerInitializationParameters struct { // spawn time is the time on the provider chain at which the consumer chain // genesis is finalized and all validators will be responsible for starting // their consumer chain validator node. - SpawnTime *time.Time `protobuf:"bytes,4,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time,omitempty"` + SpawnTime time.Time `protobuf:"bytes,4,opt,name=spawn_time,json=spawnTime,proto3,stdtime" json:"spawn_time"` // Unbonding period for the consumer, // which should be smaller than that of the provider in general. - UnbondingPeriod *time.Duration `protobuf:"bytes,5,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period,omitempty"` + UnbondingPeriod time.Duration `protobuf:"bytes,5,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` // Sent CCV related IBC packets will timeout after this duration - CcvTimeoutPeriod *time.Duration `protobuf:"bytes,6,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period,omitempty"` + CcvTimeoutPeriod time.Duration `protobuf:"bytes,6,opt,name=ccv_timeout_period,json=ccvTimeoutPeriod,proto3,stdduration" json:"ccv_timeout_period"` // Sent transfer related IBC packets will timeout after this duration - TransferTimeoutPeriod *time.Duration `protobuf:"bytes,7,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period,omitempty"` + TransferTimeoutPeriod time.Duration `protobuf:"bytes,7,opt,name=transfer_timeout_period,json=transferTimeoutPeriod,proto3,stdduration" json:"transfer_timeout_period"` // The fraction of tokens allocated to the consumer redistribution address // during distribution events. The fraction is a string representing a // decimal number. For example "0.75" would represent 75%. @@ -1520,11 +1520,11 @@ func (m *ConsumerInitializationParameters) XXX_DiscardUnknown() { var xxx_messageInfo_ConsumerInitializationParameters proto.InternalMessageInfo -func (m *ConsumerInitializationParameters) GetInitialHeight() *types.Height { +func (m *ConsumerInitializationParameters) GetInitialHeight() types.Height { if m != nil { return m.InitialHeight } - return nil + return types.Height{} } func (m *ConsumerInitializationParameters) GetGenesisHash() []byte { @@ -1541,32 +1541,32 @@ func (m *ConsumerInitializationParameters) GetBinaryHash() []byte { return nil } -func (m *ConsumerInitializationParameters) GetSpawnTime() *time.Time { +func (m *ConsumerInitializationParameters) GetSpawnTime() time.Time { if m != nil { return m.SpawnTime } - return nil + return time.Time{} } -func (m *ConsumerInitializationParameters) GetUnbondingPeriod() *time.Duration { +func (m *ConsumerInitializationParameters) GetUnbondingPeriod() time.Duration { if m != nil { return m.UnbondingPeriod } - return nil + return 0 } -func (m *ConsumerInitializationParameters) GetCcvTimeoutPeriod() *time.Duration { +func (m *ConsumerInitializationParameters) GetCcvTimeoutPeriod() time.Duration { if m != nil { return m.CcvTimeoutPeriod } - return nil + return 0 } -func (m *ConsumerInitializationParameters) GetTransferTimeoutPeriod() *time.Duration { +func (m *ConsumerInitializationParameters) GetTransferTimeoutPeriod() time.Duration { if m != nil { return m.TransferTimeoutPeriod } - return nil + return 0 } func (m *ConsumerInitializationParameters) GetConsumerRedistributionFraction() string { @@ -1604,32 +1604,23 @@ type PowerShapingParameters struct { // have to validate the proposed consumer chain. top_N can either be 0 or any value in [50, 100]. // A chain can join with top_N == 0 as an Opt In chain, or with top_N ∈ [50, 100] as a Top N chain. Top_N uint32 `protobuf:"varint,1,opt,name=top_N,json=topN,proto3" json:"top_N,omitempty"` - // We cannot use `optional` for `top_N` due to having plugins `gocosmos` and `grpc-gateway` do not support it. - // To distinguish between a set `top_N` to 0 and one that is not, we introduce a new field. - IsTop_NSet bool `protobuf:"varint,2,opt,name=is_top_N_set,json=isTopNSet,proto3" json:"is_top_N_set,omitempty"` // Corresponds to the maximum power (percentage-wise) a validator can have on the consumer chain. For instance, if // `validators_power_cap` is set to 32, it means that no validator can have more than 32% of the voting power on the // consumer chain. Note that this might not be feasible. For example, think of a consumer chain with only // 5 validators and with `validators_power_cap` set to 10%. In such a scenario, at least one validator would need // to have more than 20% of the total voting power. Therefore, `validators_power_cap` operates on a best-effort basis. - ValidatorsPowerCap uint32 `protobuf:"varint,3,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` + ValidatorsPowerCap uint32 `protobuf:"varint,2,opt,name=validators_power_cap,json=validatorsPowerCap,proto3" json:"validators_power_cap,omitempty"` // Corresponds to the maximum number of validators that can validate a consumer chain. // Only applicable to Opt In chains. Setting `validator_set_cap` on a Top N chain is a no-op. - ValidatorSetCap uint32 `protobuf:"varint,4,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` + ValidatorSetCap uint32 `protobuf:"varint,3,opt,name=validator_set_cap,json=validatorSetCap,proto3" json:"validator_set_cap,omitempty"` // corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate the consumer chain - Allowlist []string `protobuf:"bytes,5,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + Allowlist []string `protobuf:"bytes,4,rep,name=allowlist,proto3" json:"allowlist,omitempty"` // corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain - Denylist []string `protobuf:"bytes,6,rep,name=denylist,proto3" json:"denylist,omitempty"` + Denylist []string `protobuf:"bytes,5,rep,name=denylist,proto3" json:"denylist,omitempty"` // Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain. - MinStake uint64 `protobuf:"varint,7,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` - // We cannot use `optional` for `min_stake` due to having plugins `gocosmos` and `grpc-gateway` do not support it. - // To distinguish between a set `min_stake` to 0 and one that is not, we introduce a new field. - IsMinStakeSet bool `protobuf:"varint,8,opt,name=is_min_stake_set,json=isMinStakeSet,proto3" json:"is_min_stake_set,omitempty"` + MinStake uint64 `protobuf:"varint,6,opt,name=min_stake,json=minStake,proto3" json:"min_stake,omitempty"` // Corresponds to whether inactive validators are allowed to validate the consumer chain. - AllowInactiveVals bool `protobuf:"varint,9,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` - // We cannot use `optional` for `allow_inactive_vals` due to having plugins `gocosmos` and `grpc-gateway` do not support it. - // To distinguish between a set `allow_inactive_vals` to `false` and one that is not, we introduce a new field. - IsAllowInactiveValsSet bool `protobuf:"varint,10,opt,name=is_allow_inactive_vals_set,json=isAllowInactiveValsSet,proto3" json:"is_allow_inactive_vals_set,omitempty"` + AllowInactiveVals bool `protobuf:"varint,7,opt,name=allow_inactive_vals,json=allowInactiveVals,proto3" json:"allow_inactive_vals,omitempty"` } func (m *PowerShapingParameters) Reset() { *m = PowerShapingParameters{} } @@ -1672,13 +1663,6 @@ func (m *PowerShapingParameters) GetTop_N() uint32 { return 0 } -func (m *PowerShapingParameters) GetIsTop_NSet() bool { - if m != nil { - return m.IsTop_NSet - } - return false -} - func (m *PowerShapingParameters) GetValidatorsPowerCap() uint32 { if m != nil { return m.ValidatorsPowerCap @@ -1714,13 +1698,6 @@ func (m *PowerShapingParameters) GetMinStake() uint64 { return 0 } -func (m *PowerShapingParameters) GetIsMinStakeSet() bool { - if m != nil { - return m.IsMinStakeSet - } - return false -} - func (m *PowerShapingParameters) GetAllowInactiveVals() bool { if m != nil { return m.AllowInactiveVals @@ -1728,13 +1705,6 @@ func (m *PowerShapingParameters) GetAllowInactiveVals() bool { return false } -func (m *PowerShapingParameters) GetIsAllowInactiveValsSet() bool { - if m != nil { - return m.IsAllowInactiveValsSet - } - return false -} - func init() { proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") @@ -1765,149 +1735,139 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 2264 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0xcd, 0x73, 0x1b, 0x49, - 0x15, 0xf7, 0x58, 0xb2, 0x2d, 0xb5, 0xfc, 0x21, 0x77, 0xb2, 0x89, 0xec, 0x35, 0xb2, 0x32, 0x4b, - 0x82, 0xd9, 0x10, 0x29, 0x76, 0x80, 0x4a, 0x05, 0xb6, 0x82, 0x23, 0x67, 0x37, 0x1f, 0xc4, 0x2b, - 0xc6, 0xc6, 0x5b, 0xb5, 0x1c, 0xa6, 0x5a, 0x33, 0x6d, 0xa9, 0xf1, 0xcc, 0xf4, 0xa4, 0xbb, 0x35, - 0x89, 0x38, 0x70, 0xe6, 0x42, 0xd5, 0x72, 0xdb, 0xe2, 0xc2, 0x1e, 0x29, 0x0e, 0x14, 0x07, 0x8a, - 0x3f, 0x80, 0xd3, 0x16, 0x55, 0x14, 0x7b, 0xe0, 0xc0, 0x69, 0x97, 0x4a, 0x0e, 0x1c, 0xa8, 0xe2, - 0xca, 0x95, 0xea, 0x9e, 0x9e, 0xd1, 0xc8, 0x96, 0x92, 0x71, 0x2d, 0x7b, 0x49, 0x34, 0xdd, 0xbf, - 0xf7, 0xeb, 0x7e, 0xdd, 0xef, 0xab, 0x9f, 0xc1, 0x0e, 0x09, 0x04, 0x66, 0x4e, 0x1f, 0x91, 0xc0, - 0xe6, 0xd8, 0x19, 0x30, 0x22, 0x86, 0x2d, 0xc7, 0x89, 0x5a, 0x21, 0xa3, 0x11, 0x71, 0x31, 0x6b, - 0x45, 0xdb, 0xe9, 0xef, 0x66, 0xc8, 0xa8, 0xa0, 0xf0, 0xad, 0x09, 0x32, 0x4d, 0xc7, 0x89,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0xfa, 0x58, 0x32, 0xad, 0xa4, - 0xc2, 0x1d, 0x25, 0x0b, 0x7f, 0x04, 0xa0, 0xe3, 0x44, 0x6a, 0x4b, 0x74, 0x20, 0x12, 0xc6, 0x72, - 0x7e, 0xc6, 0xaa, 0xe3, 0x44, 0x87, 0xb1, 0xb4, 0xa6, 0xfc, 0x09, 0xb8, 0x2c, 0x18, 0x0a, 0xf8, - 0x31, 0x66, 0xa7, 0x79, 0x41, 0x7e, 0xde, 0x37, 0x12, 0x8e, 0x71, 0xf2, 0x07, 0xa0, 0xe1, 0x68, - 0x03, 0xb2, 0x19, 0x76, 0x09, 0x17, 0x8c, 0x74, 0x07, 0x52, 0xd6, 0x3e, 0x66, 0xc8, 0x51, 0x36, - 0x52, 0x51, 0x46, 0x50, 0x4f, 0x70, 0xd6, 0x18, 0xec, 0x5d, 0x8d, 0x82, 0xef, 0x83, 0xaf, 0x77, - 0x3d, 0xea, 0x9c, 0x70, 0xb9, 0x39, 0x7b, 0x8c, 0x49, 0x2d, 0xed, 0x13, 0xce, 0x25, 0xdb, 0x62, - 0xc3, 0xd8, 0x2a, 0x58, 0x57, 0x62, 0x6c, 0x07, 0xb3, 0xbd, 0x0c, 0xf2, 0x30, 0x03, 0x84, 0x37, - 0x00, 0xec, 0x13, 0x2e, 0x28, 0x23, 0x0e, 0xf2, 0x6c, 0x1c, 0x08, 0x46, 0x30, 0xaf, 0x2d, 0x29, - 0xf1, 0xd5, 0xd1, 0xcc, 0xfd, 0x78, 0x02, 0x3e, 0x02, 0x57, 0xa6, 0x2e, 0x6a, 0x3b, 0x7d, 0x14, - 0x04, 0xd8, 0xab, 0x2d, 0x2b, 0x55, 0x36, 0xdd, 0x29, 0x6b, 0xb6, 0x63, 0x18, 0xbc, 0x00, 0xe6, - 0x04, 0x0d, 0xed, 0xfd, 0xda, 0x4a, 0xc3, 0xd8, 0x5a, 0xb2, 0x8a, 0x82, 0x86, 0xfb, 0xf0, 0x26, - 0xb8, 0x18, 0x21, 0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 0x46, 0xfb, 0x25, 0xc2, - 0x9f, 0x68, 0xac, 0x3c, 0x81, 0x6f, 0x4f, 0x6e, 0x1a, 0x94, 0x33, 0x12, 0x67, 0x5b, 0x07, 0xf0, - 0x07, 0x60, 0x9d, 0x70, 0x7b, 0x82, 0xa0, 0x5a, 0x0e, 0x64, 0x84, 0x2f, 0x11, 0x15, 0xd5, 0xc7, - 0xc4, 0x0f, 0xb0, 0xb8, 0xf7, 0xc1, 0xa7, 0x2f, 0xea, 0xc6, 0x67, 0x2f, 0xea, 0xc6, 0x3f, 0x5f, - 0xd4, 0x8d, 0x8f, 0x5e, 0xd6, 0x67, 0x3e, 0x7b, 0x59, 0x9f, 0xf9, 0xc7, 0xcb, 0xfa, 0xcc, 0x87, - 0xef, 0x9c, 0x0d, 0xe1, 0xa3, 0x14, 0x79, 0x23, 0xfd, 0x33, 0x46, 0xf4, 0x9d, 0xd6, 0xf3, 0xf1, - 0x3f, 0x92, 0xa8, 0xe8, 0xde, 0x9d, 0x57, 0x1e, 0x79, 0xeb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x9e, 0x31, 0xef, 0x01, 0x55, 0x19, 0x00, 0x00, + // 2104 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcf, 0x6f, 0x1b, 0xc7, + 0xf5, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x83, 0x1a, 0x3b, 0xf6, 0x4a, 0xd1, 0x97, 0xa4, 0x37, + 0x5f, 0x1b, 0x6c, 0x5c, 0x2f, 0x23, 0x05, 0x05, 0x0c, 0xb7, 0x81, 0x21, 0x51, 0x4e, 0x2c, 0xa9, + 0x71, 0xd8, 0x95, 0xa0, 0x00, 0xe9, 0x61, 0x31, 0xdc, 0x1d, 0x91, 0x53, 0xed, 0xee, 0xac, 0x67, + 0x86, 0x2b, 0xb3, 0x87, 0x9e, 0x8b, 0x02, 0x05, 0xd2, 0x9e, 0x82, 0x5e, 0x9a, 0x63, 0xd1, 0x53, + 0x0f, 0x45, 0xff, 0x80, 0x9e, 0x82, 0x02, 0x45, 0x73, 0xec, 0x29, 0x29, 0xec, 0x43, 0x0f, 0x05, + 0x7a, 0xed, 0xb5, 0x98, 0xd9, 0x1f, 0x5c, 0xea, 0x97, 0x69, 0x58, 0xee, 0x45, 0xda, 0x79, 0xef, + 0xf3, 0xde, 0xbc, 0x99, 0x79, 0xbf, 0x66, 0x08, 0x36, 0x48, 0x20, 0x30, 0x73, 0xfa, 0x88, 0x04, + 0x36, 0xc7, 0xce, 0x80, 0x11, 0x31, 0x6c, 0x39, 0x4e, 0xd4, 0x0a, 0x19, 0x8d, 0x88, 0x8b, 0x59, + 0x2b, 0x5a, 0xcf, 0xbe, 0xcd, 0x90, 0x51, 0x41, 0xe1, 0x3b, 0xe7, 0xc8, 0x98, 0x8e, 0x13, 0x99, + 0x19, 0x2e, 0x5a, 0x5f, 0xbd, 0x7d, 0x91, 0xe2, 0x68, 0xbd, 0x75, 0x42, 0x18, 0x8e, 0x75, 0xad, + 0x5e, 0xef, 0xd1, 0x1e, 0x55, 0x9f, 0x2d, 0xf9, 0x95, 0x50, 0xeb, 0x3d, 0x4a, 0x7b, 0x1e, 0x6e, + 0xa9, 0x51, 0x77, 0x70, 0xd4, 0x12, 0xc4, 0xc7, 0x5c, 0x20, 0x3f, 0x4c, 0x00, 0xb5, 0xd3, 0x00, + 0x77, 0xc0, 0x90, 0x20, 0x34, 0x48, 0x15, 0x90, 0xae, 0xd3, 0x72, 0x28, 0xc3, 0x2d, 0xc7, 0x23, + 0x38, 0x10, 0x72, 0xd6, 0xf8, 0x2b, 0x01, 0xb4, 0x24, 0xc0, 0x23, 0xbd, 0xbe, 0x88, 0xc9, 0xbc, + 0x25, 0x70, 0xe0, 0x62, 0xe6, 0x93, 0x18, 0x3c, 0x1a, 0x25, 0x02, 0x6b, 0x39, 0xbe, 0xc3, 0x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, 0xbe, 0xd7, 0x7a, 0x36, + 0xfe, 0xf3, 0x81, 0xca, 0x7b, 0xdd, 0x59, 0xe5, 0xb7, 0xef, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, + 0x17, 0xd9, 0xe3, 0x8b, 0x6f, 0x18, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -3063,46 +3023,38 @@ func (m *ConsumerInitializationParameters) MarshalToSizedBuffer(dAtA []byte) (in i-- dAtA[i] = 0x42 } - if m.TransferTimeoutPeriod != nil { - n17, err17 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.TransferTimeoutPeriod):]) - if err17 != nil { - return 0, err17 - } - i -= n17 - i = encodeVarintProvider(dAtA, i, uint64(n17)) - i-- - dAtA[i] = 0x3a + n17, err17 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) + if err17 != nil { + return 0, err17 } - if m.CcvTimeoutPeriod != nil { - n18, err18 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.CcvTimeoutPeriod):]) - if err18 != nil { - return 0, err18 - } - i -= n18 - i = encodeVarintProvider(dAtA, i, uint64(n18)) - i-- - dAtA[i] = 0x32 + i -= n17 + i = encodeVarintProvider(dAtA, i, uint64(n17)) + i-- + dAtA[i] = 0x3a + n18, err18 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + if err18 != nil { + return 0, err18 } - if m.UnbondingPeriod != nil { - n19, err19 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.UnbondingPeriod):]) - if err19 != nil { - return 0, err19 - } - i -= n19 - i = encodeVarintProvider(dAtA, i, uint64(n19)) - i-- - dAtA[i] = 0x2a + i -= n18 + i = encodeVarintProvider(dAtA, i, uint64(n18)) + i-- + dAtA[i] = 0x32 + n19, err19 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err19 != nil { + return 0, err19 } - if m.SpawnTime != nil { - n20, err20 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.SpawnTime):]) - if err20 != nil { - return 0, err20 - } - i -= n20 - i = encodeVarintProvider(dAtA, i, uint64(n20)) - i-- - dAtA[i] = 0x22 + i -= n19 + i = encodeVarintProvider(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0x2a + n20, err20 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SpawnTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime):]) + if err20 != nil { + return 0, err20 } + i -= n20 + i = encodeVarintProvider(dAtA, i, uint64(n20)) + i-- + dAtA[i] = 0x22 if len(m.BinaryHash) > 0 { i -= len(m.BinaryHash) copy(dAtA[i:], m.BinaryHash) @@ -3117,18 +3069,16 @@ func (m *ConsumerInitializationParameters) MarshalToSizedBuffer(dAtA []byte) (in i-- dAtA[i] = 0x12 } - if m.InitialHeight != nil { - { - size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProvider(dAtA, i, uint64(size)) + { + size, err := m.InitialHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintProvider(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -3152,16 +3102,6 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if m.IsAllowInactiveValsSet { - i-- - if m.IsAllowInactiveValsSet { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x50 - } if m.AllowInactiveVals { i-- if m.AllowInactiveVals { @@ -3170,22 +3110,12 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0 } i-- - dAtA[i] = 0x48 - } - if m.IsMinStakeSet { - i-- - if m.IsMinStakeSet { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 + dAtA[i] = 0x38 } if m.MinStake != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.MinStake)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x30 } if len(m.Denylist) > 0 { for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { @@ -3193,7 +3123,7 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Denylist[iNdEx]) i = encodeVarintProvider(dAtA, i, uint64(len(m.Denylist[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } } if len(m.Allowlist) > 0 { @@ -3202,27 +3132,17 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Allowlist[iNdEx]) i = encodeVarintProvider(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } } if m.ValidatorSetCap != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorSetCap)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 } if m.ValidatorsPowerCap != 0 { i = encodeVarintProvider(dAtA, i, uint64(m.ValidatorsPowerCap)) i-- - dAtA[i] = 0x18 - } - if m.IsTop_NSet { - i-- - if m.IsTop_NSet { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- dAtA[i] = 0x10 } if m.Top_N != 0 { @@ -3743,10 +3663,8 @@ func (m *ConsumerInitializationParameters) Size() (n int) { } var l int _ = l - if m.InitialHeight != nil { - l = m.InitialHeight.Size() - n += 1 + l + sovProvider(uint64(l)) - } + l = m.InitialHeight.Size() + n += 1 + l + sovProvider(uint64(l)) l = len(m.GenesisHash) if l > 0 { n += 1 + l + sovProvider(uint64(l)) @@ -3755,22 +3673,14 @@ func (m *ConsumerInitializationParameters) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } - if m.SpawnTime != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.SpawnTime) - n += 1 + l + sovProvider(uint64(l)) - } - if m.UnbondingPeriod != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.UnbondingPeriod) - n += 1 + l + sovProvider(uint64(l)) - } - if m.CcvTimeoutPeriod != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.CcvTimeoutPeriod) - n += 1 + l + sovProvider(uint64(l)) - } - if m.TransferTimeoutPeriod != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.TransferTimeoutPeriod) - n += 1 + l + sovProvider(uint64(l)) - } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SpawnTime) + n += 1 + l + sovProvider(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) + n += 1 + l + sovProvider(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod) + n += 1 + l + sovProvider(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod) + n += 1 + l + sovProvider(uint64(l)) l = len(m.ConsumerRedistributionFraction) if l > 0 { n += 1 + l + sovProvider(uint64(l)) @@ -3797,9 +3707,6 @@ func (m *PowerShapingParameters) Size() (n int) { if m.Top_N != 0 { n += 1 + sovProvider(uint64(m.Top_N)) } - if m.IsTop_NSet { - n += 2 - } if m.ValidatorsPowerCap != 0 { n += 1 + sovProvider(uint64(m.ValidatorsPowerCap)) } @@ -3821,15 +3728,9 @@ func (m *PowerShapingParameters) Size() (n int) { if m.MinStake != 0 { n += 1 + sovProvider(uint64(m.MinStake)) } - if m.IsMinStakeSet { - n += 2 - } if m.AllowInactiveVals { n += 2 } - if m.IsAllowInactiveValsSet { - n += 2 - } return n } @@ -7333,9 +7234,6 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.InitialHeight == nil { - m.InitialHeight = &types.Height{} - } if err := m.InitialHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -7437,10 +7335,7 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.SpawnTime == nil { - m.SpawnTime = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SpawnTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7473,10 +7368,7 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.UnbondingPeriod == nil { - m.UnbondingPeriod = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7509,10 +7401,7 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CcvTimeoutPeriod == nil { - m.CcvTimeoutPeriod = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CcvTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7545,10 +7434,7 @@ func (m *ConsumerInitializationParameters) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.TransferTimeoutPeriod == nil { - m.TransferTimeoutPeriod = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TransferTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7724,26 +7610,6 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } } case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsTop_NSet", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsTop_NSet = bool(v != 0) - case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsPowerCap", wireType) } @@ -7762,7 +7628,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 4: + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSetCap", wireType) } @@ -7781,7 +7647,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", wireType) } @@ -7813,7 +7679,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } m.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 6: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Denylist", wireType) } @@ -7845,7 +7711,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } m.Denylist = append(m.Denylist, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 7: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MinStake", wireType) } @@ -7864,27 +7730,7 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { break } } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsMinStakeSet", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsMinStakeSet = bool(v != 0) - case 9: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AllowInactiveVals", wireType) } @@ -7904,26 +7750,6 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } } m.AllowInactiveVals = bool(v != 0) - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsAllowInactiveValsSet", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsAllowInactiveValsSet = bool(v != 0) default: iNdEx = preIndex skippy, err := skipProvider(dAtA[iNdEx:]) From f66831a343aa8c877f318816a2b62bc2a3e7f3f5 Mon Sep 17 00:00:00 2001 From: insumity Date: Thu, 22 Aug 2024 16:30:02 +0200 Subject: [PATCH 35/41] Update x/ccv/provider/types/msg.go Co-authored-by: bernd-m <43466467+bermuell@users.noreply.github.com> --- x/ccv/provider/types/msg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index aff600b1b4..2123a94d74 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -854,7 +854,7 @@ func ValidateInitializationParameters(initializationParameters ConsumerInitializ } if err := ccvtypes.ValidateDuration(initializationParameters.UnbondingPeriod); err != nil { - return errorsmod.Wrap(ErrInvalidConsumerInitializationParameters, "unbonding period cannot be zero") + return errorsmod.Wrapf(ErrInvalidConsumerInitializationParameters, "invalid unbonding period: %s", err.Error()) } return nil From 76e0370935ab47940e9d9b894a9928f9ec759983 Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 23 Aug 2024 08:26:32 +0200 Subject: [PATCH 36/41] removed double-gas charge on MsgCreateConsumer and imroved the logic of MsgUpdateConsumer --- x/ccv/provider/keeper/msg_server.go | 43 ++++-------- x/ccv/provider/keeper/msg_server_test.go | 69 -------------------- x/ccv/provider/keeper/permissionless.go | 45 ++++++++----- x/ccv/provider/keeper/permissionless_test.go | 51 +++++++++++++++ 4 files changed, 90 insertions(+), 118 deletions(-) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 8fd3b93857..1de4162fa6 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -9,8 +9,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "time" - "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v5/x/ccv/types" ) @@ -308,7 +306,6 @@ func (k msgServer) SetConsumerCommissionRate(goCtx context.Context, msg *types.M // CreateConsumer creates a consumer chain func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateConsumer) (*types.MsgCreateConsumerResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - initGas := ctx.GasMeter().GasConsumed() consumerId := k.FetchAndIncrementConsumerId(ctx) @@ -335,15 +332,11 @@ func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateCon if k.CanLaunch(ctx, consumerId) { k.SetConsumerPhase(ctx, consumerId, Initialized) - k.PrepareConsumerForLaunch(ctx, consumerId, time.Time{}, msg.InitializationParameters.SpawnTime) + k.PrepareConsumerForLaunch(ctx, consumerId, msg.InitializationParameters.SpawnTime) } else { k.SetConsumerPhase(ctx, consumerId, Registered) } - gasAfter := ctx.GasMeter().GasConsumed() - ctx.GasMeter().ConsumeGas(gasAfter-initGas, "creating a chain has an additional cost during spawn time, "+ - "so charging double the gas here") - return &types.MsgCreateConsumerResponse{ConsumerId: consumerId}, nil } @@ -357,47 +350,35 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrNoOwnerAddress, "cannot retrieve owner address %s", ownerAddress) } - if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.Top_N > 0 && msg.Signer != k.GetAuthority() { - return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidTransformToTopN, "an update to a Top N chain can only be done through a governance proposal") + if msg.Signer != ownerAddress { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Signer) } - if msg.Signer == k.GetAuthority() { - // message is executed as part of governance proposal - if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.Top_N == 0 { - // chain becomes an Opt In chain, hence we change the owner address - k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) - } else { - // message is executed as part of governance proposal and hence we change the owner address to be the one of - // the gov module account address (e.g., a gov proposal with a single `MsgUpdateConsumer` might have led to this) - k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, k.GetAuthority()) - } - } else if msg.Signer == ownerAddress { - k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) - } else { - // else means that `msg.Signer != k.GetAuthority` && `msgSigner != ownerAddress` - return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Signer) + if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.Top_N > 0 && ownerAddress != k.GetAuthority() { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidTransformToTopN, + "an update to a Top N chain can only be done if chain is owner is the gov module") } + k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) + if msg.Metadata != nil { k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, *msg.Metadata) } - var previousSpawnTime time.Time - if previousParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { - previousSpawnTime = previousParameters.SpawnTime - } - if msg.InitializationParameters != nil { k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, *msg.InitializationParameters) } if msg.PowerShapingParameters != nil { k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, *msg.PowerShapingParameters) + k.Keeper.PopulateAllowlist(ctx, consumerId) + k.Keeper.PopulateDenylist(ctx, consumerId) + k.Keeper.PopulateMinimumPowerInTopN(ctx, consumerId) } if k.CanLaunch(ctx, consumerId) { k.SetConsumerPhase(ctx, consumerId, Initialized) - k.PrepareConsumerForLaunch(ctx, consumerId, previousSpawnTime, msg.InitializationParameters.SpawnTime) + k.PrepareConsumerForLaunch(ctx, consumerId, msg.InitializationParameters.SpawnTime) } return &types.MsgUpdateConsumerResponse{}, nil diff --git a/x/ccv/provider/keeper/msg_server_test.go b/x/ccv/provider/keeper/msg_server_test.go index 9e8d738693..9dcf3942fe 100644 --- a/x/ccv/provider/keeper/msg_server_test.go +++ b/x/ccv/provider/keeper/msg_server_test.go @@ -1,7 +1,6 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" @@ -54,71 +53,3 @@ func TestCreateConsumer(t *testing.T) { require.True(t, found) require.Equal(t, providerkeeper.Registered, phase) } - -func TestUpdateConsumer(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - consumerId := "0" - - // set up a consumer client, so it seems that chain is running - providerKeeper.SetConsumerClientId(ctx, consumerId, "clientID") - - // set PSS-related fields to update them later on - providerKeeper.SetConsumerPowerShapingParameters(ctx, consumer, providertypes.PowerShapingParameters{ - Top_N: 50, - ValidatorSetCap: 10, - ValidatorsPowerCap: 34, - MinStake: 100, - AllowInactiveVals: true, - }) - providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr1"))) - providerKeeper.SetAllowlist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("allowlistedAddr2"))) - providerKeeper.SetDenylist(ctx, consumerId, providertypes.NewProviderConsAddress([]byte("denylistedAddr1"))) - - expectedTopN := uint32(75) - expectedValidatorsPowerCap := uint32(67) - expectedValidatorSetCap := uint32(20) - expectedAllowlistedValidator := "cosmosvalcons1wpex7anfv3jhystyv3eq20r35a" - expectedDenylistedValidator := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" - expectedMinStake := uint64(0) - expectedAllowInactiveValidators := false - - powerShapingParameters := providertypes.PowerShapingParameters{ - Top_N: expectedTopN, - ValidatorsPowerCap: expectedValidatorsPowerCap, - ValidatorSetCap: expectedValidatorSetCap, - Allowlist: []string{expectedAllowlistedValidator}, - Denylist: []string{expectedDenylistedValidator}, - MinStake: expectedMinStake, - AllowInactiveVals: expectedAllowInactiveValidators, - } - - providerKeeper.SetConsumerPhase(ctx, consumerId, providerkeeper.Initialized) - providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, powerShapingParameters) - err := providerKeeper.UpdateConsumer(ctx, consumerId) - require.NoError(t, err) - - actualTopN := providerKeeper.GetTopN(ctx, consumerId) - require.Equal(t, expectedTopN, actualTopN) - actualValidatorsPowerCap := providerKeeper.GetValidatorsPowerCap(ctx, consumerId) - require.Equal(t, expectedValidatorsPowerCap, actualValidatorsPowerCap) - actualValidatorSetCap := providerKeeper.GetValidatorSetCap(ctx, consumerId) - require.Equal(t, expectedValidatorSetCap, actualValidatorSetCap) - - allowlistedValidator, err := sdk.ConsAddressFromBech32(expectedAllowlistedValidator) - require.NoError(t, err) - require.Equal(t, 1, len(providerKeeper.GetAllowList(ctx, consumerId))) - require.Equal(t, providertypes.NewProviderConsAddress(allowlistedValidator), providerKeeper.GetAllowList(ctx, consumerId)[0]) - - denylistedValidator, err := sdk.ConsAddressFromBech32(expectedDenylistedValidator) - require.NoError(t, err) - require.Equal(t, 1, len(providerKeeper.GetDenyList(ctx, consumerId))) - require.Equal(t, providertypes.NewProviderConsAddress(denylistedValidator), providerKeeper.GetDenyList(ctx, consumerId)[0]) - - actualMinStake := providerKeeper.GetMinStake(ctx, consumerId) - require.Equal(t, expectedMinStake, actualMinStake) - - actualAllowInactiveValidators := providerKeeper.AllowsInactiveValidators(ctx, consumerId) - require.Equal(t, expectedAllowInactiveValidators, actualAllowInactiveValidators) -} diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index 631e070258..aaef8e09f4 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -576,19 +576,11 @@ func (k Keeper) LaunchConsumer(ctx sdk.Context, consumerId string) error { return nil } -// UpdateConsumer updates the chain with the provided consumer id -func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { - phase, found := k.GetConsumerPhase(ctx, consumerId) - if !found || phase == Stopped { - return errorsmod.Wrapf(types.ErrInvalidPhase, - "cannot update stopped or not existing chain: %s", consumerId) - } - +// PopulateAllowlist populates the allowlist store for the consumer chain with this consumer id +func (k Keeper) PopulateAllowlist(ctx sdk.Context, consumerId string) error { powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) if err != nil { - // TODO (permissionless) -- not really an invalid update record - return errorsmod.Wrapf(types.ErrInvalidPowerShapingParameters, - "did not find update record for chain: %s", consumerId) + return err } k.DeleteAllowlist(ctx, consumerId) @@ -600,6 +592,15 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { k.SetAllowlist(ctx, consumerId, types.NewProviderConsAddress(consAddr)) } + return err +} + +// PopulateDenylist populates the denylist store for the consumer chain with this consumer id +func (k Keeper) PopulateDenylist(ctx sdk.Context, consumerId string) error { + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + if err != nil { + return err + } k.DeleteDenylist(ctx, consumerId) for _, address := range powerShapingParameters.Denylist { @@ -611,12 +612,18 @@ func (k Keeper) UpdateConsumer(ctx sdk.Context, consumerId string) error { k.SetDenylist(ctx, consumerId, types.NewProviderConsAddress(consAddr)) } - oldTopN := k.GetTopN(ctx, consumerId) - if !found { - oldTopN = 0 - k.Logger(ctx).Info("consumer chain top N not found, treating as 0", "consumerId", consumerId) + return nil +} + +// PopulateMinimumPowerInTopN populates the minimum power in Top N for the consumer chain with this consumer id +func (k Keeper) PopulateMinimumPowerInTopN(ctx sdk.Context, consumerId string) error { + powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + if err != nil { + return err } + oldTopN := k.GetTopN(ctx, consumerId) + // if the top N changes, we need to update the new minimum power in top N if powerShapingParameters.Top_N != oldTopN { if powerShapingParameters.Top_N > 0 { @@ -710,9 +717,11 @@ func (k Keeper) IsValidatorOptedInToChainId(ctx sdk.Context, providerAddr types. return "", false } -func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, previousSpawnTime time.Time, spawnTime time.Time) { - // if this is not the first initialization, remove the consumer id from the old spawn time - k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) +func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, spawnTime time.Time) { + if previousParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { + // if this is not the first initialization, remove the consumer id from the old spawn time + k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousParameters.SpawnTime) + } k.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, spawnTime) } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index 4c9d11ff74..fc718d12bb 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" @@ -279,3 +280,53 @@ func TestIsValidatorOptedInToChain(t *testing.T) { require.True(t, found) require.Equal(t, expectedConsumerId, actualConsumerId) } + +func TestPopulateAllowlist(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + consumerId := "0" + + providerConsAddr1 := "cosmosvalcons1qmq08eruchr5sf5s3rwz7djpr5a25f7xw4mceq" + consAddr1, _ := sdk.ConsAddressFromBech32(providerConsAddr1) + providerConsAddr2 := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" + consAddr2, _ := sdk.ConsAddressFromBech32(providerConsAddr2) + + // set PSS-related fields to update them later on + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ + Allowlist: []string{providerConsAddr1, providerConsAddr2}, + }) + + err := providerKeeper.PopulateAllowlist(ctx, consumerId) + require.NoError(t, err) + + expectedAllowlist := []providertypes.ProviderConsAddress{ + providertypes.NewProviderConsAddress(consAddr1), + providertypes.NewProviderConsAddress(consAddr2)} + require.Equal(t, expectedAllowlist, providerKeeper.GetAllowList(ctx, consumerId)) +} + +func TestPopulateDenylist(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + consumerId := "0" + + providerConsAddr1 := "cosmosvalcons1qmq08eruchr5sf5s3rwz7djpr5a25f7xw4mceq" + consAddr1, _ := sdk.ConsAddressFromBech32(providerConsAddr1) + providerConsAddr2 := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" + consAddr2, _ := sdk.ConsAddressFromBech32(providerConsAddr2) + + // set PSS-related fields to update them later on + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ + Denylist: []string{providerConsAddr1, providerConsAddr2}, + }) + + err := providerKeeper.PopulateDenylist(ctx, consumerId) + require.NoError(t, err) + + expectedDenylist := []providertypes.ProviderConsAddress{ + providertypes.NewProviderConsAddress(consAddr1), + providertypes.NewProviderConsAddress(consAddr2)} + require.Equal(t, expectedDenylist, providerKeeper.GetDenyList(ctx, consumerId)) +} From 59e27e96b2eb3ede86038d3c8207bfed779684de Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 23 Aug 2024 09:43:29 +0200 Subject: [PATCH 37/41] added PopulateMinimumPowerInTopN tested --- x/ccv/provider/keeper/msg_server.go | 3 +- x/ccv/provider/keeper/permissionless.go | 6 +- x/ccv/provider/keeper/permissionless_test.go | 79 +++++++++++++++++++- 3 files changed, 81 insertions(+), 7 deletions(-) diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 1de4162fa6..c136ddbf2f 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -370,10 +370,11 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon } if msg.PowerShapingParameters != nil { + oldTopN := k.Keeper.GetTopN(ctx, consumerId) k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, *msg.PowerShapingParameters) k.Keeper.PopulateAllowlist(ctx, consumerId) k.Keeper.PopulateDenylist(ctx, consumerId) - k.Keeper.PopulateMinimumPowerInTopN(ctx, consumerId) + k.Keeper.PopulateMinimumPowerInTopN(ctx, consumerId, oldTopN) } if k.CanLaunch(ctx, consumerId) { diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index aaef8e09f4..ebad8e32ad 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -616,19 +616,17 @@ func (k Keeper) PopulateDenylist(ctx sdk.Context, consumerId string) error { } // PopulateMinimumPowerInTopN populates the minimum power in Top N for the consumer chain with this consumer id -func (k Keeper) PopulateMinimumPowerInTopN(ctx sdk.Context, consumerId string) error { +func (k Keeper) PopulateMinimumPowerInTopN(ctx sdk.Context, consumerId string, oldTopN uint32) error { powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) if err != nil { return err } - oldTopN := k.GetTopN(ctx, consumerId) - // if the top N changes, we need to update the new minimum power in top N if powerShapingParameters.Top_N != oldTopN { if powerShapingParameters.Top_N > 0 { // if the chain receives a non-zero top N value, store the minimum power in the top N - bondedValidators, err := k.GetLastBondedValidators(ctx) + bondedValidators, err := k.GetLastProviderConsensusActiveValidators(ctx) if err != nil { return err } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index fc718d12bb..59d378a5ad 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -2,10 +2,12 @@ package keeper_test import ( sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "testing" "time" @@ -292,7 +294,6 @@ func TestPopulateAllowlist(t *testing.T) { providerConsAddr2 := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" consAddr2, _ := sdk.ConsAddressFromBech32(providerConsAddr2) - // set PSS-related fields to update them later on providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ Allowlist: []string{providerConsAddr1, providerConsAddr2}, }) @@ -317,7 +318,6 @@ func TestPopulateDenylist(t *testing.T) { providerConsAddr2 := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" consAddr2, _ := sdk.ConsAddressFromBech32(providerConsAddr2) - // set PSS-related fields to update them later on providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ Denylist: []string{providerConsAddr1, providerConsAddr2}, }) @@ -330,3 +330,78 @@ func TestPopulateDenylist(t *testing.T) { providertypes.NewProviderConsAddress(consAddr2)} require.Equal(t, expectedDenylist, providerKeeper.GetDenyList(ctx, consumerId)) } + +func TestPopulateMinimumPowerInTopN(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + consumerId := "0" + + // test case where Top N is 0 in which case there's no minimum power in top N + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ + Top_N: 0, + }) + + err := providerKeeper.PopulateMinimumPowerInTopN(ctx, consumerId, 0) + require.NoError(t, err) + _, found := providerKeeper.GetMinimumPowerInTopN(ctx, consumerId) + require.False(t, found) + + // test cases where Top N > 0 and for this we mock some validators + powers := []int64{30, 20, 10} + validators := []stakingtypes.Validator{ + createStakingValidator(ctx, mocks, 3, powers[0], 3), // this validator has 50% of the total voting power + createStakingValidator(ctx, mocks, 2, powers[1], 2), // this validator has ~33% of the total voting gpower + createStakingValidator(ctx, mocks, 1, powers[2], 1), // this validator has ~16 of the total voting power + } + mocks.MockStakingKeeper.EXPECT().IterateLastValidatorPowers(gomock.Any(), gomock.Any()).DoAndReturn( + func(ctx sdk.Context, cb func(sdk.ValAddress, int64) bool) error { + for i, val := range validators { + if stop := cb(sdk.ValAddress(val.OperatorAddress), powers[i]); stop { + break + } + } + return nil + }).AnyTimes() + + // set up mocks for GetValidator calls + for _, val := range validators { + mocks.MockStakingKeeper.EXPECT().GetValidator(gomock.Any(), sdk.ValAddress(val.OperatorAddress)).Return(val, nil).AnyTimes() + } + + maxProviderConsensusValidators := int64(3) + params := providerKeeper.GetParams(ctx) + params.MaxProviderConsensusValidators = maxProviderConsensusValidators + providerKeeper.SetParams(ctx, params) + + // when top N is 50, the minimum power is 30 (because top validator has to validate) + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ + Top_N: 50, + }) + err = providerKeeper.PopulateMinimumPowerInTopN(ctx, consumerId, 0) + require.NoError(t, err) + minimumPowerInTopN, found := providerKeeper.GetMinimumPowerInTopN(ctx, consumerId) + require.True(t, found) + require.Equal(t, int64(30), minimumPowerInTopN) + + // when top N is 51, the minimum power is 20 (because top 2 validators have to validate) + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ + Top_N: 51, + }) + err = providerKeeper.PopulateMinimumPowerInTopN(ctx, consumerId, 0) + require.NoError(t, err) + minimumPowerInTopN, found = providerKeeper.GetMinimumPowerInTopN(ctx, consumerId) + require.True(t, found) + require.Equal(t, int64(20), minimumPowerInTopN) + + // when top N is 100, the minimum power is 10 (that of the validator with the lowest power) + providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ + Top_N: 100, + }) + err = providerKeeper.PopulateMinimumPowerInTopN(ctx, consumerId, 0) + require.NoError(t, err) + minimumPowerInTopN, found = providerKeeper.GetMinimumPowerInTopN(ctx, consumerId) + require.True(t, found) + require.Equal(t, int64(10), minimumPowerInTopN) + +} From cde883bdcce0b8bf831473fa9c69010448db4819 Mon Sep 17 00:00:00 2001 From: insumity Date: Fri, 23 Aug 2024 14:53:24 +0200 Subject: [PATCH 38/41] took into account comments (using protos for marshalling string slice, fixed issues in the UpdateConsumer logic, added extra check to abort spurious proposals) --- .../ccv/provider/v1/provider.proto | 4 + tests/integration/provider_gov_hooks.go | 10 + x/ccv/provider/keeper/hooks.go | 13 + x/ccv/provider/keeper/msg_server.go | 96 +++- x/ccv/provider/keeper/permissionless.go | 191 ++++---- x/ccv/provider/keeper/permissionless_test.go | 24 +- x/ccv/provider/types/errors.go | 23 +- x/ccv/provider/types/legacy_proposal_test.go | 2 +- x/ccv/provider/types/msg.go | 12 +- x/ccv/provider/types/provider.pb.go | 443 ++++++++++++------ 10 files changed, 539 insertions(+), 279 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index b6a08c5c03..7ccc5c147b 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -460,3 +460,7 @@ message PowerShapingParameters { // Corresponds to whether inactive validators are allowed to validate the consumer chain. bool allow_inactive_vals = 7; } + +// ConsumerIds contains consumer ids of chains +// Used so we can easily (de)serialize slices of strings +message ConsumerIds { repeated string consumer_ids = 1; } diff --git a/tests/integration/provider_gov_hooks.go b/tests/integration/provider_gov_hooks.go index 798887c14c..0890436781 100644 --- a/tests/integration/provider_gov_hooks.go +++ b/tests/integration/provider_gov_hooks.go @@ -29,6 +29,16 @@ func (s *CCVTestSuite) TestAfterPropSubmissionAndVotingPeriodEnded() { err = govKeeper.SetProposal(ctx, proposal) s.Require().NoError(err) + // the proposal can only be submitted if the owner of the chain is the gov module + providerKeeper.SetConsumerOwnerAddress(ctx, msgUpdateConsumer.ConsumerId, "some bogus address") + + err = providerKeeper.Hooks().AfterProposalSubmission(ctx, proposal.Id) + s.Require().Error(err) + + // the proposal can only be submitted if the owner of the chain is the gov module + govModuleAddress := "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn" + providerKeeper.SetConsumerOwnerAddress(ctx, msgUpdateConsumer.ConsumerId, govModuleAddress) + err = providerKeeper.Hooks().AfterProposalSubmission(ctx, proposal.Id) s.Require().NoError(err) diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index b8040fd355..841db8330e 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -119,6 +119,19 @@ func (h Hooks) AfterProposalSubmission(goCtx context.Context, proposalId uint64) for _, msg := range p.GetMessages() { sdkMsg, isMsgUpdateConsumer := msg.GetCachedValue().(*providertypes.MsgUpdateConsumer) if isMsgUpdateConsumer { + // A `MsgUpdateConsumer` can only succeed if the owner of the consumer chain is the gov module. + // If that's not the case, we immediately fail the proposal. + // Note that someone could potentially change the owner of a chain to be that of the gov module + // while a proposal is active and before the proposal is executed. Even then, we still do not allow + // `MsgUpdateConsumer` proposals if the owner of the chain is not the gov module to avoid someone forgetting + // to change the owner address while the proposal is active. + ownerAddress, err := h.k.GetConsumerOwnerAddress(ctx, sdkMsg.ConsumerId) + if err != nil { + return fmt.Errorf("cannot find owner address for consumer with consumer id (%s): %s", sdkMsg.ConsumerId, err.Error()) + } else if ownerAddress != h.k.GetAuthority() { + return fmt.Errorf("owner address (%s) is not the gov module (%s)", ownerAddress, h.k.GetAuthority()) + } + if hasUpdateConsumerMsg { return fmt.Errorf("proposal can contain at most one `MsgUpdateConsumer` message") } diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index c136ddbf2f..f87454e01e 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -11,6 +11,8 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v5/x/ccv/types" + "strings" + "time" ) type msgServer struct { @@ -311,30 +313,36 @@ func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateCon k.SetConsumerOwnerAddress(ctx, consumerId, msg.Signer) k.SetConsumerChainId(ctx, consumerId, msg.ChainId) + k.SetConsumerPhase(ctx, consumerId, Registered) if err := k.SetConsumerMetadata(ctx, consumerId, msg.Metadata); err != nil { - return &types.MsgCreateConsumerResponse{}, err + return &types.MsgCreateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidConsumerMetadata, + "cannot set consumer metadata: %s", err.Error()) } // initialization parameters are optional and hence could be nil if msg.InitializationParameters != nil { if err := k.SetConsumerInitializationParameters(ctx, consumerId, *msg.InitializationParameters); err != nil { - return &types.MsgCreateConsumerResponse{}, err + return &types.MsgCreateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidConsumerInitializationParameters, + "cannot set consumer initialization parameters: %s", err.Error()) } } // power-shaping parameters are optional and hence could be null if msg.PowerShapingParameters != nil { + if msg.PowerShapingParameters.Top_N != 0 { + return &types.MsgCreateConsumerResponse{}, errorsmod.Wrap(types.ErrCannotCreateTopNChain, + "cannot create a Top N chain using the `MsgCreateConsumer` message; use `MsgUpdateConsumer` instead") + } if err := k.SetConsumerPowerShapingParameters(ctx, consumerId, *msg.PowerShapingParameters); err != nil { - return &types.MsgCreateConsumerResponse{}, err + return &types.MsgCreateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidPowerShapingParameters, + "cannot set power shaping parameters") } } - if k.CanLaunch(ctx, consumerId) { + if spawnTime, canLaunch := k.CanLaunch(ctx, consumerId); canLaunch { k.SetConsumerPhase(ctx, consumerId, Initialized) - k.PrepareConsumerForLaunch(ctx, consumerId, msg.InitializationParameters.SpawnTime) - } else { - k.SetConsumerPhase(ctx, consumerId, Registered) + k.PrepareConsumerForLaunch(ctx, consumerId, time.Time{}, spawnTime) } return &types.MsgCreateConsumerResponse{ConsumerId: consumerId}, nil @@ -345,6 +353,12 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon ctx := sdk.UnwrapSDKContext(goCtx) consumerId := msg.ConsumerId + phase, found := k.GetConsumerPhase(ctx, consumerId) + if found && phase == Stopped { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidPhase, + "cannot update consumer chain that is in the stopped phase: %s", consumerId) + } + ownerAddress, err := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) if err != nil { return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrNoOwnerAddress, "cannot retrieve owner address %s", ownerAddress) @@ -354,32 +368,74 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrUnauthorized, "expected owner address %s, got %s", ownerAddress, msg.Signer) } - if msg.PowerShapingParameters != nil && msg.PowerShapingParameters.Top_N > 0 && ownerAddress != k.GetAuthority() { - return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidTransformToTopN, - "an update to a Top N chain can only be done if chain is owner is the gov module") + if strings.TrimSpace(msg.NewOwnerAddress) != "" { + k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) } - k.Keeper.SetConsumerOwnerAddress(ctx, consumerId, msg.NewOwnerAddress) - if msg.Metadata != nil { - k.Keeper.SetConsumerMetadata(ctx, msg.ConsumerId, *msg.Metadata) + if err := k.SetConsumerMetadata(ctx, consumerId, *msg.Metadata); err != nil { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidConsumerMetadata, + "cannot set consumer metadata: %s", err.Error()) + } + } + + // get the previous spawn time so that we can use it in `PrepareConsumerForLaunch` + var previousSpawnTime time.Time + if previousInitializationParameters, err := k.Keeper.GetConsumerInitializationParameters(ctx, msg.ConsumerId); err != nil { + previousSpawnTime = previousInitializationParameters.SpawnTime } if msg.InitializationParameters != nil { - k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, *msg.InitializationParameters) + if err = k.Keeper.SetConsumerInitializationParameters(ctx, msg.ConsumerId, *msg.InitializationParameters); err != nil { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidConsumerInitializationParameters, + "cannot set consumer initialization parameters: %s", err.Error()) + } } if msg.PowerShapingParameters != nil { + // A consumer chain can only become a Top N chain if the owner is the gov module. Because of this, to create a + // Top N chain, we need two `MsgUpdateConsumer` messages: i) one that would set the `ownerAddress` to the gov module + // and ii) one that would set the `Top_N` to something greater than 0. + if msg.PowerShapingParameters.Top_N > 0 && ownerAddress != k.GetAuthority() { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidTransformToTopN, + "an update to a Top N chain can only be done if chain is owner is the gov module") + } + oldTopN := k.Keeper.GetTopN(ctx, consumerId) - k.Keeper.SetConsumerPowerShapingParameters(ctx, msg.ConsumerId, *msg.PowerShapingParameters) - k.Keeper.PopulateAllowlist(ctx, consumerId) - k.Keeper.PopulateDenylist(ctx, consumerId) - k.Keeper.PopulateMinimumPowerInTopN(ctx, consumerId, oldTopN) + if err = k.SetConsumerPowerShapingParameters(ctx, consumerId, *msg.PowerShapingParameters); err != nil { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidPowerShapingParameters, + "cannot set power shaping parameters") + } + + k.Keeper.UpdateAllowlist(ctx, consumerId, msg.PowerShapingParameters.Allowlist) + k.Keeper.UpdateDenylist(ctx, consumerId, msg.PowerShapingParameters.Denylist) + err = k.Keeper.UpdateMinimumPowerInTopN(ctx, consumerId, oldTopN, msg.PowerShapingParameters.Top_N) + if err != nil { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrCannotUpdateMinimumPowerInTopN, + "could not update minimum power in top N, oldTopN: %d, newTopN: %d, error: %s", oldTopN, msg.PowerShapingParameters.Top_N, err.Error()) + } + } + + // A Top N cannot change its owner address to something different from the gov module if the chain + // remains a Top N chain. + currentOwnerAddress, err := k.GetConsumerOwnerAddress(ctx, consumerId) + if err != nil { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrNoOwnerAddress, "cannot retrieve owner address %s: %s", ownerAddress, err.Error()) + } + + currentPowerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) + if err != nil { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidPowerShapingParameters, "cannot retrieve power shaping parameters: %s", err.Error()) + } + + if currentPowerShapingParameters.Top_N != 0 && currentOwnerAddress != k.GetAuthority() { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidTransformToOptIn, + "a move to a new owner address that is not the gov module can only be done if `Top N` is set to 0") } - if k.CanLaunch(ctx, consumerId) { + if spawnTime, canLaunch := k.CanLaunch(ctx, consumerId); canLaunch { k.SetConsumerPhase(ctx, consumerId, Initialized) - k.PrepareConsumerForLaunch(ctx, consumerId, msg.InitializationParameters.SpawnTime) + k.PrepareConsumerForLaunch(ctx, consumerId, previousSpawnTime, spawnTime) } return &types.MsgUpdateConsumerResponse{}, nil diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index ebad8e32ad..c1b397e693 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -253,38 +253,41 @@ func (k Keeper) DeleteConsumerStopTime(ctx sdk.Context, consumerId string) { } // GetConsumersToBeLaunched -func (k Keeper) GetConsumersToBeLaunched(ctx sdk.Context, spawnTime time.Time) ([]string, error) { +func (k Keeper) GetConsumersToBeLaunched(ctx sdk.Context, spawnTime time.Time) (types.ConsumerIds, error) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.SpawnTimeToConsumerIdsKey(spawnTime)) if bz == nil { - return []string{}, nil + return types.ConsumerIds{}, nil } - var consumerIds []string - buf := bytes.NewBuffer(bz) - dec := gob.NewDecoder(buf) - err := dec.Decode(&consumerIds) - return consumerIds, err + var consumerIds types.ConsumerIds + + if err := consumerIds.Unmarshal(bz); err != nil { + return types.ConsumerIds{}, fmt.Errorf("failed to unmarshal consumer ids: %w", err) + } + return consumerIds, nil } // AppendSpawnTimeForConsumerToBeLaunched func (k Keeper) AppendSpawnTimeForConsumerToBeLaunched(ctx sdk.Context, consumerId string, spawnTime time.Time) error { store := ctx.KVStore(k.storeKey) - consumerIds, err := k.GetConsumersToBeLaunched(ctx, spawnTime) + consumerIdsSlice, err := k.GetConsumersToBeLaunched(ctx, spawnTime) if err != nil { return err } - consumerIds = append(consumerIds, consumerId) + consumerIds := append(consumerIdsSlice.ConsumerIds, consumerId) - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - err = enc.Encode(consumerIds) + appendedConsumerIdsStr := types.ConsumerIds{ + ConsumerIds: consumerIds, + } + + bz, err := appendedConsumerIdsStr.Marshal() if err != nil { return err } - store.Set(types.SpawnTimeToConsumerIdsKey(spawnTime), buf.Bytes()) + store.Set(types.SpawnTimeToConsumerIdsKey(spawnTime), bz) return nil } @@ -297,74 +300,80 @@ func (k Keeper) RemoveConsumerFromToBeLaunchedConsumers(ctx sdk.Context, consume return err } - if len(consumerIds) == 0 { + if len(consumerIds.ConsumerIds) == 0 { return fmt.Errorf("no consumer ids for spawn time: %s", spawnTime.String()) } // find the index of the consumer we want to remove index := 0 - for i := 0; i < len(consumerIds); i = i + 1 { - if consumerIds[i] == consumerId { + for i := 0; i < len(consumerIds.ConsumerIds); i = i + 1 { + if consumerIds.ConsumerIds[i] == consumerId { index = i break } } - if consumerIds[index] != consumerId { + if consumerIds.ConsumerIds[index] != consumerId { return fmt.Errorf("failed to find consumer id (%s) in the chains to be launched", consumerId) } - if len(consumerIds) == 1 { + if len(consumerIds.ConsumerIds) == 1 { store.Delete(types.SpawnTimeToConsumerIdsKey(spawnTime)) return nil } - updatedConsumerIds := append(consumerIds[:index], consumerIds[index+1:]...) - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - err = enc.Encode(updatedConsumerIds) + updatedConsumerIds := append(consumerIds.ConsumerIds[:index], consumerIds.ConsumerIds[index+1:]...) + + updatedConsumerIdsStr := types.ConsumerIds{ + ConsumerIds: updatedConsumerIds, + } + + bz, err := updatedConsumerIdsStr.Marshal() if err != nil { return err } - store.Set(types.SpawnTimeToConsumerIdsKey(spawnTime), buf.Bytes()) + store.Set(types.SpawnTimeToConsumerIdsKey(spawnTime), bz) return nil } // TODO (PERMISSIONLESS) merge the functions, they practically do the same // GetConsumersToBeStopped -func (k Keeper) GetConsumersToBeStopped(ctx sdk.Context, stopTime time.Time) ([]string, error) { +func (k Keeper) GetConsumersToBeStopped(ctx sdk.Context, stopTime time.Time) (types.ConsumerIds, error) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.StopTimeToConsumerIdsKey(stopTime)) if bz == nil { - return []string{}, nil + return types.ConsumerIds{}, nil } - var consumerIds []string - buf := bytes.NewBuffer(bz) - dec := gob.NewDecoder(buf) - err := dec.Decode(&consumerIds) - return consumerIds, err + var consumerIds types.ConsumerIds + err := consumerIds.Unmarshal(bz) + if err != nil { + return types.ConsumerIds{}, err + } + return consumerIds, nil } // AppendSpawnTimeForConsumerToBeStopped func (k Keeper) AppendStopTimeForConsumerToBeStopped(ctx sdk.Context, consumerId string, stopTime time.Time) error { store := ctx.KVStore(k.storeKey) - consumerIds, err := k.GetConsumersToBeStopped(ctx, stopTime) + consumerIdsStr, err := k.GetConsumersToBeStopped(ctx, stopTime) if err != nil { return err } - consumerIds = append(consumerIds, consumerId) + consumerIds := append(consumerIdsStr.ConsumerIds, consumerId) - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - err = enc.Encode(consumerIds) + consumerIdsNewStr := types.ConsumerIds{ + ConsumerIds: consumerIds, + } + + bz, err := consumerIdsNewStr.Marshal() if err != nil { return err } - store.Set(types.StopTimeToConsumerIdsKey(stopTime), buf.Bytes()) + store.Set(types.StopTimeToConsumerIdsKey(stopTime), bz) return nil } @@ -377,36 +386,37 @@ func (k Keeper) RemoveConsumerFromToBeStoppedConsumers(ctx sdk.Context, consumer return err } - if len(consumerIds) == 0 { + if len(consumerIds.ConsumerIds) == 0 { return fmt.Errorf("no consumer ids for stop time: %s", stopTime.String()) } // find the index of the consumer we want to remove index := 0 - for i := 0; i < len(consumerIds); i = i + 1 { - if consumerIds[i] == consumerId { + for i := 0; i < len(consumerIds.ConsumerIds); i = i + 1 { + if consumerIds.ConsumerIds[i] == consumerId { index = i break } } - if consumerIds[index] != consumerId { + if consumerIds.ConsumerIds[index] != consumerId { return fmt.Errorf("failed to find consumer id (%s) in the chains to be stopped", consumerId) } - if len(consumerIds) == 1 { + if len(consumerIds.ConsumerIds) == 1 { store.Delete(types.StopTimeToConsumerIdsKey(stopTime)) return nil } - updatedConsumerIds := append(consumerIds[:index], consumerIds[index+1:]...) - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - err = enc.Encode(updatedConsumerIds) + updatedConsumerIds := append(consumerIds.ConsumerIds[:index], consumerIds.ConsumerIds[index+1:]...) + updatedConsumerIdsStr := types.ConsumerIds{ + ConsumerIds: updatedConsumerIds, + } + bz, err := updatedConsumerIdsStr.Marshal() if err != nil { return err } - store.Set(types.StopTimeToConsumerIdsKey(stopTime), buf.Bytes()) + store.Set(types.StopTimeToConsumerIdsKey(stopTime), bz) return nil } @@ -539,14 +549,14 @@ func (k Keeper) GetInitializedConsumersReadyToLaunch(ctx sdk.Context, limit uint "error", err) continue } - if len(result)+len(consumerIds) >= int(limit) { - remainingConsumerIds := len(result) + len(consumerIds) - int(limit) - if len(consumerIds[:len(consumerIds)-remainingConsumerIds]) == 0 { + if len(result)+len(consumerIds.ConsumerIds) >= int(limit) { + remainingConsumerIds := len(result) + len(consumerIds.ConsumerIds) - int(limit) + if len(consumerIds.ConsumerIds[:len(consumerIds.ConsumerIds)-remainingConsumerIds]) == 0 { return result } - return append(result, consumerIds[:len(consumerIds)-remainingConsumerIds]...) + return append(result, consumerIds.ConsumerIds[:len(consumerIds.ConsumerIds)-remainingConsumerIds]...) } else { - result = append(result, consumerIds...) + result = append(result, consumerIds.ConsumerIds...) } } @@ -576,15 +586,10 @@ func (k Keeper) LaunchConsumer(ctx sdk.Context, consumerId string) error { return nil } -// PopulateAllowlist populates the allowlist store for the consumer chain with this consumer id -func (k Keeper) PopulateAllowlist(ctx sdk.Context, consumerId string) error { - powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) - if err != nil { - return err - } - +// UpdateAllowlist populates the allowlist store for the consumer chain with this consumer id +func (k Keeper) UpdateAllowlist(ctx sdk.Context, consumerId string, allowlist []string) { k.DeleteAllowlist(ctx, consumerId) - for _, address := range powerShapingParameters.Allowlist { + for _, address := range allowlist { consAddr, err := sdk.ConsAddressFromBech32(address) if err != nil { continue @@ -592,18 +597,12 @@ func (k Keeper) PopulateAllowlist(ctx sdk.Context, consumerId string) error { k.SetAllowlist(ctx, consumerId, types.NewProviderConsAddress(consAddr)) } - return err } -// PopulateDenylist populates the denylist store for the consumer chain with this consumer id -func (k Keeper) PopulateDenylist(ctx sdk.Context, consumerId string) error { - powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) - if err != nil { - return err - } - +// UpdateDenylist populates the denylist store for the consumer chain with this consumer id +func (k Keeper) UpdateDenylist(ctx sdk.Context, consumerId string, denylist []string) { k.DeleteDenylist(ctx, consumerId) - for _, address := range powerShapingParameters.Denylist { + for _, address := range denylist { consAddr, err := sdk.ConsAddressFromBech32(address) if err != nil { continue @@ -612,25 +611,19 @@ func (k Keeper) PopulateDenylist(ctx sdk.Context, consumerId string) error { k.SetDenylist(ctx, consumerId, types.NewProviderConsAddress(consAddr)) } - return nil } -// PopulateMinimumPowerInTopN populates the minimum power in Top N for the consumer chain with this consumer id -func (k Keeper) PopulateMinimumPowerInTopN(ctx sdk.Context, consumerId string, oldTopN uint32) error { - powerShapingParameters, err := k.GetConsumerPowerShapingParameters(ctx, consumerId) - if err != nil { - return err - } - +// UpdateMinimumPowerInTopN populates the minimum power in Top N for the consumer chain with this consumer id +func (k Keeper) UpdateMinimumPowerInTopN(ctx sdk.Context, consumerId string, oldTopN uint32, newTopN uint32) error { // if the top N changes, we need to update the new minimum power in top N - if powerShapingParameters.Top_N != oldTopN { - if powerShapingParameters.Top_N > 0 { + if newTopN != oldTopN { + if newTopN > 0 { // if the chain receives a non-zero top N value, store the minimum power in the top N bondedValidators, err := k.GetLastProviderConsensusActiveValidators(ctx) if err != nil { return err } - minPower, err := k.ComputeMinPowerInTopN(ctx, bondedValidators, powerShapingParameters.Top_N) + minPower, err := k.ComputeMinPowerInTopN(ctx, bondedValidators, newTopN) if err != nil { return err } @@ -672,14 +665,14 @@ func (k Keeper) GetLaunchedConsumersReadyToStop(ctx sdk.Context, limit uint32) [ "error", err) continue } - if len(result)+len(consumerIds) >= int(limit) { - remainingConsumerIds := len(result) + len(consumerIds) - int(limit) - if len(consumerIds[:len(consumerIds)-remainingConsumerIds]) == 0 { + if len(result)+len(consumerIds.ConsumerIds) >= int(limit) { + remainingConsumerIds := len(result) + len(consumerIds.ConsumerIds) - int(limit) + if len(consumerIds.ConsumerIds[:len(consumerIds.ConsumerIds)-remainingConsumerIds]) == 0 { return result } - return append(result, consumerIds[:len(consumerIds)-remainingConsumerIds]...) + return append(result, consumerIds.ConsumerIds[:len(consumerIds.ConsumerIds)-remainingConsumerIds]...) } else { - result = append(result, consumerIds...) + result = append(result, consumerIds.ConsumerIds...) } } @@ -715,28 +708,38 @@ func (k Keeper) IsValidatorOptedInToChainId(ctx sdk.Context, providerAddr types. return "", false } -func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, spawnTime time.Time) { - if previousParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { - // if this is not the first initialization, remove the consumer id from the old spawn time - k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousParameters.SpawnTime) +func (k Keeper) PrepareConsumerForLaunch(ctx sdk.Context, consumerId string, previousSpawnTime time.Time, spawnTime time.Time) { + if !previousSpawnTime.Equal(time.Time{}) { + // if this is not the first initialization and hence `previousSpawnTime` does not contain the zero value of `Time` + // remove the consumer id from the old spawn time + k.RemoveConsumerFromToBeLaunchedConsumers(ctx, consumerId, previousSpawnTime) } - k.AppendSpawnTimeForConsumerToBeLaunched(ctx, consumerId, spawnTime) } // CanLaunch checks on whether the consumer with `consumerId` has set all the initialization parameters set and hence -// is ready to launch +// is ready to launch and at what spawn time // TODO (PERMISSIONLESS): could remove, all fields should be there because we validate the initialization parameters -func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) bool { +func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) (time.Time, bool) { + // a chain that is already launched or stopped cannot launch again + phase, found := k.GetConsumerPhase(ctx, consumerId) + if !found || phase == Launched || phase == Stopped { + return time.Time{}, false + } + if initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { + // a chain can only launch if the spawn time is in the future + spawnTimeInTheFuture := initializationParameters.SpawnTime.After(ctx.BlockTime()) + genesisHashSet := initializationParameters.GenesisHash != nil binaryHashSet := initializationParameters.BinaryHash != nil consumerRedistributionFractionSet := initializationParameters.ConsumerRedistributionFraction != "" blocksPerDistributionTransmissionSet := initializationParameters.BlocksPerDistributionTransmission > 0 historicalEntriesSet := initializationParameters.HistoricalEntries > 0 - return genesisHashSet && binaryHashSet && - consumerRedistributionFractionSet && blocksPerDistributionTransmissionSet && historicalEntriesSet + + return initializationParameters.SpawnTime, spawnTimeInTheFuture && genesisHashSet && binaryHashSet && consumerRedistributionFractionSet && + blocksPerDistributionTransmissionSet && historicalEntriesSet } - return false + return time.Time{}, false } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index 59d378a5ad..7f8f0d7477 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -283,7 +283,7 @@ func TestIsValidatorOptedInToChain(t *testing.T) { require.Equal(t, expectedConsumerId, actualConsumerId) } -func TestPopulateAllowlist(t *testing.T) { +func TestUpdateAllowlist(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -294,12 +294,7 @@ func TestPopulateAllowlist(t *testing.T) { providerConsAddr2 := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" consAddr2, _ := sdk.ConsAddressFromBech32(providerConsAddr2) - providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ - Allowlist: []string{providerConsAddr1, providerConsAddr2}, - }) - - err := providerKeeper.PopulateAllowlist(ctx, consumerId) - require.NoError(t, err) + providerKeeper.UpdateAllowlist(ctx, consumerId, []string{providerConsAddr1, providerConsAddr2}) expectedAllowlist := []providertypes.ProviderConsAddress{ providertypes.NewProviderConsAddress(consAddr1), @@ -318,12 +313,7 @@ func TestPopulateDenylist(t *testing.T) { providerConsAddr2 := "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39" consAddr2, _ := sdk.ConsAddressFromBech32(providerConsAddr2) - providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ - Denylist: []string{providerConsAddr1, providerConsAddr2}, - }) - - err := providerKeeper.PopulateDenylist(ctx, consumerId) - require.NoError(t, err) + providerKeeper.UpdateDenylist(ctx, consumerId, []string{providerConsAddr1, providerConsAddr2}) expectedDenylist := []providertypes.ProviderConsAddress{ providertypes.NewProviderConsAddress(consAddr1), @@ -342,7 +332,7 @@ func TestPopulateMinimumPowerInTopN(t *testing.T) { Top_N: 0, }) - err := providerKeeper.PopulateMinimumPowerInTopN(ctx, consumerId, 0) + err := providerKeeper.UpdateMinimumPowerInTopN(ctx, consumerId, 0, 0) require.NoError(t, err) _, found := providerKeeper.GetMinimumPowerInTopN(ctx, consumerId) require.False(t, found) @@ -378,7 +368,7 @@ func TestPopulateMinimumPowerInTopN(t *testing.T) { providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ Top_N: 50, }) - err = providerKeeper.PopulateMinimumPowerInTopN(ctx, consumerId, 0) + err = providerKeeper.UpdateMinimumPowerInTopN(ctx, consumerId, 0, 50) require.NoError(t, err) minimumPowerInTopN, found := providerKeeper.GetMinimumPowerInTopN(ctx, consumerId) require.True(t, found) @@ -388,7 +378,7 @@ func TestPopulateMinimumPowerInTopN(t *testing.T) { providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ Top_N: 51, }) - err = providerKeeper.PopulateMinimumPowerInTopN(ctx, consumerId, 0) + err = providerKeeper.UpdateMinimumPowerInTopN(ctx, consumerId, 50, 51) require.NoError(t, err) minimumPowerInTopN, found = providerKeeper.GetMinimumPowerInTopN(ctx, consumerId) require.True(t, found) @@ -398,7 +388,7 @@ func TestPopulateMinimumPowerInTopN(t *testing.T) { providerKeeper.SetConsumerPowerShapingParameters(ctx, consumerId, providertypes.PowerShapingParameters{ Top_N: 100, }) - err = providerKeeper.PopulateMinimumPowerInTopN(ctx, consumerId, 0) + err = providerKeeper.UpdateMinimumPowerInTopN(ctx, consumerId, 51, 100) require.NoError(t, err) minimumPowerInTopN, found = providerKeeper.GetMinimumPowerInTopN(ctx, consumerId) require.True(t, found) diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 5373091029..88f2ff6781 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -33,14 +33,17 @@ var ( ErrUnauthorized = errorsmod.Register(ModuleName, 25, "unauthorized") ErrBlankConsumerChainID = errorsmod.Register(ModuleName, 26, "consumer chain id must not be blank") ErrInvalidPhase = errorsmod.Register(ModuleName, 27, "cannot perform action in the current phase of consumer chain") - ErrInvalidPowerShapingParameters = errorsmod.Register(ModuleName, 28, "invalid power shaping parameters") - ErrInvalidConsumerInitializationParameters = errorsmod.Register(ModuleName, 29, "invalid consumer initialization parameters") - ErrNoRegistrationRecord = errorsmod.Register(ModuleName, 30, "registration record is missing") - ErrNoChainId = errorsmod.Register(ModuleName, 31, "missing chain id for consumer chain") - ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 32, "missing consumer genesis") - ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 33, "invalid consumer genesis") - ErrNoConsumerId = errorsmod.Register(ModuleName, 34, "missing consumer id") - ErrAlreadyOptedIn = errorsmod.Register(ModuleName, 35, "already opted in to a chain with the same chain id") - ErrNoOwnerAddress = errorsmod.Register(ModuleName, 36, "missing owner address") - ErrInvalidTransformToTopN = errorsmod.Register(ModuleName, 37, "invalid transform to Top N chain") + ErrInvalidConsumerMetadata = errorsmod.Register(ModuleName, 28, "invalid consumer metadata") + ErrInvalidPowerShapingParameters = errorsmod.Register(ModuleName, 29, "invalid power shaping parameters") + ErrInvalidConsumerInitializationParameters = errorsmod.Register(ModuleName, 30, "invalid consumer initialization parameters") + ErrCannotUpdateMinimumPowerInTopN = errorsmod.Register(ModuleName, 31, "cannot update minimum power in Top N") + ErrNoChainId = errorsmod.Register(ModuleName, 32, "missing chain id for consumer chain") + ErrNoConsumerGenesis = errorsmod.Register(ModuleName, 33, "missing consumer genesis") + ErrInvalidConsumerGenesis = errorsmod.Register(ModuleName, 34, "invalid consumer genesis") + ErrNoConsumerId = errorsmod.Register(ModuleName, 35, "missing consumer id") + ErrAlreadyOptedIn = errorsmod.Register(ModuleName, 36, "already opted in to a chain with the same chain id") + ErrNoOwnerAddress = errorsmod.Register(ModuleName, 37, "missing owner address") + ErrInvalidTransformToTopN = errorsmod.Register(ModuleName, 38, "invalid transform to Top N chain") + ErrInvalidTransformToOptIn = errorsmod.Register(ModuleName, 39, "invalid transform to Opt In chain") + ErrCannotCreateTopNChain = errorsmod.Register(ModuleName, 40, "cannot create Top N chain outside permissionlessly") ) diff --git a/x/ccv/provider/types/legacy_proposal_test.go b/x/ccv/provider/types/legacy_proposal_test.go index 757699c263..180a4978bd 100644 --- a/x/ccv/provider/types/legacy_proposal_test.go +++ b/x/ccv/provider/types/legacy_proposal_test.go @@ -602,7 +602,7 @@ func TestMsgUpdateConsumerValidateBasic(t *testing.T) { for _, tc := range testCases { // TODO (PERMISSIONLESS) add more tests - msg, _ := types.NewMsgUpdateConsumer("", "0", "new owner", nil, nil, &tc.powerShapingParameters) + msg, _ := types.NewMsgUpdateConsumer("", "0", "cosmos1p3ucd3ptpw902fluyjzhq3ffgq4ntddac9sa3s", nil, nil, &tc.powerShapingParameters) err := msg.ValidateBasic() if tc.expPass { require.NoError(t, err, "valid case: %s should not return error. got %w", tc.name, err) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 2123a94d74..421eb7a976 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -271,7 +271,7 @@ func (msg MsgCreateConsumer) ValidateBasic() error { } if msg.PowerShapingParameters != nil { - if msg.PowerShapingParameters.Top_N > 0 { + if msg.PowerShapingParameters.Top_N != 0 { return fmt.Errorf("cannot create a Top N chain through `MsgCreateConsumer`; " + "first create the chain and then use `MsgUpdateConsumer` to make the chain Top N") } @@ -327,9 +327,13 @@ func (msg MsgUpdateConsumer) ValidateBasic() error { return err } - const maxNewOwnerAddress = 500 - if err := ValidateField("new owner address", msg.NewOwnerAddress, maxNewOwnerAddress); err != nil { - return err + // The new owner address can be empty, in which case the consumer chain does not change its owner. + // However, if the new owner address is not empty, we verify that it's a valid account address. + if strings.TrimSpace(msg.NewOwnerAddress) != "" { + _, err := sdk.AccAddressFromBech32(msg.NewOwnerAddress) + if err != nil { + return err + } } if msg.Metadata != nil { diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 6b72d79283..46b1a2c826 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -1705,6 +1705,52 @@ func (m *PowerShapingParameters) GetAllowInactiveVals() bool { return false } +// ConsumerIds contains consumer ids of chains +// Used so we can easily (de)serialize slices of strings +type ConsumerIds struct { + ConsumerIds []string `protobuf:"bytes,1,rep,name=consumer_ids,json=consumerIds,proto3" json:"consumer_ids,omitempty"` +} + +func (m *ConsumerIds) Reset() { *m = ConsumerIds{} } +func (m *ConsumerIds) String() string { return proto.CompactTextString(m) } +func (*ConsumerIds) ProtoMessage() {} +func (*ConsumerIds) Descriptor() ([]byte, []int) { + return fileDescriptor_f22ec409a72b7b72, []int{22} +} +func (m *ConsumerIds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsumerIds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsumerIds.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 *ConsumerIds) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerIds.Merge(m, src) +} +func (m *ConsumerIds) XXX_Size() int { + return m.Size() +} +func (m *ConsumerIds) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerIds.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsumerIds proto.InternalMessageInfo + +func (m *ConsumerIds) GetConsumerIds() []string { + if m != nil { + return m.ConsumerIds + } + return nil +} + func init() { proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") @@ -1728,6 +1774,7 @@ func init() { proto.RegisterType((*ConsumerMetadata)(nil), "interchain_security.ccv.provider.v1.ConsumerMetadata") proto.RegisterType((*ConsumerInitializationParameters)(nil), "interchain_security.ccv.provider.v1.ConsumerInitializationParameters") proto.RegisterType((*PowerShapingParameters)(nil), "interchain_security.ccv.provider.v1.PowerShapingParameters") + proto.RegisterType((*ConsumerIds)(nil), "interchain_security.ccv.provider.v1.ConsumerIds") } func init() { @@ -1735,139 +1782,140 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 2104 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcf, 0x6f, 0x1b, 0xc7, - 0xf5, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x83, 0x1a, 0x3b, 0xf6, 0x4a, 0xd1, 0x97, 0xa4, 0x37, - 0x5f, 0x1b, 0x6c, 0x5c, 0x2f, 0x23, 0x05, 0x05, 0x0c, 0xb7, 0x81, 0x21, 0x51, 0x4e, 0x2c, 0xa9, - 0x71, 0xd8, 0x95, 0xa0, 0x00, 0xe9, 0x61, 0x31, 0xdc, 0x1d, 0x91, 0x53, 0xed, 0xee, 0xac, 0x67, - 0x86, 0x2b, 0xb3, 0x87, 0x9e, 0x8b, 0x02, 0x05, 0xd2, 0x9e, 0x82, 0x5e, 0x9a, 0x63, 0xd1, 0x53, - 0x0f, 0x45, 0xff, 0x80, 0x9e, 0x82, 0x02, 0x45, 0x73, 0xec, 0x29, 0x29, 0xec, 0x43, 0x0f, 0x05, - 0x7a, 0xed, 0xb5, 0x98, 0xd9, 0x1f, 0x5c, 0xea, 0x97, 0x69, 0x58, 0xee, 0x45, 0xda, 0x79, 0xef, - 0xf3, 0xde, 0xbc, 0x99, 0x79, 0xbf, 0x66, 0x08, 0x36, 0x48, 0x20, 0x30, 0x73, 0xfa, 0x88, 0x04, - 0x36, 0xc7, 0xce, 0x80, 0x11, 0x31, 0x6c, 0x39, 0x4e, 0xd4, 0x0a, 0x19, 0x8d, 0x88, 0x8b, 0x59, - 0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xc7, 0x5c, 0x65, - 0x76, 0xd7, 0x65, 0x98, 0x73, 0xcc, 0x75, 0x2d, 0xc9, 0xec, 0x29, 0xc1, 0x10, 0x60, 0xe5, 0xa2, - 0x9b, 0x02, 0x87, 0x9f, 0x82, 0xb9, 0x10, 0xab, 0x36, 0x56, 0x09, 0x56, 0x36, 0x3e, 0x30, 0x27, - 0xb8, 0xe2, 0x99, 0x17, 0x29, 0xb4, 0x52, 0x6d, 0x06, 0x1b, 0xdd, 0x4f, 0x4e, 0x75, 0x09, 0x1c, - 0x1e, 0x9e, 0x9e, 0xf4, 0x07, 0xaf, 0x34, 0xe9, 0x29, 0x7d, 0xa3, 0x39, 0xef, 0x82, 0xca, 0x66, - 0xbc, 0xec, 0x1f, 0xca, 0xb2, 0x75, 0x66, 0x5b, 0xe6, 0xf3, 0xdb, 0xb2, 0x0b, 0x16, 0x93, 0xa6, - 0xef, 0x80, 0xaa, 0xdc, 0x04, 0xff, 0x0f, 0x80, 0xa4, 0x5b, 0x94, 0x39, 0x2d, 0xce, 0xee, 0xe5, - 0x84, 0xb2, 0xe3, 0x8e, 0x55, 0xf3, 0xe9, 0xb1, 0x6a, 0x6e, 0x50, 0xb0, 0x72, 0x98, 0xaf, 0xb6, - 0xaa, 0x78, 0x74, 0x90, 0x73, 0x8c, 0x05, 0x87, 0x16, 0x28, 0xaa, 0xaa, 0x1a, 0x2f, 0xf5, 0xfe, - 0x85, 0x4b, 0x8d, 0xd6, 0xcd, 0x8b, 0x94, 0x6c, 0x23, 0x81, 0x12, 0xff, 0x57, 0xba, 0x8c, 0x5f, - 0x69, 0x40, 0xdf, 0xc3, 0xc3, 0x4d, 0xce, 0x49, 0x2f, 0xf0, 0x71, 0x20, 0x64, 0xe4, 0x21, 0x07, - 0xcb, 0x4f, 0xf8, 0x0e, 0x58, 0xc8, 0x9c, 0x4e, 0x25, 0x4e, 0x4d, 0x25, 0xce, 0xf9, 0x94, 0x28, - 0xf7, 0x08, 0x3e, 0x00, 0x20, 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 0xcc, 0xfd, 0x4f, 0xde, 0x78, 0x4a, 0x57, 0xfa, 0xc6, 0x53, 0x7e, 0xbd, 0x37, 0x1e, 0xf0, 0x5a, - 0x6f, 0x3c, 0x95, 0x89, 0xde, 0x78, 0x8c, 0x5f, 0x4f, 0x83, 0x1b, 0xea, 0x06, 0xbd, 0xdf, 0x47, - 0xa1, 0x3c, 0xdc, 0x51, 0x08, 0x64, 0xd7, 0x72, 0x6d, 0x82, 0x6b, 0xf9, 0xf4, 0xab, 0x5d, 0xcb, - 0x0b, 0x13, 0x5c, 0xcb, 0x8b, 0x97, 0x5d, 0xcb, 0x67, 0x2e, 0xbb, 0x96, 0xcf, 0x4e, 0x76, 0x2d, - 0x9f, 0xbb, 0xe0, 0x5a, 0xbe, 0xf5, 0xe9, 0x57, 0xcf, 0x6b, 0xda, 0xd7, 0xcf, 0x6b, 0xda, 0x3f, - 0x9e, 0xd7, 0xb4, 0xcf, 0x5f, 0xd4, 0xa6, 0xbe, 0x7e, 0x51, 0x9b, 0xfa, 0xfb, 0x8b, 0xda, 0xd4, - 0x67, 0x1f, 0x9c, 0x4d, 0x6e, 0xa3, 0xe2, 0x71, 0x2f, 0x7b, 0xe0, 0x8f, 0xbe, 0xd7, 0x7a, 0x36, - 0xfe, 0xf3, 0x81, 0xca, 0x7b, 0xdd, 0x59, 0xe5, 0xb7, 0xef, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, - 0x17, 0xd9, 0xe3, 0x8b, 0x6f, 0x18, 0x00, 0x00, + // 2123 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x1b, 0xc7, + 0x15, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x41, 0x8d, 0x1d, 0x7b, 0xa5, 0xa8, 0x24, 0xbd, 0xa9, + 0x0d, 0x36, 0xae, 0x97, 0x96, 0x82, 0x02, 0x86, 0xdb, 0xc0, 0x90, 0x29, 0x27, 0x96, 0xd4, 0x38, + 0xec, 0x4a, 0x50, 0x80, 0xf4, 0xb0, 0x18, 0xee, 0x8e, 0xc8, 0xa9, 0x76, 0x77, 0xd6, 0x33, 0xc3, + 0x95, 0xd9, 0x43, 0xcf, 0x45, 0x81, 0x02, 0x69, 0x4f, 0x41, 0x2f, 0xcd, 0xb1, 0xe8, 0xa9, 0x87, + 0xa2, 0x7f, 0x40, 0x4f, 0x41, 0x81, 0xa2, 0x39, 0xf6, 0x94, 0x14, 0xf6, 0xa1, 0x87, 0x02, 0xbd, + 0xf6, 0x5a, 0xcc, 0xec, 0x07, 0x97, 0xfa, 0x32, 0x0d, 0xcb, 0xb9, 0x48, 0x3b, 0xef, 0xfd, 0xde, + 0x9b, 0x37, 0x33, 0xef, 0x6b, 0x86, 0x60, 0x83, 0x04, 0x02, 0x33, 0xa7, 0x8f, 0x48, 0x60, 0x73, + 0xec, 0x0c, 0x18, 0x11, 0xc3, 0x96, 0xe3, 0x44, 0xad, 0x90, 0xd1, 0x88, 0xb8, 0x98, 0xb5, 0xa2, + 0xf5, 0xec, 0xdb, 0x0c, 0x19, 0x15, 0x14, 0xbe, 0x73, 0x86, 0x8c, 0xe9, 0x38, 0x91, 0x99, 0xe1, + 0xa2, 0xf5, 0xd5, 0x9b, 0xe7, 0x29, 0x8e, 0xd6, 0x5b, 0xc7, 0x84, 0xe1, 0x58, 0xd7, 0xea, 0xd5, + 0x1e, 0xed, 0x51, 0xf5, 0xd9, 0x92, 0x5f, 0x09, 0xb5, 0xde, 0xa3, 0xb4, 0xe7, 0xe1, 0x96, 0x1a, + 0x75, 0x07, 0x87, 0x2d, 0x41, 0x7c, 0xcc, 0x05, 0xf2, 0xc3, 0x04, 0x50, 0x3b, 0x09, 0x70, 0x07, + 0x0c, 0x09, 0x42, 0x83, 0x54, 0x01, 0xe9, 0x3a, 0x2d, 0x87, 0x32, 0xdc, 0x72, 0x3c, 0x82, 0x03, + 0x21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 0x69, + 0x57, 0x99, 0x95, 0xd4, 0x6d, 0x97, 0x3f, 0xfc, 0xe4, 0xcb, 0xe7, 0x35, 0xed, 0xab, 0xe7, 0x35, + 0xed, 0x5f, 0xcf, 0x6b, 0xda, 0x67, 0x2f, 0x6a, 0x53, 0x5f, 0xbd, 0xa8, 0x4d, 0xfd, 0xf3, 0x45, + 0x6d, 0xea, 0xd3, 0xf7, 0x4f, 0xa7, 0xc3, 0x51, 0xb9, 0xb9, 0x93, 0xfd, 0x24, 0x10, 0xfd, 0xa0, + 0xf5, 0x6c, 0xfc, 0x07, 0x07, 0x95, 0x29, 0xbb, 0xb3, 0xca, 0xd3, 0xdf, 0xfb, 0x7f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xe4, 0x60, 0xc1, 0x71, 0xa1, 0x18, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -3153,6 +3201,38 @@ func (m *PowerShapingParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *ConsumerIds) 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 *ConsumerIds) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsumerIds) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsumerIds) > 0 { + for iNdEx := len(m.ConsumerIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ConsumerIds[iNdEx]) + copy(dAtA[i:], m.ConsumerIds[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.ConsumerIds[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintProvider(dAtA []byte, offset int, v uint64) int { offset -= sovProvider(v) base := offset @@ -3734,6 +3814,21 @@ func (m *PowerShapingParameters) Size() (n int) { return n } +func (m *ConsumerIds) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ConsumerIds) > 0 { + for _, s := range m.ConsumerIds { + l = len(s) + n += 1 + l + sovProvider(uint64(l)) + } + } + return n +} + func sovProvider(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7771,6 +7866,88 @@ func (m *PowerShapingParameters) Unmarshal(dAtA []byte) error { } return nil } +func (m *ConsumerIds) 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: ConsumerIds: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsumerIds: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerIds = append(m.ConsumerIds, string(dAtA[iNdEx:postIndex])) + 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 e182d49d20cd4e25902c3221d02e1fb64711a4f3 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 23 Aug 2024 16:52:59 +0200 Subject: [PATCH 39/41] feat: add fields to consumer validators query (#2167) * extend consumer validators query * nit * nits * fix msg order * deprecate power for consumer_power --- .../ccv/provider/v1/query.proto | 32 +- x/ccv/provider/keeper/grpc_query.go | 44 +- x/ccv/provider/keeper/grpc_query_test.go | 80 +- .../keeper/validator_set_update_test.go | 1 + x/ccv/provider/types/query.pb.go | 700 ++++++++++++++---- 5 files changed, 672 insertions(+), 185 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 1175d7002b..0af0d31293 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -11,6 +11,7 @@ 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"; +import "cosmos/staking/v1beta1/staking.proto"; service Query { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -339,13 +340,38 @@ message QueryConsumerValidatorsValidator { string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // The consumer public key of the validator used on the consumer chain tendermint.crypto.PublicKey consumer_key = 2; - // The power of the validator used on the consumer chain - int64 power = 3; + // [DEPRECATED] use consumer_power instead + int64 power = 3 [deprecated = true]; + // The power of the validator used on the consumer chain + int64 consumer_power = 4; // The rate to charge delegators on the consumer chain, as a fraction - string rate = 4 [ + string consumer_commission_rate = 5 [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; + // The rate to charge delegators on the provider chain, as a fraction + string provider_commission_rate = 6 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // description defines the description terms for the validator + cosmos.staking.v1beta1.Description description = 7 [(gogoproto.nullable) = false]; + // provider_operator_address defines the address of the validator's operator + string provider_operator_address = 8 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + // jailed defined whether the validator has been jailed from bonded status or not. + bool jailed = 9; + // status is the validator status (bonded/unbonding/unbonded). + cosmos.staking.v1beta1.BondStatus status = 10; + // provider_tokens defines the delegated tokens (incl. self-delegation). + string provider_tokens = 11 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // The power of the validator used on the provider chain + int64 provider_power = 12; + // validates_current_epoch defines whether the validator has to validate for the current epoch or not + bool validates_current_epoch = 13; } message QueryConsumerValidatorsResponse { diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 25774cf6f8..5408cc606a 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -8,7 +8,6 @@ import ( "google.golang.org/grpc/status" errorsmod "cosmossdk.io/errors" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -346,30 +345,41 @@ func (k Keeper) QueryConsumerValidators(goCtx context.Context, req *types.QueryC return nil, status.Error(codes.Internal, err.Error()) } - for _, v := range consumerValSet { + for _, consumerVal := range consumerValSet { + provAddr := types.ProviderConsAddress{Address: consumerVal.ProviderConsAddr} + consAddr := provAddr.ToSdkConsAddr() - consAddr, err := sdk.ConsAddressFromBech32(sdk.ConsAddress(v.ProviderConsAddr).String()) + providerVal, err := k.stakingKeeper.GetValidatorByConsAddr(ctx, consAddr) if err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid provider address") + k.Logger(ctx).Error("cannot find consensus address for provider address:%s", provAddr.String()) + continue + } + + hasToValidate, err := k.hasToValidate(ctx, provAddr, consumerId) + if err != nil { + k.Logger(ctx).Error("cannot define if validator %s has to validate for consumer %s for current epoch", + provAddr.String(), consumerId) + continue } - var rate math.LegacyDec consumerRate, found := k.GetConsumerCommissionRate(ctx, consumerId, types.NewProviderConsAddress(consAddr)) - if found { - rate = consumerRate - } else { - v, err := k.stakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - if err != nil { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("unknown validator: %s", consAddr.String())) - } - rate = v.Commission.Rate + if !found { + consumerRate = providerVal.Commission.Rate } validators = append(validators, &types.QueryConsumerValidatorsValidator{ - ProviderAddress: sdk.ConsAddress(v.ProviderConsAddr).String(), - ConsumerKey: v.PublicKey, - Power: v.Power, - Rate: rate, + ProviderAddress: sdk.ConsAddress(consumerVal.ProviderConsAddr).String(), + ConsumerKey: consumerVal.PublicKey, + ConsumerPower: consumerVal.Power, + ConsumerCommissionRate: consumerRate, + Description: providerVal.Description, + ProviderOperatorAddress: providerVal.OperatorAddress, + Jailed: providerVal.Jailed, + Status: providerVal.Status, + ProviderTokens: providerVal.Tokens, + ProviderCommissionRate: providerVal.Commission.Rate, + ProviderPower: providerVal.GetConsensusPower(k.stakingKeeper.PowerReduction(ctx)), + ValidatesCurrentEpoch: hasToValidate, }) } return &types.QueryConsumerValidatorsResponse{ diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index f99b9e360f..8dc7369648 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -112,28 +112,69 @@ func TestQueryConsumerValidators(t *testing.T) { _, err := pk.QueryConsumerValidators(ctx, &req) require.Error(t, err) - providerAddr1 := types.NewProviderConsAddress([]byte("providerAddr1")) - consumerKey1 := cryptotestutil.NewCryptoIdentityFromIntSeed(1).TMProtoCryptoPublicKey() - consumerValidator1 := types.ConsensusValidator{ProviderConsAddr: providerAddr1.ToSdkConsAddr(), Power: 1, PublicKey: &consumerKey1} - expectedCommissionRate1 := math.LegacyMustNewDecFromStr("0.123") - pk.SetConsumerCommissionRate(ctx, consumerId, providerAddr1, expectedCommissionRate1) + val1 := createStakingValidator(ctx, mocks, 1, 1, 1) + valConsAddr1, _ := val1.GetConsAddr() + providerAddr1 := types.NewProviderConsAddress(valConsAddr1) + pk1, _ := val1.CmtConsPublicKey() + consumerValidator1 := types.ConsensusValidator{ProviderConsAddr: providerAddr1.ToSdkConsAddr(), Power: 1, PublicKey: &pk1} + val1.Tokens = sdk.TokensFromConsensusPower(1, sdk.DefaultPowerReduction) + val1.Description = stakingtypes.Description{Moniker: "ConsumerValidator1"} + val1.Commission.Rate = math.LegacyMustNewDecFromStr("0.123") + + val2 := createStakingValidator(ctx, mocks, 1, 2, 2) + valConsAddr2, _ := val2.GetConsAddr() + providerAddr2 := types.NewProviderConsAddress(valConsAddr2) + pk2, _ := val2.CmtConsPublicKey() + consumerValidator2 := types.ConsensusValidator{ProviderConsAddr: providerAddr2.ToSdkConsAddr(), Power: 2, PublicKey: &pk2} + val2.Tokens = sdk.TokensFromConsensusPower(2, sdk.DefaultPowerReduction) + val2.Description = stakingtypes.Description{Moniker: "ConsumerValidator2"} + val2.Commission.Rate = math.LegacyMustNewDecFromStr("0.123") - providerAddr2 := types.NewProviderConsAddress([]byte("providerAddr2")) - consumerKey2 := cryptotestutil.NewCryptoIdentityFromIntSeed(2).TMProtoCryptoPublicKey() - consumerValidator2 := types.ConsensusValidator{ProviderConsAddr: providerAddr2.ToSdkConsAddr(), Power: 2, PublicKey: &consumerKey2} - expectedCommissionRate2 := math.LegacyMustNewDecFromStr("0.123") - pk.SetConsumerCommissionRate(ctx, consumerId, providerAddr2, expectedCommissionRate2) + // set up the client id so the chain looks like it "started" + pk.SetConsumerClientId(ctx, consumerId, "clientID") + pk.SetConsumerValSet(ctx, consumerId, []types.ConsensusValidator{consumerValidator1, consumerValidator2}) + // set a consumer commission rate for val1 + val1ConsComRate := math.LegacyMustNewDecFromStr("0.456") + pk.SetConsumerCommissionRate(ctx, consumerId, providerAddr1, val1ConsComRate) expectedResponse := types.QueryConsumerValidatorsResponse{ Validators: []*types.QueryConsumerValidatorsValidator{ - {ProviderAddress: providerAddr1.String(), ConsumerKey: &consumerKey1, Power: 1, Rate: expectedCommissionRate1}, - {ProviderAddress: providerAddr2.String(), ConsumerKey: &consumerKey2, Power: 2, Rate: expectedCommissionRate2}, + { + ProviderAddress: providerAddr1.String(), + ConsumerKey: &pk1, + ConsumerPower: 1, + ConsumerCommissionRate: val1ConsComRate, + Description: val1.Description, + ProviderOperatorAddress: val1.OperatorAddress, + Jailed: val1.Jailed, + Status: val1.Status, + ProviderTokens: val1.Tokens, + ProviderCommissionRate: val1.Commission.Rate, + ProviderPower: 1, + ValidatesCurrentEpoch: true, + }, + { + ProviderAddress: providerAddr2.String(), + ConsumerKey: &pk2, + ConsumerPower: 2, + ConsumerCommissionRate: val2.Commission.Rate, + Description: val2.Description, + ProviderOperatorAddress: val2.OperatorAddress, + Jailed: val2.Jailed, + Status: val2.Status, + ProviderTokens: val2.Tokens, + ProviderCommissionRate: val2.Commission.Rate, + ProviderPower: 2, + ValidatesCurrentEpoch: true, + }, }, } - // set up the client id so the chain looks like it "started" - pk.SetConsumerClientId(ctx, consumerId, "clientID") - pk.SetConsumerValSet(ctx, consumerId, []types.ConsensusValidator{consumerValidator1, consumerValidator2}) + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, valConsAddr1).Return(val1, nil).AnyTimes() + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, valConsAddr2).Return(val2, nil).AnyTimes() + mocks.MockStakingKeeper.EXPECT().PowerReduction(ctx).Return(sdk.DefaultPowerReduction).AnyTimes() + + testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 2, []stakingtypes.Validator{val1, val2}, []int64{1, 2}, -1) // -1 to allow the calls "AnyTimes" res, err := pk.QueryConsumerValidators(ctx, &req) require.NoError(t, err) @@ -141,13 +182,10 @@ func TestQueryConsumerValidators(t *testing.T) { // validator with no set consumer commission rate pk.DeleteConsumerCommissionRate(ctx, consumerId, providerAddr1) - expectedCommissionRate := math.LegacyMustNewDecFromStr("0.456") // because no consumer commission rate is set, the validator's set commission rate on the provider is used - val := stakingtypes.Validator{Commission: stakingtypes.Commission{CommissionRates: stakingtypes.CommissionRates{Rate: expectedCommissionRate}}} - mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr( - ctx, providerAddr1.ToSdkConsAddr()).Return(val, nil).Times(1) - res, _ = pk.QueryConsumerValidators(ctx, &req) - require.Equal(t, expectedCommissionRate, res.Validators[0].Rate) + res, err = pk.QueryConsumerValidators(ctx, &req) + require.NoError(t, err) + require.Equal(t, val1.Commission.Rate, res.Validators[0].ConsumerCommissionRate) } func TestQueryConsumerChainsValidatorHasToValidate(t *testing.T) { diff --git a/x/ccv/provider/keeper/validator_set_update_test.go b/x/ccv/provider/keeper/validator_set_update_test.go index 9f078cc701..58ef556aec 100644 --- a/x/ccv/provider/keeper/validator_set_update_test.go +++ b/x/ccv/provider/keeper/validator_set_update_test.go @@ -126,6 +126,7 @@ func createStakingValidator(ctx sdk.Context, mocks testkeeper.MockedKeepers, ind return stakingtypes.Validator{ OperatorAddress: providerValidatorAddr.String(), ConsensusPubkey: pkAny, + Status: stakingtypes.Bonded, } } diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index fe6f07fdea..467cd046c0 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -9,6 +9,7 @@ import ( fmt "fmt" crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" _ "github.com/cosmos/cosmos-proto" + types1 "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -1412,10 +1413,28 @@ type QueryConsumerValidatorsValidator struct { ProviderAddress string `protobuf:"bytes,1,opt,name=provider_address,json=providerAddress,proto3" json:"provider_address,omitempty" yaml:"address"` // The consumer public key of the validator used on the consumer chain ConsumerKey *crypto.PublicKey `protobuf:"bytes,2,opt,name=consumer_key,json=consumerKey,proto3" json:"consumer_key,omitempty"` + // [DEPRECATED] use consumer_power instead + Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` // Deprecated: Do not use. // The power of the validator used on the consumer chain - Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` + ConsumerPower int64 `protobuf:"varint,4,opt,name=consumer_power,json=consumerPower,proto3" json:"consumer_power,omitempty"` // The rate to charge delegators on the consumer chain, as a fraction - Rate cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=rate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rate"` + ConsumerCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=consumer_commission_rate,json=consumerCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"consumer_commission_rate"` + // The rate to charge delegators on the provider chain, as a fraction + ProviderCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=provider_commission_rate,json=providerCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"provider_commission_rate"` + // description defines the description terms for the validator + Description types1.Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` + // provider_operator_address defines the address of the validator's operator + ProviderOperatorAddress string `protobuf:"bytes,8,opt,name=provider_operator_address,json=providerOperatorAddress,proto3" json:"provider_operator_address,omitempty"` + // jailed defined whether the validator has been jailed from bonded status or not. + Jailed bool `protobuf:"varint,9,opt,name=jailed,proto3" json:"jailed,omitempty"` + // status is the validator status (bonded/unbonding/unbonded). + Status types1.BondStatus `protobuf:"varint,10,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` + // provider_tokens defines the delegated tokens (incl. self-delegation). + ProviderTokens cosmossdk_io_math.Int `protobuf:"bytes,11,opt,name=provider_tokens,json=providerTokens,proto3,customtype=cosmossdk.io/math.Int" json:"provider_tokens"` + // The power of the validator used on the provider chain + ProviderPower int64 `protobuf:"varint,12,opt,name=provider_power,json=providerPower,proto3" json:"provider_power,omitempty"` + // validates_current_epoch defines whether the validator has to validate for the current epoch or not + ValidatesCurrentEpoch bool `protobuf:"varint,13,opt,name=validates_current_epoch,json=validatesCurrentEpoch,proto3" json:"validates_current_epoch,omitempty"` } func (m *QueryConsumerValidatorsValidator) Reset() { *m = QueryConsumerValidatorsValidator{} } @@ -1465,6 +1484,7 @@ func (m *QueryConsumerValidatorsValidator) GetConsumerKey() *crypto.PublicKey { return nil } +// Deprecated: Do not use. func (m *QueryConsumerValidatorsValidator) GetPower() int64 { if m != nil { return m.Power @@ -1472,6 +1492,55 @@ func (m *QueryConsumerValidatorsValidator) GetPower() int64 { return 0 } +func (m *QueryConsumerValidatorsValidator) GetConsumerPower() int64 { + if m != nil { + return m.ConsumerPower + } + return 0 +} + +func (m *QueryConsumerValidatorsValidator) GetDescription() types1.Description { + if m != nil { + return m.Description + } + return types1.Description{} +} + +func (m *QueryConsumerValidatorsValidator) GetProviderOperatorAddress() string { + if m != nil { + return m.ProviderOperatorAddress + } + return "" +} + +func (m *QueryConsumerValidatorsValidator) GetJailed() bool { + if m != nil { + return m.Jailed + } + return false +} + +func (m *QueryConsumerValidatorsValidator) GetStatus() types1.BondStatus { + if m != nil { + return m.Status + } + return types1.Unspecified +} + +func (m *QueryConsumerValidatorsValidator) GetProviderPower() int64 { + if m != nil { + return m.ProviderPower + } + return 0 +} + +func (m *QueryConsumerValidatorsValidator) GetValidatesCurrentEpoch() bool { + if m != nil { + return m.ValidatesCurrentEpoch + } + return false +} + type QueryConsumerValidatorsResponse struct { Validators []*QueryConsumerValidatorsValidator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` } @@ -1940,142 +2009,158 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 2154 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4d, 0x6c, 0xdc, 0xc6, - 0x15, 0x16, 0x77, 0x25, 0x45, 0x1a, 0xc5, 0x76, 0x32, 0x56, 0x63, 0x99, 0x92, 0x77, 0x15, 0x3a, - 0x6d, 0x65, 0xd9, 0x25, 0x25, 0x05, 0x41, 0x12, 0xb7, 0x8e, 0xad, 0x5d, 0x59, 0xf6, 0xc2, 0x8e, - 0xad, 0xd0, 0xb2, 0x5b, 0x28, 0x4d, 0x69, 0x8a, 0x9c, 0xae, 0x08, 0x73, 0x39, 0x14, 0x87, 0x5a, - 0x7b, 0x61, 0xf8, 0x90, 0x16, 0x28, 0x92, 0x1e, 0x0a, 0x03, 0x45, 0x81, 0x1e, 0x73, 0x29, 0xd0, - 0x43, 0x4f, 0x3d, 0xb4, 0xe8, 0x2d, 0xc7, 0xdc, 0x9a, 0x22, 0x97, 0xa2, 0x05, 0xdc, 0xc2, 0xee, - 0xa1, 0x28, 0x50, 0xa0, 0x75, 0x7b, 0x2d, 0x50, 0x70, 0x38, 0xfc, 0x5d, 0xae, 0x96, 0xdc, 0x5d, - 0x20, 0xb7, 0xe5, 0xcc, 0x9b, 0x6f, 0xde, 0xdf, 0xbc, 0x79, 0xf3, 0x49, 0x40, 0x32, 0x2c, 0x17, - 0x39, 0xda, 0x9e, 0x6a, 0x58, 0x0a, 0x41, 0xda, 0x81, 0x63, 0xb8, 0x1d, 0x49, 0xd3, 0xda, 0x92, - 0xed, 0xe0, 0xb6, 0xa1, 0x23, 0x47, 0x6a, 0xaf, 0x4a, 0xfb, 0x07, 0xc8, 0xe9, 0x88, 0xb6, 0x83, - 0x5d, 0x0c, 0x4f, 0x67, 0x2c, 0x10, 0x35, 0xad, 0x2d, 0x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xff, 0xb6, 0x94, 0x6a, 0xee, 0x63, - 0xb5, 0xa1, 0x3e, 0x0c, 0xa7, 0x14, 0xb8, 0x7d, 0x63, 0x38, 0x90, 0xc1, 0x6a, 0x40, 0xe8, 0x8c, - 0x61, 0x6a, 0x40, 0x36, 0x48, 0x58, 0x03, 0xfe, 0xc9, 0xb1, 0xbf, 0x72, 0x65, 0xb1, 0x21, 0xb0, - 0x00, 0x1f, 0x77, 0x08, 0xe3, 0xc2, 0x6f, 0x0e, 0x0b, 0x53, 0xbc, 0x41, 0xee, 0x41, 0xde, 0xc0, - 0xff, 0x70, 0xa9, 0x7f, 0x5e, 0x48, 0xd2, 0x2b, 0xf0, 0x4a, 0xf1, 0x40, 0x67, 0x72, 0x3c, 0xfc, - 0xd5, 0xe1, 0x81, 0x8a, 0x5b, 0x1d, 0x4b, 0x0e, 0xe9, 0x61, 0x48, 0x31, 0x3d, 0xaa, 0x7d, 0xfb, - 0xb3, 0xa7, 0x15, 0xee, 0xf3, 0xa7, 0x15, 0xee, 0xaf, 0x4f, 0x2b, 0xdc, 0xe3, 0x67, 0x95, 0xb1, - 0xcf, 0x9f, 0x55, 0xc6, 0xfe, 0xf8, 0xac, 0x32, 0xb6, 0x73, 0xa1, 0x69, 0xb8, 0x7b, 0x07, 0xbb, - 0xa2, 0x86, 0x5b, 0xec, 0xdf, 0x5b, 0x62, 0xbb, 0x7c, 0x23, 0xdc, 0xa5, 0xfd, 0x86, 0xf4, 0x20, - 0xd5, 0xa6, 0x77, 0x6c, 0x44, 0x76, 0x27, 0xe9, 0x1f, 0x1a, 0x5f, 0xff, 0x7f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xa1, 0xef, 0x28, 0x4e, 0x7e, 0x24, 0x00, 0x00, + // 2411 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4d, 0x6c, 0x1c, 0x49, + 0x15, 0x76, 0x8f, 0x7f, 0x62, 0x97, 0x63, 0x67, 0xb7, 0xe2, 0xc4, 0x93, 0xb1, 0xe3, 0x71, 0x3a, + 0x59, 0x98, 0x38, 0xc9, 0xb4, 0xed, 0xd5, 0xb2, 0xbb, 0x81, 0x6c, 0xe2, 0x19, 0xc7, 0xc9, 0xc8, + 0xd9, 0xc4, 0xdb, 0x76, 0x02, 0xf2, 0x12, 0x3a, 0xed, 0xee, 0x62, 0xdc, 0xb8, 0xa7, 0xbb, 0xdd, + 0x55, 0x33, 0xc9, 0x28, 0xca, 0x61, 0x41, 0x42, 0xbb, 0x1c, 0x50, 0x24, 0x84, 0xc4, 0x71, 0x2f, + 0x48, 0x1c, 0x38, 0xa1, 0x15, 0x88, 0xdb, 0x1e, 0xf7, 0xc6, 0xb2, 0x2b, 0x21, 0x04, 0x52, 0x40, + 0x09, 0x07, 0x84, 0x84, 0x84, 0x02, 0x57, 0x24, 0xd4, 0xd5, 0xd5, 0xbf, 0xd3, 0xe3, 0xe9, 0x99, + 0xf1, 0x81, 0x9b, 0xbb, 0xea, 0xd5, 0x57, 0xef, 0xbd, 0x7a, 0xf5, 0xea, 0xbd, 0x6f, 0x0c, 0x04, + 0xcd, 0x20, 0xc8, 0x56, 0x76, 0x65, 0xcd, 0x90, 0x30, 0x52, 0xea, 0xb6, 0x46, 0x9a, 0x82, 0xa2, + 0x34, 0x04, 0xcb, 0x36, 0x1b, 0x9a, 0x8a, 0x6c, 0xa1, 0xb1, 0x24, 0xec, 0xd7, 0x91, 0xdd, 0x2c, + 0x5a, 0xb6, 0x49, 0x4c, 0x78, 0x36, 0x61, 0x41, 0x51, 0x51, 0x1a, 0x45, 0x6f, 0x41, 0xb1, 0xb1, + 0x94, 0x9b, 0xad, 0x9a, 0x66, 0x55, 0x47, 0x82, 0x6c, 0x69, 0x82, 0x6c, 0x18, 0x26, 0x91, 0x89, + 0x66, 0x1a, 0xd8, 0x85, 0xc8, 0x4d, 0x55, 0xcd, 0xaa, 0x49, 0xff, 0x14, 0x9c, 0xbf, 0xd8, 0x68, + 0x9e, 0xad, 0xa1, 0x5f, 0x3b, 0xf5, 0xef, 0x0a, 0x44, 0xab, 0x21, 0x4c, 0xe4, 0x9a, 0xc5, 0x04, + 0x96, 0xd3, 0xa8, 0xea, 0x6b, 0xe1, 0xae, 0x59, 0x6c, 0xb7, 0xa6, 0xb1, 0x24, 0xe0, 0x5d, 0xd9, + 0x46, 0xaa, 0xa4, 0x98, 0x06, 0xae, 0xd7, 0xfc, 0x15, 0xaf, 0x1d, 0xb0, 0xe2, 0xa1, 0x66, 0x23, + 0x26, 0x36, 0x4b, 0x90, 0xa1, 0x22, 0xbb, 0xa6, 0x19, 0x44, 0x50, 0xec, 0xa6, 0x45, 0x4c, 0x61, + 0x0f, 0x35, 0x3d, 0x0b, 0x4f, 0x29, 0x26, 0xae, 0x99, 0x58, 0x72, 0x8d, 0x74, 0x3f, 0xd8, 0xd4, + 0x39, 0xf7, 0x4b, 0xc0, 0x44, 0xde, 0xd3, 0x8c, 0xaa, 0xd0, 0x58, 0xda, 0x41, 0x44, 0x5e, 0xf2, + 0xbe, 0x5d, 0x29, 0xfe, 0x3e, 0x98, 0x79, 0xcf, 0x71, 0x7a, 0x99, 0x29, 0x77, 0x03, 0x19, 0x08, + 0x6b, 0x58, 0x44, 0xfb, 0x75, 0x84, 0x09, 0x3c, 0x0d, 0x46, 0x5d, 0x0d, 0x35, 0x35, 0xcb, 0xcd, + 0x73, 0x85, 0xb1, 0x52, 0x26, 0xcb, 0x89, 0x47, 0xe8, 0x58, 0x45, 0x85, 0x79, 0x30, 0xee, 0x59, + 0xe5, 0x48, 0x64, 0x1c, 0x09, 0x11, 0x78, 0x43, 0x15, 0x95, 0x7f, 0x0c, 0x66, 0x93, 0xe1, 0xb1, + 0x65, 0x1a, 0x18, 0xc1, 0xf7, 0xc1, 0x44, 0xd5, 0x1d, 0x92, 0x30, 0x91, 0x09, 0xa2, 0x9b, 0x8c, + 0x2f, 0x2f, 0x16, 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28, 0x56, 0xa6, 0x37, 0x2d, 0x84, 0x77, 0x46, 0xe8, 0xaf, 0xd9, 0xaf, 0xff, 0x2f, 0x00, + 0x00, 0xff, 0xff, 0xd3, 0x82, 0x69, 0x58, 0x09, 0x27, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3793,16 +3878,88 @@ func (m *QueryConsumerValidatorsValidator) MarshalToSizedBuffer(dAtA []byte) (in _ = i var l int _ = l + if m.ValidatesCurrentEpoch { + i-- + if m.ValidatesCurrentEpoch { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + if m.ProviderPower != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProviderPower)) + i-- + dAtA[i] = 0x60 + } { - size := m.Rate.Size() + size := m.ProviderTokens.Size() i -= size - if _, err := m.Rate.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.ProviderTokens.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + if m.Status != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x50 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if len(m.ProviderOperatorAddress) > 0 { + i -= len(m.ProviderOperatorAddress) + copy(dAtA[i:], m.ProviderOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProviderOperatorAddress))) + i-- + dAtA[i] = 0x42 + } + { + size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size := m.ProviderCommissionRate.Size() + i -= size + if _, err := m.ProviderCommissionRate.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 + { + size := m.ConsumerCommissionRate.Size() + i -= size + if _, err := m.ConsumerCommissionRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.ConsumerPower != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ConsumerPower)) + i-- + dAtA[i] = 0x20 + } if m.Power != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Power)) i-- @@ -4566,8 +4723,33 @@ func (m *QueryConsumerValidatorsValidator) Size() (n int) { if m.Power != 0 { n += 1 + sovQuery(uint64(m.Power)) } - l = m.Rate.Size() + if m.ConsumerPower != 0 { + n += 1 + sovQuery(uint64(m.ConsumerPower)) + } + l = m.ConsumerCommissionRate.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.ProviderCommissionRate.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.Description.Size() + n += 1 + l + sovQuery(uint64(l)) + l = len(m.ProviderOperatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Jailed { + n += 2 + } + if m.Status != 0 { + n += 1 + sovQuery(uint64(m.Status)) + } + l = m.ProviderTokens.Size() n += 1 + l + sovQuery(uint64(l)) + if m.ProviderPower != 0 { + n += 1 + sovQuery(uint64(m.ProviderPower)) + } + if m.ValidatesCurrentEpoch { + n += 2 + } return n } @@ -7490,8 +7672,27 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { } } case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerPower", wireType) + } + m.ConsumerPower = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ConsumerPower |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerCommissionRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7519,10 +7720,221 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Rate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ConsumerCommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderCommissionRate", 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.ProviderCommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderOperatorAddress", 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.ProviderOperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", 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.Jailed = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= types1.BondStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderTokens", 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.ProviderTokens.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderPower", wireType) + } + m.ProviderPower = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProviderPower |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatesCurrentEpoch", 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.ValidatesCurrentEpoch = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) From 35b4140cbbe49416e9718ff6a8534448b718e0f9 Mon Sep 17 00:00:00 2001 From: insumity Date: Mon, 26 Aug 2024 10:07:52 +0200 Subject: [PATCH 40/41] modified the way we verify the new owner address, as well as nit refactoring on the ConsumerIds --- .../ccv/provider/v1/provider.proto | 2 +- .../ccv/provider/v1/tx.proto | 2 +- testutil/keeper/mocks.go | 14 + x/ccv/provider/keeper/msg_server.go | 8 + x/ccv/provider/keeper/permissionless.go | 82 ++--- x/ccv/provider/types/errors.go | 7 +- x/ccv/provider/types/msg.go | 9 - x/ccv/provider/types/provider.pb.go | 292 +++++++++--------- x/ccv/provider/types/tx.pb.go | 258 ++++++++-------- x/ccv/types/expected_keepers.go | 1 + 10 files changed, 346 insertions(+), 329 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 7ccc5c147b..7204d5754b 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -463,4 +463,4 @@ message PowerShapingParameters { // ConsumerIds contains consumer ids of chains // Used so we can easily (de)serialize slices of strings -message ConsumerIds { repeated string consumer_ids = 1; } +message ConsumerIds { repeated string ids = 1; } diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index ea55cc5fe1..eb4d5ba5f0 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -393,7 +393,7 @@ message MsgUpdateConsumer { string consumer_id = 2; // the new owner of the consumer when updated - string new_owner_address = 3; + string new_owner_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // the metadata of the consumer when updated ConsumerMetadata metadata = 4; diff --git a/testutil/keeper/mocks.go b/testutil/keeper/mocks.go index 1a1cd971d5..94ef8e1f98 100644 --- a/testutil/keeper/mocks.go +++ b/testutil/keeper/mocks.go @@ -1234,6 +1234,20 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { return m.recorder } +// AddressCodec mocks base method. +func (m *MockAccountKeeper) AddressCodec() address.Codec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddressCodec") + ret0, _ := ret[0].(address.Codec) + return ret0 +} + +// AddressCodec indicates an expected call of AddressCodec. +func (mr *MockAccountKeeperMockRecorder) AddressCodec() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddressCodec", reflect.TypeOf((*MockAccountKeeper)(nil).AddressCodec)) +} + // GetModuleAccount mocks base method. func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, name string) types1.ModuleAccountI { m.ctrl.T.Helper() diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index f87454e01e..9550b7d620 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -359,6 +359,14 @@ func (k msgServer) UpdateConsumer(goCtx context.Context, msg *types.MsgUpdateCon "cannot update consumer chain that is in the stopped phase: %s", consumerId) } + // The new owner address can be empty, in which case the consumer chain does not change its owner. + // However, if the new owner address is not empty, we verify that it's a valid account address. + if strings.TrimSpace(msg.NewOwnerAddress) != "" { + if _, err := k.accountKeeper.AddressCodec().StringToBytes(msg.NewOwnerAddress); err != nil { + return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrInvalidNewOwnerAddress, "invalid new owner address %s", msg.NewOwnerAddress) + } + } + ownerAddress, err := k.Keeper.GetConsumerOwnerAddress(ctx, consumerId) if err != nil { return &types.MsgUpdateConsumerResponse{}, errorsmod.Wrapf(types.ErrNoOwnerAddress, "cannot retrieve owner address %s", ownerAddress) diff --git a/x/ccv/provider/keeper/permissionless.go b/x/ccv/provider/keeper/permissionless.go index c1b397e693..b742485f6e 100644 --- a/x/ccv/provider/keeper/permissionless.go +++ b/x/ccv/provider/keeper/permissionless.go @@ -276,10 +276,10 @@ func (k Keeper) AppendSpawnTimeForConsumerToBeLaunched(ctx sdk.Context, consumer if err != nil { return err } - consumerIds := append(consumerIdsSlice.ConsumerIds, consumerId) + consumerIds := append(consumerIdsSlice.Ids, consumerId) appendedConsumerIdsStr := types.ConsumerIds{ - ConsumerIds: consumerIds, + Ids: consumerIds, } bz, err := appendedConsumerIdsStr.Marshal() @@ -300,31 +300,31 @@ func (k Keeper) RemoveConsumerFromToBeLaunchedConsumers(ctx sdk.Context, consume return err } - if len(consumerIds.ConsumerIds) == 0 { + if len(consumerIds.Ids) == 0 { return fmt.Errorf("no consumer ids for spawn time: %s", spawnTime.String()) } // find the index of the consumer we want to remove index := 0 - for i := 0; i < len(consumerIds.ConsumerIds); i = i + 1 { - if consumerIds.ConsumerIds[i] == consumerId { + for i := 0; i < len(consumerIds.Ids); i = i + 1 { + if consumerIds.Ids[i] == consumerId { index = i break } } - if consumerIds.ConsumerIds[index] != consumerId { + if consumerIds.Ids[index] != consumerId { return fmt.Errorf("failed to find consumer id (%s) in the chains to be launched", consumerId) } - if len(consumerIds.ConsumerIds) == 1 { + if len(consumerIds.Ids) == 1 { store.Delete(types.SpawnTimeToConsumerIdsKey(spawnTime)) return nil } - updatedConsumerIds := append(consumerIds.ConsumerIds[:index], consumerIds.ConsumerIds[index+1:]...) + updatedConsumerIds := append(consumerIds.Ids[:index], consumerIds.Ids[index+1:]...) updatedConsumerIdsStr := types.ConsumerIds{ - ConsumerIds: updatedConsumerIds, + Ids: updatedConsumerIds, } bz, err := updatedConsumerIdsStr.Marshal() @@ -362,10 +362,10 @@ func (k Keeper) AppendStopTimeForConsumerToBeStopped(ctx sdk.Context, consumerId if err != nil { return err } - consumerIds := append(consumerIdsStr.ConsumerIds, consumerId) + consumerIds := append(consumerIdsStr.Ids, consumerId) consumerIdsNewStr := types.ConsumerIds{ - ConsumerIds: consumerIds, + Ids: consumerIds, } bz, err := consumerIdsNewStr.Marshal() @@ -386,30 +386,30 @@ func (k Keeper) RemoveConsumerFromToBeStoppedConsumers(ctx sdk.Context, consumer return err } - if len(consumerIds.ConsumerIds) == 0 { + if len(consumerIds.Ids) == 0 { return fmt.Errorf("no consumer ids for stop time: %s", stopTime.String()) } // find the index of the consumer we want to remove index := 0 - for i := 0; i < len(consumerIds.ConsumerIds); i = i + 1 { - if consumerIds.ConsumerIds[i] == consumerId { + for i := 0; i < len(consumerIds.Ids); i = i + 1 { + if consumerIds.Ids[i] == consumerId { index = i break } } - if consumerIds.ConsumerIds[index] != consumerId { + if consumerIds.Ids[index] != consumerId { return fmt.Errorf("failed to find consumer id (%s) in the chains to be stopped", consumerId) } - if len(consumerIds.ConsumerIds) == 1 { + if len(consumerIds.Ids) == 1 { store.Delete(types.StopTimeToConsumerIdsKey(stopTime)) return nil } - updatedConsumerIds := append(consumerIds.ConsumerIds[:index], consumerIds.ConsumerIds[index+1:]...) + updatedConsumerIds := append(consumerIds.Ids[:index], consumerIds.Ids[index+1:]...) updatedConsumerIdsStr := types.ConsumerIds{ - ConsumerIds: updatedConsumerIds, + Ids: updatedConsumerIds, } bz, err := updatedConsumerIdsStr.Marshal() if err != nil { @@ -549,14 +549,14 @@ func (k Keeper) GetInitializedConsumersReadyToLaunch(ctx sdk.Context, limit uint "error", err) continue } - if len(result)+len(consumerIds.ConsumerIds) >= int(limit) { - remainingConsumerIds := len(result) + len(consumerIds.ConsumerIds) - int(limit) - if len(consumerIds.ConsumerIds[:len(consumerIds.ConsumerIds)-remainingConsumerIds]) == 0 { + if len(result)+len(consumerIds.Ids) >= int(limit) { + remainingConsumerIds := len(result) + len(consumerIds.Ids) - int(limit) + if len(consumerIds.Ids[:len(consumerIds.Ids)-remainingConsumerIds]) == 0 { return result } - return append(result, consumerIds.ConsumerIds[:len(consumerIds.ConsumerIds)-remainingConsumerIds]...) + return append(result, consumerIds.Ids[:len(consumerIds.Ids)-remainingConsumerIds]...) } else { - result = append(result, consumerIds.ConsumerIds...) + result = append(result, consumerIds.Ids...) } } @@ -665,14 +665,14 @@ func (k Keeper) GetLaunchedConsumersReadyToStop(ctx sdk.Context, limit uint32) [ "error", err) continue } - if len(result)+len(consumerIds.ConsumerIds) >= int(limit) { - remainingConsumerIds := len(result) + len(consumerIds.ConsumerIds) - int(limit) - if len(consumerIds.ConsumerIds[:len(consumerIds.ConsumerIds)-remainingConsumerIds]) == 0 { + if len(result)+len(consumerIds.Ids) >= int(limit) { + remainingConsumerIds := len(result) + len(consumerIds.Ids) - int(limit) + if len(consumerIds.Ids[:len(consumerIds.Ids)-remainingConsumerIds]) == 0 { return result } - return append(result, consumerIds.ConsumerIds[:len(consumerIds.ConsumerIds)-remainingConsumerIds]...) + return append(result, consumerIds.Ids[:len(consumerIds.Ids)-remainingConsumerIds]...) } else { - result = append(result, consumerIds.ConsumerIds...) + result = append(result, consumerIds.Ids...) } } @@ -727,19 +727,21 @@ func (k Keeper) CanLaunch(ctx sdk.Context, consumerId string) (time.Time, bool) return time.Time{}, false } - if initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId); err == nil { - // a chain can only launch if the spawn time is in the future - spawnTimeInTheFuture := initializationParameters.SpawnTime.After(ctx.BlockTime()) + initializationParameters, err := k.GetConsumerInitializationParameters(ctx, consumerId) + if err != nil { + return time.Time{}, false + } - genesisHashSet := initializationParameters.GenesisHash != nil - binaryHashSet := initializationParameters.BinaryHash != nil + // a chain can only launch if the spawn time is in the future + spawnTimeInTheFuture := initializationParameters.SpawnTime.After(ctx.BlockTime()) - consumerRedistributionFractionSet := initializationParameters.ConsumerRedistributionFraction != "" - blocksPerDistributionTransmissionSet := initializationParameters.BlocksPerDistributionTransmission > 0 - historicalEntriesSet := initializationParameters.HistoricalEntries > 0 + genesisHashSet := initializationParameters.GenesisHash != nil + binaryHashSet := initializationParameters.BinaryHash != nil - return initializationParameters.SpawnTime, spawnTimeInTheFuture && genesisHashSet && binaryHashSet && consumerRedistributionFractionSet && - blocksPerDistributionTransmissionSet && historicalEntriesSet - } - return time.Time{}, false + consumerRedistributionFractionSet := initializationParameters.ConsumerRedistributionFraction != "" + blocksPerDistributionTransmissionSet := initializationParameters.BlocksPerDistributionTransmission > 0 + historicalEntriesSet := initializationParameters.HistoricalEntries > 0 + + return initializationParameters.SpawnTime, spawnTimeInTheFuture && genesisHashSet && binaryHashSet && consumerRedistributionFractionSet && + blocksPerDistributionTransmissionSet && historicalEntriesSet } diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 88f2ff6781..94e9e5669a 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -43,7 +43,8 @@ var ( ErrNoConsumerId = errorsmod.Register(ModuleName, 35, "missing consumer id") ErrAlreadyOptedIn = errorsmod.Register(ModuleName, 36, "already opted in to a chain with the same chain id") ErrNoOwnerAddress = errorsmod.Register(ModuleName, 37, "missing owner address") - ErrInvalidTransformToTopN = errorsmod.Register(ModuleName, 38, "invalid transform to Top N chain") - ErrInvalidTransformToOptIn = errorsmod.Register(ModuleName, 39, "invalid transform to Opt In chain") - ErrCannotCreateTopNChain = errorsmod.Register(ModuleName, 40, "cannot create Top N chain outside permissionlessly") + ErrInvalidNewOwnerAddress = errorsmod.Register(ModuleName, 38, "invalid new owner address") + ErrInvalidTransformToTopN = errorsmod.Register(ModuleName, 39, "invalid transform to Top N chain") + ErrInvalidTransformToOptIn = errorsmod.Register(ModuleName, 40, "invalid transform to Opt In chain") + ErrCannotCreateTopNChain = errorsmod.Register(ModuleName, 41, "cannot create Top N chain outside permissionlessly") ) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 421eb7a976..21b9173eca 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -327,15 +327,6 @@ func (msg MsgUpdateConsumer) ValidateBasic() error { return err } - // The new owner address can be empty, in which case the consumer chain does not change its owner. - // However, if the new owner address is not empty, we verify that it's a valid account address. - if strings.TrimSpace(msg.NewOwnerAddress) != "" { - _, err := sdk.AccAddressFromBech32(msg.NewOwnerAddress) - if err != nil { - return err - } - } - if msg.Metadata != nil { if err := ValidateConsumerMetadata(*msg.Metadata); err != nil { return err diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 46b1a2c826..a0d0fa1dd8 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -1708,7 +1708,7 @@ func (m *PowerShapingParameters) GetAllowInactiveVals() bool { // ConsumerIds contains consumer ids of chains // Used so we can easily (de)serialize slices of strings type ConsumerIds struct { - ConsumerIds []string `protobuf:"bytes,1,rep,name=consumer_ids,json=consumerIds,proto3" json:"consumer_ids,omitempty"` + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` } func (m *ConsumerIds) Reset() { *m = ConsumerIds{} } @@ -1744,9 +1744,9 @@ func (m *ConsumerIds) XXX_DiscardUnknown() { var xxx_messageInfo_ConsumerIds proto.InternalMessageInfo -func (m *ConsumerIds) GetConsumerIds() []string { +func (m *ConsumerIds) GetIds() []string { if m != nil { - return m.ConsumerIds + return m.Ids } return nil } @@ -1782,140 +1782,140 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 2123 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x41, 0x8d, 0x1d, 0x7b, 0xa5, 0xa8, 0x24, 0xbd, 0xa9, - 0x0d, 0x36, 0xae, 0x97, 0x96, 0x82, 0x02, 0x86, 0xdb, 0xc0, 0x90, 0x29, 0x27, 0x96, 0xd4, 0x38, - 0xec, 0x4a, 0x50, 0x80, 0xf4, 0xb0, 0x18, 0xee, 0x8e, 0xc8, 0xa9, 0x76, 0x77, 0xd6, 0x33, 0xc3, - 0x95, 0xd9, 0x43, 0xcf, 0x45, 0x81, 0x02, 0x69, 0x4f, 0x41, 0x2f, 0xcd, 0xb1, 0xe8, 0xa9, 0x87, - 0xa2, 0x7f, 0x40, 0x4f, 0x41, 0x81, 0xa2, 0x39, 0xf6, 0x94, 0x14, 0xf6, 0xa1, 0x87, 0x02, 0xbd, - 0xf6, 0x5a, 0xcc, 0xec, 0x07, 0x97, 0xfa, 0x32, 0x0d, 0xcb, 0xb9, 0x48, 0x3b, 0xef, 0xfd, 0xde, - 0x9b, 0x37, 0x33, 0xef, 0x6b, 0x86, 0x60, 0x83, 0x04, 0x02, 0x33, 0xa7, 0x8f, 0x48, 0x60, 0x73, - 0xec, 0x0c, 0x18, 0x11, 0xc3, 0x96, 0xe3, 0x44, 0xad, 0x90, 0xd1, 0x88, 0xb8, 0x98, 0xb5, 0xa2, - 0xf5, 0xec, 0xdb, 0x0c, 0x19, 0x15, 0x14, 0xbe, 0x73, 0x86, 0x8c, 0xe9, 0x38, 0x91, 0x99, 0xe1, - 0xa2, 0xf5, 0xd5, 0x9b, 0xe7, 0x29, 0x8e, 0xd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a, 0x5c, 0x53, 0x37, 0xe8, 0xbd, 0x3e, 0x0a, 0xe5, - 0xe1, 0x8e, 0x42, 0x20, 0xbb, 0x96, 0x6b, 0x13, 0x5c, 0xcb, 0xa7, 0x5f, 0xed, 0x5a, 0x5e, 0x98, - 0xe0, 0x5a, 0x5e, 0xbc, 0xe8, 0x5a, 0x3e, 0x73, 0xd1, 0xb5, 0x7c, 0x76, 0xb2, 0x6b, 0xf9, 0xdc, - 0x79, 0xd7, 0xf2, 0xbb, 0xa0, 0x92, 0x25, 0x08, 0x97, 0xcb, 0x10, 0xce, 0x3c, 0x87, 0xb8, 0x69, - 0x57, 0x99, 0x95, 0xd4, 0x6d, 0x97, 0x3f, 0xfc, 0xe4, 0xcb, 0xe7, 0x35, 0xed, 0xab, 0xe7, 0x35, - 0xed, 0x5f, 0xcf, 0x6b, 0xda, 0x67, 0x2f, 0x6a, 0x53, 0x5f, 0xbd, 0xa8, 0x4d, 0xfd, 0xf3, 0x45, - 0x6d, 0xea, 0xd3, 0xf7, 0x4f, 0xa7, 0xc3, 0x51, 0xb9, 0xb9, 0x93, 0xfd, 0x24, 0x10, 0xfd, 0xa0, - 0xf5, 0x6c, 0xfc, 0x07, 0x07, 0x95, 0x29, 0xbb, 0xb3, 0xca, 0xd3, 0xdf, 0xfb, 0x7f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xe4, 0x60, 0xc1, 0x71, 0xa1, 0x18, 0x00, 0x00, + // 2119 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcf, 0x6f, 0x1b, 0xc7, + 0xf5, 0xd7, 0x8a, 0x94, 0x44, 0x0e, 0xf5, 0x83, 0x1a, 0x3b, 0xf6, 0x4a, 0xd1, 0x97, 0xa4, 0x37, + 0x5f, 0x1b, 0x6c, 0x5c, 0x2f, 0x23, 0x05, 0x05, 0x0c, 0xb7, 0x81, 0x21, 0x51, 0x4e, 0x2c, 0xa9, + 0x71, 0xd8, 0x95, 0xa0, 0x00, 0xe9, 0x61, 0x31, 0xdc, 0x1d, 0x91, 0x53, 0xed, 0xee, 0xac, 0x67, + 0x86, 0x2b, 0xb3, 0x87, 0x9e, 0x8b, 0x02, 0x05, 0xd2, 0x9e, 0x82, 0x5e, 0x9a, 0x63, 0xd1, 0x53, + 0x0f, 0x45, 0xff, 0x80, 0x9e, 0x82, 0x02, 0x45, 0x73, 0xec, 0x29, 0x29, 0xec, 0x43, 0x0f, 0x05, + 0x7a, 0xed, 0xb5, 0x98, 0xd9, 0x1f, 0x5c, 0xea, 0x97, 0x69, 0x58, 0xee, 0x45, 0xda, 0x79, 0xef, + 0xf3, 0xde, 0xbc, 0x99, 0x79, 0xbf, 0x66, 0x08, 0x36, 0x48, 0x20, 0x30, 0x73, 0xfa, 0x88, 0x04, + 0x36, 0xc7, 0xce, 0x80, 0x11, 0x31, 0x6c, 0x39, 0x4e, 0xd4, 0x0a, 0x19, 0x8d, 0x88, 0x8b, 0x59, + 0x2b, 0x5a, 0xcf, 0xbe, 0xcd, 0x90, 0x51, 0x41, 0xe1, 0x3b, 0xe7, 0xc8, 0x98, 0x8e, 0x13, 0x99, + 0x19, 0x2e, 0x5a, 0x5f, 0xbd, 0x7d, 0x91, 0xe2, 0x68, 0xbd, 0x75, 0x42, 0x18, 0x8e, 0x75, 0xad, + 0x5e, 0xef, 0xd1, 0x1e, 0x55, 0x9f, 0x2d, 0xf9, 0x95, 0x50, 0xeb, 0x3d, 0x4a, 0x7b, 0x1e, 0x6e, + 0xa9, 0x51, 0x77, 0x70, 0xd4, 0x12, 0xc4, 0xc7, 0x5c, 0x20, 0x3f, 0x4c, 0x00, 0xb5, 0xd3, 0x00, + 0x77, 0xc0, 0x90, 0x20, 0x34, 0x48, 0x15, 0x90, 0xae, 0xd3, 0x72, 0x28, 0xc3, 0x2d, 0xc7, 0x23, + 0x38, 0x10, 0x72, 0xd6, 0xf8, 0x2b, 0x01, 0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4f, 0x59, 0x0b, + 0x89, 0x5c, 0x4c, 0x84, 0xb7, 0xc0, 0x7c, 0x0f, 0x07, 0x98, 0x13, 0x6e, 0xf7, 0x11, 0xef, 0xeb, + 0x33, 0x0d, 0xad, 0x39, 0x6f, 0x55, 0x12, 0xda, 0x63, 0xc4, 0xfb, 0xb0, 0x0e, 0x2a, 0x5d, 0x12, + 0x20, 0x36, 0x8c, 0x11, 0xb3, 0x0a, 0x01, 0x62, 0x92, 0x02, 0xb4, 0x01, 0xe0, 0x21, 0x3a, 0x09, + 0x6c, 0xe9, 0x1b, 0xfa, 0x5c, 0x62, 0x48, 0xec, 0x17, 0x66, 0xea, 0x17, 0xe6, 0x41, 0xea, 0x38, + 0x5b, 0x25, 0x69, 0xc8, 0xe7, 0xdf, 0xd6, 0x35, 0xab, 0xac, 0xe4, 0x24, 0x07, 0x3e, 0x01, 0xd5, + 0x41, 0xd0, 0xa5, 0x81, 0x4b, 0x82, 0x9e, 0x1d, 0x62, 0x46, 0xa8, 0xab, 0x97, 0x94, 0xaa, 0x95, + 0x33, 0xaa, 0xb6, 0x13, 0x17, 0x8b, 0x35, 0x7d, 0x21, 0x35, 0x2d, 0x65, 0xc2, 0x1d, 0x25, 0x0b, + 0x7f, 0x04, 0xa0, 0xe3, 0x44, 0xca, 0x24, 0x3a, 0x10, 0xa9, 0xc6, 0xf2, 0xe4, 0x1a, 0xab, 0x8e, + 0x13, 0x1d, 0xc4, 0xd2, 0x89, 0xca, 0x1f, 0x83, 0x9b, 0x82, 0xa1, 0x80, 0x1f, 0x61, 0x76, 0x5a, + 0x2f, 0x98, 0x5c, 0xef, 0x5b, 0xa9, 0x8e, 0x71, 0xe5, 0x8f, 0x41, 0xc3, 0x49, 0x1c, 0xc8, 0x66, + 0xd8, 0x25, 0x5c, 0x30, 0xd2, 0x1d, 0x48, 0x59, 0xfb, 0x88, 0x21, 0x47, 0xf9, 0x48, 0x45, 0x39, + 0x41, 0x2d, 0xc5, 0x59, 0x63, 0xb0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, 0xea, 0x79, 0x4d, 0xfb, 0xfa, 0x79, 0x4d, 0xfb, 0xc7, 0xf3, + 0x9a, 0xf6, 0xf9, 0x8b, 0xda, 0xd4, 0xd7, 0x2f, 0x6a, 0x53, 0x7f, 0x7f, 0x51, 0x9b, 0xfa, 0xec, + 0x83, 0xb3, 0xd9, 0x6f, 0x54, 0x5d, 0xee, 0x65, 0xbf, 0x00, 0x44, 0xdf, 0x6b, 0x3d, 0x1b, 0xff, + 0x7d, 0x41, 0x25, 0xc6, 0xee, 0xac, 0x72, 0xec, 0xf7, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x45, + 0xe0, 0x33, 0x4d, 0x90, 0x18, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -3221,11 +3221,11 @@ func (m *ConsumerIds) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.ConsumerIds) > 0 { - for iNdEx := len(m.ConsumerIds) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ConsumerIds[iNdEx]) - copy(dAtA[i:], m.ConsumerIds[iNdEx]) - i = encodeVarintProvider(dAtA, i, uint64(len(m.ConsumerIds[iNdEx]))) + if len(m.Ids) > 0 { + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Ids[iNdEx]))) i-- dAtA[i] = 0xa } @@ -3820,8 +3820,8 @@ func (m *ConsumerIds) Size() (n int) { } var l int _ = l - if len(m.ConsumerIds) > 0 { - for _, s := range m.ConsumerIds { + if len(m.Ids) > 0 { + for _, s := range m.Ids { l = len(s) n += 1 + l + sovProvider(uint64(l)) } @@ -7897,7 +7897,7 @@ func (m *ConsumerIds) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumerIds", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7925,7 +7925,7 @@ func (m *ConsumerIds) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumerIds = append(m.ConsumerIds, string(dAtA[iNdEx:postIndex])) + m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index bc8c466b3c..08e7c4c278 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -1692,136 +1692,136 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 2059 bytes of a gzipped FileDescriptorProto + // 2061 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4d, 0x6c, 0x1c, 0x49, - 0x15, 0x76, 0xcf, 0x8c, 0xbd, 0x33, 0x35, 0xfe, 0x6d, 0x3b, 0xeb, 0xf6, 0x24, 0xf1, 0x38, 0x66, - 0xd9, 0xb5, 0xc2, 0xba, 0x67, 0x63, 0x48, 0x16, 0x42, 0xf8, 0xf1, 0x4f, 0x20, 0x5e, 0x70, 0xec, - 0x6d, 0x87, 0xac, 0x04, 0x12, 0xad, 0x9a, 0xee, 0x4a, 0x4f, 0x29, 0xd3, 0x5d, 0xad, 0xae, 0x9a, - 0xf1, 0x9a, 0x13, 0xda, 0x53, 0x8e, 0x41, 0x5c, 0xb8, 0xb1, 0x07, 0x38, 0x20, 0x01, 0xda, 0xc3, - 0x9e, 0xb8, 0x20, 0x71, 0x5a, 0x89, 0xcb, 0xb2, 0x27, 0xb4, 0x87, 0x80, 0x92, 0xc3, 0x72, 0x81, - 0x03, 0x37, 0x24, 0x0e, 0xa8, 0x7e, 0xba, 0xa7, 0x7b, 0x66, 0xec,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4e, 0x0b, 0x06, 0x01, 0x6a, - 0x1b, 0x93, 0x22, 0x94, 0xba, 0x7b, 0x82, 0xcd, 0x6d, 0x09, 0xd3, 0xe7, 0xc1, 0x38, 0x23, 0xa1, - 0x7d, 0xd7, 0x98, 0x5a, 0xd1, 0xd6, 0xa6, 0xac, 0x12, 0x23, 0xe1, 0x5d, 0xfd, 0x35, 0xb0, 0xd0, - 0x85, 0x6d, 0xec, 0x42, 0x46, 0x22, 0x6a, 0x87, 0xe4, 0x08, 0x45, 0xb6, 0x03, 0x43, 0x63, 0x5a, - 0x60, 0xf4, 0x9e, 0xec, 0x80, 0x8b, 0xb6, 0x61, 0xa8, 0x5f, 0x05, 0x73, 0xc9, 0xaa, 0x4d, 0x11, - 0x13, 0xf0, 0x19, 0x01, 0x9f, 0x49, 0x04, 0x87, 0x88, 0x71, 0xec, 0x25, 0x50, 0x81, 0xed, 0x36, - 0x39, 0x6a, 0x63, 0xca, 0x8c, 0xd9, 0x95, 0xe2, 0x5a, 0xc5, 0xea, 0x2d, 0xe8, 0x35, 0x50, 0x76, - 0x51, 0x70, 0x2c, 0x84, 0x73, 0x42, 0x98, 0x3c, 0x67, 0xab, 0x8e, 0x9e, 0xbf, 0xea, 0x5c, 0x04, - 0x15, 0x9f, 0xd7, 0x17, 0x06, 0x1f, 0x22, 0x63, 0x7e, 0x45, 0x5b, 0x2b, 0x59, 0x65, 0x1f, 0x07, - 0x87, 0xfc, 0x59, 0x37, 0xc1, 0xbc, 0xb0, 0x6e, 0xe3, 0x80, 0xef, 0x6f, 0x17, 0xd9, 0x5d, 0xd8, - 0xa6, 0xc6, 0xc2, 0x8a, 0xb6, 0x56, 0xb6, 0xe6, 0x84, 0x68, 0x57, 0x49, 0xee, 0xc3, 0xf6, 0x60, - 0xdd, 0xb9, 0x0c, 0x2e, 0x0e, 0xa9, 0x2d, 0x49, 0xed, 0xf9, 0x8d, 0x06, 0xf4, 0x94, 0xdc, 0x42, - 0x3e, 0xe9, 0xc2, 0x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27, 0xb4, 0xa7, 0x1c, 0x83, 0xb8, 0x70, 0x63, 0x0f, 0x70, 0x40, 0x02, 0xb4, + 0x87, 0x3d, 0x71, 0x41, 0xe2, 0xb4, 0x12, 0x97, 0x65, 0x4f, 0x68, 0x0f, 0x01, 0x25, 0x87, 0xe5, + 0xc2, 0x85, 0x1b, 0x12, 0x07, 0x54, 0x1f, 0xdd, 0xd3, 0x3d, 0x33, 0x76, 0xda, 0x63, 0x58, 0x90, + 0xb8, 0x58, 0xee, 0x7a, 0xbf, 0xf7, 0x7b, 0x1f, 0xf5, 0xea, 0xbd, 0xae, 0x1e, 0xf0, 0x1a, 0x0e, + 0x18, 0x8a, 0x9c, 0x16, 0xc4, 0x81, 0x4d, 0x91, 0xd3, 0x89, 0x30, 0x3b, 0x6e, 0x38, 0x4e, 0xb7, + 0x11, 0x46, 0xa4, 0x8b, 0x5d, 0x14, 0x35, 0xba, 0xd7, 0x1b, 0xec, 0x1d, 0x33, 0x8c, 0x08, 0x23, + 0xfa, 0xff, 0x0d, 0x41, 0x9b, 0x8e, 0xd3, 0x35, 0x63, 0xb4, 0xd9, 0xbd, 0x5e, 0x9b, 0x83, 0x3e, + 0x0e, 0x48, 0x43, 0xfc, 0x95, 0x7a, 0xb5, 0xcb, 0x1e, 0x21, 0x5e, 0x1b, 0x35, 0x60, 0x88, 0x1b, + 0x30, 0x08, 0x08, 0x83, 0x0c, 0x93, 0x80, 0x2a, 0x69, 0x5d, 0x49, 0xc5, 0x53, 0xb3, 0xf3, 0xb0, + 0xc1, 0xb0, 0x8f, 0x28, 0x83, 0x7e, 0xa8, 0x00, 0xcb, 0xfd, 0x00, 0xb7, 0x13, 0x09, 0x06, 0x25, + 0x5f, 0xea, 0x97, 0xc3, 0xe0, 0x58, 0x89, 0x16, 0x3c, 0xe2, 0x11, 0xf1, 0x6f, 0x83, 0xff, 0x17, + 0x2b, 0x38, 0x84, 0xfa, 0x84, 0xda, 0x52, 0x20, 0x1f, 0x94, 0x68, 0x51,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ed, 0x2e, + 0xa4, 0x2d, 0xbe, 0x85, 0x4d, 0x1c, 0xc0, 0xe8, 0x58, 0x22, 0x4a, 0x02, 0x01, 0xe4, 0x92, 0x00, + 0x6c, 0x03, 0x40, 0x43, 0x78, 0x14, 0xd8, 0x7c, 0xda, 0x88, 0x0e, 0xc3, 0x1d, 0x91, 0x93, 0xc4, + 0x8c, 0x27, 0x89, 0x79, 0x3f, 0x1e, 0x45, 0x5b, 0x65, 0xee, 0xc8, 0x93, 0x3f, 0xd5, 0x35, 0xab, + 0x22, 0xf4, 0xb8, 0x44, 0xbf, 0x07, 0x66, 0x3b, 0x41, 0x93, 0x04, 0x2e, 0x0e, 0x3c, 0x3b, 0x44, + 0x11, 0x26, 0xae, 0x31, 0x21, 0xa8, 0x96, 0x06, 0xa8, 0x76, 0xd4, 0xd0, 0x92, 0x4c, 0x3f, 0xe1, + 0x4c, 0x33, 0x89, 0xf2, 0x81, 0xd0, 0xd5, 0xdf, 0x02, 0xba, 0xe3, 0x74, 0x85, 0x4b, 0xa4, 0xc3, + 0x62, 0xc6, 0x0b, 0xf9, 0x19, 0x67, 0x1d, 0xa7, 0x7b, 0x5f, 0x6a, 0x2b, 0xca, 0xef, 0x81, 0x45, + 0x16, 0xc1, 0x80, 0x3e, 0x44, 0x51, 0x3f, 0x6f, 0x39, 0x3f, 0xef, 0xc5, 0x98, 0x23, 0x4b, 0x7e, + 0x17, 0xac, 0x24, 0x07, 0x25, 0x42, 0x2e, 0xa6, 0x2c, 0xc2, 0xcd, 0x8e, 0x38, 0x95, 0xf1, 0xb9, + 0x32, 0x2a, 0xa2, 0x08, 0x96, 0x63, 0x9c, 0x95, 0x81, 0x7d, 0x43, 0xa1, 0xf4, 0x7d, 0xf0, 0xb2, + 0x38, 0xc7, 0x94, 0x3b, 0x67, 0x67, 0x98, 0x84, 0x69, 0x1f, 0x53, 0xca, 0xd9, 0xc0, 0x8a, 0xb6, + 0x56, 0xb4, 0xae, 0x4a, 0xec, 0x01, 0x8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c, 0xf2, 0x4d, 0xe4, 0x6a, + 0xde, 0x89, 0x7c, 0x15, 0xd4, 0x4f, 0xd8, 0xaf, 0x64, 0x4f, 0x7f, 0x57, 0x14, 0x27, 0x67, 0x3b, + 0x42, 0x90, 0xf5, 0x46, 0x57, 0xaf, 0xf2, 0xb4, 0x9c, 0x95, 0xb7, 0xd4, 0x7f, 0x22, 0x7a, 0xfb, + 0xf8, 0x36, 0x28, 0xfb, 0x88, 0x41, 0x17, 0x32, 0xa8, 0x6e, 0x7a, 0x37, 0x72, 0x5d, 0x76, 0x12, + 0xbf, 0x95, 0xb2, 0xba, 0x56, 0x24, 0x64, 0xfa, 0xbb, 0x1a, 0x58, 0x52, 0x77, 0x0c, 0xfc, 0x03, + 0x11, 0x96, 0x2d, 0xae, 0x44, 0x88, 0xa1, 0x88, 0x8a, 0xaa, 0xa9, 0x6e, 0xdc, 0x39, 0x93, 0xa9, + 0xdd, 0x0c, 0xdb, 0x41, 0x42, 0x66, 0x19, 0xf8, 0x04, 0x89, 0xde, 0x01, 0x86, 0xac, 0x42, 0xda, + 0x82, 0xa1, 0xb8, 0x51, 0xf4, 0x5c, 0x90, 0x17, 0x94, 0x2f, 0xe7, 0xbb, 0xda, 0x71, 0x92, 0x43, + 0xc9, 0x91, 0x32, 0xfc, 0x52, 0x38, 0x74, 0xfd, 0x56, 0x35, 0x7d, 0x80, 0x6f, 0x8b, 0xe9, 0x9d, + 0xdd, 0xc3, 0x78, 0x87, 0x5f, 0xf8, 0x1a, 0xb2, 0xfa, 0xb8, 0x24, 0x4a, 0x40, 0x5e, 0x18, 0xcf, + 0x51, 0x02, 0x7d, 0x86, 0x0a, 0x03, 0xef, 0x3b, 0x3b, 0x60, 0x2e, 0x40, 0x47, 0x36, 0x39, 0x0a, + 0x54, 0xbf, 0x45, 0x94, 0xbe, 0x70, 0x2e, 0xcc, 0x04, 0xe8, 0x68, 0x9f, 0x6b, 0xa8, 0x65, 0xfd, + 0xad, 0x54, 0x39, 0x95, 0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0x8b, 0x4d, 0x6a, 0xd5, 0x6e, 0x8f, 0xa2, 0x95, + 0x38, 0xe1, 0x83, 0x71, 0x79, 0xf5, 0x5c, 0xcf, 0x4b, 0x23, 0xe0, 0xb5, 0x1b, 0x67, 0x82, 0x27, + 0xe6, 0x42, 0x30, 0xa1, 0x6e, 0x79, 0xe6, 0x19, 0x08, 0xf6, 0x3b, 0xac, 0x76, 0xf3, 0x6c, 0xf8, + 0xc4, 0xe2, 0x2f, 0x34, 0xb0, 0x74, 0xf2, 0xad, 0x2b, 0x77, 0xbb, 0x3f, 0x91, 0xa2, 0xb6, 0x7b, + 0x6e, 0x8a, 0xc4, 0xd7, 0x9f, 0x6a, 0x60, 0x61, 0xe8, 0x8d, 0xe6, 0xf6, 0x59, 0x3b, 0x42, 0x5a, + 0xbb, 0xb6, 0x73, 0x1e, 0xed, 0x4c, 0x53, 0xa9, 0x8d, 0xff, 0xf0, 0xd3, 0xf7, 0xaf, 0x69, 0x5b, + 0x6f, 0x7f, 0xf8, 0x6c, 0x59, 0xfb, 0xe8, 0xd9, 0xb2, 0xf6, 0xe7, 0x67, 0xcb, 0xda, 0x93, 0xe7, + 0xcb, 0x63, 0x1f, 0x3d, 0x5f, 0x1e, 0xfb, 0xe3, 0xf3, 0xe5, 0xb1, 0xef, 0x7e, 0xc5, 0xc3, 0xac, + 0xd5, 0x69, 0x9a, 0x0e, 0xf1, 0xd5, 0xef, 0xa2, 0x8d, 0x9e, 0xf1, 0xf5, 0xe4, 0x67, 0xcd, 0xee, + 0x8d, 0xc6, 0x3b, 0xd9, 0xdf, 0x36, 0xc5, 0xaf, 0x38, 0xcd, 0x09, 0xf1, 0xad, 0xe9, 0xf3, 0xff, + 0x0c, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x12, 0xb4, 0x8e, 0x57, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ccv/types/expected_keepers.go b/x/ccv/types/expected_keepers.go index 5773461c34..b643bb1a6d 100644 --- a/x/ccv/types/expected_keepers.go +++ b/x/ccv/types/expected_keepers.go @@ -143,6 +143,7 @@ type BankKeeper interface { // AccountKeeper defines the expected account keeper used for simulations type AccountKeeper interface { GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI + AddressCodec() addresscodec.Codec } // IBCTransferKeeper defines the expected interface needed for distribution transfer From b54c6e4db71d483778da2ae323ee5ceceafc7359 Mon Sep 17 00:00:00 2001 From: insumity Date: Mon, 26 Aug 2024 10:53:13 +0200 Subject: [PATCH 41/41] fixed some rebase issues and changed a proto to be backward-compatible --- .../ccv/provider/v1/query.proto | 30 +- x/ccv/provider/keeper/grpc_query_test.go | 2 +- x/ccv/provider/keeper/partial_set_security.go | 2 +- x/ccv/provider/keeper/permissionless_test.go | 21 +- x/ccv/provider/keeper/proposal_test.go | 2 +- x/ccv/provider/types/query.pb.go | 411 ++++++++++-------- 6 files changed, 255 insertions(+), 213 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 0af0d31293..c9536b8e16 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -340,38 +340,44 @@ message QueryConsumerValidatorsValidator { string provider_address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; // The consumer public key of the validator used on the consumer chain tendermint.crypto.PublicKey consumer_key = 2; - // [DEPRECATED] use consumer_power instead + // [DEPRECATED] use `consumer_power` instead int64 power = 3 [deprecated = true]; - // The power of the validator used on the consumer chain - int64 consumer_power = 4; + + // [DEPRECATED] use `consumer_commission_rate` instead + string rate = 4 [ deprecated = true, + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // The power of the validator used on the consumer chain + int64 consumer_power = 5; // The rate to charge delegators on the consumer chain, as a fraction - string consumer_commission_rate = 5 [ + string consumer_commission_rate = 6 [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The rate to charge delegators on the provider chain, as a fraction - string provider_commission_rate = 6 [ + string provider_commission_rate = 7 [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // description defines the description terms for the validator - cosmos.staking.v1beta1.Description description = 7 [(gogoproto.nullable) = false]; + cosmos.staking.v1beta1.Description description = 8 [(gogoproto.nullable) = false]; // provider_operator_address defines the address of the validator's operator - string provider_operator_address = 8 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string provider_operator_address = 9 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // jailed defined whether the validator has been jailed from bonded status or not. - bool jailed = 9; + bool jailed = 10; // status is the validator status (bonded/unbonding/unbonded). - cosmos.staking.v1beta1.BondStatus status = 10; + cosmos.staking.v1beta1.BondStatus status = 11; // provider_tokens defines the delegated tokens (incl. self-delegation). - string provider_tokens = 11 [ + string provider_tokens = 12 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // The power of the validator used on the provider chain - int64 provider_power = 12; + int64 provider_power = 13; // validates_current_epoch defines whether the validator has to validate for the current epoch or not - bool validates_current_epoch = 13; + bool validates_current_epoch = 14; } message QueryConsumerValidatorsResponse { diff --git a/x/ccv/provider/keeper/grpc_query_test.go b/x/ccv/provider/keeper/grpc_query_test.go index 8dc7369648..bbc61794d8 100644 --- a/x/ccv/provider/keeper/grpc_query_test.go +++ b/x/ccv/provider/keeper/grpc_query_test.go @@ -174,7 +174,7 @@ func TestQueryConsumerValidators(t *testing.T) { mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, valConsAddr2).Return(val2, nil).AnyTimes() mocks.MockStakingKeeper.EXPECT().PowerReduction(ctx).Return(sdk.DefaultPowerReduction).AnyTimes() - testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 2, []stakingtypes.Validator{val1, val2}, []int64{1, 2}, -1) // -1 to allow the calls "AnyTimes" + testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 2, []stakingtypes.Validator{val1, val2}, -1) // -1 to allow the calls "AnyTimes" res, err := pk.QueryConsumerValidators(ctx, &req) require.NoError(t, err) diff --git a/x/ccv/provider/keeper/partial_set_security.go b/x/ccv/provider/keeper/partial_set_security.go index c834d2b492..305f0f358b 100644 --- a/x/ccv/provider/keeper/partial_set_security.go +++ b/x/ccv/provider/keeper/partial_set_security.go @@ -136,7 +136,7 @@ func (k Keeper) OptInTopNValidators(ctx sdk.Context, consumerId string, bondedVa k.Logger(ctx).Debug("Opting in validator", "validator", val.GetOperator()) // if validator already exists it gets overwritten - k.SetOptedIn(ctx, chainID, types.NewProviderConsAddress(consAddr)) + k.SetOptedIn(ctx, consumerId, types.NewProviderConsAddress(consAddr)) k.SetOptedIn(ctx, consumerId, types.NewProviderConsAddress(consAddr)) } // else validators that do not belong to the top N validators but were opted in, remain opted in } diff --git a/x/ccv/provider/keeper/permissionless_test.go b/x/ccv/provider/keeper/permissionless_test.go index 7f8f0d7477..5819e355d0 100644 --- a/x/ccv/provider/keeper/permissionless_test.go +++ b/x/ccv/provider/keeper/permissionless_test.go @@ -338,26 +338,13 @@ func TestPopulateMinimumPowerInTopN(t *testing.T) { require.False(t, found) // test cases where Top N > 0 and for this we mock some validators - powers := []int64{30, 20, 10} + powers := []int64{10, 20, 30} validators := []stakingtypes.Validator{ - createStakingValidator(ctx, mocks, 3, powers[0], 3), // this validator has 50% of the total voting power + createStakingValidator(ctx, mocks, 1, powers[0], 1), // this validator has ~16 of the total voting power createStakingValidator(ctx, mocks, 2, powers[1], 2), // this validator has ~33% of the total voting gpower - createStakingValidator(ctx, mocks, 1, powers[2], 1), // this validator has ~16 of the total voting power - } - mocks.MockStakingKeeper.EXPECT().IterateLastValidatorPowers(gomock.Any(), gomock.Any()).DoAndReturn( - func(ctx sdk.Context, cb func(sdk.ValAddress, int64) bool) error { - for i, val := range validators { - if stop := cb(sdk.ValAddress(val.OperatorAddress), powers[i]); stop { - break - } - } - return nil - }).AnyTimes() - - // set up mocks for GetValidator calls - for _, val := range validators { - mocks.MockStakingKeeper.EXPECT().GetValidator(gomock.Any(), sdk.ValAddress(val.OperatorAddress)).Return(val, nil).AnyTimes() + createStakingValidator(ctx, mocks, 3, powers[2], 3), // this validator has 50% of the total voting power } + mocks.MockStakingKeeper.EXPECT().GetBondedValidatorsByPower(gomock.Any()).Return(validators, nil).AnyTimes() maxProviderConsensusValidators := int64(3) params := providerKeeper.GetParams(ctx) diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 1c16c4efd7..1aef84957f 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -888,7 +888,7 @@ func TestBeginBlockCCR(t *testing.T) { for i, _ := range consumerIds { chainId := chainIds[i] // A consumer chain is setup corresponding to each consumerId, making these mocks necessary - testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, []int64{}, 1) + testkeeper.SetupMocksForLastBondedValidatorsExpectation(mocks.MockStakingKeeper, 0, []stakingtypes.Validator{}, 1) expectations = append(expectations, testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, chainId, clienttypes.NewHeight(2, 3))...) expectations = append(expectations, testkeeper.GetMocksForSetConsumerChain(ctx, &mocks, chainId)...) diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 467cd046c0..aee4e3d717 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1413,28 +1413,30 @@ type QueryConsumerValidatorsValidator struct { ProviderAddress string `protobuf:"bytes,1,opt,name=provider_address,json=providerAddress,proto3" json:"provider_address,omitempty" yaml:"address"` // The consumer public key of the validator used on the consumer chain ConsumerKey *crypto.PublicKey `protobuf:"bytes,2,opt,name=consumer_key,json=consumerKey,proto3" json:"consumer_key,omitempty"` - // [DEPRECATED] use consumer_power instead + // [DEPRECATED] use `consumer_power` instead Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` // Deprecated: Do not use. + // [DEPRECATED] use `consumer_commission_rate` instead + Rate cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=rate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"rate"` // Deprecated: Do not use. // The power of the validator used on the consumer chain - ConsumerPower int64 `protobuf:"varint,4,opt,name=consumer_power,json=consumerPower,proto3" json:"consumer_power,omitempty"` + ConsumerPower int64 `protobuf:"varint,5,opt,name=consumer_power,json=consumerPower,proto3" json:"consumer_power,omitempty"` // The rate to charge delegators on the consumer chain, as a fraction - ConsumerCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=consumer_commission_rate,json=consumerCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"consumer_commission_rate"` + ConsumerCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=consumer_commission_rate,json=consumerCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"consumer_commission_rate"` // The rate to charge delegators on the provider chain, as a fraction - ProviderCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=provider_commission_rate,json=providerCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"provider_commission_rate"` + ProviderCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=provider_commission_rate,json=providerCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"provider_commission_rate"` // description defines the description terms for the validator - Description types1.Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` + Description types1.Description `protobuf:"bytes,8,opt,name=description,proto3" json:"description"` // provider_operator_address defines the address of the validator's operator - ProviderOperatorAddress string `protobuf:"bytes,8,opt,name=provider_operator_address,json=providerOperatorAddress,proto3" json:"provider_operator_address,omitempty"` + ProviderOperatorAddress string `protobuf:"bytes,9,opt,name=provider_operator_address,json=providerOperatorAddress,proto3" json:"provider_operator_address,omitempty"` // jailed defined whether the validator has been jailed from bonded status or not. - Jailed bool `protobuf:"varint,9,opt,name=jailed,proto3" json:"jailed,omitempty"` + Jailed bool `protobuf:"varint,10,opt,name=jailed,proto3" json:"jailed,omitempty"` // status is the validator status (bonded/unbonding/unbonded). - Status types1.BondStatus `protobuf:"varint,10,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` + Status types1.BondStatus `protobuf:"varint,11,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` // provider_tokens defines the delegated tokens (incl. self-delegation). - ProviderTokens cosmossdk_io_math.Int `protobuf:"bytes,11,opt,name=provider_tokens,json=providerTokens,proto3,customtype=cosmossdk.io/math.Int" json:"provider_tokens"` + ProviderTokens cosmossdk_io_math.Int `protobuf:"bytes,12,opt,name=provider_tokens,json=providerTokens,proto3,customtype=cosmossdk.io/math.Int" json:"provider_tokens"` // The power of the validator used on the provider chain - ProviderPower int64 `protobuf:"varint,12,opt,name=provider_power,json=providerPower,proto3" json:"provider_power,omitempty"` + ProviderPower int64 `protobuf:"varint,13,opt,name=provider_power,json=providerPower,proto3" json:"provider_power,omitempty"` // validates_current_epoch defines whether the validator has to validate for the current epoch or not - ValidatesCurrentEpoch bool `protobuf:"varint,13,opt,name=validates_current_epoch,json=validatesCurrentEpoch,proto3" json:"validates_current_epoch,omitempty"` + ValidatesCurrentEpoch bool `protobuf:"varint,14,opt,name=validates_current_epoch,json=validatesCurrentEpoch,proto3" json:"validates_current_epoch,omitempty"` } func (m *QueryConsumerValidatorsValidator) Reset() { *m = QueryConsumerValidatorsValidator{} } @@ -2009,158 +2011,159 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 2411 bytes of a gzipped FileDescriptorProto + // 2427 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4d, 0x6c, 0x1c, 0x49, - 0x15, 0x76, 0x8f, 0x7f, 0x62, 0x97, 0x63, 0x67, 0xb7, 0xe2, 0xc4, 0x93, 0xb1, 0xe3, 0x71, 0x3a, - 0x59, 0x98, 0x38, 0xc9, 0xb4, 0xed, 0xd5, 0xb2, 0xbb, 0x81, 0x6c, 0xe2, 0x19, 0xc7, 0xc9, 0xc8, - 0xd9, 0xc4, 0xdb, 0x76, 0x02, 0xf2, 0x12, 0x3a, 0xed, 0xee, 0x62, 0xdc, 0xb8, 0xa7, 0xbb, 0xdd, - 0x55, 0x33, 0xc9, 0x28, 0xca, 0x61, 0x41, 0x42, 0xbb, 0x1c, 0x50, 0x24, 0x84, 0xc4, 0x71, 0x2f, - 0x48, 0x1c, 0x38, 0xa1, 0x15, 0x88, 0xdb, 0x1e, 0xf7, 0xc6, 0xb2, 0x2b, 0x21, 0x04, 0x52, 0x40, - 0x09, 0x07, 0x84, 0x84, 0x84, 0x02, 0x57, 0x24, 0xd4, 0xd5, 0xd5, 0xbf, 0xd3, 0xe3, 0xe9, 0x99, - 0xf1, 0x81, 0x9b, 0xbb, 0xea, 0xd5, 0x57, 0xef, 0xbd, 0x7a, 0xf5, 0xea, 0xbd, 0x6f, 0x0c, 0x04, - 0xcd, 0x20, 0xc8, 0x56, 0x76, 0x65, 0xcd, 0x90, 0x30, 0x52, 0xea, 0xb6, 0x46, 0x9a, 0x82, 0xa2, - 0x34, 0x04, 0xcb, 0x36, 0x1b, 0x9a, 0x8a, 0x6c, 0xa1, 0xb1, 0x24, 0xec, 0xd7, 0x91, 0xdd, 0x2c, - 0x5a, 0xb6, 0x49, 0x4c, 0x78, 0x36, 0x61, 0x41, 0x51, 0x51, 0x1a, 0x45, 0x6f, 0x41, 0xb1, 0xb1, - 0x94, 0x9b, 0xad, 0x9a, 0x66, 0x55, 0x47, 0x82, 0x6c, 0x69, 0x82, 0x6c, 0x18, 0x26, 0x91, 0x89, - 0x66, 0x1a, 0xd8, 0x85, 0xc8, 0x4d, 0x55, 0xcd, 0xaa, 0x49, 0xff, 0x14, 0x9c, 0xbf, 0xd8, 0x68, - 0x9e, 0xad, 0xa1, 0x5f, 0x3b, 0xf5, 0xef, 0x0a, 0x44, 0xab, 0x21, 0x4c, 0xe4, 0x9a, 0xc5, 0x04, - 0x96, 0xd3, 0xa8, 0xea, 0x6b, 0xe1, 0xae, 0x59, 0x6c, 0xb7, 0xa6, 0xb1, 0x24, 0xe0, 0x5d, 0xd9, - 0x46, 0xaa, 0xa4, 0x98, 0x06, 0xae, 0xd7, 0xfc, 0x15, 0xaf, 0x1d, 0xb0, 0xe2, 0xa1, 0x66, 0x23, - 0x26, 0x36, 0x4b, 0x90, 0xa1, 0x22, 0xbb, 0xa6, 0x19, 0x44, 0x50, 0xec, 0xa6, 0x45, 0x4c, 0x61, - 0x0f, 0x35, 0x3d, 0x0b, 0x4f, 0x29, 0x26, 0xae, 0x99, 0x58, 0x72, 0x8d, 0x74, 0x3f, 0xd8, 0xd4, - 0x39, 0xf7, 0x4b, 0xc0, 0x44, 0xde, 0xd3, 0x8c, 0xaa, 0xd0, 0x58, 0xda, 0x41, 0x44, 0x5e, 0xf2, - 0xbe, 0x5d, 0x29, 0xfe, 0x3e, 0x98, 0x79, 0xcf, 0x71, 0x7a, 0x99, 0x29, 0x77, 0x03, 0x19, 0x08, - 0x6b, 0x58, 0x44, 0xfb, 0x75, 0x84, 0x09, 0x3c, 0x0d, 0x46, 0x5d, 0x0d, 0x35, 0x35, 0xcb, 0xcd, - 0x73, 0x85, 0xb1, 0x52, 0x26, 0xcb, 0x89, 0x47, 0xe8, 0x58, 0x45, 0x85, 0x79, 0x30, 0xee, 0x59, - 0xe5, 0x48, 0x64, 0x1c, 0x09, 0x11, 0x78, 0x43, 0x15, 0x95, 0x7f, 0x0c, 0x66, 0x93, 0xe1, 0xb1, - 0x65, 0x1a, 0x18, 0xc1, 0xf7, 0xc1, 0x44, 0xd5, 0x1d, 0x92, 0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, 0xed, 0x72, 0xc9, 0xdf, 0xa5, 0xf1, 0x86, - 0xf0, 0x28, 0x56, 0xa6, 0x37, 0x2d, 0x84, 0x77, 0x46, 0xe8, 0xaf, 0xd9, 0xaf, 0xff, 0x2f, 0x00, - 0x00, 0xff, 0xff, 0xd3, 0x82, 0x69, 0x58, 0x09, 0x27, 0x00, 0x00, + 0x15, 0x76, 0x8f, 0x7f, 0x62, 0x97, 0x37, 0xce, 0x6e, 0xc5, 0x89, 0x27, 0x63, 0xc7, 0xe3, 0x74, + 0x12, 0x98, 0x38, 0xc9, 0xb4, 0xed, 0xd5, 0xb2, 0x9b, 0x40, 0x36, 0xf1, 0x8c, 0xe3, 0x64, 0xe4, + 0x6c, 0xe2, 0x6d, 0x3b, 0x01, 0x79, 0x31, 0x9d, 0x76, 0x77, 0x31, 0x6e, 0xdc, 0xd3, 0xd5, 0xee, + 0xea, 0x99, 0x64, 0x14, 0xe5, 0xb0, 0x20, 0xa1, 0x5d, 0x0e, 0x28, 0x08, 0x21, 0x71, 0xdc, 0x0b, + 0x12, 0x07, 0x4e, 0x68, 0x05, 0xe2, 0xb6, 0xc7, 0xbd, 0xb1, 0xec, 0x5e, 0x10, 0x48, 0x01, 0x25, + 0x1c, 0x10, 0x12, 0x12, 0x5a, 0xb8, 0x22, 0xa1, 0xae, 0xae, 0xfe, 0x9d, 0x1e, 0x4f, 0xcf, 0x8c, + 0x0f, 0xdc, 0xdc, 0x55, 0xaf, 0xbe, 0x7a, 0xef, 0xd5, 0xab, 0x57, 0xef, 0x7d, 0x63, 0x20, 0x68, + 0x86, 0x8d, 0x2c, 0x65, 0x57, 0xd6, 0x0c, 0x89, 0x20, 0xa5, 0x6e, 0x69, 0x76, 0x53, 0x50, 0x94, + 0x86, 0x60, 0x5a, 0xb8, 0xa1, 0xa9, 0xc8, 0x12, 0x1a, 0x8b, 0xc2, 0x7e, 0x1d, 0x59, 0xcd, 0xa2, + 0x69, 0x61, 0x1b, 0xc3, 0xb3, 0x09, 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 0x7b, 0xc3, 0x53, 0xf1, 0x80, 0x0d, 0x82, 0x75, 0x1a, 0x8c, 0x29, 0xba, 0x86, 0x0c, 0x3b, + 0x08, 0xd5, 0x51, 0x77, 0xa0, 0xa2, 0xc2, 0xe3, 0x60, 0xd8, 0xc6, 0xa6, 0x74, 0x37, 0x3b, 0x38, + 0xc7, 0x15, 0x8e, 0x8a, 0x43, 0x36, 0x36, 0xef, 0xc2, 0x79, 0x00, 0x6b, 0x9a, 0x21, 0x99, 0xf8, + 0x91, 0x13, 0xdf, 0x86, 0xe4, 0x4a, 0x0c, 0xcd, 0x71, 0x85, 0x41, 0x71, 0xa2, 0xa6, 0x19, 0xeb, + 0xce, 0x44, 0xc5, 0xd8, 0x74, 0x64, 0x17, 0xc0, 0x64, 0x43, 0xd6, 0x35, 0x55, 0xb6, 0xb1, 0x45, + 0xd8, 0x12, 0x45, 0x36, 0xb3, 0xc3, 0x14, 0x0f, 0x06, 0x73, 0x74, 0x51, 0x59, 0x36, 0xe1, 0x3c, + 0x78, 0xcd, 0x1f, 0x95, 0x08, 0xb2, 0xa9, 0xf8, 0x08, 0x15, 0x3f, 0xe6, 0x4f, 0x6c, 0x20, 0xdb, + 0x91, 0x9d, 0x01, 0x63, 0xb2, 0xae, 0xe3, 0x47, 0xba, 0x46, 0xec, 0xec, 0x91, 0xb9, 0xc1, 0xc2, + 0x98, 0x18, 0x0c, 0xc0, 0x1c, 0x18, 0x55, 0x91, 0xd1, 0xa4, 0x93, 0xa3, 0x74, 0xd2, 0xff, 0xe6, + 0x7f, 0xc5, 0x81, 0x33, 0xf4, 0x8c, 0x1e, 0x78, 0x90, 0xa1, 0x20, 0xb0, 0x52, 0xde, 0xf3, 0x6b, + 0xe0, 0x55, 0xef, 0x48, 0x24, 0x59, 0x55, 0x2d, 0x44, 0x88, 0xeb, 0xc1, 0x12, 0xfc, 0xf2, 0x79, + 0x7e, 0xa2, 0x29, 0xd7, 0xf4, 0xab, 0x3c, 0x9b, 0xe0, 0x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, 0x08, 0xa5, 0x09, 0x33, 0x22, 0xc2, 0xff, 0x87, 0x03, 0x67, + 0x3a, 0xae, 0x82, 0xab, 0xed, 0x6e, 0x79, 0x69, 0xfa, 0xcb, 0xe7, 0xf9, 0x29, 0x37, 0xeb, 0xc4, + 0x25, 0x12, 0xd2, 0xef, 0x6a, 0xdb, 0xec, 0x15, 0xc2, 0x89, 0x4b, 0x24, 0xa4, 0xb1, 0xeb, 0xe0, + 0x15, 0x5f, 0x6a, 0x0f, 0x35, 0xd9, 0x6d, 0x9d, 0x29, 0x06, 0x15, 0x6a, 0xd1, 0xad, 0x50, 0x8b, + 0xeb, 0xf5, 0x1d, 0x5d, 0x53, 0xd6, 0x50, 0x53, 0xf4, 0x0f, 0x6c, 0x0d, 0x35, 0xf9, 0x49, 0x00, + 0xdd, 0x4b, 0x20, 0x5b, 0x72, 0x70, 0x05, 0x1f, 0x82, 0xe3, 0x91, 0x51, 0x76, 0x2c, 0x15, 0x30, + 0x62, 0xd2, 0x11, 0x56, 0x2d, 0x5c, 0x4c, 0x79, 0x16, 0xce, 0x12, 0x76, 0x03, 0x18, 0x00, 0xaf, + 0xb3, 0x94, 0x10, 0x89, 0x80, 0x7b, 0xa6, 0x8d, 0xd4, 0x8a, 0xe1, 0x27, 0xda, 0x43, 0xab, 0x79, + 0xf7, 0x59, 0x4a, 0xe9, 0xb4, 0x9b, 0x5f, 0x68, 0x9e, 0x0e, 0x17, 0x0e, 0xb1, 0xe3, 0x44, 0x5e, + 0xa6, 0x99, 0x0e, 0x55, 0x10, 0xd1, 0xf3, 0x45, 0x84, 0x7f, 0x08, 0x66, 0x23, 0x5b, 0x1e, 0xbe, + 0x51, 0x3f, 0x39, 0x02, 0xe6, 0xda, 0x6c, 0xe1, 0xff, 0x95, 0x58, 0x26, 0x70, 0xe9, 0xcb, 0x84, + 0x78, 0x7c, 0x65, 0xba, 0x8c, 0x2f, 0x98, 0x05, 0xc3, 0xb4, 0xf0, 0xa2, 0x91, 0x39, 0x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17, 0xb3, 0xdc, 0x67, 0x2f, 0x66, 0xb9, 0xbf, 0xbe, 0x98, 0xe5, 0x9e, 0xbd, 0x9c, + 0x1d, 0xf8, 0xec, 0xe5, 0xec, 0xc0, 0x1f, 0x5f, 0xce, 0x0e, 0x6c, 0x5d, 0xab, 0x6a, 0xf6, 0x6e, + 0x7d, 0xa7, 0xa8, 0xe0, 0x1a, 0xfb, 0x27, 0xad, 0xd0, 0x2e, 0x97, 0xfd, 0x5d, 0x1a, 0x6f, 0x08, + 0x8f, 0x63, 0x65, 0x7a, 0xd3, 0x44, 0x64, 0x67, 0x84, 0xfe, 0x10, 0xfe, 0xfa, 0xff, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x69, 0x3e, 0x82, 0x9f, 0x44, 0x27, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3886,12 +3889,12 @@ func (m *QueryConsumerValidatorsValidator) MarshalToSizedBuffer(dAtA []byte) (in dAtA[i] = 0 } i-- - dAtA[i] = 0x68 + dAtA[i] = 0x70 } if m.ProviderPower != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ProviderPower)) i-- - dAtA[i] = 0x60 + dAtA[i] = 0x68 } { size := m.ProviderTokens.Size() @@ -3902,11 +3905,11 @@ func (m *QueryConsumerValidatorsValidator) MarshalToSizedBuffer(dAtA []byte) (in i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x5a + dAtA[i] = 0x62 if m.Status != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Status)) i-- - dAtA[i] = 0x50 + dAtA[i] = 0x58 } if m.Jailed { i-- @@ -3916,14 +3919,14 @@ func (m *QueryConsumerValidatorsValidator) MarshalToSizedBuffer(dAtA []byte) (in dAtA[i] = 0 } i-- - dAtA[i] = 0x48 + dAtA[i] = 0x50 } if len(m.ProviderOperatorAddress) > 0 { i -= len(m.ProviderOperatorAddress) copy(dAtA[i:], m.ProviderOperatorAddress) i = encodeVarintQuery(dAtA, i, uint64(len(m.ProviderOperatorAddress))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x4a } { size, err := m.Description.MarshalToSizedBuffer(dAtA[:i]) @@ -3934,7 +3937,7 @@ func (m *QueryConsumerValidatorsValidator) MarshalToSizedBuffer(dAtA []byte) (in i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 { size := m.ProviderCommissionRate.Size() i -= size @@ -3944,7 +3947,7 @@ func (m *QueryConsumerValidatorsValidator) MarshalToSizedBuffer(dAtA []byte) (in i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a { size := m.ConsumerCommissionRate.Size() i -= size @@ -3954,12 +3957,22 @@ func (m *QueryConsumerValidatorsValidator) MarshalToSizedBuffer(dAtA []byte) (in i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 if m.ConsumerPower != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ConsumerPower)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 + } + { + 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] = 0x22 if m.Power != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Power)) i-- @@ -4723,6 +4736,8 @@ func (m *QueryConsumerValidatorsValidator) Size() (n int) { if m.Power != 0 { n += 1 + sovQuery(uint64(m.Power)) } + l = m.Rate.Size() + n += 1 + l + sovQuery(uint64(l)) if m.ConsumerPower != 0 { n += 1 + sovQuery(uint64(m.ConsumerPower)) } @@ -7672,6 +7687,40 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { } } case 4: + 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 + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ConsumerPower", wireType) } @@ -7690,7 +7739,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { break } } - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConsumerCommissionRate", wireType) } @@ -7724,7 +7773,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProviderCommissionRate", wireType) } @@ -7758,7 +7807,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } @@ -7791,7 +7840,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProviderOperatorAddress", wireType) } @@ -7823,7 +7872,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { } m.ProviderOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) } @@ -7843,7 +7892,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { } } m.Jailed = bool(v != 0) - case 10: + case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } @@ -7862,7 +7911,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { break } } - case 11: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProviderTokens", wireType) } @@ -7896,7 +7945,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 12: + case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ProviderPower", wireType) } @@ -7915,7 +7964,7 @@ func (m *QueryConsumerValidatorsValidator) Unmarshal(dAtA []byte) error { break } } - case 13: + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatesCurrentEpoch", wireType) }