From 7e02a968bac801f43053b0ccdc82e94f85e8941b Mon Sep 17 00:00:00 2001 From: Aditya <14364734+AdityaSripal@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:06:31 +0200 Subject: [PATCH] Rename Id Fields to Channel for Packet V2 (#7428) * change id fields to channel * Apply suggestions from code review Co-authored-by: Damian Nolan --------- Co-authored-by: Damian Nolan --- .../core/04-channel/v2/keeper/msg_server.go | 18 +-- modules/core/04-channel/v2/keeper/relay.go | 42 +++--- .../core/04-channel/v2/types/channel.pb.go | 124 +++++++++--------- modules/core/04-channel/v2/types/packet.go | 20 +-- .../core/04-channel/v2/types/packet_test.go | 4 +- modules/core/04-channel/v2/types/tx.pb.go | 110 ++++++++-------- proto/ibc/core/channel/v2/channel.proto | 4 +- proto/ibc/core/channel/v2/tx.proto | 2 +- 8 files changed, 162 insertions(+), 162 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/msg_server.go b/modules/core/04-channel/v2/keeper/msg_server.go index 0455fd7adbe..819e3a6549e 100644 --- a/modules/core/04-channel/v2/keeper/msg_server.go +++ b/modules/core/04-channel/v2/keeper/msg_server.go @@ -16,10 +16,10 @@ var _ channeltypesv2.MsgServer = &Keeper{} // SendPacket implements the PacketMsgServer SendPacket method. func (k *Keeper) SendPacket(ctx context.Context, msg *channeltypesv2.MsgSendPacket) (*channeltypesv2.MsgSendPacketResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - sequence, err := k.sendPacket(ctx, msg.SourceId, msg.TimeoutTimestamp, msg.PacketData) + sequence, err := k.sendPacket(ctx, msg.SourceChannel, msg.TimeoutTimestamp, msg.PacketData) if err != nil { - sdkCtx.Logger().Error("send packet failed", "source-id", msg.SourceId, "error", errorsmod.Wrap(err, "send packet failed")) - return nil, errorsmod.Wrapf(err, "send packet failed for source id: %s", msg.SourceId) + sdkCtx.Logger().Error("send packet failed", "source-id", msg.SourceChannel, "error", errorsmod.Wrap(err, "send packet failed")) + return nil, errorsmod.Wrapf(err, "send packet failed for source id: %s", msg.SourceChannel) } signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -34,7 +34,7 @@ func (k *Keeper) SendPacket(ctx context.Context, msg *channeltypesv2.MsgSendPack // https://github.com/cosmos/ibc-go/issues/7384 // for _, pd := range msg.PacketData { // cbs := k.PortKeeper.AppRouter.Route(pd.SourcePort) - // err := cbs.OnSendPacket(ctx, msg.SourceId, sequence, msg.TimeoutTimestamp, pd, signer) + // err := cbs.OnSendPacket(ctx, msg.SourceChannel, sequence, msg.TimeoutTimestamp, pd, signer) // if err != nil { // return nil, err // } @@ -52,8 +52,8 @@ func (k *Keeper) RecvPacket(ctx context.Context, msg *channeltypesv2.MsgRecvPack sdkCtx := sdk.UnwrapSDKContext(ctx) err := k.recvPacket(ctx, msg.Packet, msg.ProofCommitment, msg.ProofHeight) if err != nil { - sdkCtx.Logger().Error("receive packet failed", "source-id", msg.Packet.SourceId, "dest-id", msg.Packet.DestinationId, "error", errorsmod.Wrap(err, "send packet failed")) - return nil, errorsmod.Wrapf(err, "receive packet failed for source id: %s and destination id: %s", msg.Packet.SourceId, msg.Packet.DestinationId) + sdkCtx.Logger().Error("receive packet failed", "source-id", msg.Packet.SourceChannel, "dest-id", msg.Packet.DestinationChannel, "error", errorsmod.Wrap(err, "send packet failed")) + return nil, errorsmod.Wrapf(err, "receive packet failed for source id: %s and destination id: %s", msg.Packet.SourceChannel, msg.Packet.DestinationChannel) } signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -81,8 +81,8 @@ func (k *Keeper) RecvPacket(ctx context.Context, msg *channeltypesv2.MsgRecvPack func (k *Keeper) Timeout(ctx context.Context, timeout *channeltypesv2.MsgTimeout) (*channeltypesv2.MsgTimeoutResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) if err := k.timeoutPacket(ctx, timeout.Packet, timeout.ProofUnreceived, timeout.ProofHeight); err != nil { - sdkCtx.Logger().Error("Timeout packet failed", "source-id", timeout.Packet.SourceId, "destination-id", timeout.Packet.DestinationId, "error", errorsmod.Wrap(err, "timeout packet failed")) - return nil, errorsmod.Wrapf(err, "send packet failed for source id: %s and destination id: %s", timeout.Packet.SourceId, timeout.Packet.DestinationId) + sdkCtx.Logger().Error("Timeout packet failed", "source-id", timeout.Packet.SourceChannel, "destination-id", timeout.Packet.DestinationChannel, "error", errorsmod.Wrap(err, "timeout packet failed")) + return nil, errorsmod.Wrapf(err, "send packet failed for source id: %s and destination id: %s", timeout.Packet.SourceChannel, timeout.Packet.DestinationChannel) } signer, err := sdk.AccAddressFromBech32(timeout.Signer) @@ -97,7 +97,7 @@ func (k *Keeper) Timeout(ctx context.Context, timeout *channeltypesv2.MsgTimeout // https://github.com/cosmos/ibc-go/issues/7384 // for _, pd := range timeout.Packet.Data { // cbs := k.PortKeeper.AppRouter.Route(pd.SourcePort) - // err := cbs.OnTimeoutPacket(timeout.Packet.SourceId, timeout.Packet.TimeoutTimestamp, signer) + // err := cbs.OnTimeoutPacket(timeout.Packet.SourceChannel, timeout.Packet.TimeoutTimestamp, signer) // if err != nil { // return err, err // } diff --git a/modules/core/04-channel/v2/keeper/relay.go b/modules/core/04-channel/v2/keeper/relay.go index 201df3cc5d4..93856fe77c6 100644 --- a/modules/core/04-channel/v2/keeper/relay.go +++ b/modules/core/04-channel/v2/keeper/relay.go @@ -91,7 +91,7 @@ func (k *Keeper) sendPacket( k.SetNextSequenceSend(ctx, sourceID, sequence+1) k.SetPacketCommitment(ctx, sourceID, packet.GetSequence(), commitment) - k.Logger(ctx).Info("packet sent", "sequence", strconv.FormatUint(packet.Sequence, 10), "dest_id", packet.DestinationId, "src_id", packet.SourceId) + k.Logger(ctx).Info("packet sent", "sequence", strconv.FormatUint(packet.Sequence, 10), "dest_channel_id", packet.DestinationChannel, "src_channel_id", packet.SourceChannel) EmitSendPacketEvents(ctx, packet) @@ -114,15 +114,15 @@ func (k Keeper) recvPacket( ) error { // Lookup counterparty associated with our channel and ensure // that the packet was indeed sent by our counterparty. - counterparty, ok := k.GetCounterparty(ctx, packet.DestinationId) + counterparty, ok := k.GetCounterparty(ctx, packet.DestinationChannel) if !ok { // TODO: figure out how aliasing will work when more than one packet data is sent. - counterparty, ok = k.getV1Counterparty(ctx, packet.Data[0].DestinationPort, packet.DestinationId) + counterparty, ok = k.getV1Counterparty(ctx, packet.Data[0].DestinationPort, packet.DestinationChannel) if !ok { - return errorsmod.Wrap(types.ErrCounterpartyNotFound, packet.DestinationId) + return errorsmod.Wrap(types.ErrCounterpartyNotFound, packet.DestinationChannel) } } - if counterparty.ClientId != packet.SourceId { + if counterparty.ClientId != packet.SourceChannel { return channeltypes.ErrInvalidChannelIdentifier } @@ -137,7 +137,7 @@ func (k Keeper) recvPacket( // REPLAY PROTECTION: Packet receipts will indicate that a packet has already been received // on unordered channels. Packet receipts must not be pruned, unless it has been marked stale // by the increase of the recvStartSequence. - _, found := k.GetPacketReceipt(ctx, packet.DestinationId, packet.Sequence) + _, found := k.GetPacketReceipt(ctx, packet.DestinationChannel, packet.Sequence) if found { EmitRecvPacketEvents(ctx, packet) // This error indicates that the packet has already been relayed. Core IBC will @@ -146,27 +146,27 @@ func (k Keeper) recvPacket( return channeltypes.ErrNoOpMsg } - path := hostv2.PacketCommitmentKey(packet.SourceId, packet.Sequence) + path := hostv2.PacketCommitmentKey(packet.SourceChannel, packet.Sequence) merklePath := types.BuildMerklePath(counterparty.MerklePathPrefix, path) commitment := channeltypesv2.CommitPacket(packet) if err := k.ClientKeeper.VerifyMembership( ctx, - packet.DestinationId, + packet.DestinationChannel, proofHeight, 0, 0, proof, merklePath, commitment, ); err != nil { - return errorsmod.Wrapf(err, "failed packet commitment verification for client (%s)", packet.DestinationId) + return errorsmod.Wrapf(err, "failed packet commitment verification for client (%s)", packet.DestinationChannel) } // Set Packet Receipt to prevent timeout from occurring on counterparty - k.SetPacketReceipt(ctx, packet.DestinationId, packet.Sequence) + k.SetPacketReceipt(ctx, packet.DestinationChannel, packet.Sequence) - k.Logger(ctx).Info("packet received", "sequence", strconv.FormatUint(packet.Sequence, 10), "src_id", packet.SourceId, "dst_id", packet.DestinationId) + k.Logger(ctx).Info("packet received", "sequence", strconv.FormatUint(packet.Sequence, 10), "src_id", packet.SourceChannel, "dst_id", packet.DestinationChannel) EmitRecvPacketEvents(ctx, packet) @@ -188,17 +188,17 @@ func (k Keeper) timeoutPacket( ) error { // Lookup counterparty associated with our channel and ensure // that the packet was indeed sent by our counterparty. - counterparty, ok := k.GetCounterparty(ctx, packet.SourceId) + counterparty, ok := k.GetCounterparty(ctx, packet.SourceChannel) if !ok { // TODO: figure out how aliasing will work when more than one packet data is sent. - counterparty, ok = k.getV1Counterparty(ctx, packet.Data[0].SourcePort, packet.SourceId) + counterparty, ok = k.getV1Counterparty(ctx, packet.Data[0].SourcePort, packet.SourceChannel) if !ok { - return errorsmod.Wrap(types.ErrCounterpartyNotFound, packet.DestinationId) + return errorsmod.Wrap(types.ErrCounterpartyNotFound, packet.DestinationChannel) } } // check that timeout height or timeout timestamp has passed on the other end - proofTimestamp, err := k.ClientKeeper.GetClientTimestampAtHeight(ctx, packet.SourceId, proofHeight) + proofTimestamp, err := k.ClientKeeper.GetClientTimestampAtHeight(ctx, packet.SourceChannel, proofHeight) if err != nil { return err } @@ -209,7 +209,7 @@ func (k Keeper) timeoutPacket( } // check that the commitment has not been cleared and that it matches the packet sent by relayer - commitment, ok := k.GetPacketCommitment(ctx, packet.SourceId, packet.Sequence) + commitment, ok := k.GetPacketCommitment(ctx, packet.SourceChannel, packet.Sequence) if !ok { EmitTimeoutPacketEvents(ctx, packet) @@ -227,24 +227,24 @@ func (k Keeper) timeoutPacket( } // verify packet receipt absence - path := hostv2.PacketReceiptKey(packet.SourceId, packet.Sequence) + path := hostv2.PacketReceiptKey(packet.SourceChannel, packet.Sequence) merklePath := types.BuildMerklePath(counterparty.MerklePathPrefix, path) if err := k.ClientKeeper.VerifyNonMembership( ctx, - packet.SourceId, + packet.SourceChannel, proofHeight, 0, 0, proof, merklePath, ); err != nil { - return errorsmod.Wrapf(err, "failed packet receipt absence verification for client (%s)", packet.SourceId) + return errorsmod.Wrapf(err, "failed packet receipt absence verification for client (%s)", packet.SourceChannel) } // delete packet commitment to prevent replay - k.DeletePacketCommitment(ctx, packet.SourceId, packet.Sequence) + k.DeletePacketCommitment(ctx, packet.SourceChannel, packet.Sequence) - k.Logger(ctx).Info("packet timed out", "sequence", strconv.FormatUint(packet.Sequence, 10), "src_id", packet.SourceId, "dst_id", packet.DestinationId) + k.Logger(ctx).Info("packet timed out", "sequence", strconv.FormatUint(packet.Sequence, 10), "src_channel_id", packet.SourceChannel, "dst_channel_id", packet.DestinationChannel) EmitTimeoutPacketEvents(ctx, packet) diff --git a/modules/core/04-channel/v2/types/channel.pb.go b/modules/core/04-channel/v2/types/channel.pb.go index 6ba9798bb01..2a9829af5d5 100644 --- a/modules/core/04-channel/v2/types/channel.pb.go +++ b/modules/core/04-channel/v2/types/channel.pb.go @@ -66,9 +66,9 @@ type Packet struct { // with a later sequence number. Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` // identifies the sending chain. - SourceId string `protobuf:"bytes,2,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + SourceChannel string `protobuf:"bytes,2,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` // identifies the receiving chain. - DestinationId string `protobuf:"bytes,3,opt,name=destination_id,json=destinationId,proto3" json:"destination_id,omitempty"` + DestinationChannel string `protobuf:"bytes,3,opt,name=destination_channel,json=destinationChannel,proto3" json:"destination_channel,omitempty"` // timeout timestamp after which the packet times out. TimeoutTimestamp uint64 `protobuf:"varint,4,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` // a list of packet data, each one for a specific application. @@ -115,16 +115,16 @@ func (m *Packet) GetSequence() uint64 { return 0 } -func (m *Packet) GetSourceId() string { +func (m *Packet) GetSourceChannel() string { if m != nil { - return m.SourceId + return m.SourceChannel } return "" } -func (m *Packet) GetDestinationId() string { +func (m *Packet) GetDestinationChannel() string { if m != nil { - return m.DestinationId + return m.DestinationChannel } return "" } @@ -438,48 +438,48 @@ func init() { proto.RegisterFile("ibc/core/channel/v2/channel.proto", fileDescri var fileDescriptor_7e9b57d8f218397d = []byte{ // 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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0xa0, 0x72, 0xf3, 0x15, 0x3d, 0x2a, 0x2a, 0x1f, 0x61, 0xad, 0x41, 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, 0x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0xe6, 0xe6, 0xae, 0x94, 0xf9, 0x7e, 0x57, 0xca, 0x7c, 0xd8, 0x1f, 0xd8, 0xe2, 0x34, 0xec, 0x55, + 0x09, 0x73, 0x75, 0xc2, 0xb8, 0xcb, 0xb8, 0x6e, 0xf7, 0xc8, 0xee, 0x80, 0xe9, 0xd1, 0x9e, 0xee, + 0xb2, 0x7e, 0xe8, 0x50, 0x1e, 0xbf, 0x49, 0x2f, 0x5f, 0xef, 0x8e, 0x3c, 0x4b, 0xe2, 0xc2, 0xa7, + 0xbc, 0x37, 0x2f, 0x9f, 0x9a, 0x57, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf7, 0xcc, 0x0a, 0xf3, + 0xba, 0x04, 0x00, 0x00, } func (m *Packet) Marshal() (dAtA []byte, err error) { @@ -521,17 +521,17 @@ func (m *Packet) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x20 } - if len(m.DestinationId) > 0 { - i -= len(m.DestinationId) - copy(dAtA[i:], m.DestinationId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.DestinationId))) + if len(m.DestinationChannel) > 0 { + i -= len(m.DestinationChannel) + copy(dAtA[i:], m.DestinationChannel) + i = encodeVarintChannel(dAtA, i, uint64(len(m.DestinationChannel))) i-- dAtA[i] = 0x1a } - if len(m.SourceId) > 0 { - i -= len(m.SourceId) - copy(dAtA[i:], m.SourceId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.SourceId))) + if len(m.SourceChannel) > 0 { + i -= len(m.SourceChannel) + copy(dAtA[i:], m.SourceChannel) + i = encodeVarintChannel(dAtA, i, uint64(len(m.SourceChannel))) i-- dAtA[i] = 0x12 } @@ -766,11 +766,11 @@ func (m *Packet) Size() (n int) { if m.Sequence != 0 { n += 1 + sovChannel(uint64(m.Sequence)) } - l = len(m.SourceId) + l = len(m.SourceChannel) if l > 0 { n += 1 + l + sovChannel(uint64(l)) } - l = len(m.DestinationId) + l = len(m.DestinationChannel) if l > 0 { n += 1 + l + sovChannel(uint64(l)) } @@ -928,7 +928,7 @@ func (m *Packet) Unmarshal(dAtA []byte) error { } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -956,11 +956,11 @@ func (m *Packet) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SourceId = string(dAtA[iNdEx:postIndex]) + m.SourceChannel = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DestinationId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DestinationChannel", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -988,7 +988,7 @@ func (m *Packet) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DestinationId = string(dAtA[iNdEx:postIndex]) + m.DestinationChannel = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { diff --git a/modules/core/04-channel/v2/types/packet.go b/modules/core/04-channel/v2/types/packet.go index 85924dca020..6cf39b0372f 100644 --- a/modules/core/04-channel/v2/types/packet.go +++ b/modules/core/04-channel/v2/types/packet.go @@ -12,13 +12,13 @@ import ( ) // NewPacket constructs a new packet. -func NewPacket(sequence uint64, sourceID, destinationID string, timeoutTimestamp uint64, data ...PacketData) Packet { +func NewPacket(sequence uint64, sourceChannel, destinationChannel string, timeoutTimestamp uint64, data ...PacketData) Packet { return Packet{ - Sequence: sequence, - SourceId: sourceID, - DestinationId: destinationID, - TimeoutTimestamp: timeoutTimestamp, - Data: data, + Sequence: sequence, + SourceChannel: sourceChannel, + DestinationChannel: destinationChannel, + TimeoutTimestamp: timeoutTimestamp, + Data: data, } } @@ -43,10 +43,10 @@ func (p Packet) ValidateBasic() error { } } - if err := host.ChannelIdentifierValidator(p.SourceId); err != nil { + if err := host.ChannelIdentifierValidator(p.SourceChannel); err != nil { return errorsmod.Wrap(err, "invalid source channel ID") } - if err := host.ChannelIdentifierValidator(p.DestinationId); err != nil { + if err := host.ChannelIdentifierValidator(p.DestinationChannel); err != nil { return errorsmod.Wrap(err, "invalid destination channel ID") } @@ -89,14 +89,14 @@ func (p Payload) Validate() error { } // CommitPacket returns the V2 packet commitment bytes. The commitment consists of: -// sha256_hash(timeout) + sha256_hash(destinationID) + sha256_hash(packetData) from a given packet. +// sha256_hash(timeout) + sha256_hash(destinationChannel) + sha256_hash(packetData) from a given packet. // This results in a fixed length preimage. // NOTE: A fixed length preimage is ESSENTIAL to prevent relayers from being able // to malleate the packet fields and create a commitment hash that matches the original packet. func CommitPacket(packet Packet) []byte { buf := sdk.Uint64ToBigEndian(packet.GetTimeoutTimestamp()) - destIDHash := sha256.Sum256([]byte(packet.DestinationId)) + destIDHash := sha256.Sum256([]byte(packet.DestinationChannel)) buf = append(buf, destIDHash[:]...) for _, data := range packet.Data { diff --git a/modules/core/04-channel/v2/types/packet_test.go b/modules/core/04-channel/v2/types/packet_test.go index 691e3f8e408..aad8539edc1 100644 --- a/modules/core/04-channel/v2/types/packet_test.go +++ b/modules/core/04-channel/v2/types/packet_test.go @@ -89,14 +89,14 @@ func TestValidateBasic(t *testing.T) { { "failure: invalid source channel ID", func() { - packet.SourceId = "" + packet.SourceChannel = "" }, host.ErrInvalidID, }, { "failure: invalid dest channel ID", func() { - packet.DestinationId = "" + packet.DestinationChannel = "" }, host.ErrInvalidID, }, diff --git a/modules/core/04-channel/v2/types/tx.pb.go b/modules/core/04-channel/v2/types/tx.pb.go index b06a92f0e96..e85b1319cf9 100644 --- a/modules/core/04-channel/v2/types/tx.pb.go +++ b/modules/core/04-channel/v2/types/tx.pb.go @@ -33,7 +33,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgSendPacket sends an outgoing IBC packet. type MsgSendPacket struct { - SourceId string `protobuf:"bytes,1,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"` + SourceChannel string `protobuf:"bytes,1,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` TimeoutTimestamp uint64 `protobuf:"varint,2,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` PacketData []PacketData `protobuf:"bytes,3,rep,name=packet_data,json=packetData,proto3" json:"packet_data"` Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` @@ -363,53 +363,53 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/tx.proto", fileDescriptor_d421c7119e969b99) } var fileDescriptor_d421c7119e969b99 = []byte{ - // 723 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, 0xc4, 0x01, - 0xf1, 0x08, 0x3c, 0x42, 0x0f, 0x3c, 0x44, 0xc5, 0xa9, 0x47, 0x4e, 0x08, 0x35, 0x87, 0xbe, 0x06, - 0xf2, 0xee, 0xc6, 0xf9, 0xa8, 0xd3, 0x56, 0x6a, 0x4e, 0xb6, 0x67, 0xfe, 0xfb, 0x9f, 0xd9, 0xdf, - 0xae, 0x77, 0xe1, 0xb6, 0xdd, 0x40, 0x1a, 0x22, 0x3e, 0xd6, 0x50, 0xd3, 0x70, 0x5d, 0xdc, 0xd2, - 0xc2, 0xaa, 0x16, 0xec, 0xaa, 0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, 0x7f, 0x3a, 0xc5, 0xd4, 0xdb, 0x27, 0x96, 0x1d, 0x34, - 0xdb, 0x0d, 0x15, 0x11, 0x47, 0x13, 0x97, 0xb0, 0xdd, 0x40, 0xcb, 0x16, 0xd1, 0xc2, 0x15, 0xcd, - 0x21, 0x66, 0xbb, 0x85, 0x29, 0xbf, 0x3f, 0x1f, 0x3e, 0x5e, 0xee, 0xbf, 0xe5, 0xf7, 0x3c, 0x4c, - 0x1b, 0x59, 0x76, 0x87, 0x3e, 0xfa, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xf6, 0x75, 0x3c, 0x36, 0x09, - 0x08, 0x00, 0x00, + // 727 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x6e, 0xd3, 0x4a, + 0x14, 0xc6, 0xe3, 0x26, 0xcd, 0xbd, 0xf7, 0xa4, 0x6d, 0x7a, 0x7d, 0x2f, 0x10, 0x19, 0x94, 0x94, + 0x08, 0xd4, 0x52, 0xa8, 0x4d, 0x02, 0x9b, 0x56, 0x48, 0xa8, 0x2d, 0x42, 0x6c, 0x2a, 0x21, 0x37, + 0xb0, 0x80, 0x8a, 0xc8, 0x99, 0x0c, 0x8e, 0xd5, 0xd8, 0x63, 0x3c, 0x13, 0xd3, 0xee, 0x10, 0x2b, + 0xc4, 0x02, 0xf1, 0x08, 0x3c, 0x42, 0x17, 0x3c, 0x44, 0x97, 0x5d, 0xb0, 0x60, 0x85, 0x50, 0xb3, + 0xe8, 0x6b, 0x20, 0xcf, 0x4c, 0x9c, 0x3f, 0x75, 0xda, 0x4a, 0xcd, 0xca, 0xf6, 0x39, 0xdf, 0x7c, + 0xe7, 0xcc, 0x6f, 0xc6, 0x33, 0x70, 0xc3, 0x69, 0x20, 0x03, 0x91, 0x00, 0x1b, 0xa8, 0x65, 0x79, + 0x1e, 0x6e, 0x1b, 0x61, 0xd5, 0x60, 0x7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xd4, 0xcf, 0x6e, 0x31, 0xf5, 0xea, + 0x91, 0xed, 0xb0, 0x56, 0xa7, 0xa1, 0x23, 0xe2, 0x1a, 0xf2, 0x3a, 0x76, 0x1a, 0x68, 0xc5, 0x26, + 0x46, 0xb8, 0x6a, 0xb8, 0xa4, 0xd9, 0x69, 0x63, 0x2a, 0x6e, 0xd2, 0xfb, 0x0f, 0x57, 0x06, 0xef, + 0xfb, 0x7d, 0x1f, 0xd3, 0x46, 0x96, 0xdf, 0xa6, 0x0f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb1, + 0x1c, 0xb4, 0xdc, 0x13, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -654,10 +654,10 @@ func (m *MsgSendPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if len(m.SourceId) > 0 { - i -= len(m.SourceId) - copy(dAtA[i:], m.SourceId) - i = encodeVarintTx(dAtA, i, uint64(len(m.SourceId))) + if len(m.SourceChannel) > 0 { + i -= len(m.SourceChannel) + copy(dAtA[i:], m.SourceChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceChannel))) i-- dAtA[i] = 0xa } @@ -979,7 +979,7 @@ func (m *MsgSendPacket) Size() (n int) { } var l int _ = l - l = len(m.SourceId) + l = len(m.SourceChannel) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1152,7 +1152,7 @@ func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1180,7 +1180,7 @@ func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SourceId = string(dAtA[iNdEx:postIndex]) + m.SourceChannel = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { diff --git a/proto/ibc/core/channel/v2/channel.proto b/proto/ibc/core/channel/v2/channel.proto index 4bbe3df2342..20d002d2e6e 100644 --- a/proto/ibc/core/channel/v2/channel.proto +++ b/proto/ibc/core/channel/v2/channel.proto @@ -14,9 +14,9 @@ message Packet { // with a later sequence number. uint64 sequence = 1; // identifies the sending chain. - string source_id = 2; + string source_channel = 2; // identifies the receiving chain. - string destination_id = 3; + string destination_channel = 3; // timeout timestamp after which the packet times out. uint64 timeout_timestamp = 4; // a list of packet data, each one for a specific application. diff --git a/proto/ibc/core/channel/v2/tx.proto b/proto/ibc/core/channel/v2/tx.proto index 1fef3095a23..95b19c91cf5 100644 --- a/proto/ibc/core/channel/v2/tx.proto +++ b/proto/ibc/core/channel/v2/tx.proto @@ -32,7 +32,7 @@ message MsgSendPacket { option (cosmos.msg.v1.signer) = "signer"; option (gogoproto.goproto_getters) = false; - string source_id = 1; + string source_channel = 1; uint64 timeout_timestamp = 2; repeated PacketData packet_data = 3 [(gogoproto.nullable) = false]; string signer = 4;