diff --git a/modules/core/03-connection/keeper/verify.go b/modules/core/03-connection/keeper/verify.go index a4d4ea33683..765a0384a3c 100644 --- a/modules/core/03-connection/keeper/verify.go +++ b/modules/core/03-connection/keeper/verify.go @@ -408,43 +408,6 @@ func (k Keeper) VerifyChannelUpgradeError( return nil } -// VerifyChannelUpgradeErrorAbsence verifies a proof of the absence of a -// channel upgrade error. -func (k Keeper) VerifyChannelUpgradeErrorAbsence( - ctx sdk.Context, - connection exported.ConnectionI, - proofHeight exported.Height, - proofErrorReceiptAbsence []byte, - portID, - channelID string, -) error { - clientID := connection.GetClientID() - clientState, clientStore, err := k.getClientStateAndVerificationStore(ctx, clientID) - if err != nil { - return err - } - - if status := k.clientKeeper.GetClientStatus(ctx, clientState, clientID); status != exported.Active { - return errorsmod.Wrapf(clienttypes.ErrClientNotActive, "client (%s) status is %s", clientID, status) - } - - merklePath := commitmenttypes.NewMerklePath(host.ChannelUpgradeErrorPath(portID, channelID)) - merklePath, err = commitmenttypes.ApplyPrefix(connection.GetCounterparty().GetPrefix(), merklePath) - if err != nil { - return err - } - - if err := clientState.VerifyNonMembership( - ctx, clientStore, k.cdc, proofHeight, - 0, 0, - proofErrorReceiptAbsence, merklePath, - ); err != nil { - return errorsmod.Wrapf(err, "failed upgrade error receipt absence verification for client (%s)", clientID) - } - - return nil -} - // VerifyChannelUpgrade verifies the proof that a particular proposed upgrade has been stored in the upgrade path. func (k Keeper) VerifyChannelUpgrade( ctx sdk.Context, diff --git a/modules/core/03-connection/keeper/verify_test.go b/modules/core/03-connection/keeper/verify_test.go index e6a01a3b4aa..8a8dd958b65 100644 --- a/modules/core/03-connection/keeper/verify_test.go +++ b/modules/core/03-connection/keeper/verify_test.go @@ -764,77 +764,6 @@ func (suite *KeeperTestSuite) TestVerifyUpgradeErrorReceipt() { } } -func (suite *KeeperTestSuite) TestVerifyUpgradeErrorReceiptAbsence() { - var path *ibctesting.Path - - cases := []struct { - name string - malleate func() - expPass bool - }{ - { - name: "success", - malleate: func() {}, - expPass: true, - }, - { - name: "fails when client state is frozen", - malleate: func() { - clientState := path.EndpointB.GetClientState().(*ibctm.ClientState) - clientState.FrozenHeight = clienttypes.NewHeight(0, 1) - path.EndpointB.SetClientState(clientState) - }, - expPass: false, - }, - { - name: "fails with bad client id", - malleate: func() { - connection := path.EndpointB.GetConnection() - connection.ClientId = ibctesting.InvalidID - path.EndpointB.SetConnection(connection) - }, - expPass: false, - }, - { - name: "verification fails when the key exists", - malleate: func() { - upgradeErr := channeltypes.NewUpgradeError(1, channeltypes.ErrInvalidChannel) - suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.WriteErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, upgradeErr) - suite.chainA.Coordinator.CommitBlock(suite.chainA) - suite.Require().NoError(path.EndpointB.UpdateClient()) - }, - expPass: false, - }, - } - - for _, tc := range cases { - tc := tc - - suite.Run(tc.name, func() { - suite.SetupTest() // reset - - path = ibctesting.NewPath(suite.chainA, suite.chainB) - suite.coordinator.Setup(path) - - suite.chainA.Coordinator.CommitBlock(suite.chainA) - suite.Require().NoError(path.EndpointB.UpdateClient()) - - tc.malleate() - - upgradeErrorReceiptKey := host.ChannelUpgradeErrorKey(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) - proof, proofHeight := suite.chainA.QueryProof(upgradeErrorReceiptKey) - - err := suite.chainB.GetSimApp().IBCKeeper.ConnectionKeeper.VerifyChannelUpgradeErrorAbsence(suite.chainB.GetContext(), path.EndpointB.GetConnection(), proofHeight, proof, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - - if tc.expPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - }) - } -} - func (suite *KeeperTestSuite) TestVerifyUpgrade() { var ( path *ibctesting.Path diff --git a/modules/core/04-channel/types/expected_keepers.go b/modules/core/04-channel/types/expected_keepers.go index 9b3b4b2e2de..d46c514182e 100644 --- a/modules/core/04-channel/types/expected_keepers.go +++ b/modules/core/04-channel/types/expected_keepers.go @@ -91,14 +91,6 @@ type ConnectionKeeper interface { channelID string, errorReceipt ErrorReceipt, ) error - VerifyChannelUpgradeErrorAbsence( - ctx sdk.Context, - connection exported.ConnectionI, - proofHeight exported.Height, - proofErrorReceiptAbsence []byte, - portID, - channelID string, - ) error } // PortKeeper expected account IBC port keeper