From e5bce0bd7a25c916deae64fe02823932f94256e1 Mon Sep 17 00:00:00 2001 From: Aditya Sripal <14364734+AdityaSripal@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:23:11 +0100 Subject: [PATCH 1/3] simplify ack to array of byte arrays --- .../core/04-channel/v2/keeper/msg_server.go | 37 +- .../04-channel/v2/keeper/msg_server_test.go | 62 ++-- modules/core/04-channel/v2/keeper/packet.go | 4 +- .../core/04-channel/v2/keeper/packet_test.go | 16 +- .../core/04-channel/v2/types/commitment.go | 4 +- modules/core/04-channel/v2/types/packet.pb.go | 349 +++--------------- modules/core/ante/ante_test.go | 9 +- proto/ibc/core/channel/v2/packet.proto | 8 +- 8 files changed, 112 insertions(+), 377 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/msg_server.go b/modules/core/04-channel/v2/keeper/msg_server.go index 6bda4404531..c7d02be6b06 100644 --- a/modules/core/04-channel/v2/keeper/msg_server.go +++ b/modules/core/04-channel/v2/keeper/msg_server.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "slices" "time" errorsmod "cosmossdk.io/errors" @@ -130,9 +129,10 @@ func (k *Keeper) RecvPacket(ctx context.Context, msg *types.MsgRecvPacket) (*typ // build up the recv results for each application callback. ack := types.Acknowledgement{ - AcknowledgementResults: []types.AcknowledgementResult{}, + AppAcknowledgements: [][]byte{}, } + var isAsync bool for _, pd := range msg.Packet.Payloads { // Cache context so that we may discard state changes from callback if the acknowledgement is unsuccessful. cacheCtx, writeFn = sdkCtx.CacheContext() @@ -147,23 +147,26 @@ func (k *Keeper) RecvPacket(ctx context.Context, msg *types.MsgRecvPacket) (*typ sdkCtx.EventManager().EmitEvents(internalerrors.ConvertToErrorEvents(cacheCtx.EventManager().Events())) } - ack.AcknowledgementResults = append(ack.AcknowledgementResults, types.AcknowledgementResult{ - AppName: pd.DestinationPort, - RecvPacketResult: res, - }) + if res.Status == types.PacketStatus_Async { + // Set packet acknowledgement to async if any of the acknowledgements are async. + isAsync = true + // Return error if there is more than 1 payload + // TODO: Handle case where there are multiple payloads + if len(msg.Packet.Payloads) > 1 { + return nil, errorsmod.Wrapf(types.ErrInvalidPacket, "packet with multiple payloads cannot have async acknowledgement") + } + } + + // append app acknowledgement to the overall acknowledgement + ack.AppAcknowledgements = append(ack.AppAcknowledgements, res.Acknowledgement) } // note this should never happen as the payload would have had to be empty. - if len(ack.AcknowledgementResults) == 0 { + if len(ack.AppAcknowledgements) == 0 { sdkCtx.Logger().Error("receive packet failed", "source-channel", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "invalid acknowledgement results")) return &types.MsgRecvPacketResponse{Result: types.FAILURE}, errorsmod.Wrapf(err, "receive packet failed source-channel %s invalid acknowledgement results", msg.Packet.SourceChannel) } - // NOTE: TBD how we will handle async acknowledgements with more than one payload. - isAsync := slices.ContainsFunc(ack.AcknowledgementResults, func(ackResult types.AcknowledgementResult) bool { - return ackResult.RecvPacketResult.Status == types.PacketStatus_Async - }) - if !isAsync { // Set packet acknowledgement only if the acknowledgement is not async. // NOTE: IBC applications modules may call the WriteAcknowledgement asynchronously if the @@ -203,14 +206,10 @@ func (k *Keeper) Acknowledgement(ctx context.Context, msg *types.MsgAcknowledgem return nil, errorsmod.Wrap(err, "acknowledge packet verification failed") } - recvResults := make(map[string]types.RecvPacketResult) - for _, r := range msg.Acknowledgement.AcknowledgementResults { - recvResults[r.AppName] = r.RecvPacketResult - } - - for _, pd := range msg.Packet.Payloads { + for i, pd := range msg.Packet.Payloads { cbs := k.Router.Route(pd.SourcePort) - err := cbs.OnAcknowledgementPacket(ctx, msg.Packet.SourceChannel, msg.Packet.DestinationChannel, pd, recvResults[pd.DestinationPort].Acknowledgement, relayer) + ack := msg.Acknowledgement.AppAcknowledgements[i] + err := cbs.OnAcknowledgementPacket(ctx, msg.Packet.SourceChannel, msg.Packet.DestinationChannel, pd, ack, relayer) if err != nil { return nil, errorsmod.Wrapf(err, "failed OnAcknowledgementPacket for source port %s, source channel %s, destination channel %s", pd.SourcePort, msg.Packet.SourceChannel, msg.Packet.DestinationChannel) } diff --git a/modules/core/04-channel/v2/keeper/msg_server_test.go b/modules/core/04-channel/v2/keeper/msg_server_test.go index 2fa079e1e1f..833f8e16ad5 100644 --- a/modules/core/04-channel/v2/keeper/msg_server_test.go +++ b/modules/core/04-channel/v2/keeper/msg_server_test.go @@ -230,49 +230,50 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { path *ibctesting.Path packet channeltypesv2.Packet expectedAck channeltypesv2.Acknowledgement + expRecvRes channeltypesv2.RecvPacketResult ) testCases := []struct { - name string - malleate func() - expError error + name string + malleate func() + expError error + expAckWritten bool }{ { - name: "success", - malleate: func() {}, - expError: nil, + name: "success", + malleate: func() {}, + expError: nil, + expAckWritten: true, }, { name: "success: failed recv result", malleate: func() { - failedRecvResult := channeltypesv2.RecvPacketResult{ + expRecvRes = channeltypesv2.RecvPacketResult{ Status: channeltypesv2.PacketStatus_Failure, Acknowledgement: mock.MockFailPacketData, } - // a failed ack should be returned by the application. - expectedAck.AcknowledgementResults[0].RecvPacketResult = failedRecvResult - path.EndpointB.Chain.GetSimApp().MockModuleV2B.IBCApp.OnRecvPacket = func(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.Payload, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult { - return failedRecvResult + return expRecvRes } }, + expError: nil, + expAckWritten: true, }, { name: "success: async recv result", malleate: func() { - asyncResult := channeltypesv2.RecvPacketResult{ + expRecvRes = channeltypesv2.RecvPacketResult{ Status: channeltypesv2.PacketStatus_Async, Acknowledgement: nil, } - // an async ack should be returned by the application. - expectedAck.AcknowledgementResults[0].RecvPacketResult = asyncResult - path.EndpointB.Chain.GetSimApp().MockModuleV2B.IBCApp.OnRecvPacket = func(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.Payload, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult { - return asyncResult + return expRecvRes } }, + expError: nil, + expAckWritten: false, }, { name: "success: NoOp", @@ -280,6 +281,8 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { suite.chainB.App.GetIBCKeeper().ChannelKeeperV2.SetPacketReceipt(suite.chainB.GetContext(), packet.DestinationChannel, packet.Sequence) expectedAck = channeltypesv2.Acknowledgement{} }, + expError: nil, + expAckWritten: false, }, { name: "failure: counterparty not found", @@ -314,18 +317,14 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { packet, err = path.EndpointA.MsgSendPacket(timeoutTimestamp, mockv2.NewMockPayload(mockv2.ModuleNameA, mockv2.ModuleNameB)) suite.Require().NoError(err) - // default expected ack is a single successful recv result for moduleB. - expectedAck = channeltypesv2.Acknowledgement{ - AcknowledgementResults: []channeltypesv2.AcknowledgementResult{ - { - AppName: mockv2.ModuleNameB, - RecvPacketResult: mockv2.MockRecvPacketResult, - }, - }, - } + // default expected receive result is a single successful recv result for moduleB. + expRecvRes = mockv2.MockRecvPacketResult tc.malleate() + // expectedAck is derived from the expected recv result. + expectedAck = channeltypesv2.Acknowledgement{AppAcknowledgements: [][]byte{expRecvRes.Acknowledgement}} + err = path.EndpointB.MsgRecvPacket(packet) ck := path.EndpointB.Chain.GetSimApp().IBCKeeper.ChannelKeeperV2 @@ -340,7 +339,7 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { ackWritten := ck.HasPacketAcknowledgement(path.EndpointB.Chain.GetContext(), packet.DestinationChannel, packet.Sequence) - if len(expectedAck.AcknowledgementResults) == 0 || expectedAck.AcknowledgementResults[0].RecvPacketResult.Status == channeltypesv2.PacketStatus_Async { + if !tc.expAckWritten { // ack should not be written for async app or if the packet receipt was already present. suite.Require().False(ackWritten) } else { // successful or failed acknowledgement @@ -415,7 +414,7 @@ func (suite *KeeperTestSuite) TestMsgAcknowledgement() { { name: "failure: failed membership verification", malleate: func() { - ack.AcknowledgementResults[0].RecvPacketResult.Acknowledgement = mock.MockFailPacketData + ack.AppAcknowledgements[0] = mock.MockFailPacketData }, expError: errors.New("failed packet acknowledgement verification"), }, @@ -438,14 +437,7 @@ func (suite *KeeperTestSuite) TestMsgAcknowledgement() { suite.Require().NoError(err) // Construct expected acknowledgement - ack = channeltypesv2.Acknowledgement{ - AcknowledgementResults: []channeltypesv2.AcknowledgementResult{ - { - AppName: mockv2.ModuleNameB, - RecvPacketResult: mockv2.MockRecvPacketResult, - }, - }, - } + ack = channeltypesv2.Acknowledgement{AppAcknowledgements: [][]byte{mockv2.MockRecvPacketResult.Acknowledgement}} tc.malleate() diff --git a/modules/core/04-channel/v2/keeper/packet.go b/modules/core/04-channel/v2/keeper/packet.go index 6ba078490c5..d7e40d07fc2 100644 --- a/modules/core/04-channel/v2/keeper/packet.go +++ b/modules/core/04-channel/v2/keeper/packet.go @@ -191,8 +191,8 @@ func (k Keeper) WriteAcknowledgement( // TODO: Validate Acknowledgment more thoroughly here after Issue #7472: https://github.com/cosmos/ibc-go/issues/7472 - if len(ack.AcknowledgementResults) != len(packet.Payloads) { - return errorsmod.Wrapf(types.ErrInvalidAcknowledgement, "length of acknowledgement results %d does not match length of payload %d", len(ack.AcknowledgementResults), len(packet.Payloads)) + if len(ack.AppAcknowledgements) != len(packet.Payloads) { + return errorsmod.Wrapf(types.ErrInvalidAcknowledgement, "length of app acknowledgement %d does not match length of app payload %d", len(ack.AppAcknowledgements), len(packet.Payloads)) } // set the acknowledgement so that it can be verified on the other side diff --git a/modules/core/04-channel/v2/keeper/packet_test.go b/modules/core/04-channel/v2/keeper/packet_test.go index e93e2d97259..9f4988c240a 100644 --- a/modules/core/04-channel/v2/keeper/packet_test.go +++ b/modules/core/04-channel/v2/keeper/packet_test.go @@ -275,7 +275,7 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgement() { "failure: empty ack", func() { ack = types.Acknowledgement{ - AcknowledgementResults: []types.AcknowledgementResult{}, + AppAcknowledgements: [][]byte{}, } }, types.ErrInvalidAcknowledgement, @@ -307,12 +307,7 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgement() { // create standard ack that can be malleated ack = types.Acknowledgement{ - AcknowledgementResults: []types.AcknowledgementResult{ - { - AppName: mockv2.ModuleNameB, - RecvPacketResult: mockv2.MockRecvPacketResult, - }, - }, + AppAcknowledgements: [][]byte{mockv2.MockRecvPacketResult.Acknowledgement}, } suite.chainB.App.GetIBCKeeper().ChannelKeeperV2.SetPacketReceipt(suite.chainB.GetContext(), packet.DestinationChannel, packet.Sequence) @@ -340,10 +335,7 @@ func (suite *KeeperTestSuite) TestAcknowledgePacket() { packet types.Packet err error ack = types.Acknowledgement{ - AcknowledgementResults: []types.AcknowledgementResult{{ - AppName: mockv2.ModuleNameB, - RecvPacketResult: mockv2.MockRecvPacketResult, - }}, + AppAcknowledgements: [][]byte{mockv2.MockRecvPacketResult.Acknowledgement}, } freezeClient bool ) @@ -397,7 +389,7 @@ func (suite *KeeperTestSuite) TestAcknowledgePacket() { { "failure: verify membership fails", func() { - ack.AcknowledgementResults[0].RecvPacketResult = mockv2.MockFailRecvPacketResult + ack.AppAcknowledgements[0] = mockv2.MockFailRecvPacketResult.Acknowledgement }, commitmenttypes.ErrInvalidProof, }, diff --git a/modules/core/04-channel/v2/types/commitment.go b/modules/core/04-channel/v2/types/commitment.go index 721049ca83b..8078ab4123e 100644 --- a/modules/core/04-channel/v2/types/commitment.go +++ b/modules/core/04-channel/v2/types/commitment.go @@ -51,8 +51,8 @@ func hashPayload(data Payload) []byte { // CommitAcknowledgement returns the hash of the acknowledgement data. func CommitAcknowledgement(acknowledgement Acknowledgement) []byte { var buf []byte - for _, ack := range acknowledgement.GetAcknowledgementResults() { - hash := sha256.Sum256(ack.RecvPacketResult.GetAcknowledgement()) + for _, ack := range acknowledgement.GetAppAcknowledgements() { + hash := sha256.Sum256(ack) buf = append(buf, hash[:]...) } diff --git a/modules/core/04-channel/v2/types/packet.pb.go b/modules/core/04-channel/v2/types/packet.pb.go index a41a9d8256e..cb14c1e8880 100644 --- a/modules/core/04-channel/v2/types/packet.pb.go +++ b/modules/core/04-channel/v2/types/packet.pb.go @@ -227,7 +227,7 @@ func (m *Payload) GetValue() []byte { // 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"` + AppAcknowledgements [][]byte `protobuf:"bytes,1,rep,name=app_acknowledgements,json=appAcknowledgements,proto3" json:"app_acknowledgements,omitempty"` } func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } @@ -263,66 +263,13 @@ func (m *Acknowledgement) XXX_DiscardUnknown() { var xxx_messageInfo_Acknowledgement proto.InternalMessageInfo -func (m *Acknowledgement) GetAcknowledgementResults() []AcknowledgementResult { +func (m *Acknowledgement) GetAppAcknowledgements() [][]byte { if m != nil { - return m.AcknowledgementResults + return m.AppAcknowledgements } 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_2f814aba9ca97169, []int{3} -} -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 @@ -335,7 +282,7 @@ 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_2f814aba9ca97169, []int{4} + return fileDescriptor_2f814aba9ca97169, []int{3} } func (m *RecvPacketResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -383,55 +330,50 @@ func init() { proto.RegisterType((*Packet)(nil), "ibc.core.channel.v2.Packet") 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/packet.proto", fileDescriptor_2f814aba9ca97169) } var fileDescriptor_2f814aba9ca97169 = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xc1, 0x6a, 0x13, 0x41, - 0x18, 0xc7, 0x33, 0x6d, 0xd2, 0x24, 0x93, 0xda, 0xae, 0xd3, 0x56, 0xb7, 0x41, 0xd2, 0x35, 0x50, - 0x8d, 0x95, 0xee, 0x4a, 0xf4,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xae, 0x92, 0xf9, 0xf4, 0x7a, 0xe8, 0x88, 0xd3, 0xa8, - 0xaf, 0x13, 0xe6, 0x19, 0x84, 0x71, 0x8f, 0x71, 0xc3, 0xe9, 0x93, 0xfd, 0x21, 0x33, 0xe2, 0x03, - 0xc3, 0x63, 0x83, 0xc8, 0xa5, 0x3c, 0x79, 0x4b, 0x5e, 0xbc, 0xda, 0x9f, 0x7a, 0x4e, 0xc4, 0x45, - 0x40, 0x79, 0x7f, 0x45, 0xbe, 0x11, 0x2f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x59, 0x03, - 0x6e, 0x72, 0x04, 0x00, 0x00, + // 587 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xc1, 0x6e, 0xd3, 0x30, + 0x18, 0xc7, 0xeb, 0xb5, 0xdd, 0x56, 0xaf, 0x6c, 0xc1, 0x1d, 0x52, 0xa8, 0x50, 0x17, 0x2a, 0x01, + 0x05, 0xb4, 0x04, 0x0a, 0x97, 0x49, 0x08, 0xa9, 0xcb, 0x32, 0x69, 0x02, 0x95, 0xca, 0x69, 0x91, + 0xe0, 0x52, 0xb9, 0xae, 0x95, 0x45, 0x4b, 0xe2, 0x10, 0x3b, 0x99, 0xf6, 0x0a, 0x3b, 0xf1, 0x02, + 0x3b, 0x70, 0xe6, 0x45, 0x76, 0xdc, 0x91, 0x13, 0x42, 0xdb, 0x89, 0xb7, 0x40, 0x75, 0xb2, 0xaa, + 0x1b, 0x70, 0x4a, 0xbe, 0xff, 0xf7, 0xfb, 0xdb, 0xfa, 0x7f, 0xd6, 0x07, 0x0d, 0x7f, 0x42, 0x2d, + 0xca, 0x13, 0x66, 0xd1, 0x43, 0x12, 0x45, 0x2c, 0xb0, 0xb2, 0xae, 0x15, 0x13, 0x7a, 0xc4, 0xa4, + 0x19, 0x27, 0x5c, 0x72, 0xd4, 0xf0, 0x27,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x50, 0x1b, 0x36, 0x6e, 0x72, 0x3d, 0xf7, 0x53, 0xdf, 0xd6, 0xca, 0xcd, + 0xda, 0xe9, 0x99, 0x51, 0xed, 0x89, 0x93, 0x88, 0xee, 0x7e, 0x3c, 0xbf, 0x6c, 0x81, 0x8b, 0xcb, + 0x16, 0xf8, 0x75, 0xd9, 0x02, 0x5f, 0xaf, 0x5a, 0xa5, 0x8b, 0xab, 0x56, 0xe9, 0xc7, 0x55, 0xab, + 0xf4, 0xf9, 0x8d, 0xe7, 0xcb, 0xc3, 0x74, 0x62, 0x52, 0x1e, 0x5a, 0x94, 0x8b, 0x90, 0x0b, 0xcb, + 0x9f, 0xd0, 0x6d, 0x8f, 0x5b, 0xd9, 0x8e, 0x15, 0xf2, 0x69, 0x1a, 0x30, 0x91, 0xef, 0xe0, 0x8b, + 0xd7, 0xdb, 0x0b, 0x6b, 0x28, 0x4f, 0x62, 0x26, 0x26, 0xcb, 0x6a, 0xb7, 0x5e, 0xfd, 0x09, 0x00, + 0x00, 0xff, 0xff, 0x23, 0xd8, 0x40, 0xe5, 0xaa, 0x03, 0x00, 0x00, } func (m *Packet) Marshal() (dAtA []byte, err error) { @@ -573,16 +515,11 @@ func (m *Acknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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 = encodeVarintPacket(dAtA, i, uint64(size)) - } + if len(m.AppAcknowledgements) > 0 { + for iNdEx := len(m.AppAcknowledgements) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AppAcknowledgements[iNdEx]) + copy(dAtA[i:], m.AppAcknowledgements[iNdEx]) + i = encodeVarintPacket(dAtA, i, uint64(len(m.AppAcknowledgements[iNdEx]))) i-- dAtA[i] = 0xa } @@ -590,46 +527,6 @@ func (m *Acknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 = encodeVarintPacket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.AppName) > 0 { - i -= len(m.AppName) - copy(dAtA[i:], m.AppName) - i = encodeVarintPacket(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) @@ -740,30 +637,15 @@ func (m *Acknowledgement) Size() (n int) { } var l int _ = l - if len(m.AcknowledgementResults) > 0 { - for _, e := range m.AcknowledgementResults { - l = e.Size() + if len(m.AppAcknowledgements) > 0 { + for _, b := range m.AppAcknowledgements { + l = len(b) n += 1 + l + sovPacket(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 + sovPacket(uint64(l)) - } - l = m.RecvPacketResult.Size() - n += 1 + l + sovPacket(uint64(l)) - return n -} - func (m *RecvPacketResult) Size() (n int) { if m == nil { return 0 @@ -1215,125 +1097,9 @@ func (m *Acknowledgement) Unmarshal(dAtA []byte) error { 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 ErrIntOverflowPacket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + return fmt.Errorf("proto: wrong wireType = %d for field AppAcknowledgements", wireType) } - if msglen < 0 { - return ErrInvalidLengthPacket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPacket - } - 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 := skipPacket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPacket - } - 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 ErrIntOverflowPacket - } - 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 ErrIntOverflowPacket - } - 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 ErrInvalidLengthPacket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPacket - } - 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 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacket @@ -1343,24 +1109,23 @@ func (m *AcknowledgementResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthPacket } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthPacket } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RecvPacketResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AppAcknowledgements = append(m.AppAcknowledgements, make([]byte, postIndex-iNdEx)) + copy(m.AppAcknowledgements[len(m.AppAcknowledgements)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/modules/core/ante/ante_test.go b/modules/core/ante/ante_test.go index 75e37659640..f654e776c34 100644 --- a/modules/core/ante/ante_test.go +++ b/modules/core/ante/ante_test.go @@ -128,14 +128,7 @@ func (suite *AnteTestSuite) createAcknowledgementMessageV2(isRedundant bool) *ch err = suite.path.EndpointA.MsgRecvPacket(packet) suite.Require().NoError(err) - ack := channeltypesv2.Acknowledgement{ - AcknowledgementResults: []channeltypesv2.AcknowledgementResult{ - { - AppName: mock.ModuleNameB, - RecvPacketResult: mock.MockRecvPacketResult, - }, - }, - } + ack := channeltypesv2.Acknowledgement{[][]byte{mock.MockRecvPacketResult.Acknowledgement}} if isRedundant { err = suite.path.EndpointB.MsgAcknowledgePacket(packet, ack) suite.Require().NoError(err) diff --git a/proto/ibc/core/channel/v2/packet.proto b/proto/ibc/core/channel/v2/packet.proto index fef2c588e5a..ea14112c643 100644 --- a/proto/ibc/core/channel/v2/packet.proto +++ b/proto/ibc/core/channel/v2/packet.proto @@ -39,13 +39,7 @@ message Payload { // 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]; + repeated bytes app_acknowledgements = 1; } // PacketStatus specifies the status of a RecvPacketResult. From 7a67e7248dd62848fbaca6f55526183580ae5231 Mon Sep 17 00:00:00 2001 From: Aditya Sripal <14364734+AdityaSripal@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:37:08 +0100 Subject: [PATCH 2/3] simplify test --- .../04-channel/v2/keeper/msg_server_test.go | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/msg_server_test.go b/modules/core/04-channel/v2/keeper/msg_server_test.go index 833f8e16ad5..5e3576f0c88 100644 --- a/modules/core/04-channel/v2/keeper/msg_server_test.go +++ b/modules/core/04-channel/v2/keeper/msg_server_test.go @@ -227,10 +227,9 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { func (suite *KeeperTestSuite) TestMsgRecvPacket() { var ( - path *ibctesting.Path - packet channeltypesv2.Packet - expectedAck channeltypesv2.Acknowledgement - expRecvRes channeltypesv2.RecvPacketResult + path *ibctesting.Path + packet channeltypesv2.Packet + expRecvRes channeltypesv2.RecvPacketResult ) testCases := []struct { @@ -252,10 +251,6 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { Status: channeltypesv2.PacketStatus_Failure, Acknowledgement: mock.MockFailPacketData, } - - path.EndpointB.Chain.GetSimApp().MockModuleV2B.IBCApp.OnRecvPacket = func(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.Payload, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult { - return expRecvRes - } }, expError: nil, expAckWritten: true, @@ -267,10 +262,6 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { Status: channeltypesv2.PacketStatus_Async, Acknowledgement: nil, } - - path.EndpointB.Chain.GetSimApp().MockModuleV2B.IBCApp.OnRecvPacket = func(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.Payload, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult { - return expRecvRes - } }, expError: nil, expAckWritten: false, @@ -279,7 +270,6 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { name: "success: NoOp", malleate: func() { suite.chainB.App.GetIBCKeeper().ChannelKeeperV2.SetPacketReceipt(suite.chainB.GetContext(), packet.DestinationChannel, packet.Sequence) - expectedAck = channeltypesv2.Acknowledgement{} }, expError: nil, expAckWritten: false, @@ -323,7 +313,12 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { tc.malleate() // expectedAck is derived from the expected recv result. - expectedAck = channeltypesv2.Acknowledgement{AppAcknowledgements: [][]byte{expRecvRes.Acknowledgement}} + expectedAck := channeltypesv2.Acknowledgement{AppAcknowledgements: [][]byte{expRecvRes.Acknowledgement}} + + // modify the callback to return the expected recv result. + path.EndpointB.Chain.GetSimApp().MockModuleV2B.IBCApp.OnRecvPacket = func(ctx context.Context, sourceChannel string, destinationChannel string, data channeltypesv2.Payload, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult { + return expRecvRes + } err = path.EndpointB.MsgRecvPacket(packet) From 11501cff6f90228823015e2dd576501310956318 Mon Sep 17 00:00:00 2001 From: Aditya Sripal <14364734+AdityaSripal@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:56:11 +0100 Subject: [PATCH 3/3] lint --- modules/core/ante/ante_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/ante/ante_test.go b/modules/core/ante/ante_test.go index f654e776c34..a7fd7062f5e 100644 --- a/modules/core/ante/ante_test.go +++ b/modules/core/ante/ante_test.go @@ -128,7 +128,7 @@ func (suite *AnteTestSuite) createAcknowledgementMessageV2(isRedundant bool) *ch err = suite.path.EndpointA.MsgRecvPacket(packet) suite.Require().NoError(err) - ack := channeltypesv2.Acknowledgement{[][]byte{mock.MockRecvPacketResult.Acknowledgement}} + ack := channeltypesv2.Acknowledgement{AppAcknowledgements: [][]byte{mock.MockRecvPacketResult.Acknowledgement}} if isRedundant { err = suite.path.EndpointB.MsgAcknowledgePacket(packet, ack) suite.Require().NoError(err)