Skip to content

Commit

Permalink
Remove check for counterparty timeout in ChanUpgradeTry. (#4301)
Browse files Browse the repository at this point in the history
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
  • Loading branch information
DimitrisJim and damiannolan authored Aug 8, 2023
1 parent 5721b4d commit e7d651d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
5 changes: 0 additions & 5 deletions modules/core/04-channel/keeper/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ func (k Keeper) ChanUpgradeTry(
)
}

if hasPassed, err := counterpartyUpgrade.Timeout.HasPassed(ctx); hasPassed {
// abort here and let counterparty timeout the upgrade
return types.Upgrade{}, errorsmod.Wrap(err, "upgrade timeout has passed")
}

// construct counterpartyChannel from existing information and provided counterpartyUpgradeSequence
// create upgrade fields from counterparty proposed upgrade and own verified connection hops
proposedUpgradeFields := types.UpgradeFields{
Expand Down
7 changes: 0 additions & 7 deletions modules/core/04-channel/keeper/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,6 @@ func (suite *KeeperTestSuite) TestChanUpgradeTry() {
},
connectiontypes.ErrInvalidConnectionState,
},
{
"timeout has passed",
func() {
counterpartyUpgrade.Timeout = types.NewTimeout(clienttypes.NewHeight(0, 1), 0)
},
types.ErrInvalidUpgrade,
},
{
"initializing handshake fails, proposed connection hops do not exist",
func() {
Expand Down
16 changes: 0 additions & 16 deletions modules/core/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,22 +816,6 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTry() {
suite.Require().ErrorIs(err, capabilitytypes.ErrCapabilityNotFound)
},
},
{
"elapsed upgrade timeout returns error",
func() {
msg.UpgradeTimeout = channeltypes.NewTimeout(clienttypes.NewHeight(1, 10), 0)
suite.coordinator.CommitNBlocks(suite.chainB, 100)
},
func(res *channeltypes.MsgChannelUpgradeTryResponse, err error) {
suite.Require().Error(err)
suite.Require().Nil(res)
suite.Require().ErrorIs(err, channeltypes.ErrInvalidUpgrade)

errorReceipt, found := suite.chainB.GetSimApp().GetIBCKeeper().ChannelKeeper.GetUpgradeErrorReceipt(suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID)
suite.Require().Empty(errorReceipt)
suite.Require().False(found)
},
},
{
"unsynchronized upgrade sequence writes upgrade error receipt",
func() {
Expand Down

0 comments on commit e7d651d

Please sign in to comment.