From 5d98657edf80d9cb9ca5479aebf6798a47f4c3a6 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 --- .../core/04-channel/v2/keeper/grpc_query.go | 32 + .../04-channel/v2/types/expected_keepers.go | 2 + modules/core/04-channel/v2/types/query.go | 16 +- modules/core/04-channel/v2/types/query.pb.go | 971 +++++++++++++++--- .../core/04-channel/v2/types/query.pb.gw.go | 119 +++ proto/ibc/core/channel/v2/query.proto | 31 + 6 files changed, 1003 insertions(+), 168 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/grpc_query.go b/modules/core/04-channel/v2/keeper/grpc_query.go index 3f5c7b1e59d..87a5760be13 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query.go +++ b/modules/core/04-channel/v2/keeper/grpc_query.go @@ -51,6 +51,38 @@ 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()) + } + + channel, found := q.GetChannel(ctx, req.ChannelId) + if !found { + return nil, status.Error(codes.NotFound, errorsmod.Wrapf(types.ErrChannelNotFound, "channel-id: %s", req.ChannelId).Error()) + } + + consHeight := clienttypes.NewHeight(req.RevisionNumber, req.RevisionHeight) + consensusState, found := q.ClientKeeper.GetClientConsensusState(ctx, channel.ClientId, consHeight) + if !found { + return nil, status.Error( + codes.NotFound, + errorsmod.Wrapf(clienttypes.ErrConsensusStateNotFound, "client-id: %s", channel.ClientId).Error(), + ) + } + + anyConsensusState, err := clienttypes.PackConsensusState(consensusState) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return types.NewQueryChannelConsensusStateResponse(channel.ClientId, anyConsensusState, nil, clienttypes.GetSelfHeight(ctx)), 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/expected_keepers.go b/modules/core/04-channel/v2/types/expected_keepers.go index 5a1a0a5d058..8582f98e8ca 100644 --- a/modules/core/04-channel/v2/types/expected_keepers.go +++ b/modules/core/04-channel/v2/types/expected_keepers.go @@ -19,4 +19,6 @@ type ClientKeeper interface { // GetClientTimestampAtHeight returns the timestamp for a given height on the client // given its client ID and height GetClientTimestampAtHeight(ctx context.Context, clientID string, height exported.Height) (uint64, error) + // GetClientConsensusState gets the stored consensus state from a client at a given height. + GetClientConsensusState(ctx context.Context, clientID string, height exported.Height) (exported.ConsensusState, bool) } diff --git a/modules/core/04-channel/v2/types/query.go b/modules/core/04-channel/v2/types/query.go index b02d0275537..658a01d2b75 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,16 @@ func NewQueryChannelResponse(channel Channel) *QueryChannelResponse { } } +// 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..5dc28af0d3a 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,145 @@ 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"` + // revision number of the consensus state + RevisionNumber uint64 `protobuf:"varint,2,opt,name=revision_number,json=revisionNumber,proto3" json:"revision_number,omitempty"` + // revision height of the consensus state + RevisionHeight uint64 `protobuf:"varint,3,opt,name=revision_height,json=revisionHeight,proto3" json:"revision_height,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 "" +} + +func (m *QueryChannelConsensusStateRequest) GetRevisionNumber() uint64 { + if m != nil { + return m.RevisionNumber + } + return 0 +} + +func (m *QueryChannelConsensusStateRequest) GetRevisionHeight() uint64 { + if m != nil { + return m.RevisionHeight + } + return 0 +} + +// 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 +272,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 +315,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 +365,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 +384,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 +434,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 +484,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 +503,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 +553,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 +603,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 +622,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 +672,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 +722,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 +744,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 +801,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 +851,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 +872,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 +929,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 +979,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 +998,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 +1046,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 +1089,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 +1109,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 +1158,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 +1201,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 +1234,86 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/query.proto", fileDescriptor_a328cba4986edcab) } var fileDescriptor_a328cba4986edcab = []byte{ - // 1113 bytes of a gzipped FileDescriptorProto + // 1254 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, 0x59, 0xcc, 0xe5, 0x18, 0x7c, 0xf7, 0x25, 0x83, 0x19, 0x8c, 0x3f, 0x92, 0xe1, - 0x93, 0x77, 0x2a, 0x5f, 0x82, 0x13, 0x1f, 0x0f, 0xc1, 0xaf, 0x7b, 0x59, 0x55, 0x7a, 0xb7, 0x4f, - 0x1d, 0x17, 0x9f, 0x06, 0x10, 0x38, 0x1a, 0x66, 0xab, 0x84, 0x2a, 0xa8, 0x3a, 0xaf, 0xce, 0x8b, - 0x93, 0x8d, 0x96, 0xfc, 0x09, 0x2c, 0x45, 0xbd, 0x1c, 0x9b, 0x59, 0x0e, 0xc5, 0x57, 0x60, 0x56, - 0x18, 0x71, 0x9f, 0x62, 0x7d, 0x59, 0x49, 0xa8, 0x9d, 0x22, 0xdc, 0xd6, 0x66, 0x1e, 0xfe, 0x7e, - 0x66, 0x4a, 0xf5, 0x5d, 0xe4, 0xab, 0xb0, 0xcc, 0xa3, 0x7e, 0x44, 0x77, 0xdc, 0xad, 0x21, 0x10, - 0x4b, 0xa7, 0x5b, 0xd4, 0x6a, 0x65, 0x04, 0xf5, 0x3d, 0x82, 0xd3, 0x13, 0xfc, 0x05, 0xbc, 0xf3, - 0x80, 0x2d, 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 0xf2, 0xe9, 0xb0, 0x06, 0xdb, 0xf4, + 0x4c, 0x8f, 0x24, 0x83, 0x86, 0x2f, 0xc0, 0x44, 0x9d, 0x34, 0x6d, 0x66, 0x53, 0xa7, 0xe8, 0x34, + 0x6a, 0x25, 0x52, 0x9f, 0xce, 0xcc, 0xa3, 0xfc, 0xa0, 0x31, 0xee, 0x8b, 0x6f, 0x73, 0x69, 0x40, + 0x71, 0x9b, 0xd8, 0x95, 0x6d, 0x6f, 0x3a, 0x1b, 0x54, 0xbc, 0xc9, 0xa5, 0xea, 0xaf, 0x08, 0xd4, + 0x38, 0x58, 0x92, 0xfb, 0x32, 0x4c, 0x58, 0xfe, 0x97, 0x22, 0x6b, 0x7d, 0x92, 0x31, 0x98, 0xd2, + 0x44, 0x52, 0x34, 0x3f, 0x29, 0xda, 0x8a, 0xb3, 0x67, 0x8c, 0x5b, 0x01, 0x37, 0x78, 0x16, 0x46, + 0x44, 0x9e, 0x5b, 0xac, 0x32, 0x9c, 0xd5, 0xb0, 0x10, 0xac, 0x97, 0xf1, 0x14, 0x9c, 0x70, 0xeb, + 0x94, 0x6e, 0x71, 0x84, 0x63, 0x86, 0x78, 0xc1, 0x6b, 0x30, 0xc6, 0x1f, 0x7c, 0xf8, 0x83, 0xfc, + 0x38, 0xa5, 0x2b, 0xe4, 0xa2, 0x70, 0x9a, 0x8b, 0x9a, 0xa0, 0x22, 0x03, 0x3e, 0xca, 0xad, 0x24, + 0xbb, 0x65, 0x98, 0xe3, 0xe4, 0x6e, 0x93, 0x5d, 0x6f, 0xb3, 0x15, 0x62, 0xc7, 0x22, 0x9b, 0xc4, + 0x29, 0x27, 0xac, 0x84, 0x6f, 0x11, 0x9c, 0xed, 0x63, 0x2f, 0xe3, 0x72, 0x09, 0xb0, 0x43, 0x76, + 0xbd, 0x22, 0x93, 0x1f, 0x8b, 0x8c, 0x38, 0xc2, 0xd1, 0xa0, 0x31, 0xe9, 0x84, 0xac, 0x3a, 0x4c, + 0x33, 0x71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x59, 0x97, 0xe3, 0x28, 0x76, 0x4a, 0xa6, + 0x3d, 0x9a, 0xd8, 0x74, 0x76, 0x3e, 0x9b, 0x1f, 0x34, 0x66, 0xdc, 0x50, 0x81, 0xfa, 0x23, 0x8a, + 0xa9, 0x7f, 0x23, 0x78, 0x39, 0x96, 0x8d, 0x0c, 0xfd, 0x7b, 0x30, 0x19, 0x8a, 0x71, 0xf2, 0x6a, + 0xee, 0xb1, 0xfc, 0x3f, 0x94, 0x34, 0x85, 0x99, 0x2e, 0xde, 0x06, 0xb1, 0x88, 0xed, 0xb6, 0x4b, + 0xf9, 0x25, 0x18, 0x72, 0x69, 0xdd, 0xeb, 0x64, 0xee, 0x64, 0xeb, 0x75, 0xbd, 0x1c, 0xca, 0x6a, + 0x26, 0xae, 0xc6, 0xb3, 0xa1, 0x1a, 0x7f, 0x80, 0x40, 0x89, 0x3a, 0x51, 0x06, 0x58, 0x81, 0xe1, + 0x7a, 0x4b, 0xd4, 0x24, 0xc2, 0xef, 0xb0, 0xd1, 0x7e, 0x3f, 0xce, 0xeb, 0xf2, 0x8e, 0x9c, 0xa5, + 0x1f, 0x39, 0xfe, 0x69, 0x02, 0x5e, 0xd2, 0x3a, 0x9e, 0x83, 0x91, 0x4e, 0xb5, 0x65, 0x78, 0xb5, + 0x75, 0x04, 0xea, 0xae, 0x1c, 0x90, 0x11, 0xde, 0x25, 0xed, 0x80, 0x3d, 0x0a, 0xd9, 0x77, 0xa5, + 0x37, 0x93, 0x32, 0xbd, 0x35, 0x19, 0xec, 0xce, 0xc9, 0x2b, 0xd6, 0x4e, 0x52, 0x52, 0x0b, 0x30, + 0x25, 0x9b, 0xca, 0xb4, 0x76, 0x8a, 0x61, 0x7e, 0xd8, 0xf5, 0x5b, 0xa5, 0xd3, 0x46, 0x0d, 0x98, + 0x8d, 0x3c, 0xee, 0x78, 0x59, 0x16, 0xfe, 0x99, 0x80, 0x13, 0xfc, 0x5c, 0xfc, 0x15, 0x82, 0x21, + 0xb9, 0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, 0x42, 0xe8, 0xed, + 0xb9, 0x84, 0x95, 0x4e, 0xf2, 0xbf, 0x76, 0xae, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x26, 0xef, + 0x93, 0x8c, 0x66, 0x14, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1179,6 +1330,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 +1368,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 +1453,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 +1481,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 +1531,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 +1701,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 +1805,105 @@ 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 m.RevisionHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.RevisionHeight)) + i-- + dAtA[i] = 0x18 + } + if m.RevisionNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.RevisionNumber)) + i-- + dAtA[i] = 0x10 + } + 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 +2265,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 +2476,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 +2534,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 +2575,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 +2633,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,7 +2688,7 @@ func (m *QueryChannelResponse) Size() (n int) { return n } -func (m *QueryNextSequenceSendRequest) Size() (n int) { +func (m *QueryChannelConsensusStateRequest) Size() (n int) { if m == nil { return 0 } @@ -2408,17 +2698,28 @@ func (m *QueryNextSequenceSendRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.RevisionNumber != 0 { + n += 1 + sovQuery(uint64(m.RevisionNumber)) + } + if m.RevisionHeight != 0 { + n += 1 + sovQuery(uint64(m.RevisionHeight)) + } return n } -func (m *QueryNextSequenceSendResponse) Size() (n int) { +func (m *QueryChannelConsensusStateResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.NextSequenceSend != 0 { - n += 1 + sovQuery(uint64(m.NextSequenceSend)) + 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 { @@ -2429,7 +2730,7 @@ func (m *QueryNextSequenceSendResponse) Size() (n int) { return n } -func (m *QueryPacketCommitmentRequest) Size() (n int) { +func (m *QueryNextSequenceSendRequest) Size() (n int) { if m == nil { return 0 } @@ -2439,20 +2740,51 @@ func (m *QueryPacketCommitmentRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if m.Sequence != 0 { - n += 1 + sovQuery(uint64(m.Sequence)) - } return n } -func (m *QueryPacketCommitmentResponse) Size() (n int) { +func (m *QueryNextSequenceSendResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Commitment) - if l > 0 { + if m.NextSequenceSend != 0 { + n += 1 + sovQuery(uint64(m.NextSequenceSend)) + } + 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 *QueryPacketCommitmentRequest) 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)) + } + if m.Sequence != 0 { + n += 1 + sovQuery(uint64(m.Sequence)) + } + return n +} + +func (m *QueryPacketCommitmentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Commitment) + if l > 0 { n += 1 + l + sovQuery(uint64(l)) } l = len(m.Proof) @@ -2867,6 +3199,311 @@ 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 + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RevisionNumber", wireType) + } + m.RevisionNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RevisionNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RevisionHeight", wireType) + } + m.RevisionHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RevisionHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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..8232a344110 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,78 @@ func local_request_Query_Channel_0(ctx context.Context, marshaler runtime.Marsha } +var ( + filter_Query_ChannelConsensusState_0 = &utilities.DoubleArray{Encoding: map[string]int{"channel_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +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) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ChannelConsensusState_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", 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) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ChannelConsensusState_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", 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 +784,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 +1052,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 +1238,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 +1260,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..13b4aa637de 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,30 @@ 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; + // revision number of the consensus state + uint64 revision_number = 2; + // revision height of the consensus state + uint64 revision_height = 3; +} + +// 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