diff --git a/modules/core/04-channel/v2/types/channel.go b/modules/core/04-channel/v2/types/channel.go index 3a45be384fbf..f4ab5b2afe43 100644 --- a/modules/core/04-channel/v2/types/channel.go +++ b/modules/core/04-channel/v2/types/channel.go @@ -32,3 +32,20 @@ func (c Channel) Validate() error { return nil } + +// NewIdentifiedChannel creates a new IdentifiedChannel instance +func NewIdentifiedChannel(channelID string, channel Channel) IdentifiedChannel { + return IdentifiedChannel{ + Channel: channel, + ChannelId: channelID, + } +} + +// ValidateBasic performs a basic validation of the identifiers and channel fields. +func (ic IdentifiedChannel) ValidateBasic() error { + if err := host.ChannelIdentifierValidator(ic.ChannelId); err != nil { + return errorsmod.Wrap(err, "invalid channel ID") + } + + return ic.Channel.Validate() +} diff --git a/modules/core/04-channel/v2/types/genesis.go b/modules/core/04-channel/v2/types/genesis.go new file mode 100644 index 000000000000..3b567f97c879 --- /dev/null +++ b/modules/core/04-channel/v2/types/genesis.go @@ -0,0 +1,134 @@ +package types + +import ( + "errors" + "fmt" + + channeltypesv1 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" +) + +// NewPacketState creates a new PacketState instance. +func NewPacketState(channelID string, sequence uint64, data []byte) PacketState { + return PacketState{ + ChannelId: channelID, + Sequence: sequence, + Data: data, + } +} + +// Validate performs basic validation of fields returning an error upon any failure. +func (ps PacketState) Validate() error { + if ps.Data == nil { + return errors.New("data bytes cannot be nil") + } + return validateGenFields(ps.ChannelId, ps.Sequence) +} + +// NewPacketSequence creates a new PacketSequences instance. +func NewPacketSequence(channelID string, sequence uint64) PacketSequence { + return PacketSequence{ + ChannelId: channelID, + Sequence: sequence, + } +} + +// Validate performs basic validation of fields returning an error upon any failure. +func (ps PacketSequence) Validate() error { + return validateGenFields(ps.ChannelId, ps.Sequence) +} + +// NewGenesisState creates a GenesisState instance. +func NewGenesisState( + channels []IdentifiedChannel, acks, receipts, commitments []PacketState, + sendSeqs []PacketSequence, nextChannelSequence uint64, +) GenesisState { + return GenesisState{ + Channels: channels, + Acknowledgements: acks, + Receipts: receipts, + Commitments: commitments, + SendSequences: sendSeqs, + NextChannelSequence: nextChannelSequence, + } +} + +// DefaultGenesisState returns the ibc channel v2 submodule's default genesis state. +func DefaultGenesisState() GenesisState { + return GenesisState{ + Channels: []IdentifiedChannel{}, + Acknowledgements: []PacketState{}, + Receipts: []PacketState{}, + Commitments: []PacketState{}, + SendSequences: []PacketSequence{}, + NextChannelSequence: 0, + } +} + +// Validate performs basic genesis state validation returning an error upon any failure. +func (gs GenesisState) Validate() error { + // keep track of the max sequence to ensure it is less than + // the next sequence used in creating channel identifiers. + var maxSequence uint64 + + for i, channel := range gs.Channels { + sequence, err := channeltypesv1.ParseChannelSequence(channel.ChannelId) + if err != nil { + return err + } + + if sequence > maxSequence { + maxSequence = sequence + } + + if err := channel.ValidateBasic(); err != nil { + return fmt.Errorf("invalid channel %v channel index %d: %w", channel, i, err) + } + } + + if maxSequence != 0 && maxSequence >= gs.NextChannelSequence { + return fmt.Errorf("next channel sequence %d must be greater than maximum sequence used in channel identifier %d", gs.NextChannelSequence, maxSequence) + } + + for i, ack := range gs.Acknowledgements { + if err := ack.Validate(); err != nil { + return fmt.Errorf("invalid acknowledgement %v ack index %d: %w", ack, i, err) + } + if len(ack.Data) == 0 { + return fmt.Errorf("invalid acknowledgement %v ack index %d: data bytes cannot be empty", ack, i) + } + } + + for i, receipt := range gs.Receipts { + if err := receipt.Validate(); err != nil { + return fmt.Errorf("invalid acknowledgement %v ack index %d: %w", receipt, i, err) + } + } + + for i, commitment := range gs.Commitments { + if err := commitment.Validate(); err != nil { + return fmt.Errorf("invalid commitment %v index %d: %w", commitment, i, err) + } + if len(commitment.Data) == 0 { + return fmt.Errorf("invalid acknowledgement %v ack index %d: data bytes cannot be empty", commitment, i) + } + } + + for i, ss := range gs.SendSequences { + if err := ss.Validate(); err != nil { + return fmt.Errorf("invalid send sequence %v index %d: %w", ss, i, err) + } + } + + return nil +} + +func validateGenFields(channelID string, sequence uint64) error { + if err := host.ChannelIdentifierValidator(channelID); err != nil { + return fmt.Errorf("invalid channel Id: %w", err) + } + if sequence == 0 { + return errors.New("sequence cannot be 0") + } + return nil +} diff --git a/modules/core/04-channel/v2/types/genesis.pb.go b/modules/core/04-channel/v2/types/genesis.pb.go index 2528c89d61f8..ea9c321819fc 100644 --- a/modules/core/04-channel/v2/types/genesis.pb.go +++ b/modules/core/04-channel/v2/types/genesis.pb.go @@ -23,13 +23,15 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GenesisState defines the ibc channel submodule's genesis state. +// GenesisState defines the ibc channel/v2 submodule's genesis state. type GenesisState struct { Channels []IdentifiedChannel `protobuf:"bytes,1,rep,name=channels,proto3,casttype=IdentifiedChannel" json:"channels"` Acknowledgements []PacketState `protobuf:"bytes,2,rep,name=acknowledgements,proto3" json:"acknowledgements"` Commitments []PacketState `protobuf:"bytes,3,rep,name=commitments,proto3" json:"commitments"` Receipts []PacketState `protobuf:"bytes,4,rep,name=receipts,proto3" json:"receipts"` SendSequences []PacketSequence `protobuf:"bytes,5,rep,name=send_sequences,json=sendSequences,proto3" json:"send_sequences"` + // the sequence for the next generated channel identifier + NextChannelSequence uint64 `protobuf:"varint,6,opt,name=next_channel_sequence,json=nextChannelSequence,proto3" json:"next_channel_sequence,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -100,6 +102,13 @@ func (m *GenesisState) GetSendSequences() []PacketSequence { return nil } +func (m *GenesisState) GetNextChannelSequence() uint64 { + if m != nil { + return m.NextChannelSequence + } + return 0 +} + // PacketState defines the generic type necessary to retrieve and store // packet commitments, acknowledgements, and receipts. // Caller is responsible for knowing the context necessary to interpret this @@ -210,33 +219,35 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/genesis.proto", fileDescriptor_b5d374f126f051c3) } var fileDescriptor_b5d374f126f051c3 = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0xae, 0xd3, 0x30, - 0x14, 0xc6, 0xe3, 0x9b, 0x80, 0x7a, 0xdd, 0xcb, 0x15, 0x18, 0x86, 0x50, 0x89, 0x34, 0x14, 0x09, - 0x65, 0xb9, 0x31, 0x2a, 0x2c, 0x20, 0xa6, 0x30, 0x40, 0xc5, 0x52, 0x05, 0x89, 0x01, 0x09, 0x55, - 0x89, 0x7d, 0x48, 0xad, 0x36, 0x76, 0xa9, 0xdd, 0x22, 0xde, 0x80, 0x91, 0x47, 0x80, 0xb7, 0xe9, - 0xd8, 0x91, 0xa9, 0x42, 0xed, 0x5b, 0x30, 0xa1, 0xfc, 0x69, 0x55, 0xd4, 0x0a, 0xa9, 0xba, 0x9b, - 0x7d, 0xfc, 0x7d, 0xbf, 0x9f, 0x87, 0x83, 0x1f, 0x8a, 0x94, 0x51, 0xa6, 0xa6, 0x40, 0xd9, 0x30, - 0x91, 0x12, 0xc6, 0x74, 0xde, 0xa5, 0x19, 0x48, 0xd0, 0x42, 0x87, 0x93, 0xa9, 0x32, 0x8a, 0xdc, - 0x15, 0x29, 0x0b, 0x8b, 0x48, 0x58, 0x47, 0xc2, 0x79, 0xb7, 0x75, 0x2f, 0x53, 0x99, 0x2a, 0xdf, - 0x69, 0x71, 0xaa, 0xa2, 0xad, 0xa3, 0xb4, 0x6d, 0xab, 0x8c, 0x74, 0x7e, 0xda, 0xf8, 0xe2, 0x75, - 0xc5, 0x7f, 0x67, 0x12, 0x03, 0xe4, 0x23, 0x6e, 0xd4, 0x09, 0xed, 0x22, 0xdf, 0x0e, 0x9a, 0xdd, - 0xc7, 0xe1, 0x11, 0x63, 0xd8, 0xe3, 0x20, 0x8d, 0xf8, 0x24, 0x80, 0xbf, 0xaa, 0x86, 0xd1, 0xfd, - 0xc5, 0xaa, 0x6d, 0xfd, 0x59, 0xb5, 0xef, 0x1c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, 0x53, 0x39, 0x65, 0x4a, - 0xe7, 0x4a, 0x53, 0x91, 0xb2, 0xab, 0x4c, 0xd1, 0xf9, 0x73, 0x9a, 0x2b, 0x3e, 0x1b, 0x83, 0xae, - 0x36, 0xf6, 0xc9, 0xb3, 0xab, 0xbd, 0xa5, 0x35, 0x5f, 0x27, 0xa0, 0xd3, 0x9b, 0xe5, 0xce, 0x3e, - 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x16, 0xa3, 0xcb, 0xa2, 0x26, 0x03, 0x00, 0x00, + // 436 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x33, 0xdd, 0x58, 0xb6, 0xb3, 0xb5, 0xe8, 0x54, 0x21, 0x2e, 0x98, 0x8d, 0x2b, 0x48, + 0x2e, 0xcd, 0x48, 0xf4, 0xa2, 0x78, 0x8a, 0x07, 0x2d, 0x5e, 0x4a, 0x04, 0x0f, 0x82, 0x94, 0x64, + 0xe6, 0x35, 0x1d, 0xba, 0x99, 0x59, 0x77, 0x66, 0x57, 0xfd, 0x06, 0x1e, 0xfd, 0x08, 0x7e, 0x9c, + 0x1e, 0x7b, 0x11, 0x3c, 0x15, 0xd9, 0xfd, 0x16, 0x9e, 0x24, 0x93, 0x3f, 0xac, 0x74, 0x11, 0x4a, + 0x6f, 0xef, 0xbc, 0xef, 0xf3, 0xfc, 0x9e, 0x97, 0xe1, 0xc5, 0x0f, 0x44, 0xce, 0x28, 0x53, 0x33, + 0xa0, 0xec, 0x24, 0x93, 0x12, 0x26, 0x74, 0x11, 0xd3, 0x02, 0x24, 0x68, 0xa1, 0xa3, 0xe9, 0x4c, + 0x19, 0x45, 0xf6, 0x45, 0xce, 0xa2, 0x4a, 0x12, 0x35, 0x92, 0x68, 0x11, 0x0f, 0xef, 0x14, 0xaa, + 0x50, 0x76, 0x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01, 0x0a, 0x77, 0xd2, 0x9d, 0xa6, 0x73, + 0xc8, 0xc9, 0x10, 0xf7, 0x3b, 0xe8, 0x96, 0x85, 0x76, 0x6f, 0x42, 0xb0, 0xcb, 0x33, 0x93, 0x79, + 0xbd, 0x00, 0x85, 0xbb, 0xa9, 0xad, 0x9f, 0xbb, 0xdf, 0x7e, 0x8c, 0x9c, 0xf1, 0x1b, 0xbc, 0xf7, + 0xef, 0xfa, 0xd7, 0x88, 0x49, 0xde, 0x9d, 0x2d, 0x7d, 0x74, 0xbe, 0xf4, 0xd1, 0xef, 0xa5, 0x8f, + 0xbe, 0xaf, 0x7c, 0xe7, 0x7c, 0xe5, 0x3b, 0xbf, 0x56, 0xbe, 0xf3, 0xfe, 0x45, 0x21, 0xcc, 0xc9, + 0x3c, 0x8f, 0x98, 0x2a, 0x29, 0x53, 0xba, 0x54, 0x9a, 0x8a, 0x9c, 0x1d, 0x14, 0x8a, 0x2e, 0x9e, + 0xd1, 0x52, 0xf1, 0xf9, 0x04, 0x74, 0x7d, 0xe5, 0x8f, 0x9f, 0x1e, 0xac, 0x1d, 0xba, 0xf9, 0x3a, + 0x05, 0x9d, 0x6f, 0xdb, 0x3b, 0x7f, 0xf2, 0x37, 0x00, 0x00, 0xff, 0xff, 0x28, 0x88, 0xce, 0xb6, + 0x5a, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -259,6 +270,11 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.NextChannelSequence != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.NextChannelSequence)) + i-- + dAtA[i] = 0x30 + } if len(m.SendSequences) > 0 { for iNdEx := len(m.SendSequences) - 1; iNdEx >= 0; iNdEx-- { { @@ -456,6 +472,9 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if m.NextChannelSequence != 0 { + n += 1 + sovGenesis(uint64(m.NextChannelSequence)) + } return n } @@ -700,6 +719,25 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextChannelSequence", wireType) + } + m.NextChannelSequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextChannelSequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/modules/core/04-channel/v2/types/genesis_test.go b/modules/core/04-channel/v2/types/genesis_test.go new file mode 100644 index 000000000000..e70290d54b15 --- /dev/null +++ b/modules/core/04-channel/v2/types/genesis_test.go @@ -0,0 +1,102 @@ +package types_test + +import ( + "errors" + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" + ibctesting "github.com/cosmos/ibc-go/v9/testing" +) + +func TestValidateGenesis(t *testing.T) { + testCases := []struct { + name string + genState types.GenesisState + expError error + }{ + { + "default", + types.DefaultGenesisState(), + nil, + }, + { + "valid genesis", + types.NewGenesisState( + []types.IdentifiedChannel{ + types.NewIdentifiedChannel( + ibctesting.FirstChannelID, types.NewChannel(ibctesting.FirstClientID, ibctesting.SecondChannelID, ibctesting.MerklePath), + ), + types.NewIdentifiedChannel( + ibctesting.SecondChannelID, types.NewChannel(ibctesting.SecondClientID, ibctesting.FirstChannelID, ibctesting.MerklePath), + ), + }, + []types.PacketState{types.NewPacketState(ibctesting.FirstChannelID, 1, []byte("ack"))}, + []types.PacketState{types.NewPacketState(ibctesting.SecondChannelID, 1, []byte(""))}, + []types.PacketState{types.NewPacketState(ibctesting.FirstChannelID, 1, []byte("commit_hash"))}, + []types.PacketSequence{types.NewPacketSequence(ibctesting.SecondChannelID, 1)}, + 2, + ), + nil, + }, + { + "invalid channel identifier", + types.GenesisState{ + Channels: []types.IdentifiedChannel{types.NewIdentifiedChannel(ibctesting.InvalidID, types.NewChannel(ibctesting.FirstClientID, ibctesting.SecondChannelID, ibctesting.MerklePath))}, + }, + host.ErrInvalidID, + }, + { + "invalid ack", + types.GenesisState{ + Acknowledgements: []types.PacketState{ + types.NewPacketState(ibctesting.SecondChannelID, 1, nil), + }, + }, + errors.New("data bytes cannot be nil"), + }, + { + "invalid commitment", + types.GenesisState{ + Commitments: []types.PacketState{ + types.NewPacketState(ibctesting.FirstChannelID, 1, nil), + }, + }, + errors.New("data bytes cannot be nil"), + }, + { + "invalid send seq", + types.GenesisState{ + SendSequences: []types.PacketSequence{ + types.NewPacketSequence(ibctesting.FirstChannelID, 0), + }, + }, + errors.New("sequence cannot be 0"), + }, + { + "next channel sequence is less than maximum channel identifier sequence used", + types.GenesisState{ + Channels: []types.IdentifiedChannel{ + types.NewIdentifiedChannel("channel-10", types.NewChannel(ibctesting.FirstClientID, ibctesting.SecondChannelID, ibctesting.MerklePath)), + }, + NextChannelSequence: 0, + }, + fmt.Errorf("next channel sequence 0 must be greater than maximum sequence used in channel identifier 10"), + }, + } + + for _, tc := range testCases { + + err := tc.genState.Validate() + + expPass := tc.expError == nil + if expPass { + require.NoError(t, err) + } else { + ibctesting.RequireErrorIsOrContains(t, err, tc.expError) + } + } +} diff --git a/modules/core/04-channel/v2/types/packet.go b/modules/core/04-channel/v2/types/packet.go index 42da61b2a155..1ba7722b9253 100644 --- a/modules/core/04-channel/v2/types/packet.go +++ b/modules/core/04-channel/v2/types/packet.go @@ -84,12 +84,3 @@ func (p Payload) ValidateBasic() error { func TimeoutTimestampToNanos(seconds uint64) uint64 { return uint64(time.Unix(int64(seconds), 0).UnixNano()) } - -// NewPacketState creates and returns a new PacketState envelope type to encapsulate packet commitments, acks or receipts. -func NewPacketState(channelID string, sequence uint64, data []byte) PacketState { - return PacketState{ - ChannelId: channelID, - Sequence: sequence, - Data: data, - } -} diff --git a/proto/ibc/core/channel/v2/genesis.proto b/proto/ibc/core/channel/v2/genesis.proto index ab2c2b73944f..a4c54a91977d 100644 --- a/proto/ibc/core/channel/v2/genesis.proto +++ b/proto/ibc/core/channel/v2/genesis.proto @@ -7,13 +7,15 @@ option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/type import "gogoproto/gogo.proto"; import "ibc/core/channel/v2/channel.proto"; -// GenesisState defines the ibc channel submodule's genesis state. +// GenesisState defines the ibc channel/v2 submodule's genesis state. message GenesisState { repeated IdentifiedChannel channels = 1 [(gogoproto.casttype) = "IdentifiedChannel", (gogoproto.nullable) = false]; repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; repeated PacketSequence send_sequences = 5 [(gogoproto.nullable) = false]; + // the sequence for the next generated channel identifier + uint64 next_channel_sequence = 6; } // PacketState defines the generic type necessary to retrieve and store