From e3b46ff0cdc055dc352b31db31cdb10985d02497 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Wed, 6 Nov 2024 12:50:07 +0200 Subject: [PATCH 01/23] feat: add protobuf files for channel/v2 genesis storage. (#7502) --- .../core/04-channel/v2/types/channel.pb.go | 256 +++- .../core/04-channel/v2/types/genesis.pb.go | 1043 +++++++++++++++++ proto/ibc/core/channel/v2/channel.proto | 10 + proto/ibc/core/channel/v2/genesis.proto | 40 + 4 files changed, 1329 insertions(+), 20 deletions(-) create mode 100644 modules/core/04-channel/v2/types/genesis.pb.go create mode 100644 proto/ibc/core/channel/v2/genesis.proto diff --git a/modules/core/04-channel/v2/types/channel.pb.go b/modules/core/04-channel/v2/types/channel.pb.go index 8666e2f8517..8d3dafb35ae 100644 --- a/modules/core/04-channel/v2/types/channel.pb.go +++ b/modules/core/04-channel/v2/types/channel.pb.go @@ -97,33 +97,79 @@ func (m *Channel) GetMerklePathPrefix() v2.MerklePath { return v2.MerklePath{} } +// IdentifiedChannel defines a channel with an additional channel identifier field. +type IdentifiedChannel struct { + // channel identified. + Channel Channel `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel"` + // channel identifier + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (m *IdentifiedChannel) Reset() { *m = IdentifiedChannel{} } +func (m *IdentifiedChannel) String() string { return proto.CompactTextString(m) } +func (*IdentifiedChannel) ProtoMessage() {} +func (*IdentifiedChannel) Descriptor() ([]byte, []int) { + return fileDescriptor_7e9b57d8f218397d, []int{1} +} +func (m *IdentifiedChannel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IdentifiedChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IdentifiedChannel.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 *IdentifiedChannel) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdentifiedChannel.Merge(m, src) +} +func (m *IdentifiedChannel) XXX_Size() int { + return m.Size() +} +func (m *IdentifiedChannel) XXX_DiscardUnknown() { + xxx_messageInfo_IdentifiedChannel.DiscardUnknown(m) +} + +var xxx_messageInfo_IdentifiedChannel proto.InternalMessageInfo + func init() { proto.RegisterType((*Channel)(nil), "ibc.core.channel.v2.Channel") + proto.RegisterType((*IdentifiedChannel)(nil), "ibc.core.channel.v2.IdentifiedChannel") } func init() { proto.RegisterFile("ibc/core/channel/v2/channel.proto", fileDescriptor_7e9b57d8f218397d) } var fileDescriptor_7e9b57d8f218397d = []byte{ - // 302 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0x83, 0x40, - 0x18, 0xc7, 0x39, 0x35, 0x6a, 0x71, 0x31, 0xa8, 0xb1, 0xa9, 0xc9, 0x59, 0xbb, 0xd8, 0xa5, 0x9c, - 0x41, 0x63, 0x62, 0xe2, 0x54, 0xa7, 0x0e, 0x26, 0x4d, 0x87, 0x0e, 0x2e, 0x04, 0x8e, 0x13, 0x2e, - 0x72, 0x7c, 0xe4, 0x38, 0x88, 0x7d, 0x0b, 0x9f, 0xc6, 0x67, 0xe8, 0xd8, 0xd1, 0xc9, 0x18, 0x78, - 0x11, 0xc3, 0xd1, 0x96, 0x6e, 0x1f, 0xff, 0xef, 0xc7, 0x2f, 0xdf, 0xfd, 0xcd, 0x1b, 0xee, 0x53, - 0x42, 0x41, 0x32, 0x42, 0x23, 0x2f, 0x49, 0x58, 0x4c, 0x0a, 0x67, 0x33, 0xda, 0xa9, 0x04, 0x05, - 0xd6, 0x19, 0xf7, 0xa9, 0x5d, 0x23, 0xf6, 0x26, 0x2f, 0x9c, 0xde, 0x79, 0x08, 0x21, 0xe8, 0x3d, - 0xa9, 0xa7, 0x06, 0xed, 0xdd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01, 0x00, 0x00, + // 356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xc1, 0x4e, 0xea, 0x40, + 0x14, 0x86, 0x3b, 0xf7, 0x92, 0xcb, 0x65, 0xd8, 0x68, 0xd5, 0x48, 0x50, 0x0b, 0xb2, 0x91, 0x0d, + 0x33, 0xa6, 0x1a, 0x13, 0x0d, 0x2b, 0x5c, 0xb1, 0x30, 0x21, 0x2c, 0x58, 0xb8, 0x69, 0xda, 0xe9, + 0xd0, 0x4e, 0xec, 0x74, 0x9a, 0x76, 0x68, 0xe4, 0x0d, 0x5c, 0xfa, 0x08, 0x3e, 0x85, 0xcf, 0xc0, + 0x92, 0xa5, 0x2b, 0x63, 0xe0, 0x45, 0x4c, 0xa7, 0x2d, 0x90, 0xe8, 0xee, 0xcc, 0x39, 0xff, 0xf9, + 0xf2, 0xff, 0x73, 0xe0, 0x39, 0x73, 0x08, 0x26, 0x22, 0xa6, 0x98, 0xf8, 0x76, 0x18, 0xd2, 0x00, + 0xa7, 0x66, 0x59, 0xa2, 0x28, 0x16, 0x52, 0xe8, 0x07, 0xcc, 0x21, 0x28, 0x93, 0xa0, 0xb2, 0x9f, + 0x9a, 0xcd, 0x43, 0x4f, 0x78, 0x42, 0xcd, 0x71, 0x56, 0xe5, 0xd2, 0xe6, 0xc5, 0x96, 0x26, 0x38, + 0x67, 0x92, 0xd3, 0x50, 0x2a, 0xe0, 0xe6, 0x95, 0x0b, 0x3b, 0xef, 0x00, 0x56, 0xef, 0x73, 0x9a, + 0x7e, 0x02, 0x6b, 0x24, 0x60, 0x34, 0x94, 0x16, 0x73, 0x1b, 0xa0, 0x0d, 0xba, 0xb5, 0xf1, 0xff, + 0xbc, 0x31, 0x74, 0xf5, 0x1b, 0x78, 0x4c, 0xc4, 0x2c, 0x94, 0x34, 0x8e, 0xec, 0x58, 0xce, 0xad, + 0xc2, 0x42, 0x26, 0xfd, 0xa3, 0xa4, 0x47, 0xbb, 0xe3, 0x02, 0x39, 0x74, 0xf5, 0x09, 0xd4, 0x39, + 0x8d, 0x9f, 0x02, 0x6a, 0x45, 0xb6, 0xf4, 0xad, 0x28, 0xa6, 0x53, 0xf6, 0xdc, 0xf8, 0xdb, 0x06, + 0xdd, 0xba, 0xd9, 0x41, 0xdb, 0x44, 0x5b, 0x63, 0xa9, 0x89, 0x1e, 0xd4, 0xc6, 0xc8, 0x96, 0xfe, + 0xa0, 0xb2, 0xf8, 0x6c, 0x69, 0xe3, 0x3d, 0xbe, 0xe9, 0x8c, 0x14, 0xa1, 0x93, 0xc2, 0xfd, 0xa1, + 0x4b, 0x43, 0xc9, 0xa6, 0x8c, 0xba, 0x65, 0x82, 0x3e, 0xac, 0x16, 0xbe, 0x94, 0xff, 0xba, 0x79, + 0x8a, 0x7e, 0xf9, 0x33, 0x54, 0xc8, 0x0b, 0x76, 0xb9, 0xa2, 0x9f, 0x41, 0xf8, 0x23, 0x55, 0x8d, + 0x94, 0x49, 0xee, 0x2a, 0x2f, 0x6f, 0x2d, 0x6d, 0x30, 0x59, 0xac, 0x0c, 0xb0, 0x5c, 0x19, 0xe0, + 0x6b, 0x65, 0x80, 0xd7, 0xb5, 0xa1, 0x2d, 0xd7, 0x86, 0xf6, 0xb1, 0x36, 0xb4, 0xc7, 0xbe, 0xc7, + 0xa4, 0x3f, 0x73, 0xb2, 0x28, 0x98, 0x88, 0x84, 0x8b, 0x04, 0x33, 0x87, 0xf4, 0x3c, 0x81, 0xd3, + 0x5b, 0xcc, 0x85, 0x3b, 0x0b, 0x68, 0x92, 0xdf, 0xe4, 0xf2, 0xba, 0xb7, 0x73, 0x64, 0x39, 0x8f, + 0x68, 0xe2, 0xfc, 0x53, 0xf7, 0xb8, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xc9, 0x7e, 0x8b, + 0x08, 0x02, 0x00, 0x00, } func (m *Channel) Marshal() (dAtA []byte, err error) { @@ -173,6 +219,46 @@ func (m *Channel) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *IdentifiedChannel) 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 *IdentifiedChannel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IdentifiedChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintChannel(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintChannel(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintChannel(dAtA []byte, offset int, v uint64) int { offset -= sovChannel(v) base := offset @@ -203,6 +289,21 @@ func (m *Channel) Size() (n int) { return n } +func (m *IdentifiedChannel) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Channel.Size() + n += 1 + l + sovChannel(uint64(l)) + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovChannel(uint64(l)) + } + return n +} + func sovChannel(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -356,6 +457,121 @@ func (m *Channel) Unmarshal(dAtA []byte) error { } return nil } +func (m *IdentifiedChannel) 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 ErrIntOverflowChannel + } + 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: IdentifiedChannel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IdentifiedChannel: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthChannel + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", 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.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipChannel(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/04-channel/v2/types/genesis.pb.go b/modules/core/04-channel/v2/types/genesis.pb.go new file mode 100644 index 00000000000..2528c89d61f --- /dev/null +++ b/modules/core/04-channel/v2/types/genesis.pb.go @@ -0,0 +1,1043 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/core/channel/v2/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the ibc channel 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"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_b5d374f126f051c3, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetChannels() []IdentifiedChannel { + if m != nil { + return m.Channels + } + return nil +} + +func (m *GenesisState) GetAcknowledgements() []PacketState { + if m != nil { + return m.Acknowledgements + } + return nil +} + +func (m *GenesisState) GetCommitments() []PacketState { + if m != nil { + return m.Commitments + } + return nil +} + +func (m *GenesisState) GetReceipts() []PacketState { + if m != nil { + return m.Receipts + } + return nil +} + +func (m *GenesisState) GetSendSequences() []PacketSequence { + if m != nil { + return m.SendSequences + } + return nil +} + +// 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 +// state as a commitment, acknowledgement, or a receipt. +type PacketState struct { + // channel unique identifier. + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // packet sequence. + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + // embedded data that represents packet state. + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *PacketState) Reset() { *m = PacketState{} } +func (m *PacketState) String() string { return proto.CompactTextString(m) } +func (*PacketState) ProtoMessage() {} +func (*PacketState) Descriptor() ([]byte, []int) { + return fileDescriptor_b5d374f126f051c3, []int{1} +} +func (m *PacketState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PacketState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PacketState.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 *PacketState) XXX_Merge(src proto.Message) { + xxx_messageInfo_PacketState.Merge(m, src) +} +func (m *PacketState) XXX_Size() int { + return m.Size() +} +func (m *PacketState) XXX_DiscardUnknown() { + xxx_messageInfo_PacketState.DiscardUnknown(m) +} + +var xxx_messageInfo_PacketState proto.InternalMessageInfo + +// PacketSequence defines the genesis type necessary to retrieve and store next send sequences. +type PacketSequence struct { + // channel unique identifier. + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // packet sequence + Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (m *PacketSequence) Reset() { *m = PacketSequence{} } +func (m *PacketSequence) String() string { return proto.CompactTextString(m) } +func (*PacketSequence) ProtoMessage() {} +func (*PacketSequence) Descriptor() ([]byte, []int) { + return fileDescriptor_b5d374f126f051c3, []int{2} +} +func (m *PacketSequence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PacketSequence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PacketSequence.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 *PacketSequence) XXX_Merge(src proto.Message) { + xxx_messageInfo_PacketSequence.Merge(m, src) +} +func (m *PacketSequence) XXX_Size() int { + return m.Size() +} +func (m *PacketSequence) XXX_DiscardUnknown() { + xxx_messageInfo_PacketSequence.DiscardUnknown(m) +} + +var xxx_messageInfo_PacketSequence proto.InternalMessageInfo + +func (m *PacketSequence) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *PacketSequence) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "ibc.core.channel.v2.GenesisState") + proto.RegisterType((*PacketState)(nil), "ibc.core.channel.v2.PacketState") + proto.RegisterType((*PacketSequence)(nil), "ibc.core.channel.v2.PacketSequence") +} + +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,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, 0xf2, 0xdf, 0xaf, 0x5c, 0x43, 0x13, 0xbd, + 0x5f, 0xac, 0x3d, 0xb4, 0x5c, 0x7b, 0xe8, 0xf7, 0xda, 0x43, 0xdf, 0x37, 0x9e, 0xb5, 0xdc, 0x78, + 0xd6, 0xaf, 0x8d, 0x67, 0x7d, 0x78, 0x99, 0x09, 0x33, 0x9c, 0xa5, 0x21, 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, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SendSequences) > 0 { + for iNdEx := len(m.SendSequences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendSequences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Receipts) > 0 { + for iNdEx := len(m.Receipts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Receipts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Commitments) > 0 { + for iNdEx := len(m.Commitments) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Commitments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Acknowledgements) > 0 { + for iNdEx := len(m.Acknowledgements) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Acknowledgements[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Channels) > 0 { + for iNdEx := len(m.Channels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Channels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PacketState) 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 *PacketState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PacketState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a + } + if m.Sequence != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x10 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PacketSequence) 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 *PacketSequence) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PacketSequence) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sequence != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x10 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Channels) > 0 { + for _, e := range m.Channels { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Acknowledgements) > 0 { + for _, e := range m.Acknowledgements { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Commitments) > 0 { + for _, e := range m.Commitments { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Receipts) > 0 { + for _, e := range m.Receipts { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.SendSequences) > 0 { + for _, e := range m.SendSequences { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *PacketState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovGenesis(uint64(m.Sequence)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *PacketSequence) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovGenesis(uint64(m.Sequence)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channels = append(m.Channels, IdentifiedChannel{}) + if err := m.Channels[len(m.Channels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgements", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Acknowledgements = append(m.Acknowledgements, PacketState{}) + if err := m.Acknowledgements[len(m.Acknowledgements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commitments", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Commitments = append(m.Commitments, PacketState{}) + if err := m.Commitments[len(m.Commitments)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receipts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receipts = append(m.Receipts, PacketState{}) + if err := m.Receipts[len(m.Receipts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendSequences", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendSequences = append(m.SendSequences, PacketSequence{}) + if err := m.SendSequences[len(m.SendSequences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PacketState) 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 ErrIntOverflowGenesis + } + 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: PacketState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PacketState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PacketSequence) 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 ErrIntOverflowGenesis + } + 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: PacketSequence: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PacketSequence: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/proto/ibc/core/channel/v2/channel.proto b/proto/ibc/core/channel/v2/channel.proto index 67a5a1871be..f3ac209cdd9 100644 --- a/proto/ibc/core/channel/v2/channel.proto +++ b/proto/ibc/core/channel/v2/channel.proto @@ -25,3 +25,13 @@ message Channel { // the final path. ibc.core.commitment.v2.MerklePath merkle_path_prefix = 3 [(gogoproto.nullable) = false]; } + +// IdentifiedChannel defines a channel with an additional channel identifier field. +message IdentifiedChannel { + option (gogoproto.goproto_getters) = false; + + // channel identified. + Channel channel = 1 [(gogoproto.nullable) = false]; + // channel identifier + string channel_id = 2; +} diff --git a/proto/ibc/core/channel/v2/genesis.proto b/proto/ibc/core/channel/v2/genesis.proto new file mode 100644 index 00000000000..ab2c2b73944 --- /dev/null +++ b/proto/ibc/core/channel/v2/genesis.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package ibc.core.channel.v2; + +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v2/channel.proto"; + +// GenesisState defines the ibc channel 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]; +} + +// 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 +// state as a commitment, acknowledgement, or a receipt. +message PacketState { + option (gogoproto.goproto_getters) = false; + + // channel unique identifier. + string channel_id = 1; + // packet sequence. + uint64 sequence = 2; + // embedded data that represents packet state. + bytes data = 3; +} + +// PacketSequence defines the genesis type necessary to retrieve and store next send sequences. +message PacketSequence { + // channel unique identifier. + string channel_id = 1; + // packet sequence + uint64 sequence = 2; +} From c7670b39f220a8769b01ec5c7872d7ee92fd1291 Mon Sep 17 00:00:00 2001 From: Gjermund Garaba Date: Wed, 6 Nov 2024 14:54:36 +0100 Subject: [PATCH 02/23] wire channel query server v2 (#7537) * wire channel query server v2 * register grpc gateway routes --- modules/core/module.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/core/module.go b/modules/core/module.go index 6edba9b02c3..32e2589d075 100644 --- a/modules/core/module.go +++ b/modules/core/module.go @@ -24,6 +24,7 @@ import ( connectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types" channelkeeper "github.com/cosmos/ibc-go/v9/modules/core/04-channel/keeper" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + channelkeeperv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/keeper" channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" "github.com/cosmos/ibc-go/v9/modules/core/client/cli" "github.com/cosmos/ibc-go/v9/modules/core/exported" @@ -92,6 +93,7 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r if err != nil { panic(err) } + err = channeltypesv2.RegisterQueryHandlerClient(context.Background(), mux, channeltypesv2.NewQueryClient(clientCtx)) if err != nil { panic(err) } @@ -140,6 +142,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { clienttypes.RegisterQueryServer(cfg.QueryServer(), clientkeeper.NewQueryServer(am.keeper.ClientKeeper)) connectiontypes.RegisterQueryServer(cfg.QueryServer(), connectionkeeper.NewQueryServer(am.keeper.ConnectionKeeper)) channeltypes.RegisterQueryServer(cfg.QueryServer(), channelkeeper.NewQueryServer(am.keeper.ChannelKeeper)) + channeltypesv2.RegisterQueryServer(cfg.QueryServer(), channelkeeperv2.NewQueryServer(am.keeper.ChannelKeeperV2)) clientMigrator := clientkeeper.NewMigrator(am.keeper.ClientKeeper) if err := cfg.RegisterMigration(exported.ModuleName, 2, clientMigrator.Migrate2to3); err != nil { From c191b1da0f23c3201e68a0e075a68f21d8ecf082 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 7 Nov 2024 09:14:32 +0000 Subject: [PATCH 03/23] Ignore files with no tests when searching for test files (#7541) * chore: ignore files with no tests when searching for test files * chore: updated tests --- cmd/build_test_matrix/main.go | 7 ++++++- cmd/build_test_matrix/main_test.go | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmd/build_test_matrix/main.go b/cmd/build_test_matrix/main.go index c2bee6d7050..052328dc5f4 100644 --- a/cmd/build_test_matrix/main.go +++ b/cmd/build_test_matrix/main.go @@ -112,7 +112,7 @@ func getGithubActionMatrixForTests(e2eRootDirectory, testName string, suite stri suiteNameForFile, testCases, err := extractSuiteAndTestNames(f) if err != nil { - return fmt.Errorf("failed extracting test suite name and test cases: %s", err) + return nil } if testName != "" && contains(testName, testCases) { @@ -145,6 +145,11 @@ func getGithubActionMatrixForTests(e2eRootDirectory, testName string, suite stri }) } } + + if len(gh.Include) == 0 { + return GithubActionTestMatrix{}, fmt.Errorf("no test cases found") + } + // Sort the test cases by name so that the order is consistent. sort.SliceStable(gh.Include, func(i, j int) bool { return gh.Include[i].Test < gh.Include[j].Test diff --git a/cmd/build_test_matrix/main_test.go b/cmd/build_test_matrix/main_test.go index 67a8fde26f8..280a4f620be 100644 --- a/cmd/build_test_matrix/main_test.go +++ b/cmd/build_test_matrix/main_test.go @@ -17,10 +17,10 @@ const ( ) func TestGetGithubActionMatrixForTests(t *testing.T) { - t.Run("empty dir does not fail", func(t *testing.T) { + t.Run("empty dir with no test cases fails", func(t *testing.T) { testingDir := t.TempDir() _, err := getGithubActionMatrixForTests(testingDir, "", "", nil) - assert.NoError(t, err) + assert.Error(t, err) }) t.Run("only test functions are picked up", func(t *testing.T) { @@ -105,12 +105,12 @@ func TestGetGithubActionMatrixForTests(t *testing.T) { assert.Error(t, err) }) - t.Run("non test files are not picked up", func(t *testing.T) { + t.Run("non test files are skipped", func(t *testing.T) { testingDir := t.TempDir() createFileWithTestSuiteAndTests(t, "FeeMiddlewareTestSuite", "TestA", "TestB", testingDir, nonTestFile) gh, err := getGithubActionMatrixForTests(testingDir, "", "", nil) - assert.NoError(t, err) + assert.Error(t, err) assert.Empty(t, gh.Include) }) From 44a143b54a097f3772e825565897a5a6cb1f0aa5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:00:28 +0200 Subject: [PATCH 04/23] chore(deps): bump github.com/cometbft/cometbft from 0.38.13 to 0.38.15 (#7540) * chore(deps): bump github.com/cometbft/cometbft from 0.38.13 to 0.38.15 Bumps [github.com/cometbft/cometbft](https://github.com/cometbft/cometbft) from 0.38.13 to 0.38.15. - [Release notes](https://github.com/cometbft/cometbft/releases) - [Changelog](https://github.com/cometbft/cometbft/blob/v0.38.15/CHANGELOG.md) - [Commits](https://github.com/cometbft/cometbft/compare/v0.38.13...v0.38.15) --- updated-dependencies: - dependency-name: github.com/cometbft/cometbft dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * deps: bump cometbft to 0.38.15, tidy-all, add to CHANGELOG --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim --- CHANGELOG.md | 2 +- e2e/go.mod | 18 +++++++------- e2e/go.sum | 36 ++++++++++++++-------------- go.mod | 18 +++++++------- go.sum | 36 ++++++++++++++-------------- modules/apps/callbacks/go.mod | 18 +++++++------- modules/apps/callbacks/go.sum | 36 ++++++++++++++-------------- modules/light-clients/08-wasm/go.mod | 18 +++++++------- modules/light-clients/08-wasm/go.sum | 36 ++++++++++++++-------------- simapp/go.mod | 18 +++++++------- simapp/go.sum | 36 ++++++++++++++-------------- 11 files changed, 136 insertions(+), 136 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c53b5aaa493..0f9200953d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies -* [\#7516](https://github.com/cosmos/ibc-go/pull/7516) Bump CometBFT to v0.38.13. +* [\#7540](https://github.com/cosmos/ibc-go/pull/7540) Bump CometBFT to v0.38.15. ### API Breaking diff --git a/e2e/go.mod b/e2e/go.mod index 91bf21aa678..835855eb64f 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -14,7 +14,7 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 cosmossdk.io/x/upgrade v0.1.4 - github.com/cometbft/cometbft v0.38.13 + github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-sdk v0.50.10 github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-00010101000000-000000000000 @@ -200,9 +200,9 @@ require ( github.com/pierrec/xxHash v0.1.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect @@ -237,14 +237,14 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.22.0 // indirect google.golang.org/api v0.186.0 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index f43de53fe8b..a1678aeef59 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -359,8 +359,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.13 h1:k0ssyC8W0FfFvGpSHpojZ4JrXAANlJEIM41hjRq6OoU= -github.com/cometbft/cometbft v0.38.13/go.mod h1:NMmNysQM+T5uxTXVLMgzcvq35OVOyC7GK2/bnHqldjE= +github.com/cometbft/cometbft v0.38.15 h1:5veFd8k1uXM27PBg9sMO3hAfRJ3vbh4OmmLf6cVrqXg= +github.com/cometbft/cometbft v0.38.15/go.mod h1:+wh6ap6xctVG+JOHwbl8pPKZ0GeqdPYqISu7F4b43cQ= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -959,8 +959,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -975,8 +975,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1164,8 +1164,8 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1266,8 +1266,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1293,8 +1293,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1407,13 +1407,13 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1424,8 +1424,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/go.mod b/go.mod index a479b29b1f0..68797e77500 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( cosmossdk.io/store v1.1.1 cosmossdk.io/x/tx v0.13.5 cosmossdk.io/x/upgrade v0.1.4 - github.com/cometbft/cometbft v0.38.13 + github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.10 @@ -146,9 +146,9 @@ require ( github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -176,14 +176,14 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/go.sum b/go.sum index d292a8981bf..be93dc36a3c 100644 --- a/go.sum +++ b/go.sum @@ -323,8 +323,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.13 h1:k0ssyC8W0FfFvGpSHpojZ4JrXAANlJEIM41hjRq6OoU= -github.com/cometbft/cometbft v0.38.13/go.mod h1:NMmNysQM+T5uxTXVLMgzcvq35OVOyC7GK2/bnHqldjE= +github.com/cometbft/cometbft v0.38.15 h1:5veFd8k1uXM27PBg9sMO3hAfRJ3vbh4OmmLf6cVrqXg= +github.com/cometbft/cometbft v0.38.15/go.mod h1:+wh6ap6xctVG+JOHwbl8pPKZ0GeqdPYqISu7F4b43cQ= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -854,8 +854,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -870,8 +870,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1034,8 +1034,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1134,8 +1134,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1161,8 +1161,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1274,13 +1274,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1291,8 +1291,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/modules/apps/callbacks/go.mod b/modules/apps/callbacks/go.mod index 5cbe97a2770..9563e5f4538 100644 --- a/modules/apps/callbacks/go.mod +++ b/modules/apps/callbacks/go.mod @@ -22,7 +22,7 @@ require ( cosmossdk.io/x/feegrant v0.1.1 cosmossdk.io/x/tx v0.13.5 cosmossdk.io/x/upgrade v0.1.4 - github.com/cometbft/cometbft v0.38.13 + github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-sdk v0.50.10 github.com/cosmos/gogoproto v1.7.0 @@ -153,9 +153,9 @@ require ( github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -182,14 +182,14 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/modules/apps/callbacks/go.sum b/modules/apps/callbacks/go.sum index 8a19280e481..81a6e4d10d4 100644 --- a/modules/apps/callbacks/go.sum +++ b/modules/apps/callbacks/go.sum @@ -333,8 +333,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.13 h1:k0ssyC8W0FfFvGpSHpojZ4JrXAANlJEIM41hjRq6OoU= -github.com/cometbft/cometbft v0.38.13/go.mod h1:NMmNysQM+T5uxTXVLMgzcvq35OVOyC7GK2/bnHqldjE= +github.com/cometbft/cometbft v0.38.15 h1:5veFd8k1uXM27PBg9sMO3hAfRJ3vbh4OmmLf6cVrqXg= +github.com/cometbft/cometbft v0.38.15/go.mod h1:+wh6ap6xctVG+JOHwbl8pPKZ0GeqdPYqISu7F4b43cQ= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -866,8 +866,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -882,8 +882,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1046,8 +1046,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1146,8 +1146,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1173,8 +1173,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1285,13 +1285,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1302,8 +1302,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/modules/light-clients/08-wasm/go.mod b/modules/light-clients/08-wasm/go.mod index 2ab1e61c546..962a23a5d89 100644 --- a/modules/light-clients/08-wasm/go.mod +++ b/modules/light-clients/08-wasm/go.mod @@ -24,7 +24,7 @@ require ( cosmossdk.io/x/tx v0.13.5 cosmossdk.io/x/upgrade v0.1.4 github.com/CosmWasm/wasmvm/v2 v2.1.2 - github.com/cometbft/cometbft v0.38.13 + github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-sdk v0.50.10 github.com/cosmos/gogoproto v1.7.0 @@ -156,9 +156,9 @@ require ( github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -186,14 +186,14 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/modules/light-clients/08-wasm/go.sum b/modules/light-clients/08-wasm/go.sum index 7ce9776cab3..4b7cc4d195d 100644 --- a/modules/light-clients/08-wasm/go.sum +++ b/modules/light-clients/08-wasm/go.sum @@ -335,8 +335,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.13 h1:k0ssyC8W0FfFvGpSHpojZ4JrXAANlJEIM41hjRq6OoU= -github.com/cometbft/cometbft v0.38.13/go.mod h1:NMmNysQM+T5uxTXVLMgzcvq35OVOyC7GK2/bnHqldjE= +github.com/cometbft/cometbft v0.38.15 h1:5veFd8k1uXM27PBg9sMO3hAfRJ3vbh4OmmLf6cVrqXg= +github.com/cometbft/cometbft v0.38.15/go.mod h1:+wh6ap6xctVG+JOHwbl8pPKZ0GeqdPYqISu7F4b43cQ= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -868,8 +868,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -884,8 +884,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1050,8 +1050,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1150,8 +1150,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1177,8 +1177,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1289,13 +1289,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1306,8 +1306,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/simapp/go.mod b/simapp/go.mod index cbee9d5aa33..4f97f5e303f 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -18,7 +18,7 @@ require ( cosmossdk.io/x/feegrant v0.1.1 cosmossdk.io/x/tx v0.13.5 cosmossdk.io/x/upgrade v0.1.4 - github.com/cometbft/cometbft v0.38.13 + github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-sdk v0.50.10 github.com/cosmos/gogoproto v1.7.0 @@ -151,9 +151,9 @@ require ( github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/common v0.60.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -180,14 +180,14 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 8a19280e481..81a6e4d10d4 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -333,8 +333,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.13 h1:k0ssyC8W0FfFvGpSHpojZ4JrXAANlJEIM41hjRq6OoU= -github.com/cometbft/cometbft v0.38.13/go.mod h1:NMmNysQM+T5uxTXVLMgzcvq35OVOyC7GK2/bnHqldjE= +github.com/cometbft/cometbft v0.38.15 h1:5veFd8k1uXM27PBg9sMO3hAfRJ3vbh4OmmLf6cVrqXg= +github.com/cometbft/cometbft v0.38.15/go.mod h1:+wh6ap6xctVG+JOHwbl8pPKZ0GeqdPYqISu7F4b43cQ= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -866,8 +866,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -882,8 +882,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= -github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1046,8 +1046,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1146,8 +1146,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1173,8 +1173,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1285,13 +1285,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1302,8 +1302,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 9239d5dc569b712d90ecc321690ac51d934380f7 Mon Sep 17 00:00:00 2001 From: Gjermund Garaba Date: Thu, 7 Nov 2024 11:12:35 +0100 Subject: [PATCH 05/23] fix: channel must exist before channel creator check (#7538) * fix: channel must exist before channel creator check * Update modules/core/04-channel/v2/keeper/msg_server.go Co-authored-by: DimitrisJim * fixed failing test --------- Co-authored-by: DimitrisJim --- modules/core/04-channel/v2/keeper/msg_server.go | 10 +++++----- modules/core/04-channel/v2/keeper/msg_server_test.go | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/msg_server.go b/modules/core/04-channel/v2/keeper/msg_server.go index c4623150ea1..6bda4404531 100644 --- a/modules/core/04-channel/v2/keeper/msg_server.go +++ b/modules/core/04-channel/v2/keeper/msg_server.go @@ -38,6 +38,11 @@ func (k *Keeper) CreateChannel(goCtx context.Context, msg *types.MsgCreateChanne func (k *Keeper) RegisterCounterparty(goCtx context.Context, msg *types.MsgRegisterCounterparty) (*types.MsgRegisterCounterpartyResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + channel, ok := k.GetChannel(ctx, msg.ChannelId) + if !ok { + return nil, errorsmod.Wrapf(types.ErrChannelNotFound, "channel must exist for channel id %s", msg.ChannelId) + } + creator, found := k.GetCreator(ctx, msg.ChannelId) if !found { return nil, errorsmod.Wrap(ibcerrors.ErrUnauthorized, "channel creator must be set") @@ -47,11 +52,6 @@ func (k *Keeper) RegisterCounterparty(goCtx context.Context, msg *types.MsgRegis return nil, errorsmod.Wrapf(ibcerrors.ErrUnauthorized, "channel creator (%s) must match signer (%s)", creator, msg.Signer) } - channel, ok := k.GetChannel(ctx, msg.ChannelId) - if !ok { - return nil, errorsmod.Wrapf(types.ErrInvalidChannel, "channel must exist for channel id %s", msg.ChannelId) - } - channel.CounterpartyChannelId = msg.CounterpartyChannelId k.SetChannel(ctx, msg.ChannelId, channel) // Delete client creator from state as it is not needed after this point. 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 b4b5d8c71c4..2fa079e1e1f 100644 --- a/modules/core/04-channel/v2/keeper/msg_server_test.go +++ b/modules/core/04-channel/v2/keeper/msg_server_test.go @@ -52,9 +52,10 @@ func (suite *KeeperTestSuite) TestRegisterCounterparty() { { "failure: channel must already exist", func() { + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.DeleteCreator(suite.chainA.GetContext(), path.EndpointA.ChannelID) suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.ChannelStore(suite.chainA.GetContext(), path.EndpointA.ChannelID).Delete([]byte(channeltypesv2.ChannelKey)) }, - channeltypesv2.ErrInvalidChannel, + channeltypesv2.ErrChannelNotFound, }, } From 94e1bff01f0dcdfff7ad6e052ef26d77c62ef560 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 13:50:21 +0200 Subject: [PATCH 06/23] chore(deps): bump google.golang.org/grpc from 1.67.1 to 1.68.0 (#7545) * chore(deps): bump google.golang.org/grpc from 1.67.1 to 1.68.0 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.67.1 to 1.68.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.67.1...v1.68.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * deps: bump grpc to 1.68.0 and tidy all --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: DimitrisJim --- e2e/go.mod | 4 ++-- e2e/go.sum | 8 ++++---- go.mod | 4 ++-- go.sum | 8 ++++---- modules/apps/callbacks/go.mod | 4 ++-- modules/apps/callbacks/go.sum | 8 ++++---- modules/light-clients/08-wasm/go.mod | 4 ++-- modules/light-clients/08-wasm/go.sum | 8 ++++---- simapp/go.mod | 4 ++-- simapp/go.sum | 8 ++++---- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/e2e/go.mod b/e2e/go.mod index 835855eb64f..f09f1f477d7 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -25,7 +25,7 @@ require ( github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 golang.org/x/mod v0.21.0 - google.golang.org/grpc v1.67.1 + google.golang.org/grpc v1.68.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -249,7 +249,7 @@ require ( golang.org/x/tools v0.22.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index a1678aeef59..34fc7832e96 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -1673,8 +1673,8 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1718,8 +1718,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/go.mod b/go.mod index 68797e77500..951517b06ce 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 - google.golang.org/grpc v1.67.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 + google.golang.org/grpc v1.68.0 google.golang.org/protobuf v1.35.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index be93dc36a3c..71148407922 100644 --- a/go.sum +++ b/go.sum @@ -1539,8 +1539,8 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1584,8 +1584,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/modules/apps/callbacks/go.mod b/modules/apps/callbacks/go.mod index 9563e5f4538..7116e4df6b9 100644 --- a/modules/apps/callbacks/go.mod +++ b/modules/apps/callbacks/go.mod @@ -193,9 +193,9 @@ require ( golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.67.1 // indirect + google.golang.org/grpc v1.68.0 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/modules/apps/callbacks/go.sum b/modules/apps/callbacks/go.sum index 81a6e4d10d4..3093129c229 100644 --- a/modules/apps/callbacks/go.sum +++ b/modules/apps/callbacks/go.sum @@ -1549,8 +1549,8 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1594,8 +1594,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/modules/light-clients/08-wasm/go.mod b/modules/light-clients/08-wasm/go.mod index 962a23a5d89..f4792ae360d 100644 --- a/modules/light-clients/08-wasm/go.mod +++ b/modules/light-clients/08-wasm/go.mod @@ -35,8 +35,8 @@ require ( github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 - google.golang.org/grpc v1.67.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 + google.golang.org/grpc v1.68.0 ) require ( diff --git a/modules/light-clients/08-wasm/go.sum b/modules/light-clients/08-wasm/go.sum index 4b7cc4d195d..252eaf346ea 100644 --- a/modules/light-clients/08-wasm/go.sum +++ b/modules/light-clients/08-wasm/go.sum @@ -1553,8 +1553,8 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1598,8 +1598,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/simapp/go.mod b/simapp/go.mod index 4f97f5e303f..d81fcebeba8 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -191,9 +191,9 @@ require ( golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.67.1 // indirect + google.golang.org/grpc v1.68.0 // indirect google.golang.org/protobuf v1.35.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 81a6e4d10d4..3093129c229 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -1549,8 +1549,8 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGrVb2hFXuQ+ZMbCNdakARIn/aHMmG8= google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1594,8 +1594,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From cae86e65b3f5740a2c7e35461dd25312869e4280 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 11 Nov 2024 12:50:30 +0100 Subject: [PATCH 07/23] feat: add paginated packet commitments query to channel/v2 (#7533) * feat: add paginated packet commitments query to channel/v2 * chore: add cli handler * chore: rm commented code * chore: make lint-fix --------- Co-authored-by: DimitrisJim --- modules/core/04-channel/v2/client/cli/cli.go | 1 + .../core/04-channel/v2/client/cli/query.go | 39 + .../core/04-channel/v2/keeper/grpc_query.go | 48 ++ .../04-channel/v2/keeper/grpc_query_test.go | 115 +++ modules/core/04-channel/v2/types/packet.go | 9 + modules/core/04-channel/v2/types/query.pb.go | 672 ++++++++++++++++-- .../core/04-channel/v2/types/query.pb.gw.go | 119 ++++ modules/core/24-host/v2/packet_keys.go | 5 + proto/ibc/core/channel/v2/query.proto | 25 + 9 files changed, 987 insertions(+), 46 deletions(-) diff --git a/modules/core/04-channel/v2/client/cli/cli.go b/modules/core/04-channel/v2/client/cli/cli.go index a9d985e72a0..59d9dded017 100644 --- a/modules/core/04-channel/v2/client/cli/cli.go +++ b/modules/core/04-channel/v2/client/cli/cli.go @@ -21,6 +21,7 @@ func GetQueryCmd() *cobra.Command { queryCmd.AddCommand( getCmdQueryChannel(), getCmdQueryPacketCommitment(), + getCmdQueryPacketCommitments(), getCmdQueryPacketAcknowledgement(), getCmdQueryPacketReceipt(), ) diff --git a/modules/core/04-channel/v2/client/cli/query.go b/modules/core/04-channel/v2/client/cli/query.go index a6a1d7f0762..c79d92dfd4c 100644 --- a/modules/core/04-channel/v2/client/cli/query.go +++ b/modules/core/04-channel/v2/client/cli/query.go @@ -96,6 +96,45 @@ func getCmdQueryPacketCommitment() *cobra.Command { return cmd } +func getCmdQueryPacketCommitments() *cobra.Command { + cmd := &cobra.Command{ + Use: "packet-commitments [channel-id]", + Short: "Query all packet commitments associated with a channel", + Long: "Query all packet commitments associated with a channel", + Example: fmt.Sprintf("%s query %s %s packet-commitments [channel-id]", version.AppName, exported.ModuleName, types.SubModuleName), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + req := &types.QueryPacketCommitmentsRequest{ + ChannelId: args[0], + Pagination: pageReq, + } + + res, err := queryClient.PacketCommitments(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "packet commitments associated with a channel") + + return cmd +} + func getCmdQueryPacketAcknowledgement() *cobra.Command { cmd := &cobra.Command{ Use: "packet-acknowledgement [channel-id] [sequence]", diff --git a/modules/core/04-channel/v2/keeper/grpc_query.go b/modules/core/04-channel/v2/keeper/grpc_query.go index 3106bc367cc..e72a5b3bbd9 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query.go +++ b/modules/core/04-channel/v2/keeper/grpc_query.go @@ -2,15 +2,22 @@ package keeper import ( "context" + "strings" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/store/prefix" + + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" + hostv2 "github.com/cosmos/ibc-go/v9/modules/core/24-host/v2" ) var _ types.QueryServer = (*queryServer)(nil) @@ -71,6 +78,47 @@ func (q *queryServer) PacketCommitment(ctx context.Context, req *types.QueryPack return types.NewQueryPacketCommitmentResponse(commitment, nil, clienttypes.GetSelfHeight(ctx)), nil } +// PacketCommitments implements the Query/PacketCommitments gRPC method +func (q *queryServer) PacketCommitments(ctx context.Context, req *types.QueryPacketCommitmentsRequest) (*types.QueryPacketCommitmentsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if err := host.ChannelIdentifierValidator(req.ChannelId); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + if !q.HasChannel(ctx, req.ChannelId) { + return nil, status.Error(codes.NotFound, errorsmod.Wrap(types.ErrChannelNotFound, req.ChannelId).Error()) + } + + var commitments []*types.PacketState + store := prefix.NewStore(runtime.KVStoreAdapter(q.storeService.OpenKVStore(ctx)), hostv2.PacketCommitmentPrefixKey(req.ChannelId)) + + pageRes, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { + keySplit := strings.Split(string(key), "/") + + sequence := sdk.BigEndianToUint64([]byte(keySplit[len(keySplit)-1])) + if sequence == 0 { + return types.ErrInvalidPacket + } + + commitment := types.NewPacketState(req.ChannelId, sequence, value) + commitments = append(commitments, &commitment) + return nil + }) + if err != nil { + return nil, err + } + + selfHeight := clienttypes.GetSelfHeight(ctx) + return &types.QueryPacketCommitmentsResponse{ + Commitments: commitments, + Pagination: pageRes, + Height: selfHeight, + }, nil +} + // PacketAcknowledgement implements the Query/PacketAcknowledgement gRPC method. func (q *queryServer) PacketAcknowledgement(ctx context.Context, req *types.QueryPacketAcknowledgementRequest) (*types.QueryPacketAcknowledgementResponse, error) { if req == nil { diff --git a/modules/core/04-channel/v2/keeper/grpc_query_test.go b/modules/core/04-channel/v2/keeper/grpc_query_test.go index e458128ce09..faecb9a2595 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query_test.go +++ b/modules/core/04-channel/v2/keeper/grpc_query_test.go @@ -6,6 +6,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/keeper" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" @@ -191,6 +193,119 @@ func (suite *KeeperTestSuite) TestQueryPacketCommitment() { } } +func (suite *KeeperTestSuite) TestQueryPacketCommitments() { + var ( + req *types.QueryPacketCommitmentsRequest + expCommitments = []*types.PacketState{} + ) + + testCases := []struct { + msg string + malleate func() + expError error + }{ + { + "success", + func() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupV2() + + expCommitments = make([]*types.PacketState, 0, 10) // reset expected commitments + for i := uint64(1); i <= 10; i++ { + pktStateCommitment := types.NewPacketState(path.EndpointA.ChannelID, i, []byte(fmt.Sprintf("hash_%d", i))) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetPacketCommitment(suite.chainA.GetContext(), pktStateCommitment.ChannelId, pktStateCommitment.Sequence, pktStateCommitment.Data) + expCommitments = append(expCommitments, &pktStateCommitment) + } + + req = &types.QueryPacketCommitmentsRequest{ + ChannelId: path.EndpointA.ChannelID, + Pagination: &query.PageRequest{ + Key: nil, + Limit: 11, + CountTotal: true, + }, + } + }, + nil, + }, + { + "success: with pagination", + func() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupV2() + + expCommitments = make([]*types.PacketState, 0, 10) // reset expected commitments + for i := uint64(1); i <= 10; i++ { + pktStateCommitment := types.NewPacketState(path.EndpointA.ChannelID, i, []byte(fmt.Sprintf("hash_%d", i))) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetPacketCommitment(suite.chainA.GetContext(), pktStateCommitment.ChannelId, pktStateCommitment.Sequence, pktStateCommitment.Data) + expCommitments = append(expCommitments, &pktStateCommitment) + } + + limit := uint64(5) + expCommitments = expCommitments[:limit] + + req = &types.QueryPacketCommitmentsRequest{ + ChannelId: path.EndpointA.ChannelID, + Pagination: &query.PageRequest{ + Key: nil, + Limit: limit, + CountTotal: true, + }, + } + }, + nil, + }, + { + "empty request", + func() { + req = nil + }, + status.Error(codes.InvalidArgument, "empty request"), + }, + { + "invalid channel ID", + func() { + req = &types.QueryPacketCommitmentsRequest{ + ChannelId: "", + } + }, + status.Error(codes.InvalidArgument, "identifier cannot be blank: invalid identifier"), + }, + { + "channel not found", + func() { + req = &types.QueryPacketCommitmentsRequest{ + ChannelId: "channel-141", + } + }, + status.Error(codes.NotFound, fmt.Sprintf("%s: channel not found", "channel-141")), + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() // reset + + tc.malleate() + ctx := suite.chainA.GetContext() + + queryServer := keeper.NewQueryServer(suite.chainA.GetSimApp().IBCKeeper.ChannelKeeperV2) + res, err := queryServer.PacketCommitments(ctx, req) + + expPass := tc.expError == nil + if expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(expCommitments, res.Commitments) + } else { + suite.Require().Error(err) + } + }) + } +} + func (suite *KeeperTestSuite) TestQueryPacketAcknowledgement() { var ( expAcknowledgement []byte diff --git a/modules/core/04-channel/v2/types/packet.go b/modules/core/04-channel/v2/types/packet.go index 1ba7722b925..42da61b2a15 100644 --- a/modules/core/04-channel/v2/types/packet.go +++ b/modules/core/04-channel/v2/types/packet.go @@ -84,3 +84,12 @@ 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/modules/core/04-channel/v2/types/query.pb.go b/modules/core/04-channel/v2/types/query.pb.go index 02e5f2a1b1b..897cd508b6d 100644 --- a/modules/core/04-channel/v2/types/query.pb.go +++ b/modules/core/04-channel/v2/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -240,6 +241,125 @@ func (m *QueryPacketCommitmentResponse) GetProofHeight() types.Height { return types.Height{} } +// QueryPacketCommitmentsRequest is the request type for the Query/PacketCommitments RPC method. +type QueryPacketCommitmentsRequest struct { + // channel unique identifier + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // pagination request + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryPacketCommitmentsRequest) Reset() { *m = QueryPacketCommitmentsRequest{} } +func (m *QueryPacketCommitmentsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPacketCommitmentsRequest) ProtoMessage() {} +func (*QueryPacketCommitmentsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a328cba4986edcab, []int{4} +} +func (m *QueryPacketCommitmentsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPacketCommitmentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPacketCommitmentsRequest.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 *QueryPacketCommitmentsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPacketCommitmentsRequest.Merge(m, src) +} +func (m *QueryPacketCommitmentsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPacketCommitmentsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPacketCommitmentsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPacketCommitmentsRequest proto.InternalMessageInfo + +func (m *QueryPacketCommitmentsRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *QueryPacketCommitmentsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryPacketCommitmentResponse is the response type for the Query/PacketCommitment RPC method. +type QueryPacketCommitmentsResponse struct { + // collection of packet commitments for the requested channel identifier. + Commitments []*PacketState `protobuf:"bytes,1,rep,name=commitments,proto3" json:"commitments,omitempty"` + // pagination response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` + // query block height. + Height types.Height `protobuf:"bytes,3,opt,name=height,proto3" json:"height"` +} + +func (m *QueryPacketCommitmentsResponse) Reset() { *m = QueryPacketCommitmentsResponse{} } +func (m *QueryPacketCommitmentsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPacketCommitmentsResponse) ProtoMessage() {} +func (*QueryPacketCommitmentsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a328cba4986edcab, []int{5} +} +func (m *QueryPacketCommitmentsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPacketCommitmentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPacketCommitmentsResponse.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 *QueryPacketCommitmentsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPacketCommitmentsResponse.Merge(m, src) +} +func (m *QueryPacketCommitmentsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPacketCommitmentsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPacketCommitmentsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPacketCommitmentsResponse proto.InternalMessageInfo + +func (m *QueryPacketCommitmentsResponse) GetCommitments() []*PacketState { + if m != nil { + return m.Commitments + } + return nil +} + +func (m *QueryPacketCommitmentsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryPacketCommitmentsResponse) GetHeight() types.Height { + if m != nil { + return m.Height + } + return types.Height{} +} + // QueryPacketAcknowledgementRequest is the request type for the Query/PacketAcknowledgement RPC method. type QueryPacketAcknowledgementRequest struct { // channel unique identifier @@ -252,7 +372,7 @@ func (m *QueryPacketAcknowledgementRequest) Reset() { *m = QueryPacketAc func (m *QueryPacketAcknowledgementRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementRequest) ProtoMessage() {} func (*QueryPacketAcknowledgementRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{4} + return fileDescriptor_a328cba4986edcab, []int{6} } func (m *QueryPacketAcknowledgementRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -309,7 +429,7 @@ func (m *QueryPacketAcknowledgementResponse) Reset() { *m = QueryPacketA func (m *QueryPacketAcknowledgementResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementResponse) ProtoMessage() {} func (*QueryPacketAcknowledgementResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{5} + return fileDescriptor_a328cba4986edcab, []int{7} } func (m *QueryPacketAcknowledgementResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -373,7 +493,7 @@ func (m *QueryPacketReceiptRequest) Reset() { *m = QueryPacketReceiptReq func (m *QueryPacketReceiptRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketReceiptRequest) ProtoMessage() {} func (*QueryPacketReceiptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{6} + return fileDescriptor_a328cba4986edcab, []int{8} } func (m *QueryPacketReceiptRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -437,7 +557,7 @@ func (m *QueryPacketReceiptResponse) Reset() { *m = QueryPacketReceiptRe func (m *QueryPacketReceiptResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketReceiptResponse) ProtoMessage() {} func (*QueryPacketReceiptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{7} + return fileDescriptor_a328cba4986edcab, []int{9} } func (m *QueryPacketReceiptResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -492,6 +612,8 @@ func init() { proto.RegisterType((*QueryChannelResponse)(nil), "ibc.core.channel.v2.QueryChannelResponse") proto.RegisterType((*QueryPacketCommitmentRequest)(nil), "ibc.core.channel.v2.QueryPacketCommitmentRequest") proto.RegisterType((*QueryPacketCommitmentResponse)(nil), "ibc.core.channel.v2.QueryPacketCommitmentResponse") + proto.RegisterType((*QueryPacketCommitmentsRequest)(nil), "ibc.core.channel.v2.QueryPacketCommitmentsRequest") + proto.RegisterType((*QueryPacketCommitmentsResponse)(nil), "ibc.core.channel.v2.QueryPacketCommitmentsResponse") proto.RegisterType((*QueryPacketAcknowledgementRequest)(nil), "ibc.core.channel.v2.QueryPacketAcknowledgementRequest") proto.RegisterType((*QueryPacketAcknowledgementResponse)(nil), "ibc.core.channel.v2.QueryPacketAcknowledgementResponse") proto.RegisterType((*QueryPacketReceiptRequest)(nil), "ibc.core.channel.v2.QueryPacketReceiptRequest") @@ -501,48 +623,58 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/query.proto", fileDescriptor_a328cba4986edcab) } var fileDescriptor_a328cba4986edcab = []byte{ - // 654 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x4f, 0xd4, 0x40, - 0x14, 0xde, 0xe1, 0x37, 0x0f, 0x8c, 0x66, 0xc0, 0x88, 0x0d, 0x14, 0xe8, 0x69, 0x35, 0xd2, 0x91, - 0x95, 0x68, 0x4c, 0xb8, 0xc0, 0xc6, 0x08, 0x26, 0x26, 0xd8, 0x18, 0x13, 0x3d, 0x48, 0xba, 0xb3, - 0x63, 0xb7, 0x61, 0xdb, 0x29, 0xed, 0x6c, 0x0d, 0x21, 0x5c, 0xf8, 0x0b, 0x8c, 0xdc, 0xfc, 0x0f, - 0xfc, 0x2b, 0xbc, 0x92, 0x78, 0x21, 0xe1, 0xe2, 0xc9, 0x18, 0xf0, 0x0f, 0x31, 0x9d, 0x0e, 0xbb, - 0xdd, 0x4d, 0x77, 0xd9, 0x35, 0x7a, 0x9b, 0x79, 0xf3, 0xbe, 0xf7, 0xbe, 0xef, 0xa3, 0x1f, 0x0b, - 0x8b, 0x6e, 0x85, 0x12, 0xca, 0x43, 0x46, 0x68, 0xcd, 0xf6, 0x7d, 0x56, 0x27, 0x71, 0x89, 0xec, - 0x37, 0x58, 0x78, 0x60, 0x06, 0x21, 0x17, 0x1c, 0xcf, 0xb8, 0x15, 0x6a, 0x26, 0x0d, 0xa6, 0x6a, - 0x30, 0xe3, 0x92, 0xb6, 0x9c, 0x87, 0xba, 0x7a, 0x97, 0x38, 0x2d, 0x33, 0xb8, 0xee, 0x32, 0x5f, - 0x90, 0x78, 0x55, 0x9d, 0x54, 0xc3, 0xbc, 0xc3, 0xb9, 0x53, 0x67, 0xc4, 0x0e, 0x5c, 0x62, 0xfb, - 0x3e, 0x17, 0xb6, 0x70, 0xb9, 0x1f, 0xa9, 0xd7, 0x59, 0x87, 0x3b, 0x5c, 0x1e, 0x49, 0x72, 0x4a, - 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x71, 0x36, 0xdd, 0x6b, 0x53, 0xf5, 0x0d, - 0xc1, 0x8d, 0xb6, 0x6f, 0x1a, 0x9b, 0xd7, 0xb1, 0x6a, 0x8f, 0x9b, 0x46, 0xfa, 0xee, 0x57, 0xec, - 0x5f, 0x4a, 0xf6, 0xcf, 0xf1, 0xb3, 0xc1, 0xd9, 0x87, 0xe9, 0xa8, 0xac, 0x82, 0xcd, 0x37, 0xa7, - 0x17, 0x3a, 0x3a, 0xbb, 0xd0, 0xd1, 0xaf, 0x0b, 0x1d, 0x7d, 0xba, 0xd4, 0x0b, 0x67, 0x97, 0x7a, - 0xe1, 0xc7, 0xa5, 0x5e, 0x78, 0xb7, 0xee, 0xb8, 0xa2, 0xd6, 0xa8, 0x98, 0x94, 0x7b, 0x84, 0xf2, - 0xc8, 0xe3, 0x51, 0xb2, 0x71, 0xc5, 0xe1, 0x24, 0x7e, 0x4a, 0x3c, 0x5e, 0x6d, 0xd4, 0x59, 0x94, - 0xee, 0x7f, 0xb8, 0xb6, 0x92, 0xa1, 0x20, 0x0e, 0x02, 0x16, 0x55, 0xc6, 0xe4, 0x4f, 0xdf, 0xa3, - 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x39, 0x9c, 0xc7, 0xa2, 0xaa, 0x07, 0x00, 0x00, + // 810 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0x4d, 0x4f, 0x13, 0x5d, + 0x14, 0xc7, 0x7b, 0x29, 0x50, 0x38, 0xe5, 0xc9, 0xf3, 0x3c, 0x17, 0x8c, 0x75, 0x02, 0x43, 0x99, + 0x85, 0x56, 0x22, 0x73, 0xed, 0x40, 0x7c, 0x49, 0x30, 0x06, 0x1a, 0x04, 0x4c, 0x4c, 0x70, 0x34, + 0x26, 0xba, 0x90, 0x4c, 0xa7, 0xd7, 0xe9, 0x84, 0x76, 0xee, 0xd0, 0x99, 0xd6, 0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1f, 0xe5, 0xdf, 0x4c, 0x8b, 0x3f, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x78, 0xf5, 0x4d, 0xe9, 0x32, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -561,6 +693,8 @@ type QueryClient interface { Channel(ctx context.Context, in *QueryChannelRequest, opts ...grpc.CallOption) (*QueryChannelResponse, error) // PacketCommitment queries a stored packet commitment hash. PacketCommitment(ctx context.Context, in *QueryPacketCommitmentRequest, opts ...grpc.CallOption) (*QueryPacketCommitmentResponse, error) + // PacketCommitments queries a stored packet commitment hash. + PacketCommitments(ctx context.Context, in *QueryPacketCommitmentsRequest, opts ...grpc.CallOption) (*QueryPacketCommitmentsResponse, error) // PacketAcknowledgement queries a stored acknowledgement commitment hash. PacketAcknowledgement(ctx context.Context, in *QueryPacketAcknowledgementRequest, opts ...grpc.CallOption) (*QueryPacketAcknowledgementResponse, error) // PacketReceipt queries a stored packet receipt. @@ -593,6 +727,15 @@ func (c *queryClient) PacketCommitment(ctx context.Context, in *QueryPacketCommi return out, nil } +func (c *queryClient) PacketCommitments(ctx context.Context, in *QueryPacketCommitmentsRequest, opts ...grpc.CallOption) (*QueryPacketCommitmentsResponse, error) { + out := new(QueryPacketCommitmentsResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/PacketCommitments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) PacketAcknowledgement(ctx context.Context, in *QueryPacketAcknowledgementRequest, opts ...grpc.CallOption) (*QueryPacketAcknowledgementResponse, error) { out := new(QueryPacketAcknowledgementResponse) err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/PacketAcknowledgement", in, out, opts...) @@ -617,6 +760,8 @@ type QueryServer interface { Channel(context.Context, *QueryChannelRequest) (*QueryChannelResponse, error) // PacketCommitment queries a stored packet commitment hash. PacketCommitment(context.Context, *QueryPacketCommitmentRequest) (*QueryPacketCommitmentResponse, error) + // PacketCommitments queries a stored packet commitment hash. + PacketCommitments(context.Context, *QueryPacketCommitmentsRequest) (*QueryPacketCommitmentsResponse, error) // PacketAcknowledgement queries a stored acknowledgement commitment hash. PacketAcknowledgement(context.Context, *QueryPacketAcknowledgementRequest) (*QueryPacketAcknowledgementResponse, error) // PacketReceipt queries a stored packet receipt. @@ -633,6 +778,9 @@ func (*UnimplementedQueryServer) Channel(ctx context.Context, req *QueryChannelR func (*UnimplementedQueryServer) PacketCommitment(ctx context.Context, req *QueryPacketCommitmentRequest) (*QueryPacketCommitmentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PacketCommitment not implemented") } +func (*UnimplementedQueryServer) PacketCommitments(ctx context.Context, req *QueryPacketCommitmentsRequest) (*QueryPacketCommitmentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PacketCommitments not implemented") +} func (*UnimplementedQueryServer) PacketAcknowledgement(ctx context.Context, req *QueryPacketAcknowledgementRequest) (*QueryPacketAcknowledgementResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PacketAcknowledgement not implemented") } @@ -680,6 +828,24 @@ func _Query_PacketCommitment_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_PacketCommitments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPacketCommitmentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PacketCommitments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v2.Query/PacketCommitments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PacketCommitments(ctx, req.(*QueryPacketCommitmentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_PacketAcknowledgement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryPacketAcknowledgementRequest) if err := dec(in); err != nil { @@ -728,6 +894,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PacketCommitment", Handler: _Query_PacketCommitment_Handler, }, + { + MethodName: "PacketCommitments", + Handler: _Query_PacketCommitments_Handler, + }, { MethodName: "PacketAcknowledgement", Handler: _Query_PacketAcknowledgement_Handler, @@ -886,6 +1056,107 @@ func (m *QueryPacketCommitmentResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryPacketCommitmentsRequest) 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 *QueryPacketCommitmentsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPacketCommitmentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryPacketCommitmentsResponse) 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 *QueryPacketCommitmentsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPacketCommitmentsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Height.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Commitments) > 0 { + for iNdEx := len(m.Commitments) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Commitments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryPacketAcknowledgementRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1130,6 +1401,44 @@ func (m *QueryPacketCommitmentResponse) Size() (n int) { return n } +func (m *QueryPacketCommitmentsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryPacketCommitmentsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Commitments) > 0 { + for _, e := range m.Commitments { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + l = m.Height.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryPacketAcknowledgementRequest) Size() (n int) { if m == nil { return 0 @@ -1626,6 +1935,277 @@ func (m *QueryPacketCommitmentResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryPacketCommitmentsRequest) 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 ErrIntOverflowQuery + } + 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: QueryPacketCommitmentsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPacketCommitmentsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPacketCommitmentsResponse) 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 ErrIntOverflowQuery + } + 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: QueryPacketCommitmentsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPacketCommitmentsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commitments", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Commitments = append(m.Commitments, &PacketState{}) + if err := m.Commitments[len(m.Commitments)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Height.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryPacketAcknowledgementRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/04-channel/v2/types/query.pb.gw.go b/modules/core/04-channel/v2/types/query.pb.gw.go index 5a274f65b17..07dbf642b72 100644 --- a/modules/core/04-channel/v2/types/query.pb.gw.go +++ b/modules/core/04-channel/v2/types/query.pb.gw.go @@ -163,6 +163,78 @@ func local_request_Query_PacketCommitment_0(ctx context.Context, marshaler runti } +var ( + filter_Query_PacketCommitments_0 = &utilities.DoubleArray{Encoding: map[string]int{"channel_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_PacketCommitments_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPacketCommitmentsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PacketCommitments_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.PacketCommitments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_PacketCommitments_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPacketCommitmentsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PacketCommitments_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.PacketCommitments(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_PacketAcknowledgement_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryPacketAcknowledgementRequest var metadata runtime.ServerMetadata @@ -385,6 +457,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_PacketCommitments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_PacketCommitments_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_PacketCommitments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_PacketAcknowledgement_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -512,6 +607,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_PacketCommitments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_PacketCommitments_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_PacketCommitments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_PacketAcknowledgement_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -560,6 +675,8 @@ var ( pattern_Query_PacketCommitment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_commitments", "sequence"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_PacketCommitments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_commitments"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_PacketAcknowledgement_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_acks", "sequence"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PacketReceipt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_receipts", "sequence"}, "", runtime.AssumeColonVerbOpt(false))) @@ -570,6 +687,8 @@ var ( forward_Query_PacketCommitment_0 = runtime.ForwardResponseMessage + forward_Query_PacketCommitments_0 = runtime.ForwardResponseMessage + forward_Query_PacketAcknowledgement_0 = runtime.ForwardResponseMessage forward_Query_PacketReceipt_0 = runtime.ForwardResponseMessage diff --git a/modules/core/24-host/v2/packet_keys.go b/modules/core/24-host/v2/packet_keys.go index a556df4de38..b7c540b2abd 100644 --- a/modules/core/24-host/v2/packet_keys.go +++ b/modules/core/24-host/v2/packet_keys.go @@ -17,6 +17,11 @@ func PacketAcknowledgementKey(channelID string, sequence uint64) []byte { return []byte(fmt.Sprintf("acks/channels/%s/sequences/%s", channelID, sdk.Uint64ToBigEndian(sequence))) } +// PacketCommitmentPrefixKey returns the store key prefix under which packet commitments for a particular channel are stored. +func PacketCommitmentPrefixKey(channelID string) []byte { + return []byte(fmt.Sprintf("commitments/channels/%s", channelID)) +} + // PacketCommitmentKey returns the store key of under which a packet commitment is stored. func PacketCommitmentKey(channelID string, sequence uint64) []byte { return []byte(fmt.Sprintf("commitments/channels/%s/sequences/%s", channelID, sdk.Uint64ToBigEndian(sequence))) diff --git a/proto/ibc/core/channel/v2/query.proto b/proto/ibc/core/channel/v2/query.proto index 6d731385164..00b60fd6891 100644 --- a/proto/ibc/core/channel/v2/query.proto +++ b/proto/ibc/core/channel/v2/query.proto @@ -4,7 +4,9 @@ package ibc.core.channel.v2; option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types"; +import "cosmos/base/query/v1beta1/pagination.proto"; import "ibc/core/channel/v2/channel.proto"; +import "ibc/core/channel/v2/genesis.proto"; import "ibc/core/client/v1/client.proto"; import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; @@ -21,6 +23,11 @@ service Query { option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/packet_commitments/{sequence}"; } + // PacketCommitments queries a stored packet commitment hash. + rpc PacketCommitments(QueryPacketCommitmentsRequest) returns (QueryPacketCommitmentsResponse) { + option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/packet_commitments"; + } + // PacketAcknowledgement queries a stored acknowledgement commitment hash. rpc PacketAcknowledgement(QueryPacketAcknowledgementRequest) returns (QueryPacketAcknowledgementResponse) { option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/packet_acks/{sequence}"; @@ -61,6 +68,24 @@ message QueryPacketCommitmentResponse { ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; } +// QueryPacketCommitmentsRequest is the request type for the Query/PacketCommitments RPC method. +message QueryPacketCommitmentsRequest { + // channel unique identifier + string channel_id = 1; + // pagination request + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryPacketCommitmentResponse is the response type for the Query/PacketCommitment RPC method. +message QueryPacketCommitmentsResponse { + // collection of packet commitments for the requested channel identifier. + repeated ibc.core.channel.v2.PacketState commitments = 1; + // pagination response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; + // query block height. + ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; +} + // QueryPacketAcknowledgementRequest is the request type for the Query/PacketAcknowledgement RPC method. message QueryPacketAcknowledgementRequest { // channel unique identifier From 86f5e24511cb4087ee7c5157c4a2b3f8ba176f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 11 Nov 2024 13:17:24 +0100 Subject: [PATCH 08/23] refactor: remove simd from callbacks module (#7506) * refactor: remove callbacks simd * chore: remove callbacks docker build workflow * e2e: go mod tidy * chore: undo unintentional changes --------- Co-authored-by: DimitrisJim --- .../build-callbacks-simd-image-from-tag.yml | 35 -- modules/apps/callbacks/Dockerfile | 27 -- modules/apps/callbacks/go.mod | 15 +- modules/apps/callbacks/go.sum | 14 - .../callbacks/testing/simapp/ante_handler.go | 6 +- modules/apps/callbacks/testing/simapp/app.go | 117 +----- .../apps/callbacks/testing/simapp/export.go | 3 - .../callbacks/testing/simapp/simd/cmd/root.go | 342 ------------------ .../callbacks/testing/simapp/simd/main.go | 20 - 9 files changed, 13 insertions(+), 566 deletions(-) delete mode 100644 .github/workflows/build-callbacks-simd-image-from-tag.yml delete mode 100644 modules/apps/callbacks/Dockerfile delete mode 100644 modules/apps/callbacks/testing/simapp/simd/cmd/root.go delete mode 100644 modules/apps/callbacks/testing/simapp/simd/main.go diff --git a/.github/workflows/build-callbacks-simd-image-from-tag.yml b/.github/workflows/build-callbacks-simd-image-from-tag.yml deleted file mode 100644 index 75b96933603..00000000000 --- a/.github/workflows/build-callbacks-simd-image-from-tag.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build Callbacks Simd Image -on: - workflow_dispatch: - inputs: - tag: - description: 'The tag of the image to build' - required: true - type: string - -env: - REGISTRY: ghcr.io - ORG: cosmos - IMAGE_NAME: ibc-go-callbacks-simd - GIT_TAG: "${{ inputs.tag }}" - -jobs: - build-image-at-tag: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: "${{ env.GIT_TAG }}" - fetch-depth: 0 - - name: Log in to the Container registry - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build image - run: | - # remove any `/` characters from the docker tag and replace them with a - - docker_tag="$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9\.]/-/g')" - docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f modules/apps/callbacks/Dockerfile - docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" diff --git a/modules/apps/callbacks/Dockerfile b/modules/apps/callbacks/Dockerfile deleted file mode 100644 index c209fa95ae1..00000000000 --- a/modules/apps/callbacks/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM golang:1.22-alpine3.20 as builder - -RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make; - -ENV GOPATH="" - -# Copy relevant files before go mod download. Replace directives to local paths break if local -# files are not copied before go mod download. -ADD internal internal -ADD testing testing -ADD modules modules -ADD LICENSE LICENSE - -COPY go.mod . -COPY go.sum . - -WORKDIR modules/apps/callbacks - -RUN go mod download - -RUN GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false go build -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger," -w -s' -trimpath -o /go/build/ ./... - -FROM alpine:3.18 - -COPY --from=builder /go/build/simd /bin/simd - -ENTRYPOINT ["simd"] diff --git a/modules/apps/callbacks/go.mod b/modules/apps/callbacks/go.mod index 7116e4df6b9..f46ef15e693 100644 --- a/modules/apps/callbacks/go.mod +++ b/modules/apps/callbacks/go.mod @@ -9,17 +9,10 @@ replace github.com/cosmos/ibc-go/v9 => ../../../ replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 require ( - cosmossdk.io/api v0.7.6 - cosmossdk.io/client/v2 v2.0.0-beta.5 - cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1 - cosmossdk.io/tools/confix v0.1.2 - cosmossdk.io/x/circuit v0.1.1 - cosmossdk.io/x/evidence v0.1.1 - cosmossdk.io/x/feegrant v0.1.1 cosmossdk.io/x/tx v0.13.5 cosmossdk.io/x/upgrade v0.1.4 github.com/cometbft/cometbft v0.38.15 @@ -28,8 +21,6 @@ require ( github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/v9 v9.0.0 github.com/spf13/cast v1.7.0 - github.com/spf13/cobra v1.8.1 - github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 ) @@ -40,7 +31,9 @@ require ( cloud.google.com/go/compute/metadata v0.5.0 // indirect cloud.google.com/go/iam v1.1.9 // indirect cloud.google.com/go/storage v1.41.0 // indirect + cosmossdk.io/api v0.7.6 // indirect cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/core v0.11.1 // indirect cosmossdk.io/depinject v1.0.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -71,8 +64,6 @@ require ( github.com/cosmos/iavl v1.2.0 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect - github.com/creachadair/atomicfile v0.3.1 // indirect - github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect @@ -166,7 +157,9 @@ require ( github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.19.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect diff --git a/modules/apps/callbacks/go.sum b/modules/apps/callbacks/go.sum index 3093129c229..d494177cfda 100644 --- a/modules/apps/callbacks/go.sum +++ b/modules/apps/callbacks/go.sum @@ -188,8 +188,6 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.5 h1:0LVv3nEByn//hFDIrYLs2WvsEU3HodOelh4SDHnA/1I= -cosmossdk.io/client/v2 v2.0.0-beta.5/go.mod h1:4p0P6o0ro+FizakJUYS9SeM94RNbv0thLmkHRw5o5as= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= @@ -204,14 +202,6 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= -cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= -cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= -cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= -cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= -cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= -cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= -cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= -cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= @@ -366,10 +356,6 @@ github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5n github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= -github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= -github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= -github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= diff --git a/modules/apps/callbacks/testing/simapp/ante_handler.go b/modules/apps/callbacks/testing/simapp/ante_handler.go index 58603401edf..f1c4cb8207a 100644 --- a/modules/apps/callbacks/testing/simapp/ante_handler.go +++ b/modules/apps/callbacks/testing/simapp/ante_handler.go @@ -3,8 +3,6 @@ package simapp import ( "errors" - circuitante "cosmossdk.io/x/circuit/ante" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -15,8 +13,7 @@ import ( // HandlerOptions are the options required for constructing a default SDK AnteHandler. type HandlerOptions struct { ante.HandlerOptions - CircuitKeeper circuitante.CircuitBreaker - IBCKeeper *keeper.Keeper + IBCKeeper *keeper.Keeper } // NewAnteHandler returns an AnteHandler that checks and increments sequence @@ -37,7 +34,6 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { anteDecorators := []sdk.AnteDecorator{ ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first - circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper), ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), diff --git a/modules/apps/callbacks/testing/simapp/app.go b/modules/apps/callbacks/testing/simapp/app.go index d73bcbcb648..35484d4313f 100644 --- a/modules/apps/callbacks/testing/simapp/app.go +++ b/modules/apps/callbacks/testing/simapp/app.go @@ -11,21 +11,8 @@ import ( "github.com/cosmos/gogoproto/proto" "github.com/spf13/cast" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - "cosmossdk.io/client/v2/autocli" - "cosmossdk.io/core/appmodule" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/circuit" - circuitkeeper "cosmossdk.io/x/circuit/keeper" - circuittypes "cosmossdk.io/x/circuit/types" - "cosmossdk.io/x/evidence" - evidencekeeper "cosmossdk.io/x/evidence/keeper" - evidencetypes "cosmossdk.io/x/evidence/types" - "cosmossdk.io/x/feegrant" - feegrantkeeper "cosmossdk.io/x/feegrant/keeper" - feegrantmodule "cosmossdk.io/x/feegrant/module" "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/upgrade" upgradekeeper "cosmossdk.io/x/upgrade/keeper" @@ -40,7 +27,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" - runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" @@ -61,18 +47,12 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/authz" - authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" - authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -82,9 +62,6 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/group" - groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" - groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -179,20 +156,14 @@ type SimApp struct { MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper - CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper - AuthzKeeper authzkeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly IBCFeeKeeper ibcfeekeeper.Keeper ICAControllerKeeper icacontrollerkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper - EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper - CircuitKeeper circuitkeeper.Keeper // mock contract keeper used for testing MockContractKeeper *ContractKeeper @@ -282,11 +253,11 @@ func NewSimApp( bApp.SetTxEncoder(txConfig.TxEncoder()) keys := storetypes.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, crisistypes.StoreKey, + authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, group.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, - evidencetypes.StoreKey, ibctransfertypes.StoreKey, icacontrollertypes.StoreKey, icahosttypes.StoreKey, - authzkeeper.StoreKey, ibcfeetypes.StoreKey, consensusparamtypes.StoreKey, circuittypes.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey, + ibctransfertypes.StoreKey, icacontrollertypes.StoreKey, icahosttypes.StoreKey, + ibcfeetypes.StoreKey, consensusparamtypes.StoreKey, ) // register streaming services @@ -338,30 +309,12 @@ func NewSimApp( appCodec, legacyAmino, runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), app.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)) - app.CrisisKeeper = crisiskeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[crisistypes.StoreKey]), invCheckPeriod, - app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AccountKeeper.AddressCodec()) - - app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[feegrant.StoreKey]), app.AccountKeeper) - // register the staking hooks // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks app.StakingKeeper.SetHooks( stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), ) - app.CircuitKeeper = circuitkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[circuittypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AccountKeeper.AddressCodec()) - app.BaseApp.SetCircuitBreaker(&app.CircuitKeeper) - - app.AuthzKeeper = authzkeeper.NewKeeper(runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), appCodec, app.MsgServiceRouter(), app.AccountKeeper) - - groupConfig := group.DefaultConfig() - /* - Example of setting group params: - groupConfig.MaxMetadataLen = 1000 - */ - app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper, groupConfig) - // get skipUpgradeHeights from the app options skipUpgradeHeights := map[int64]bool{} for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { @@ -541,19 +494,8 @@ func NewSimApp( smLightClientModule := solomachine.NewLightClientModule(appCodec, storeProvider) clientKeeper.AddRoute(solomachine.ModuleName, &smLightClientModule) - // create evidence keeper with router - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), app.StakingKeeper, app.SlashingKeeper, app.AccountKeeper.AddressCodec(), runtime.ProvideCometInfoService(), - ) - // If evidence needs to be handled for the app, set routes in router here and seal - app.EvidenceKeeper = *evidenceKeeper - // **** Module Options **** - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - // NOTE: Any module instantiated in the module manager that is later modified // must be passed by reference here. app.ModuleManager = module.NewManager( @@ -564,20 +506,14 @@ func NewSimApp( auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), - crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), - evidence.NewAppModule(app.EvidenceKeeper), params.NewAppModule(app.ParamsKeeper), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), - circuit.NewAppModule(appCodec, app.CircuitKeeper), // IBC modules ibc.NewAppModule(app.IBCKeeper), @@ -621,28 +557,23 @@ func NewSimApp( minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, - evidencetypes.ModuleName, stakingtypes.ModuleName, ibcexported.ModuleName, ibctransfertypes.ModuleName, genutiltypes.ModuleName, - authz.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, ) app.ModuleManager.SetOrderEndBlockers( - crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, ibcexported.ModuleName, ibctransfertypes.ModuleName, genutiltypes.ModuleName, - feegrant.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, - group.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -651,10 +582,10 @@ func NewSimApp( genesisModuleOrder := []string{ authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, - slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, - ibcexported.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, ibctransfertypes.ModuleName, - icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, - vestingtypes.ModuleName, group.ModuleName, consensusparamtypes.ModuleName, circuittypes.ModuleName, + slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, + ibcexported.ModuleName, genutiltypes.ModuleName, ibctransfertypes.ModuleName, + icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, + vestingtypes.ModuleName, consensusparamtypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) @@ -662,21 +593,12 @@ func NewSimApp( // Uncomment if you want to set a custom migration order here. // app.ModuleManager.SetOrderMigrations(custom order) - app.ModuleManager.RegisterInvariants(app.CrisisKeeper) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) err := app.ModuleManager.RegisterServices(app.configurator) if err != nil { panic(err) } - autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.ModuleManager.Modules)) - - reflectionSvc, err := runtimeservices.NewReflectionService() - if err != nil { - panic(err) - } - reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) - // add test gRPC service for testing gRPC queries in isolation testpb.RegisterQueryServer(app.GRPCQueryRouter(), testpb.QueryImpl{}) @@ -755,10 +677,8 @@ func (app *SimApp) setAnteHandler(txConfig client.TxConfig) { AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper, SignModeHandler: txConfig.SignModeHandler(), - FeegrantKeeper: app.FeeGrantKeeper, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, - &app.CircuitKeeper, app.IBCKeeper, }, ) @@ -847,27 +767,6 @@ func (app *SimApp) TxConfig() client.TxConfig { return app.txConfig } -// AutoCliOpts returns the autocli options for the app. -func (app *SimApp) AutoCliOpts() autocli.AppOptions { - modules := make(map[string]appmodule.AppModule, 0) - for _, m := range app.ModuleManager.Modules { - if moduleWithName, ok := m.(module.HasName); ok { - moduleName := moduleWithName.Name() - if appModule, ok := moduleWithName.(appmodule.AppModule); ok { - modules[moduleName] = appModule - } - } - } - - return autocli.AppOptions{ - Modules: modules, - ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules), - AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), - ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), - ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), - } -} - // DefaultGenesis returns a default genesis from the registered AppModuleBasic's. func (app *SimApp) DefaultGenesis() map[string]json.RawMessage { return app.BasicModuleManager.DefaultGenesis(app.appCodec) diff --git a/modules/apps/callbacks/testing/simapp/export.go b/modules/apps/callbacks/testing/simapp/export.go index 375a9a642fc..19460073b45 100644 --- a/modules/apps/callbacks/testing/simapp/export.go +++ b/modules/apps/callbacks/testing/simapp/export.go @@ -69,9 +69,6 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] allowedAddrsMap[addr] = true } - /* Just to be safe, assert the invariants on current state. */ - app.CrisisKeeper.AssertInvariants(ctx) - /* Handle fee distribution state. */ // withdraw all validator commission diff --git a/modules/apps/callbacks/testing/simapp/simd/cmd/root.go b/modules/apps/callbacks/testing/simapp/simd/cmd/root.go deleted file mode 100644 index 2b214f78ea7..00000000000 --- a/modules/apps/callbacks/testing/simapp/simd/cmd/root.go +++ /dev/null @@ -1,342 +0,0 @@ -package cmd - -import ( - "errors" - "io" - "os" - - dbm "github.com/cosmos/cosmos-db" - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "cosmossdk.io/log" - confixcmd "cosmossdk.io/tools/confix/cmd" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/config" - "github.com/cosmos/cosmos-sdk/client/debug" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/keys" - "github.com/cosmos/cosmos-sdk/client/pruning" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/client/snapshot" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/server" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/types/tx/signing" - authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/tx" - txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" - "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - - cmtcfg "github.com/cometbft/cometbft/config" - - "github.com/cosmos/ibc-go/modules/apps/callbacks/testing/simapp" - "github.com/cosmos/ibc-go/modules/apps/callbacks/testing/simapp/params" -) - -// NewRootCmd creates a new root command for simd. It is called once in the -// main function. -func NewRootCmd() *cobra.Command { - // we "pre"-instantiate the application for getting the injected/configured encoding configuration - // note, this is not necessary when using app wiring, as depinject can be directly used (see root_v2.go) - tempApp := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(tempDir())) - encodingConfig := params.EncodingConfig{ - InterfaceRegistry: tempApp.InterfaceRegistry(), - Codec: tempApp.AppCodec(), - TxConfig: tempApp.TxConfig(), - Amino: tempApp.LegacyAmino(), - } - - initClientCtx := client.Context{}. - WithCodec(encodingConfig.Codec). - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithLegacyAmino(encodingConfig.Amino). - WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). - WithHomeDir(simapp.DefaultNodeHome). - WithViper("") // In simapp, we don't use any prefix for env variables. - - rootCmd := &cobra.Command{ - Use: "simd", - Short: "simulation app", - SilenceErrors: true, - PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - // set the default command outputs - cmd.SetOut(cmd.OutOrStdout()) - cmd.SetErr(cmd.ErrOrStderr()) - - initClientCtx = initClientCtx.WithCmdContext(cmd.Context()) - initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) - if err != nil { - return err - } - - initClientCtx, err = config.ReadFromClientConfig(initClientCtx) - if err != nil { - return err - } - - // This needs to go after ReadFromClientConfig, as that function - // sets the RPC client needed for SIGN_MODE_TEXTUAL. - enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) //nolint:gocritic // we know we aren't appending to the same slice - txConfigOpts := tx.ConfigOptions{ - EnabledSignModes: enabledSignModes, - TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), - } - txConfigWithTextual, err := tx.NewTxConfigWithOptions( - codec.NewProtoCodec(encodingConfig.InterfaceRegistry), - txConfigOpts, - ) - if err != nil { - return err - } - initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual) - - if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { - return err - } - - customAppTemplate, customAppConfig := initAppConfig() - customCMTConfig := initCometBFTConfig() - - return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCMTConfig) - }, - } - - initRootCmd(rootCmd, encodingConfig, tempApp.BasicModuleManager) - - if err := tempApp.AutoCliOpts().EnhanceRootCommand(rootCmd); err != nil { - panic(err) - } - - return rootCmd -} - -// initCometBFTConfig helps to override default CometBFT Config values. -// return cmtcfg.DefaultConfig if no custom configuration is required for the application. -func initCometBFTConfig() *cmtcfg.Config { - cfg := cmtcfg.DefaultConfig() - - // these values put a higher strain on node memory - // cfg.P2P.MaxNumInboundPeers = 100 - // cfg.P2P.MaxNumOutboundPeers = 40 - - return cfg -} - -// initAppConfig helps to override default appConfig template and configs. -// return "", nil if no custom configuration is required for the application. -func initAppConfig() (string, interface{}) { - // The following code snippet is just for reference. - - // WASMConfig defines configuration for the wasm module. - type WASMConfig struct { - // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries - QueryGasLimit uint64 `mapstructure:"query_gas_limit"` - - // Address defines the gRPC-web server to listen on - LruSize uint64 `mapstructure:"lru_size"` - } - - type CustomAppConfig struct { - serverconfig.Config - - WASM WASMConfig `mapstructure:"wasm"` - } - - // Optionally allow the chain developer to overwrite the SDK's default - // server config. - srvCfg := serverconfig.DefaultConfig() - // The SDK's default minimum gas price is set to "" (empty value) inside - // app.toml. If left empty by validators, the node will halt on startup. - // However, the chain developer can set a default app.toml value for their - // validators here. - // - // In summary: - // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their - // own app.toml config, - // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their - // own app.toml to override, or use this default value. - // - // In simapp, we set the min gas prices to 0. - srvCfg.MinGasPrices = "0stake" - // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default - - customAppConfig := CustomAppConfig{ - Config: *srvCfg, - WASM: WASMConfig{ - LruSize: 1, - QueryGasLimit: 300000, - }, - } - - customAppTemplate := serverconfig.DefaultConfigTemplate + ` -[wasm] -# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries -query_gas_limit = 300000 -# This is the number of wasm vm instances we keep cached in memory for speed-up -# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0` - - return customAppTemplate, customAppConfig -} - -func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig, basicManager module.BasicManager) { - cfg := sdk.GetConfig() - cfg.Seal() - - rootCmd.AddCommand( - genutilcli.InitCmd(basicManager, simapp.DefaultNodeHome), - debug.Cmd(), - confixcmd.ConfigCommand(), - pruning.Cmd(newApp, simapp.DefaultNodeHome), - snapshot.Cmd(newApp), - server.QueryBlockResultsCmd(), - ) - - server.AddCommands(rootCmd, simapp.DefaultNodeHome, newApp, appExport, addModuleInitFlags) - - // add keybase, auxiliary RPC, query, genesis, and tx child commands - rootCmd.AddCommand( - server.StatusCommand(), - genesisCommand(encodingConfig, basicManager), - txCommand(), - queryCommand(), - keys.Commands(), - ) -} - -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) -} - -func queryCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "query", - Aliases: []string{"q"}, - Short: "Querying subcommands", - DisableFlagParsing: false, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - rpc.ValidatorCommand(), - server.QueryBlockCmd(), - authcmd.QueryTxsByEventsCmd(), - server.QueryBlocksCmd(), - authcmd.QueryTxCmd(), - authcmd.GetSimulateCmd(), - ) - - return cmd -} - -func txCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "tx", - Short: "Transactions subcommands", - DisableFlagParsing: false, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetSignCommand(), - authcmd.GetSignBatchCommand(), - authcmd.GetMultiSignCommand(), - authcmd.GetMultiSignBatchCmd(), - authcmd.GetValidateSignaturesCommand(), - authcmd.GetBroadcastCommand(), - authcmd.GetEncodeCommand(), - authcmd.GetDecodeCommand(), - authcmd.GetSimulateCmd(), - ) - - return cmd -} - -// genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter -func genesisCommand(encodingConfig params.EncodingConfig, basicManager module.BasicManager, cmds ...*cobra.Command) *cobra.Command { - cmd := genutilcli.Commands(encodingConfig.TxConfig, basicManager, simapp.DefaultNodeHome) - - for _, subCmd := range cmds { - cmd.AddCommand(subCmd) - } - return cmd -} - -// newApp creates the application -func newApp( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - appOpts servertypes.AppOptions, -) servertypes.Application { - baseappOptions := server.DefaultBaseappOptions(appOpts) - - return simapp.NewSimApp( - logger, db, traceStore, true, - appOpts, - baseappOptions..., - ) -} - -// appExport creates a new simapp (optionally at a given height) and exports state. -func appExport( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - height int64, - forZeroHeight bool, - jailAllowedAddrs []string, - appOpts servertypes.AppOptions, - modulesToExport []string, -) (servertypes.ExportedApp, error) { - var simApp *simapp.SimApp - - // this check is necessary as we use the flag in x/upgrade. - // we can exit more gracefully by checking the flag here. - homePath, ok := appOpts.Get(flags.FlagHome).(string) - if !ok || homePath == "" { - return servertypes.ExportedApp{}, errors.New("application home not set") - } - - viperAppOpts, ok := appOpts.(*viper.Viper) - if !ok { - return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") - } - - // overwrite the FlagInvCheckPeriod - viperAppOpts.Set(server.FlagInvCheckPeriod, 1) - appOpts = viperAppOpts - - if height != -1 { - simApp = simapp.NewSimApp(logger, db, traceStore, false, appOpts) - - if err := simApp.LoadHeight(height); err != nil { - return servertypes.ExportedApp{}, err - } - } else { - simApp = simapp.NewSimApp(logger, db, traceStore, true, appOpts) - } - - return simApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) -} - -var tempDir = func() string { - dir, err := os.MkdirTemp("", "simapp") - if err != nil { - dir = simapp.DefaultNodeHome - } - defer os.RemoveAll(dir) - - return dir -} diff --git a/modules/apps/callbacks/testing/simapp/simd/main.go b/modules/apps/callbacks/testing/simapp/simd/main.go deleted file mode 100644 index 61e9d7c2180..00000000000 --- a/modules/apps/callbacks/testing/simapp/simd/main.go +++ /dev/null @@ -1,20 +0,0 @@ -package main - -import ( - "os" - - "cosmossdk.io/log" - - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - - "github.com/cosmos/ibc-go/modules/apps/callbacks/testing/simapp" - "github.com/cosmos/ibc-go/modules/apps/callbacks/testing/simapp/simd/cmd" -) - -func main() { - rootCmd := cmd.NewRootCmd() - if err := svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome); err != nil { - log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) - os.Exit(1) - } -} From c6d60da4d3ac515289f0be1fa769b6045a9beebe Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Mon, 11 Nov 2024 15:04:23 +0200 Subject: [PATCH 09/23] bug: init receipts in new genesis state function. (#7542) --- .golangci.yml | 1 - modules/core/04-channel/types/genesis.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index dc20f7102ee..99a7c1eadf8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,6 @@ run: linters: disable-all: true enable: - - copyloopvar - errcheck - gci - goconst diff --git a/modules/core/04-channel/types/genesis.go b/modules/core/04-channel/types/genesis.go index 575a0423331..c038b0fefb5 100644 --- a/modules/core/04-channel/types/genesis.go +++ b/modules/core/04-channel/types/genesis.go @@ -50,6 +50,7 @@ func NewGenesisState( return GenesisState{ Channels: channels, Acknowledgements: acks, + Receipts: receipts, Commitments: commitments, SendSequences: sendSeqs, RecvSequences: recvSeqs, From 02960e9ee204116583963251ca03f7d015c68c92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:49:08 +0200 Subject: [PATCH 10/23] chore(deps): bump JamesIves/github-pages-deploy-action (#7548) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.8 to 4.6.9. - [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases) - [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.6.8...v4.6.9) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 24226ac5c7a..fd8d516afa1 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -27,7 +27,7 @@ jobs: run: make build-docs - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.6.8 + uses: JamesIves/github-pages-deploy-action@v4.6.9 with: branch: gh-pages folder: docs/build From b176e454d42b376c8f1131f0c46168ec2de9149a Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Mon, 11 Nov 2024 15:59:15 +0200 Subject: [PATCH 11/23] chore: revert re-ordering for v1 channel msg. --- modules/core/04-channel/types/tx.pb.go | 298 ++++++++++++------------- proto/ibc/core/channel/v1/tx.proto | 6 +- 2 files changed, 152 insertions(+), 152 deletions(-) diff --git a/modules/core/04-channel/types/tx.pb.go b/modules/core/04-channel/types/tx.pb.go index a6d96fb510f..71157b18e4b 100644 --- a/modules/core/04-channel/types/tx.pb.go +++ b/modules/core/04-channel/types/tx.pb.go @@ -1675,131 +1675,131 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/tx.proto", fileDescriptor_bc4637e0ac3fc7b7) } var fileDescriptor_bc4637e0ac3fc7b7 = []byte{ - // 1972 bytes of a gzipped FileDescriptorProto + // 1975 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcf, 0x6f, 0xdb, 0xc8, - 0x15, 0x36, 0xf5, 0x33, 0x7e, 0x4e, 0xd6, 0x0a, 0xe5, 0xc4, 0x32, 0x6d, 0x4b, 0x8a, 0x5a, 0x34, - 0x5e, 0x37, 0x91, 0xd6, 0xde, 0xa4, 0x40, 0x82, 0x05, 0x5a, 0x47, 0x55, 0xba, 0x06, 0xe2, 0xd8, - 0xa0, 0xac, 0xa2, 0xdd, 0x2d, 0x2a, 0xc8, 0xd4, 0x84, 0x22, 0x24, 0x91, 0x5c, 0x92, 0xd2, 0xae, - 0x0b, 0xb4, 0x58, 0xf4, 0x14, 0xe4, 0xb0, 0x68, 0x81, 0xbd, 0x06, 0x68, 0xd1, 0x7f, 0x60, 0xcf, - 0xfd, 0x71, 0xe8, 0x6d, 0x4f, 0xc5, 0x1e, 0x17, 0x05, 0xba, 0x28, 0x92, 0x43, 0x2e, 0xfd, 0x0b, - 0x0a, 0x14, 0x28, 0x38, 0x33, 0xa4, 0x28, 0x72, 0x28, 0x51, 0x96, 0x6a, 0xf4, 0x26, 0xce, 0x7c, - 0xf3, 0xde, 0xcc, 0xf7, 0xbd, 0x79, 0x9c, 0x37, 0x14, 0x6c, 0x29, 0x67, 0x52, 0x45, 0xd2, 0x0c, - 0x54, 0x91, 0x3a, 0x2d, 0x55, 0x45, 0xbd, 0xca, 0x70, 0xaf, 0x62, 0x7d, 0x52, 0xd6, 0x0d, 0xcd, - 0xd2, 0xf8, 0xac, 0x72, 0x26, 0x95, 0xed, 0xde, 0x32, 0xed, 0x2d, 0x0f, 0xf7, 0x84, 0x35, 0x59, - 0x93, 0x35, 0xdc, 0x5f, 0xb1, 0x7f, 0x11, 0xa8, 0xb0, 0x2e, 0x69, 0x66, 0x5f, 0x33, 0x2b, 0x7d, - 0x53, 0xb6, 0x4d, 0xf4, 0x4d, 0x99, 0x76, 0x14, 0x46, 0x1e, 0x7a, 0x0a, 0x52, 0x2d, 0xbb, 0x97, - 0xfc, 0xa2, 0x80, 0x5b, 0xac, 0x29, 0x38, 0xfe, 0x26, 0x40, 0x06, 0xba, 0x6c, 0xb4, 0xda, 0x88, - 0x40, 0x4a, 0x9f, 0x73, 0xc0, 0x1f, 0x99, 0x72, 0x95, 0xf4, 0x1f, 0xeb, 0x48, 0x3d, 0x54, 0x15, - 0x8b, 0x5f, 0x87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0xd0, 0x77, 0x52, 0xd3, 0x44, 0x1f, 0x0d, 0x90, 0x2a, - 0x21, 0x1c, 0xff, 0x09, 0x71, 0xd3, 0x0b, 0x6a, 0x10, 0x4c, 0x9d, 0x42, 0x82, 0x14, 0x16, 0x21, - 0xcf, 0xa6, 0xc8, 0x65, 0xf1, 0x35, 0x07, 0xd7, 0x8e, 0x4c, 0x59, 0x44, 0xd2, 0xf0, 0xa4, 0x25, - 0x75, 0x91, 0xc5, 0x3f, 0x80, 0x94, 0x8e, 0x7f, 0x61, 0xee, 0x56, 0xf6, 0x37, 0x99, 0x69, 0x9a, - 0x80, 0xe9, 0x02, 0xe9, 0x00, 0xfe, 0x6d, 0xc8, 0x10, 0x82, 0x24, 0xad, 0xdf, 0x57, 0xac, 0x3e, - 0x52, 0x2d, 0x4c, 0xf2, 0x55, 0x71, 0x15, 0xb7, 0x57, 0xdd, 0xe6, 0x00, 0x97, 0xf1, 0xf9, 0xb8, - 0x4c, 0x4c, 0x0e, 0xa5, 0x9f, 0xe3, 0xfd, 0x3b, 0x5a, 0xa4, 0x9b, 0x79, 0xbf, 0x0f, 0x29, 0x03, - 0x99, 0x83, 0x1e, 0x59, 0xec, 0x5b, 0xfb, 0xb7, 0x99, 0x8b, 0x75, 0xe0, 0x22, 0x86, 0x9e, 0x9e, - 0xeb, 0x48, 0xa4, 0xc3, 0x68, 0x06, 0xfe, 0x2c, 0x06, 0x70, 0x64, 0xca, 0xa7, 0x4a, 0x1f, 0x69, - 0x83, 0xc5, 0x50, 0x38, 0x50, 0x0d, 0x24, 0x21, 0x65, 0x88, 0xda, 0x63, 0x14, 0x36, 0xdc, 0xe6, - 0xc5, 0x50, 0x78, 0x07, 0x78, 0x15, 0x7d, 0x62, 0xb9, 0x61, 0xd6, 0x34, 0x90, 0x34, 0xc4, 0x74, - 0x26, 0xc4, 0x8c, 0xdd, 0xe3, 0x04, 0x97, 0x4d, 0x5e, 0xf4, 0xa4, 0xf2, 0x21, 0x3e, 0x42, 0x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x16, 0x43, 0xe1, 0x40, 0x35, 0x90, 0x84, 0x94, 0x21, 0x6a, 0x8f, 0x51, 0xd8, 0x70, 0x9b, 0x17, + 0x43, 0xe1, 0x1d, 0xe0, 0x55, 0xf4, 0xb1, 0xe5, 0xa6, 0x59, 0xd3, 0x40, 0xd2, 0x10, 0xd3, 0x99, + 0x10, 0x33, 0x76, 0x8f, 0x93, 0x5c, 0x36, 0x79, 0xd1, 0x8b, 0xca, 0x07, 0x78, 0x0b, 0x45, 0xf9, + 0x58, 0x34, 0xdb, 0xff, 0x21, 0xef, 0x3b, 0x6a, 0xfd, 0x58, 0xc5, 0x89, 0x7d, 0x49, 0xa4, 0x17, + 0x60, 0x85, 0xa6, 0xb8, 0xed, 0x94, 0xd6, 0x08, 0x52, 0x35, 0x48, 0x18, 0x0b, 0x29, 0x12, 0x6c, + 0x55, 0x92, 0x53, 0x55, 0x49, 0xcd, 0x56, 0x52, 0xd2, 0x17, 0x28, 0x29, 0x67, 0xf8, 0x45, 0x39, + 0xce, 0xfd, 0xa2, 0x05, 0x7e, 0x1e, 0xc3, 0xe9, 0x73, 0x20, 0x75, 0x55, 0xed, 0xa3, 0x1e, 0x6a, + 0xcb, 0x08, 0xd7, 0x8c, 0x39, 0x14, 0xde, 0x81, 0xd5, 0xd6, 0xb8, 0x35, 0x47, 0x60, 0x5f, 0xf3, + 0x48, 0x60, 0x7b, 0x60, 0x7b, 0x4c, 0xe0, 0x03, 0xbb, 0xe5, 0x92, 0xdf, 0xce, 0x12, 0xde, 0xf5, + 0xfb, 0x98, 0x58, 0x34, 0xdf, 0x7f, 0x1a, 0xdb, 0xdf, 0xd0, 0x14, 0x98, 0xeb, 0x25, 0xff, 0x43, + 0x48, 0x3d, 0x53, 0x50, 0xaf, 0x6d, 0xd2, 0xaa, 0x54, 0x62, 0x06, 0x46, 0x3d, 0x3d, 0xc6, 0x48, + 0x47, 0x31, 0x32, 0x2e, 0x7a, 0x6d, 0xff, 0x94, 0xf3, 0x6e, 0x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f, 0xbb, 0xeb, 0xfc, 0xb5, 0xc9, 0x3a, + 0xd7, 0x91, 0x79, 0x96, 0xc2, 0x7f, 0x6b, 0x7a, 0xe7, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5b, + 0x64, 0x1e, 0xc4, 0xa1, 0x25, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1829,10 +1829,10 @@ type MsgClient interface { ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) // RecvPacket defines a rpc handler method for MsgRecvPacket. RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) - // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) // Timeout defines a rpc handler method for MsgTimeout. Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) // Acknowledgement defines a rpc handler method for MsgAcknowledgement. Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) // ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. @@ -1926,18 +1926,18 @@ func (c *msgClient) RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...g return out, nil } -func (c *msgClient) TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) { - out := new(MsgTimeoutOnCloseResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/TimeoutOnClose", in, out, opts...) +func (c *msgClient) Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) { + out := new(MsgTimeoutResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Timeout", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) { - out := new(MsgTimeoutResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Timeout", in, out, opts...) +func (c *msgClient) TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) { + out := new(MsgTimeoutOnCloseResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/TimeoutOnClose", in, out, opts...) if err != nil { return nil, err } @@ -2051,10 +2051,10 @@ type MsgServer interface { ChannelCloseConfirm(context.Context, *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) // RecvPacket defines a rpc handler method for MsgRecvPacket. RecvPacket(context.Context, *MsgRecvPacket) (*MsgRecvPacketResponse, error) - // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - TimeoutOnClose(context.Context, *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) // Timeout defines a rpc handler method for MsgTimeout. Timeout(context.Context, *MsgTimeout) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(context.Context, *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) // Acknowledgement defines a rpc handler method for MsgAcknowledgement. Acknowledgement(context.Context, *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) // ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. @@ -2102,12 +2102,12 @@ func (*UnimplementedMsgServer) ChannelCloseConfirm(ctx context.Context, req *Msg func (*UnimplementedMsgServer) RecvPacket(ctx context.Context, req *MsgRecvPacket) (*MsgRecvPacketResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RecvPacket not implemented") } -func (*UnimplementedMsgServer) TimeoutOnClose(ctx context.Context, req *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TimeoutOnClose not implemented") -} func (*UnimplementedMsgServer) Timeout(ctx context.Context, req *MsgTimeout) (*MsgTimeoutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Timeout not implemented") } +func (*UnimplementedMsgServer) TimeoutOnClose(ctx context.Context, req *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TimeoutOnClose not implemented") +} func (*UnimplementedMsgServer) Acknowledgement(ctx context.Context, req *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Acknowledgement not implemented") } @@ -2269,38 +2269,38 @@ func _Msg_RecvPacket_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Msg_TimeoutOnClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTimeoutOnClose) +func _Msg_Timeout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeout) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).TimeoutOnClose(ctx, in) + return srv.(MsgServer).Timeout(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/TimeoutOnClose", + FullMethod: "/ibc.core.channel.v1.Msg/Timeout", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).TimeoutOnClose(ctx, req.(*MsgTimeoutOnClose)) + return srv.(MsgServer).Timeout(ctx, req.(*MsgTimeout)) } return interceptor(ctx, in, info, handler) } -func _Msg_Timeout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgTimeout) +func _Msg_TimeoutOnClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeoutOnClose) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).Timeout(ctx, in) + return srv.(MsgServer).TimeoutOnClose(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ibc.core.channel.v1.Msg/Timeout", + FullMethod: "/ibc.core.channel.v1.Msg/TimeoutOnClose", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Timeout(ctx, req.(*MsgTimeout)) + return srv.(MsgServer).TimeoutOnClose(ctx, req.(*MsgTimeoutOnClose)) } return interceptor(ctx, in, info, handler) } @@ -2517,14 +2517,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RecvPacket", Handler: _Msg_RecvPacket_Handler, }, - { - MethodName: "TimeoutOnClose", - Handler: _Msg_TimeoutOnClose_Handler, - }, { MethodName: "Timeout", Handler: _Msg_Timeout_Handler, }, + { + MethodName: "TimeoutOnClose", + Handler: _Msg_TimeoutOnClose_Handler, + }, { MethodName: "Acknowledgement", Handler: _Msg_Acknowledgement_Handler, diff --git a/proto/ibc/core/channel/v1/tx.proto b/proto/ibc/core/channel/v1/tx.proto index 611b4068088..06e8523284a 100644 --- a/proto/ibc/core/channel/v1/tx.proto +++ b/proto/ibc/core/channel/v1/tx.proto @@ -36,12 +36,12 @@ service Msg { // RecvPacket defines a rpc handler method for MsgRecvPacket. rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); - // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); - // Timeout defines a rpc handler method for MsgTimeout. rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); From e769eeb2beebc6aa68d901c393fbd2b844ef17f0 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Mon, 11 Nov 2024 16:15:24 +0200 Subject: [PATCH 12/23] chore: revert exporting of deletePacketCommitment. --- modules/core/04-channel/keeper/keeper.go | 2 +- modules/core/04-channel/keeper/packet.go | 2 +- modules/core/04-channel/keeper/timeout.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/04-channel/keeper/keeper.go b/modules/core/04-channel/keeper/keeper.go index 1dddc74e126..db81e134084 100644 --- a/modules/core/04-channel/keeper/keeper.go +++ b/modules/core/04-channel/keeper/keeper.go @@ -267,7 +267,7 @@ func (k *Keeper) SetPacketCommitment(ctx context.Context, portID, channelID stri } } -func (k *Keeper) DeletePacketCommitment(ctx context.Context, portID, channelID string, sequence uint64) { +func (k *Keeper) deletePacketCommitment(ctx context.Context, portID, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) if err := store.Delete(host.PacketCommitmentKey(portID, channelID, sequence)); err != nil { panic(err) diff --git a/modules/core/04-channel/keeper/packet.go b/modules/core/04-channel/keeper/packet.go index 89630094748..4be14bbf330 100644 --- a/modules/core/04-channel/keeper/packet.go +++ b/modules/core/04-channel/keeper/packet.go @@ -441,7 +441,7 @@ func (k *Keeper) AcknowledgePacket( } // Delete packet commitment, since the packet has been acknowledged, the commitement is no longer necessary - k.DeletePacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) + k.deletePacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) // log that a packet has been acknowledged k.Logger(ctx).Info( diff --git a/modules/core/04-channel/keeper/timeout.go b/modules/core/04-channel/keeper/timeout.go index 0e2b9817e05..b7d39b843c4 100644 --- a/modules/core/04-channel/keeper/timeout.go +++ b/modules/core/04-channel/keeper/timeout.go @@ -132,7 +132,7 @@ func (k *Keeper) timeoutExecuted( channel types.Channel, packet types.Packet, ) error { - k.DeletePacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) + k.deletePacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) // if an upgrade is in progress, handling packet flushing and update channel state appropriately if channel.State == types.FLUSHING && channel.Ordering == types.UNORDERED { From 5b3ce55b37ed33a5ebb376b4ffa5471cddad5965 Mon Sep 17 00:00:00 2001 From: Aditya <14364734+AdityaSripal@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:19:57 +0100 Subject: [PATCH 13/23] Match commitment to specification (#7544) * fix hash * prepend hash with byte 0x02 * fix hash to spec * chore: update function documentation to align with implementation. --------- Co-authored-by: DimitrisJim --- modules/core/04-channel/v2/keeper/keeper.go | 2 +- .../core/04-channel/v2/types/commitment.go | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/keeper.go b/modules/core/04-channel/v2/keeper/keeper.go index b5e81ee7cee..fe1ad9b8a23 100644 --- a/modules/core/04-channel/v2/keeper/keeper.go +++ b/modules/core/04-channel/v2/keeper/keeper.go @@ -133,7 +133,7 @@ func (k *Keeper) HasPacketReceipt(ctx context.Context, channelID string, sequenc // This is a public path that is standardized by the IBC V2 specification. func (k *Keeper) SetPacketReceipt(ctx context.Context, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) - if err := store.Set(hostv2.PacketReceiptKey(channelID, sequence), []byte{byte(1)}); err != nil { + if err := store.Set(hostv2.PacketReceiptKey(channelID, sequence), []byte{byte(2)}); err != nil { panic(err) } } diff --git a/modules/core/04-channel/v2/types/commitment.go b/modules/core/04-channel/v2/types/commitment.go index 6d815f3da46..721049ca83b 100644 --- a/modules/core/04-channel/v2/types/commitment.go +++ b/modules/core/04-channel/v2/types/commitment.go @@ -7,22 +7,28 @@ import ( ) // CommitPacket returns the V2 packet commitment bytes. The commitment consists of: -// sha256_hash(timeout) + sha256_hash(destinationChannel) + sha256_hash(payload) from a given packet. +// 0x02 + sha256_hash(destinationChannel) + sha256_hash(timeout) + sha256_hash(payload) 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()) - + var buf []byte destIDHash := sha256.Sum256([]byte(packet.DestinationChannel)) buf = append(buf, destIDHash[:]...) + timeoutBytes := sdk.Uint64ToBigEndian(packet.GetTimeoutTimestamp()) + timeoutHash := sha256.Sum256(timeoutBytes) + buf = append(buf, timeoutHash[:]...) + + var appBytes []byte for _, payload := range packet.Payloads { - buf = append(buf, hashPayload(payload)...) + appBytes = append(appBytes, hashPayload(payload)...) } + appHash := sha256.Sum256(appBytes) + buf = append(buf, appHash[:]...) hash := sha256.Sum256(buf) - return hash[:] + return append([]byte{byte(2)}, hash[:]...) } // hashPayload returns the hash of the payload. @@ -32,12 +38,12 @@ func hashPayload(data Payload) []byte { buf = append(buf, sourceHash[:]...) destHash := sha256.Sum256([]byte(data.DestinationPort)) buf = append(buf, destHash[:]...) - payloadValueHash := sha256.Sum256(data.Value) - buf = append(buf, payloadValueHash[:]...) - payloadEncodingHash := sha256.Sum256([]byte(data.Encoding)) - buf = append(buf, payloadEncodingHash[:]...) payloadVersionHash := sha256.Sum256([]byte(data.Version)) buf = append(buf, payloadVersionHash[:]...) + payloadEncodingHash := sha256.Sum256([]byte(data.Encoding)) + buf = append(buf, payloadEncodingHash[:]...) + payloadValueHash := sha256.Sum256(data.Value) + buf = append(buf, payloadValueHash[:]...) hash := sha256.Sum256(buf) return hash[:] } @@ -51,5 +57,5 @@ func CommitAcknowledgement(acknowledgement Acknowledgement) []byte { } hash := sha256.Sum256(buf) - return hash[:] + return append([]byte{byte(2)}, hash[:]...) } From 84c176ae8d6f144f9a6d32953fd5502611dc6eb9 Mon Sep 17 00:00:00 2001 From: srdtrk <59252793+srdtrk@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:42:14 +0800 Subject: [PATCH 14/23] docs: land on v9 by default (#7553) --- docs/docusaurus.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 0620421a31a..e953a05c3c8 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -49,13 +49,17 @@ const config = { // Exclude template markdown files from the docs exclude: ["**/*.template.md"], // Select the latest version - lastVersion: "v8.5.x", + lastVersion: "v9.0.x", // Assign banners to specific versions versions: { current: { path: "main", banner: "unreleased", }, + "v9.0.x": { + path: "v9", + banner: "none", + }, "v8.5.x": { path: "v8", banner: "none", From 083cfb17d1a4128809a523c5d352eba695b96dc0 Mon Sep 17 00:00:00 2001 From: Vasilev Ivan <20002mc@gmail.com> Date: Tue, 12 Nov 2024 13:58:42 +0300 Subject: [PATCH 15/23] test: ensure that the packet commit changes if the packed fields changes (#7514) * test: ensure that the packet commit changes if the packed fields changes * test: fix lint and sequence * test: tweak test slightly * chore: fix linter complaint. --------- Co-authored-by: DimitrisJim --- modules/core/04-channel/types/packet_test.go | 34 +++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/modules/core/04-channel/types/packet_test.go b/modules/core/04-channel/types/packet_test.go index 1338f45c8d1..fca1d9a357d 100644 --- a/modules/core/04-channel/types/packet_test.go +++ b/modules/core/04-channel/types/packet_test.go @@ -13,16 +13,44 @@ import ( ) func TestCommitPacket(t *testing.T) { - packet := types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) - registry := codectypes.NewInterfaceRegistry() clienttypes.RegisterInterfaces(registry) types.RegisterInterfaces(registry) cdc := codec.NewProtoCodec(registry) + packet := types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp) commitment := types.CommitPacket(cdc, packet) require.NotNil(t, commitment) + + testCases := []struct { + name string + packet types.Packet + }{ + { + name: "diff data", + packet: types.NewPacket(unknownPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp), + }, + { + name: "diff timeout revision number", + packet: types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, clienttypes.NewHeight(timeoutHeight.RevisionNumber+1, timeoutHeight.RevisionHeight), timeoutTimestamp), + }, + { + name: "diff timeout revision height", + packet: types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, clienttypes.NewHeight(timeoutHeight.RevisionNumber, timeoutHeight.RevisionHeight+1), timeoutTimestamp), + }, + { + name: "diff timeout timestamp", + packet: types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, uint64(1)), + }, + } + + for _, tc := range testCases { + testCommitment := types.CommitPacket(cdc, tc.packet) + require.NotNil(t, testCommitment) + + require.NotEqual(t, commitment, testCommitment) + } } func TestPacketValidateBasic(t *testing.T) { @@ -44,8 +72,6 @@ func TestPacketValidateBasic(t *testing.T) { } for i, tc := range testCases { - tc := tc - err := tc.packet.ValidateBasic() if tc.expPass { require.NoError(t, err, "Msg %d failed: %s", i, tc.errMsg) From cb299784471e7c484dc124ab2b900ef7f98609df Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 12 Nov 2024 14:54:00 +0200 Subject: [PATCH 16/23] chore: drop usage of 'channeltypesv2'. --- modules/core/04-channel/v2/keeper/events.go | 18 ++-- .../core/04-channel/v2/keeper/export_test.go | 12 +-- .../04-channel/v2/keeper/msg_server_test.go | 92 +++++++++---------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/events.go b/modules/core/04-channel/v2/keeper/events.go index 720fb93e11b..b20273d74bf 100644 --- a/modules/core/04-channel/v2/keeper/events.go +++ b/modules/core/04-channel/v2/keeper/events.go @@ -5,31 +5,31 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" ) // EmitSendPacketEvents emits events for the SendPacket handler. -func EmitSendPacketEvents(ctx context.Context, packet channeltypesv2.Packet) { +func EmitSendPacketEvents(ctx context.Context, packet types.Packet) { // TODO: https://github.com/cosmos/ibc-go/issues/7386 } // EmitRecvPacketEvents emits events for the RecvPacket handler. -func EmitRecvPacketEvents(ctx context.Context, packet channeltypesv2.Packet) { +func EmitRecvPacketEvents(ctx context.Context, packet types.Packet) { // TODO: https://github.com/cosmos/ibc-go/issues/7386 } // EmitAcknowledgePacketEvents emits events for the AcknowledgePacket handler. -func EmitAcknowledgePacketEvents(ctx context.Context, packet channeltypesv2.Packet) { +func EmitAcknowledgePacketEvents(ctx context.Context, packet types.Packet) { // TODO: https://github.com/cosmos/ibc-go/issues/7386 } // EmitTimeoutPacketEvents emits events for the TimeoutPacket handler. -func EmitTimeoutPacketEvents(ctx context.Context, packet channeltypesv2.Packet) { +func EmitTimeoutPacketEvents(ctx context.Context, packet types.Packet) { // TODO: https://github.com/cosmos/ibc-go/issues/7386 } // EmitWriteAcknowledgementEvents emits events for WriteAcknowledgement. -func EmitWriteAcknowledgementEvents(ctx context.Context, packet channeltypesv2.Packet, ack channeltypesv2.Acknowledgement) { +func EmitWriteAcknowledgementEvents(ctx context.Context, packet types.Packet, ack types.Acknowledgement) { // TODO: https://github.com/cosmos/ibc-go/issues/7386 } @@ -39,12 +39,12 @@ func (*Keeper) EmitCreateChannelEvent(ctx context.Context, channelID string) { sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( - channeltypesv2.EventTypeCreateChannel, - sdk.NewAttribute(channeltypesv2.AttributeKeyChannelID, channelID), + types.EventTypeCreateChannel, + sdk.NewAttribute(types.AttributeKeyChannelID, channelID), ), sdk.NewEvent( sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, channeltypesv2.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), ), }) } diff --git a/modules/core/04-channel/v2/keeper/export_test.go b/modules/core/04-channel/v2/keeper/export_test.go index d772eac3bef..aae6048ed2a 100644 --- a/modules/core/04-channel/v2/keeper/export_test.go +++ b/modules/core/04-channel/v2/keeper/export_test.go @@ -7,7 +7,7 @@ package keeper import ( "context" - channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" "github.com/cosmos/ibc-go/v9/modules/core/exported" ) @@ -15,7 +15,7 @@ func (k *Keeper) SendPacketTest( ctx context.Context, sourceChannel string, timeoutTimestamp uint64, - payloads []channeltypesv2.Payload, + payloads []types.Payload, ) (uint64, string, error) { return k.sendPacket( ctx, @@ -27,7 +27,7 @@ func (k *Keeper) SendPacketTest( func (k *Keeper) RecvPacketTest( ctx context.Context, - packet channeltypesv2.Packet, + packet types.Packet, proof []byte, proofHeight exported.Height, ) error { @@ -41,8 +41,8 @@ func (k *Keeper) RecvPacketTest( func (k *Keeper) AcknowledgePacketTest( ctx context.Context, - packet channeltypesv2.Packet, - acknowledgement channeltypesv2.Acknowledgement, + packet types.Packet, + acknowledgement types.Acknowledgement, proof []byte, proofHeight exported.Height, ) error { @@ -57,7 +57,7 @@ func (k *Keeper) AcknowledgePacketTest( func (k *Keeper) TimeoutPacketTest( ctx context.Context, - packet channeltypesv2.Packet, + packet types.Packet, proof []byte, proofHeight exported.Height, ) error { 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..3ea899c28af 100644 --- a/modules/core/04-channel/v2/keeper/msg_server_test.go +++ b/modules/core/04-channel/v2/keeper/msg_server_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" - channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" @@ -20,7 +20,7 @@ import ( func (suite *KeeperTestSuite) TestRegisterCounterparty() { var ( path *ibctesting.Path - msg *channeltypesv2.MsgRegisterCounterparty + msg *types.MsgRegisterCounterparty ) cases := []struct { name string @@ -31,7 +31,7 @@ func (suite *KeeperTestSuite) TestRegisterCounterparty() { "success", func() { // set it before handler - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetChannel(suite.chainA.GetContext(), msg.ChannelId, channeltypesv2.NewChannel(path.EndpointA.ClientID, "", ibctesting.MerklePath)) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetChannel(suite.chainA.GetContext(), msg.ChannelId, types.NewChannel(path.EndpointA.ClientID, "", ibctesting.MerklePath)) }, nil, }, @@ -53,9 +53,9 @@ func (suite *KeeperTestSuite) TestRegisterCounterparty() { "failure: channel must already exist", func() { suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.DeleteCreator(suite.chainA.GetContext(), path.EndpointA.ChannelID) - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.ChannelStore(suite.chainA.GetContext(), path.EndpointA.ChannelID).Delete([]byte(channeltypesv2.ChannelKey)) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.ChannelStore(suite.chainA.GetContext(), path.EndpointA.ChannelID).Delete([]byte(types.ChannelKey)) }, - channeltypesv2.ErrChannelNotFound, + types.ErrChannelNotFound, }, } @@ -70,7 +70,7 @@ func (suite *KeeperTestSuite) TestRegisterCounterparty() { suite.Require().NoError(path.EndpointB.CreateChannel()) signer := path.EndpointA.Chain.SenderAccount.GetAddress().String() - msg = channeltypesv2.NewMsgRegisterCounterparty(path.EndpointA.ChannelID, path.EndpointB.ChannelID, signer) + msg = types.NewMsgRegisterCounterparty(path.EndpointA.ChannelID, path.EndpointB.ChannelID, signer) tc.malleate() @@ -102,9 +102,9 @@ func (suite *KeeperTestSuite) TestRegisterCounterparty() { func (suite *KeeperTestSuite) TestMsgSendPacket() { var ( path *ibctesting.Path - expectedPacket channeltypesv2.Packet + expectedPacket types.Packet timeoutTimestamp uint64 - payload channeltypesv2.Payload + payload types.Payload ) testCases := []struct { @@ -121,8 +121,8 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { name: "success: valid timeout timestamp", malleate: func() { // ensure a message timeout. - timeoutTimestamp = uint64(suite.chainA.GetContext().BlockTime().Add(channeltypesv2.MaxTimeoutDelta - 10*time.Second).Unix()) - expectedPacket = channeltypesv2.NewPacket(1, path.EndpointA.ChannelID, path.EndpointB.ChannelID, timeoutTimestamp, payload) + timeoutTimestamp = uint64(suite.chainA.GetContext().BlockTime().Add(types.MaxTimeoutDelta - 10*time.Second).Unix()) + expectedPacket = types.NewPacket(1, path.EndpointA.ChannelID, path.EndpointB.ChannelID, timeoutTimestamp, payload) }, expError: nil, }, @@ -132,15 +132,15 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { // ensure a message timeout. timeoutTimestamp = uint64(1) }, - expError: channeltypesv2.ErrTimeoutElapsed, + expError: types.ErrTimeoutElapsed, }, { name: "failure: timeout timestamp exceeds max allowed input", malleate: func() { // ensure message timeout exceeds max allowed input. - timeoutTimestamp = uint64(suite.chainA.GetContext().BlockTime().Add(channeltypesv2.MaxTimeoutDelta + 10*time.Second).Unix()) + timeoutTimestamp = uint64(suite.chainA.GetContext().BlockTime().Add(types.MaxTimeoutDelta + 10*time.Second).Unix()) }, - expError: channeltypesv2.ErrInvalidTimeout, + expError: types.ErrInvalidTimeout, }, { name: "failure: timeout timestamp less than current block timestamp", @@ -148,7 +148,7 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { // ensure message timeout exceeds max allowed input. timeoutTimestamp = uint64(suite.chainA.GetContext().BlockTime().Unix()) - 1 }, - expError: channeltypesv2.ErrTimeoutElapsed, + expError: types.ErrTimeoutElapsed, }, { name: "failure: inactive client", @@ -160,7 +160,7 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { { name: "failure: application callback error", malleate: func() { - path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnSendPacket = func(ctx context.Context, sourceID string, destinationID string, sequence uint64, data channeltypesv2.Payload, signer sdk.AccAddress) error { + path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnSendPacket = func(ctx context.Context, sourceID string, destinationID string, sequence uint64, data types.Payload, signer sdk.AccAddress) error { return mock.MockApplicationCallbackError } }, @@ -171,7 +171,7 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { malleate: func() { path.EndpointA.ChannelID = ibctesting.InvalidID }, - expError: channeltypesv2.ErrChannelNotFound, + expError: types.ErrChannelNotFound, }, { name: "failure: route to non existing app", @@ -194,7 +194,7 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { timeoutTimestamp = suite.chainA.GetTimeoutTimestampSecs() payload = mockv2.NewMockPayload(mockv2.ModuleNameA, mockv2.ModuleNameB) - expectedPacket = channeltypesv2.NewPacket(1, path.EndpointA.ChannelID, path.EndpointB.ChannelID, timeoutTimestamp, payload) + expectedPacket = types.NewPacket(1, path.EndpointA.ChannelID, path.EndpointB.ChannelID, timeoutTimestamp, payload) tc.malleate() @@ -209,7 +209,7 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { packetCommitment := ck.GetPacketCommitment(path.EndpointA.Chain.GetContext(), path.EndpointA.ChannelID, 1) suite.Require().NotNil(packetCommitment) - suite.Require().Equal(channeltypesv2.CommitPacket(expectedPacket), packetCommitment, "packet commitment is not stored correctly") + suite.Require().Equal(types.CommitPacket(expectedPacket), packetCommitment, "packet commitment is not stored correctly") nextSequenceSend, ok := ck.GetNextSequenceSend(path.EndpointA.Chain.GetContext(), path.EndpointA.ChannelID) suite.Require().True(ok) @@ -228,8 +228,8 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { func (suite *KeeperTestSuite) TestMsgRecvPacket() { var ( path *ibctesting.Path - packet channeltypesv2.Packet - expectedAck channeltypesv2.Acknowledgement + packet types.Packet + expectedAck types.Acknowledgement ) testCases := []struct { @@ -245,15 +245,15 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { { name: "success: failed recv result", malleate: func() { - failedRecvResult := channeltypesv2.RecvPacketResult{ - Status: channeltypesv2.PacketStatus_Failure, + failedRecvResult := types.RecvPacketResult{ + Status: types.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 { + path.EndpointB.Chain.GetSimApp().MockModuleV2B.IBCApp.OnRecvPacket = func(ctx context.Context, sourceChannel string, destinationChannel string, data types.Payload, relayer sdk.AccAddress) types.RecvPacketResult { return failedRecvResult } }, @@ -261,15 +261,15 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { { name: "success: async recv result", malleate: func() { - asyncResult := channeltypesv2.RecvPacketResult{ - Status: channeltypesv2.PacketStatus_Async, + asyncResult := types.RecvPacketResult{ + Status: types.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 { + path.EndpointB.Chain.GetSimApp().MockModuleV2B.IBCApp.OnRecvPacket = func(ctx context.Context, sourceChannel string, destinationChannel string, data types.Payload, relayer sdk.AccAddress) types.RecvPacketResult { return asyncResult } }, @@ -278,7 +278,7 @@ 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{} + expectedAck = types.Acknowledgement{} }, }, { @@ -287,7 +287,7 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { // change the destination id to a non-existent channel. packet.DestinationChannel = ibctesting.InvalidID }, - expError: channeltypesv2.ErrChannelNotFound, + expError: types.ErrChannelNotFound, }, { name: "failure: invalid proof", @@ -315,8 +315,8 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { suite.Require().NoError(err) // default expected ack is a single successful recv result for moduleB. - expectedAck = channeltypesv2.Acknowledgement{ - AcknowledgementResults: []channeltypesv2.AcknowledgementResult{ + expectedAck = types.Acknowledgement{ + AcknowledgementResults: []types.AcknowledgementResult{ { AppName: mockv2.ModuleNameB, RecvPacketResult: mockv2.MockRecvPacketResult, @@ -340,13 +340,13 @@ 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 len(expectedAck.AcknowledgementResults) == 0 || expectedAck.AcknowledgementResults[0].RecvPacketResult.Status == types.PacketStatus_Async { // 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 // ack should be written for synchronous app (default mock application behaviour). suite.Require().True(ackWritten) - expectedBz := channeltypesv2.CommitAcknowledgement(expectedAck) + expectedBz := types.CommitAcknowledgement(expectedAck) actualAckBz := ck.GetPacketAcknowledgement(path.EndpointB.Chain.GetContext(), packet.DestinationChannel, packet.Sequence) suite.Require().Equal(expectedBz, actualAckBz) @@ -364,8 +364,8 @@ func (suite *KeeperTestSuite) TestMsgRecvPacket() { func (suite *KeeperTestSuite) TestMsgAcknowledgement() { var ( path *ibctesting.Path - packet channeltypesv2.Packet - ack channeltypesv2.Acknowledgement + packet types.Packet + ack types.Acknowledgement ) testCases := []struct { name string @@ -383,7 +383,7 @@ func (suite *KeeperTestSuite) TestMsgAcknowledgement() { // Modify the callback to return an error. // This way, we can verify that the callback is not executed in a No-op case. - path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnAcknowledgementPacket = func(context.Context, string, string, channeltypesv2.Payload, []byte, sdk.AccAddress) error { + path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnAcknowledgementPacket = func(context.Context, string, string, types.Payload, []byte, sdk.AccAddress) error { return mock.MockApplicationCallbackError } }, @@ -391,7 +391,7 @@ func (suite *KeeperTestSuite) TestMsgAcknowledgement() { { name: "failure: callback fails", malleate: func() { - path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnAcknowledgementPacket = func(context.Context, string, string, channeltypesv2.Payload, []byte, sdk.AccAddress) error { + path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnAcknowledgementPacket = func(context.Context, string, string, types.Payload, []byte, sdk.AccAddress) error { return mock.MockApplicationCallbackError } }, @@ -403,14 +403,14 @@ func (suite *KeeperTestSuite) TestMsgAcknowledgement() { // change the source id to a non-existent channel. packet.SourceChannel = "not-existent-channel" }, - expError: channeltypesv2.ErrChannelNotFound, + expError: types.ErrChannelNotFound, }, { name: "failure: invalid commitment", malleate: func() { suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetPacketCommitment(suite.chainA.GetContext(), packet.SourceChannel, packet.Sequence, []byte("foo")) }, - expError: channeltypesv2.ErrInvalidPacket, + expError: types.ErrInvalidPacket, }, { name: "failure: failed membership verification", @@ -438,8 +438,8 @@ func (suite *KeeperTestSuite) TestMsgAcknowledgement() { suite.Require().NoError(err) // Construct expected acknowledgement - ack = channeltypesv2.Acknowledgement{ - AcknowledgementResults: []channeltypesv2.AcknowledgementResult{ + ack = types.Acknowledgement{ + AcknowledgementResults: []types.AcknowledgementResult{ { AppName: mockv2.ModuleNameB, RecvPacketResult: mockv2.MockRecvPacketResult, @@ -465,7 +465,7 @@ func (suite *KeeperTestSuite) TestMsgAcknowledgement() { func (suite *KeeperTestSuite) TestMsgTimeout() { var ( path *ibctesting.Path - packet channeltypesv2.Packet + packet types.Packet ) testCases := []struct { @@ -484,16 +484,16 @@ func (suite *KeeperTestSuite) TestMsgTimeout() { // Modify the callback to return a different error. // This way, we can verify that the callback is not executed in a No-op case. - path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnTimeoutPacket = func(context.Context, string, string, channeltypesv2.Payload, sdk.AccAddress) error { + path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnTimeoutPacket = func(context.Context, string, string, types.Payload, sdk.AccAddress) error { return mock.MockApplicationCallbackError } }, - expError: channeltypesv2.ErrNoOpMsg, + expError: types.ErrNoOpMsg, }, { name: "failure: callback fails", malleate: func() { - path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnTimeoutPacket = func(context.Context, string, string, channeltypesv2.Payload, sdk.AccAddress) error { + path.EndpointA.Chain.GetSimApp().MockModuleV2A.IBCApp.OnTimeoutPacket = func(context.Context, string, string, types.Payload, sdk.AccAddress) error { return mock.MockApplicationCallbackError } }, @@ -505,14 +505,14 @@ func (suite *KeeperTestSuite) TestMsgTimeout() { // change the source id to a non-existent channel. packet.SourceChannel = "not-existent-channel" }, - expError: channeltypesv2.ErrChannelNotFound, + expError: types.ErrChannelNotFound, }, { name: "failure: invalid commitment", malleate: func() { suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetPacketCommitment(suite.chainA.GetContext(), packet.SourceChannel, packet.Sequence, []byte("foo")) }, - expError: channeltypesv2.ErrInvalidPacket, + expError: types.ErrInvalidPacket, }, { name: "failure: unable to timeout if packet has been received", From 5031af8893f1a74772173ecbdefc1ab48a043546 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 12 Nov 2024 15:10:31 +0200 Subject: [PATCH 17/23] chore: fix post-merge test failure. --- modules/core/04-channel/types/packet_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/core/04-channel/types/packet_test.go b/modules/core/04-channel/types/packet_test.go index f889deb9ce4..f26192b8712 100644 --- a/modules/core/04-channel/types/packet_test.go +++ b/modules/core/04-channel/types/packet_test.go @@ -5,6 +5,7 @@ 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" ) @@ -36,7 +37,7 @@ func TestCommitPacket(t *testing.T) { } for _, tc := range testCases { - testCommitment := types.CommitPacket(cdc, tc.packet) + testCommitment := types.CommitPacket(tc.packet) require.NotNil(t, testCommitment) require.NotEqual(t, commitment, testCommitment) From 00505238557a6d9eab1013e07e43a75f401680f8 Mon Sep 17 00:00:00 2001 From: Aditya <14364734+AdityaSripal@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:38:31 +0100 Subject: [PATCH 18/23] ICS24: Change Provable keys (#7517) * refactor packet keys * provable keys * chore: fix packet commitments prefix function. --------- Co-authored-by: DimitrisJim --- modules/core/24-host/v2/packet_keys.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/modules/core/24-host/v2/packet_keys.go b/modules/core/24-host/v2/packet_keys.go index b7c540b2abd..a95814198f8 100644 --- a/modules/core/24-host/v2/packet_keys.go +++ b/modules/core/24-host/v2/packet_keys.go @@ -6,25 +6,24 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// PacketReceiptKey returns the store key of under which a packet -// receipt is stored -func PacketReceiptKey(channelID string, sequence uint64) []byte { - return []byte(fmt.Sprintf("receipts/channels/%s/sequences/%s", channelID, sdk.Uint64ToBigEndian(sequence))) -} - -// PacketAcknowledgementKey returns the store key of under which a packet acknowledgement is stored. -func PacketAcknowledgementKey(channelID string, sequence uint64) []byte { - return []byte(fmt.Sprintf("acks/channels/%s/sequences/%s", channelID, sdk.Uint64ToBigEndian(sequence))) +// PacketCommitmentKey returns the store key of under which a packet commitment is stored. +func PacketCommitmentKey(channelID string, sequence uint64) []byte { + return append(append([]byte(channelID), byte(1)), sdk.Uint64ToBigEndian(sequence)...) } // PacketCommitmentPrefixKey returns the store key prefix under which packet commitments for a particular channel are stored. func PacketCommitmentPrefixKey(channelID string) []byte { - return []byte(fmt.Sprintf("commitments/channels/%s", channelID)) + return append([]byte(channelID), byte(1)) } -// PacketCommitmentKey returns the store key of under which a packet commitment is stored. -func PacketCommitmentKey(channelID string, sequence uint64) []byte { - return []byte(fmt.Sprintf("commitments/channels/%s/sequences/%s", channelID, sdk.Uint64ToBigEndian(sequence))) +// PacketReceiptKey returns the store key of under which a packet receipt is stored. +func PacketReceiptKey(channelID string, sequence uint64) []byte { + return append(append([]byte(channelID), byte(2)), sdk.Uint64ToBigEndian(sequence)...) +} + +// PacketAcknowledgementKey returns the store key of under which a packet acknowledgement is stored. +func PacketAcknowledgementKey(channelID string, sequence uint64) []byte { + return append(append([]byte(channelID), byte(3)), sdk.Uint64ToBigEndian(sequence)...) } // NextSequenceSendKey returns the store key for the next sequence send of a given channelID. From d416dc36de108ae19eb76b2b81733ddc3f68c5c7 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 12 Nov 2024 16:02:55 +0200 Subject: [PATCH 19/23] chore: amend event emitted for create channel. (#7557) --- modules/core/04-channel/v2/keeper/events.go | 5 +++-- modules/core/04-channel/v2/keeper/msg_server.go | 2 +- modules/core/04-channel/v2/types/events.go | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/events.go b/modules/core/04-channel/v2/keeper/events.go index b20273d74bf..1c2140d2835 100644 --- a/modules/core/04-channel/v2/keeper/events.go +++ b/modules/core/04-channel/v2/keeper/events.go @@ -33,14 +33,15 @@ func EmitWriteAcknowledgementEvents(ctx context.Context, packet types.Packet, ac // TODO: https://github.com/cosmos/ibc-go/issues/7386 } -// EmitCreateChannelEvent emits a channel create event. -func (*Keeper) EmitCreateChannelEvent(ctx context.Context, channelID string) { +// emitCreateChannelEvent emits a channel create event. +func (*Keeper) emitCreateChannelEvent(ctx context.Context, channelID, clientID string) { sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeCreateChannel, sdk.NewAttribute(types.AttributeKeyChannelID, channelID), + sdk.NewAttribute(types.AttributeKeyClientID, clientID), ), sdk.NewEvent( sdk.EventTypeMessage, diff --git a/modules/core/04-channel/v2/keeper/msg_server.go b/modules/core/04-channel/v2/keeper/msg_server.go index 6bda4404531..39d376aac30 100644 --- a/modules/core/04-channel/v2/keeper/msg_server.go +++ b/modules/core/04-channel/v2/keeper/msg_server.go @@ -29,7 +29,7 @@ func (k *Keeper) CreateChannel(goCtx context.Context, msg *types.MsgCreateChanne k.SetCreator(ctx, channelID, msg.Signer) k.SetNextSequenceSend(ctx, channelID, 1) - k.EmitCreateChannelEvent(goCtx, channelID) + k.emitCreateChannelEvent(goCtx, channelID, msg.ClientId) return &types.MsgCreateChannelResponse{ChannelId: channelID}, nil } diff --git a/modules/core/04-channel/v2/types/events.go b/modules/core/04-channel/v2/types/events.go index 6166f0422d1..78bf04df189 100644 --- a/modules/core/04-channel/v2/types/events.go +++ b/modules/core/04-channel/v2/types/events.go @@ -9,6 +9,7 @@ import ( // IBC channel events const ( AttributeKeyChannelID = "channel_id" + AttributeKeyClientID = "client_id" ) // IBC channel events vars From 6b237fcc1bc013a127f9ca301e392e3e5cccbc3a Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 12 Nov 2024 16:44:59 +0200 Subject: [PATCH 20/23] chore: add event for register counterparty (#7556) --- modules/core/04-channel/v2/keeper/events.go | 18 ++++++++++++++++++ .../core/04-channel/v2/keeper/msg_server.go | 2 ++ modules/core/04-channel/v2/types/events.go | 8 +++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/events.go b/modules/core/04-channel/v2/keeper/events.go index 1c2140d2835..7940cc15ff7 100644 --- a/modules/core/04-channel/v2/keeper/events.go +++ b/modules/core/04-channel/v2/keeper/events.go @@ -49,3 +49,21 @@ func (*Keeper) emitCreateChannelEvent(ctx context.Context, channelID, clientID s ), }) } + +// emitRegisterCounterpartyEvent emits a register counterparty event. +func (*Keeper) emitRegisterCounterpartyEvent(ctx context.Context, channelID string, channel types.Channel) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + sdkCtx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeRegisterCounterparty, + sdk.NewAttribute(types.AttributeKeyChannelID, channelID), + sdk.NewAttribute(types.AttributeKeyClientID, channel.ClientId), + sdk.NewAttribute(types.AttributeKeyCounterpartyChannelID, channel.CounterpartyChannelId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + }) +} diff --git a/modules/core/04-channel/v2/keeper/msg_server.go b/modules/core/04-channel/v2/keeper/msg_server.go index 39d376aac30..a4b6c19d9ff 100644 --- a/modules/core/04-channel/v2/keeper/msg_server.go +++ b/modules/core/04-channel/v2/keeper/msg_server.go @@ -57,6 +57,8 @@ func (k *Keeper) RegisterCounterparty(goCtx context.Context, msg *types.MsgRegis // Delete client creator from state as it is not needed after this point. k.DeleteCreator(ctx, msg.ChannelId) + k.emitRegisterCounterpartyEvent(goCtx, msg.ChannelId, channel) + return &types.MsgRegisterCounterpartyResponse{}, nil } diff --git a/modules/core/04-channel/v2/types/events.go b/modules/core/04-channel/v2/types/events.go index 78bf04df189..35496926d0e 100644 --- a/modules/core/04-channel/v2/types/events.go +++ b/modules/core/04-channel/v2/types/events.go @@ -8,13 +8,15 @@ import ( // IBC channel events const ( - AttributeKeyChannelID = "channel_id" - AttributeKeyClientID = "client_id" + AttributeKeyChannelID = "channel_id" + AttributeKeyClientID = "client_id" + AttributeKeyCounterpartyChannelID = "counterparty_channel_id" ) // IBC channel events vars var ( - EventTypeCreateChannel = "create_channel" + EventTypeCreateChannel = "create_channel" + EventTypeRegisterCounterparty = "register_counterparty" AttributeValueCategory = fmt.Sprintf("%s_%s", ibcexported.ModuleName, SubModuleName) ) From 3abeb0b548134df0d65b8849527d9dae1e04fc6f Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 12 Nov 2024 18:09:56 +0200 Subject: [PATCH 21/23] chore: add next sequence send query. (#7550) --- modules/core/04-channel/v2/client/cli/abci.go | 19 + modules/core/04-channel/v2/client/cli/cli.go | 1 + .../core/04-channel/v2/client/cli/query.go | 46 ++ .../core/04-channel/v2/keeper/grpc_query.go | 20 + .../04-channel/v2/keeper/grpc_query_test.go | 72 +++ modules/core/04-channel/v2/types/query.go | 18 + modules/core/04-channel/v2/types/query.pb.go | 599 ++++++++++++++++-- .../core/04-channel/v2/types/query.pb.gw.go | 101 +++ proto/ibc/core/channel/v2/query.proto | 21 + 9 files changed, 837 insertions(+), 60 deletions(-) diff --git a/modules/core/04-channel/v2/client/cli/abci.go b/modules/core/04-channel/v2/client/cli/abci.go index 942ca2a6ebf..5069eddf03e 100644 --- a/modules/core/04-channel/v2/client/cli/abci.go +++ b/modules/core/04-channel/v2/client/cli/abci.go @@ -1,6 +1,8 @@ package cli import ( + "encoding/binary" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" @@ -10,6 +12,23 @@ import ( ibcclient "github.com/cosmos/ibc-go/v9/modules/core/client" ) +func queryNextSequenceSendABCI(clientCtx client.Context, channelID string) (*types.QueryNextSequenceSendResponse, error) { + key := host.NextSequenceSendKey(channelID) + value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) + if err != nil { + return nil, err + } + + // check if next sequence send exists + if len(value) == 0 { + return nil, errorsmod.Wrapf(types.ErrSequenceSendNotFound, "channelID (%s)", channelID) + } + + sequence := binary.BigEndian.Uint64(value) + + return types.NewQueryNextSequenceSendResponse(sequence, proofBz, proofHeight), nil +} + func queryPacketCommitmentABCI(clientCtx client.Context, channelID string, sequence uint64) (*types.QueryPacketCommitmentResponse, error) { key := host.PacketCommitmentKey(channelID, sequence) value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) diff --git a/modules/core/04-channel/v2/client/cli/cli.go b/modules/core/04-channel/v2/client/cli/cli.go index 59d9dded017..b759dd0e65f 100644 --- a/modules/core/04-channel/v2/client/cli/cli.go +++ b/modules/core/04-channel/v2/client/cli/cli.go @@ -20,6 +20,7 @@ func GetQueryCmd() *cobra.Command { queryCmd.AddCommand( getCmdQueryChannel(), + getCmdQueryNextSequenceSend(), getCmdQueryPacketCommitment(), getCmdQueryPacketCommitments(), getCmdQueryPacketAcknowledgement(), diff --git a/modules/core/04-channel/v2/client/cli/query.go b/modules/core/04-channel/v2/client/cli/query.go index c79d92dfd4c..f07e853e78d 100644 --- a/modules/core/04-channel/v2/client/cli/query.go +++ b/modules/core/04-channel/v2/client/cli/query.go @@ -45,6 +45,52 @@ func getCmdQueryChannel() *cobra.Command { return cmd } +// getCmdQueryNextSequenceSend defines the command to query a next send sequence for a given channel +func getCmdQueryNextSequenceSend() *cobra.Command { + cmd := &cobra.Command{ + Use: "next-sequence-send [channel-id]", + Short: "Query a next send sequence", + Long: "Query the next sequence send for a given channel", + Example: fmt.Sprintf( + "%s query %s %s next-sequence-send [channel-id]", version.AppName, exported.ModuleName, types.SubModuleName, + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + channelID := args[0] + prove, err := cmd.Flags().GetBool(flags.FlagProve) + if err != nil { + return err + } + + if prove { + res, err := queryNextSequenceSendABCI(clientCtx, channelID) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + } + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.NextSequenceSend(cmd.Context(), types.NewQueryNextSequenceSendRequest(channelID)) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + cmd.Flags().Bool(flags.FlagProve, true, "show proofs for the query results") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + func getCmdQueryPacketCommitment() *cobra.Command { cmd := &cobra.Command{ Use: "packet-commitment [channel-id] [sequence]", diff --git a/modules/core/04-channel/v2/keeper/grpc_query.go b/modules/core/04-channel/v2/keeper/grpc_query.go index e72a5b3bbd9..f11c1f5155b 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query.go +++ b/modules/core/04-channel/v2/keeper/grpc_query.go @@ -52,6 +52,26 @@ func (q *queryServer) Channel(ctx context.Context, req *types.QueryChannelReques return types.NewQueryChannelResponse(channel), nil } +// NextSequenceSend implements the Query/NextSequenceSend gRPC method +func (q *queryServer) NextSequenceSend(ctx context.Context, req *types.QueryNextSequenceSendRequest) (*types.QueryNextSequenceSendResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if err := host.ChannelIdentifierValidator(req.ChannelId); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + sequence, found := q.GetNextSequenceSend(ctx, req.ChannelId) + if !found { + return nil, status.Error( + codes.NotFound, + errorsmod.Wrapf(types.ErrSequenceSendNotFound, "channel-id %s", req.ChannelId).Error(), + ) + } + return types.NewQueryNextSequenceSendResponse(sequence, nil, clienttypes.GetSelfHeight(ctx)), nil +} + // PacketCommitment implements the Query/PacketCommitment gRPC method. func (q *queryServer) PacketCommitment(ctx context.Context, req *types.QueryPacketCommitmentRequest) (*types.QueryPacketCommitmentResponse, error) { if req == nil { diff --git a/modules/core/04-channel/v2/keeper/grpc_query_test.go b/modules/core/04-channel/v2/keeper/grpc_query_test.go index faecb9a2595..40a2ba07b4c 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query_test.go +++ b/modules/core/04-channel/v2/keeper/grpc_query_test.go @@ -514,3 +514,75 @@ func (suite *KeeperTestSuite) TestQueryPacketReceipt() { }) } } + +func (suite *KeeperTestSuite) TestQueryNextSequenceSend() { + var ( + req *types.QueryNextSequenceSendRequest + expSeq uint64 + ) + + testCases := []struct { + msg string + malleate func() + expError error + }{ + { + "success", + func() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.Setup() + + expSeq = 42 + seq := uint64(42) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetNextSequenceSend(suite.chainA.GetContext(), path.EndpointA.ChannelID, seq) + req = types.NewQueryNextSequenceSendRequest(path.EndpointA.ChannelID) + }, + nil, + }, + { + "req is nil", + func() { + req = nil + }, + status.Error(codes.InvalidArgument, "empty request"), + }, + { + "invalid channel ID", + func() { + req = types.NewQueryNextSequenceSendRequest("") + }, + status.Error(codes.InvalidArgument, "identifier cannot be blank: invalid identifier"), + }, + { + "sequence send not found", + func() { + req = types.NewQueryNextSequenceSendRequest(ibctesting.FirstChannelID) + }, + status.Error(codes.NotFound, fmt.Sprintf("channel-id %s: sequence send not found", ibctesting.FirstChannelID)), + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() // reset + + tc.malleate() + ctx := suite.chainA.GetContext() + + queryServer := keeper.NewQueryServer(suite.chainA.App.GetIBCKeeper().ChannelKeeperV2) + res, err := queryServer.NextSequenceSend(ctx, req) + + expPass := tc.expError == nil + if expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(expSeq, res.NextSequenceSend) + } else { + suite.Require().ErrorIs(err, tc.expError) + suite.Require().Nil(res) + } + }) + } +} diff --git a/modules/core/04-channel/v2/types/query.go b/modules/core/04-channel/v2/types/query.go index 985be5c6dd4..2a70a6481b2 100644 --- a/modules/core/04-channel/v2/types/query.go +++ b/modules/core/04-channel/v2/types/query.go @@ -16,6 +16,24 @@ func NewQueryChannelResponse(channel Channel) *QueryChannelResponse { } } +// NewQueryNextSequenceSendRequest creates a new next sequence send query. +func NewQueryNextSequenceSendRequest(channelID string) *QueryNextSequenceSendRequest { + return &QueryNextSequenceSendRequest{ + ChannelId: channelID, + } +} + +// NewQueryNextSequenceSendResponse creates a new QueryNextSequenceSendResponse instance +func NewQueryNextSequenceSendResponse( + sequence uint64, proof []byte, height clienttypes.Height, +) *QueryNextSequenceSendResponse { + return &QueryNextSequenceSendResponse{ + NextSequenceSend: sequence, + Proof: proof, + ProofHeight: height, + } +} + // NewQueryPacketCommitmentRequest creates and returns a new packet commitment query request. func NewQueryPacketCommitmentRequest(channelID string, sequence uint64) *QueryPacketCommitmentRequest { return &QueryPacketCommitmentRequest{ diff --git a/modules/core/04-channel/v2/types/query.pb.go b/modules/core/04-channel/v2/types/query.pb.go index 897cd508b6d..e6213b0c5b1 100644 --- a/modules/core/04-channel/v2/types/query.pb.go +++ b/modules/core/04-channel/v2/types/query.pb.go @@ -122,6 +122,116 @@ func (m *QueryChannelResponse) GetChannel() Channel { return Channel{} } +// QueryNextSequenceSendRequest is the request type for the Query/QueryNextSequenceSend RPC method +type QueryNextSequenceSendRequest struct { + // channel unique identifier + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (m *QueryNextSequenceSendRequest) Reset() { *m = QueryNextSequenceSendRequest{} } +func (m *QueryNextSequenceSendRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextSequenceSendRequest) ProtoMessage() {} +func (*QueryNextSequenceSendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a328cba4986edcab, []int{2} +} +func (m *QueryNextSequenceSendRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextSequenceSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextSequenceSendRequest.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 *QueryNextSequenceSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextSequenceSendRequest.Merge(m, src) +} +func (m *QueryNextSequenceSendRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextSequenceSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextSequenceSendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextSequenceSendRequest proto.InternalMessageInfo + +func (m *QueryNextSequenceSendRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +// QueryNextSequenceSendResponse is the response type for the Query/QueryNextSequenceSend RPC method +type QueryNextSequenceSendResponse struct { + // next sequence send number + NextSequenceSend uint64 `protobuf:"varint,1,opt,name=next_sequence_send,json=nextSequenceSend,proto3" json:"next_sequence_send,omitempty"` + // merkle proof of existence + Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + // height at which the proof was retrieved + ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` +} + +func (m *QueryNextSequenceSendResponse) Reset() { *m = QueryNextSequenceSendResponse{} } +func (m *QueryNextSequenceSendResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextSequenceSendResponse) ProtoMessage() {} +func (*QueryNextSequenceSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a328cba4986edcab, []int{3} +} +func (m *QueryNextSequenceSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextSequenceSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextSequenceSendResponse.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 *QueryNextSequenceSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextSequenceSendResponse.Merge(m, src) +} +func (m *QueryNextSequenceSendResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextSequenceSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextSequenceSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextSequenceSendResponse proto.InternalMessageInfo + +func (m *QueryNextSequenceSendResponse) GetNextSequenceSend() uint64 { + if m != nil { + return m.NextSequenceSend + } + return 0 +} + +func (m *QueryNextSequenceSendResponse) GetProof() []byte { + if m != nil { + return m.Proof + } + return nil +} + +func (m *QueryNextSequenceSendResponse) GetProofHeight() types.Height { + if m != nil { + return m.ProofHeight + } + return types.Height{} +} + // QueryPacketCommitmentRequest is the request type for the Query/PacketCommitment RPC method. type QueryPacketCommitmentRequest struct { // channel unique identifier @@ -134,7 +244,7 @@ func (m *QueryPacketCommitmentRequest) Reset() { *m = QueryPacketCommitm func (m *QueryPacketCommitmentRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentRequest) ProtoMessage() {} func (*QueryPacketCommitmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{2} + return fileDescriptor_a328cba4986edcab, []int{4} } func (m *QueryPacketCommitmentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -191,7 +301,7 @@ func (m *QueryPacketCommitmentResponse) Reset() { *m = QueryPacketCommit func (m *QueryPacketCommitmentResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentResponse) ProtoMessage() {} func (*QueryPacketCommitmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{3} + return fileDescriptor_a328cba4986edcab, []int{5} } func (m *QueryPacketCommitmentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -253,7 +363,7 @@ func (m *QueryPacketCommitmentsRequest) Reset() { *m = QueryPacketCommit func (m *QueryPacketCommitmentsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentsRequest) ProtoMessage() {} func (*QueryPacketCommitmentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{4} + return fileDescriptor_a328cba4986edcab, []int{6} } func (m *QueryPacketCommitmentsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,7 +420,7 @@ func (m *QueryPacketCommitmentsResponse) Reset() { *m = QueryPacketCommi func (m *QueryPacketCommitmentsResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentsResponse) ProtoMessage() {} func (*QueryPacketCommitmentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{5} + return fileDescriptor_a328cba4986edcab, []int{7} } func (m *QueryPacketCommitmentsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -372,7 +482,7 @@ func (m *QueryPacketAcknowledgementRequest) Reset() { *m = QueryPacketAc func (m *QueryPacketAcknowledgementRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementRequest) ProtoMessage() {} func (*QueryPacketAcknowledgementRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{6} + return fileDescriptor_a328cba4986edcab, []int{8} } func (m *QueryPacketAcknowledgementRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -429,7 +539,7 @@ func (m *QueryPacketAcknowledgementResponse) Reset() { *m = QueryPacketA func (m *QueryPacketAcknowledgementResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementResponse) ProtoMessage() {} func (*QueryPacketAcknowledgementResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{7} + return fileDescriptor_a328cba4986edcab, []int{9} } func (m *QueryPacketAcknowledgementResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -493,7 +603,7 @@ func (m *QueryPacketReceiptRequest) Reset() { *m = QueryPacketReceiptReq func (m *QueryPacketReceiptRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketReceiptRequest) ProtoMessage() {} func (*QueryPacketReceiptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{8} + return fileDescriptor_a328cba4986edcab, []int{10} } func (m *QueryPacketReceiptRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -557,7 +667,7 @@ func (m *QueryPacketReceiptResponse) Reset() { *m = QueryPacketReceiptRe func (m *QueryPacketReceiptResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketReceiptResponse) ProtoMessage() {} func (*QueryPacketReceiptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{9} + return fileDescriptor_a328cba4986edcab, []int{11} } func (m *QueryPacketReceiptResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -610,6 +720,8 @@ func (m *QueryPacketReceiptResponse) GetProofHeight() types.Height { func init() { proto.RegisterType((*QueryChannelRequest)(nil), "ibc.core.channel.v2.QueryChannelRequest") proto.RegisterType((*QueryChannelResponse)(nil), "ibc.core.channel.v2.QueryChannelResponse") + proto.RegisterType((*QueryNextSequenceSendRequest)(nil), "ibc.core.channel.v2.QueryNextSequenceSendRequest") + proto.RegisterType((*QueryNextSequenceSendResponse)(nil), "ibc.core.channel.v2.QueryNextSequenceSendResponse") proto.RegisterType((*QueryPacketCommitmentRequest)(nil), "ibc.core.channel.v2.QueryPacketCommitmentRequest") proto.RegisterType((*QueryPacketCommitmentResponse)(nil), "ibc.core.channel.v2.QueryPacketCommitmentResponse") proto.RegisterType((*QueryPacketCommitmentsRequest)(nil), "ibc.core.channel.v2.QueryPacketCommitmentsRequest") @@ -623,58 +735,63 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/query.proto", fileDescriptor_a328cba4986edcab) } var fileDescriptor_a328cba4986edcab = []byte{ - // 810 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0x4d, 0x4f, 0x13, 0x5d,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, 0x26, 0xc7, 0x3e, 0x9f, 0xc9, - 0xb1, 0x67, 0xcb, 0x96, 0xed, 0x17, 0xab, 0x79, 0xd5, 0x64, 0x65, 0x22, 0x3e, 0xe0, 0xec, 0xbc, - 0xb9, 0x60, 0x31, 0x52, 0xbb, 0x4d, 0xca, 0xac, 0x50, 0x2d, 0x51, 0x2f, 0x38, 0xff, 0xfa, 0xd2, - 0x42, 0x08, 0xc1, 0xdf, 0x73, 0xa9, 0x97, 0x1f, 0xe5, 0xdf, 0x4c, 0x8b, 0x3f, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x78, 0xf5, 0x4d, 0xe9, 0x32, 0x0a, 0x00, 0x00, + // 883 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x3d, 0xb1, 0x9b, 0x1f, 0xcf, 0x41, 0x84, 0x69, 0x10, 0x66, 0x95, 0x6e, 0xdd, 0x3d, + 0x80, 0xa9, 0xda, 0x1d, 0xbc, 0xad, 0xf8, 0x21, 0xb5, 0x42, 0x8d, 0x55, 0xda, 0x20, 0x81, 0xc2, + 0x06, 0x21, 0xc1, 0x01, 0x6b, 0xbd, 0x1e, 0xd6, 0xab, 0xd8, 0x33, 0x5b, 0xef, 0xd8, 0xb4, 0xaa, + 0x7a, 0xe1, 0xc0, 0x85, 0x0b, 0xa2, 0x37, 0xfe, 0x02, 0xf8, 0x2b, 0x40, 0xe2, 0x12, 0x89, 0x4b, + 0xa4, 0x5c, 0x38, 0x21, 0x94, 0x20, 0xf1, 0x6f, 0x20, 0xcf, 0x8c, 0xed, 0xb5, 0xbd, 0x76, 0xbc, + 0x40, 0x6e, 0x33, 0xe3, 0xf7, 0xde, 0x7c, 0xbe, 0xdf, 0x9d, 0x79, 0x63, 0xb8, 0x1a, 0x36, 0x7c, + 0xe2, 0xf3, 0x2e, 0x25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03, 0x4e, 0xfa, 0xef, 0x92, 0x0e, + 0x6f, 0xf6, 0xda, 0x34, 0x56, 0xfb, 0xbf, 0x79, 0xfb, 0x66, 0x02, 0x41, 0x3c, 0x89, 0x68, 0xdc, + 0x58, 0x95, 0x7f, 0x70, 0x6f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x7f, 0x40, 0x76, 0xdf, + 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -691,6 +808,8 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Channel queries the counterparty of an IBC client. Channel(ctx context.Context, in *QueryChannelRequest, opts ...grpc.CallOption) (*QueryChannelResponse, error) + // NextSequenceSend returns the next send sequence for a given channel. + NextSequenceSend(ctx context.Context, in *QueryNextSequenceSendRequest, opts ...grpc.CallOption) (*QueryNextSequenceSendResponse, error) // PacketCommitment queries a stored packet commitment hash. PacketCommitment(ctx context.Context, in *QueryPacketCommitmentRequest, opts ...grpc.CallOption) (*QueryPacketCommitmentResponse, error) // PacketCommitments queries a stored packet commitment hash. @@ -718,6 +837,15 @@ func (c *queryClient) Channel(ctx context.Context, in *QueryChannelRequest, opts return out, nil } +func (c *queryClient) NextSequenceSend(ctx context.Context, in *QueryNextSequenceSendRequest, opts ...grpc.CallOption) (*QueryNextSequenceSendResponse, error) { + out := new(QueryNextSequenceSendResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/NextSequenceSend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) PacketCommitment(ctx context.Context, in *QueryPacketCommitmentRequest, opts ...grpc.CallOption) (*QueryPacketCommitmentResponse, error) { out := new(QueryPacketCommitmentResponse) err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/PacketCommitment", in, out, opts...) @@ -758,6 +886,8 @@ func (c *queryClient) PacketReceipt(ctx context.Context, in *QueryPacketReceiptR type QueryServer interface { // Channel queries the counterparty of an IBC client. Channel(context.Context, *QueryChannelRequest) (*QueryChannelResponse, error) + // NextSequenceSend returns the next send sequence for a given channel. + NextSequenceSend(context.Context, *QueryNextSequenceSendRequest) (*QueryNextSequenceSendResponse, error) // PacketCommitment queries a stored packet commitment hash. PacketCommitment(context.Context, *QueryPacketCommitmentRequest) (*QueryPacketCommitmentResponse, error) // PacketCommitments queries a stored packet commitment hash. @@ -775,6 +905,9 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Channel(ctx context.Context, req *QueryChannelRequest) (*QueryChannelResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Channel not implemented") } +func (*UnimplementedQueryServer) NextSequenceSend(ctx context.Context, req *QueryNextSequenceSendRequest) (*QueryNextSequenceSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextSequenceSend not implemented") +} func (*UnimplementedQueryServer) PacketCommitment(ctx context.Context, req *QueryPacketCommitmentRequest) (*QueryPacketCommitmentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PacketCommitment not implemented") } @@ -810,6 +943,24 @@ func _Query_Channel_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_NextSequenceSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextSequenceSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextSequenceSend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v2.Query/NextSequenceSend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextSequenceSend(ctx, req.(*QueryNextSequenceSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_PacketCommitment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryPacketCommitmentRequest) if err := dec(in); err != nil { @@ -890,6 +1041,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Channel", Handler: _Query_Channel_Handler, }, + { + MethodName: "NextSequenceSend", + Handler: _Query_NextSequenceSend_Handler, + }, { MethodName: "PacketCommitment", Handler: _Query_PacketCommitment_Handler, @@ -974,6 +1129,81 @@ func (m *QueryChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryNextSequenceSendRequest) 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 *QueryNextSequenceSendRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextSequenceSendRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryNextSequenceSendResponse) 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 *QueryNextSequenceSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextSequenceSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x12 + } + if m.NextSequenceSend != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextSequenceSend)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *QueryPacketCommitmentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1366,6 +1596,37 @@ func (m *QueryChannelResponse) Size() (n int) { return n } +func (m *QueryNextSequenceSendRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryNextSequenceSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextSequenceSend != 0 { + n += 1 + sovQuery(uint64(m.NextSequenceSend)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = m.ProofHeight.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryPacketCommitmentRequest) Size() (n int) { if m == nil { return 0 @@ -1683,6 +1944,224 @@ func (m *QueryChannelResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextSequenceSendRequest) 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 ErrIntOverflowQuery + } + 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: QueryNextSequenceSendRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextSequenceSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNextSequenceSendResponse) 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 ErrIntOverflowQuery + } + 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: QueryNextSequenceSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextSequenceSendResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceSend", wireType) + } + m.NextSequenceSend = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextSequenceSend |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) + if m.Proof == nil { + m.Proof = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryPacketCommitmentRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/04-channel/v2/types/query.pb.gw.go b/modules/core/04-channel/v2/types/query.pb.gw.go index 07dbf642b72..7cbe955c0fb 100644 --- a/modules/core/04-channel/v2/types/query.pb.gw.go +++ b/modules/core/04-channel/v2/types/query.pb.gw.go @@ -87,6 +87,60 @@ func local_request_Query_Channel_0(ctx context.Context, marshaler runtime.Marsha } +func request_Query_NextSequenceSend_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextSequenceSendRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + msg, err := client.NextSequenceSend(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NextSequenceSend_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextSequenceSendRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + msg, err := server.NextSequenceSend(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_PacketCommitment_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryPacketCommitmentRequest var metadata runtime.ServerMetadata @@ -434,6 +488,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NextSequenceSend_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NextSequenceSend_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextSequenceSend_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_PacketCommitment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -587,6 +664,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NextSequenceSend_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NextSequenceSend_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextSequenceSend_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_PacketCommitment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -673,6 +770,8 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Channel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_NextSequenceSend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "next_sequence_send"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_PacketCommitment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_commitments", "sequence"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PacketCommitments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "packet_commitments"}, "", runtime.AssumeColonVerbOpt(false))) @@ -685,6 +784,8 @@ var ( var ( forward_Query_Channel_0 = runtime.ForwardResponseMessage + forward_Query_NextSequenceSend_0 = runtime.ForwardResponseMessage + forward_Query_PacketCommitment_0 = runtime.ForwardResponseMessage forward_Query_PacketCommitments_0 = runtime.ForwardResponseMessage diff --git a/proto/ibc/core/channel/v2/query.proto b/proto/ibc/core/channel/v2/query.proto index 00b60fd6891..f9df59fcfaf 100644 --- a/proto/ibc/core/channel/v2/query.proto +++ b/proto/ibc/core/channel/v2/query.proto @@ -18,6 +18,11 @@ service Query { option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}"; } + // NextSequenceSend returns the next send sequence for a given channel. + rpc NextSequenceSend(QueryNextSequenceSendRequest) returns (QueryNextSequenceSendResponse) { + option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/next_sequence_send"; + } + // PacketCommitment queries a stored packet commitment hash. rpc PacketCommitment(QueryPacketCommitmentRequest) returns (QueryPacketCommitmentResponse) { option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/packet_commitments/{sequence}"; @@ -50,6 +55,22 @@ message QueryChannelResponse { Channel channel = 1 [(gogoproto.nullable) = false]; } +// QueryNextSequenceSendRequest is the request type for the Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendRequest { + // channel unique identifier + string channel_id = 1; +} + +// QueryNextSequenceSendResponse is the response type for the Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendResponse { + // next sequence send number + uint64 next_sequence_send = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + // QueryPacketCommitmentRequest is the request type for the Query/PacketCommitment RPC method. message QueryPacketCommitmentRequest { // channel unique identifier From 43584bfc05d337cd761919f90659303b15789be8 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 12 Nov 2024 18:28:43 +0200 Subject: [PATCH 22/23] chore: make AliasV1Channel a private function. --- modules/core/04-channel/v2/keeper/export_test.go | 5 +++++ modules/core/04-channel/v2/keeper/keeper.go | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/core/04-channel/v2/keeper/export_test.go b/modules/core/04-channel/v2/keeper/export_test.go index aae6048ed2a..6da7c89c873 100644 --- a/modules/core/04-channel/v2/keeper/export_test.go +++ b/modules/core/04-channel/v2/keeper/export_test.go @@ -68,3 +68,8 @@ func (k *Keeper) TimeoutPacketTest( proofHeight, ) } + +// AliasV1Channel is a wrapper around aliasV1Channel to allow its usage in tests. +func (k *Keeper) AliasV1Channel(ctx context.Context, portID, channelID string) (types.Channel, bool) { + return k.aliasV1Channel(ctx, portID, channelID) +} diff --git a/modules/core/04-channel/v2/keeper/keeper.go b/modules/core/04-channel/v2/keeper/keeper.go index fe1ad9b8a23..1b8d5398aba 100644 --- a/modules/core/04-channel/v2/keeper/keeper.go +++ b/modules/core/04-channel/v2/keeper/keeper.go @@ -213,9 +213,9 @@ func (k *Keeper) SetNextSequenceSend(ctx context.Context, channelID string, sequ } } -// AliasV1Channel returns a version 2 channel for the given port and channel ID +// aliasV1Channel returns a version 2 channel for the given port and channel ID // by converting the channel into a version 2 channel. -func (k *Keeper) AliasV1Channel(ctx context.Context, portID, channelID string) (types.Channel, bool) { +func (k *Keeper) aliasV1Channel(ctx context.Context, portID, channelID string) (types.Channel, bool) { channel, ok := k.channelKeeperV1.GetChannel(ctx, portID, channelID) if !ok { return types.Channel{}, false @@ -242,7 +242,7 @@ func (k *Keeper) AliasV1Channel(ctx context.Context, portID, channelID string) ( // convertV1Channel attempts to retrieve a v1 channel from the channel keeper if it exists, then converts it // to a v2 counterparty and stores it in the v2 channel keeper for future use func (k *Keeper) convertV1Channel(ctx context.Context, port, id string) (types.Channel, bool) { - if channel, ok := k.AliasV1Channel(ctx, port, id); ok { + if channel, ok := k.aliasV1Channel(ctx, port, id); ok { // we can key on just the channel here since channel ids are globally unique k.SetChannel(ctx, id, channel) return channel, true From 831a351d159e7220e104cd5e4e95018a138bcb50 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 12 Nov 2024 18:45:43 +0200 Subject: [PATCH 23/23] nit: consistent import name for 24-host/v2 --- modules/core/04-channel/v2/client/cli/abci.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/core/04-channel/v2/client/cli/abci.go b/modules/core/04-channel/v2/client/cli/abci.go index 5069eddf03e..d341e35b4e2 100644 --- a/modules/core/04-channel/v2/client/cli/abci.go +++ b/modules/core/04-channel/v2/client/cli/abci.go @@ -8,12 +8,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" - host "github.com/cosmos/ibc-go/v9/modules/core/24-host/v2" + hostv2 "github.com/cosmos/ibc-go/v9/modules/core/24-host/v2" ibcclient "github.com/cosmos/ibc-go/v9/modules/core/client" ) func queryNextSequenceSendABCI(clientCtx client.Context, channelID string) (*types.QueryNextSequenceSendResponse, error) { - key := host.NextSequenceSendKey(channelID) + key := hostv2.NextSequenceSendKey(channelID) value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) if err != nil { return nil, err @@ -30,7 +30,7 @@ func queryNextSequenceSendABCI(clientCtx client.Context, channelID string) (*typ } func queryPacketCommitmentABCI(clientCtx client.Context, channelID string, sequence uint64) (*types.QueryPacketCommitmentResponse, error) { - key := host.PacketCommitmentKey(channelID, sequence) + key := hostv2.PacketCommitmentKey(channelID, sequence) value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) if err != nil { return nil, err @@ -45,7 +45,7 @@ func queryPacketCommitmentABCI(clientCtx client.Context, channelID string, seque } func queryPacketAcknowledgementABCI(clientCtx client.Context, channelID string, sequence uint64) (*types.QueryPacketAcknowledgementResponse, error) { - key := host.PacketAcknowledgementKey(channelID, sequence) + key := hostv2.PacketAcknowledgementKey(channelID, sequence) value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) if err != nil { return nil, err @@ -60,7 +60,7 @@ func queryPacketAcknowledgementABCI(clientCtx client.Context, channelID string, } func queryPacketReceiptABCI(clientCtx client.Context, channelID string, sequence uint64) (*types.QueryPacketReceiptResponse, error) { - key := host.PacketReceiptKey(channelID, sequence) + key := hostv2.PacketReceiptKey(channelID, sequence) value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) if err != nil {