From d99017edc9c7897de888dbe9104d5d0de9d01e69 Mon Sep 17 00:00:00 2001 From: Sammy Liu Date: Wed, 27 Sep 2023 16:59:57 -0400 Subject: [PATCH] selective routing and event emission --- docs/proto/proto-docs.md | 39 ++ .../axelar/nexus/exported/v1beta1/types.proto | 10 + proto/axelar/nexus/v1beta1/events.proto | 6 + x/nexus/exported/types.pb.go | 568 +++++++++++++++--- x/nexus/keeper/msg_dispatcher.go | 90 ++- x/nexus/keeper/msg_dispatcher_test.go | 33 +- x/nexus/types/events.pb.go | 302 ++++++++-- 7 files changed, 877 insertions(+), 171 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 09eee4bbdc..cb17a674d8 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -51,6 +51,7 @@ - [axelar/nexus/exported/v1beta1/types.proto](#axelar/nexus/exported/v1beta1/types.proto) - [Asset](#axelar.nexus.exported.v1beta1.Asset) - [Chain](#axelar.nexus.exported.v1beta1.Chain) + - [ConnectionRouterMessage](#axelar.nexus.exported.v1beta1.ConnectionRouterMessage) - [CrossChainAddress](#axelar.nexus.exported.v1beta1.CrossChainAddress) - [CrossChainTransfer](#axelar.nexus.exported.v1beta1.CrossChainTransfer) - [FeeInfo](#axelar.nexus.exported.v1beta1.FeeInfo) @@ -372,6 +373,7 @@ - [QueryService](#axelar.multisig.v1beta1.QueryService) - [axelar/nexus/v1beta1/events.proto](#axelar/nexus/v1beta1/events.proto) + - [ConnectionRouterMessageReceived](#axelar.nexus.v1beta1.ConnectionRouterMessageReceived) - [FeeDeducted](#axelar.nexus.v1beta1.FeeDeducted) - [InsufficientFee](#axelar.nexus.v1beta1.InsufficientFee) - [MessageExecuted](#axelar.nexus.v1beta1.MessageExecuted) @@ -1235,6 +1237,27 @@ Chain represents the properties of a registered blockchain + + +### ConnectionRouterMessage + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sender_chain` | [string](#string) | | | +| `sender_address` | [string](#string) | | | +| `recipient_chain` | [string](#string) | | | +| `recipient_address` | [string](#string) | | | +| `payload_hash` | [bytes](#bytes) | | | +| `source_tx_id` | [bytes](#bytes) | | | +| `source_tx_index` | [uint64](#uint64) | | | + + + + + + ### CrossChainAddress @@ -5862,6 +5885,22 @@ Query defines the gRPC querier service. + + +### ConnectionRouterMessageReceived + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `message` | [axelar.nexus.exported.v1beta1.ConnectionRouterMessage](#axelar.nexus.exported.v1beta1.ConnectionRouterMessage) | | | +| `routed` | [bool](#bool) | | | + + + + + + ### FeeDeducted diff --git a/proto/axelar/nexus/exported/v1beta1/types.proto b/proto/axelar/nexus/exported/v1beta1/types.proto index 7e1b7f386e..726e9202ee 100644 --- a/proto/axelar/nexus/exported/v1beta1/types.proto +++ b/proto/axelar/nexus/exported/v1beta1/types.proto @@ -109,3 +109,13 @@ message GeneralMessage { bytes source_tx_id = 7 [ (gogoproto.customname) = "SourceTxID" ]; uint64 source_tx_index = 8; } + +message ConnectionRouterMessage { + string sender_chain = 1 [ (gogoproto.casttype) = "ChainName" ]; + string sender_address = 2; + string recipient_chain = 3 [ (gogoproto.casttype) = "ChainName" ]; + string recipient_address = 4; + bytes payload_hash = 5; + bytes source_tx_id = 6 [ (gogoproto.customname) = "SourceTxID" ]; + uint64 source_tx_index = 7; +} diff --git a/proto/axelar/nexus/v1beta1/events.proto b/proto/axelar/nexus/v1beta1/events.proto index 554c7b50ed..ba2d38bcd2 100644 --- a/proto/axelar/nexus/v1beta1/events.proto +++ b/proto/axelar/nexus/v1beta1/events.proto @@ -60,3 +60,9 @@ message MessageProcessing { string id = 1 [ (gogoproto.customname) = "ID" ]; } message MessageExecuted { string id = 1 [ (gogoproto.customname) = "ID" ]; } message MessageFailed { string id = 1 [ (gogoproto.customname) = "ID" ]; } + +message ConnectionRouterMessageReceived { + exported.v1beta1.ConnectionRouterMessage message = 1 + [ (gogoproto.nullable) = false ]; + bool routed = 2; +} diff --git a/x/nexus/exported/types.pb.go b/x/nexus/exported/types.pb.go index 3455c6a996..aafb7c8547 100644 --- a/x/nexus/exported/types.pb.go +++ b/x/nexus/exported/types.pb.go @@ -402,6 +402,49 @@ func (m *GeneralMessage) XXX_DiscardUnknown() { var xxx_messageInfo_GeneralMessage proto.InternalMessageInfo +type ConnectionRouterMessage struct { + SenderChain ChainName `protobuf:"bytes,1,opt,name=sender_chain,json=senderChain,proto3,casttype=ChainName" json:"sender_chain,omitempty"` + SenderAddress string `protobuf:"bytes,2,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"` + RecipientChain ChainName `protobuf:"bytes,3,opt,name=recipient_chain,json=recipientChain,proto3,casttype=ChainName" json:"recipient_chain,omitempty"` + RecipientAddress string `protobuf:"bytes,4,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + PayloadHash []byte `protobuf:"bytes,5,opt,name=payload_hash,json=payloadHash,proto3" json:"payload_hash,omitempty"` + SourceTxID []byte `protobuf:"bytes,6,opt,name=source_tx_id,json=sourceTxId,proto3" json:"source_tx_id,omitempty"` + SourceTxIndex uint64 `protobuf:"varint,7,opt,name=source_tx_index,json=sourceTxIndex,proto3" json:"source_tx_index,omitempty"` +} + +func (m *ConnectionRouterMessage) Reset() { *m = ConnectionRouterMessage{} } +func (m *ConnectionRouterMessage) String() string { return proto.CompactTextString(m) } +func (*ConnectionRouterMessage) ProtoMessage() {} +func (*ConnectionRouterMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_82a7a8692925fe67, []int{7} +} +func (m *ConnectionRouterMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectionRouterMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectionRouterMessage.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 *ConnectionRouterMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectionRouterMessage.Merge(m, src) +} +func (m *ConnectionRouterMessage) XXX_Size() int { + return m.Size() +} +func (m *ConnectionRouterMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectionRouterMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectionRouterMessage proto.InternalMessageInfo + func init() { proto.RegisterEnum("axelar.nexus.exported.v1beta1.TransferState", TransferState_name, TransferState_value) proto.RegisterEnum("axelar.nexus.exported.v1beta1.TransferDirection", TransferDirection_name, TransferDirection_value) @@ -413,6 +456,7 @@ func init() { proto.RegisterType((*FeeInfo)(nil), "axelar.nexus.exported.v1beta1.FeeInfo") proto.RegisterType((*Asset)(nil), "axelar.nexus.exported.v1beta1.Asset") proto.RegisterType((*GeneralMessage)(nil), "axelar.nexus.exported.v1beta1.GeneralMessage") + proto.RegisterType((*ConnectionRouterMessage)(nil), "axelar.nexus.exported.v1beta1.ConnectionRouterMessage") } func init() { @@ -420,80 +464,85 @@ func init() { } var fileDescriptor_82a7a8692925fe67 = []byte{ - // 1155 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x6f, 0x1b, 0xc5, - 0x1b, 0xf7, 0x3a, 0x7e, 0xcb, 0xe4, 0xa5, 0xee, 0xa8, 0xff, 0xd6, 0x7f, 0xa3, 0xae, 0x5d, 0x53, - 0xda, 0x14, 0xd1, 0x75, 0x5f, 0x28, 0x47, 0xc0, 0xb1, 0xd7, 0xe9, 0xd2, 0x76, 0x6d, 0xad, 0xd7, - 0x08, 0x71, 0x59, 0x6d, 0x76, 0x1f, 0x3b, 0xa3, 0xc4, 0x33, 0xd6, 0xce, 0xba, 0x38, 0xdf, 0x00, - 0x85, 0x0b, 0x07, 0xae, 0x3e, 0x20, 0x38, 0x20, 0xc4, 0x97, 0xe0, 0x44, 0x2f, 0x48, 0x3d, 0x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, 0xe5, - 0x83, 0x59, 0x15, 0x1b, 0x94, 0x4f, 0x06, 0x03, 0xe2, 0x89, 0x29, 0x6c, 0x8c, 0xd8, 0x84, 0x86, - 0x0b, 0x7a, 0x7e, 0x52, 0xd0, 0xc5, 0x44, 0x4f, 0x8b, 0x04, 0xe0, 0x85, 0x84, 0x51, 0x7c, 0x1f, - 0xa9, 0x47, 0xf8, 0x2d, 0xc3, 0xd2, 0x9b, 0xb6, 0xd1, 0x31, 0xcf, 0x6a, 0x58, 0x9f, 0xf2, 0x31, - 0x78, 0x64, 0x40, 0xc0, 0xc7, 0xb7, 0xd1, 0x5b, 0x67, 0x04, 0x19, 0x66, 0xb3, 0xf3, 0x24, 0x52, - 0x2b, 0x35, 0x18, 0xd4, 0x63, 0x23, 0x21, 0xf7, 0x6c, 0xf7, 0x4e, 0xdf, 0xde, 0xea, 0x44, 0x6d, - 0x94, 0xee, 0x9d, 0x49, 0x38, 0x64, 0x84, 0x0e, 0xcb, 0x19, 0x41, 0x79, 0xb3, 0xf7, 0xec, 0x2f, - 0x35, 0xf5, 0xec, 0x50, 0x55, 0x9e, 0x1f, 0xaa, 0xca, 0x9f, 0x87, 0xaa, 0xf2, 0xf5, 0x0b, 0x35, - 0xf5, 0xfc, 0x85, 0x9a, 0xfa, 0xed, 0x85, 0x9a, 0xfa, 0xfc, 0xc1, 0xc2, 0x1f, 0x56, 0xb4, 0x39, - 0x14, 0xc2, 0x2f, 0x58, 0xb0, 0x1b, 0xdf, 0x6e, 0x7b, 0x2c, 0x80, 0xfa, 0xf4, 0xd4, 0x27, 0xd2, - 0x76, 0x4e, 0x7e, 0x97, 0xdc, 0xff, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x8b, 0x8f, 0x7e, 0x42, - 0x09, 0x00, 0x00, + // 1242 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x6f, 0x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0x8f, 0x8a, 0xc7, 0xfc, 0x4d, 0xcd, 0x50, 0x1b, 0x3d, 0xad, 0xad, 0x2f, + 0xda, 0x83, 0x3e, 0x61, 0x63, 0xb0, 0xdd, 0x81, 0x0b, 0x0e, 0xbe, 0x8d, 0xde, 0x59, 0xe0, 0xa4, + 0xe9, 0x8d, 0xf6, 0x53, 0x59, 0xad, 0xa8, 0x41, 0x23, 0x36, 0x1d, 0xf1, 0x72, 0x17, 0xc3, 0xdb, + 0xfd, 0xde, 0x66, 0x5b, 0x6e, 0x87, 0x80, 0xb7, 0x27, 0xfe, 0x90, 0xba, 0x64, 0x58, 0x88, 0xf3, + 0x94, 0x37, 0xba, 0xcf, 0xff, 0x2e, 0x46, 0x9e, 0x1f, 0x15, 0x95, 0x17, 0x47, 0x45, 0xe5, 0xaf, + 0xa3, 0xa2, 0xf2, 0xf5, 0xcb, 0x62, 0xe4, 0xc5, 0xcb, 0x62, 0xe4, 0xf7, 0x97, 0xc5, 0xc8, 0xe7, + 0x0f, 0x4e, 0x7c, 0x07, 0xe4, 0x0b, 0x89, 0x80, 0xff, 0x05, 0xf5, 0x76, 0x82, 0xd3, 0x6d, 0x9b, + 0x7a, 0x50, 0x9b, 0xce, 0xfd, 0xf3, 0xdc, 0x4a, 0x8a, 0xbf, 0x7b, 0xf7, 0xff, 0x09, 0x00, 0x00, + 0xff, 0xff, 0x76, 0x96, 0xf7, 0xf8, 0x99, 0x0a, 0x00, 0x00, } func (m *Chain) Marshal() (dAtA []byte, err error) { @@ -871,6 +920,76 @@ func (m *GeneralMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ConnectionRouterMessage) 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 *ConnectionRouterMessage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionRouterMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SourceTxIndex != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.SourceTxIndex)) + i-- + dAtA[i] = 0x38 + } + if len(m.SourceTxID) > 0 { + i -= len(m.SourceTxID) + copy(dAtA[i:], m.SourceTxID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SourceTxID))) + i-- + dAtA[i] = 0x32 + } + if len(m.PayloadHash) > 0 { + i -= len(m.PayloadHash) + copy(dAtA[i:], m.PayloadHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.PayloadHash))) + i-- + dAtA[i] = 0x2a + } + if len(m.RecipientAddress) > 0 { + i -= len(m.RecipientAddress) + copy(dAtA[i:], m.RecipientAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.RecipientAddress))) + i-- + dAtA[i] = 0x22 + } + if len(m.RecipientChain) > 0 { + i -= len(m.RecipientChain) + copy(dAtA[i:], m.RecipientChain) + i = encodeVarintTypes(dAtA, i, uint64(len(m.RecipientChain))) + i-- + dAtA[i] = 0x1a + } + if len(m.SenderAddress) > 0 { + i -= len(m.SenderAddress) + copy(dAtA[i:], m.SenderAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SenderAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.SenderChain) > 0 { + i -= len(m.SenderChain) + copy(dAtA[i:], m.SenderChain) + i = encodeVarintTypes(dAtA, i, uint64(len(m.SenderChain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -1028,6 +1147,42 @@ func (m *GeneralMessage) Size() (n int) { return n } +func (m *ConnectionRouterMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SenderChain) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.SenderAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.RecipientChain) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.RecipientAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.PayloadHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.SourceTxID) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.SourceTxIndex != 0 { + n += 1 + sovTypes(uint64(m.SourceTxIndex)) + } + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2145,6 +2300,271 @@ func (m *GeneralMessage) Unmarshal(dAtA []byte) error { } return nil } +func (m *ConnectionRouterMessage) 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 ErrIntOverflowTypes + } + 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: ConnectionRouterMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectionRouterMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SenderChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SenderChain = ChainName(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SenderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SenderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecipientChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecipientChain = ChainName(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecipientAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecipientAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayloadHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PayloadHash = append(m.PayloadHash[:0], dAtA[iNdEx:postIndex]...) + if m.PayloadHash == nil { + m.PayloadHash = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceTxID", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceTxID = append(m.SourceTxID[:0], dAtA[iNdEx:postIndex]...) + if m.SourceTxID == nil { + m.SourceTxID = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceTxIndex", wireType) + } + m.SourceTxIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SourceTxIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/nexus/keeper/msg_dispatcher.go b/x/nexus/keeper/msg_dispatcher.go index f1f4884715..b980c60ee9 100644 --- a/x/nexus/keeper/msg_dispatcher.go +++ b/x/nexus/keeper/msg_dispatcher.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/axelarnetwork/axelar-core/utils" axelarnet "github.com/axelarnetwork/axelar-core/x/axelarnet/exported" "github.com/axelarnetwork/axelar-core/x/nexus/exported" "github.com/axelarnetwork/axelar-core/x/nexus/types" @@ -18,17 +19,7 @@ import ( var _ wasmkeeper.Messenger = (*Messenger)(nil) -type message struct { - SenderChain exported.ChainName `json:"sender_chain"` - SenderAddress string `json:"sender_address"` - RecipientChain exported.ChainName `json:"recipient_chain"` - RecipientAddress string `json:"recipient_address"` - PayloadHash []byte `json:"payload_hash"` - SourceTxID []byte `json:"source_tx_id"` - SourceTxIndex uint64 `json:"source_tx_index"` -} - -type request = []message +type request = []exported.ConnectionRouterMessage type Messenger struct { types.Nexus @@ -56,46 +47,49 @@ func (m Messenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, _ s return nil, nil, fmt.Errorf("contract address %s is not the connection router", contractAddr) } - // TODO: consider routing messages that can be routed instead of failing the - // whole batch whenever one message fails and returning the ones that - // succeeded/failed in the response - // TODO: consider handling only one message at a time instead of a batch for _, msg := range req { - recipientChain, ok := m.GetChain(ctx, msg.RecipientChain) - if !ok { - return nil, nil, fmt.Errorf("recipient chain %s is not a registered chain", msg.RecipientChain) - } - - msgID, _, _ := m.GenerateMessageID(ctx) - senderChain := exported.Chain{Name: msg.SenderChain, SupportsForeignAssets: false, KeyType: tss.None, Module: wasmtypes.ModuleName} - sender := exported.CrossChainAddress{Chain: senderChain, Address: msg.SenderAddress} - recipient := exported.CrossChainAddress{Chain: recipientChain, Address: msg.RecipientAddress} - - // set status to approved if the message is sent to a cosmos chain and set - // to processing otherwise, because messages sent to cosmos chains require - // translation with the original payload. - // https://github.com/axelarnetwork/axelar-core/blob/ea48d5b974dfd94ea235311eddabe23bfa430cd9/x/axelarnet/keeper/msg_server.go#L520 - status := exported.Approved - if !recipientChain.IsFrom(axelarnet.ModuleName) { - status = exported.Processing - } - msg := exported.NewGeneralMessage( - msgID, - sender, - recipient, - msg.PayloadHash, - status, - msg.SourceTxID, - msg.SourceTxIndex, - nil, - ) - - if err := m.Nexus.SetNewMessageFromWasm(ctx, msg); err != nil { - return nil, nil, err - } + routed := utils.RunCached(ctx, m, func(ctx sdk.Context) (bool, error) { + return m.routeMsg(ctx, msg) + }) + ctx.EventManager().EmitTypedEvent(&types.ConnectionRouterMessageReceived{Message: msg, Routed: routed}) } - // TODO: return events return nil, nil, nil } + +func (m Messenger) routeMsg(ctx sdk.Context, msg exported.ConnectionRouterMessage) (bool, error) { + recipientChain, ok := m.GetChain(ctx, msg.RecipientChain) + if !ok { + return false, fmt.Errorf("recipient chain %s is not a registered chain", msg.RecipientChain) + } + + id, _, _ := m.GenerateMessageID(ctx) + senderChain := exported.Chain{Name: msg.SenderChain, SupportsForeignAssets: false, KeyType: tss.None, Module: wasmtypes.ModuleName} + sender := exported.CrossChainAddress{Chain: senderChain, Address: msg.SenderAddress} + recipient := exported.CrossChainAddress{Chain: recipientChain, Address: msg.RecipientAddress} + + // set status to approved if the message is sent to a cosmos chain and set + // to processing otherwise, because messages sent to cosmos chains require + // translation with the original payload. + // https://github.com/axelarnetwork/axelar-core/blob/ea48d5b974dfd94ea235311eddabe23bfa430cd9/x/axelarnet/keeper/msg_server.go#L520 + status := exported.Approved + if !recipientChain.IsFrom(axelarnet.ModuleName) { + status = exported.Processing + } + + if err := m.Nexus.SetNewMessageFromWasm(ctx, exported.NewGeneralMessage( + id, + sender, + recipient, + msg.PayloadHash, + status, + msg.SourceTxID, + msg.SourceTxIndex, + nil, + )); err != nil { + return false, err + } + + return true, nil +} diff --git a/x/nexus/keeper/msg_dispatcher_test.go b/x/nexus/keeper/msg_dispatcher_test.go index 2fda1e98ae..6eb09f68f9 100644 --- a/x/nexus/keeper/msg_dispatcher_test.go +++ b/x/nexus/keeper/msg_dispatcher_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "bytes" "errors" "fmt" "testing" @@ -9,6 +10,7 @@ import ( wasmvmtypes "github.com/CosmWasm/wasmvm/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -20,21 +22,23 @@ import ( "github.com/axelarnetwork/axelar-core/x/nexus/keeper" "github.com/axelarnetwork/axelar-core/x/nexus/types" "github.com/axelarnetwork/axelar-core/x/nexus/types/mock" + "github.com/axelarnetwork/utils/slices" . "github.com/axelarnetwork/utils/test" ) func TestMessenger_DispatchMsg(t *testing.T) { var ( + ctx sdk.Context messenger keeper.Messenger nexus *mock.NexusMock msg wasmvmtypes.CosmosMsg ) - ctx := sdk.NewContext(fake.NewMultiStore(), tmproto.Header{}, false, log.TestingLogger()) contractAddr := rand.AccAddr() givenMessenger := Given("a messenger", func() { - nexus = &mock.NexusMock{} + ctx = sdk.NewContext(fake.NewMultiStore(), tmproto.Header{}, false, log.TestingLogger()) + nexus = &mock.NexusMock{LoggerFunc: func(_ sdk.Context) log.Logger { return log.TestingLogger() }} messenger = keeper.NewMessenger(nexus) }) @@ -110,11 +114,15 @@ func TestMessenger_DispatchMsg(t *testing.T) { return exported.Chain{}, false } }). - Then("should return error", func(t *testing.T) { + Then("should not do anything", func(t *testing.T) { _, _, err := messenger.DispatchMsg(ctx, contractAddr, "", msg) - assert.ErrorContains(t, err, "is not a registered chain") - assert.False(t, errors.Is(err, wasmtypes.ErrUnknownMsg)) + assert.NoError(t, err) + assert.Len(t, slices.Filter(ctx.EventManager().Events(), func(ev sdk.Event) bool { + return ev.Type == "axelar.nexus.v1beta1.ConnectionRouterMessageReceived" && slices.Any(ev.Attributes, func(attr abci.EventAttribute) bool { + return bytes.Equal(attr.Key, []byte("routed")) && bytes.Equal(attr.Value, []byte("false")) + }) + }), 2) }), When("the destination chain is registered", func() { @@ -137,11 +145,15 @@ func TestMessenger_DispatchMsg(t *testing.T) { return fmt.Errorf("set msg error") } }). - Then("should return error", func(t *testing.T) { + Then("should do nothing", func(t *testing.T) { _, _, err := messenger.DispatchMsg(ctx, contractAddr, "", msg) - assert.ErrorContains(t, err, "set msg error") - assert.False(t, errors.Is(err, wasmtypes.ErrUnknownMsg)) + assert.NoError(t, err) + assert.Len(t, slices.Filter(ctx.EventManager().Events(), func(ev sdk.Event) bool { + return ev.Type == "axelar.nexus.v1beta1.ConnectionRouterMessageReceived" && slices.Any(ev.Attributes, func(attr abci.EventAttribute) bool { + return bytes.Equal(attr.Key, []byte("routed")) && bytes.Equal(attr.Value, []byte("false")) + }) + }), 2) }), When("the destination chain is registered", func() { @@ -177,6 +189,11 @@ func TestMessenger_DispatchMsg(t *testing.T) { assert.Equal(t, nexus.SetNewMessageFromWasmCalls()[1].Msg.Recipient.Chain, axelarnet.Axelarnet) assert.Equal(t, nexus.SetNewMessageFromWasmCalls()[1].Msg.Status, exported.Approved) assert.Nil(t, nexus.SetNewMessageFromWasmCalls()[1].Msg.Asset) + assert.Len(t, slices.Filter(ctx.EventManager().Events(), func(ev sdk.Event) bool { + return ev.Type == "axelar.nexus.v1beta1.ConnectionRouterMessageReceived" && slices.Any(ev.Attributes, func(attr abci.EventAttribute) bool { + return bytes.Equal(attr.Key, []byte("routed")) && bytes.Equal(attr.Value, []byte("true")) + }) + }), 2) }), ). Run(t) diff --git a/x/nexus/types/events.pb.go b/x/nexus/types/events.pb.go index e6ea2d978e..7c635f2544 100644 --- a/x/nexus/types/events.pb.go +++ b/x/nexus/types/events.pb.go @@ -469,6 +469,62 @@ func (m *MessageFailed) GetID() string { func (*MessageFailed) XXX_MessageName() string { return "axelar.nexus.v1beta1.MessageFailed" } + +type ConnectionRouterMessageReceived struct { + Message exported.ConnectionRouterMessage `protobuf:"bytes,1,opt,name=message,proto3" json:"message"` + Routed bool `protobuf:"varint,2,opt,name=routed,proto3" json:"routed,omitempty"` +} + +func (m *ConnectionRouterMessageReceived) Reset() { *m = ConnectionRouterMessageReceived{} } +func (m *ConnectionRouterMessageReceived) String() string { return proto.CompactTextString(m) } +func (*ConnectionRouterMessageReceived) ProtoMessage() {} +func (*ConnectionRouterMessageReceived) Descriptor() ([]byte, []int) { + return fileDescriptor_4433ea5171b09eb9, []int{7} +} +func (m *ConnectionRouterMessageReceived) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectionRouterMessageReceived) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectionRouterMessageReceived.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 *ConnectionRouterMessageReceived) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectionRouterMessageReceived.Merge(m, src) +} +func (m *ConnectionRouterMessageReceived) XXX_Size() int { + return m.Size() +} +func (m *ConnectionRouterMessageReceived) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectionRouterMessageReceived.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectionRouterMessageReceived proto.InternalMessageInfo + +func (m *ConnectionRouterMessageReceived) GetMessage() exported.ConnectionRouterMessage { + if m != nil { + return m.Message + } + return exported.ConnectionRouterMessage{} +} + +func (m *ConnectionRouterMessageReceived) GetRouted() bool { + if m != nil { + return m.Routed + } + return false +} + +func (*ConnectionRouterMessageReceived) XXX_MessageName() string { + return "axelar.nexus.v1beta1.ConnectionRouterMessageReceived" +} func init() { proto.RegisterType((*FeeDeducted)(nil), "axelar.nexus.v1beta1.FeeDeducted") proto.RegisterType((*InsufficientFee)(nil), "axelar.nexus.v1beta1.InsufficientFee") @@ -477,52 +533,56 @@ func init() { proto.RegisterType((*MessageProcessing)(nil), "axelar.nexus.v1beta1.MessageProcessing") proto.RegisterType((*MessageExecuted)(nil), "axelar.nexus.v1beta1.MessageExecuted") proto.RegisterType((*MessageFailed)(nil), "axelar.nexus.v1beta1.MessageFailed") + proto.RegisterType((*ConnectionRouterMessageReceived)(nil), "axelar.nexus.v1beta1.ConnectionRouterMessageReceived") } func init() { proto.RegisterFile("axelar/nexus/v1beta1/events.proto", fileDescriptor_4433ea5171b09eb9) } var fileDescriptor_4433ea5171b09eb9 = []byte{ - // 625 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x54, 0x41, 0x4f, 0x13, 0x41, - 0x14, 0xee, 0xb4, 0xd0, 0xc8, 0x14, 0x05, 0x26, 0xc4, 0x54, 0x0e, 0x5b, 0xe8, 0x45, 0x08, 0x71, - 0x57, 0x30, 0xc6, 0x83, 0x07, 0xb5, 0x54, 0x62, 0x13, 0x25, 0x64, 0x83, 0x07, 0xbd, 0x90, 0xe9, - 0xce, 0xeb, 0x76, 0xe2, 0x76, 0x66, 0x33, 0x33, 0x0b, 0xe5, 0x27, 0x78, 0x30, 0xf1, 0xe8, 0x4f, - 0xe2, 0xc8, 0xd1, 0x53, 0xd5, 0xf6, 0x1f, 0x78, 0xe4, 0x64, 0x76, 0x77, 0xba, 0x04, 0x13, 0x12, - 0x24, 0x26, 0x5e, 0xbc, 0x4d, 0x5f, 0xbf, 0xf7, 0xbe, 0x6f, 0xbe, 0x6f, 0xf6, 0xe1, 0x35, 0x3a, - 0x84, 0x88, 0x2a, 0x4f, 0xc0, 0x30, 0xd1, 0xde, 0xd1, 0x56, 0x17, 0x0c, 0xdd, 0xf2, 0xe0, 0x08, - 0x84, 0xd1, 0x6e, 0xac, 0xa4, 0x91, 0x64, 0x39, 0x87, 0xb8, 0x19, 0xc4, 0xb5, 0x90, 0x15, 0x27, - 0x94, 0x32, 0x8c, 0xc0, 0xcb, 0x30, 0xdd, 0xa4, 0xe7, 0xb1, 0x44, 0x51, 0xc3, 0xa5, 0xc8, 0xbb, - 0x56, 0x96, 0x43, 0x19, 0xca, 0xec, 0xe8, 0xa5, 0x27, 0x5b, 0x75, 0x02, 0xa9, 0x07, 0x52, 0x7b, - 0x5d, 0xaa, 0xa1, 0x60, 0x0b, 0x24, 0x9f, 0x76, 0x6d, 0x5c, 0x92, 0x03, 0xc3, 0x58, 0x2a, 0x03, - 0xac, 0x40, 0x9a, 0x93, 0x18, 0xac, 0xac, 0xe6, 0xc7, 0x0a, 0xae, 0xed, 0x02, 0xb4, 0x81, 0x25, - 0x81, 0x01, 0x46, 0x34, 0xae, 0x19, 0x45, 0x85, 0xee, 0x81, 0x3a, 0xe4, 0xac, 0x8e, 0x56, 0xd1, - 0xfa, 0x4c, 0xcb, 0x1f, 0x8f, 0x1a, 0xf8, 0xc0, 0x96, 0x3b, 0xed, 0xf3, 0x51, 0xe3, 0x79, 0xc8, - 0x4d, 0x3f, 0xe9, 0xba, 0x81, 0x1c, 0x78, 0x39, 0x99, 0x00, 0x73, 0x2c, 0xd5, 0x07, 0xfb, 0xeb, - 0x41, 0x20, 0x15, 0x78, 0xc3, 0xdf, 0x14, 0xb8, 0x17, 0x33, 0x7c, 0x3c, 0xa5, 0xe9, 0x30, 0x12, - 0xe1, 0x05, 0x05, 0x01, 0x8f, 0x39, 0x08, 0x73, 0x18, 0xf4, 0x29, 0x17, 0xf5, 0xf2, 0x2a, 0x5a, - 0x9f, 0x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 0xad, 0x69, 0x08, 0x3e, 0x04, 0xc0, 0x8f, 0x80, 0x91, 0xbb, 0xb8, 0x6c, 0x9f, - 0xda, 0x5c, 0xab, 0x3a, 0x1e, 0x35, 0xca, 0x9d, 0xb6, 0x5f, 0xe6, 0x8c, 0xac, 0xe1, 0xf9, 0x98, - 0x9e, 0x44, 0x92, 0xb2, 0xc3, 0x3e, 0xd5, 0xfd, 0x4c, 0xe6, 0xbc, 0x5f, 0xb3, 0xb5, 0x57, 0x54, - 0xf7, 0xc9, 0x1e, 0xae, 0x6a, 0x10, 0x0c, 0x94, 0xd5, 0xf2, 0xd0, 0xbd, 0xb4, 0xf6, 0x8a, 0xbb, - 0x17, 0xb7, 0x51, 0x52, 0xeb, 0xcc, 0x08, 0x1b, 0xf0, 0x34, 0xb5, 0x7c, 0x0a, 0x39, 0xc0, 0x73, - 0xc5, 0x13, 0xb0, 0x89, 0xdf, 0x74, 0xe4, 0xc5, 0xa0, 0xe6, 0x26, 0x5e, 0xb2, 0x77, 0xde, 0x57, - 0x32, 0x00, 0xad, 0xb9, 0x08, 0xaf, 0xba, 0x75, 0x73, 0xa3, 0x30, 0xe8, 0xe5, 0x10, 0x82, 0xc4, - 0x5c, 0x6d, 0x50, 0xf3, 0x3e, 0xbe, 0x6d, 0xa1, 0xbb, 0x94, 0x47, 0x57, 0x03, 0x5b, 0xfb, 0xa7, - 0x63, 0x07, 0x9d, 0x8d, 0x1d, 0xf4, 0x7d, 0xec, 0xa0, 0xcf, 0x13, 0xa7, 0x74, 0x3a, 0x71, 0xd0, - 0xd9, 0xc4, 0x29, 0x7d, 0x9d, 0x38, 0xa5, 0xf7, 0xdb, 0x7f, 0xf4, 0x9e, 0xb2, 0x6d, 0xde, 0xad, - 0x66, 0x61, 0x3f, 0xfa, 0x15, 0x00, 0x00, 0xff, 0xff, 0x35, 0x60, 0x41, 0xd9, 0x8a, 0x06, 0x00, - 0x00, + // 674 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0x41, 0x4f, 0x13, 0x41, + 0x14, 0xee, 0xb6, 0x50, 0x61, 0x8a, 0x02, 0x13, 0x42, 0x2a, 0x87, 0x5d, 0xe8, 0x45, 0x08, 0x71, + 0x57, 0x30, 0xea, 0xc1, 0x83, 0xda, 0x56, 0x62, 0x13, 0x25, 0x64, 0x83, 0x26, 0x7a, 0x21, 0xd3, + 0x9d, 0xd7, 0xed, 0xc4, 0x76, 0xa6, 0x99, 0x99, 0x85, 0xf2, 0x13, 0x3c, 0x98, 0xe8, 0xcd, 0x9f, + 0xc4, 0x91, 0xa3, 0xa7, 0xaa, 0xed, 0x3f, 0xf0, 0xc8, 0xc9, 0xec, 0xee, 0x74, 0x09, 0x44, 0x14, + 0x89, 0x89, 0x17, 0x6f, 0xbb, 0x6f, 0xbf, 0xf7, 0xbd, 0xf7, 0xbe, 0xef, 0xf5, 0x15, 0xad, 0x90, + 0x3e, 0x74, 0x88, 0xf4, 0x38, 0xf4, 0x23, 0xe5, 0xed, 0x6f, 0x34, 0x41, 0x93, 0x0d, 0x0f, 0xf6, + 0x81, 0x6b, 0xe5, 0xf6, 0xa4, 0xd0, 0x02, 0x2f, 0xa4, 0x10, 0x37, 0x81, 0xb8, 0x06, 0xb2, 0x64, + 0x87, 0x42, 0x84, 0x1d, 0xf0, 0x12, 0x4c, 0x33, 0x6a, 0x79, 0x34, 0x92, 0x44, 0x33, 0xc1, 0xd3, + 0xac, 0xa5, 0x85, 0x50, 0x84, 0x22, 0x79, 0xf4, 0xe2, 0x27, 0x13, 0xb5, 0x03, 0xa1, 0xba, 0x42, + 0x79, 0x4d, 0xa2, 0x20, 0xab, 0x16, 0x08, 0x36, 0xce, 0x5a, 0x3b, 0xd3, 0x0e, 0xf4, 0x7b, 0x42, + 0x6a, 0xa0, 0x19, 0x52, 0x1f, 0xf6, 0xc0, 0xb4, 0x55, 0x79, 0x57, 0x40, 0xa5, 0x2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57, 0xd6, 0x32, 0x81, 0x9e, 0xf6, 0x21, + 0x88, 0xf4, 0xc5, 0x02, 0x55, 0x6e, 0xa1, 0xeb, 0x06, 0xba, 0x45, 0x58, 0xe7, 0x17, 0xc0, 0x8f, + 0x16, 0x72, 0x6a, 0x82, 0x73, 0x08, 0x62, 0x5b, 0x7c, 0x11, 0x69, 0x90, 0xe7, 0x5d, 0x78, 0x85, + 0xae, 0x75, 0xd3, 0x50, 0x42, 0x50, 0xda, 0xbc, 0xff, 0xbb, 0xc1, 0x7f, 0x4e, 0x68, 0xc6, 0x1f, + 0x93, 0xe1, 0x45, 0x54, 0x94, 0xf1, 0x77, 0x9a, 0xf8, 0x37, 0xe5, 0x9b, 0xb7, 0xea, 0xce, 0xd1, + 0xd0, 0xb6, 0x8e, 0x87, 0xb6, 0xf5, 0x75, 0x68, 0x5b, 0x1f, 0x46, 0x76, 0xee, 0x68, 0x64, 0x5b, + 0xc7, 0x23, 0x3b, 0xf7, 0x79, 0x64, 0xe7, 0xde, 0x6c, 0xfe, 0xd1, 0x8e, 0x27, 0xff, 0x30, 0xcd, + 0x62, 0xb2, 0x80, 0x77, 0x7f, 0x04, 0x00, 0x00, 0xff, 0xff, 0x17, 0x55, 0xd1, 0x34, 0x1e, 0x07, + 0x00, 0x00, } func (m *FeeDeducted) Marshal() (dAtA []byte, err error) { @@ -844,6 +904,49 @@ func (m *MessageFailed) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ConnectionRouterMessageReceived) 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 *ConnectionRouterMessageReceived) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionRouterMessageReceived) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Routed { + i-- + if m.Routed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + { + size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -980,6 +1083,20 @@ func (m *MessageFailed) Size() (n int) { return n } +func (m *ConnectionRouterMessageReceived) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Message.Size() + n += 1 + l + sovEvents(uint64(l)) + if m.Routed { + n += 2 + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1960,6 +2077,109 @@ func (m *MessageFailed) Unmarshal(dAtA []byte) error { } return nil } +func (m *ConnectionRouterMessageReceived) 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 ErrIntOverflowEvents + } + 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: ConnectionRouterMessageReceived: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectionRouterMessageReceived: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Routed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Routed = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0