From ac7e1b99660a1f16794279d3b8a398c980b8c0c7 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Tue, 12 Sep 2023 14:49:17 +0200 Subject: [PATCH 01/36] feat: store chain in proposal --- x/ccv/provider/keeper/gov_hook.go | 82 +++++++++++++++++++++++++++++++ x/ccv/provider/keeper/keeper.go | 43 ++++++++++++++++ x/ccv/provider/types/keys.go | 7 +++ x/ccv/provider/types/keys_test.go | 1 + 4 files changed, 133 insertions(+) create mode 100644 x/ccv/provider/keeper/gov_hook.go diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go new file mode 100644 index 0000000000..1707ab8d69 --- /dev/null +++ b/x/ccv/provider/keeper/gov_hook.go @@ -0,0 +1,82 @@ +package keeper + +import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + sdkgov "github.com/cosmos/cosmos-sdk/x/gov/types" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + + "github.com/cosmos/gogoproto/proto" + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" +) + +type GovHooks struct { + gk govkeeper.Keeper + k *Keeper +} + +// Implements GovHooks interface +// GovHooks exist in cosmos-sdk/x/gov/keeper/hooks.go of v0.45.16-lsm-ics and on +var _ sdkgov.GovHooks = GovHooks{} + +func (k *Keeper) Hooks() Hooks { + return Hooks{k} +} + +// AfterProposalSubmission - call hook if registered +// After consumerAddition proposal submission, the consumer chainID is stored +func (gh GovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64) { + p, ok := gh.gk.GetProposal(ctx, proposalID) + if !ok { + panic(fmt.Errorf("failed to get proposal %d in gov hook", proposalID)) + } + msgs := p.GetMessages() + + var msgLegacyContent v1.MsgExecLegacyContent + err := proto.Unmarshal(msgs[0].Value, &msgLegacyContent) + if err != nil { + panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) + } + + // if the proposal is not ConsumerAdditionProposal, return + var consadditionProp types.ConsumerAdditionProposal + if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consadditionProp); err != nil { + return + } + + if consadditionProp.ProposalType() == types.ProposalTypeConsumerRemoval { + gh.k.SetChainsInProposal(ctx, consadditionProp.ChainId, proposalID) + } +} + +// AfterProposalVotingPeriodEnded - call hook if registered +// After proposal voting ends, the consumer chainID in store is deleted. +// When a proposal passes, this chainID will be available in providerKeeper.GetAllPendingConsumerAdditionProps +// or providerKeeper.GetAllConsumerChains(ctx). +func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID uint64) { + p, ok := gh.gk.GetProposal(ctx, proposalID) + if !ok { + panic(fmt.Errorf("failed to get proposal %d in gov hook", proposalID)) + } + msgs := p.GetMessages() + + var msgLegacyContent v1.MsgExecLegacyContent + err := proto.Unmarshal(msgs[0].Value, &msgLegacyContent) + if err != nil { + panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) + } + var consadditionProp types.ConsumerAdditionProposal + + // if the proposal is not ConsumerAdditionProposal, return + if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consadditionProp); err != nil { + return + } + + gh.k.DeleteChainsInProposal(ctx, consadditionProp.ChainId) +} + +func (gh GovHooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) { +} +func (gh GovHooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) {} +func (gh GovHooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64) {} diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index bebef70c56..619ef348fa 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -178,6 +178,49 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { store.Delete(types.ChainToChannelKey(chainID)) } +// GetChainsInProposal gets chainId in gov proposal before voting finishes +func (k Keeper) GetChainsInProposal(ctx sdk.Context, chainID string) (string, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ChainInProposalKey(chainID)) + if bz == nil { + return "", false + } + + return string(bz), true +} + +// SetChainsInProposal sets consumer chainId in gov consumerAddition proposal in store +// the consumer chainId is only added when the voting period for consumerAddition proposal +// does not end. +func (k Keeper) SetChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ChainInProposalKey(chainID), sdk.Uint64ToBigEndian(proposalID)) +} + +// DeleteChainsInProposal deletes the consumer chainID from store +// which is in gov consumerAddition proposal +func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ChainInProposalKey(chainID)) +} + +// GetAllChainsInProposal get consumer chainId in gov consumerAddition proposal before +// voting period ends. +func (k Keeper) GetAllChainsInProposal(ctx sdk.Context) []string { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, []byte{types.ChainInProposalByteKey}) + defer iterator.Close() + + chainIDs := []string{} + for ; iterator.Valid(); iterator.Next() { + // remove 1 byte prefix from key to retrieve chainID + chainID := string(iterator.Key()[1:]) + chainIDs = append(chainIDs, chainID) + } + + return chainIDs +} + // GetAllConsumerChains gets all of the consumer chains, for which the provider module // created IBC clients. Consumer chains with created clients are also referred to as registered. // diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index ee4c11015b..4281a7ddb9 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -138,6 +138,8 @@ const ( // handled in the current block VSCMaturedHandledThisBlockBytePrefix + // ChainInProposalByteKey is the byte prefix storing the consumer chainId in consumerAddition gov proposal submitted before voting finishes + ChainInProposalByteKey // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO getAllKeyPrefixes() IN keys_test.go ) @@ -414,6 +416,11 @@ func ChainIdWithLenKey(prefix byte, chainID string) []byte { ) } +// ChainInProposalKey returns the consumer chainId in consumerAddition gov proposal submitted before voting finishes +func ChainInProposalKey(chainID string) []byte { + return append([]byte{ChainInProposalByteKey}, []byte(chainID)...) +} + // ParseChainIdAndTsKey returns the chain ID and time for a ChainIdAndTs key func ParseChainIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { expectedPrefix := []byte{prefix} diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 9f470f4a82..d4842a0df2 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -54,6 +54,7 @@ func getAllKeyPrefixes() []byte { providertypes.ConsumerAddrsToPruneBytePrefix, providertypes.SlashLogBytePrefix, providertypes.VSCMaturedHandledThisBlockBytePrefix, + providertypes.ChainInProposalByteKey, } } From 0eea51597b0f8465f27898e26fe6e76af27dea7d Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Tue, 12 Sep 2023 15:49:41 +0200 Subject: [PATCH 02/36] add govHook --- x/ccv/provider/keeper/gov_hook.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index 1707ab8d69..091b922baf 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -20,8 +20,11 @@ type GovHooks struct { // GovHooks exist in cosmos-sdk/x/gov/keeper/hooks.go of v0.45.16-lsm-ics and on var _ sdkgov.GovHooks = GovHooks{} -func (k *Keeper) Hooks() Hooks { - return Hooks{k} +func (k *Keeper) GovHooks(gk govkeeper.Keeper) GovHooks { + return GovHooks{ + gk: gk, + k: k, + } } // AfterProposalSubmission - call hook if registered From a79f384208dbc90e17dbb272b6fc5cbfb4ff2528 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 14 Sep 2023 13:18:43 +0200 Subject: [PATCH 03/36] delete GetChainsInProposal --- x/ccv/provider/keeper/gov_hook.go | 5 ++--- x/ccv/provider/keeper/keeper.go | 11 ----------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index 091b922baf..5fd74f7c8a 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -79,7 +79,6 @@ func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID ui gh.k.DeleteChainsInProposal(ctx, consadditionProp.ChainId) } -func (gh GovHooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) { -} +func (gh GovHooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) {} func (gh GovHooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) {} -func (gh GovHooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64) {} +func (gh GovHooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64) {} diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 619ef348fa..ca9f484844 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -178,17 +178,6 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { store.Delete(types.ChainToChannelKey(chainID)) } -// GetChainsInProposal gets chainId in gov proposal before voting finishes -func (k Keeper) GetChainsInProposal(ctx sdk.Context, chainID string) (string, bool) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ChainInProposalKey(chainID)) - if bz == nil { - return "", false - } - - return string(bz), true -} - // SetChainsInProposal sets consumer chainId in gov consumerAddition proposal in store // the consumer chainId is only added when the voting period for consumerAddition proposal // does not end. From 690c61ccd516d645f099576f4bdb21405a392802 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 14 Sep 2023 16:10:26 +0200 Subject: [PATCH 04/36] check proposal type --- x/ccv/provider/keeper/gov_hook.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index 5fd74f7c8a..b423e3bb8e 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -48,7 +48,7 @@ func (gh GovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64) { return } - if consadditionProp.ProposalType() == types.ProposalTypeConsumerRemoval { + if consadditionProp.ProposalType() == types.ProposalTypeConsumerAddition { gh.k.SetChainsInProposal(ctx, consadditionProp.ChainId, proposalID) } } @@ -75,6 +75,9 @@ func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID ui if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consadditionProp); err != nil { return } + if consadditionProp.ProposalType() != types.ProposalTypeConsumerAddition { + return + } gh.k.DeleteChainsInProposal(ctx, consadditionProp.ChainId) } From 658b5f5e3d8f4bb42e64b9773bf223077859ac72 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Fri, 15 Sep 2023 19:33:17 +0200 Subject: [PATCH 05/36] update key --- x/ccv/provider/keeper/gov_hook.go | 56 +++++++++++++++++-------------- x/ccv/provider/keeper/keeper.go | 6 ++-- x/ccv/provider/types/keys.go | 8 +++-- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index b423e3bb8e..a05e1ab657 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -36,20 +36,22 @@ func (gh GovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64) { } msgs := p.GetMessages() - var msgLegacyContent v1.MsgExecLegacyContent - err := proto.Unmarshal(msgs[0].Value, &msgLegacyContent) - if err != nil { - panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) - } + for _, msg := range msgs { + var msgLegacyContent v1.MsgExecLegacyContent + err := proto.Unmarshal(msg.Value, &msgLegacyContent) + if err != nil { + panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) + } - // if the proposal is not ConsumerAdditionProposal, return - var consadditionProp types.ConsumerAdditionProposal - if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consadditionProp); err != nil { - return - } + // if the proposal is not ConsumerAdditionProposal, return + var consAdditionProp types.ConsumerAdditionProposal + if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { + return + } - if consadditionProp.ProposalType() == types.ProposalTypeConsumerAddition { - gh.k.SetChainsInProposal(ctx, consadditionProp.ChainId, proposalID) + if consAdditionProp.ProposalType() == types.ProposalTypeConsumerAddition { + gh.k.SetChainsInProposal(ctx, consAdditionProp.ChainId, proposalID) + } } } @@ -64,22 +66,24 @@ func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID ui } msgs := p.GetMessages() - var msgLegacyContent v1.MsgExecLegacyContent - err := proto.Unmarshal(msgs[0].Value, &msgLegacyContent) - if err != nil { - panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) - } - var consadditionProp types.ConsumerAdditionProposal + for _, msg := range msgs { + var msgLegacyContent v1.MsgExecLegacyContent + err := proto.Unmarshal(msg.Value, &msgLegacyContent) + if err != nil { + panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) + } + var consAdditionProp types.ConsumerAdditionProposal - // if the proposal is not ConsumerAdditionProposal, return - if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consadditionProp); err != nil { - return - } - if consadditionProp.ProposalType() != types.ProposalTypeConsumerAddition { - return - } + // if the proposal is not ConsumerAdditionProposal, return + if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { + return + } + if consAdditionProp.ProposalType() != types.ProposalTypeConsumerAddition { + return + } - gh.k.DeleteChainsInProposal(ctx, consadditionProp.ChainId) + gh.k.DeleteChainsInProposal(ctx, consAdditionProp.ChainId, proposalID) + } } func (gh GovHooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) {} diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index ca9f484844..3b09a161d4 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -183,14 +183,14 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { // does not end. func (k Keeper) SetChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { store := ctx.KVStore(k.storeKey) - store.Set(types.ChainInProposalKey(chainID), sdk.Uint64ToBigEndian(proposalID)) + store.Set(types.ChainInProposalKey(chainID, proposalID), []byte(chainID)) } // DeleteChainsInProposal deletes the consumer chainID from store // which is in gov consumerAddition proposal -func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string) { +func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ChainInProposalKey(chainID)) + store.Delete(types.ChainInProposalKey(chainID, proposalID)) } // GetAllChainsInProposal get consumer chainId in gov consumerAddition proposal before diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 4281a7ddb9..77b8201e3e 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -417,8 +417,12 @@ func ChainIdWithLenKey(prefix byte, chainID string) []byte { } // ChainInProposalKey returns the consumer chainId in consumerAddition gov proposal submitted before voting finishes -func ChainInProposalKey(chainID string) []byte { - return append([]byte{ChainInProposalByteKey}, []byte(chainID)...) +func ChainInProposalKey(chainID string, proposalID uint64) []byte { + return ccvtypes.AppendMany( + []byte{ChainInProposalByteKey}, + []byte(chainID), + sdk.Uint64ToBigEndian(proposalID), + ) } // ParseChainIdAndTsKey returns the chain ID and time for a ChainIdAndTs key From b0a37213c29702467013970c83ef9356381b8e6a Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Tue, 19 Sep 2023 12:12:19 +0200 Subject: [PATCH 06/36] feat: add query proposed chainIDs --- .../ccv/provider/v1/query.proto | 14 + x/ccv/provider/keeper/grpc_query.go | 14 + x/ccv/provider/types/query.pb.go | 506 +++++++++++++++--- x/ccv/provider/types/query.pb.gw.go | 65 +++ 4 files changed, 515 insertions(+), 84 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index b0c1dc2b47..5429840f5e 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -81,6 +81,15 @@ service Query { option (google.api.http).get = "/interchain_security/ccv/provider/registered_consumer_reward_denoms"; } + + // QueryProposedConsumerChainIDs query chainIDs in consumerAdditionProposals + // before voting period finishes, after voting period finishes, this chainID will be removed from the result + rpc QueryProposedConsumerChainIDs( + QueryProposedChainIDsRequest) + returns (QueryProposedChainIDsResponse) { + option (google.api.http).get = + "/interchain_security/ccv/provider/proposed_consumer_chainids"; + } } message QueryConsumerGenesisRequest { string chain_id = 1; } @@ -187,3 +196,8 @@ message QueryRegisteredConsumerRewardDenomsRequest {} message QueryRegisteredConsumerRewardDenomsResponse { repeated string denoms = 1; } + +message QueryProposedChainIDsRequest {} +message QueryProposedChainIDsResponse{ + repeated string proposedChainIDs = 1; +} diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 2b522ea9ef..a0f5a8d30f 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -253,3 +253,17 @@ func (k Keeper) QueryRegisteredConsumerRewardDenoms(goCtx context.Context, req * Denoms: denoms, }, nil } + +func (k Keeper) QueryProposedConsumerChainIDs(goCtx context.Context, req *types.QueryProposedChainIDsRequest) (*types.QueryProposedChainIDsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + chains := k.GetAllChainsInProposal(ctx) + + return &types.QueryProposedChainIDsResponse{ + ProposedChainIDs: chains, + }, nil +} diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 9fc9178e09..da4086a9b1 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1039,6 +1039,86 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) GetDenoms() []string { return nil } +type QueryProposedChainIDsRequest struct { +} + +func (m *QueryProposedChainIDsRequest) Reset() { *m = QueryProposedChainIDsRequest{} } +func (m *QueryProposedChainIDsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposedChainIDsRequest) ProtoMessage() {} +func (*QueryProposedChainIDsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{21} +} +func (m *QueryProposedChainIDsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposedChainIDsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposedChainIDsRequest.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 *QueryProposedChainIDsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposedChainIDsRequest.Merge(m, src) +} +func (m *QueryProposedChainIDsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposedChainIDsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposedChainIDsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposedChainIDsRequest proto.InternalMessageInfo + +type QueryProposedChainIDsResponse struct { + ProposedChainIDs []string `protobuf:"bytes,1,rep,name=proposedChainIDs,proto3" json:"proposedChainIDs,omitempty"` +} + +func (m *QueryProposedChainIDsResponse) Reset() { *m = QueryProposedChainIDsResponse{} } +func (m *QueryProposedChainIDsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposedChainIDsResponse) ProtoMessage() {} +func (*QueryProposedChainIDsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{22} +} +func (m *QueryProposedChainIDsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposedChainIDsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposedChainIDsResponse.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 *QueryProposedChainIDsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposedChainIDsResponse.Merge(m, src) +} +func (m *QueryProposedChainIDsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposedChainIDsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposedChainIDsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposedChainIDsResponse proto.InternalMessageInfo + +func (m *QueryProposedChainIDsResponse) GetProposedChainIDs() []string { + if m != nil { + return m.ProposedChainIDs + } + return nil +} + func init() { proto.RegisterType((*QueryConsumerGenesisRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisRequest") proto.RegisterType((*QueryConsumerGenesisResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisResponse") @@ -1061,6 +1141,8 @@ func init() { proto.RegisterType((*ThrottledPacketDataWrapper)(nil), "interchain_security.ccv.provider.v1.ThrottledPacketDataWrapper") proto.RegisterType((*QueryRegisteredConsumerRewardDenomsRequest)(nil), "interchain_security.ccv.provider.v1.QueryRegisteredConsumerRewardDenomsRequest") proto.RegisterType((*QueryRegisteredConsumerRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.QueryRegisteredConsumerRewardDenomsResponse") + proto.RegisterType((*QueryProposedChainIDsRequest)(nil), "interchain_security.ccv.provider.v1.QueryProposedChainIDsRequest") + proto.RegisterType((*QueryProposedChainIDsResponse)(nil), "interchain_security.ccv.provider.v1.QueryProposedChainIDsResponse") } func init() { @@ -1068,90 +1150,95 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1323 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, - 0x1f, 0xf5, 0x3a, 0x69, 0x9a, 0x4c, 0xfa, 0xfd, 0xb6, 0x4c, 0x4b, 0x71, 0xb7, 0x95, 0x5d, 0xb6, - 0x02, 0xd2, 0x16, 0x76, 0x1b, 0x57, 0x48, 0x6d, 0x21, 0x75, 0xed, 0x24, 0xa4, 0x51, 0x1b, 0x35, - 0xac, 0xab, 0x56, 0x02, 0xd4, 0x65, 0xb2, 0x3b, 0xd8, 0x2b, 0xd6, 0x3b, 0xdb, 0x99, 0xb1, 0xd3, - 0x80, 0x38, 0x00, 0x12, 0xf4, 0x58, 0x09, 0x71, 0xe3, 0xd0, 0x13, 0xff, 0x05, 0xf7, 0xde, 0xa8, - 0xe8, 0xa5, 0xa7, 0x82, 0x12, 0x0e, 0x1c, 0x11, 0x77, 0x24, 0xb4, 0xb3, 0xb3, 0xfe, 0x11, 0x6f, - 0xec, 0xb5, 0x9b, 0x9b, 0x3d, 0x3b, 0x9f, 0xf7, 0x79, 0xef, 0xe9, 0x33, 0xb3, 0x6f, 0x81, 0xe1, - 0xfa, 0x1c, 0x53, 0xbb, 0x8e, 0x5c, 0xdf, 0x62, 0xd8, 0x6e, 0x52, 0x97, 0x6f, 0x19, 0xb6, 0xdd, - 0x32, 0x02, 0x4a, 0x5a, 0xae, 0x83, 0xa9, 0xd1, 0x9a, 0x37, 0xee, 0x37, 0x31, 0xdd, 0xd2, 0x03, - 0x4a, 0x38, 0x81, 0x67, 0x12, 0x0a, 0x74, 0xdb, 0x6e, 0xe9, 0x71, 0x81, 0xde, 0x9a, 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3b, 0xaf, 0x3c, 0xdd, 0xce, 0x2b, 0x7f, 0x6c, 0xe7, 0x95, 0x47, 0x3b, - 0xf9, 0xcc, 0xd3, 0x9d, 0x7c, 0xe6, 0xf9, 0x4e, 0x3e, 0xf3, 0xd1, 0x42, 0xcd, 0xe5, 0xf5, 0xe6, - 0x86, 0x6e, 0x93, 0x86, 0x61, 0x13, 0xd6, 0x20, 0xac, 0xab, 0xdf, 0x3b, 0xed, 0x7e, 0xad, 0x8b, - 0xc6, 0x83, 0x5d, 0xf3, 0xb7, 0x15, 0x60, 0xb6, 0x31, 0x25, 0xbe, 0x56, 0x2e, 0xfe, 0x17, 0x00, - 0x00, 0xff, 0xff, 0x84, 0xab, 0xda, 0x7b, 0x39, 0x13, 0x00, 0x00, + // 1393 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xc1, 0x6f, 0x13, 0xc7, + 0x17, 0xf6, 0x26, 0x21, 0x24, 0x13, 0x7e, 0x3f, 0xd0, 0x84, 0x52, 0xb3, 0x50, 0x9b, 0x2e, 0x6a, + 0x1b, 0xa0, 0xf5, 0x12, 0xa3, 0x4a, 0x40, 0x09, 0x21, 0x4e, 0xd2, 0x10, 0x01, 0x22, 0xdd, 0x20, + 0x90, 0xda, 0x8a, 0xed, 0x64, 0x77, 0xea, 0xac, 0xba, 0xde, 0x59, 0x66, 0xc6, 0x0e, 0x69, 0xd5, + 0x43, 0x5b, 0xa9, 0x45, 0xea, 0x05, 0xa9, 0xea, 0x9d, 0x53, 0xff, 0x8b, 0xde, 0xb9, 0x15, 0x95, + 0x0b, 0x27, 0x5a, 0x85, 0x1e, 0x7a, 0xe8, 0xa1, 0xea, 0xbd, 0x52, 0xb5, 0x33, 0xb3, 0x6b, 0x3b, + 0x5e, 0xdb, 0x6b, 0x93, 0x9b, 0x3d, 0x33, 0xef, 0x7b, 0xdf, 0xf7, 0xf4, 0xe6, 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 0xf3, 0x7a, 0x49, 0x4e, 0xfc, 0x52, 0x3c, 0xf1, 0x4b, 0xb7, 0xe2, 0x89, 0x5f, 0x99, 0x88, + 0x66, 0xd8, 0xc3, 0xdf, 0x8a, 0x9a, 0x75, 0x24, 0x42, 0xb1, 0x62, 0x90, 0xc5, 0x18, 0x03, 0xae, + 0x83, 0xfd, 0x21, 0x72, 0x3e, 0xc3, 0x9c, 0xe5, 0xc7, 0xc4, 0x54, 0xba, 0x90, 0xe9, 0x0a, 0xc5, + 0x15, 0x70, 0xd7, 0x23, 0xce, 0x6b, 0x02, 0xc1, 0x8a, 0x91, 0x8c, 0x25, 0x75, 0x89, 0x93, 0x53, + 0x71, 0xc7, 0xc9, 0x83, 0x4b, 0x88, 0xa3, 0x0c, 0x13, 0xfe, 0xd7, 0x78, 0x80, 0xf5, 0x84, 0x51, + 0xc5, 0xef, 0xd1, 0x6d, 0x10, 0x8c, 0x31, 0xef, 0x73, 0x59, 0xe5, 0x31, 0x4b, 0xfc, 0x86, 0x5b, + 0x60, 0x3a, 0x4c, 0x40, 0x56, 0x03, 0xc6, 0xa3, 0x62, 0xb3, 0xfc, 0xa8, 0x28, 0xc1, 0xfc, 0x60, + 0x25, 0x68, 0xb2, 0xb9, 0x43, 0x51, 0x18, 0x62, 0xaa, 0x9e, 0x8e, 0xb4, 0x0c, 0xc6, 0xcf, 0x1a, + 0x38, 0x9c, 0x56, 0x3c, 0x78, 0x17, 0x1c, 0xa8, 0xfa, 0x64, 0x03, 0xf9, 0x36, 0x0e, 0x38, 0xdd, + 0x56, 0x03, 0xed, 0xdd, 0x4c, 0x54, 0x56, 0x44, 0xa0, 0x40, 0x5b, 0x8e, 0x82, 0x15, 0x81, 0x29, + 0x09, 0x28, 0x96, 0xe0, 0x32, 0x18, 0x73, 0x11, 0x47, 0xa2, 0x0a, 0x53, 0xe5, 0x33, 0xbd, 0x9e, + 0xc1, 0x16, 0x5a, 0x11, 0x79, 0x85, 0x26, 0xc2, 0x8d, 0x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7, 0xfe, 0x8e, 0x16, 0x95, 0x14, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1191,6 +1278,9 @@ type QueryClient interface { // QueryRegisteredConsumerRewardDenoms returns a list of consumer reward // denoms that are registered QueryRegisteredConsumerRewardDenoms(ctx context.Context, in *QueryRegisteredConsumerRewardDenomsRequest, opts ...grpc.CallOption) (*QueryRegisteredConsumerRewardDenomsResponse, error) + // QueryProposedConsumerChainIDs query chainIDs in consumerAdditionProposals + // before voting period finishes, after voting period finish, this chainID will be removed from the result + QueryProposedConsumerChainIDs(ctx context.Context, in *QueryProposedChainIDsRequest, opts ...grpc.CallOption) (*QueryProposedChainIDsResponse, error) } type queryClient struct { @@ -1282,6 +1372,15 @@ func (c *queryClient) QueryRegisteredConsumerRewardDenoms(ctx context.Context, i return out, nil } +func (c *queryClient) QueryProposedConsumerChainIDs(ctx context.Context, in *QueryProposedChainIDsRequest, opts ...grpc.CallOption) (*QueryProposedChainIDsResponse, error) { + out := new(QueryProposedChainIDsResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryProposedConsumerChainIDs", 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 @@ -1309,6 +1408,9 @@ type QueryServer interface { // QueryRegisteredConsumerRewardDenoms returns a list of consumer reward // denoms that are registered QueryRegisteredConsumerRewardDenoms(context.Context, *QueryRegisteredConsumerRewardDenomsRequest) (*QueryRegisteredConsumerRewardDenomsResponse, error) + // QueryProposedConsumerChainIDs query chainIDs in consumerAdditionProposals + // before voting period finishes, after voting period finish, this chainID will be removed from the result + QueryProposedConsumerChainIDs(context.Context, *QueryProposedChainIDsRequest) (*QueryProposedChainIDsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1342,6 +1444,9 @@ func (*UnimplementedQueryServer) QueryThrottledConsumerPacketData(ctx context.Co func (*UnimplementedQueryServer) QueryRegisteredConsumerRewardDenoms(ctx context.Context, req *QueryRegisteredConsumerRewardDenomsRequest) (*QueryRegisteredConsumerRewardDenomsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryRegisteredConsumerRewardDenoms not implemented") } +func (*UnimplementedQueryServer) QueryProposedConsumerChainIDs(ctx context.Context, req *QueryProposedChainIDsRequest) (*QueryProposedChainIDsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryProposedConsumerChainIDs not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1509,6 +1614,24 @@ func _Query_QueryRegisteredConsumerRewardDenoms_Handler(srv interface{}, ctx con return interceptor(ctx, in, info, handler) } +func _Query_QueryProposedConsumerChainIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposedChainIDsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryProposedConsumerChainIDs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryProposedConsumerChainIDs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryProposedConsumerChainIDs(ctx, req.(*QueryProposedChainIDsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.provider.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1549,6 +1672,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryRegisteredConsumerRewardDenoms", Handler: _Query_QueryRegisteredConsumerRewardDenoms_Handler, }, + { + MethodName: "QueryProposedConsumerChainIDs", + Handler: _Query_QueryProposedConsumerChainIDs_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/query.proto", @@ -2293,6 +2420,61 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) MarshalToSizedBuffer(dAtA return len(dAtA) - i, nil } +func (m *QueryProposedChainIDsRequest) 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 *QueryProposedChainIDsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposedChainIDsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryProposedChainIDsResponse) 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 *QueryProposedChainIDsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposedChainIDsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProposedChainIDs) > 0 { + for iNdEx := len(m.ProposedChainIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ProposedChainIDs[iNdEx]) + copy(dAtA[i:], m.ProposedChainIDs[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProposedChainIDs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2613,6 +2795,30 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) Size() (n int) { return n } +func (m *QueryProposedChainIDsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryProposedChainIDsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ProposedChainIDs) > 0 { + for _, s := range m.ProposedChainIDs { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4486,6 +4692,138 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) Unmarshal(dAtA []byte) err } return nil } +func (m *QueryProposedChainIDsRequest) 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: QueryProposedChainIDsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposedChainIDsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryProposedChainIDsResponse) 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: QueryProposedChainIDsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposedChainIDsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposedChainIDs", 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.ProposedChainIDs = append(m.ProposedChainIDs, 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 6a249ca2a2..7cdd5e2525 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -285,6 +285,24 @@ func local_request_Query_QueryRegisteredConsumerRewardDenoms_0(ctx context.Conte } +func request_Query_QueryProposedConsumerChainIDs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposedChainIDsRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryProposedConsumerChainIDs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryProposedConsumerChainIDs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposedChainIDsRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryProposedConsumerChainIDs(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. @@ -498,6 +516,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryProposedConsumerChainIDs_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_QueryProposedConsumerChainIDs_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_QueryProposedConsumerChainIDs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -719,6 +760,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryProposedConsumerChainIDs_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_QueryProposedConsumerChainIDs_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_QueryProposedConsumerChainIDs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -740,6 +801,8 @@ var ( pattern_Query_QueryThrottledConsumerPacketData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "pending_consumer_packets"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryRegisteredConsumerRewardDenoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "registered_consumer_reward_denoms"}, "", runtime.AssumeColonVerbOpt(false))) + + 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_chainids"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -760,4 +823,6 @@ var ( forward_Query_QueryThrottledConsumerPacketData_0 = runtime.ForwardResponseMessage forward_Query_QueryRegisteredConsumerRewardDenoms_0 = runtime.ForwardResponseMessage + + forward_Query_QueryProposedConsumerChainIDs_0 = runtime.ForwardResponseMessage ) From fbb74fcc0d75562c20ee914da278813c08406ef4 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Tue, 19 Sep 2023 13:49:30 +0200 Subject: [PATCH 07/36] feat: set govhook --- app/provider/app.go | 9 +++++++-- x/ccv/provider/keeper/gov_hook.go | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/provider/app.go b/app/provider/app.go index ef3f6508f7..1f9e984d87 100644 --- a/app/provider/app.go +++ b/app/provider/app.go @@ -442,7 +442,7 @@ func New( AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) govConfig := govtypes.DefaultConfig() - app.GovKeeper = *govkeeper.NewKeeper( + govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.AccountKeeper, @@ -454,7 +454,12 @@ func New( ) // Set legacy router for backwards compatibility with gov v1beta1 - app.GovKeeper.SetLegacyRouter(govRouter) + govKeeper.SetLegacyRouter(govRouter) + + govHook := app.ProviderKeeper.GovHooks(govKeeper) + app.GovKeeper = *govKeeper.SetHooks( + govtypes.NewMultiGovHooks(govHook), + ) app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index a05e1ab657..1b7a45ff1d 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -12,7 +12,7 @@ import ( ) type GovHooks struct { - gk govkeeper.Keeper + gk *govkeeper.Keeper k *Keeper } @@ -20,7 +20,7 @@ type GovHooks struct { // GovHooks exist in cosmos-sdk/x/gov/keeper/hooks.go of v0.45.16-lsm-ics and on var _ sdkgov.GovHooks = GovHooks{} -func (k *Keeper) GovHooks(gk govkeeper.Keeper) GovHooks { +func (k *Keeper) GovHooks(gk *govkeeper.Keeper) GovHooks { return GovHooks{ gk: gk, k: k, From b61bd855fb601dbc2e1a7e0b6695262e22ebb519 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Tue, 19 Sep 2023 14:39:50 +0200 Subject: [PATCH 08/36] feat: parse key --- .../ccv/provider/v1/query.proto | 9 +- x/ccv/provider/keeper/grpc_query.go | 2 +- x/ccv/provider/keeper/keeper.go | 19 +- x/ccv/provider/types/keys.go | 35 +- x/ccv/provider/types/query.pb.go | 422 +++++++++++++----- 5 files changed, 365 insertions(+), 122 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 5429840f5e..552976266a 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -198,6 +198,13 @@ message QueryRegisteredConsumerRewardDenomsResponse { } message QueryProposedChainIDsRequest {} + message QueryProposedChainIDsResponse{ - repeated string proposedChainIDs = 1; + repeated ProposedChain proposedChains = 1 + [ (gogoproto.nullable) = false ]; +} + +message ProposedChain { + string chainID = 1; + uint64 proposalID = 2; } diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index a0f5a8d30f..45f30f7a3a 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -264,6 +264,6 @@ func (k Keeper) QueryProposedConsumerChainIDs(goCtx context.Context, req *types. chains := k.GetAllChainsInProposal(ctx) return &types.QueryProposedChainIDsResponse{ - ProposedChainIDs: chains, + ProposedChains: chains, }, nil } diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 3b09a161d4..fbe210313a 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -195,19 +195,26 @@ func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string, proposal // GetAllChainsInProposal get consumer chainId in gov consumerAddition proposal before // voting period ends. -func (k Keeper) GetAllChainsInProposal(ctx sdk.Context) []string { +func (k Keeper) GetAllChainsInProposal(ctx sdk.Context) []types.ProposedChain { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte{types.ChainInProposalByteKey}) defer iterator.Close() - chainIDs := []string{} + proposedChains := []types.ProposedChain{} for ; iterator.Valid(); iterator.Next() { - // remove 1 byte prefix from key to retrieve chainID - chainID := string(iterator.Key()[1:]) - chainIDs = append(chainIDs, chainID) + chainID, proposalID, err := types.ParseChainInProposalKey(types.ChainInProposalByteKey, iterator.Key()) + if err != nil { + panic(fmt.Errorf("proposed chains cannot be parsed: %w", err)) + } + + proposedChains = append(proposedChains, types.ProposedChain{ + ChainID: chainID, + ProposalID: proposalID, + }) + } - return chainIDs + return proposedChains } // GetAllConsumerChains gets all of the consumer chains, for which the provider module diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 77b8201e3e..5b9799073a 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -7,7 +7,6 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) @@ -416,15 +415,6 @@ func ChainIdWithLenKey(prefix byte, chainID string) []byte { ) } -// ChainInProposalKey returns the consumer chainId in consumerAddition gov proposal submitted before voting finishes -func ChainInProposalKey(chainID string, proposalID uint64) []byte { - return ccvtypes.AppendMany( - []byte{ChainInProposalByteKey}, - []byte(chainID), - sdk.Uint64ToBigEndian(proposalID), - ) -} - // ParseChainIdAndTsKey returns the chain ID and time for a ChainIdAndTs key func ParseChainIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { expectedPrefix := []byte{prefix} @@ -495,6 +485,31 @@ func VSCMaturedHandledThisBlockKey() []byte { return []byte{VSCMaturedHandledThisBlockBytePrefix} } +// ChainInProposalKey returns the consumer chainId in consumerAddition gov proposal submitted before voting finishes +func ChainInProposalKey(chainID string, proposalID uint64) []byte { + chainIdL := len(chainID) + return ccvtypes.AppendMany( + []byte{ChainInProposalByteKey}, + sdk.Uint64ToBigEndian(uint64(chainIdL)), + []byte(chainID), + sdk.Uint64ToBigEndian(proposalID), + ) +} + + +func ParseChainInProposalKey(prefix byte, bz []byte) (string, uint64, error) { + expectedPrefix := []byte{prefix} + prefixL := len(expectedPrefix) + if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { + return "", 0, 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)]) + proposalID := sdk.BigEndianToUint64(bz[prefixL+8+int(chainIdL):]) + + return chainID, proposalID, nil +} + // // End of generic helpers section // diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index da4086a9b1..ed953ff820 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1076,7 +1076,7 @@ func (m *QueryProposedChainIDsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryProposedChainIDsRequest proto.InternalMessageInfo type QueryProposedChainIDsResponse struct { - ProposedChainIDs []string `protobuf:"bytes,1,rep,name=proposedChainIDs,proto3" json:"proposedChainIDs,omitempty"` + ProposedChains []ProposedChain `protobuf:"bytes,1,rep,name=proposedChains,proto3" json:"proposedChains"` } func (m *QueryProposedChainIDsResponse) Reset() { *m = QueryProposedChainIDsResponse{} } @@ -1112,13 +1112,65 @@ func (m *QueryProposedChainIDsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryProposedChainIDsResponse proto.InternalMessageInfo -func (m *QueryProposedChainIDsResponse) GetProposedChainIDs() []string { +func (m *QueryProposedChainIDsResponse) GetProposedChains() []ProposedChain { if m != nil { - return m.ProposedChainIDs + return m.ProposedChains } return nil } +type ProposedChain struct { + ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` + ProposalID uint64 `protobuf:"varint,2,opt,name=proposalID,proto3" json:"proposalID,omitempty"` +} + +func (m *ProposedChain) Reset() { *m = ProposedChain{} } +func (m *ProposedChain) String() string { return proto.CompactTextString(m) } +func (*ProposedChain) ProtoMessage() {} +func (*ProposedChain) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{23} +} +func (m *ProposedChain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposedChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposedChain.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 *ProposedChain) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposedChain.Merge(m, src) +} +func (m *ProposedChain) XXX_Size() int { + return m.Size() +} +func (m *ProposedChain) XXX_DiscardUnknown() { + xxx_messageInfo_ProposedChain.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposedChain proto.InternalMessageInfo + +func (m *ProposedChain) GetChainID() string { + if m != nil { + return m.ChainID + } + return "" +} + +func (m *ProposedChain) GetProposalID() uint64 { + if m != nil { + return m.ProposalID + } + return 0 +} + func init() { proto.RegisterType((*QueryConsumerGenesisRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisRequest") proto.RegisterType((*QueryConsumerGenesisResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisResponse") @@ -1143,6 +1195,7 @@ func init() { proto.RegisterType((*QueryRegisteredConsumerRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.QueryRegisteredConsumerRewardDenomsResponse") proto.RegisterType((*QueryProposedChainIDsRequest)(nil), "interchain_security.ccv.provider.v1.QueryProposedChainIDsRequest") proto.RegisterType((*QueryProposedChainIDsResponse)(nil), "interchain_security.ccv.provider.v1.QueryProposedChainIDsResponse") + proto.RegisterType((*ProposedChain)(nil), "interchain_security.ccv.provider.v1.ProposedChain") } func init() { @@ -1150,95 +1203,97 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1393 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xc1, 0x6f, 0x13, 0xc7, - 0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4b, 0xfc, 0x86, 0x5b, - 0x60, 0x3a, 0x4c, 0x40, 0x56, 0x03, 0xc6, 0xa3, 0x62, 0xb3, 0xfc, 0xa8, 0x28, 0xc1, 0xfc, 0x60, - 0x25, 0x68, 0xb2, 0xb9, 0x43, 0x51, 0x18, 0x62, 0xaa, 0x9e, 0x8e, 0xb4, 0x0c, 0xc6, 0xcf, 0x1a, - 0x38, 0x9c, 0x56, 0x3c, 0x78, 0x17, 0x1c, 0xa8, 0xfa, 0x64, 0x03, 0xf9, 0x36, 0x0e, 0x38, 0xdd, - 0x56, 0x03, 0xed, 0xdd, 0x4c, 0x54, 0x56, 0x44, 0xa0, 0x40, 0x5b, 0x8e, 0x82, 0x15, 0x81, 0x29, - 0x09, 0x28, 0x96, 0xe0, 0x32, 0x18, 0x73, 0x11, 0x47, 0xa2, 0x0a, 0x53, 0xe5, 0x33, 0xbd, 0x9e, - 0xc1, 0x16, 0x5a, 0x11, 0x79, 0x85, 0x26, 0xc2, 0x8d, 0x67, 0x1a, 0xd0, 0xbb, 0x2b, 0x87, 0x6b, - 0xe0, 0x80, 0x6c, 0x71, 0xa9, 0x5d, 0xa9, 0x18, 0x24, 0xdb, 0xd5, 0x9c, 0x25, 0xaf, 0x91, 0xaa, - 0xcb, 0x27, 0x00, 0x36, 0x98, 0x63, 0xd7, 0x10, 0xaf, 0x47, 0x36, 0x43, 0xe1, 0x4a, 0x15, 0x67, - 0x7b, 0xe1, 0xde, 0x5e, 0x5f, 0xbc, 0x21, 0x83, 0xda, 0xc0, 0x0f, 0x35, 0x98, 0xd3, 0xb6, 0x5e, - 0x19, 0x97, 0x95, 0x31, 0xde, 0x06, 0xa7, 0x45, 0xbb, 0x59, 0xb8, 0xea, 0x31, 0x8e, 0x69, 0xb3, - 0xdf, 0x2c, 0xbc, 0x85, 0xa8, 0xbb, 0x84, 0x03, 0x52, 0x4b, 0x5e, 0xaa, 0x65, 0x70, 0x26, 0xd3, - 0x69, 0xd5, 0x9f, 0x47, 0xc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0xd1, 0xc5, 0x50, - 0xe9, 0x95, 0x97, 0x81, 0x50, 0xaa, 0x97, 0x84, 0xea, 0xcb, 0xf0, 0x52, 0x86, 0x26, 0x50, 0x18, - 0x76, 0xfb, 0x40, 0xf7, 0x5c, 0x56, 0xb9, 0xf3, 0x78, 0xa7, 0xa0, 0x3d, 0xd9, 0x29, 0x68, 0xbf, - 0xef, 0x14, 0xb4, 0x87, 0x2f, 0x0a, 0xb9, 0x27, 0x2f, 0x0a, 0xb9, 0x67, 0x2f, 0x0a, 0xb9, 0x0f, - 0xe7, 0xaa, 0x1e, 0xdf, 0xac, 0x6f, 0x94, 0x1c, 0x52, 0x33, 0x1d, 0xc2, 0x6a, 0x84, 0xb5, 0x24, - 0x7a, 0x27, 0x49, 0xd4, 0x38, 0x67, 0xde, 0xdf, 0x75, 0xdd, 0xb6, 0x43, 0xcc, 0x36, 0xc6, 0xc5, - 0x97, 0xe0, 0xb9, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xfe, 0x8e, 0x16, 0x95, 0x14, 0x00, - 0x00, + // 1429 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x13, 0xc7, + 0x17, 0xf7, 0x26, 0x21, 0x24, 0x2f, 0xfc, 0xd2, 0x84, 0x2f, 0x5f, 0xb3, 0x50, 0x9b, 0x2e, 0x6a, + 0x1b, 0xa0, 0xf5, 0x12, 0xa3, 0x4a, 0x40, 0x09, 0x21, 0x8e, 0xd3, 0x60, 0x01, 0x22, 0xdd, 0x20, + 0x90, 0xda, 0x8a, 0x65, 0xb2, 0x3b, 0x75, 0x56, 0x5d, 0xef, 0x2e, 0x3b, 0x63, 0x87, 0xb4, 0xea, + 0x81, 0x56, 0x6a, 0x91, 0x7a, 0x41, 0xaa, 0x7a, 0xe7, 0xd4, 0xff, 0xa2, 0x77, 0x6e, 0x45, 0xe5,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6e, 0xe5, 0x94, 0x67, + 0x5b, 0x39, 0xe5, 0xf7, 0xad, 0x9c, 0xf2, 0xf8, 0x55, 0x2e, 0xf3, 0xec, 0x55, 0x2e, 0xf3, 0xe2, + 0x55, 0x2e, 0xf3, 0xf1, 0x5c, 0xd5, 0x61, 0xeb, 0xf5, 0xb5, 0x82, 0xe5, 0xd7, 0x74, 0xcb, 0xa7, + 0x35, 0x9f, 0xb6, 0x15, 0x7a, 0xaf, 0x59, 0xa8, 0x71, 0x4e, 0x7f, 0xb0, 0xed, 0xb8, 0x6d, 0x06, + 0x84, 0xae, 0x8d, 0xf3, 0xdf, 0xa2, 0xe7, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x03, 0x9f, + 0xc2, 0x17, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1279,7 +1334,7 @@ type QueryClient interface { // denoms that are registered QueryRegisteredConsumerRewardDenoms(ctx context.Context, in *QueryRegisteredConsumerRewardDenomsRequest, opts ...grpc.CallOption) (*QueryRegisteredConsumerRewardDenomsResponse, error) // QueryProposedConsumerChainIDs query chainIDs in consumerAdditionProposals - // before voting period finishes, after voting period finish, this chainID will be removed from the result + // before voting period finishes, after voting period finishes, this chainID will be removed from the result QueryProposedConsumerChainIDs(ctx context.Context, in *QueryProposedChainIDsRequest, opts ...grpc.CallOption) (*QueryProposedChainIDsResponse, error) } @@ -1409,7 +1464,7 @@ type QueryServer interface { // denoms that are registered QueryRegisteredConsumerRewardDenoms(context.Context, *QueryRegisteredConsumerRewardDenomsRequest) (*QueryRegisteredConsumerRewardDenomsResponse, error) // QueryProposedConsumerChainIDs query chainIDs in consumerAdditionProposals - // before voting period finishes, after voting period finish, this chainID will be removed from the result + // before voting period finishes, after voting period finishes, this chainID will be removed from the result QueryProposedConsumerChainIDs(context.Context, *QueryProposedChainIDsRequest) (*QueryProposedChainIDsResponse, error) } @@ -2463,11 +2518,16 @@ func (m *QueryProposedChainIDsResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - if len(m.ProposedChainIDs) > 0 { - for iNdEx := len(m.ProposedChainIDs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ProposedChainIDs[iNdEx]) - copy(dAtA[i:], m.ProposedChainIDs[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ProposedChainIDs[iNdEx]))) + if len(m.ProposedChains) > 0 { + for iNdEx := len(m.ProposedChains) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProposedChains[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } @@ -2475,6 +2535,41 @@ func (m *QueryProposedChainIDsResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *ProposedChain) 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 *ProposedChain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposedChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalID != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalID)) + i-- + dAtA[i] = 0x10 + } + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2810,15 +2905,31 @@ func (m *QueryProposedChainIDsResponse) Size() (n int) { } var l int _ = l - if len(m.ProposedChainIDs) > 0 { - for _, s := range m.ProposedChainIDs { - l = len(s) + if len(m.ProposedChains) > 0 { + for _, e := range m.ProposedChains { + l = e.Size() n += 1 + l + sovQuery(uint64(l)) } } return n } +func (m *ProposedChain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ProposalID != 0 { + n += 1 + sovQuery(uint64(m.ProposalID)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4773,7 +4884,91 @@ func (m *QueryProposedChainIDsResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposedChainIDs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProposedChains", 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 + } + m.ProposedChains = append(m.ProposedChains, ProposedChain{}) + if err := m.ProposedChains[len(m.ProposedChains)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposedChain) 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: ProposedChain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposedChain: 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 { @@ -4801,8 +4996,27 @@ func (m *QueryProposedChainIDsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProposedChainIDs = append(m.ProposedChainIDs, 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 ProposalID", wireType) + } + m.ProposalID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) From d13c124b64d55cc19caa03c1bb76791f02963835 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Tue, 19 Sep 2023 14:44:07 +0200 Subject: [PATCH 09/36] refactor: names --- x/ccv/provider/keeper/grpc_query.go | 2 +- x/ccv/provider/keeper/keeper.go | 9 ++++----- x/ccv/provider/types/keys.go | 8 ++++---- x/ccv/provider/types/keys_test.go | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 45f30f7a3a..93837df229 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -261,7 +261,7 @@ func (k Keeper) QueryProposedConsumerChainIDs(goCtx context.Context, req *types. ctx := sdk.UnwrapSDKContext(goCtx) - chains := k.GetAllChainsInProposal(ctx) + chains := k.GetAllProposedConsumerChainIDs(ctx) return &types.QueryProposedChainIDsResponse{ ProposedChains: chains, diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index fbe210313a..01c908e4b9 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -193,16 +193,15 @@ func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string, proposal store.Delete(types.ChainInProposalKey(chainID, proposalID)) } -// GetAllChainsInProposal get consumer chainId in gov consumerAddition proposal before -// voting period ends. -func (k Keeper) GetAllChainsInProposal(ctx sdk.Context) []types.ProposedChain { +// GetAllProposedConsumerChainIDs get consumer chainId in gov consumerAddition proposal before voting period ends. +func (k Keeper) GetAllProposedConsumerChainIDs(ctx sdk.Context) []types.ProposedChain { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, []byte{types.ChainInProposalByteKey}) + iterator := sdk.KVStorePrefixIterator(store, []byte{types.ProposedConsumerChainByteKey}) defer iterator.Close() proposedChains := []types.ProposedChain{} for ; iterator.Valid(); iterator.Next() { - chainID, proposalID, err := types.ParseChainInProposalKey(types.ChainInProposalByteKey, iterator.Key()) + chainID, proposalID, err := types.ParseProposedConsumerChainKey(types.ProposedConsumerChainByteKey, iterator.Key()) if err != nil { panic(fmt.Errorf("proposed chains cannot be parsed: %w", err)) } diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 5b9799073a..393546f04e 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -137,8 +137,8 @@ const ( // handled in the current block VSCMaturedHandledThisBlockBytePrefix - // ChainInProposalByteKey is the byte prefix storing the consumer chainId in consumerAddition gov proposal submitted before voting finishes - ChainInProposalByteKey + // ProposedConsumerChainByteKey is the byte prefix storing the consumer chainId in consumerAddition gov proposal submitted before voting finishes + ProposedConsumerChainByteKey // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO getAllKeyPrefixes() IN keys_test.go ) @@ -489,7 +489,7 @@ func VSCMaturedHandledThisBlockKey() []byte { func ChainInProposalKey(chainID string, proposalID uint64) []byte { chainIdL := len(chainID) return ccvtypes.AppendMany( - []byte{ChainInProposalByteKey}, + []byte{ProposedConsumerChainByteKey}, sdk.Uint64ToBigEndian(uint64(chainIdL)), []byte(chainID), sdk.Uint64ToBigEndian(proposalID), @@ -497,7 +497,7 @@ func ChainInProposalKey(chainID string, proposalID uint64) []byte { } -func ParseChainInProposalKey(prefix byte, bz []byte) (string, uint64, error) { +func ParseProposedConsumerChainKey(prefix byte, bz []byte) (string, uint64, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index d4842a0df2..d08ea3a7bb 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -54,7 +54,7 @@ func getAllKeyPrefixes() []byte { providertypes.ConsumerAddrsToPruneBytePrefix, providertypes.SlashLogBytePrefix, providertypes.VSCMaturedHandledThisBlockBytePrefix, - providertypes.ChainInProposalByteKey, + providertypes.ProposedConsumerChainByteKey, } } From 1c6d099bcba43c6e89688ca9f0d4d29e63564a9a Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Wed, 20 Sep 2023 15:03:51 +0200 Subject: [PATCH 10/36] feat: add list proposed consumer chains --- x/ccv/provider/client/cli/query.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index 1240e242f0..b1cbb2d9ef 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -33,6 +33,7 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand(CmdThrottleState()) cmd.AddCommand(CmdThrottledConsumerPacketData()) cmd.AddCommand(CmdRegisteredConsumerRewardDenoms()) + cmd.AddCommand(CmdProposedConsumerChains()) return cmd } @@ -93,6 +94,33 @@ func CmdConsumerChains() *cobra.Command { return cmd } +func CmdProposedConsumerChains() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-proposed-consumer-chains", + Short: "Query chainIDs in consumer addition proposal before voting finishes", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryProposedChainIDsRequest{} + res, err := queryClient.QueryProposedConsumerChainIDs(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + func CmdConsumerStartProposals() *cobra.Command { cmd := &cobra.Command{ Use: "list-start-proposals", From 2f007f57daee7876f630beaae19277fb97e92451 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Wed, 20 Sep 2023 16:00:34 +0200 Subject: [PATCH 11/36] test: add e2e test --- tests/e2e/state.go | 28 ++++++++++++++++++++++++++++ tests/e2e/steps_start_chains.go | 3 +++ 2 files changed, 31 insertions(+) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 8cc343ef00..a77e053016 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -19,6 +19,7 @@ type State map[chainID]ChainState type ChainState struct { ValBalances *map[validatorID]uint Proposals *map[uint]Proposal + ProposedConsumerChains []string ValPowers *map[validatorID]uint RepresentativePowers *map[validatorID]uint Params *[]Param @@ -132,6 +133,11 @@ func (tr TestRun) getChainState(chain chainID, modelState ChainState) ChainState chainState.Proposals = &proposals } + if modelState.ProposedConsumerChains != nil { + proposedConsumerChains := tr.getProposedConsumerChains(chain) + chainState.ProposedConsumerChains = proposedConsumerChains + } + if modelState.ValPowers != nil { tr.waitBlocks(chain, 1, 10*time.Second) powers := tr.getValPowers(chain, *modelState.ValPowers) @@ -772,3 +778,25 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) { verbosity := false executeCommandWithVerbosity(cmd, "curlJsonRPCRequest", verbosity) } + + +func (tr TestRun) getProposedConsumerChains(chain chainID) []string { + bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + + "query", "provider", "list-proposed-consumer-chains", + `--node`, tr.getQueryNode(chain), + `-o`, `json`, + ).CombinedOutput() + if err != nil { + log.Fatal(err, "\n", string(bz)) + } + + arr := gjson.Get(string(bz), "proposedChains").Array() + chains := []string{} + for _, c := range arr { + cid := c.Get("chainID").String() + chains = append(chains, cid) + } + + return chains +} diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go index 6017a22641..e014b76fc1 100644 --- a/tests/e2e/steps_start_chains.go +++ b/tests/e2e/steps_start_chains.go @@ -22,6 +22,7 @@ func stepStartProviderChain() []Step { validatorID("bob"): 9500000000, validatorID("carol"): 9500000000, }, + ProposedConsumerChains: []string{}, }, }, }, @@ -54,6 +55,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Status: "PROPOSAL_STATUS_VOTING_PERIOD", }, }, + ProposedConsumerChains: []string{consumerName}, }, }, }, @@ -133,6 +135,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Status: "PROPOSAL_STATUS_PASSED", }, }, + ProposedConsumerChains: []string{}, ValBalances: &map[validatorID]uint{ validatorID("alice"): 9500000000, validatorID("bob"): 9500000000, From 27daf3ac7789a58259d052b46ee23051161821fb Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Wed, 20 Sep 2023 18:19:32 +0200 Subject: [PATCH 12/36] add e2e test --- tests/e2e/state.go | 10 +++++----- tests/e2e/steps_start_chains.go | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index c23e0d35e3..a517cd40ef 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -19,7 +19,7 @@ type State map[ChainID]ChainState type ChainState struct { ValBalances *map[ValidatorID]uint Proposals *map[uint]Proposal - ProposedConsumerChains []string + ProposedConsumerChains *[]string ValPowers *map[ValidatorID]uint RepresentativePowers *map[ValidatorID]uint Params *[]Param @@ -135,7 +135,7 @@ func (tr TestRun) getChainState(chain ChainID, modelState ChainState) ChainState if modelState.ProposedConsumerChains != nil { proposedConsumerChains := tr.getProposedConsumerChains(chain) - chainState.ProposedConsumerChains = proposedConsumerChains + chainState.ProposedConsumerChains = &proposedConsumerChains } if modelState.ValPowers != nil { @@ -780,9 +780,9 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) { } -func (tr TestRun) getProposedConsumerChains(chain chainID) []string { - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, - +func (tr TestRun) getProposedConsumerChains(chain ChainID) []string { + tr.waitBlocks(chain, 1, 10*time.Second) + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "provider", "list-proposed-consumer-chains", `--node`, tr.getQueryNode(chain), `-o`, `json`, diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go index 253a0afb53..ec75b71abc 100644 --- a/tests/e2e/steps_start_chains.go +++ b/tests/e2e/steps_start_chains.go @@ -22,7 +22,6 @@ func stepStartProviderChain() []Step { ValidatorID("bob"): 9500000000, ValidatorID("carol"): 9500000000, }, - ProposedConsumerChains: []string{}, }, }, }, @@ -55,7 +54,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Status: "PROPOSAL_STATUS_VOTING_PERIOD", }, }, - ProposedConsumerChains: []string{consumerName}, + ProposedConsumerChains: &[]string{consumerName}, }, }, }, @@ -135,10 +134,9 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Status: "PROPOSAL_STATUS_PASSED", }, }, - ProposedConsumerChains: []string{}, - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9500000000, - validatorID("bob"): 9500000000, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9500000000, + ValidatorID("bob"): 9500000000, }, }, }, From 114db150d54db0700ee16cbae2868ca03dbf39eb Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Wed, 20 Sep 2023 18:34:12 +0200 Subject: [PATCH 13/36] update comments --- x/ccv/provider/types/keys.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 393546f04e..35c02f3335 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -485,7 +485,7 @@ func VSCMaturedHandledThisBlockKey() []byte { return []byte{VSCMaturedHandledThisBlockBytePrefix} } -// ChainInProposalKey returns the consumer chainId in consumerAddition gov proposal submitted before voting finishes +// ChainInProposalKey returns the key of proposed consumer chainId in consumerAddition gov proposal before voting finishes, the stored key format is prefix|len(chainID)|chainID|proposalID func ChainInProposalKey(chainID string, proposalID uint64) []byte { chainIdL := len(chainID) return ccvtypes.AppendMany( From 74b7d9134524dc29493ab2363710a98383779b85 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 11:02:46 +0200 Subject: [PATCH 14/36] update ProposeConsumerChains in e2e test --- tests/e2e/steps_start_chains.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go index ec75b71abc..53ee31f32b 100644 --- a/tests/e2e/steps_start_chains.go +++ b/tests/e2e/steps_start_chains.go @@ -54,7 +54,6 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Status: "PROPOSAL_STATUS_VOTING_PERIOD", }, }, - ProposedConsumerChains: &[]string{consumerName}, }, }, }, @@ -138,6 +137,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint ValidatorID("alice"): 9500000000, ValidatorID("bob"): 9500000000, }, + ProposedConsumerChains: &[]string{consumerName}, }, }, }, From 8db40a8eec5cc545b7d33e5aa63fea7fec75eb8a Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 11:20:21 +0200 Subject: [PATCH 15/36] remove wait for block --- tests/e2e/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index a517cd40ef..a1324aaef6 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -781,7 +781,7 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) { func (tr TestRun) getProposedConsumerChains(chain ChainID) []string { - tr.waitBlocks(chain, 1, 10*time.Second) + //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "provider", "list-proposed-consumer-chains", `--node`, tr.getQueryNode(chain), From 5a2642077189d2b816ae65286427dfdbda5066fe Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 11:31:10 +0200 Subject: [PATCH 16/36] docs: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29b6328e94..2b0b9d84b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Add an entry to the unreleased provider section whenever merging a PR to main th * (deps) [#1258](https://github.com/cosmos/interchain-security/pull/1258) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.4). * (deps!) [#1196](https://github.com/cosmos/interchain-security/pull/1196) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.2.0](https://github.com/cosmos/ibc-go/releases/tag/v7.2.0). * `[x/ccv/provider]` (fix) [#1076](https://github.com/cosmos/interchain-security/pull/1076) Add `InitTimeoutTimestamps` and `ExportedVscSendTimestamps` to exported genesis. +* (feature) [#1282](https://github.com/cosmos/interchain-security/issues/1282) In the `ConsumerAdditionProposal`, consumer chainIDs proposed before the voting period finishes are now stored in the state. The gRPC query `/interchain_security/ccv/provider/proposed_consumer_chainids` and CLI command `query provider proposed-consumer-chains` can be used to retrieve this information. ## [Unreleased for Consumer] From 956b4cc9a34edac806665243ff4af996dbbd604d Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 12:28:40 +0200 Subject: [PATCH 17/36] fix: lint --- x/ccv/provider/keeper/gov_hook.go | 9 ++++++--- x/ccv/provider/keeper/keeper.go | 2 +- x/ccv/provider/types/keys.go | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index 1b7a45ff1d..dcb02683b3 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -2,12 +2,14 @@ package keeper import ( "fmt" + + "github.com/cosmos/gogoproto/proto" + sdk "github.com/cosmos/cosmos-sdk/types" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" sdkgov "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/gogoproto/proto" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) @@ -86,6 +88,7 @@ func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID ui } } -func (gh GovHooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) {} +func (gh GovHooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) { +} func (gh GovHooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) {} -func (gh GovHooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64) {} +func (gh GovHooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64) {} diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index a0b5ba2dbc..7e01fef383 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -207,7 +207,7 @@ func (k Keeper) GetAllProposedConsumerChainIDs(ctx sdk.Context) []types.Proposed } proposedChains = append(proposedChains, types.ProposedChain{ - ChainID: chainID, + ChainID: chainID, ProposalID: proposalID, }) diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 35c02f3335..de441aad9a 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -7,6 +7,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) @@ -496,7 +497,6 @@ func ChainInProposalKey(chainID string, proposalID uint64) []byte { ) } - func ParseProposedConsumerChainKey(prefix byte, bz []byte) (string, uint64, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) @@ -505,7 +505,7 @@ func ParseProposedConsumerChainKey(prefix byte, bz []byte) (string, uint64, erro } chainIdL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) chainID := string(bz[prefixL+8 : prefixL+8+int(chainIdL)]) - proposalID := sdk.BigEndianToUint64(bz[prefixL+8+int(chainIdL):]) + proposalID := sdk.BigEndianToUint64(bz[prefixL+8+int(chainIdL):]) return chainID, proposalID, nil } From f1933617affdee348978e5b120481322c9a36285 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 12:38:19 +0200 Subject: [PATCH 18/36] add TestParseProposedConsumerChainKey --- x/ccv/provider/keeper/keeper.go | 4 ++-- x/ccv/provider/types/keys.go | 4 ++-- x/ccv/provider/types/keys_test.go | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 7e01fef383..7984bfe6ab 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -183,14 +183,14 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { // does not end. func (k Keeper) SetChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { store := ctx.KVStore(k.storeKey) - store.Set(types.ChainInProposalKey(chainID, proposalID), []byte(chainID)) + store.Set(types.ProposedConsumerChainKey(chainID, proposalID), []byte(chainID)) } // DeleteChainsInProposal deletes the consumer chainID from store // which is in gov consumerAddition proposal func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ChainInProposalKey(chainID, proposalID)) + store.Delete(types.ProposedConsumerChainKey(chainID, proposalID)) } // GetAllProposedConsumerChainIDs get consumer chainId in gov consumerAddition proposal before voting period ends. diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index de441aad9a..caddfff5fe 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -486,8 +486,8 @@ func VSCMaturedHandledThisBlockKey() []byte { return []byte{VSCMaturedHandledThisBlockBytePrefix} } -// ChainInProposalKey returns the key of proposed consumer chainId in consumerAddition gov proposal before voting finishes, the stored key format is prefix|len(chainID)|chainID|proposalID -func ChainInProposalKey(chainID string, proposalID uint64) []byte { +// ProposedConsumerChainKey returns the key of proposed consumer chainId in consumerAddition gov proposal before voting finishes, the stored key format is prefix|len(chainID)|chainID|proposalID +func ProposedConsumerChainKey(chainID string, proposalID uint64) []byte { chainIdL := len(chainID) return ccvtypes.AppendMany( []byte{ProposedConsumerChainByteKey}, diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index d08ea3a7bb..e137817daa 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -310,3 +310,24 @@ func TestKeysWithUint64Payload(t *testing.T) { } } } + +func TestParseProposedConsumerChainKey(t *testing.T) { + tests := []struct { + prefix byte + chainID string + proposalID uint64 + }{ + {chainID: "1", proposalID: 1}, + {chainID: "some other ID", proposalID: 12}, + {chainID: "some other other chain ID", proposalID: 123}, + } + + for _, test := range tests { + key := providertypes.ProposedConsumerChainKey(test.chainID, test.proposalID) + cID, pID, err := providertypes.ParseProposedConsumerChainKey( + providertypes.ProposedConsumerChainByteKey, key) + require.NoError(t, err) + require.Equal(t, cID, test.chainID) + require.Equal(t, pID, test.proposalID) + } +} From c2cb5291584974d80ba432539440cb10320eb3a7 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 17:15:56 +0200 Subject: [PATCH 19/36] refactor gov hook --- x/ccv/provider/keeper/gov_hook.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index dcb02683b3..d8e73586d6 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -45,10 +45,14 @@ func (gh GovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64) { panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) } - // if the proposal is not ConsumerAdditionProposal, return + // if the proposal is not ConsumerAdditionProposal, continue + if msgLegacyContent.Content.TypeUrl != "/interchain_security.ccv.provider.v1.ConsumerAdditionProposal" { + continue + } + // if the proposal is not ConsumerAdditionProposal, continue var consAdditionProp types.ConsumerAdditionProposal if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { - return + continue } if consAdditionProp.ProposalType() == types.ProposalTypeConsumerAddition { @@ -74,17 +78,20 @@ func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID ui if err != nil { panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) } - var consAdditionProp types.ConsumerAdditionProposal + if msgLegacyContent.Content.TypeUrl != "/interchain_security.ccv.provider.v1.ConsumerAdditionProposal" { + continue + } + var consAdditionProp types.ConsumerAdditionProposal // if the proposal is not ConsumerAdditionProposal, return if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { - return + continue } - if consAdditionProp.ProposalType() != types.ProposalTypeConsumerAddition { - return + + if consAdditionProp.ProposalType() == types.ProposalTypeConsumerAddition { + gh.k.DeleteChainsInProposal(ctx, consAdditionProp.ChainId, proposalID) } - gh.k.DeleteChainsInProposal(ctx, consAdditionProp.ChainId, proposalID) } } From 8253ee714de7f1bb9d94bf79c838f54580ec6ccd Mon Sep 17 00:00:00 2001 From: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Date: Thu, 21 Sep 2023 17:41:52 +0200 Subject: [PATCH 20/36] Update proto/interchain_security/ccv/provider/v1/query.proto Co-authored-by: MSalopek --- proto/interchain_security/ccv/provider/v1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 5292fe4982..3c03a45b8e 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -88,7 +88,7 @@ service Query { QueryProposedChainIDsRequest) returns (QueryProposedChainIDsResponse) { option (google.api.http).get = - "/interchain_security/ccv/provider/proposed_consumer_chainids"; + "/interchain_security/ccv/provider/proposed_consumer_chains"; } } From f0c591e1de52f1b9c5094eaae434c4c7db0dc949 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 17:58:51 +0200 Subject: [PATCH 21/36] update proto --- x/ccv/provider/types/query.pb.go | 179 ++++++++++++++-------------- x/ccv/provider/types/query.pb.gw.go | 2 +- 2 files changed, 90 insertions(+), 91 deletions(-) diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 63df47cbbe..229bb7c7e0 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1203,97 +1203,96 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1427 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x13, 0x47, - 0x14, 0xf6, 0x3a, 0x21, 0x24, 0x2f, 0xfc, 0xd2, 0x84, 0x52, 0xb3, 0x50, 0x9b, 0x2e, 0x6a, 0x1b, - 0xa0, 0xf5, 0x12, 0xa3, 0x4a, 0x40, 0x09, 0x21, 0x8e, 0xd3, 0x60, 0x01, 0x22, 0xdd, 0x20, 0x90, - 0xda, 0x8a, 0x65, 0xb2, 0x3b, 0x75, 0x56, 0x5d, 0xef, 0x2e, 0x3b, 0x63, 0x87, 0x14, 0xf5, 0x40, - 0x2b, 0xb5, 0x48, 0xbd, 0x20, 0x55, 0xbd, 0x73, 0xea, 0x7f, 0xd1, 0x3b, 0xb7, 0xa2, 0x72, 0xe1, - 0x44, 0xab, 0xd0, 0x43, 0x0f, 0x3d, 0x54, 0xbd, 0x57, 0xaa, 0x76, 0x76, 0x76, 0xfd, 0x6b, 0x63, - 0xaf, 0x0d, 0x37, 0x7b, 0x66, 0xde, 0xf7, 0xbe, 0xef, 0xe5, 0xcd, 0x9b, 0xcf, 0x01, 0xd5, 0x72, - 0x18, 0xf1, 0x8d, 0x0d, 0x6c, 0x39, 0x3a, 0x25, 0x46, 0xc3, 0xb7, 0xd8, 0x96, 0x6a, 0x18, 0x4d, - 0xd5, 0xf3, 0xdd, 0xa6, 0x65, 0x12, 0x5f, 0x6d, 0xce, 0xa9, 0x77, 0x1b, 0xc4, 0xdf, 0x2a, 0x7a, - 0xbe, 0xcb, 0x5c, 0x74, 0x3c, 0x21, 0xa0, 0x68, 0x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86, 0x67, 0xd8, 0x61, 0x35, 0xe5, 0x4b, 0xa3, 0x03, - 0x08, 0x85, 0xe7, 0xb8, 0xc2, 0x33, 0x68, 0x6e, 0x08, 0x85, 0xa1, 0x09, 0x45, 0x0f, 0xb2, 0x90, - 0xdb, 0xc1, 0x59, 0x52, 0x74, 0x75, 0x44, 0x66, 0x89, 0x26, 0x56, 0xbe, 0xf6, 0x9a, 0xd0, 0x84, - 0xe8, 0xcb, 0x5c, 0x74, 0x19, 0x5d, 0x1a, 0x56, 0x74, 0xf0, 0x5b, 0xc2, 0x67, 0x7a, 0xec, 0x0f, - 0xd1, 0x7f, 0x12, 0xbc, 0x99, 0x6c, 0x54, 0x29, 0xba, 0x32, 0x32, 0xe9, 0x5e, 0x47, 0x2c, 0x5f, - 0x7d, 0x3d, 0x60, 0xa2, 0x00, 0x2b, 0xbc, 0x00, 0x8b, 0x68, 0x61, 0x84, 0x02, 0xb8, 0x5e, 0x9b, - 0xfe, 0x7f, 0x24, 0xe1, 0x85, 0x12, 0x5d, 0x25, 0xfa, 0x38, 0x3d, 0xeb, 0x7e, 0xfe, 0x58, 0x5e, - 0x79, 0x65, 0x1c, 0x21, 0x7c, 0x91, 0x0b, 0xff, 0x08, 0x9d, 0x4b, 0xf1, 0x8b, 0x3d, 0x02, 0xd2, + // 1418 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x13, 0xc7, + 0x17, 0xf7, 0x3a, 0x21, 0x24, 0x2f, 0xfc, 0xd2, 0x84, 0x2f, 0x5f, 0xb3, 0x50, 0x9b, 0x2e, 0x6a, + 0x1b, 0xa0, 0xf5, 0x12, 0xa3, 0x4a, 0x40, 0x1b, 0x42, 0x1c, 0xa7, 0xc1, 0x02, 0x44, 0xba, 0x41, + 0x20, 0xb5, 0x15, 0xcb, 0x64, 0x77, 0xea, 0xac, 0xba, 0xde, 0x5d, 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, + 0x79, 0x38, 0xf6, 0x71, 0xd0, 0x95, 0x25, 0x91, 0xbd, 0x42, 0x1c, 0x42, 0x2d, 0xaa, 0x91, 0x7b, + 0x0d, 0x42, 0x19, 0x3a, 0x0a, 0x93, 0x21, 0x84, 0x65, 0xe6, 0xa4, 0x13, 0xd2, 0xec, 0x94, 0xb6, + 0x97, 0x7f, 0xaf, 0x9a, 0xca, 0x03, 0x38, 0x9e, 0x9c, 0x49, 0x3d, 0xd7, 0xa1, 0x04, 0x7d, 0x0a, + 0xfb, 0x6b, 0xe1, 0x92, 0x4e, 0x19, 0x66, 0x84, 0xe7, 0x4f, 0x97, 0xce, 0x16, 0x77, 0x6a, 0x7c, + 0x73, 0xae, 0xd8, 0x85, 0xb5, 0x16, 0xe4, 0x95, 0xc7, 0x9f, 0xbe, 0x2c, 0x64, 0xb4, 0x7d, 0xb5, + 0xb6, 0x35, 0xe5, 0x38, 0xc8, 0x1d, 0xc5, 0x97, 0x02, 0xb8, 0x88, 0xb5, 0x82, 0xbb, 0x44, 0x45, + 0xbb, 0x82, 0x59, 0x19, 0x26, 0x78, 0x79, 0x9a, 0x93, 0x4e, 0x8c, 0xcd, 0x4e, 0x97, 0x4e, 0x17, + 0x53, 0xcc, 0x42, 0x91, 0x83, 0x68, 0x22, 0x53, 0x39, 0x05, 0xef, 0xf4, 0x96, 0x58, 0x63, 0xd8, + 0x67, 0xab, 0xbe, 0xeb, 0xb9, 0x14, 0xdb, 0x31, 0x9b, 0x47, 0x12, 0xcc, 0x0e, 0x8e, 0x15, 0xdc, + 0x3e, 0x83, 0x29, 0x2f, 0x5a, 0x14, 0x1d, 0xbb, 0x94, 0x8e, 0x9e, 0x00, 0x5f, 0x34, 0x4d, 0x2b, + 0x18, 0xd2, 0x16, 0x74, 0x0b, 0x50, 0x99, 0x85, 0xb7, 0x93, 0x98, 0xb8, 0x5e, 0x0f, 0xe9, 0x6f, + 0xa5, 0x64, 0x81, 0x1d, 0xa1, 0xf1, 0x5f, 0xba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, 0x4f, 0x3d, 0x95, 0x6b, 0x92, 0x57, 0x77, 0x0f, 0x50, 0xb4, 0xe3, + 0x2a, 0x6f, 0xc7, 0x32, 0x5a, 0x1a, 0xdc, 0x0e, 0x3f, 0x46, 0x6c, 0x75, 0xc4, 0xe7, 0x98, 0x7a, + 0xe8, 0xc6, 0xd0, 0x5f, 0x3d, 0x6e, 0xab, 0xfd, 0x4a, 0xad, 0x56, 0x28, 0x1a, 0xc2, 0x5b, 0xec, + 0x60, 0xe9, 0xe4, 0xf2, 0xeb, 0x40, 0x8c, 0x30, 0x04, 0x02, 0x43, 0xef, 0x7a, 0xc6, 0xcb, 0xb7, + 0x9f, 0x6e, 0xe7, 0xa5, 0x67, 0xdb, 0x79, 0xe9, 0xf7, 0xed, 0xbc, 0xf4, 0xf8, 0x55, 0x3e, 0xf3, + 0xec, 0x55, 0x3e, 0xf3, 0xe2, 0x55, 0x3e, 0xf3, 0xc9, 0x7c, 0xcd, 0x62, 0x1b, 0x8d, 0xf5, 0xa2, + 0xe1, 0xd6, 0x55, 0xc3, 0xa5, 0x75, 0x97, 0xb6, 0x95, 0x79, 0x2f, 0x2e, 0xd3, 0x3c, 0xa7, 0xde, + 0xef, 0x3a, 0x6c, 0x5b, 0x1e, 0xa1, 0xeb, 0x13, 0xfc, 0x97, 0xe8, 0xb9, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x1c, 0xfd, 0x42, 0x7e, 0x1d, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ccv/provider/types/query.pb.gw.go b/x/ccv/provider/types/query.pb.gw.go index 7cdd5e2525..c417c4688c 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -802,7 +802,7 @@ var ( pattern_Query_QueryRegisteredConsumerRewardDenoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "registered_consumer_reward_denoms"}, "", runtime.AssumeColonVerbOpt(false))) - 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_chainids"}, "", runtime.AssumeColonVerbOpt(false))) + 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))) ) var ( From 4aa274a3c777c6495c29e098864205c7b09193ab Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 18:00:07 +0200 Subject: [PATCH 22/36] add test for set kv --- x/ccv/provider/keeper/keeper.go | 9 +++++++-- x/ccv/provider/keeper/keeper_test.go | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 7984bfe6ab..226192e926 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -178,14 +178,19 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { store.Delete(types.ChainToChannelKey(chainID)) } -// SetChainsInProposal sets consumer chainId in gov consumerAddition proposal in store +// SetProposedConsumerChain sets consumer chainId in gov consumerAddition proposal in store // the consumer chainId is only added when the voting period for consumerAddition proposal // does not end. -func (k Keeper) SetChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { +func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, chainID string, proposalID uint64) { store := ctx.KVStore(k.storeKey) store.Set(types.ProposedConsumerChainKey(chainID, proposalID), []byte(chainID)) } +func (k Keeper) GetProposedConsumerChains(ctx sdk.Context, chainID string, proposalID uint64) string { + store := ctx.KVStore(k.storeKey) + return string(store.Get(types.ProposedConsumerChainKey(chainID, proposalID))) +} + // DeleteChainsInProposal deletes the consumer chainID from store // which is in gov consumerAddition proposal func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index be3ef4001c..d2c586979d 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -533,3 +533,23 @@ func TestSetSlashLog(t *testing.T) { require.True(t, providerKeeper.GetSlashLog(ctx, addrWithDoubleSigns)) require.False(t, providerKeeper.GetSlashLog(ctx, addrWithoutDoubleSigns)) } + +func TestSetProposedConsumerChains(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + tests := []struct { + chainID string + proposalID uint64 + }{ + {chainID: "1", proposalID: 1}, + {chainID: "some other ID", proposalID: 12}, + {chainID: "some other other chain ID", proposalID: 123}, + } + + for _, test := range tests { + providerKeeper.SetProposedConsumerChain(ctx, test.chainID, test.proposalID) + cID := providerKeeper.GetProposedConsumerChains(ctx, test.chainID, test.proposalID) + require.Equal(t, cID, test.chainID) + } +} From 979b3834b29691f057ed1ac2302d3fc38632b03f Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 18:12:35 +0200 Subject: [PATCH 23/36] refactor key to be prefix_proposalID --- x/ccv/provider/keeper/gov_hook.go | 2 +- x/ccv/provider/keeper/keeper.go | 13 +++++++------ x/ccv/provider/keeper/keeper_test.go | 2 +- x/ccv/provider/types/keys.go | 18 +++++++----------- x/ccv/provider/types/keys_test.go | 6 ++---- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index d8e73586d6..2ba8d7cdce 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -56,7 +56,7 @@ func (gh GovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64) { } if consAdditionProp.ProposalType() == types.ProposalTypeConsumerAddition { - gh.k.SetChainsInProposal(ctx, consAdditionProp.ChainId, proposalID) + gh.k.SetProposedConsumerChain(ctx, consAdditionProp.ChainId, proposalID) } } } diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 226192e926..0f6bdd69a1 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -183,19 +183,20 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { // does not end. func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, chainID string, proposalID uint64) { store := ctx.KVStore(k.storeKey) - store.Set(types.ProposedConsumerChainKey(chainID, proposalID), []byte(chainID)) + store.Set(types.ProposedConsumerChainKey(proposalID), []byte(chainID)) } -func (k Keeper) GetProposedConsumerChains(ctx sdk.Context, chainID string, proposalID uint64) string { +// GetProposedConsumerChain get the proposed chainID in consumerAddition proposal. +func (k Keeper) GetProposedConsumerChain(ctx sdk.Context, proposalID uint64) string { store := ctx.KVStore(k.storeKey) - return string(store.Get(types.ProposedConsumerChainKey(chainID, proposalID))) + return string(store.Get(types.ProposedConsumerChainKey(proposalID))) } // DeleteChainsInProposal deletes the consumer chainID from store // which is in gov consumerAddition proposal func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ProposedConsumerChainKey(chainID, proposalID)) + store.Delete(types.ProposedConsumerChainKey(proposalID)) } // GetAllProposedConsumerChainIDs get consumer chainId in gov consumerAddition proposal before voting period ends. @@ -206,13 +207,13 @@ func (k Keeper) GetAllProposedConsumerChainIDs(ctx sdk.Context) []types.Proposed proposedChains := []types.ProposedChain{} for ; iterator.Valid(); iterator.Next() { - chainID, proposalID, err := types.ParseProposedConsumerChainKey(types.ProposedConsumerChainByteKey, iterator.Key()) + proposalID, err := types.ParseProposedConsumerChainKey(types.ProposedConsumerChainByteKey, iterator.Key()) if err != nil { panic(fmt.Errorf("proposed chains cannot be parsed: %w", err)) } proposedChains = append(proposedChains, types.ProposedChain{ - ChainID: chainID, + ChainID: string(iterator.Value()), ProposalID: proposalID, }) diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index d2c586979d..7ee852abd6 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -549,7 +549,7 @@ func TestSetProposedConsumerChains(t *testing.T) { for _, test := range tests { providerKeeper.SetProposedConsumerChain(ctx, test.chainID, test.proposalID) - cID := providerKeeper.GetProposedConsumerChains(ctx, test.chainID, test.proposalID) + cID := providerKeeper.GetProposedConsumerChain(ctx, test.proposalID) require.Equal(t, cID, test.chainID) } } diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index caddfff5fe..fa0428311c 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -486,28 +486,24 @@ func VSCMaturedHandledThisBlockKey() []byte { return []byte{VSCMaturedHandledThisBlockBytePrefix} } -// ProposedConsumerChainKey returns the key of proposed consumer chainId in consumerAddition gov proposal before voting finishes, the stored key format is prefix|len(chainID)|chainID|proposalID -func ProposedConsumerChainKey(chainID string, proposalID uint64) []byte { - chainIdL := len(chainID) +// ProposedConsumerChainKey returns the key of proposed consumer chainId in consumerAddition gov proposal before voting finishes, the stored key format is prefix|proposalID, value is chainID +func ProposedConsumerChainKey(proposalID uint64) []byte { return ccvtypes.AppendMany( []byte{ProposedConsumerChainByteKey}, - sdk.Uint64ToBigEndian(uint64(chainIdL)), - []byte(chainID), sdk.Uint64ToBigEndian(proposalID), ) } -func ParseProposedConsumerChainKey(prefix byte, bz []byte) (string, uint64, error) { +// ParseProposedConsumerChainKey get the proposalID in the key +func ParseProposedConsumerChainKey(prefix byte, bz []byte) (uint64, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { - return "", 0, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) + return 0, 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)]) - proposalID := sdk.BigEndianToUint64(bz[prefixL+8+int(chainIdL):]) + proposalID := sdk.BigEndianToUint64(bz[prefixL:]) - return chainID, proposalID, nil + return proposalID, nil } // diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index e137817daa..91d793ec97 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -313,7 +313,6 @@ func TestKeysWithUint64Payload(t *testing.T) { func TestParseProposedConsumerChainKey(t *testing.T) { tests := []struct { - prefix byte chainID string proposalID uint64 }{ @@ -323,11 +322,10 @@ func TestParseProposedConsumerChainKey(t *testing.T) { } for _, test := range tests { - key := providertypes.ProposedConsumerChainKey(test.chainID, test.proposalID) - cID, pID, err := providertypes.ParseProposedConsumerChainKey( + key := providertypes.ProposedConsumerChainKey(test.proposalID) + pID, err := providertypes.ParseProposedConsumerChainKey( providertypes.ProposedConsumerChainByteKey, key) require.NoError(t, err) - require.Equal(t, cID, test.chainID) require.Equal(t, pID, test.proposalID) } } From b020e49db4cf0155cd2eaf86f92671e50e354670 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 18:13:13 +0200 Subject: [PATCH 24/36] formatting --- app/provider/app.go | 2 +- tests/e2e/state.go | 1 - x/ccv/provider/keeper/keeper_test.go | 2 +- x/ccv/provider/types/keys_test.go | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/provider/app.go b/app/provider/app.go index b36f9a7093..377bedd10c 100644 --- a/app/provider/app.go +++ b/app/provider/app.go @@ -460,7 +460,7 @@ func New( govHook := app.ProviderKeeper.GovHooks(govKeeper) app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks(govHook), - ) + ) app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, diff --git a/tests/e2e/state.go b/tests/e2e/state.go index a1324aaef6..472d8eef28 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -779,7 +779,6 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) { executeCommandWithVerbosity(cmd, "curlJsonRPCRequest", verbosity) } - func (tr TestRun) getProposedConsumerChains(chain ChainID) []string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 7ee852abd6..12d693d389 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -539,7 +539,7 @@ func TestSetProposedConsumerChains(t *testing.T) { defer ctrl.Finish() tests := []struct { - chainID string + chainID string proposalID uint64 }{ {chainID: "1", proposalID: 1}, diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 91d793ec97..6d32e49178 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -313,7 +313,7 @@ func TestKeysWithUint64Payload(t *testing.T) { func TestParseProposedConsumerChainKey(t *testing.T) { tests := []struct { - chainID string + chainID string proposalID uint64 }{ {chainID: "1", proposalID: 1}, From a90f87ce4a0869d0e85d895d3f024c1847a298ec Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 18:22:35 +0200 Subject: [PATCH 25/36] update e2e test --- tests/e2e/steps_start_chains.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go index 53ee31f32b..5d72149545 100644 --- a/tests/e2e/steps_start_chains.go +++ b/tests/e2e/steps_start_chains.go @@ -164,6 +164,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint ValidatorID("bob"): 9500000000, ValidatorID("carol"): 9500000000, }, + ProposedConsumerChains: &[]string{}, }, ChainID(consumerName): ChainState{ ValBalances: &map[ValidatorID]uint{ From c15976413e29b56649f1a6813559d606ce8137be Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Thu, 21 Sep 2023 18:28:48 +0200 Subject: [PATCH 26/36] format --- proto/interchain_security/ccv/provider/v1/query.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 3c03a45b8e..0136a420e7 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -199,7 +199,7 @@ message QueryRegisteredConsumerRewardDenomsResponse { message QueryProposedChainIDsRequest {} -message QueryProposedChainIDsResponse{ +message QueryProposedChainIDsResponse { repeated ProposedChain proposedChains = 1 [ (gogoproto.nullable) = false ]; } From 1f2f388c25ef74b3400105b96dd60918eeac18b3 Mon Sep 17 00:00:00 2001 From: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:05:48 +0200 Subject: [PATCH 27/36] Update x/ccv/provider/keeper/gov_hook.go Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> --- x/ccv/provider/keeper/gov_hook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index 2ba8d7cdce..8ec4ba0044 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -49,7 +49,7 @@ func (gh GovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64) { if msgLegacyContent.Content.TypeUrl != "/interchain_security.ccv.provider.v1.ConsumerAdditionProposal" { continue } - // if the proposal is not ConsumerAdditionProposal, continue + // if the consumer addition proposal cannot be unmarshaled, continue var consAdditionProp types.ConsumerAdditionProposal if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { continue From 39ca877ba775d7ac6fe69b86dd9573d20f4052d5 Mon Sep 17 00:00:00 2001 From: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:06:17 +0200 Subject: [PATCH 28/36] Update x/ccv/provider/keeper/keeper.go Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> --- x/ccv/provider/keeper/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 0f6bdd69a1..dc1096e84c 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -178,7 +178,7 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { store.Delete(types.ChainToChannelKey(chainID)) } -// SetProposedConsumerChain sets consumer chainId in gov consumerAddition proposal in store +// SetProposedConsumerChain stores a consumer chainId corresponding to a submitted consumer addition proposal // the consumer chainId is only added when the voting period for consumerAddition proposal // does not end. func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, chainID string, proposalID uint64) { From 85d0f33fd9df75032125cc3e8faae1c010eac63f Mon Sep 17 00:00:00 2001 From: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:06:52 +0200 Subject: [PATCH 29/36] Update x/ccv/provider/keeper/keeper.go Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> --- x/ccv/provider/keeper/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index dc1096e84c..92c3eefe4a 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -179,7 +179,7 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { } // SetProposedConsumerChain stores a consumer chainId corresponding to a submitted consumer addition proposal -// the consumer chainId is only added when the voting period for consumerAddition proposal +// This consumer chainId is deleted once the voting period for the proposal ends // does not end. func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, chainID string, proposalID uint64) { store := ctx.KVStore(k.storeKey) From e094e42bd2a819dae06464162f34b3f1eec40c55 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Fri, 22 Sep 2023 12:53:45 +0200 Subject: [PATCH 30/36] fix e2e test --- tests/e2e/state.go | 1 + tests/e2e/steps_start_chains.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 472d8eef28..a43f3adc03 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -781,6 +781,7 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) { func (tr TestRun) getProposedConsumerChains(chain ChainID) []string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. + tr.waitBlocks(chain, 1, 10*time.Second) bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "provider", "list-proposed-consumer-chains", `--node`, tr.getQueryNode(chain), diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go index 5d72149545..58a5f75162 100644 --- a/tests/e2e/steps_start_chains.go +++ b/tests/e2e/steps_start_chains.go @@ -54,6 +54,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Status: "PROPOSAL_STATUS_VOTING_PERIOD", }, }, + ProposedConsumerChains: &[]string{consumerName}, }, }, }, @@ -137,7 +138,6 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint ValidatorID("alice"): 9500000000, ValidatorID("bob"): 9500000000, }, - ProposedConsumerChains: &[]string{consumerName}, }, }, }, From c7cda12985ac3a0ddec50e9494f90d5e94568981 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Fri, 22 Sep 2023 14:24:35 +0200 Subject: [PATCH 31/36] fix gosec --- tests/e2e/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index a43f3adc03..9180553c60 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -780,8 +780,8 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) { } func (tr TestRun) getProposedConsumerChains(chain ChainID) []string { - //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. tr.waitBlocks(chain, 1, 10*time.Second) + //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "provider", "list-proposed-consumer-chains", `--node`, tr.getQueryNode(chain), From 6bf0f398d34e3fba45d7ebf9ac01cf7bf48780f6 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Mon, 2 Oct 2023 11:29:33 +0200 Subject: [PATCH 32/36] remove type url check --- x/ccv/provider/keeper/gov_hook.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index 8ec4ba0044..ca54584c13 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -45,10 +45,6 @@ func (gh GovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64) { panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) } - // if the proposal is not ConsumerAdditionProposal, continue - if msgLegacyContent.Content.TypeUrl != "/interchain_security.ccv.provider.v1.ConsumerAdditionProposal" { - continue - } // if the consumer addition proposal cannot be unmarshaled, continue var consAdditionProp types.ConsumerAdditionProposal if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { @@ -79,9 +75,6 @@ func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID ui panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) } - if msgLegacyContent.Content.TypeUrl != "/interchain_security.ccv.provider.v1.ConsumerAdditionProposal" { - continue - } var consAdditionProp types.ConsumerAdditionProposal // if the proposal is not ConsumerAdditionProposal, return if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { From dc7371bead16dd226e16ea9e9264eee8a76bad1c Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Mon, 2 Oct 2023 12:55:00 +0200 Subject: [PATCH 33/36] test: add unit test --- x/ccv/provider/keeper/gov_hook.go | 3 +- x/ccv/provider/keeper/keeper.go | 4 +- x/ccv/provider/keeper/keeper_test.go | 75 ++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 4 deletions(-) diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go index ca54584c13..61f504366f 100644 --- a/x/ccv/provider/keeper/gov_hook.go +++ b/x/ccv/provider/keeper/gov_hook.go @@ -82,9 +82,8 @@ func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID ui } if consAdditionProp.ProposalType() == types.ProposalTypeConsumerAddition { - gh.k.DeleteChainsInProposal(ctx, consAdditionProp.ChainId, proposalID) + gh.k.DeleteProposedConsumerChainInStore(ctx, proposalID) } - } } diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 92c3eefe4a..ba2b6f47fe 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -192,9 +192,9 @@ func (k Keeper) GetProposedConsumerChain(ctx sdk.Context, proposalID uint64) str return string(store.Get(types.ProposedConsumerChainKey(proposalID))) } -// DeleteChainsInProposal deletes the consumer chainID from store +// DeleteProposedConsumerChainInStore deletes the consumer chainID from store // which is in gov consumerAddition proposal -func (k Keeper) DeleteChainsInProposal(ctx sdk.Context, chainID string, proposalID uint64) { +func (k Keeper) DeleteProposedConsumerChainInStore(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(k.storeKey) store.Delete(types.ProposedConsumerChainKey(proposalID)) } diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 12d693d389..73ef0af6ec 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -545,6 +545,7 @@ func TestSetProposedConsumerChains(t *testing.T) { {chainID: "1", proposalID: 1}, {chainID: "some other ID", proposalID: 12}, {chainID: "some other other chain ID", proposalID: 123}, + {chainID: "", proposalID: 1234}, } for _, test := range tests { @@ -553,3 +554,77 @@ func TestSetProposedConsumerChains(t *testing.T) { require.Equal(t, cID, test.chainID) } } + +func TestDeleteProposedConsumerChainInStore(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + tests := []struct { + 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}, + } + for _, test := range tests { + providerKeeper.SetProposedConsumerChain(ctx, test.chainID, test.proposalID) + providerKeeper.DeleteProposedConsumerChainInStore(ctx, test.deleteProposalID) + cID := providerKeeper.GetProposedConsumerChain(ctx, test.proposalID) + if test.ok { + require.Equal(t, cID, "") + } else { + require.Equal(t, cID, test.chainID) + } + } +} + +func TestGetAllProposedConsumerChainIDs(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + tests := [][]types.ProposedChain{ + []types.ProposedChain{}, + []types.ProposedChain{ + { + ChainID: "1", + ProposalID: 1, + }, + }, + []types.ProposedChain{ + { + ChainID: "1", + ProposalID: 1, + }, + { + ChainID: "2", + ProposalID: 2, + }, + { + ChainID: "", + ProposalID: 3, + }, + }, + } + + for _, test := range tests { + for _, tc := range test { + providerKeeper.SetProposedConsumerChain(ctx, tc.ChainID, tc.ProposalID) + } + + chains := providerKeeper.GetAllProposedConsumerChainIDs(ctx) + + sort.Slice(chains, func(i, j int) bool { + return chains[i].ProposalID < chains[j].ProposalID + }) + sort.Slice(test, func(i, j int) bool { + return test[i].ProposalID < test[j].ProposalID + }) + require.Equal(t, chains, test) + + for _, tc := range test { + providerKeeper.DeleteProposedConsumerChainInStore(ctx, tc.ProposalID) + } + } +} From 5ee311642be87e7f5432a64553117bce4273f2ad Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Mon, 2 Oct 2023 13:07:19 +0200 Subject: [PATCH 34/36] lint --- x/ccv/provider/keeper/keeper_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 73ef0af6ec..428778c240 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -588,21 +588,21 @@ func TestGetAllProposedConsumerChainIDs(t *testing.T) { []types.ProposedChain{}, []types.ProposedChain{ { - ChainID: "1", + ChainID: "1", ProposalID: 1, }, }, []types.ProposedChain{ { - ChainID: "1", + ChainID: "1", ProposalID: 1, }, { - ChainID: "2", + ChainID: "2", ProposalID: 2, }, { - ChainID: "", + ChainID: "", ProposalID: 3, }, }, From d31f4c88bb811b444bd83bed879535cadc5a5500 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Mon, 2 Oct 2023 13:12:12 +0200 Subject: [PATCH 35/36] fix lint --- x/ccv/provider/keeper/keeper_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 428778c240..14c86fe775 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -585,14 +585,14 @@ func TestGetAllProposedConsumerChainIDs(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() tests := [][]types.ProposedChain{ - []types.ProposedChain{}, - []types.ProposedChain{ + {}, + { { ChainID: "1", ProposalID: 1, }, }, - []types.ProposedChain{ + { { ChainID: "1", ProposalID: 1, From 533ea069ff0c8ae87e0f4ff44e30a6fed8c149be Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Mon, 2 Oct 2023 13:36:29 +0200 Subject: [PATCH 36/36] fix err --- tests/e2e/config.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 6726ab2304..fc7c1badcd 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -395,7 +395,7 @@ func ChangeoverTestRun() TestRun { return tr } -func (s *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { +func (tr *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { if localSdkPath != "" { fmt.Println("USING LOCAL SDK", localSdkPath) } @@ -403,17 +403,17 @@ func (s *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag str fmt.Println("USING GAIA INSTEAD OF ICS provider app", gaiaTag) } - s.useGaia = useGaia - s.gaiaTag = gaiaTag - s.localSdkPath = localSdkPath + tr.useGaia = useGaia + tr.gaiaTag = gaiaTag + tr.localSdkPath = localSdkPath } -func (s *TestRun) SetCometMockConfig(useCometmock bool) { - s.useCometmock = useCometmock +func (tr *TestRun) SetCometMockConfig(useCometmock bool) { + tr.useCometmock = useCometmock } -func (s *TestRun) SetRelayerConfig(useRly bool) { - s.useGorelayer = useRly +func (tr *TestRun) SetRelayerConfig(useRly bool) { + tr.useGorelayer = useRly } // validateStringLiterals enforces that configs follow the constraints @@ -423,8 +423,8 @@ func (s *TestRun) SetRelayerConfig(useRly bool) { // within the container will be named as "$CHAIN_ID-$VAL_ID-out" etc. // where this name is constrained to 15 bytes or less. Therefore each string literal // used as a validatorID or chainID needs to be 5 char or less. -func (s *TestRun) validateStringLiterals() { - for valID, valConfig := range s.validatorConfigs { +func (tr *TestRun) validateStringLiterals() { + for valID, valConfig := range tr.validatorConfigs { if len(valID) > 5 { panic("validator id string literal must be 5 char or less") @@ -448,7 +448,7 @@ func (s *TestRun) validateStringLiterals() { } } - for chainID, chainConfig := range s.chainConfigs { + for chainID, chainConfig := range tr.chainConfigs { if len(chainID) > 5 { panic("chain id string literal must be 5 char or less") }