From bb0bfa5e57f6289c9cce06485488a835ab639b3d Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Thu, 3 Oct 2024 11:40:08 +0100 Subject: [PATCH] chore: add Acknowledgement message proto. (#7381) * chore: add Acknowledgment message! * chore: fix proto mess * random fixes --- .../core/04-channel/v2/types/channel.pb.go | 723 +++++++++++++++++- modules/core/04-channel/v2/types/codec.go | 1 + modules/core/04-channel/v2/types/tx.pb.go | 628 +++++++++++++-- proto/ibc/core/channel/v2/channel.proto | 31 + proto/ibc/core/channel/v2/tx.proto | 23 + 5 files changed, 1335 insertions(+), 71 deletions(-) diff --git a/modules/core/04-channel/v2/types/channel.pb.go b/modules/core/04-channel/v2/types/channel.pb.go index 52cbc2a2dee..6ba9798bb01 100644 --- a/modules/core/04-channel/v2/types/channel.pb.go +++ b/modules/core/04-channel/v2/types/channel.pb.go @@ -23,6 +23,42 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// PacketStatus specifies the status of a RecvPacketResult. +type PacketStatus int32 + +const ( + // PACKET_STATUS_UNSPECIFIED indicates an unknown packet status. + PacketStatus_NONE PacketStatus = 0 + // PACKET_STATUS_SUCCESS indicates a successful packet receipt. + PacketStatus_Success PacketStatus = 1 + // PACKET_STATUS_FAILURE indicates a failed packet receipt. + PacketStatus_Failure PacketStatus = 2 + // PACKET_STATUS_ASYNC indicates an async packet receipt. + PacketStatus_Async PacketStatus = 3 +) + +var PacketStatus_name = map[int32]string{ + 0: "PACKET_STATUS_UNSPECIFIED", + 1: "PACKET_STATUS_SUCCESS", + 2: "PACKET_STATUS_FAILURE", + 3: "PACKET_STATUS_ASYNC", +} + +var PacketStatus_value = map[string]int32{ + "PACKET_STATUS_UNSPECIFIED": 0, + "PACKET_STATUS_SUCCESS": 1, + "PACKET_STATUS_FAILURE": 2, + "PACKET_STATUS_ASYNC": 3, +} + +func (x PacketStatus) String() string { + return proto.EnumName(PacketStatus_name, int32(x)) +} + +func (PacketStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_7e9b57d8f218397d, []int{0} +} + // Packet defines a type that carries data across different chains through IBC type Packet struct { // number corresponds to the order of sends and receives, where a Packet @@ -235,42 +271,215 @@ func (m *Payload) GetValue() []byte { return nil } +// Acknowledgement contains a list of all ack results associated with a single packet. +type Acknowledgement struct { + AcknowledgementResults []AcknowledgementResult `protobuf:"bytes,1,rep,name=acknowledgement_results,json=acknowledgementResults,proto3" json:"acknowledgement_results"` +} + +func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } +func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } +func (*Acknowledgement) ProtoMessage() {} +func (*Acknowledgement) Descriptor() ([]byte, []int) { + return fileDescriptor_7e9b57d8f218397d, []int{3} +} +func (m *Acknowledgement) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Acknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Acknowledgement.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 *Acknowledgement) XXX_Merge(src proto.Message) { + xxx_messageInfo_Acknowledgement.Merge(m, src) +} +func (m *Acknowledgement) XXX_Size() int { + return m.Size() +} +func (m *Acknowledgement) XXX_DiscardUnknown() { + xxx_messageInfo_Acknowledgement.DiscardUnknown(m) +} + +var xxx_messageInfo_Acknowledgement proto.InternalMessageInfo + +func (m *Acknowledgement) GetAcknowledgementResults() []AcknowledgementResult { + if m != nil { + return m.AcknowledgementResults + } + return nil +} + +// AcknowledgementResult of identified acknowledgement. Correlating IBC application name to opaque ack bytes. +type AcknowledgementResult struct { + AppName string `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` + RecvPacketResult RecvPacketResult `protobuf:"bytes,2,opt,name=recv_packet_result,json=recvPacketResult,proto3" json:"recv_packet_result"` +} + +func (m *AcknowledgementResult) Reset() { *m = AcknowledgementResult{} } +func (m *AcknowledgementResult) String() string { return proto.CompactTextString(m) } +func (*AcknowledgementResult) ProtoMessage() {} +func (*AcknowledgementResult) Descriptor() ([]byte, []int) { + return fileDescriptor_7e9b57d8f218397d, []int{4} +} +func (m *AcknowledgementResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AcknowledgementResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AcknowledgementResult.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 *AcknowledgementResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_AcknowledgementResult.Merge(m, src) +} +func (m *AcknowledgementResult) XXX_Size() int { + return m.Size() +} +func (m *AcknowledgementResult) XXX_DiscardUnknown() { + xxx_messageInfo_AcknowledgementResult.DiscardUnknown(m) +} + +var xxx_messageInfo_AcknowledgementResult proto.InternalMessageInfo + +func (m *AcknowledgementResult) GetAppName() string { + if m != nil { + return m.AppName + } + return "" +} + +func (m *AcknowledgementResult) GetRecvPacketResult() RecvPacketResult { + if m != nil { + return m.RecvPacketResult + } + return RecvPacketResult{} +} + +// RecvPacketResult speecifies the status of a packet as well as the acknowledgement bytes. +type RecvPacketResult struct { + // status of the packet + Status PacketStatus `protobuf:"varint,1,opt,name=status,proto3,enum=ibc.core.channel.v2.PacketStatus" json:"status,omitempty"` + // acknowledgement of the packet + Acknowledgement []byte `protobuf:"bytes,2,opt,name=acknowledgement,proto3" json:"acknowledgement,omitempty"` +} + +func (m *RecvPacketResult) Reset() { *m = RecvPacketResult{} } +func (m *RecvPacketResult) String() string { return proto.CompactTextString(m) } +func (*RecvPacketResult) ProtoMessage() {} +func (*RecvPacketResult) Descriptor() ([]byte, []int) { + return fileDescriptor_7e9b57d8f218397d, []int{5} +} +func (m *RecvPacketResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RecvPacketResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RecvPacketResult.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 *RecvPacketResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_RecvPacketResult.Merge(m, src) +} +func (m *RecvPacketResult) XXX_Size() int { + return m.Size() +} +func (m *RecvPacketResult) XXX_DiscardUnknown() { + xxx_messageInfo_RecvPacketResult.DiscardUnknown(m) +} + +var xxx_messageInfo_RecvPacketResult proto.InternalMessageInfo + +func (m *RecvPacketResult) GetStatus() PacketStatus { + if m != nil { + return m.Status + } + return PacketStatus_NONE +} + +func (m *RecvPacketResult) GetAcknowledgement() []byte { + if m != nil { + return m.Acknowledgement + } + return nil +} + func init() { + proto.RegisterEnum("ibc.core.channel.v2.PacketStatus", PacketStatus_name, PacketStatus_value) proto.RegisterType((*Packet)(nil), "ibc.core.channel.v2.Packet") proto.RegisterType((*PacketData)(nil), "ibc.core.channel.v2.PacketData") proto.RegisterType((*Payload)(nil), "ibc.core.channel.v2.Payload") + proto.RegisterType((*Acknowledgement)(nil), "ibc.core.channel.v2.Acknowledgement") + proto.RegisterType((*AcknowledgementResult)(nil), "ibc.core.channel.v2.AcknowledgementResult") + proto.RegisterType((*RecvPacketResult)(nil), "ibc.core.channel.v2.RecvPacketResult") } func init() { proto.RegisterFile("ibc/core/channel/v2/channel.proto", fileDescriptor_7e9b57d8f218397d) } var fileDescriptor_7e9b57d8f218397d = []byte{ - // 405 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x3d, 0x6f, 0xd4, 0x30, - 0x18, 0x3e, 0xd3, 0x6b, 0xaf, 0xf7, 0x1e, 0x1f, 0xc5, 0x74, 0x88, 0x0a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e, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x25, 0x2c, - 0xa2, 0x71, 0x02, 0x00, 0x00, + // 660 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0x41, 0x4f, 0x1a, 0x4f, + 0x18, 0xc6, 0x59, 0x45, 0x81, 0x17, 0xff, 0xba, 0xff, 0x51, 0x5b, 0xa4, 0x0d, 0x22, 0x89, 0x2d, + 0xb5, 0x91, 0x6d, 0x68, 0x2f, 0x26, 0x5e, 0x10, 0x31, 0x21, 0x6d, 0x28, 0xd9, 0x85, 0x26, 0xf6, + 0x42, 0x86, 0xd9, 0x09, 0x6e, 0xdc, 0xdd, 0xd9, 0xee, 0xcc, 0xae, 0x31, 0xe9, 0x27, 0x30, 0x69, + 0xd2, 0x53, 0x6f, 0x7e, 0x82, 0x7e, 0x11, 0x8f, 0x1e, 0x7b, 0x6a, 0x1a, 0xfd, 0x22, 0x0d, 0xb3, + 0xbb, 0x2d, 0x50, 0xda, 0x13, 0xfb, 0x3e, 0xef, 0xef, 0x9d, 0x79, 0x9e, 0x19, 0x32, 0xb0, 0x63, + 0x0d, 0x89, 0x46, 0x98, 0x4f, 0x35, 0x72, 0x86, 0x5d, 0x97, 0xda, 0x5a, 0x58, 0x4f, 0x3e, 0x6b, + 0x9e, 0xcf, 0x04, 0x43, 0xeb, 0xd6, 0x90, 0xd4, 0xc6, 0x48, 0x2d, 0xd1, 0xc3, 0x7a, 0x71, 0x63, + 0xc4, 0x46, 0x4c, 0xf6, 0xb5, 0xf1, 0x57, 0x84, 0x56, 0x6e, 0x15, 0x58, 0xee, 0x62, 0x72, 0x4e, + 0x05, 0x2a, 0x42, 0x96, 0xd3, 0x0f, 0x01, 0x75, 0x09, 0x2d, 0x28, 0x65, 0xa5, 0x9a, 0xd6, 0x7f, + 0xd5, 0xe8, 0x11, 0xe4, 0x38, 0x0b, 0x7c, 0x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x41, 0xce, 0x5d, + 0x76, 0x61, 0x53, 0x73, 0x44, 0x1d, 0xea, 0x0a, 0x64, 0xc1, 0x43, 0x3c, 0x2d, 0x0d, 0x7c, 0xca, + 0x03, 0x5b, 0xf0, 0x82, 0x22, 0x0f, 0x74, 0x6f, 0xae, 0xef, 0x99, 0x65, 0x74, 0x39, 0x12, 0xa7, + 0x78, 0x80, 0xe7, 0x35, 0x79, 0xe5, 0x93, 0x02, 0x9b, 0x73, 0xe7, 0xd0, 0x16, 0x64, 0xb1, 0xe7, + 0x0d, 0x5c, 0xec, 0xd0, 0x24, 0x24, 0xf6, 0xbc, 0x0e, 0x76, 0x28, 0x3a, 0x05, 0xe4, 0x53, 0x12, + 0x0e, 0x3c, 0x79, 0x4d, 0xb1, 0x37, 0x19, 0x37, 0x5f, 0xdf, 0x9d, 0x6b, 0x4d, 0xa7, 0x24, 0x8c, + 0x2e, 0x75, 0xca, 0x95, 0xea, 0xcf, 0xe8, 0x95, 0x0b, 0x50, 0x67, 0x59, 0x74, 0x00, 0xcb, 0x5c, + 0x60, 0x11, 0x70, 0xe9, 0x63, 0xb5, 0xbe, 0xf3, 0x8f, 0xbf, 0x93, 0x21, 0x41, 0x3d, 0x1e, 0x40, + 0x55, 0x58, 0x9b, 0x09, 0x2e, 0x6d, 0xae, 0xe8, 0xb3, 0xf2, 0xde, 0x57, 0x05, 0x56, 0x26, 0x97, + 0x40, 0x4f, 0x61, 0xab, 0xdb, 0x68, 0xbe, 0x6e, 0xf5, 0x06, 0x46, 0xaf, 0xd1, 0xeb, 0x1b, 0x83, + 0x7e, 0xc7, 0xe8, 0xb6, 0x9a, 0xed, 0x93, 0x76, 0xeb, 0x58, 0x4d, 0x15, 0xb3, 0x57, 0xd7, 0xe5, + 0x74, 0xe7, 0x6d, 0xa7, 0x85, 0x9e, 0xc0, 0xe6, 0x34, 0x68, 0xf4, 0x9b, 0xcd, 0x96, 0x61, 0xa8, + 0x4a, 0x31, 0x7f, 0x75, 0x5d, 0xce, 0x18, 0x01, 0x21, 0x94, 0xf3, 0x3f, 0xb9, 0x93, 0x46, 0xfb, + 0x4d, 0x5f, 0x6f, 0xa9, 0x0b, 0x11, 0x77, 0x82, 0x2d, 0x3b, 0xf0, 0x29, 0xaa, 0xc0, 0xfa, 0x34, + 0xd7, 0x30, 0x4e, 0x3b, 0x4d, 0x75, 0xb1, 0x98, 0xbb, 0xba, 0x2e, 0x2f, 0x35, 0xf8, 0xa5, 0x4b, + 0x8e, 0xde, 0xdd, 0xdc, 0x95, 0x94, 0xdb, 0xbb, 0x92, 0xf2, 0xe3, 0xae, 0xa4, 0x7c, 0xbe, 0x2f, + 0xa5, 0x6e, 0xef, 0x4b, 0xa9, 0x6f, 0xf7, 0xa5, 0xd4, 0xfb, 0xc3, 0x91, 0x25, 0xce, 0x82, 0x61, + 0x8d, 0x30, 0x47, 0x23, 0x8c, 0x3b, 0x8c, 0x6b, 0xd6, 0x90, 0xec, 0x8f, 0x98, 0x16, 0x1e, 0x68, + 0x0e, 0x33, 0x03, 0x9b, 0xf2, 0xe8, 0xfd, 0x79, 0xf1, 0x6a, 0x7f, 0xe2, 0x09, 0x12, 0x97, 0x1e, + 0xe5, 0xc3, 0x65, 0xf9, 0xac, 0xbc, 0xfc, 0x19, 0x00, 0x00, 0xff, 0xff, 0x55, 0xf8, 0x84, 0x77, + 0xa6, 0x04, 0x00, 0x00, } func (m *Packet) Marshal() (dAtA []byte, err error) { @@ -425,6 +634,118 @@ func (m *Payload) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Acknowledgement) 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 *Acknowledgement) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Acknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AcknowledgementResults) > 0 { + for iNdEx := len(m.AcknowledgementResults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AcknowledgementResults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChannel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *AcknowledgementResult) 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 *AcknowledgementResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AcknowledgementResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.RecvPacketResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChannel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.AppName) > 0 { + i -= len(m.AppName) + copy(dAtA[i:], m.AppName) + i = encodeVarintChannel(dAtA, i, uint64(len(m.AppName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RecvPacketResult) 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 *RecvPacketResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RecvPacketResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Acknowledgement) > 0 { + i -= len(m.Acknowledgement) + copy(dAtA[i:], m.Acknowledgement) + i = encodeVarintChannel(dAtA, i, uint64(len(m.Acknowledgement))) + i-- + dAtA[i] = 0x12 + } + if m.Status != 0 { + i = encodeVarintChannel(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintChannel(dAtA []byte, offset int, v uint64) int { offset -= sovChannel(v) base := offset @@ -505,6 +826,52 @@ func (m *Payload) Size() (n int) { return n } +func (m *Acknowledgement) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AcknowledgementResults) > 0 { + for _, e := range m.AcknowledgementResults { + l = e.Size() + n += 1 + l + sovChannel(uint64(l)) + } + } + return n +} + +func (m *AcknowledgementResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppName) + if l > 0 { + n += 1 + l + sovChannel(uint64(l)) + } + l = m.RecvPacketResult.Size() + n += 1 + l + sovChannel(uint64(l)) + return n +} + +func (m *RecvPacketResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + sovChannel(uint64(m.Status)) + } + l = len(m.Acknowledgement) + if l > 0 { + n += 1 + l + sovChannel(uint64(l)) + } + return n +} + func sovChannel(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -992,6 +1359,308 @@ func (m *Payload) Unmarshal(dAtA []byte) error { } return nil } +func (m *Acknowledgement) 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 ErrIntOverflowChannel + } + 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: Acknowledgement: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Acknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AcknowledgementResults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChannel + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AcknowledgementResults = append(m.AcknowledgementResults, AcknowledgementResult{}) + if err := m.AcknowledgementResults[len(m.AcknowledgementResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AcknowledgementResult) 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 ErrIntOverflowChannel + } + 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: AcknowledgementResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AcknowledgementResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + 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 ErrInvalidLengthChannel + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecvPacketResult", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChannel + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RecvPacketResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RecvPacketResult) 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 ErrIntOverflowChannel + } + 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: RecvPacketResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RecvPacketResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= PacketStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthChannel + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Acknowledgement = append(m.Acknowledgement[:0], dAtA[iNdEx:postIndex]...) + if m.Acknowledgement == nil { + m.Acknowledgement = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipChannel(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/04-channel/v2/types/codec.go b/modules/core/04-channel/v2/types/codec.go index 6b505433102..1053c8b64d6 100644 --- a/modules/core/04-channel/v2/types/codec.go +++ b/modules/core/04-channel/v2/types/codec.go @@ -13,5 +13,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgSendPacket{}, &MsgRecvPacket{}, &MsgTimeout{}, + &MsgAcknowledgement{}, ) } diff --git a/modules/core/04-channel/v2/types/tx.pb.go b/modules/core/04-channel/v2/types/tx.pb.go index 4c60ac0135d..7dc604e3999 100644 --- a/modules/core/04-channel/v2/types/tx.pb.go +++ b/modules/core/04-channel/v2/types/tx.pb.go @@ -110,7 +110,7 @@ func (m *MsgSendPacketResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSendPacketResponse proto.InternalMessageInfo -// MsgRecvPacket receives incoming IBC packet +// MsgRecvPacket receives an incoming IBC packet. type MsgRecvPacket struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` ProofCommitment []byte `protobuf:"bytes,2,opt,name=proof_commitment,json=proofCommitment,proto3" json:"proof_commitment,omitempty"` @@ -269,6 +269,86 @@ func (m *MsgTimeoutResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTimeoutResponse proto.InternalMessageInfo +// MsgAcknowledgement receives incoming IBC acknowledgement. +type MsgAcknowledgement struct { + Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` + Acknowledgement Acknowledgement `protobuf:"bytes,2,opt,name=acknowledgement,proto3" json:"acknowledgement"` + ProofAcked []byte `protobuf:"bytes,3,opt,name=proof_acked,json=proofAcked,proto3" json:"proof_acked,omitempty"` + ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgAcknowledgement) Reset() { *m = MsgAcknowledgement{} } +func (m *MsgAcknowledgement) String() string { return proto.CompactTextString(m) } +func (*MsgAcknowledgement) ProtoMessage() {} +func (*MsgAcknowledgement) Descriptor() ([]byte, []int) { + return fileDescriptor_d421c7119e969b99, []int{6} +} +func (m *MsgAcknowledgement) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcknowledgement.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 *MsgAcknowledgement) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgement.Merge(m, src) +} +func (m *MsgAcknowledgement) XXX_Size() int { + return m.Size() +} +func (m *MsgAcknowledgement) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgement.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcknowledgement proto.InternalMessageInfo + +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +type MsgAcknowledgementResponse struct { + Result types1.ResponseResultType `protobuf:"varint,1,opt,name=result,proto3,enum=ibc.core.channel.v1.ResponseResultType" json:"result,omitempty"` +} + +func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementResponse{} } +func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAcknowledgementResponse) ProtoMessage() {} +func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d421c7119e969b99, []int{7} +} +func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcknowledgementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcknowledgementResponse.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 *MsgAcknowledgementResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgementResponse.Merge(m, src) +} +func (m *MsgAcknowledgementResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgementResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSendPacket)(nil), "ibc.core.channel.v2.MsgSendPacket") proto.RegisterType((*MsgSendPacketResponse)(nil), "ibc.core.channel.v2.MsgSendPacketResponse") @@ -276,52 +356,60 @@ func init() { proto.RegisterType((*MsgRecvPacketResponse)(nil), "ibc.core.channel.v2.MsgRecvPacketResponse") proto.RegisterType((*MsgTimeout)(nil), "ibc.core.channel.v2.MsgTimeout") proto.RegisterType((*MsgTimeoutResponse)(nil), "ibc.core.channel.v2.MsgTimeoutResponse") + proto.RegisterType((*MsgAcknowledgement)(nil), "ibc.core.channel.v2.MsgAcknowledgement") + proto.RegisterType((*MsgAcknowledgementResponse)(nil), "ibc.core.channel.v2.MsgAcknowledgementResponse") } func init() { proto.RegisterFile("ibc/core/channel/v2/tx.proto", fileDescriptor_d421c7119e969b99) } var fileDescriptor_d421c7119e969b99 = []byte{ - // 637 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4f, 0x4f, 0xd4, 0x4e, - 0x18, 0xc7, 0xb7, 0xb0, 0xec, 0x0f, 0x66, 0xf9, 0x09, 0xd6, 0x7f, 0x9b, 0x62, 0xba, 0xb8, 0x17, - 0x10, 0xa5, 0x75, 0xab, 0x17, 0x88, 0x89, 0x09, 0x18, 0xa3, 0x07, 0x12, 0x53, 0xd0, 0x83, 0x12, - 0x9b, 0xee, 0xf4, 0xb1, 0xdb, 0xb8, 0xed, 0xd4, 0xce, 0xb4, 0x81, 0x9b, 0xf1, 0xe4, 0xc9, 0xf8, - 0x12, 0x4c, 0x7c, 0x03, 0xbc, 0x0c, 0xe2, 0x89, 0xa3, 0x27, 0x63, 0xd8, 0x03, 0x6f, 0xc3, 0x74, - 0x66, 0xda, 0x5d, 0x92, 0x02, 0x1e, 0x38, 0xb5, 0x7d, 0xbe, 0xdf, 0x79, 0xfe, 0x7c, 0x3a, 0x33, - 0xe8, 0x76, 0xd0, 0xc3, 0x26, 0x26, 0x09, 0x98, 0xb8, 0xef, 0x46, 0x11, 0x0c, 0xcc, 0xcc, 0x32, - 0xd9, 0x9e, 0x11, 0x27, 0x84, 0x11, 0xf5, 0x5a, 0xd0, 0xc3, 0x46, 0xae, 0x1a, 0x52, 0x35, 0x32, - 0x4b, 0xbb, 0xee, 0x13, 0x9f, 0x70, 0xdd, 0xcc, 0xdf, 0x84, 0x55, 0xbb, 0x85, 0x09, 0x0d, 0x09, - 0x35, 0x43, 0xea, 0x9b, 0x59, 0x37, 0x7f, 0x48, 0xe1, 0x4e, 0x55, 0x85, 0x22, 0x9d, 0xb0, 0x54, - 0x34, 0xd1, 0x2d, 0x9b, 0xd0, 0xda, 0x23, 0x75, 0x10, 0x40, 0xc4, 0x72, 0x51, 0xbc, 0x09, 0x43, - 0xe7, 0xa7, 0x82, 0xfe, 0xdf, 0xa2, 0xfe, 0x36, 0x44, 0xde, 0x4b, 0x17, 0x7f, 0x00, 0xa6, 0x2e, - 0xa0, 0x19, 0x4a, 0xd2, 0x04, 0x83, 0x13, 0x78, 0x2d, 0x65, 0x51, 0x59, 0x9e, 0xb1, 0xa7, 0x45, - 0xe0, 0x85, 0xa7, 0xde, 0x43, 0x57, 0x59, 0x10, 0x02, 0x49, 0x99, 0x93, 0x3f, 0x29, 0x73, 0xc3, - 0xb8, 0x35, 0xb1, 0xa8, 0x2c, 0xd7, 0xed, 0x79, 0x29, 0xec, 0x14, 0x71, 0xf5, 0x19, 0x6a, 0xc6, - 0x3c, 0xa7, 0xe3, 0xb9, 0xcc, 0x6d, 0x4d, 0x2e, 0x4e, 0x2e, 0x37, 0xad, 0xb6, 0x51, 0xc1, 0xc5, - 0x10, 0xb5, 0x9f, 0xba, 0xcc, 0xdd, 0xa8, 0x1f, 0xfe, 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0xe0, 0x7c, 0x4f, 0xf0, 0x06, 0x06, 0x00, 0x00, + // 724 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xc7, 0xe3, 0x26, 0x0d, 0xed, 0xa4, 0x90, 0x62, 0xbe, 0x22, 0x17, 0x25, 0x25, 0x42, 0x6a, + 0x29, 0xd4, 0x26, 0x81, 0x4b, 0x2b, 0x24, 0xd4, 0x16, 0x21, 0x38, 0x54, 0x42, 0x6e, 0xe0, 0x00, + 0x15, 0x91, 0xb3, 0x5e, 0x1c, 0xab, 0xb1, 0xd7, 0x78, 0x1d, 0xd3, 0xde, 0x10, 0x27, 0x4e, 0xa8, + 0x8f, 0xc0, 0x23, 0xf4, 0xc0, 0x43, 0x54, 0x9c, 0x7a, 0xe4, 0x84, 0x50, 0x73, 0xe8, 0x6b, 0x20, + 0xef, 0x6e, 0x9c, 0x8f, 0x3a, 0x6d, 0xa5, 0xe6, 0x64, 0x7b, 0xe6, 0xbf, 0xff, 0x99, 0xfd, 0xed, + 0x7a, 0x17, 0xee, 0xda, 0x0d, 0xa4, 0x21, 0xe2, 0x63, 0x0d, 0x35, 0x0d, 0xd7, 0xc5, 0x2d, 0x2d, + 0xac, 0x6a, 0xc1, 0xae, 0xea, 0xf9, 0x24, 0x20, 0xf2, 0x0d, 0xbb, 0x81, 0xd4, 0x28, 0xab, 0x8a, + 0xac, 0x1a, 0x56, 0x95, 0x9b, 0x16, 0xb1, 0x08, 0xcb, 0x6b, 0xd1, 0x1b, 0x97, 0x2a, 0x77, 0x10, + 0xa1, 0x0e, 0xa1, 0x9a, 0x43, 0x2d, 0x2d, 0xac, 0x44, 0x0f, 0x91, 0xb8, 0x97, 0x54, 0xa1, 0x6b, + 0xc7, 0x25, 0x09, 0x4d, 0x54, 0xe2, 0x26, 0x94, 0x52, 0x2f, 0xdb, 0xb2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xf0, 0x25, + 0x0f, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -340,8 +428,10 @@ type PacketMsgClient interface { SendPacket(ctx context.Context, in *MsgSendPacket, opts ...grpc.CallOption) (*MsgSendPacketResponse, error) // RecvPacket defines a rpc handler method for MsgRecvPacket. RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) - // Timeout defines a rpc handler method for MsgTimeout. + // Timeout defines a rpc handler method for MsgTimeout. Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) } type packetMsgClient struct { @@ -379,14 +469,25 @@ func (c *packetMsgClient) Timeout(ctx context.Context, in *MsgTimeout, opts ...g return out, nil } +func (c *packetMsgClient) Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) { + out := new(MsgAcknowledgementResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.PacketMsg/Acknowledgement", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // PacketMsgServer is the server API for PacketMsg service. type PacketMsgServer interface { // SendPacket defines a rpc handler method for MsgSendPacket. SendPacket(context.Context, *MsgSendPacket) (*MsgSendPacketResponse, error) // RecvPacket defines a rpc handler method for MsgRecvPacket. RecvPacket(context.Context, *MsgRecvPacket) (*MsgRecvPacketResponse, error) - // Timeout defines a rpc handler method for MsgTimeout. + // Timeout defines a rpc handler method for MsgTimeout. Timeout(context.Context, *MsgTimeout) (*MsgTimeoutResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(context.Context, *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) } // UnimplementedPacketMsgServer can be embedded to have forward compatible implementations. @@ -402,6 +503,9 @@ func (*UnimplementedPacketMsgServer) RecvPacket(ctx context.Context, req *MsgRec func (*UnimplementedPacketMsgServer) Timeout(ctx context.Context, req *MsgTimeout) (*MsgTimeoutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Timeout not implemented") } +func (*UnimplementedPacketMsgServer) Acknowledgement(ctx context.Context, req *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Acknowledgement not implemented") +} func RegisterPacketMsgServer(s grpc1.Server, srv PacketMsgServer) { s.RegisterService(&_PacketMsg_serviceDesc, srv) @@ -461,6 +565,24 @@ func _PacketMsg_Timeout_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _PacketMsg_Acknowledgement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAcknowledgement) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PacketMsgServer).Acknowledgement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v2.PacketMsg/Acknowledgement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PacketMsgServer).Acknowledgement(ctx, req.(*MsgAcknowledgement)) + } + return interceptor(ctx, in, info, handler) +} + var _PacketMsg_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.core.channel.v2.PacketMsg", HandlerType: (*PacketMsgServer)(nil), @@ -477,6 +599,10 @@ var _PacketMsg_serviceDesc = grpc.ServiceDesc{ MethodName: "Timeout", Handler: _PacketMsg_Timeout_Handler, }, + { + MethodName: "Acknowledgement", + Handler: _PacketMsg_Acknowledgement_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "ibc/core/channel/v2/tx.proto", @@ -741,6 +867,101 @@ func (m *MsgTimeoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgAcknowledgement) 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 *MsgAcknowledgement) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ProofAcked) > 0 { + i -= len(m.ProofAcked) + copy(dAtA[i:], m.ProofAcked) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofAcked))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Acknowledgement.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgAcknowledgementResponse) 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 *MsgAcknowledgementResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Result != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Result)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -859,6 +1080,41 @@ func (m *MsgTimeoutResponse) Size() (n int) { return n } +func (m *MsgAcknowledgement) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Packet.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.Acknowledgement.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.ProofAcked) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAcknowledgementResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Result != 0 { + n += 1 + sovTx(uint64(m.Result)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1622,6 +1878,290 @@ func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAcknowledgement: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Acknowledgement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofAcked", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofAcked = append(m.ProofAcked[:0], dAtA[iNdEx:postIndex]...) + if m.ProofAcked == nil { + m.ProofAcked = []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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAcknowledgementResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcknowledgementResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + m.Result = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Result |= types1.ResponseResultType(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/proto/ibc/core/channel/v2/channel.proto b/proto/ibc/core/channel/v2/channel.proto index d4946a21618..4bbe3df2342 100644 --- a/proto/ibc/core/channel/v2/channel.proto +++ b/proto/ibc/core/channel/v2/channel.proto @@ -42,3 +42,34 @@ message Payload { // the raw bytes for the payload. bytes value = 3; } + +// Acknowledgement contains a list of all ack results associated with a single packet. +message Acknowledgement { + repeated AcknowledgementResult acknowledgement_results = 1 [(gogoproto.nullable) = false]; +} + +// AcknowledgementResult of identified acknowledgement. Correlating IBC application name to opaque ack bytes. +message AcknowledgementResult { + string app_name = 1; + RecvPacketResult recv_packet_result = 2 [(gogoproto.nullable) = false]; +} + +// PacketStatus specifies the status of a RecvPacketResult. +enum PacketStatus { + // PACKET_STATUS_UNSPECIFIED indicates an unknown packet status. + PACKET_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"]; + // PACKET_STATUS_SUCCESS indicates a successful packet receipt. + PACKET_STATUS_SUCCESS = 1 [(gogoproto.enumvalue_customname) = "Success"]; + // PACKET_STATUS_FAILURE indicates a failed packet receipt. + PACKET_STATUS_FAILURE = 2 [(gogoproto.enumvalue_customname) = "Failure"]; + // PACKET_STATUS_ASYNC indicates an async packet receipt. + PACKET_STATUS_ASYNC = 3 [(gogoproto.enumvalue_customname) = "Async"]; +} + +// RecvPacketResult speecifies the status of a packet as well as the acknowledgement bytes. +message RecvPacketResult { + // status of the packet + PacketStatus status = 1; + // acknowledgement of the packet + bytes acknowledgement = 2; +} diff --git a/proto/ibc/core/channel/v2/tx.proto b/proto/ibc/core/channel/v2/tx.proto index b94e6e42de9..b25ebd50341 100644 --- a/proto/ibc/core/channel/v2/tx.proto +++ b/proto/ibc/core/channel/v2/tx.proto @@ -22,6 +22,9 @@ service PacketMsg { // Timeout defines a rpc handler method for MsgTimeout. rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); } // MsgSendPacket sends an outgoing IBC packet. @@ -80,3 +83,23 @@ message MsgTimeoutResponse { ibc.core.channel.v1.ResponseResultType result = 1; } + +// MsgAcknowledgement receives incoming IBC acknowledgement. +message MsgAcknowledgement { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + Packet packet = 1 [(gogoproto.nullable) = false]; + Acknowledgement acknowledgement = 2 [(gogoproto.nullable) = false]; + bytes proof_acked = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; +} + +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +message MsgAcknowledgementResponse { + option (gogoproto.goproto_getters) = false; + + ibc.core.channel.v1.ResponseResultType result = 1; +}