From 9c09e60f4a25a8fde19863a4a7dd01d49d447b56 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 3 Dec 2024 07:20:50 +0200 Subject: [PATCH] chore: add channel consensus state rpc --- modules/core/04-channel/v2/client/cli/abci.go | 4 + modules/core/04-channel/v2/client/cli/cli.go | 1 + .../core/04-channel/v2/client/cli/query.go | 45 + .../core/04-channel/v2/keeper/grpc_query.go | 18 + modules/core/04-channel/v2/types/query.go | 23 +- modules/core/04-channel/v2/types/query.pb.go | 877 ++++++++++++++---- .../core/04-channel/v2/types/query.pb.gw.go | 101 ++ proto/ibc/core/channel/v2/query.proto | 27 + 8 files changed, 938 insertions(+), 158 deletions(-) diff --git a/modules/core/04-channel/v2/client/cli/abci.go b/modules/core/04-channel/v2/client/cli/abci.go index d341e35b4e2..adc4eea825e 100644 --- a/modules/core/04-channel/v2/client/cli/abci.go +++ b/modules/core/04-channel/v2/client/cli/abci.go @@ -12,6 +12,10 @@ import ( ibcclient "github.com/cosmos/ibc-go/v9/modules/core/client" ) +func queryChannelConsensusStateABCI(clientCtx client.Context, channelID string) (*types.QueryChannelConsensusStateResponse, error) { + return &types.QueryChannelConsensusStateResponse{}, nil +} + func queryNextSequenceSendABCI(clientCtx client.Context, channelID string) (*types.QueryNextSequenceSendResponse, error) { key := hostv2.NextSequenceSendKey(channelID) value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) diff --git a/modules/core/04-channel/v2/client/cli/cli.go b/modules/core/04-channel/v2/client/cli/cli.go index c9a0d954287..a2a5913a51d 100644 --- a/modules/core/04-channel/v2/client/cli/cli.go +++ b/modules/core/04-channel/v2/client/cli/cli.go @@ -20,6 +20,7 @@ func GetQueryCmd() *cobra.Command { queryCmd.AddCommand( getCmdQueryChannel(), + getCmdQueryChannelConsensusState(), getCmdQueryNextSequenceSend(), getCmdQueryPacketCommitment(), getCmdQueryPacketCommitments(), diff --git a/modules/core/04-channel/v2/client/cli/query.go b/modules/core/04-channel/v2/client/cli/query.go index 2be1a004d3e..824b8431432 100644 --- a/modules/core/04-channel/v2/client/cli/query.go +++ b/modules/core/04-channel/v2/client/cli/query.go @@ -49,6 +49,51 @@ func getCmdQueryChannel() *cobra.Command { return cmd } +// getCmdQueryChannelConsensusState defines the command to query the channel consensus state for the given channel ID. +func getCmdQueryChannelConsensusState() *cobra.Command { + cmd := &cobra.Command{ + Use: "consensus-state [channel-id]", + Short: "Query the consensus state associated with a channel.", + Long: "Query the consensus state associated with a channel for the provided channel ID.", + Example: fmt.Sprintf("%s query %s %s consensus-state [channel-id]", version.AppName, exported.ModuleName, types.SubModuleName), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + channelID := args[0] + prove, err := cmd.Flags().GetBool(flags.FlagProve) + if err != nil { + return err + } + + if prove { + res, err := queryChannelConsensusStateABCI(clientCtx, channelID) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + } + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.ChannelConsensusState(cmd.Context(), types.NewQueryChannelConsensusStateRequest(channelID)) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + cmd.Flags().Bool(flags.FlagProve, true, "show proofs for the query results") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + // getCmdQueryNextSequenceSend defines the command to query a next send sequence for a given channel func getCmdQueryNextSequenceSend() *cobra.Command { cmd := &cobra.Command{ diff --git a/modules/core/04-channel/v2/keeper/grpc_query.go b/modules/core/04-channel/v2/keeper/grpc_query.go index 3f5c7b1e59d..986d001f8ea 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query.go +++ b/modules/core/04-channel/v2/keeper/grpc_query.go @@ -51,6 +51,24 @@ func (q *queryServer) Channel(ctx context.Context, req *types.QueryChannelReques return types.NewQueryChannelResponse(channel), nil } +// ChannelConsensusState implements the Query/ChannelConsensusState gRPC method +func (q *queryServer) ChannelConsensusState(ctx context.Context, req *types.QueryChannelConsensusStateRequest) (*types.QueryChannelConsensusStateResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if err := host.ChannelIdentifierValidator(req.ChannelId); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + _, found := q.GetChannel(ctx, req.ChannelId) + if !found { + return nil, status.Error(codes.NotFound, errorsmod.Wrapf(types.ErrChannelNotFound, "channel-id: %s", req.ChannelId).Error()) + } + + return nil, nil +} + // NextSequenceSend implements the Query/NextSequenceSend gRPC method func (q *queryServer) NextSequenceSend(ctx context.Context, req *types.QueryNextSequenceSendRequest) (*types.QueryNextSequenceSendResponse, error) { if req == nil { diff --git a/modules/core/04-channel/v2/types/query.go b/modules/core/04-channel/v2/types/query.go index b02d0275537..a8282b23c6b 100644 --- a/modules/core/04-channel/v2/types/query.go +++ b/modules/core/04-channel/v2/types/query.go @@ -1,6 +1,10 @@ package types -import clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" +import ( + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + + clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" +) // NewQueryChannelRequest creates and returns a new channel query request. func NewQueryChannelRequest(channelID string) *QueryChannelRequest { @@ -16,6 +20,23 @@ func NewQueryChannelResponse(channel Channel) *QueryChannelResponse { } } +// NewQueryChannelConsensusStateRequest creates and returns a new ChannelConsensusState query request. +func NewQueryChannelConsensusStateRequest(channelID string) *QueryChannelConsensusStateRequest { + return &QueryChannelConsensusStateRequest{ + ChannelId: channelID, + } +} + +// NewQueryChannelConsensusStateResponse creates and returns a new ChannelConsensusState query response. +func NewQueryChannelConsensusStateResponse(clientID string, anyConsensusState *codectypes.Any, proof []byte, height clienttypes.Height) *QueryChannelConsensusStateResponse { + return &QueryChannelConsensusStateResponse{ + ConsensusState: anyConsensusState, + ClientId: clientID, + Proof: proof, + ProofHeight: height, + } +} + // NewQueryNextSequenceSendRequest creates a new next sequence send query. func NewQueryNextSequenceSendRequest(channelID string) *QueryNextSequenceSendRequest { return &QueryNextSequenceSendRequest{ diff --git a/modules/core/04-channel/v2/types/query.pb.go b/modules/core/04-channel/v2/types/query.pb.go index 5ae8436bd9b..2df98cef01d 100644 --- a/modules/core/04-channel/v2/types/query.pb.go +++ b/modules/core/04-channel/v2/types/query.pb.go @@ -6,11 +6,12 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - types "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" + types1 "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -122,6 +123,127 @@ func (m *QueryChannelResponse) GetChannel() Channel { return Channel{} } +// QueryChannelConsensusStateRequest is the request type for the Query/ConsensusState +// RPC method +type QueryChannelConsensusStateRequest struct { + // channel unique identifier + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (m *QueryChannelConsensusStateRequest) Reset() { *m = QueryChannelConsensusStateRequest{} } +func (m *QueryChannelConsensusStateRequest) String() string { return proto.CompactTextString(m) } +func (*QueryChannelConsensusStateRequest) ProtoMessage() {} +func (*QueryChannelConsensusStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a328cba4986edcab, []int{2} +} +func (m *QueryChannelConsensusStateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChannelConsensusStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChannelConsensusStateRequest.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 *QueryChannelConsensusStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChannelConsensusStateRequest.Merge(m, src) +} +func (m *QueryChannelConsensusStateRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryChannelConsensusStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChannelConsensusStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChannelConsensusStateRequest proto.InternalMessageInfo + +func (m *QueryChannelConsensusStateRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +// QueryChannelConsensusStateResponse is the Response type for the +// Query/QueryChannelConsensusState RPC method +type QueryChannelConsensusStateResponse struct { + // consensus state associated with the channel + ConsensusState *types.Any `protobuf:"bytes,1,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty"` + // client ID associated with the consensus state + ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // merkle proof of existence + Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` + // height at which the proof was retrieved + ProofHeight types1.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` +} + +func (m *QueryChannelConsensusStateResponse) Reset() { *m = QueryChannelConsensusStateResponse{} } +func (m *QueryChannelConsensusStateResponse) String() string { return proto.CompactTextString(m) } +func (*QueryChannelConsensusStateResponse) ProtoMessage() {} +func (*QueryChannelConsensusStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a328cba4986edcab, []int{3} +} +func (m *QueryChannelConsensusStateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChannelConsensusStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChannelConsensusStateResponse.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 *QueryChannelConsensusStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChannelConsensusStateResponse.Merge(m, src) +} +func (m *QueryChannelConsensusStateResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryChannelConsensusStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChannelConsensusStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChannelConsensusStateResponse proto.InternalMessageInfo + +func (m *QueryChannelConsensusStateResponse) GetConsensusState() *types.Any { + if m != nil { + return m.ConsensusState + } + return nil +} + +func (m *QueryChannelConsensusStateResponse) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *QueryChannelConsensusStateResponse) GetProof() []byte { + if m != nil { + return m.Proof + } + return nil +} + +func (m *QueryChannelConsensusStateResponse) GetProofHeight() types1.Height { + if m != nil { + return m.ProofHeight + } + return types1.Height{} +} + // QueryNextSequenceSendRequest is the request type for the Query/QueryNextSequenceSend RPC method type QueryNextSequenceSendRequest struct { // channel unique identifier @@ -132,7 +254,7 @@ func (m *QueryNextSequenceSendRequest) Reset() { *m = QueryNextSequenceS func (m *QueryNextSequenceSendRequest) String() string { return proto.CompactTextString(m) } func (*QueryNextSequenceSendRequest) ProtoMessage() {} func (*QueryNextSequenceSendRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{2} + return fileDescriptor_a328cba4986edcab, []int{4} } func (m *QueryNextSequenceSendRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -175,14 +297,14 @@ type QueryNextSequenceSendResponse struct { // merkle proof of existence Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` // height at which the proof was retrieved - ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` + ProofHeight types1.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` } func (m *QueryNextSequenceSendResponse) Reset() { *m = QueryNextSequenceSendResponse{} } func (m *QueryNextSequenceSendResponse) String() string { return proto.CompactTextString(m) } func (*QueryNextSequenceSendResponse) ProtoMessage() {} func (*QueryNextSequenceSendResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{3} + return fileDescriptor_a328cba4986edcab, []int{5} } func (m *QueryNextSequenceSendResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -225,11 +347,11 @@ func (m *QueryNextSequenceSendResponse) GetProof() []byte { return nil } -func (m *QueryNextSequenceSendResponse) GetProofHeight() types.Height { +func (m *QueryNextSequenceSendResponse) GetProofHeight() types1.Height { if m != nil { return m.ProofHeight } - return types.Height{} + return types1.Height{} } // QueryPacketCommitmentRequest is the request type for the Query/PacketCommitment RPC method. @@ -244,7 +366,7 @@ func (m *QueryPacketCommitmentRequest) Reset() { *m = QueryPacketCommitm func (m *QueryPacketCommitmentRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentRequest) ProtoMessage() {} func (*QueryPacketCommitmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{4} + return fileDescriptor_a328cba4986edcab, []int{6} } func (m *QueryPacketCommitmentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -294,14 +416,14 @@ type QueryPacketCommitmentResponse struct { // merkle proof of existence Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` // height at which the proof was retrieved - ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` + ProofHeight types1.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` } func (m *QueryPacketCommitmentResponse) Reset() { *m = QueryPacketCommitmentResponse{} } func (m *QueryPacketCommitmentResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentResponse) ProtoMessage() {} func (*QueryPacketCommitmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{5} + return fileDescriptor_a328cba4986edcab, []int{7} } func (m *QueryPacketCommitmentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -344,11 +466,11 @@ func (m *QueryPacketCommitmentResponse) GetProof() []byte { return nil } -func (m *QueryPacketCommitmentResponse) GetProofHeight() types.Height { +func (m *QueryPacketCommitmentResponse) GetProofHeight() types1.Height { if m != nil { return m.ProofHeight } - return types.Height{} + return types1.Height{} } // QueryPacketCommitmentsRequest is the request type for the Query/PacketCommitments RPC method. @@ -363,7 +485,7 @@ func (m *QueryPacketCommitmentsRequest) Reset() { *m = QueryPacketCommit func (m *QueryPacketCommitmentsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentsRequest) ProtoMessage() {} func (*QueryPacketCommitmentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{6} + return fileDescriptor_a328cba4986edcab, []int{8} } func (m *QueryPacketCommitmentsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -413,14 +535,14 @@ type QueryPacketCommitmentsResponse struct { // pagination response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` // query block height. - Height types.Height `protobuf:"bytes,3,opt,name=height,proto3" json:"height"` + Height types1.Height `protobuf:"bytes,3,opt,name=height,proto3" json:"height"` } func (m *QueryPacketCommitmentsResponse) Reset() { *m = QueryPacketCommitmentsResponse{} } func (m *QueryPacketCommitmentsResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentsResponse) ProtoMessage() {} func (*QueryPacketCommitmentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{7} + return fileDescriptor_a328cba4986edcab, []int{9} } func (m *QueryPacketCommitmentsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -463,11 +585,11 @@ func (m *QueryPacketCommitmentsResponse) GetPagination() *query.PageResponse { return nil } -func (m *QueryPacketCommitmentsResponse) GetHeight() types.Height { +func (m *QueryPacketCommitmentsResponse) GetHeight() types1.Height { if m != nil { return m.Height } - return types.Height{} + return types1.Height{} } // QueryPacketAcknowledgementRequest is the request type for the Query/PacketAcknowledgement RPC method. @@ -482,7 +604,7 @@ func (m *QueryPacketAcknowledgementRequest) Reset() { *m = QueryPacketAc func (m *QueryPacketAcknowledgementRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementRequest) ProtoMessage() {} func (*QueryPacketAcknowledgementRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{8} + return fileDescriptor_a328cba4986edcab, []int{10} } func (m *QueryPacketAcknowledgementRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -532,14 +654,14 @@ type QueryPacketAcknowledgementResponse struct { // merkle proof of existence Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` // height at which the proof was retrieved - ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` + ProofHeight types1.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` } func (m *QueryPacketAcknowledgementResponse) Reset() { *m = QueryPacketAcknowledgementResponse{} } func (m *QueryPacketAcknowledgementResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementResponse) ProtoMessage() {} func (*QueryPacketAcknowledgementResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{9} + return fileDescriptor_a328cba4986edcab, []int{11} } func (m *QueryPacketAcknowledgementResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -582,11 +704,11 @@ func (m *QueryPacketAcknowledgementResponse) GetProof() []byte { return nil } -func (m *QueryPacketAcknowledgementResponse) GetProofHeight() types.Height { +func (m *QueryPacketAcknowledgementResponse) GetProofHeight() types1.Height { if m != nil { return m.ProofHeight } - return types.Height{} + return types1.Height{} } // QueryPacketAcknowledgementsRequest is the request type for the @@ -604,7 +726,7 @@ func (m *QueryPacketAcknowledgementsRequest) Reset() { *m = QueryPacketA func (m *QueryPacketAcknowledgementsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementsRequest) ProtoMessage() {} func (*QueryPacketAcknowledgementsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{10} + return fileDescriptor_a328cba4986edcab, []int{12} } func (m *QueryPacketAcknowledgementsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -661,14 +783,14 @@ type QueryPacketAcknowledgementsResponse struct { // pagination response Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` // query block height - Height types.Height `protobuf:"bytes,3,opt,name=height,proto3" json:"height"` + Height types1.Height `protobuf:"bytes,3,opt,name=height,proto3" json:"height"` } func (m *QueryPacketAcknowledgementsResponse) Reset() { *m = QueryPacketAcknowledgementsResponse{} } func (m *QueryPacketAcknowledgementsResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementsResponse) ProtoMessage() {} func (*QueryPacketAcknowledgementsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{11} + return fileDescriptor_a328cba4986edcab, []int{13} } func (m *QueryPacketAcknowledgementsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -711,11 +833,11 @@ func (m *QueryPacketAcknowledgementsResponse) GetPagination() *query.PageRespons return nil } -func (m *QueryPacketAcknowledgementsResponse) GetHeight() types.Height { +func (m *QueryPacketAcknowledgementsResponse) GetHeight() types1.Height { if m != nil { return m.Height } - return types.Height{} + return types1.Height{} } // QueryPacketReceiptRequest is the request type for the Query/PacketReceipt RPC method. @@ -732,7 +854,7 @@ func (m *QueryPacketReceiptRequest) Reset() { *m = QueryPacketReceiptReq func (m *QueryPacketReceiptRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketReceiptRequest) ProtoMessage() {} func (*QueryPacketReceiptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{12} + return fileDescriptor_a328cba4986edcab, []int{14} } func (m *QueryPacketReceiptRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -789,14 +911,14 @@ type QueryPacketReceiptResponse struct { // merkle proof of existence or absence Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` // height at which the proof was retrieved - ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` + ProofHeight types1.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` } func (m *QueryPacketReceiptResponse) Reset() { *m = QueryPacketReceiptResponse{} } func (m *QueryPacketReceiptResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketReceiptResponse) ProtoMessage() {} func (*QueryPacketReceiptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{13} + return fileDescriptor_a328cba4986edcab, []int{15} } func (m *QueryPacketReceiptResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -839,11 +961,11 @@ func (m *QueryPacketReceiptResponse) GetProof() []byte { return nil } -func (m *QueryPacketReceiptResponse) GetProofHeight() types.Height { +func (m *QueryPacketReceiptResponse) GetProofHeight() types1.Height { if m != nil { return m.ProofHeight } - return types.Height{} + return types1.Height{} } // QueryUnreceivedPacketsRequest is the request type for the Query/UnreceivedPackets RPC method @@ -858,7 +980,7 @@ func (m *QueryUnreceivedPacketsRequest) Reset() { *m = QueryUnreceivedPa func (m *QueryUnreceivedPacketsRequest) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedPacketsRequest) ProtoMessage() {} func (*QueryUnreceivedPacketsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{14} + return fileDescriptor_a328cba4986edcab, []int{16} } func (m *QueryUnreceivedPacketsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -906,14 +1028,14 @@ type QueryUnreceivedPacketsResponse struct { // list of unreceived packet sequences Sequences []uint64 `protobuf:"varint,1,rep,packed,name=sequences,proto3" json:"sequences,omitempty"` // query block height - Height types.Height `protobuf:"bytes,2,opt,name=height,proto3" json:"height"` + Height types1.Height `protobuf:"bytes,2,opt,name=height,proto3" json:"height"` } func (m *QueryUnreceivedPacketsResponse) Reset() { *m = QueryUnreceivedPacketsResponse{} } func (m *QueryUnreceivedPacketsResponse) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedPacketsResponse) ProtoMessage() {} func (*QueryUnreceivedPacketsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{15} + return fileDescriptor_a328cba4986edcab, []int{17} } func (m *QueryUnreceivedPacketsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -949,11 +1071,11 @@ func (m *QueryUnreceivedPacketsResponse) GetSequences() []uint64 { return nil } -func (m *QueryUnreceivedPacketsResponse) GetHeight() types.Height { +func (m *QueryUnreceivedPacketsResponse) GetHeight() types1.Height { if m != nil { return m.Height } - return types.Height{} + return types1.Height{} } // QueryUnreceivedAcks is the request type for the @@ -969,7 +1091,7 @@ func (m *QueryUnreceivedAcksRequest) Reset() { *m = QueryUnreceivedAcksR func (m *QueryUnreceivedAcksRequest) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedAcksRequest) ProtoMessage() {} func (*QueryUnreceivedAcksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{16} + return fileDescriptor_a328cba4986edcab, []int{18} } func (m *QueryUnreceivedAcksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1018,14 +1140,14 @@ type QueryUnreceivedAcksResponse struct { // list of unreceived acknowledgement sequences Sequences []uint64 `protobuf:"varint,1,rep,packed,name=sequences,proto3" json:"sequences,omitempty"` // query block height - Height types.Height `protobuf:"bytes,2,opt,name=height,proto3" json:"height"` + Height types1.Height `protobuf:"bytes,2,opt,name=height,proto3" json:"height"` } func (m *QueryUnreceivedAcksResponse) Reset() { *m = QueryUnreceivedAcksResponse{} } func (m *QueryUnreceivedAcksResponse) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedAcksResponse) ProtoMessage() {} func (*QueryUnreceivedAcksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{17} + return fileDescriptor_a328cba4986edcab, []int{19} } func (m *QueryUnreceivedAcksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1061,16 +1183,18 @@ func (m *QueryUnreceivedAcksResponse) GetSequences() []uint64 { return nil } -func (m *QueryUnreceivedAcksResponse) GetHeight() types.Height { +func (m *QueryUnreceivedAcksResponse) GetHeight() types1.Height { if m != nil { return m.Height } - return types.Height{} + return types1.Height{} } func init() { proto.RegisterType((*QueryChannelRequest)(nil), "ibc.core.channel.v2.QueryChannelRequest") proto.RegisterType((*QueryChannelResponse)(nil), "ibc.core.channel.v2.QueryChannelResponse") + proto.RegisterType((*QueryChannelConsensusStateRequest)(nil), "ibc.core.channel.v2.QueryChannelConsensusStateRequest") + proto.RegisterType((*QueryChannelConsensusStateResponse)(nil), "ibc.core.channel.v2.QueryChannelConsensusStateResponse") proto.RegisterType((*QueryNextSequenceSendRequest)(nil), "ibc.core.channel.v2.QueryNextSequenceSendRequest") proto.RegisterType((*QueryNextSequenceSendResponse)(nil), "ibc.core.channel.v2.QueryNextSequenceSendResponse") proto.RegisterType((*QueryPacketCommitmentRequest)(nil), "ibc.core.channel.v2.QueryPacketCommitmentRequest") @@ -1092,77 +1216,84 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/query.proto", fileDescriptor_a328cba4986edcab) } var fileDescriptor_a328cba4986edcab = []byte{ - // 1113 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x5f, 0x6f, 0xdb, 0x54, - 0x14, 0xef, 0x6d, 0xba, 0xb5, 0x3d, 0x29, 0xa3, 0xbb, 0x2b, 0x90, 0x79, 0x5d, 0x96, 0x19, 0x09, - 0xc2, 0xb4, 0xf9, 0x36, 0xd9, 0x04, 0x43, 0xda, 0x40, 0x6d, 0x19, 0x5b, 0x27, 0x40, 0xc5, 0x05, - 0x24, 0xd0, 0xb4, 0xc8, 0x71, 0xee, 0x5c, 0x2b, 0x89, 0xaf, 0x17, 0x3b, 0xa1, 0xd3, 0xd4, 0x17, - 0x1e, 0x78, 0x46, 0xec, 0x8d, 0x4f, 0x00, 0x2f, 0x7c, 0x05, 0x90, 0x78, 0x99, 0xb4, 0x97, 0x49, - 0x7b, 0x80, 0x27, 0x04, 0x2d, 0x12, 0xdf, 0x80, 0x67, 0x94, 0xeb, 0xeb, 0xf8, 0x4f, 0x1c, 0xd7, - 0xde, 0x56, 0xc4, 0x9b, 0x7d, 0x73, 0xfe, 0xfc, 0x7e, 0xe7, 0xfe, 0x8e, 0xcf, 0x51, 0xe0, 0x8c, - 0xd9, 0xd4, 0x89, 0xce, 0x7a, 0x94, 0xe8, 0xdb, 0x9a, 0x65, 0xd1, 0x0e, 0x19, 0xd4, 0xc9, 0xdd, - 0x3e, 0xed, 0xdd, 0x53, 0xec, 0x1e, 0x73, 0x19, 0x3e, 0x61, 0x36, 0x75, 0x65, 0x68, 0xa0, 0x08, - 0x03, 0x65, 0x50, 0x97, 0xce, 0xe9, 0xcc, 0xe9, 0x32, 0x87, 0x34, 0x35, 0x87, 0x7a, 0xd6, 0x64, - 0x50, 0x6b, 0x52, 0x57, 0xab, 0x11, 0x5b, 0x33, 0x4c, 0x4b, 0x73, 0x4d, 0x66, 0x79, 0x01, 0xa4, - 0xb3, 0x49, 0x19, 0xfc, 0x58, 0x29, 0x26, 0x06, 0xb5, 0xa8, 0x63, 0x3a, 0xc2, 0x24, 0x84, 0xb3, - 0x63, 0x52, 0xcb, 0x25, 0x83, 0x9a, 0x78, 0x12, 0x06, 0xcb, 0x06, 0x63, 0x46, 0x87, 0x12, 0xcd, - 0x36, 0x89, 0x66, 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e8, 0x61, 0xe5, 0x20, 0x5c, 0xd1, 0x79, 0x2c, 0x91, - 0xcc, 0xf6, 0x02, 0xfe, 0x87, 0x1c, 0xfe, 0x75, 0x7c, 0x2d, 0x3f, 0xfc, 0x9e, 0x17, 0x2a, 0x72, - 0x37, 0x7b, 0x08, 0x8e, 0x8f, 0xcd, 0xb0, 0xb4, 0xbe, 0x99, 0x34, 0x4e, 0xd3, 0xfa, 0x66, 0xe2, - 0x90, 0x94, 0x5b, 0x9c, 0xcd, 0x6d, 0x7c, 0xeb, 0x39, 0x7d, 0x08, 0x9c, 0x5d, 0xd2, 0x1f, 0x25, - 0x6b, 0xd8, 0x82, 0xce, 0x9f, 0x08, 0x8e, 0x45, 0xe7, 0x17, 0x26, 0x59, 0xd0, 0x86, 0x06, 0xab, - 0xb4, 0x92, 0xdd, 0x41, 0x70, 0xeb, 0x70, 0x6e, 0x77, 0x70, 0xeb, 0x19, 0xb9, 0x25, 0x0d, 0xec, - 0x08, 0xcd, 0x61, 0xbf, 0xad, 0x7d, 0xf6, 0x70, 0xaf, 0x8c, 0x1e, 0xef, 0x95, 0xd1, 0x1f, 0x7b, - 0x65, 0xf4, 0xcd, 0x7e, 0x79, 0xea, 0xf1, 0x7e, 0x79, 0xea, 0xb7, 0xfd, 0xf2, 0xd4, 0x17, 0x57, - 0x0c, 0xd3, 0xdd, 0xee, 0x37, 0x15, 0x9d, 0x75, 0x89, 0xf8, 0x57, 0xc6, 0x6c, 0xea, 0x17, 0x0c, - 0x46, 0x06, 0x6f, 0x93, 0x2e, 0x6b, 0xf5, 0x3b, 0xd4, 0xf1, 0xe0, 0xad, 0x5c, 0xba, 0x10, 0x42, - 0xe8, 0xde, 0xb3, 0xa9, 0xd3, 0x3c, 0xca, 0xff, 0x08, 0xb9, 0xf8, 0x6f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xd2, 0x18, 0x54, 0x2c, 0x07, 0x12, 0x00, 0x00, + // 1225 bytes of a gzipped FileDescriptorProto + 0x1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x68, 0x80, 0x04, 0x55, 0x0a, 0x69, 0x5c, 0x24, 0xfe, 0x1b, 0x1c, 0xff, 0x5b, 0x78, 0x35, 0x05, + 0xfe, 0x7e, 0x99, 0x8a, 0x1f, 0x21, 0x98, 0x0e, 0xab, 0x95, 0x38, 0x0a, 0x03, 0xb4, 0x65, 0x1c, + 0x85, 0x41, 0x92, 0x51, 0xdd, 0xe4, 0x14, 0x6e, 0xe3, 0x5b, 0x29, 0x28, 0xf4, 0xdd, 0x6d, 0x8c, + 0xdc, 0xf7, 0x19, 0x1d, 0xe0, 0x1f, 0x10, 0x9c, 0xe9, 0xd3, 0x5e, 0x38, 0x05, 0x36, 0x7f, 0x20, + 0x28, 0x57, 0x53, 0xf9, 0x3c, 0xc3, 0x99, 0xf4, 0x13, 0xc2, 0x4f, 0x10, 0x9c, 0x8b, 0xbc, 0x7d, + 0xe3, 0xba, 0x24, 0x4e, 0x89, 0xc5, 0x75, 0x49, 0xac, 0xc0, 0x52, 0x37, 0x38, 0xa3, 0x75, 0xbc, + 0x96, 0x9e, 0x91, 0x61, 0xee, 0x06, 0xce, 0xe6, 0x27, 0x04, 0xff, 0x8f, 0xd6, 0x14, 0x38, 0x2d, + 0xbc, 0xce, 0x29, 0x5d, 0x4f, 0xef, 0x28, 0x89, 0xdd, 0xe6, 0xc4, 0xde, 0xc6, 0xc5, 0xa7, 0x22, + 0x16, 0x84, 0xff, 0x1d, 0x82, 0xff, 0x05, 0xee, 0x70, 0xac, 0x1d, 0x87, 0x2b, 0x28, 0x2f, 0x14, + 0x92, 0xd8, 0x5e, 0xc2, 0x7f, 0x8f, 0xc3, 0xbf, 0x89, 0x6f, 0xa4, 0x87, 0xdf, 0x10, 0xa1, 0x02, + 0x67, 0x73, 0x88, 0xe0, 0x4c, 0xdf, 0x95, 0x1c, 0xd7, 0x37, 0x83, 0xd4, 0x41, 0x5c, 0xdf, 0x0c, + 0xbc, 0xf3, 0xd5, 0x0a, 0x67, 0x73, 0x17, 0xdf, 0x79, 0x4e, 0x83, 0x80, 0x1d, 0x90, 0x66, 0x67, + 0xb3, 0x92, 0x2b, 0xe9, 0xfc, 0x8e, 0xe0, 0x74, 0xf0, 0x3a, 0xc6, 0x24, 0x09, 0xda, 0x1e, 0x9d, + 0xa0, 0x2c, 0x25, 0x77, 0x90, 0xdc, 0x6a, 0x9c, 0xdb, 0x36, 0xae, 0x3c, 0x23, 0xb7, 0x28, 0xfd, + 0x11, 0xa0, 0xd9, 0xee, 0xb7, 0xe2, 0xc7, 0x0f, 0x0f, 0x73, 0xe8, 0xf1, 0x61, 0x0e, 0xfd, 0x76, + 0x98, 0x43, 0x5f, 0x1e, 0xe5, 0x86, 0x1e, 0x1f, 0xe5, 0x86, 0x7e, 0x3e, 0xca, 0x0d, 0x7d, 0xba, + 0x52, 0xb5, 0xbc, 0x9d, 0x66, 0x59, 0x33, 0x9d, 0x3a, 0x91, 0x7f, 0xe8, 0xac, 0xb2, 0x79, 0xa5, + 0xea, 0x90, 0xd6, 0xeb, 0xa4, 0xee, 0x54, 0x9a, 0x35, 0xca, 0x04, 0xbc, 0xa5, 0x6b, 0x57, 0x7a, + 0x10, 0x7a, 0xfb, 0x2e, 0x65, 0xe5, 0x11, 0xfe, 0x6b, 0xe7, 0xea, 0x3f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xe8, 0x98, 0xd8, 0x75, 0x13, 0x14, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1179,6 +1310,9 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Channel queries the counterparty of an IBC client. Channel(ctx context.Context, in *QueryChannelRequest, opts ...grpc.CallOption) (*QueryChannelResponse, error) + // ChannelConsensusState queries for the consensus state for the channel associated + // with the provided channel identifiers. + ChannelConsensusState(ctx context.Context, in *QueryChannelConsensusStateRequest, opts ...grpc.CallOption) (*QueryChannelConsensusStateResponse, error) // NextSequenceSend returns the next send sequence for a given channel. NextSequenceSend(ctx context.Context, in *QueryNextSequenceSendRequest, opts ...grpc.CallOption) (*QueryNextSequenceSendResponse, error) // PacketCommitment queries a stored packet commitment hash. @@ -1214,6 +1348,15 @@ func (c *queryClient) Channel(ctx context.Context, in *QueryChannelRequest, opts return out, nil } +func (c *queryClient) ChannelConsensusState(ctx context.Context, in *QueryChannelConsensusStateRequest, opts ...grpc.CallOption) (*QueryChannelConsensusStateResponse, error) { + out := new(QueryChannelConsensusStateResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/ChannelConsensusState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) NextSequenceSend(ctx context.Context, in *QueryNextSequenceSendRequest, opts ...grpc.CallOption) (*QueryNextSequenceSendResponse, error) { out := new(QueryNextSequenceSendResponse) err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/NextSequenceSend", in, out, opts...) @@ -1290,6 +1433,9 @@ func (c *queryClient) UnreceivedAcks(ctx context.Context, in *QueryUnreceivedAck type QueryServer interface { // Channel queries the counterparty of an IBC client. Channel(context.Context, *QueryChannelRequest) (*QueryChannelResponse, error) + // ChannelConsensusState queries for the consensus state for the channel associated + // with the provided channel identifiers. + ChannelConsensusState(context.Context, *QueryChannelConsensusStateRequest) (*QueryChannelConsensusStateResponse, error) // NextSequenceSend returns the next send sequence for a given channel. NextSequenceSend(context.Context, *QueryNextSequenceSendRequest) (*QueryNextSequenceSendResponse, error) // PacketCommitment queries a stored packet commitment hash. @@ -1315,6 +1461,9 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Channel(ctx context.Context, req *QueryChannelRequest) (*QueryChannelResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Channel not implemented") } +func (*UnimplementedQueryServer) ChannelConsensusState(ctx context.Context, req *QueryChannelConsensusStateRequest) (*QueryChannelConsensusStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelConsensusState not implemented") +} func (*UnimplementedQueryServer) NextSequenceSend(ctx context.Context, req *QueryNextSequenceSendRequest) (*QueryNextSequenceSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NextSequenceSend not implemented") } @@ -1362,6 +1511,24 @@ func _Query_Channel_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_ChannelConsensusState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryChannelConsensusStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ChannelConsensusState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v2.Query/ChannelConsensusState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ChannelConsensusState(ctx, req.(*QueryChannelConsensusStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_NextSequenceSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryNextSequenceSendRequest) if err := dec(in); err != nil { @@ -1514,6 +1681,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Channel", Handler: _Query_Channel_Handler, }, + { + MethodName: "ChannelConsensusState", + Handler: _Query_ChannelConsensusState_Handler, + }, { MethodName: "NextSequenceSend", Handler: _Query_NextSequenceSend_Handler, @@ -1614,6 +1785,95 @@ func (m *QueryChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryChannelConsensusStateRequest) 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 *QueryChannelConsensusStateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChannelConsensusStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryChannelConsensusStateResponse) 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 *QueryChannelConsensusStateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChannelConsensusStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x1a + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0x12 + } + if m.ConsensusState != nil { + { + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryNextSequenceSendRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1975,20 +2235,20 @@ func (m *QueryPacketAcknowledgementsRequest) MarshalToSizedBuffer(dAtA []byte) ( var l int _ = l if len(m.PacketCommitmentSequences) > 0 { - dAtA9 := make([]byte, len(m.PacketCommitmentSequences)*10) - var j8 int + dAtA11 := make([]byte, len(m.PacketCommitmentSequences)*10) + var j10 int for _, num := range m.PacketCommitmentSequences { for num >= 1<<7 { - dAtA9[j8] = uint8(uint64(num)&0x7f | 0x80) + dAtA11[j10] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j8++ + j10++ } - dAtA9[j8] = uint8(num) - j8++ + dAtA11[j10] = uint8(num) + j10++ } - i -= j8 - copy(dAtA[i:], dAtA9[:j8]) - i = encodeVarintQuery(dAtA, i, uint64(j8)) + i -= j10 + copy(dAtA[i:], dAtA11[:j10]) + i = encodeVarintQuery(dAtA, i, uint64(j10)) i-- dAtA[i] = 0x1a } @@ -2186,20 +2446,20 @@ func (m *QueryUnreceivedPacketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, var l int _ = l if len(m.Sequences) > 0 { - dAtA15 := make([]byte, len(m.Sequences)*10) - var j14 int + dAtA17 := make([]byte, len(m.Sequences)*10) + var j16 int for _, num := range m.Sequences { for num >= 1<<7 { - dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) + dAtA17[j16] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j14++ + j16++ } - dAtA15[j14] = uint8(num) - j14++ + dAtA17[j16] = uint8(num) + j16++ } - i -= j14 - copy(dAtA[i:], dAtA15[:j14]) - i = encodeVarintQuery(dAtA, i, uint64(j14)) + i -= j16 + copy(dAtA[i:], dAtA17[:j16]) + i = encodeVarintQuery(dAtA, i, uint64(j16)) i-- dAtA[i] = 0x12 } @@ -2244,20 +2504,20 @@ func (m *QueryUnreceivedPacketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, i-- dAtA[i] = 0x12 if len(m.Sequences) > 0 { - dAtA18 := make([]byte, len(m.Sequences)*10) - var j17 int + dAtA20 := make([]byte, len(m.Sequences)*10) + var j19 int for _, num := range m.Sequences { for num >= 1<<7 { - dAtA18[j17] = uint8(uint64(num)&0x7f | 0x80) + dAtA20[j19] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j17++ + j19++ } - dAtA18[j17] = uint8(num) - j17++ + dAtA20[j19] = uint8(num) + j19++ } - i -= j17 - copy(dAtA[i:], dAtA18[:j17]) - i = encodeVarintQuery(dAtA, i, uint64(j17)) + i -= j19 + copy(dAtA[i:], dAtA20[:j19]) + i = encodeVarintQuery(dAtA, i, uint64(j19)) i-- dAtA[i] = 0xa } @@ -2285,20 +2545,20 @@ func (m *QueryUnreceivedAcksRequest) MarshalToSizedBuffer(dAtA []byte) (int, err var l int _ = l if len(m.PacketAckSequences) > 0 { - dAtA20 := make([]byte, len(m.PacketAckSequences)*10) - var j19 int + dAtA22 := make([]byte, len(m.PacketAckSequences)*10) + var j21 int for _, num := range m.PacketAckSequences { for num >= 1<<7 { - dAtA20[j19] = uint8(uint64(num)&0x7f | 0x80) + dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j19++ + j21++ } - dAtA20[j19] = uint8(num) - j19++ + dAtA22[j21] = uint8(num) + j21++ } - i -= j19 - copy(dAtA[i:], dAtA20[:j19]) - i = encodeVarintQuery(dAtA, i, uint64(j19)) + i -= j21 + copy(dAtA[i:], dAtA22[:j21]) + i = encodeVarintQuery(dAtA, i, uint64(j21)) i-- dAtA[i] = 0x12 } @@ -2343,20 +2603,20 @@ func (m *QueryUnreceivedAcksResponse) MarshalToSizedBuffer(dAtA []byte) (int, er i-- dAtA[i] = 0x12 if len(m.Sequences) > 0 { - dAtA23 := make([]byte, len(m.Sequences)*10) - var j22 int + dAtA25 := make([]byte, len(m.Sequences)*10) + var j24 int for _, num := range m.Sequences { for num >= 1<<7 { - dAtA23[j22] = uint8(uint64(num)&0x7f | 0x80) + dAtA25[j24] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j22++ + j24++ } - dAtA23[j22] = uint8(num) - j22++ + dAtA25[j24] = uint8(num) + j24++ } - i -= j22 - copy(dAtA[i:], dAtA23[:j22]) - i = encodeVarintQuery(dAtA, i, uint64(j22)) + i -= j24 + copy(dAtA[i:], dAtA25[:j24]) + i = encodeVarintQuery(dAtA, i, uint64(j24)) i-- dAtA[i] = 0xa } @@ -2398,6 +2658,42 @@ func (m *QueryChannelResponse) Size() (n int) { return n } +func (m *QueryChannelConsensusStateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryChannelConsensusStateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConsensusState != nil { + l = m.ConsensusState.Size() + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryNextSequenceSendRequest) Size() (n int) { if m == nil { return 0 @@ -2867,6 +3163,273 @@ func (m *QueryChannelResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryChannelConsensusStateRequest) 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: QueryChannelConsensusStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChannelConsensusStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryChannelConsensusStateResponse) 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: QueryChannelConsensusStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChannelConsensusStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} + } + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.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 *QueryNextSequenceSendRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/04-channel/v2/types/query.pb.gw.go b/modules/core/04-channel/v2/types/query.pb.gw.go index 2f03fdadfd5..313b5f46371 100644 --- a/modules/core/04-channel/v2/types/query.pb.gw.go +++ b/modules/core/04-channel/v2/types/query.pb.gw.go @@ -87,6 +87,60 @@ func local_request_Query_Channel_0(ctx context.Context, marshaler runtime.Marsha } +func request_Query_ChannelConsensusState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChannelConsensusStateRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + msg, err := client.ChannelConsensusState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ChannelConsensusState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChannelConsensusStateRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + msg, err := server.ChannelConsensusState(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_NextSequenceSend_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryNextSequenceSendRequest var metadata runtime.ServerMetadata @@ -712,6 +766,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ChannelConsensusState_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_ChannelConsensusState_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_ChannelConsensusState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_NextSequenceSend_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -957,6 +1034,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ChannelConsensusState_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_ChannelConsensusState_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_ChannelConsensusState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_NextSequenceSend_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1123,6 +1220,8 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Channel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ChannelConsensusState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "consensus_state"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_NextSequenceSend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "next_sequence_send"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PacketCommitment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_commitments", "sequence"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1143,6 +1242,8 @@ var ( var ( forward_Query_Channel_0 = runtime.ForwardResponseMessage + forward_Query_ChannelConsensusState_0 = runtime.ForwardResponseMessage + forward_Query_NextSequenceSend_0 = runtime.ForwardResponseMessage forward_Query_PacketCommitment_0 = runtime.ForwardResponseMessage diff --git a/proto/ibc/core/channel/v2/query.proto b/proto/ibc/core/channel/v2/query.proto index 40d1cdc31eb..9e333e55c85 100644 --- a/proto/ibc/core/channel/v2/query.proto +++ b/proto/ibc/core/channel/v2/query.proto @@ -9,6 +9,7 @@ import "ibc/core/channel/v2/channel.proto"; import "ibc/core/channel/v2/genesis.proto"; import "ibc/core/client/v1/client.proto"; import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; // Query provides defines the gRPC querier service @@ -18,6 +19,12 @@ service Query { option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}"; } + // ChannelConsensusState queries for the consensus state for the channel associated + // with the provided channel identifiers. + rpc ChannelConsensusState(QueryChannelConsensusStateRequest) returns (QueryChannelConsensusStateResponse) { + option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/consensus_state"; + } + // NextSequenceSend returns the next send sequence for a given channel. rpc NextSequenceSend(QueryNextSequenceSendRequest) returns (QueryNextSequenceSendResponse) { option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/next_sequence_send"; @@ -72,6 +79,26 @@ message QueryChannelResponse { Channel channel = 1 [(gogoproto.nullable) = false]; } +// QueryChannelConsensusStateRequest is the request type for the Query/ConsensusState +// RPC method +message QueryChannelConsensusStateRequest { + // channel unique identifier + string channel_id = 1; +} + +// QueryChannelConsensusStateResponse is the Response type for the +// Query/QueryChannelConsensusState RPC method +message QueryChannelConsensusStateResponse { + // consensus state associated with the channel + google.protobuf.Any consensus_state = 1; + // client ID associated with the consensus state + string client_id = 2; + // merkle proof of existence + bytes proof = 3; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; +} + // QueryNextSequenceSendRequest is the request type for the Query/QueryNextSequenceSend RPC method message QueryNextSequenceSendRequest { // channel unique identifier