diff --git a/modules/core/04-channel/types/channel.pb.go b/modules/core/04-channel/types/channel.pb.go index 636f44c2bf1..2263ee69c4e 100644 --- a/modules/core/04-channel/types/channel.pb.go +++ b/modules/core/04-channel/types/channel.pb.go @@ -108,41 +108,6 @@ func (Order) EnumDescriptor() ([]byte, []int) { return fileDescriptor_c3a07336710636a0, []int{1} } -// IBCVersion defines the version that the IBC packet intends to use. -// This allows asynchronous upgrades over time as unsupported IBC Versions -// will simply be rejected by the receiver and timed out on sender. -type IBCVersion int32 - -const ( - // zero-value for IBC version. - // This will be treated as a classic packet - IBC_VERSION_UNSPECIFIED IBCVersion = 0 - // IBC version 1 implements the Classic protocol - IBC_VERSION_1 IBCVersion = 1 - // IBC version 2 implements the Eureka protocol - IBC_VERSION_2 IBCVersion = 2 -) - -var IBCVersion_name = map[int32]string{ - 0: "IBC_VERSION_UNSPECIFIED", - 1: "IBC_VERSION_1", - 2: "IBC_VERSION_2", -} - -var IBCVersion_value = map[string]int32{ - "IBC_VERSION_UNSPECIFIED": 0, - "IBC_VERSION_1": 1, - "IBC_VERSION_2": 2, -} - -func (x IBCVersion) String() string { - return proto.EnumName(IBCVersion_name, int32(x)) -} - -func (IBCVersion) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{2} -} - // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. @@ -313,12 +278,6 @@ type Packet struct { TimeoutHeight types.Height `protobuf:"bytes,7,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height"` // block timestamp (in nanoseconds) after which the packet times out TimeoutTimestamp uint64 `protobuf:"varint,8,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` - // which IBC version to use to commit this packet - ProtocolVersion IBCVersion `protobuf:"varint,9,opt,name=protocol_version,json=protocolVersion,proto3,enum=ibc.core.channel.v1.IBCVersion" json:"protocol_version,omitempty"` - // version which application should use to process the packet data - AppVersion string `protobuf:"bytes,10,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"` - // encoding to be used TODO clearer message - Encoding string `protobuf:"bytes,11,opt,name=encoding,proto3" json:"encoding,omitempty"` } func (m *Packet) Reset() { *m = Packet{} } @@ -647,7 +606,6 @@ func (m *Params) GetUpgradeTimeout() Timeout { func init() { proto.RegisterEnum("ibc.core.channel.v1.State", State_name, State_value) proto.RegisterEnum("ibc.core.channel.v1.Order", Order_name, Order_value) - proto.RegisterEnum("ibc.core.channel.v1.IBCVersion", IBCVersion_name, IBCVersion_value) proto.RegisterType((*Channel)(nil), "ibc.core.channel.v1.Channel") proto.RegisterType((*IdentifiedChannel)(nil), "ibc.core.channel.v1.IdentifiedChannel") proto.RegisterType((*Counterparty)(nil), "ibc.core.channel.v1.Counterparty") @@ -662,71 +620,66 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/channel.proto", fileDescriptor_c3a07336710636a0) } var fileDescriptor_c3a07336710636a0 = []byte{ - // 1024 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x4d, 0x6f, 0xe3, 0x44, - 0x18, 0x8e, 0x53, 0xe7, 0xeb, 0x4d, 0x93, 0xb8, 0x53, 0xe8, 0x5a, 0xa6, 0x24, 0xde, 0x0a, 0x44, - 0xb7, 0x68, 0x93, 0x6d, 0x41, 0x88, 0xe5, 0xd6, 0xa6, 0xde, 0xad, 0xd9, 0x92, 0x54, 0x4e, 0xb2, - 0x12, 0x7b, 0xb1, 0x5c, 0x7b, 0x48, 0xad, 0x4d, 0x3c, 0xc6, 0x9e, 0x74, 0xb5, 0xe2, 0x8c, 0xb4, - 0xca, 0x89, 0x3f, 0x10, 0x09, 0x89, 0xbf, 0xc0, 0x8f, 0xd8, 0xe3, 0x1e, 0x39, 0x21, 0x68, 0xff, - 0x03, 0x67, 0xe4, 0x99, 0x71, 0x3e, 0xaa, 0xa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x24, - 0x50, 0x73, 0xba, 0xb4, 0x5b, 0xb2, 0x52, 0x13, 0x3d, 0x00, 0x65, 0x12, 0x0e, 0x23, 0xc7, 0xc3, - 0x76, 0x8c, 0xbf, 0x9f, 0xe0, 0xc0, 0xc5, 0x6a, 0x5e, 0x97, 0x76, 0x65, 0xab, 0x26, 0xf0, 0x9e, - 0x80, 0xbf, 0x92, 0xdf, 0xfc, 0xdc, 0xc8, 0xec, 0xfc, 0x95, 0x85, 0x0d, 0xd3, 0xc3, 0x01, 0xf5, - 0xbf, 0xf3, 0xb1, 0xf7, 0xff, 0x00, 0xef, 0x41, 0x21, 0x24, 0x11, 0xb5, 0x7d, 0x8f, 0xcd, 0xad, - 0x64, 0xe5, 0x13, 0xd3, 0xf4, 0xd0, 0x87, 0x00, 0xa2, 0x95, 0xc4, 0x57, 0x60, 0xbe, 0x92, 0x40, - 0x4c, 0xef, 0xd6, 0xc1, 0x17, 0xef, 0x1a, 0xfc, 0x29, 0xac, 0x2f, 0xef, 0x67, 0xb9, 0xb0, 0x74, - 0x47, 0xe1, 0xec, 0x8d, 0xc2, 0x22, 0xdb, 0x9f, 0x6b, 0x90, 0x3f, 0x73, 0xdc, 0x97, 0x98, 0x22, - 0x0d, 0x8a, 0xf3, 0x0e, 0x24, 0xd6, 0xc1, 0xdc, 0x46, 0x0d, 0x28, 0xc7, 0x64, 0x12, 0xb9, 0xd8, - 0x4e, 0x92, 0x8b, 0x64, 0xc0, 0xa1, 0x33, 0x12, 0x51, 0xf4, 0x31, 0x54, 0x05, 0x41, 0x54, 0x60, - 0x07, 0x52, 0xb2, 0x2a, 0x1c, 0x4d, 0xf5, 0xf1, 0x00, 0x14, 0x0f, 0xc7, 0xd4, 0x0f, 0x1c, 0x36, - 0x69, 0x96, 0x4c, 0x66, 0xc4, 0xda, 0x12, 0xce, 0x32, 0xb6, 0x60, 0x73, 0x99, 0x9a, 0xa6, 0xe5, - 0x63, 0x47, 0x4b, 0xae, 0x34, 0x37, 0x02, 0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0x4d, 0x45, 0x5f, 0x87, 0x38, 0x3e, 0xcf, 0xb3, 0xe7, - 0xe6, 0xb3, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x19, 0x54, 0x78, 0x4b, 0x74, 0x09, 0x00, 0x00, + // 937 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x4f, 0x6f, 0xe2, 0xc6, + 0x1b, 0xc6, 0xc4, 0xfc, 0x7b, 0x93, 0x80, 0x33, 0xf9, 0xfd, 0x52, 0xcb, 0x4a, 0xc1, 0x8b, 0x5a, + 0x95, 0x4d, 0xb5, 0xb0, 0xd9, 0x56, 0x55, 0xb7, 0xb7, 0x04, 0xbc, 0x8b, 0xb5, 0x14, 0x90, 0x81, + 0x43, 0xf7, 0x82, 0x8c, 0x3d, 0x05, 0x6b, 0xc1, 0x43, 0xed, 0x81, 0xd5, 0xaa, 0xe7, 0x4a, 0x2b, + 0x4e, 0xfd, 0x02, 0x48, 0x95, 0xfa, 0x15, 0xfa, 0x21, 0xf6, 0xb8, 0xc7, 0x3d, 0x55, 0x55, 0xf2, + 0x1d, 0x7a, 0xae, 0x3c, 0x33, 0x0e, 0x10, 0x45, 0x51, 0x55, 0xa9, 0xb7, 0x9e, 0x98, 0xf7, 0x79, + 0x9f, 0xf7, 0x7d, 0xde, 0x3f, 0xc3, 0xc8, 0xf0, 0xc0, 0x1b, 0x39, 0x35, 0x87, 0x04, 0xb8, 0xe6, + 0x4c, 0x6c, 0xdf, 0xc7, 0xd3, 0xda, 0xf2, 0x3c, 0x3e, 0x56, 0xe7, 0x01, 0xa1, 0x04, 0x1d, 0x7b, + 0x23, 0xa7, 0x1a, 0x51, 0xaa, 0x31, 0xbe, 0x3c, 0xd7, 0xfe, 0x37, 0x26, 0x63, 0xc2, 0xfc, 0xb5, + 0xe8, 0xc4, 0xa9, 0x5a, 0x69, 0x93, 0x6d, 0xea, 0x61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0x65, 0x73, + 0xcb, 0x59, 0xe9, 0xc8, 0x34, 0x5d, 0xf4, 0x31, 0x80, 0x28, 0x25, 0xf2, 0x65, 0x98, 0x2f, 0x27, + 0x10, 0xd3, 0xbd, 0x73, 0xf0, 0xd9, 0xfb, 0x06, 0xdf, 0x82, 0x83, 0xed, 0x7e, 0xb6, 0x85, 0xa5, + 0x7b, 0x84, 0x93, 0xb7, 0x84, 0x45, 0xb6, 0x0f, 0x49, 0x48, 0x77, 0x6d, 0xe7, 0x15, 0xa6, 0x48, + 0x83, 0xec, 0x4d, 0x05, 0x12, 0xab, 0xe0, 0xc6, 0x46, 0x25, 0xd8, 0x0f, 0xc9, 0x22, 0x70, 0xf0, + 0x30, 0x4a, 0x2e, 0x92, 0x01, 0x87, 0xba, 0x24, 0xa0, 0xe8, 0x53, 0xc8, 0x0b, 0x82, 0x50, 0x60, + 0x0b, 0xc9, 0x59, 0x87, 0x1c, 0x8d, 0xef, 0xc7, 0x43, 0x50, 0x5c, 0x1c, 0x52, 0xcf, 0xb7, 0xd9, + 0xa4, 0x59, 0x32, 0x99, 0x11, 0x0b, 0x5b, 0x38, 0xcb, 0x58, 0x83, 0xe3, 0x6d, 0x6a, 0x9c, 0x96, + 0x8f, 0x1d, 0x6d, 0xb9, 0xe2, 0xdc, 0x08, 0x64, 0xd7, 0xa6, 0x36, 0x1b, 0xff, 0x81, 0xc5, 0xce, + 0xe8, 0x39, 0xe4, 0xa9, 0x37, 0xc3, 0x64, 0x41, 0x87, 0x13, 0xec, 0x8d, 0x27, 0x94, 0x2d, 0x60, + 0x7f, 0xe7, 0x8e, 0xf1, 0xc7, 0x60, 0x79, 0x5e, 0x6d, 0x32, 0x86, 0xb8, 0x20, 0x87, 0x22, 0x8e, + 0x83, 0xe8, 0x73, 0x38, 0x8a, 0x13, 0x45, 0xbf, 0x21, 0xb5, 0x67, 0x73, 0xb1, 0x27, 0x45, 0x38, + 0xfa, 0x31, 0x2e, 0x46, 0xfb, 0x23, 0xec, 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, + 0x46, 0x55, 0x87, 0xcc, 0x6a, 0x0e, 0x09, 0x67, 0x24, 0xac, 0x79, 0x23, 0xe7, 0xd1, 0x98, 0xd4, + 0x96, 0x4f, 0x6b, 0x33, 0xe2, 0x2e, 0xa6, 0x38, 0xe4, 0x9f, 0x08, 0x8f, 0xbf, 0x7c, 0x14, 0x7f, + 0x73, 0xd0, 0x37, 0x73, 0x1c, 0x8e, 0xd2, 0xec, 0x1b, 0xe1, 0x8b, 0xbf, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x39, 0xda, 0x3d, 0x84, 0x94, 0x08, 0x00, 0x00, } func (m *Channel) Marshal() (dAtA []byte, err error) { @@ -928,25 +881,6 @@ func (m *Packet) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Encoding) > 0 { - i -= len(m.Encoding) - copy(dAtA[i:], m.Encoding) - i = encodeVarintChannel(dAtA, i, uint64(len(m.Encoding))) - i-- - dAtA[i] = 0x5a - } - if len(m.AppVersion) > 0 { - i -= len(m.AppVersion) - copy(dAtA[i:], m.AppVersion) - i = encodeVarintChannel(dAtA, i, uint64(len(m.AppVersion))) - i-- - dAtA[i] = 0x52 - } - if m.ProtocolVersion != 0 { - i = encodeVarintChannel(dAtA, i, uint64(m.ProtocolVersion)) - i-- - dAtA[i] = 0x48 - } if m.TimeoutTimestamp != 0 { i = encodeVarintChannel(dAtA, i, uint64(m.TimeoutTimestamp)) i-- @@ -1363,17 +1297,6 @@ func (m *Packet) Size() (n int) { if m.TimeoutTimestamp != 0 { n += 1 + sovChannel(uint64(m.TimeoutTimestamp)) } - if m.ProtocolVersion != 0 { - n += 1 + sovChannel(uint64(m.ProtocolVersion)) - } - l = len(m.AppVersion) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.Encoding) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } return n } @@ -2334,89 +2257,6 @@ func (m *Packet) Unmarshal(dAtA []byte) error { break } } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProtocolVersion", wireType) - } - m.ProtocolVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProtocolVersion |= IBCVersion(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppVersion = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Encoding = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipChannel(dAtA[iNdEx:]) diff --git a/modules/core/04-channel/types/msgs_test.go b/modules/core/04-channel/types/msgs_test.go index 173131d73df..e660cf39bd4 100644 --- a/modules/core/04-channel/types/msgs_test.go +++ b/modules/core/04-channel/types/msgs_test.go @@ -64,7 +64,6 @@ var ( disabledTimeout = clienttypes.ZeroHeight() validPacketData = []byte("testdata") unknownPacketData = []byte("unknown") - validVersion = "ics-20" packet = types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) invalidPacket = types.NewPacket(unknownPacketData, 0, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) diff --git a/modules/core/04-channel/types/packet.go b/modules/core/04-channel/types/packet.go index 71ff5bd62e9..b585f093e50 100644 --- a/modules/core/04-channel/types/packet.go +++ b/modules/core/04-channel/types/packet.go @@ -2,8 +2,6 @@ package types import ( "crypto/sha256" - "slices" - "strings" errorsmod "cosmossdk.io/errors" @@ -14,32 +12,13 @@ import ( "github.com/cosmos/ibc-go/v9/modules/core/exported" ) -// CommitPacket returns the packet commitment bytes based on -// the ProtocolVersion specified in the Packet. The commitment -// must commit to all fields in the packet apart from the source port -// source channel and sequence (which will be committed to in the packet commitment key path) -// and the ProtocolVersion which is defining how to hash the packet fields. -// NOTE: The commitment MUST be a fixed length preimage 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 { - switch packet.ProtocolVersion { - case IBC_VERSION_UNSPECIFIED, IBC_VERSION_1: - return commitV1Packet(packet) - case IBC_VERSION_2: - // TODO: convert to PacketV2 and commit. - return commitV2Packet(packet) - default: - panic("unsupported version") - } -} - -// commitV1Packet returns the V1 packet commitment bytes. The commitment consists of: +// CommitPacket returns the packet commitment bytes. The commitment consists of: // sha256_hash(timeout_timestamp + timeout_height.RevisionNumber + timeout_height.RevisionHeight + sha256_hash(data)) // 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. // NOTE: sdk.Uint64ToBigEndian sets the uint64 to a slice of length 8. -func commitV1Packet(packet Packet) []byte { +func CommitPacket(packet Packet) []byte { timeoutHeight := packet.GetTimeoutHeight() buf := sdk.Uint64ToBigEndian(packet.GetTimeoutTimestamp()) @@ -57,50 +36,6 @@ func commitV1Packet(packet Packet) []byte { return hash[:] } -// commitV2Packet returns the V2 packet commitment bytes. The commitment consists of: -// sha256_hash(timeout_timestamp + timeout_height.RevisionNumber + timeout_height.RevisionHeight) -// + sha256_hash(destPort) + sha256_hash(destChannel) + sha256_hash(version) + sha256_hash(data)) -// 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. -// NOTE: sdk.Uint64ToBigEndian sets the uint64 to a slice of length 8. -func commitV2Packet(packet Packet) []byte { - timeoutHeight := packet.GetTimeoutHeight() - - timeoutBuf := sdk.Uint64ToBigEndian(packet.GetTimeoutTimestamp()) - - // only hash the timeout height if it is non-zero. This will allow us to remove it entirely in the future - if !timeoutHeight.EQ(clienttypes.ZeroHeight()) { - revisionNumber := sdk.Uint64ToBigEndian(timeoutHeight.GetRevisionNumber()) - timeoutBuf = append(timeoutBuf, revisionNumber...) - - revisionHeight := sdk.Uint64ToBigEndian(timeoutHeight.GetRevisionHeight()) - timeoutBuf = append(timeoutBuf, revisionHeight...) - } - - // hash the timeout rather than using a fixed-size preimage directly - // this will allow more flexibility in the future with how timeouts are defined - timeoutHash := sha256.Sum256(timeoutBuf) - buf := timeoutHash[:] - - // hash the destination identifiers since we can no longer retrieve them from the channelEnd - portHash := sha256.Sum256([]byte(packet.GetDestPort())) - buf = append(buf, portHash[:]...) - destinationHash := sha256.Sum256([]byte(packet.GetDestChannel())) - buf = append(buf, destinationHash[:]...) - - // hash the app version. - versionHash := sha256.Sum256([]byte(packet.AppVersion)) - buf = append(buf, versionHash[:]...) - - // hash the data - dataHash := sha256.Sum256(packet.GetData()) - buf = append(buf, dataHash[:]...) - - hash := sha256.Sum256(buf) - return hash[:] -} - // CommitAcknowledgement returns the hash of commitment bytes func CommitAcknowledgement(data []byte) []byte { hash := sha256.Sum256(data) @@ -124,29 +59,6 @@ func NewPacket( DestinationChannel: destinationChannel, TimeoutHeight: timeoutHeight, TimeoutTimestamp: timeoutTimestamp, - ProtocolVersion: IBC_VERSION_1, - Encoding: "json", - } -} - -func NewPacketWithVersion( - data []byte, - sequence uint64, sourcePort, sourceChannel, - destinationPort, destinationChannel string, - timeoutHeight clienttypes.Height, timeoutTimestamp uint64, - appVersion string, -) Packet { - return Packet{ - Data: data, - Sequence: sequence, - SourcePort: sourcePort, - SourceChannel: sourceChannel, - DestinationPort: destinationPort, - DestinationChannel: destinationChannel, - TimeoutHeight: timeoutHeight, - TimeoutTimestamp: timeoutTimestamp, - ProtocolVersion: IBC_VERSION_2, - AppVersion: appVersion, } } @@ -197,12 +109,6 @@ func (p Packet) ValidateBasic() error { if len(p.Data) == 0 { return errorsmod.Wrap(ErrInvalidPacket, "packet data bytes cannot be empty") } - if p.AppVersion != "" && slices.Contains([]IBCVersion{IBC_VERSION_UNSPECIFIED, IBC_VERSION_1}, p.ProtocolVersion) { - return errorsmod.Wrapf(ErrInvalidPacket, "app version cannot be specified when packet does not use protocol %s", IBC_VERSION_2) - } - if strings.TrimSpace(p.AppVersion) == "" && p.ProtocolVersion == IBC_VERSION_2 { - return errorsmod.Wrapf(ErrInvalidPacket, "app version must be specified when packet uses protocol %s", IBC_VERSION_2) - } return nil } diff --git a/modules/core/04-channel/types/packet_test.go b/modules/core/04-channel/types/packet_test.go index a030f813375..296ebb6d8ed 100644 --- a/modules/core/04-channel/types/packet_test.go +++ b/modules/core/04-channel/types/packet_test.go @@ -5,41 +5,13 @@ import ( "github.com/stretchr/testify/require" - clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" ) func TestCommitPacket(t *testing.T) { - // V1 packet1 commitment - packet1 := types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) - commitment1 := types.CommitPacket(packet1) - require.NotNil(t, commitment1) - - // V2 packet commitment with empty app version - packet2 := types.NewPacketWithVersion(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp, "") - commitment2 := types.CommitPacket(packet2) - require.NotNil(t, commitment2) - - // even though app version is empty for both packet1 and packet2 - // the commitment is different because we use Eureka protocol for packet2 - require.NotEqual(t, commitment1, commitment2) - - // V2 packet commitment with non-empty app version - packet3 := types.NewPacketWithVersion(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp, validVersion) - commitment3 := types.CommitPacket(packet3) - require.NotNil(t, commitment3) - - require.NotEqual(t, commitment1, commitment3) - require.NotEqual(t, commitment2, commitment3) - - // V2 packet commitment with non-empty app version and zero timeout height - packet4 := types.NewPacketWithVersion(validPacketData, 1, portid, chanid, cpportid, cpchanid, clienttypes.ZeroHeight(), timeoutTimestamp, validVersion) - commitment4 := types.CommitPacket(packet4) - require.NotNil(t, commitment4) - - require.NotEqual(t, commitment1, commitment4) - require.NotEqual(t, commitment2, commitment4) - require.NotEqual(t, commitment3, commitment4) + packet := types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) + commitment := types.CommitPacket(packet) + require.NotNil(t, commitment) } func TestPacketValidateBasic(t *testing.T) { @@ -58,11 +30,6 @@ func TestPacketValidateBasic(t *testing.T) { {types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, disabledTimeout, 0), false, "disabled both timeout height and timestamp"}, {types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, disabledTimeout, timeoutTimestamp), true, "disabled timeout height, valid timeout timestamp"}, {types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, 0), true, "disabled timeout timestamp, valid timeout height"}, - {types.NewPacketWithVersion(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp, "version"), true, "valid v2 packet"}, - {types.Packet{1, portid, chanid, cpportid, cpchanid, validPacketData, timeoutHeight, timeoutTimestamp, types.IBC_VERSION_1, "version", "json"}, false, "invalid specifying of app version with protocol version 1"}, - {types.Packet{1, portid, chanid, cpportid, cpchanid, validPacketData, timeoutHeight, timeoutTimestamp, types.IBC_VERSION_UNSPECIFIED, "version", "json"}, false, "invalid specifying of app version with unspecified protocol version"}, - {types.NewPacketWithVersion(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp, ""), false, "app version must be specified when packet uses protocol version 2"}, - {types.NewPacketWithVersion(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp, " "), false, "app version must be specified when packet uses protocol version 2"}, } for i, tc := range testCases { diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto index 77b523c181f..78df62bdbb4 100644 --- a/proto/ibc/core/channel/v1/channel.proto +++ b/proto/ibc/core/channel/v1/channel.proto @@ -90,21 +90,6 @@ enum Order { ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"]; } -// IBCVersion defines the version that the IBC packet intends to use. -// This allows asynchronous upgrades over time as unsupported IBC Versions -// will simply be rejected by the receiver and timed out on sender. -enum IBCVersion { - option (gogoproto.goproto_enum_prefix) = false; - - // zero-value for IBC version. - // This will be treated as a classic packet - IBC_VERSION_UNSPECIFIED = 0; - // IBC version 1 implements the Classic protocol - IBC_VERSION_1 = 1; - // IBC version 2 implements the Eureka protocol - IBC_VERSION_2 = 2; -} - // Counterparty defines a channel end counterparty message Counterparty { option (gogoproto.goproto_getters) = false; @@ -137,12 +122,6 @@ message Packet { ibc.core.client.v1.Height timeout_height = 7 [(gogoproto.nullable) = false]; // block timestamp (in nanoseconds) after which the packet times out uint64 timeout_timestamp = 8; - // which IBC version to use to commit this packet - IBCVersion protocol_version = 9; - // version which application should use to process the packet data - string app_version = 10; - // encoding to be used TODO clearer message - string encoding = 11; } // PacketState defines the generic type necessary to retrieve and store