From f08fc12ab514c534afe2bacb22c898d824c90111 Mon Sep 17 00:00:00 2001 From: lacsomot <153717732+lacsomot@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:10:53 +0700 Subject: [PATCH] chore: add unreceived packets rpc (#7561) * add UnreceivedPackets query * lint * minor * use HasChannel and correct flag * add unit test * lint * fix expErr * Update modules/core/04-channel/v2/keeper/grpc_query.go Co-authored-by: Damian Nolan * using HasPacketReceipt --------- Co-authored-by: Damian Nolan --- modules/core/04-channel/v2/client/cli/cli.go | 1 + .../core/04-channel/v2/client/cli/query.go | 44 + .../core/04-channel/v2/keeper/grpc_query.go | 49 ++ .../04-channel/v2/keeper/grpc_query_test.go | 149 ++++ modules/core/04-channel/v2/types/query.go | 8 + modules/core/04-channel/v2/types/query.pb.go | 752 ++++++++++++++++-- .../core/04-channel/v2/types/query.pb.gw.go | 123 +++ proto/ibc/core/channel/v2/query.proto | 20 + 8 files changed, 1073 insertions(+), 73 deletions(-) diff --git a/modules/core/04-channel/v2/client/cli/cli.go b/modules/core/04-channel/v2/client/cli/cli.go index a333b0c5055..c9a0d954287 100644 --- a/modules/core/04-channel/v2/client/cli/cli.go +++ b/modules/core/04-channel/v2/client/cli/cli.go @@ -25,6 +25,7 @@ func GetQueryCmd() *cobra.Command { getCmdQueryPacketCommitments(), getCmdQueryPacketAcknowledgement(), getCmdQueryPacketReceipt(), + getCmdQueryUnreceivedPackets(), getCmdQueryUnreceivedAcks(), ) diff --git a/modules/core/04-channel/v2/client/cli/query.go b/modules/core/04-channel/v2/client/cli/query.go index 66d465afe3c..2be1a004d3e 100644 --- a/modules/core/04-channel/v2/client/cli/query.go +++ b/modules/core/04-channel/v2/client/cli/query.go @@ -287,6 +287,50 @@ func getCmdQueryPacketReceipt() *cobra.Command { return cmd } +// getCmdQueryUnreceivedPackets defines the command to query all the unreceived +// packets on the receiving chain +func getCmdQueryUnreceivedPackets() *cobra.Command { + cmd := &cobra.Command{ + Use: "unreceived-packets [channel-id]", + Short: "Query a channel/v2 unreceived-packets", + Long: "Query a channel/v2 unreceived-packets by channel-id and sequences", + Example: fmt.Sprintf( + "%s query %s %s unreceived-packet [channel-id] --sequences=1,2,3", 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] + seqSlice, err := cmd.Flags().GetInt64Slice(flagSequences) + if err != nil { + return err + } + + seqs := make([]uint64, len(seqSlice)) + for i := range seqSlice { + seqs[i] = uint64(seqSlice[i]) + } + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.UnreceivedPackets(cmd.Context(), types.NewQueryUnreceivedPacketsRequest(channelID, seqs)) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + cmd.Flags().Int64Slice(flagSequences, []int64{}, "comma separated list of packet sequence numbers") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + // getCmdQueryUnreceivedAcks defines the command to query all the unreceived acks on the original sending chain func getCmdQueryUnreceivedAcks() *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 7495f40763f..644fa315fb5 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query.go +++ b/modules/core/04-channel/v2/keeper/grpc_query.go @@ -188,6 +188,55 @@ func (q *queryServer) PacketReceipt(ctx context.Context, req *types.QueryPacketR return types.NewQueryPacketReceiptResponse(hasReceipt, nil, clienttypes.GetSelfHeight(ctx)), nil } +// UnreceivedPackets implements the Query/UnreceivedPackets gRPC method. Given +// a list of counterparty packet commitments, the querier checks if the packet +// has already been received by checking if a receipt exists on this +// chain for the packet sequence. All packets that haven't been received yet +// are returned in the response +// Usage: To use this method correctly, first query all packet commitments on +// the sending chain using the Query/PacketCommitments gRPC method. +// Then input the returned sequences into the QueryUnreceivedPacketsRequest +// and send the request to this Query/UnreceivedPackets on the **receiving** +// chain. This gRPC method will then return the list of packet sequences that +// are yet to be received on the receiving chain. +// +// NOTE: The querier makes the assumption that the provided list of packet +// commitments is correct and will not function properly if the list +// is not up to date. Ideally the query height should equal the latest height +// on the counterparty's client which represents this chain. +func (q *queryServer) UnreceivedPackets(ctx context.Context, req *types.QueryUnreceivedPacketsRequest) (*types.QueryUnreceivedPacketsResponse, 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()) + } + + if !q.HasChannel(ctx, req.ChannelId) { + return nil, status.Error(codes.NotFound, errorsmod.Wrap(types.ErrChannelNotFound, req.ChannelId).Error()) + } + + var unreceivedSequences []uint64 + for i, seq := range req.Sequences { + // filter for invalid sequences to ensure they are not included in the response value. + if seq == 0 { + return nil, status.Errorf(codes.InvalidArgument, "packet sequence %d cannot be 0", i) + } + + // if the packet receipt does not exist, then it is unreceived + if !q.HasPacketReceipt(ctx, req.ChannelId, seq) { + unreceivedSequences = append(unreceivedSequences, seq) + } + } + + selfHeight := clienttypes.GetSelfHeight(ctx) + return &types.QueryUnreceivedPacketsResponse{ + Sequences: unreceivedSequences, + Height: selfHeight, + }, nil +} + // UnreceivedAcks implements the Query/UnreceivedAcks gRPC method. Given // a list of counterparty packet acknowledgements, the querier checks if the packet // has already been received by checking if the packet commitment still exists on this diff --git a/modules/core/04-channel/v2/keeper/grpc_query_test.go b/modules/core/04-channel/v2/keeper/grpc_query_test.go index 03d4e886dd5..b0e107328d3 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query_test.go +++ b/modules/core/04-channel/v2/keeper/grpc_query_test.go @@ -587,6 +587,155 @@ func (suite *KeeperTestSuite) TestQueryNextSequenceSend() { } } +func (suite *KeeperTestSuite) TestQueryUnreceivedPackets() { + var ( + expSeq []uint64 + path *ibctesting.Path + req *types.QueryUnreceivedPacketsRequest + ) + + testCases := []struct { + msg string + malleate func() + expError error + }{ + { + "empty request", + func() { + req = nil + }, + status.Error(codes.InvalidArgument, "empty request"), + }, + { + "invalid channel ID", + func() { + req = &types.QueryUnreceivedPacketsRequest{ + ChannelId: "", + } + }, + status.Error(codes.InvalidArgument, "identifier cannot be blank: invalid identifier"), + }, + { + "invalid seq", + func() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupV2() + + req = &types.QueryUnreceivedPacketsRequest{ + ChannelId: path.EndpointA.ChannelID, + Sequences: []uint64{0}, + } + }, + status.Error(codes.InvalidArgument, "packet sequence 0 cannot be 0"), + }, + { + "channel not found", + func() { + req = &types.QueryUnreceivedPacketsRequest{ + ChannelId: "invalid-channel-id", + } + }, + status.Error(codes.NotFound, fmt.Sprintf("%s: channel not found", "invalid-channel-id")), + }, + { + "basic success empty packet commitments", + func() { + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupV2() + + expSeq = []uint64(nil) + req = &types.QueryUnreceivedPacketsRequest{ + ChannelId: path.EndpointA.ChannelID, + Sequences: []uint64{}, + } + }, + nil, + }, + { + "basic success unreceived packet commitments", + func() { + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupV2() + + // no ack exists + + expSeq = []uint64{1} + req = &types.QueryUnreceivedPacketsRequest{ + ChannelId: path.EndpointA.ChannelID, + Sequences: []uint64{1}, + } + }, + nil, + }, + { + "basic success unreceived packet commitments, nothing to relay", + func() { + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupV2() + + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetPacketReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelID, 1) + + expSeq = []uint64(nil) + req = &types.QueryUnreceivedPacketsRequest{ + ChannelId: path.EndpointA.ChannelID, + Sequences: []uint64{1}, + } + }, + nil, + }, + { + "success multiple unreceived packet commitments", + func() { + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupV2() + expSeq = []uint64(nil) // reset + packetCommitments := []uint64{} + + // set packet receipt for every other sequence + for seq := uint64(1); seq < 10; seq++ { + packetCommitments = append(packetCommitments, seq) + + if seq%2 == 0 { + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetPacketReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelID, seq) + } else { + expSeq = append(expSeq, seq) + } + } + + req = &types.QueryUnreceivedPacketsRequest{ + ChannelId: path.EndpointA.ChannelID, + Sequences: packetCommitments, + } + }, + nil, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() // reset + + tc.malleate() + ctx := suite.chainA.GetContext() + + queryServer := keeper.NewQueryServer(suite.chainA.App.GetIBCKeeper().ChannelKeeperV2) + res, err := queryServer.UnreceivedPackets(ctx, req) + + expPass := tc.expError == nil + if expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(expSeq, res.Sequences) + } else { + suite.Require().ErrorIs(err, tc.expError) + suite.Require().Error(err) + } + }) + } +} + func (suite *KeeperTestSuite) TestQueryUnreceivedAcks() { var ( path *ibctesting.Path diff --git a/modules/core/04-channel/v2/types/query.go b/modules/core/04-channel/v2/types/query.go index 2a70a6481b2..b02d0275537 100644 --- a/modules/core/04-channel/v2/types/query.go +++ b/modules/core/04-channel/v2/types/query.go @@ -84,3 +84,11 @@ func NewQueryPacketReceiptResponse(exists bool, proof []byte, height clienttypes ProofHeight: height, } } + +// NewQueryPacketReceiptRequest creates and returns a new packet receipt query request. +func NewQueryUnreceivedPacketsRequest(channelID string, sequences []uint64) *QueryUnreceivedPacketsRequest { + return &QueryUnreceivedPacketsRequest{ + ChannelId: channelID, + Sequences: sequences, + } +} diff --git a/modules/core/04-channel/v2/types/query.pb.go b/modules/core/04-channel/v2/types/query.pb.go index 89675bdba42..32b16b47518 100644 --- a/modules/core/04-channel/v2/types/query.pb.go +++ b/modules/core/04-channel/v2/types/query.pb.go @@ -717,6 +717,116 @@ func (m *QueryPacketReceiptResponse) GetProofHeight() types.Height { return types.Height{} } +// QueryUnreceivedPacketsRequest is the request type for the Query/UnreceivedPackets RPC method +type QueryUnreceivedPacketsRequest struct { + // channel unique identifier + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // list of packet sequences + Sequences []uint64 `protobuf:"varint,2,rep,packed,name=sequences,proto3" json:"sequences,omitempty"` +} + +func (m *QueryUnreceivedPacketsRequest) Reset() { *m = QueryUnreceivedPacketsRequest{} } +func (m *QueryUnreceivedPacketsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryUnreceivedPacketsRequest) ProtoMessage() {} +func (*QueryUnreceivedPacketsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a328cba4986edcab, []int{12} +} +func (m *QueryUnreceivedPacketsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUnreceivedPacketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUnreceivedPacketsRequest.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 *QueryUnreceivedPacketsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUnreceivedPacketsRequest.Merge(m, src) +} +func (m *QueryUnreceivedPacketsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryUnreceivedPacketsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUnreceivedPacketsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUnreceivedPacketsRequest proto.InternalMessageInfo + +func (m *QueryUnreceivedPacketsRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *QueryUnreceivedPacketsRequest) GetSequences() []uint64 { + if m != nil { + return m.Sequences + } + return nil +} + +// QueryUnreceivedPacketsResponse is the response type for the Query/UnreceivedPacketCommitments RPC method +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"` +} + +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{13} +} +func (m *QueryUnreceivedPacketsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUnreceivedPacketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUnreceivedPacketsResponse.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 *QueryUnreceivedPacketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUnreceivedPacketsResponse.Merge(m, src) +} +func (m *QueryUnreceivedPacketsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryUnreceivedPacketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUnreceivedPacketsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUnreceivedPacketsResponse proto.InternalMessageInfo + +func (m *QueryUnreceivedPacketsResponse) GetSequences() []uint64 { + if m != nil { + return m.Sequences + } + return nil +} + +func (m *QueryUnreceivedPacketsResponse) GetHeight() types.Height { + if m != nil { + return m.Height + } + return types.Height{} +} + // QueryUnreceivedAcks is the request type for the // Query/UnreceivedAcks RPC method type QueryUnreceivedAcksRequest struct { @@ -730,7 +840,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{12} + return fileDescriptor_a328cba4986edcab, []int{14} } func (m *QueryUnreceivedAcksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -786,7 +896,7 @@ func (m *QueryUnreceivedAcksResponse) Reset() { *m = QueryUnreceivedAcks func (m *QueryUnreceivedAcksResponse) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedAcksResponse) ProtoMessage() {} func (*QueryUnreceivedAcksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{13} + return fileDescriptor_a328cba4986edcab, []int{15} } func (m *QueryUnreceivedAcksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -842,6 +952,8 @@ func init() { proto.RegisterType((*QueryPacketAcknowledgementResponse)(nil), "ibc.core.channel.v2.QueryPacketAcknowledgementResponse") proto.RegisterType((*QueryPacketReceiptRequest)(nil), "ibc.core.channel.v2.QueryPacketReceiptRequest") proto.RegisterType((*QueryPacketReceiptResponse)(nil), "ibc.core.channel.v2.QueryPacketReceiptResponse") + proto.RegisterType((*QueryUnreceivedPacketsRequest)(nil), "ibc.core.channel.v2.QueryUnreceivedPacketsRequest") + proto.RegisterType((*QueryUnreceivedPacketsResponse)(nil), "ibc.core.channel.v2.QueryUnreceivedPacketsResponse") proto.RegisterType((*QueryUnreceivedAcksRequest)(nil), "ibc.core.channel.v2.QueryUnreceivedAcksRequest") proto.RegisterType((*QueryUnreceivedAcksResponse)(nil), "ibc.core.channel.v2.QueryUnreceivedAcksResponse") } @@ -849,68 +961,72 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/query.proto", fileDescriptor_a328cba4986edcab) } var fileDescriptor_a328cba4986edcab = []byte{ - // 974 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4d, 0x6f, 0x1b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- 0xff, 0x4d, 0x7e, 0xd3, 0xbd, 0xea, 0x71, 0x32, 0x78, 0x8f, 0x74, 0x79, 0xab, 0xdf, 0xa1, 0x22, - 0x84, 0xb7, 0x79, 0xfd, 0x6a, 0x0c, 0xa1, 0x7c, 0x10, 0x50, 0xd1, 0x5c, 0x54, 0x7f, 0x55, 0xae, - 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0xf9, 0xcb, 0xc4, 0x1e, 0xa9, 0x0d, 0x00, 0x00, + // 1028 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x5d, 0x6f, 0xdb, 0x54, + 0x18, 0xee, 0x49, 0xb2, 0xb5, 0x7d, 0x53, 0xa0, 0x3b, 0x2b, 0x22, 0x98, 0x2e, 0xcb, 0x7c, 0x01, + 0x61, 0xda, 0x7c, 0x9a, 0x6c, 0xe2, 0x43, 0xda, 0x84, 0xda, 0x6a, 0x6c, 0x45, 0x02, 0x15, 0x17, + 0x90, 0x40, 0xd3, 0x22, 0xc7, 0x39, 0x73, 0xad, 0x24, 0x3e, 0x5e, 0xec, 0x84, 0x4e, 0x53, 0x6f, + 0xb8, 0xe0, 0x1a, 0xb1, 0x3b, 0x7e, 0x01, 0xfc, 0x0a, 0x90, 0xb8, 0x99, 0xc4, 0xcd, 0xa4, 0x71, + 0xc1, 0x15, 0x82, 0x16, 0x89, 0xbf, 0x81, 0x72, 0xce, 0x71, 0x62, 0x27, 0xb6, 0x6b, 0xb3, 0xf5, + 0xce, 0x3e, 0x79, 0x3f, 0x9e, 0xe7, 0xf1, 0xfb, 0xfa, 0x89, 0xe1, 0xa2, 0xdd, 0x36, 0x89, 0xc9, + 0x06, 0x94, 0x98, 0xfb, 0x86, 0xe3, 0xd0, 0x1e, 0x19, 0x35, 0xc9, 0x83, 0x21, 0x1d, 0x3c, 0xd4, + 0xdc, 0x01, 0xf3, 0x19, 0x3e, 0x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 0x11, 0xdb, 0xee, 0x74, 0x59, 0x36, 0x7f, + 0x5f, 0x81, 0x33, 0xbc, 0x2f, 0xfe, 0x1e, 0xc1, 0xa2, 0xb4, 0x52, 0x5c, 0x8f, 0x7d, 0x31, 0xc5, + 0x58, 0xbb, 0xf2, 0x76, 0x86, 0x48, 0x41, 0x41, 0x6d, 0x7e, 0xf3, 0xec, 0x9f, 0xc7, 0x85, 0x2b, + 0xf8, 0x32, 0x49, 0xf9, 0x03, 0xe3, 0x91, 0x47, 0x53, 0x5d, 0x0f, 0xf1, 0x2f, 0x08, 0x56, 0x67, + 0x0d, 0x18, 0x37, 0x92, 0x7b, 0x26, 0x98, 0xbd, 0xd2, 0xcc, 0x93, 0x22, 0xf1, 0xde, 0xe2, 0x78, + 0x3f, 0xc0, 0x37, 0xb3, 0xe3, 0x25, 0xf3, 0x7f, 0x08, 0xf0, 0x6f, 0x08, 0x56, 0x67, 0x7d, 0x21, + 0x8d, 0x42, 0x82, 0x8b, 0xa7, 0x51, 0x48, 0x32, 0x67, 0x75, 0x97, 0x53, 0xf8, 0x08, 0xdf, 0xc9, + 0x41, 0x41, 0xce, 0x6d, 0xc8, 0x78, 0xc8, 0xa3, 0x80, 0xd1, 0x21, 0xfe, 0x15, 0xc1, 0xb9, 0x39, + 0x97, 0xc3, 0x39, 0xb0, 0x05, 0x1b, 0xa4, 0x5c, 0xcb, 0x95, 0xf3, 0x1c, 0xcf, 0x64, 0x9e, 0x10, + 0x7e, 0x86, 0xe0, 0xd5, 0x58, 0x87, 0xc1, 0xef, 0x9c, 0x84, 0x2a, 0xde, 0xf3, 0x94, 0x77, 0x73, + 0xe7, 0x49, 0x46, 0x3b, 0x9c, 0xd1, 0x36, 0xde, 0xcc, 0xcf, 0xc8, 0x30, 0xbb, 0x91, 0x67, 0xf3, + 0x33, 0x82, 0x97, 0x22, 0xd6, 0x80, 0xb5, 0x93, 0x50, 0x45, 0x5d, 0x4b, 0x21, 0x99, 0xe3, 0x25, + 0xfa, 0x8f, 0x39, 0xfa, 0xdb, 0xf8, 0x56, 0x7e, 0xf4, 0x03, 0x51, 0x2a, 0xc2, 0xe0, 0x08, 0xc1, + 0xb9, 0xb9, 0x37, 0x7d, 0xda, 0x74, 0x25, 0x99, 0x4e, 0xda, 0x74, 0x25, 0x5a, 0x89, 0xda, 0xe1, + 0x6c, 0xee, 0xe1, 0xbb, 0x2f, 0x68, 0x5d, 0xbc, 0x43, 0x32, 0x9c, 0x34, 0x6b, 0xb9, 0x92, 0xce, + 0xdf, 0x08, 0x5e, 0x8e, 0xbe, 0xe5, 0x31, 0xc9, 0x82, 0x36, 0x64, 0x3f, 0xca, 0x46, 0xf6, 0x04, + 0xc9, 0xad, 0xc7, 0xb9, 0xdd, 0xc7, 0x9d, 0xe7, 0xe4, 0x16, 0x67, 0x6b, 0x11, 0x9a, 0xe3, 0xa9, + 0xdc, 0xfa, 0xe2, 0xc9, 0x51, 0x15, 0x3d, 0x3d, 0xaa, 0xa2, 0xbf, 0x8e, 0xaa, 0xe8, 0xbb, 0xe3, + 0xea, 0xc2, 0xd3, 0xe3, 0xea, 0xc2, 0x1f, 0xc7, 0xd5, 0x85, 0xaf, 0x6e, 0x58, 0xb6, 0xbf, 0x3f, + 0x6c, 0x6b, 0x26, 0xeb, 0x13, 0xf9, 0xd1, 0x6b, 0xb7, 0xcd, 0xab, 0x16, 0x23, 0xa3, 0xf7, 0x49, + 0x9f, 0x75, 0x86, 0x3d, 0xea, 0x09, 0x78, 0x1b, 0xd7, 0xaf, 0x86, 0x10, 0xfa, 0x0f, 0x5d, 0xea, + 0xb5, 0xcf, 0xf2, 0xef, 0xcc, 0x6b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x92, 0x15, 0x18, + 0x66, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -937,6 +1053,7 @@ type QueryClient interface { PacketAcknowledgement(ctx context.Context, in *QueryPacketAcknowledgementRequest, opts ...grpc.CallOption) (*QueryPacketAcknowledgementResponse, error) // PacketReceipt queries a stored packet receipt. PacketReceipt(ctx context.Context, in *QueryPacketReceiptRequest, opts ...grpc.CallOption) (*QueryPacketReceiptResponse, error) + UnreceivedPackets(ctx context.Context, in *QueryUnreceivedPacketsRequest, opts ...grpc.CallOption) (*QueryUnreceivedPacketsResponse, error) // UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences. UnreceivedAcks(ctx context.Context, in *QueryUnreceivedAcksRequest, opts ...grpc.CallOption) (*QueryUnreceivedAcksResponse, error) } @@ -1003,6 +1120,15 @@ func (c *queryClient) PacketReceipt(ctx context.Context, in *QueryPacketReceiptR return out, nil } +func (c *queryClient) UnreceivedPackets(ctx context.Context, in *QueryUnreceivedPacketsRequest, opts ...grpc.CallOption) (*QueryUnreceivedPacketsResponse, error) { + out := new(QueryUnreceivedPacketsResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/UnreceivedPackets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) UnreceivedAcks(ctx context.Context, in *QueryUnreceivedAcksRequest, opts ...grpc.CallOption) (*QueryUnreceivedAcksResponse, error) { out := new(QueryUnreceivedAcksResponse) err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/UnreceivedAcks", in, out, opts...) @@ -1026,6 +1152,7 @@ type QueryServer interface { PacketAcknowledgement(context.Context, *QueryPacketAcknowledgementRequest) (*QueryPacketAcknowledgementResponse, error) // PacketReceipt queries a stored packet receipt. PacketReceipt(context.Context, *QueryPacketReceiptRequest) (*QueryPacketReceiptResponse, error) + UnreceivedPackets(context.Context, *QueryUnreceivedPacketsRequest) (*QueryUnreceivedPacketsResponse, error) // UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences. UnreceivedAcks(context.Context, *QueryUnreceivedAcksRequest) (*QueryUnreceivedAcksResponse, error) } @@ -1052,6 +1179,9 @@ func (*UnimplementedQueryServer) PacketAcknowledgement(ctx context.Context, req func (*UnimplementedQueryServer) PacketReceipt(ctx context.Context, req *QueryPacketReceiptRequest) (*QueryPacketReceiptResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PacketReceipt not implemented") } +func (*UnimplementedQueryServer) UnreceivedPackets(ctx context.Context, req *QueryUnreceivedPacketsRequest) (*QueryUnreceivedPacketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnreceivedPackets not implemented") +} func (*UnimplementedQueryServer) UnreceivedAcks(ctx context.Context, req *QueryUnreceivedAcksRequest) (*QueryUnreceivedAcksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnreceivedAcks not implemented") } @@ -1168,6 +1298,24 @@ func _Query_PacketReceipt_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_UnreceivedPackets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryUnreceivedPacketsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).UnreceivedPackets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v2.Query/UnreceivedPackets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).UnreceivedPackets(ctx, req.(*QueryUnreceivedPacketsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_UnreceivedAcks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryUnreceivedAcksRequest) if err := dec(in); err != nil { @@ -1214,6 +1362,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PacketReceipt", Handler: _Query_PacketReceipt_Handler, }, + { + MethodName: "UnreceivedPackets", + Handler: _Query_UnreceivedPackets_Handler, + }, { MethodName: "UnreceivedAcks", Handler: _Query_UnreceivedAcks_Handler, @@ -1718,7 +1870,7 @@ func (m *QueryPacketReceiptResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryUnreceivedAcksRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryUnreceivedPacketsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1728,20 +1880,20 @@ func (m *QueryUnreceivedAcksRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryUnreceivedAcksRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryUnreceivedPacketsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryUnreceivedAcksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryUnreceivedPacketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.PacketAckSequences) > 0 { - dAtA10 := make([]byte, len(m.PacketAckSequences)*10) + if len(m.Sequences) > 0 { + dAtA10 := make([]byte, len(m.Sequences)*10) var j9 int - for _, num := range m.PacketAckSequences { + for _, num := range m.Sequences { for num >= 1<<7 { dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -1766,7 +1918,7 @@ func (m *QueryUnreceivedAcksRequest) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryUnreceivedAcksResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryUnreceivedPacketsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1776,12 +1928,12 @@ func (m *QueryUnreceivedAcksResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryUnreceivedAcksResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryUnreceivedPacketsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryUnreceivedAcksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryUnreceivedPacketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1817,6 +1969,105 @@ func (m *QueryUnreceivedAcksResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *QueryUnreceivedAcksRequest) 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 *QueryUnreceivedAcksRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUnreceivedAcksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PacketAckSequences) > 0 { + dAtA15 := make([]byte, len(m.PacketAckSequences)*10) + var j14 int + for _, num := range m.PacketAckSequences { + for num >= 1<<7 { + dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j14++ + } + dAtA15[j14] = uint8(num) + j14++ + } + i -= j14 + copy(dAtA[i:], dAtA15[:j14]) + i = encodeVarintQuery(dAtA, i, uint64(j14)) + i-- + dAtA[i] = 0x12 + } + 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 *QueryUnreceivedAcksResponse) 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 *QueryUnreceivedAcksResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUnreceivedAcksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Height.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sequences) > 0 { + dAtA18 := make([]byte, len(m.Sequences)*10) + var j17 int + for _, num := range m.Sequences { + for num >= 1<<7 { + dAtA18[j17] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j17++ + } + dAtA18[j17] = uint8(num) + j17++ + } + i -= j17 + copy(dAtA[i:], dAtA18[:j17]) + i = encodeVarintQuery(dAtA, i, uint64(j17)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2029,6 +2280,44 @@ func (m *QueryPacketReceiptResponse) Size() (n int) { return n } +func (m *QueryUnreceivedPacketsRequest) 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 len(m.Sequences) > 0 { + l = 0 + for _, e := range m.Sequences { + l += sovQuery(uint64(e)) + } + n += 1 + sovQuery(uint64(l)) + l + } + return n +} + +func (m *QueryUnreceivedPacketsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Sequences) > 0 { + l = 0 + for _, e := range m.Sequences { + l += sovQuery(uint64(e)) + } + n += 1 + sovQuery(uint64(l)) + l + } + l = m.Height.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryUnreceivedAcksRequest) Size() (n int) { if m == nil { return 0 @@ -3501,6 +3790,323 @@ func (m *QueryPacketReceiptResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryUnreceivedPacketsRequest) 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: QueryUnreceivedPacketsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUnreceivedPacketsRequest: 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 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sequences = append(m.Sequences, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Sequences) == 0 { + m.Sequences = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sequences = append(m.Sequences, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Sequences", wireType) + } + 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 *QueryUnreceivedPacketsResponse) 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: QueryUnreceivedPacketsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUnreceivedPacketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sequences = append(m.Sequences, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.Sequences) == 0 { + m.Sequences = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sequences = append(m.Sequences, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Sequences", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", 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.Height.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 *QueryUnreceivedAcksRequest) 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 995de0f48cc..9454ddcb63a 100644 --- a/modules/core/04-channel/v2/types/query.pb.gw.go +++ b/modules/core/04-channel/v2/types/query.pb.gw.go @@ -459,6 +459,82 @@ func local_request_Query_PacketReceipt_0(ctx context.Context, marshaler runtime. } +func request_Query_UnreceivedPackets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUnreceivedPacketsRequest + 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) + } + + val, ok = pathParams["sequences"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequences") + } + + protoReq.Sequences, err = runtime.Uint64Slice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequences", err) + } + + msg, err := client.UnreceivedPackets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_UnreceivedPackets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUnreceivedPacketsRequest + 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) + } + + val, ok = pathParams["sequences"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequences") + } + + protoReq.Sequences, err = runtime.Uint64Slice(val, ",") + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequences", err) + } + + msg, err := server.UnreceivedPackets(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_UnreceivedAcks_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryUnreceivedAcksRequest var metadata runtime.ServerMetadata @@ -679,6 +755,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_UnreceivedPackets_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_UnreceivedPackets_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_UnreceivedPackets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_UnreceivedAcks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -863,6 +962,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_UnreceivedPackets_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_UnreceivedPackets_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_UnreceivedPackets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_UnreceivedAcks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -899,6 +1018,8 @@ var ( pattern_Query_PacketReceipt_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_receipts", "sequence"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_UnreceivedPackets_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, 2, 8}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_commitments", "sequences", "unreceived_packets"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_UnreceivedAcks_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, 2, 8}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_commitments", "packet_ack_sequences", "unreceived_acks"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -915,5 +1036,7 @@ var ( forward_Query_PacketReceipt_0 = runtime.ForwardResponseMessage + forward_Query_UnreceivedPackets_0 = runtime.ForwardResponseMessage + forward_Query_UnreceivedAcks_0 = runtime.ForwardResponseMessage ) diff --git a/proto/ibc/core/channel/v2/query.proto b/proto/ibc/core/channel/v2/query.proto index 80b54c48e21..ca77940306d 100644 --- a/proto/ibc/core/channel/v2/query.proto +++ b/proto/ibc/core/channel/v2/query.proto @@ -43,6 +43,11 @@ service Query { option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/packet_receipts/{sequence}"; } + rpc UnreceivedPackets(QueryUnreceivedPacketsRequest) returns (QueryUnreceivedPacketsResponse) { + option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/packet_commitments/" + "{sequences}/unreceived_packets"; + } + // UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences. rpc UnreceivedAcks(QueryUnreceivedAcksRequest) returns (QueryUnreceivedAcksResponse) { option (google.api.http).get = @@ -151,6 +156,21 @@ message QueryPacketReceiptResponse { ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; } +// QueryUnreceivedPacketsRequest is the request type for the Query/UnreceivedPackets RPC method +message QueryUnreceivedPacketsRequest { + // channel unique identifier + string channel_id = 1; + // list of packet sequences + repeated uint64 sequences = 2; +} + +// QueryUnreceivedPacketsResponse is the response type for the Query/UnreceivedPacketCommitments RPC method +message QueryUnreceivedPacketsResponse { + // list of unreceived packet sequences + repeated uint64 sequences = 1; + // query block height + ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; +} // QueryUnreceivedAcks is the request type for the // Query/UnreceivedAcks RPC method message QueryUnreceivedAcksRequest {