From 34cbe05aaf09d92a710e7630aeed45e0ad03d177 Mon Sep 17 00:00:00 2001 From: sangier <45793271+sangier@users.noreply.github.com> Date: Tue, 14 Nov 2023 19:31:26 +0100 Subject: [PATCH] imp: remove `LatestSequenceSend` (#5108) * del: latestsequencesend field * fix: comment * gofumpt * del: tests * del leftover tests part * adressing comments * addressing comment --------- Co-authored-by: sangier Co-authored-by: sangier Co-authored-by: Carlos Rodriguez --- e2e/tests/core/02-client/client_test.go | 1 - e2e/testsuite/grpc_query.go | 18 ++-- modules/core/04-channel/keeper/packet.go | 18 ---- modules/core/04-channel/keeper/packet_test.go | 61 ------------- modules/core/04-channel/keeper/upgrade.go | 6 -- .../core/04-channel/keeper/upgrade_test.go | 17 ---- modules/core/04-channel/types/upgrade.go | 5 +- modules/core/04-channel/types/upgrade.pb.go | 87 ++++++------------- proto/ibc/core/channel/v1/upgrade.proto | 8 +- testing/endpoint.go | 3 +- 10 files changed, 43 insertions(+), 181 deletions(-) diff --git a/e2e/tests/core/02-client/client_test.go b/e2e/tests/core/02-client/client_test.go index 62ab6baeb25..9d6159b0942 100644 --- a/e2e/tests/core/02-client/client_test.go +++ b/e2e/tests/core/02-client/client_test.go @@ -133,7 +133,6 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() { }) t.Run("ensure legacy proposal does not succeed", func(t *testing.T) { - authority, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainA) s.Require().NoError(err) s.Require().NotNil(authority) diff --git a/e2e/testsuite/grpc_query.go b/e2e/testsuite/grpc_query.go index 38f2ab0e2b8..ae0257da567 100644 --- a/e2e/testsuite/grpc_query.go +++ b/e2e/testsuite/grpc_query.go @@ -85,15 +85,15 @@ func (s *E2ETestSuite) InitGRPCClients(chain *cosmos.CosmosChain) { FeeQueryClient: feetypes.NewQueryClient(grpcConn), ICAControllerQueryClient: controllertypes.NewQueryClient(grpcConn), ICAHostQueryClient: hosttypes.NewQueryClient(grpcConn), - BankQueryClient: banktypes.NewQueryClient(grpcConn), - GovQueryClient: govtypesv1beta1.NewQueryClient(grpcConn), - GovQueryClientV1: govtypesv1.NewQueryClient(grpcConn), - GroupsQueryClient: grouptypes.NewQueryClient(grpcConn), - ParamsQueryClient: paramsproposaltypes.NewQueryClient(grpcConn), - AuthQueryClient: authtypes.NewQueryClient(grpcConn), - AuthZQueryClient: authz.NewQueryClient(grpcConn), - ConsensusServiceClient: cmtservice.NewServiceClient(grpcConn), - UpgradeQueryClient: upgradetypes.NewQueryClient(grpcConn), + BankQueryClient: banktypes.NewQueryClient(grpcConn), + GovQueryClient: govtypesv1beta1.NewQueryClient(grpcConn), + GovQueryClientV1: govtypesv1.NewQueryClient(grpcConn), + GroupsQueryClient: grouptypes.NewQueryClient(grpcConn), + ParamsQueryClient: paramsproposaltypes.NewQueryClient(grpcConn), + AuthQueryClient: authtypes.NewQueryClient(grpcConn), + AuthZQueryClient: authz.NewQueryClient(grpcConn), + ConsensusServiceClient: cmtservice.NewServiceClient(grpcConn), + UpgradeQueryClient: upgradetypes.NewQueryClient(grpcConn), } } diff --git a/modules/core/04-channel/keeper/packet.go b/modules/core/04-channel/keeper/packet.go index 75e6c691730..8b7a5f79082 100644 --- a/modules/core/04-channel/keeper/packet.go +++ b/modules/core/04-channel/keeper/packet.go @@ -132,24 +132,6 @@ func (k Keeper) RecvPacket( return errorsmod.Wrapf(types.ErrInvalidChannelState, "expected channel state to be one of [%s, %s], but got %s", types.OPEN, types.FLUSHING, channel.State) } - // in the case of the channel being in FLUSHING we need to ensure that the the counterparty last sequence send - // is less than or equal to the packet sequence. - if channel.State == types.FLUSHING { - counterpartyUpgrade, found := k.GetCounterpartyUpgrade(ctx, packet.GetDestPort(), packet.GetDestChannel()) - if !found { - return errorsmod.Wrapf(types.ErrUpgradeNotFound, "counterparty upgrade not found for channel: %s", packet.GetDestChannel()) - } - - // only error if the counterparty latest sequence send is set (> 0) - counterpartyLatestSequenceSend := counterpartyUpgrade.LatestSequenceSend - if counterpartyLatestSequenceSend != 0 && packet.GetSequence() > counterpartyLatestSequenceSend { - return errorsmod.Wrapf( - types.ErrInvalidPacket, - "failed to receive packet, cannot flush packet at sequence greater than counterparty last sequence send (%d) > (%d)", packet.GetSequence(), counterpartyLatestSequenceSend, - ) - } - } - // Authenticate capability to ensure caller has authority to receive packet on this channel capName := host.ChannelCapabilityPath(packet.GetDestPort(), packet.GetDestChannel()) if !k.scopedKeeper.AuthenticateCapability(ctx, chanCap, capName) { diff --git a/modules/core/04-channel/keeper/packet_test.go b/modules/core/04-channel/keeper/packet_test.go index f9202ce7682..b549725ab38 100644 --- a/modules/core/04-channel/keeper/packet_test.go +++ b/modules/core/04-channel/keeper/packet_test.go @@ -347,70 +347,9 @@ func (suite *KeeperTestSuite) TestRecvPacket() { channel := path.EndpointB.GetChannel() channel.State = types.FLUSHING path.EndpointB.SetChannel(channel) - - // set last packet sent sequence to sequence + 1 - counterpartyUpgrade := types.Upgrade{LatestSequenceSend: sequence + 1} - path.EndpointB.SetChannelCounterpartyUpgrade(counterpartyUpgrade) - }, - nil, - }, - { - "success with an counterparty latest sequence send set to 0", - func() { - suite.coordinator.Setup(path) - sequence, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) - suite.Require().NoError(err) - - packet = types.NewPacket(ibctesting.MockPacketData, sequence, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, defaultTimeoutHeight, disabledTimeoutTimestamp) - channelCap = suite.chainB.GetChannelCapability(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - - channel := path.EndpointB.GetChannel() - channel.State = types.FLUSHING - path.EndpointB.SetChannel(channel) - - // set last packet sent sequence to zero. - counterpartyUpgrade := types.Upgrade{LatestSequenceSend: 0} - path.EndpointB.SetChannelCounterpartyUpgrade(counterpartyUpgrade) }, nil, }, - { - "failure while upgrading channel, counterparty upgrade not found", - func() { - suite.coordinator.Setup(path) - sequence, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) - suite.Require().NoError(err) - packet = types.NewPacket(ibctesting.MockPacketData, sequence, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, defaultTimeoutHeight, disabledTimeoutTimestamp) - channelCap = suite.chainB.GetChannelCapability(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - - channel := path.EndpointB.GetChannel() - channel.State = types.FLUSHING - path.EndpointB.SetChannel(channel) - }, - types.ErrUpgradeNotFound, - }, - { - "failure while upgrading channel, packet sequence > counterparty last send sequence", - func() { - suite.coordinator.Setup(path) - // send 2 packets so that when LatestSequenceSend is set to sequence - 1, it is not 0. - _, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) - suite.Require().NoError(err) - sequence, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) - suite.Require().NoError(err) - packet = types.NewPacket(ibctesting.MockPacketData, sequence, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, defaultTimeoutHeight, disabledTimeoutTimestamp) - channelCap = suite.chainB.GetChannelCapability(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - - channel := path.EndpointB.GetChannel() - channel.State = types.FLUSHING - path.EndpointB.SetChannel(channel) - - // set last packet sent sequence to sequence - 1 - counterpartyUpgrade := types.Upgrade{LatestSequenceSend: sequence - 1} - path.EndpointB.SetChannelCounterpartyUpgrade(counterpartyUpgrade) - }, - types.ErrInvalidPacket, - }, { "failure while upgrading channel, channel in flush complete state", func() { diff --git a/modules/core/04-channel/keeper/upgrade.go b/modules/core/04-channel/keeper/upgrade.go index b6c7ceb6874..656826e51cf 100644 --- a/modules/core/04-channel/keeper/upgrade.go +++ b/modules/core/04-channel/keeper/upgrade.go @@ -763,12 +763,6 @@ func (k Keeper) startFlushing(ctx sdk.Context, portID, channelID string, upgrade channel.State = types.FLUSHING k.SetChannel(ctx, portID, channelID, channel) - nextSequenceSend, found := k.GetNextSequenceSend(ctx, portID, channelID) - if !found { - return errorsmod.Wrapf(types.ErrSequenceSendNotFound, "port ID (%s) channel ID (%s)", portID, channelID) - } - - upgrade.LatestSequenceSend = nextSequenceSend - 1 upgrade.Timeout = k.getAbsoluteUpgradeTimeout(ctx) k.SetUpgrade(ctx, portID, channelID, *upgrade) diff --git a/modules/core/04-channel/keeper/upgrade_test.go b/modules/core/04-channel/keeper/upgrade_test.go index 9f54b17c510..207e8e5873b 100644 --- a/modules/core/04-channel/keeper/upgrade_test.go +++ b/modules/core/04-channel/keeper/upgrade_test.go @@ -301,10 +301,6 @@ func (suite *KeeperTestSuite) TestChanUpgradeTry() { suite.Require().NoError(err) suite.Require().NotEmpty(upgrade) suite.Require().Equal(proposedUpgrade.Fields, upgrade.Fields) - - nextSequenceSend, found := path.EndpointB.Chain.GetSimApp().IBCKeeper.ChannelKeeper.GetNextSequenceSend(path.EndpointB.Chain.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - suite.Require().True(found) - suite.Require().Equal(nextSequenceSend-1, upgrade.LatestSequenceSend) } else { suite.assertUpgradeError(err, tc.expError) } @@ -489,14 +485,6 @@ func (suite *KeeperTestSuite) TestChanUpgradeAck() { }, commitmenttypes.ErrInvalidProof, }, - { - "fails due to proof verification failure, counterparty update has unexpected sequence", - func() { - // Decrementing LatestSequenceSend is sufficient to cause the proof to fail. - counterpartyUpgrade.LatestSequenceSend-- - }, - commitmenttypes.ErrInvalidProof, - }, { "fails due to mismatch in upgrade ordering", func() { @@ -1757,12 +1745,7 @@ func (suite *KeeperTestSuite) TestStartFlush() { suite.assertUpgradeError(err, tc.expError) } else { channel := path.EndpointB.GetChannel() - - nextSequenceSend, ok := suite.chainB.GetSimApp().IBCKeeper.ChannelKeeper.GetNextSequenceSend(suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - suite.Require().True(ok) - suite.Require().Equal(types.FLUSHING, channel.State) - suite.Require().Equal(nextSequenceSend-1, upgrade.LatestSequenceSend) expectedTimeoutTimestamp := types.DefaultTimeout.Timestamp + uint64(suite.chainB.GetContext().BlockTime().UnixNano()) suite.Require().Equal(expectedTimeoutTimestamp, upgrade.Timeout.Timestamp) diff --git a/modules/core/04-channel/types/upgrade.go b/modules/core/04-channel/types/upgrade.go index 278edc0fb01..eb2c5b1a753 100644 --- a/modules/core/04-channel/types/upgrade.go +++ b/modules/core/04-channel/types/upgrade.go @@ -12,9 +12,8 @@ import ( // NewUpgrade creates a new Upgrade instance. func NewUpgrade(upgradeFields UpgradeFields, timeout Timeout, latestPacketSent uint64) Upgrade { return Upgrade{ - Fields: upgradeFields, - Timeout: timeout, - LatestSequenceSend: latestPacketSent, + Fields: upgradeFields, + Timeout: timeout, } } diff --git a/modules/core/04-channel/types/upgrade.pb.go b/modules/core/04-channel/types/upgrade.pb.go index 0a7c6828716..5a8fca81909 100644 --- a/modules/core/04-channel/types/upgrade.pb.go +++ b/modules/core/04-channel/types/upgrade.pb.go @@ -25,12 +25,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Upgrade is a verifiable type which contains the relevant information // for an attempted upgrade. It provides the proposed changes to the channel -// end, the timeout for this upgrade attempt and the latest packet sequence sent -// to allow the counterparty to block sends after the upgrade has started. +// end and the timeout for this upgrade attempt. type Upgrade struct { - Fields UpgradeFields `protobuf:"bytes,1,opt,name=fields,proto3" json:"fields"` - Timeout Timeout `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout"` - LatestSequenceSend uint64 `protobuf:"varint,3,opt,name=latest_sequence_send,json=latestSequenceSend,proto3" json:"latest_sequence_send,omitempty"` + Fields UpgradeFields `protobuf:"bytes,1,opt,name=fields,proto3" json:"fields"` + Timeout Timeout `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout"` } func (m *Upgrade) Reset() { *m = Upgrade{} } @@ -159,33 +157,31 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/upgrade.proto", fileDescriptor_fb1cef68588848b2) } var fileDescriptor_fb1cef68588848b2 = []byte{ - // 407 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xd4, 0x30, - 0x10, 0x86, 0xe3, 0x76, 0xd5, 0xed, 0x1a, 0x28, 0x92, 0xe9, 0x21, 0x5a, 0xa1, 0x74, 0xd9, 0x0b, - 0x7b, 0x69, 0xdc, 0x16, 0x84, 0x00, 0x71, 0x40, 0x95, 0x40, 0x88, 0x0b, 0x92, 0x17, 0x2e, 0x5c, - 0x56, 0x1b, 0x67, 0xc8, 0x5a, 0x4a, 0x3c, 0xc1, 0x76, 0x22, 0xf1, 0x06, 0x1c, 0xfb, 0x08, 0xbc, - 0x0a, 0xb7, 0x1e, 0x7b, 0xe4, 0x84, 0xd0, 0xee, 0x8b, 0xa0, 0x38, 0x49, 0x11, 0x52, 0x6e, 0x99, - 0xcc, 0xf7, 0xff, 0xfe, 0xc7, 0x63, 0xfa, 0x48, 0x25, 0x92, 0x4b, 0x34, 0xc0, 0xe5, 0x66, 0xad, - 0x35, 0xe4, 0xbc, 0x3e, 0xe7, 0x55, 0x99, 0x99, 0x75, 0x0a, 0x71, 0x69, 0xd0, 0x21, 0x7b, 0xa0, - 0x12, 0x19, 0x37, 0x48, 0xdc, 0x21, 0x71, 0x7d, 0x3e, 0x3d, 0xce, 0x30, 0x43, 0xdf, 0xe7, 0xcd, - 0x57, 0x8b, 0x4e, 0x07, 0xdd, 0x7a, 0x95, 0x47, 0xe6, 0x3f, 0x09, 0x1d, 0x7f, 0x6a, 0xfd, 0xd9, - 0x6b, 0x7a, 0xf0, 0x45, 0x41, 0x9e, 0xda, 0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, 0xdb, 0x88, 0xdc, 0x6c, - 0x23, 0xf2, 0x67, 0x1b, 0x91, 0xab, 0x5d, 0x14, 0xdc, 0xec, 0xa2, 0xe0, 0xd7, 0x2e, 0x0a, 0x3e, - 0xbf, 0xc8, 0x94, 0xdb, 0x54, 0x49, 0x2c, 0xb1, 0xe0, 0x12, 0x6d, 0x81, 0x96, 0xab, 0x44, 0x9e, - 0x66, 0xc8, 0xeb, 0xe7, 0xbc, 0xc0, 0xb4, 0xca, 0xc1, 0xb6, 0xfb, 0x3f, 0x7b, 0x7a, 0xda, 0x3f, - 0x01, 0xf7, 0xad, 0x04, 0x9b, 0x1c, 0xf8, 0xf5, 0x3f, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xc0, - 0xc7, 0xee, 0x2b, 0x71, 0x02, 0x00, 0x00, + // 378 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0xaa, 0xd3, 0x40, + 0x14, 0x87, 0x33, 0x6d, 0xe9, 0x9f, 0x51, 0x2b, 0x44, 0x17, 0x21, 0x48, 0x5a, 0xbb, 0xb1, 0x9b, + 0x66, 0x6c, 0x15, 0x51, 0x71, 0x21, 0x05, 0x45, 0xdc, 0x08, 0x51, 0x37, 0x6e, 0xa4, 0x99, 0x1c, + 0xd3, 0x81, 0x66, 0x4e, 0x9c, 0x49, 0x02, 0xbe, 0x81, 0x3b, 0xfb, 0x08, 0x3e, 0x4e, 0x97, 0x5d, + 0xba, 0x92, 0x4b, 0xfb, 0x22, 0x97, 0x4c, 0x92, 0x5e, 0x2e, 0x64, 0x37, 0x67, 0xe6, 0xfb, 0x7d, + 0xe7, 0x30, 0x87, 0x3e, 0x16, 0x21, 0x67, 0x1c, 0x15, 0x30, 0xbe, 0xdd, 0x48, 0x09, 0x3b, 0x56, + 0x2c, 0x59, 0x9e, 0xc6, 0x6a, 0x13, 0x81, 0x9f, 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, 0x97, + 0xae, 0x04, 0xb4, 0xde, 0xc4, 0x60, 0xbe, 0x60, 0x14, 0x34, 0x65, 0xe5, 0x5a, 0x7f, 0x3e, 0x9c, + 0x3c, 0x72, 0x3c, 0x79, 0xe4, 0xea, 0xe4, 0x91, 0xfd, 0xd9, 0xb3, 0x8e, 0x67, 0xcf, 0xfa, 0x77, + 0xf6, 0xac, 0x6f, 0xaf, 0x62, 0x91, 0x6d, 0xf3, 0xd0, 0xe7, 0x98, 0x30, 0x8e, 0x3a, 0x41, 0xcd, + 0x44, 0xc8, 0x17, 0x31, 0xb2, 0xe2, 0x25, 0x4b, 0x30, 0xca, 0x77, 0xa0, 0xab, 0x6d, 0x3e, 0x7d, + 0xbe, 0x68, 0x16, 0x9a, 0xfd, 0x4a, 0x41, 0x87, 0x7d, 0xb3, 0xcc, 0x67, 0xd7, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xf9, 0xfb, 0x1a, 0x65, 0x3f, 0x02, 0x00, 0x00, } func (m *Upgrade) Marshal() (dAtA []byte, err error) { @@ -208,11 +204,6 @@ func (m *Upgrade) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.LatestSequenceSend != 0 { - i = encodeVarintUpgrade(dAtA, i, uint64(m.LatestSequenceSend)) - i-- - dAtA[i] = 0x18 - } { size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -336,9 +327,6 @@ func (m *Upgrade) Size() (n int) { n += 1 + l + sovUpgrade(uint64(l)) l = m.Timeout.Size() n += 1 + l + sovUpgrade(uint64(l)) - if m.LatestSequenceSend != 0 { - n += 1 + sovUpgrade(uint64(m.LatestSequenceSend)) - } return n } @@ -481,25 +469,6 @@ func (m *Upgrade) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LatestSequenceSend", wireType) - } - m.LatestSequenceSend = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowUpgrade - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LatestSequenceSend |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipUpgrade(dAtA[iNdEx:]) diff --git a/proto/ibc/core/channel/v1/upgrade.proto b/proto/ibc/core/channel/v1/upgrade.proto index 6b15c06b64b..0b04b81eda6 100644 --- a/proto/ibc/core/channel/v1/upgrade.proto +++ b/proto/ibc/core/channel/v1/upgrade.proto @@ -9,14 +9,12 @@ import "ibc/core/channel/v1/channel.proto"; // Upgrade is a verifiable type which contains the relevant information // for an attempted upgrade. It provides the proposed changes to the channel -// end, the timeout for this upgrade attempt and the latest packet sequence sent -// to allow the counterparty to block sends after the upgrade has started. +// end and the timeout for this upgrade attempt. message Upgrade { option (gogoproto.goproto_getters) = false; - UpgradeFields fields = 1 [(gogoproto.nullable) = false]; - Timeout timeout = 2 [(gogoproto.nullable) = false]; - uint64 latest_sequence_send = 3; + UpgradeFields fields = 1 [(gogoproto.nullable) = false]; + Timeout timeout = 2 [(gogoproto.nullable) = false]; } // UpgradeFields are the fields in a channel end which may be changed diff --git a/testing/endpoint.go b/testing/endpoint.go index 23f5c55e486..44500a9fab0 100644 --- a/testing/endpoint.go +++ b/testing/endpoint.go @@ -873,8 +873,7 @@ func (endpoint *Endpoint) GetProposedUpgrade() channeltypes.Upgrade { ConnectionHops: []string{endpoint.ConnectionID}, Version: endpoint.ChannelConfig.Version, }, - Timeout: channeltypes.NewTimeout(endpoint.Counterparty.Chain.GetTimeoutHeight(), 0), - LatestSequenceSend: 0, + Timeout: channeltypes.NewTimeout(endpoint.Counterparty.Chain.GetTimeoutHeight(), 0), } override := endpoint.ChannelConfig.ProposedUpgrade