From fc7ec743dc63ce9924dce312a51266dbb526e3fa Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 30 Jan 2024 15:58:06 +0100 Subject: [PATCH 1/6] chore: reorganize channel ugprades tests + add them to compatibility tests --- .../main/ica-channel-upgrade-chain-a.json | 19 ++ .../main/ica-channel-upgrade-chain-b.json | 19 ++ .../transfer-channel-upgrade-chain-a.json | 19 ++ .../transfer-channel-upgrade-chain-b.json | 19 ++ .../ica-channel-upgrade-chain-a.json | 18 ++ .../ica-channel-upgrade-chain-b.json | 18 ++ .../transfer-channel-upgrade-chain-a.json | 18 ++ .../transfer-channel-upgrade-chain-b.json | 18 ++ .../ica-channel-upgrade-chain-a.json | 18 ++ .../ica-channel-upgrade-chain-b.json | 18 ++ .../transfer-channel-upgrade-chain-a.json | 18 ++ .../transfer-channel-upgrade-chain-b.json | 18 ++ e2e/_dev-configs/upgrade.yaml | 43 ++++ e2e/tests/interchain_accounts/base_test.go | 177 --------------- .../interchain_accounts/upgrades_test.go | 204 ++++++++++++++++-- .../04-channel => transfer}/upgrades_test.go | 54 +---- e2e/tests/upgrades/upgrade_test.go | 24 +-- e2e/testsuite/testsuite.go | 36 ++++ 18 files changed, 490 insertions(+), 268 deletions(-) create mode 100644 .github/compatibility-test-matrices/main/ica-channel-upgrade-chain-a.json create mode 100644 .github/compatibility-test-matrices/main/ica-channel-upgrade-chain-b.json create mode 100644 .github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-a.json create mode 100644 .github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-b.json create mode 100644 .github/compatibility-test-matrices/release-v8.1.x/ica-channel-upgrade-chain-a.json create mode 100644 .github/compatibility-test-matrices/release-v8.1.x/ica-channel-upgrade-chain-b.json create mode 100644 .github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-a.json create mode 100644 .github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-b.json create mode 100644 .github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-a.json create mode 100644 .github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-b.json create mode 100644 .github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json create mode 100644 .github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json create mode 100644 e2e/_dev-configs/upgrade.yaml rename e2e/tests/{core/04-channel => transfer}/upgrades_test.go (82%) diff --git a/.github/compatibility-test-matrices/main/ica-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/main/ica-channel-upgrade-chain-a.json new file mode 100644 index 00000000000..a60e574ef91 --- /dev/null +++ b/.github/compatibility-test-matrices/main/ica-channel-upgrade-chain-a.json @@ -0,0 +1,19 @@ +{ + "chain-a": [ + "main" + ], + "chain-b": [ + "main", + "release-v8.1.x" + ], + "entrypoint": [ + "TestInterchainAccountsChannelUpgradesTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered", + "TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/main/ica-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/main/ica-channel-upgrade-chain-b.json new file mode 100644 index 00000000000..c82135bf751 --- /dev/null +++ b/.github/compatibility-test-matrices/main/ica-channel-upgrade-chain-b.json @@ -0,0 +1,19 @@ +{ + "chain-a": [ + "main", + "release-v8.1.x" + ], + "chain-b": [ + "main" + ], + "entrypoint": [ + "TestInterchainAccountsChannelUpgradesTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered", + "TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-a.json new file mode 100644 index 00000000000..2a1a3ea3b92 --- /dev/null +++ b/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-a.json @@ -0,0 +1,19 @@ +{ + "chain-a": [ + "main" + ], + "chain-b": [ + "main", + "release-v8.1.x" + ], + "entrypoint": [ + "TestTransferChannelUpgradesTestSuite" + ], + "test": [ + "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-b.json new file mode 100644 index 00000000000..20d7267c447 --- /dev/null +++ b/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-b.json @@ -0,0 +1,19 @@ +{ + "chain-a": [ + "main", + "release-v8.1.x" + ], + "chain-b": [ + "main" + ], + "entrypoint": [ + "TestTransferChannelUpgradesTestSuite" + ], + "test": [ + "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.1.x/ica-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/release-v8.1.x/ica-channel-upgrade-chain-a.json new file mode 100644 index 00000000000..dd68090538a --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.1.x/ica-channel-upgrade-chain-a.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v8.1.x" + ], + "chain-b": [ + "release-v8.1.x" + ], + "entrypoint": [ + "TestInterchainAccountsChannelUpgradesTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered", + "TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.1.x/ica-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/release-v8.1.x/ica-channel-upgrade-chain-b.json new file mode 100644 index 00000000000..dd68090538a --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.1.x/ica-channel-upgrade-chain-b.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v8.1.x" + ], + "chain-b": [ + "release-v8.1.x" + ], + "entrypoint": [ + "TestInterchainAccountsChannelUpgradesTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered", + "TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-a.json new file mode 100644 index 00000000000..fb2627bf27b --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-a.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v8.1.x" + ], + "chain-b": [ + "release-v8.1.x" + ], + "entrypoint": [ + "TestTransferChannelUpgradesTestSuite" + ], + "test": [ + "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-b.json new file mode 100644 index 00000000000..fb2627bf27b --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-b.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v8.1.x" + ], + "chain-b": [ + "release-v8.1.x" + ], + "entrypoint": [ + "TestTransferChannelUpgradesTestSuite" + ], + "test": [ + "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-a.json new file mode 100644 index 00000000000..dd68090538a --- /dev/null +++ b/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-a.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v8.1.x" + ], + "chain-b": [ + "release-v8.1.x" + ], + "entrypoint": [ + "TestInterchainAccountsChannelUpgradesTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered", + "TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-b.json new file mode 100644 index 00000000000..dd68090538a --- /dev/null +++ b/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-b.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v8.1.x" + ], + "chain-b": [ + "release-v8.1.x" + ], + "entrypoint": [ + "TestInterchainAccountsChannelUpgradesTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered", + "TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json new file mode 100644 index 00000000000..fb2627bf27b --- /dev/null +++ b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v8.1.x" + ], + "chain-b": [ + "release-v8.1.x" + ], + "entrypoint": [ + "TestTransferChannelUpgradesTestSuite" + ], + "test": [ + "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json new file mode 100644 index 00000000000..fb2627bf27b --- /dev/null +++ b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v8.1.x" + ], + "chain-b": [ + "release-v8.1.x" + ], + "entrypoint": [ + "TestTransferChannelUpgradesTestSuite" + ], + "test": [ + "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/e2e/_dev-configs/upgrade.yaml b/e2e/_dev-configs/upgrade.yaml new file mode 100644 index 00000000000..22e2967f104 --- /dev/null +++ b/e2e/_dev-configs/upgrade.yaml @@ -0,0 +1,43 @@ +--- +chains: + # the entry at index 0 corresponds to CHAIN_A +- chainId: chainA-1 + numValidators: 1 + numFullNodes: 0 + image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE + tag: v8.0.0 # override with CHAIN_A_TAG + binary: simd # override with CHAIN_BINARY + + # the entry at index 1 corresponds to CHAIN_B +- chainId: chainB-1 + numValidators: 1 + numFullNodes: 0 + image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE + tag: main + binary: simd # override with CHAIN_BINARY + +activeRelayer: hermes # override with RELAYER_ID +relayers: + - id: hermes + image: ghcr.io/informalsystems/hermes + tag: "latest" + - id: rly + image: ghcr.io/cosmos/relayer + tag: "latest" + - id: hyperspace + image: ghcr.io/misko9/hyperspace + tag: "20231122v39" + +cometbft: + logLevel: info + +debug: + # setting this value to true will force log collection even if the test passes. + dumpLogs: false + +# Required only for upgrade tests. +# Chain A will be upgraded the specified tag. +# The plan name must be registered as an upgrade handler in the given tag. +upgrade: + planName: "v8.1" + tag: "main" \ No newline at end of file diff --git a/e2e/tests/interchain_accounts/base_test.go b/e2e/tests/interchain_accounts/base_test.go index 253c56a9df9..1477f4b511a 100644 --- a/e2e/tests/interchain_accounts/base_test.go +++ b/e2e/tests/interchain_accounts/base_test.go @@ -17,7 +17,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/ibc-go/e2e/testsuite" "github.com/cosmos/ibc-go/e2e/testvalues" @@ -425,179 +424,3 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterReop s.Require().Equal(expected, balance.Int64()) }) } - -func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered() { - t := s.T() - ctx := context.TODO() - - // setup relayers and connection-0 between two chains - // channel-0 is a transfer channel but it will not be used in this test case - relayer, _ := s.SetupChainsRelayerAndChannel(ctx, nil) - chainA, chainB := s.GetChains() - - // setup 2 accounts: controller account on chain A, a second chain B account. - // host account will be created when the ICA is registered - controllerAccount := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) - controllerAddress := controllerAccount.FormattedAddress() - chainBAccount := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) - - var ( - portID string - hostAccount string - - initialChannelID = "channel-1" - ) - - t.Run("register interchain account", func(t *testing.T) { - var err error - // explicitly set the version string because we don't want to use incentivized channels. - version := icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID) - msgRegisterInterchainAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAddress, version, channeltypes.ORDERED) - s.RegisterInterchainAccount(ctx, chainA, controllerAccount, msgRegisterInterchainAccount) - portID, err = icatypes.NewControllerPortID(controllerAddress) - s.Require().NoError(err) - }) - - t.Run("start relayer", func(t *testing.T) { - s.StartRelayer(relayer) - }) - - t.Run("verify interchain account", func(t *testing.T) { - var err error - hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) - s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) - - _, err = s.QueryChannel(ctx, chainA, portID, initialChannelID) - s.Require().NoError(err) - }) - - t.Run("fund interchain account wallet", func(t *testing.T) { - // fund the host account account so it has some $$ to send - err := chainB.SendFunds(ctx, interchaintest.FaucetAccountKeyName, ibc.WalletAmount{ - Address: hostAccount, - Amount: sdkmath.NewInt(testvalues.StartingTokenAmount), - Denom: chainB.Config().Denom, - }) - s.Require().NoError(err) - }) - - t.Run("broadcast MsgSendTx", func(t *testing.T) { - // assemble bank transfer message from host account to user account on host chain - msgSend := &banktypes.MsgSend{ - FromAddress: hostAccount, - ToAddress: chainBAccount.FormattedAddress(), - Amount: sdk.NewCoins(testvalues.DefaultTransferAmount(chainB.Config().Denom)), - } - - cdc := testsuite.Codec() - - bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf) - s.Require().NoError(err) - - packetData := icatypes.InterchainAccountPacketData{ - Type: icatypes.EXECUTE_TX, - Data: bz, - Memo: "e2e", - } - - msgSendTx := controllertypes.NewMsgSendTx(controllerAddress, ibctesting.FirstConnectionID, uint64(5*time.Minute), packetData) - - resp := s.BroadcastMessages( - ctx, - chainA, - controllerAccount, - msgSendTx, - ) - - s.AssertTxSuccess(resp) - s.AssertPacketRelayed(ctx, chainA, portID, initialChannelID, 1) - }) - - t.Run("verify tokens transferred", func(t *testing.T) { - balance, err := s.QueryBalance(ctx, chainB, chainBAccount.FormattedAddress(), chainB.Config().Denom) - s.Require().NoError(err) - - expected := testvalues.IBCTransferAmount + testvalues.StartingTokenAmount - s.Require().Equal(expected, balance.Int64()) - }) - - channel, err := s.QueryChannel(ctx, chainA, portID, initialChannelID) - s.Require().NoError(err) - - // upgrade the channel ordering to UNORDERED - upgradeFields := channeltypes.NewUpgradeFields(channeltypes.UNORDERED, channel.ConnectionHops, channel.Version) - - t.Run("execute gov proposal to initiate channel upgrade", func(t *testing.T) { - govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainA) - s.Require().NoError(err) - s.Require().NotNil(govModuleAddress) - - msg := channeltypes.NewMsgChannelUpgradeInit(portID, initialChannelID, upgradeFields, govModuleAddress.String()) - s.ExecuteAndPassGovV1Proposal(ctx, msg, chainA, controllerAccount) - }) - - t.Run("verify channel A upgraded and is now unordered", func(t *testing.T) { - var channel channeltypes.Channel - waitErr := test.WaitForCondition(time.Minute*2, time.Second*5, func() (bool, error) { - channel, err = s.QueryChannel(ctx, chainA, portID, initialChannelID) - if err != nil { - return false, err - } - return channel.Ordering == channeltypes.UNORDERED, nil - }) - s.Require().NoErrorf(waitErr, "channel was not upgraded: expected %s got %s", channeltypes.UNORDERED, channel.Ordering) - }) - - t.Run("verify channel B upgraded and is now unordered", func(t *testing.T) { - var channel channeltypes.Channel - waitErr := test.WaitForCondition(time.Minute*2, time.Second*5, func() (bool, error) { - channel, err = s.QueryChannel(ctx, chainB, icatypes.HostPortID, initialChannelID) - if err != nil { - return false, err - } - return channel.Ordering == channeltypes.UNORDERED, nil - }) - s.Require().NoErrorf(waitErr, "channel was not upgraded: expected %s got %s", channeltypes.UNORDERED, channel.Ordering) - }) - - t.Run("broadcast MsgSendTx", func(t *testing.T) { - // assemble bank transfer message from host account to user account on host chain - msgSend := &banktypes.MsgSend{ - FromAddress: hostAccount, - ToAddress: chainBAccount.FormattedAddress(), - Amount: sdk.NewCoins(testvalues.DefaultTransferAmount(chainB.Config().Denom)), - } - - cdc := testsuite.Codec() - - bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf) - s.Require().NoError(err) - - packetData := icatypes.InterchainAccountPacketData{ - Type: icatypes.EXECUTE_TX, - Data: bz, - Memo: "e2e", - } - - msgSendTx := controllertypes.NewMsgSendTx(controllerAddress, ibctesting.FirstConnectionID, uint64(5*time.Minute), packetData) - - resp := s.BroadcastMessages( - ctx, - chainA, - controllerAccount, - msgSendTx, - ) - - s.AssertTxSuccess(resp) - s.AssertPacketRelayed(ctx, chainA, portID, initialChannelID, 2) - }) - - t.Run("verify tokens transferred", func(t *testing.T) { - balance, err := s.QueryBalance(ctx, chainB, chainBAccount.FormattedAddress(), chainB.Config().Denom) - s.Require().NoError(err) - - expected := 2*testvalues.IBCTransferAmount + testvalues.StartingTokenAmount - s.Require().Equal(expected, balance.Int64()) - }) -} diff --git a/e2e/tests/interchain_accounts/upgrades_test.go b/e2e/tests/interchain_accounts/upgrades_test.go index a14641b8336..ddfe321f2ef 100644 --- a/e2e/tests/interchain_accounts/upgrades_test.go +++ b/e2e/tests/interchain_accounts/upgrades_test.go @@ -36,6 +36,186 @@ type InterchainAccountsChannelUpgradesTestSuite struct { testsuite.E2ETestSuite } +// TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered tests upgrading an ICA channel to +// unordered and sends a message to the host afterwards. +func (s *InterchainAccountsChannelUpgradesTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered() { + t := s.T() + ctx := context.TODO() + + // setup relayers and connection-0 between two chains + // channel-0 is a transfer channel but it will not be used in this test case + relayer, _ := s.SetupChainsRelayerAndChannel(ctx, nil) + chainA, chainB := s.GetChains() + + // setup 2 accounts: controller account on chain A, a second chain B account. + // host account will be created when the ICA is registered + controllerAccount := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + controllerAddress := controllerAccount.FormattedAddress() + chainBAccount := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) + + var ( + portID string + hostAccount string + + initialChannelID = "channel-1" + ) + + t.Run("register interchain account", func(t *testing.T) { + var err error + // explicitly set the version string because we don't want to use incentivized channels. + version := icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID) + msgRegisterInterchainAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAddress, version, channeltypes.ORDERED) + + txResp := s.BroadcastMessages(ctx, chainA, controllerAccount, msgRegisterInterchainAccount) + s.AssertTxSuccess(txResp) + portID, err = icatypes.NewControllerPortID(controllerAddress) + s.Require().NoError(err) + }) + + t.Run("start relayer", func(t *testing.T) { + s.StartRelayer(relayer) + }) + + t.Run("verify interchain account", func(t *testing.T) { + var err error + hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) + s.Require().NoError(err) + s.Require().NotZero(len(hostAccount)) + + _, err = s.QueryChannel(ctx, chainA, portID, initialChannelID) + s.Require().NoError(err) + }) + + t.Run("fund interchain account wallet", func(t *testing.T) { + // fund the host account account so it has some $$ to send + err := chainB.SendFunds(ctx, interchaintest.FaucetAccountKeyName, ibc.WalletAmount{ + Address: hostAccount, + Amount: sdkmath.NewInt(testvalues.StartingTokenAmount), + Denom: chainB.Config().Denom, + }) + s.Require().NoError(err) + }) + + t.Run("broadcast MsgSendTx", func(t *testing.T) { + // assemble bank transfer message from host account to user account on host chain + msgSend := &banktypes.MsgSend{ + FromAddress: hostAccount, + ToAddress: chainBAccount.FormattedAddress(), + Amount: sdk.NewCoins(testvalues.DefaultTransferAmount(chainB.Config().Denom)), + } + + cdc := testsuite.Codec() + + bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf) + s.Require().NoError(err) + + packetData := icatypes.InterchainAccountPacketData{ + Type: icatypes.EXECUTE_TX, + Data: bz, + Memo: "e2e", + } + + msgSendTx := controllertypes.NewMsgSendTx(controllerAddress, ibctesting.FirstConnectionID, uint64(5*time.Minute), packetData) + + resp := s.BroadcastMessages( + ctx, + chainA, + controllerAccount, + msgSendTx, + ) + + s.AssertTxSuccess(resp) + s.AssertPacketRelayed(ctx, chainA, portID, initialChannelID, 1) + }) + + t.Run("verify tokens transferred", func(t *testing.T) { + balance, err := s.QueryBalance(ctx, chainB, chainBAccount.FormattedAddress(), chainB.Config().Denom) + s.Require().NoError(err) + + expected := testvalues.IBCTransferAmount + testvalues.StartingTokenAmount + s.Require().Equal(expected, balance.Int64()) + }) + + channel, err := s.QueryChannel(ctx, chainA, portID, initialChannelID) + s.Require().NoError(err) + + // upgrade the channel ordering to UNORDERED + upgradeFields := channeltypes.NewUpgradeFields(channeltypes.UNORDERED, channel.ConnectionHops, channel.Version) + + t.Run("execute gov proposal to initiate channel upgrade", func(t *testing.T) { + govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainA) + s.Require().NoError(err) + s.Require().NotNil(govModuleAddress) + + msg := channeltypes.NewMsgChannelUpgradeInit(portID, initialChannelID, upgradeFields, govModuleAddress.String()) + s.ExecuteAndPassGovV1Proposal(ctx, msg, chainA, controllerAccount) + }) + + t.Run("verify channel A upgraded and is now unordered", func(t *testing.T) { + var channel channeltypes.Channel + waitErr := test.WaitForCondition(time.Minute*2, time.Second*5, func() (bool, error) { + channel, err = s.QueryChannel(ctx, chainA, portID, initialChannelID) + if err != nil { + return false, err + } + return channel.Ordering == channeltypes.UNORDERED, nil + }) + s.Require().NoErrorf(waitErr, "channel was not upgraded: expected %s got %s", channeltypes.UNORDERED, channel.Ordering) + }) + + t.Run("verify channel B upgraded and is now unordered", func(t *testing.T) { + var channel channeltypes.Channel + waitErr := test.WaitForCondition(time.Minute*2, time.Second*5, func() (bool, error) { + channel, err = s.QueryChannel(ctx, chainB, icatypes.HostPortID, initialChannelID) + if err != nil { + return false, err + } + return channel.Ordering == channeltypes.UNORDERED, nil + }) + s.Require().NoErrorf(waitErr, "channel was not upgraded: expected %s got %s", channeltypes.UNORDERED, channel.Ordering) + }) + + t.Run("broadcast MsgSendTx", func(t *testing.T) { + // assemble bank transfer message from host account to user account on host chain + msgSend := &banktypes.MsgSend{ + FromAddress: hostAccount, + ToAddress: chainBAccount.FormattedAddress(), + Amount: sdk.NewCoins(testvalues.DefaultTransferAmount(chainB.Config().Denom)), + } + + cdc := testsuite.Codec() + + bz, err := icatypes.SerializeCosmosTx(cdc, []proto.Message{msgSend}, icatypes.EncodingProtobuf) + s.Require().NoError(err) + + packetData := icatypes.InterchainAccountPacketData{ + Type: icatypes.EXECUTE_TX, + Data: bz, + Memo: "e2e", + } + + msgSendTx := controllertypes.NewMsgSendTx(controllerAddress, ibctesting.FirstConnectionID, uint64(5*time.Minute), packetData) + + resp := s.BroadcastMessages( + ctx, + chainA, + controllerAccount, + msgSendTx, + ) + + s.AssertTxSuccess(resp) + s.AssertPacketRelayed(ctx, chainA, portID, initialChannelID, 2) + }) + + t.Run("verify tokens transferred", func(t *testing.T) { + balance, err := s.QueryBalance(ctx, chainB, chainBAccount.FormattedAddress(), chainB.Config().Denom) + s.Require().NoError(err) + + expected := 2*testvalues.IBCTransferAmount + testvalues.StartingTokenAmount + s.Require().Equal(expected, balance.Int64()) + }) +} + // TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds tests upgrading an ICA channel to // wire up fee middleware and then forces it to close it by timing out a packet. func (s *InterchainAccountsChannelUpgradesTestSuite) TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds() { @@ -93,7 +273,7 @@ func (s *InterchainAccountsChannelUpgradesTestSuite) TestChannelUpgrade_ICAChann }) t.Run("execute gov proposal to initiate channel upgrade", func(t *testing.T) { - s.initiateChannelUpgrade(ctx, chainA, chainAWallet, controllerPortID, channelID, s.createUpgradeFields(channelA)) + s.InitiateChannelUpgrade(ctx, chainA, chainAWallet, controllerPortID, channelID, s.CreateUpgradeFields(channelA)) }) s.Require().NoError(test.WaitForBlocks(ctx, 10, chainA, chainB), "failed to wait for blocks") @@ -198,25 +378,3 @@ func (s *InterchainAccountsChannelUpgradesTestSuite) TestChannelUpgrade_ICAChann s.Require().Equal(channeltypes.CLOSED, channel.State, "the channel was not in an expected state") }) } - -// createUpgradeFields created the upgrade fields for channel -func (s *InterchainAccountsChannelUpgradesTestSuite) createUpgradeFields(channel channeltypes.Channel) channeltypes.UpgradeFields { - versionMetadata := feetypes.Metadata{ - FeeVersion: feetypes.Version, - AppVersion: channel.Version, - } - versionBytes, err := feetypes.ModuleCdc.MarshalJSON(&versionMetadata) - s.Require().NoError(err) - - return channeltypes.NewUpgradeFields(channel.Ordering, channel.ConnectionHops, string(versionBytes)) -} - -// initiateChannelUpgrade creates and submits a governance proposal to execute the message to initiate a channel upgrade -func (s *InterchainAccountsChannelUpgradesTestSuite) initiateChannelUpgrade(ctx context.Context, chain ibc.Chain, wallet ibc.Wallet, portID, channelID string, upgradeFields channeltypes.UpgradeFields) { - govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chain) - s.Require().NoError(err) - s.Require().NotNil(govModuleAddress) - - msg := channeltypes.NewMsgChannelUpgradeInit(portID, channelID, upgradeFields, govModuleAddress.String()) - s.ExecuteAndPassGovV1Proposal(ctx, msg, chain, wallet) -} diff --git a/e2e/tests/core/04-channel/upgrades_test.go b/e2e/tests/transfer/upgrades_test.go similarity index 82% rename from e2e/tests/core/04-channel/upgrades_test.go rename to e2e/tests/transfer/upgrades_test.go index b3cd671911a..48faff45293 100644 --- a/e2e/tests/core/04-channel/upgrades_test.go +++ b/e2e/tests/transfer/upgrades_test.go @@ -1,6 +1,6 @@ //go:build !test_e2e -package channel +package transfer import ( "context" @@ -12,8 +12,6 @@ import ( sdkmath "cosmossdk.io/math" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/ibc-go/e2e/testsuite" "github.com/cosmos/ibc-go/e2e/testvalues" feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" @@ -21,16 +19,16 @@ import ( channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) -func TestChannelTestSuite(t *testing.T) { - testifysuite.Run(t, new(ChannelTestSuite)) +func TestTransferChannelUpgradesTestSuite(t *testing.T) { + testifysuite.Run(t, new(TransferChannelUpgradesTestSuite)) } -type ChannelTestSuite struct { +type TransferChannelUpgradesTestSuite struct { testsuite.E2ETestSuite } // TestChannelUpgrade_WithFeeMiddleware_Succeeds tests upgrading a transfer channel to wire up fee middleware -func (s *ChannelTestSuite) TestChannelUpgrade_WithFeeMiddleware_Succeeds() { +func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_Succeeds() { t := s.T() ctx := context.TODO() @@ -84,7 +82,7 @@ func (s *ChannelTestSuite) TestChannelUpgrade_WithFeeMiddleware_Succeeds() { chA, err := s.QueryChannel(ctx, chainA, channelA.PortID, channelA.ChannelID) s.Require().NoError(err) - s.initiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.createUpgradeFields(chA)) + s.InitiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.CreateUpgradeFields(chA)) }) t.Run("start relayer", func(t *testing.T) { @@ -236,7 +234,7 @@ func (s *ChannelTestSuite) TestChannelUpgrade_WithFeeMiddleware_Succeeds() { } // TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck tests upgrading a transfer channel to wire up fee middleware but fails on ACK because of timeout -func (s *ChannelTestSuite) TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck() { +func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck() { t := s.T() ctx := context.TODO() @@ -250,14 +248,14 @@ func (s *ChannelTestSuite) TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeout s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("execute gov proposal to set upgrade timeout", func(t *testing.T) { - s.setUpgradeTimeoutParam(ctx, chainB, chainBWallet) + s.SetUpgradeTimeoutParam(ctx, chainB, chainBWallet) }) t.Run("execute gov proposal to initiate channel upgrade", func(t *testing.T) { chA, err := s.QueryChannel(ctx, chainA, channelA.PortID, channelA.ChannelID) s.Require().NoError(err) - s.initiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.createUpgradeFields(chA)) + s.InitiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.CreateUpgradeFields(chA)) }) t.Run("start relayer", func(t *testing.T) { @@ -292,37 +290,3 @@ func (s *ChannelTestSuite) TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeout s.Require().Contains(errorReceipt.Message, "restored channel to pre-upgrade state") }) } - -// createUpgradeFields created the upgrade fields for channel -func (s *ChannelTestSuite) createUpgradeFields(channel channeltypes.Channel) channeltypes.UpgradeFields { - versionMetadata := feetypes.Metadata{ - FeeVersion: feetypes.Version, - AppVersion: transfertypes.Version, - } - versionBytes, err := feetypes.ModuleCdc.MarshalJSON(&versionMetadata) - s.Require().NoError(err) - - return channeltypes.NewUpgradeFields(channel.Ordering, channel.ConnectionHops, string(versionBytes)) -} - -// setUpgradeTimeoutParam creates and submits a governance proposal to execute the message to update 04-channel params with a timeout of 1s -func (s *ChannelTestSuite) setUpgradeTimeoutParam(ctx context.Context, chain ibc.Chain, wallet ibc.Wallet) { - const timeoutDelta = 1000000000 // use 1 second as relative timeout to force upgrade timeout on the counterparty - govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chain) - s.Require().NoError(err) - s.Require().NotNil(govModuleAddress) - - upgradeTimeout := channeltypes.NewTimeout(channeltypes.DefaultTimeout.Height, timeoutDelta) - msg := channeltypes.NewMsgUpdateChannelParams(govModuleAddress.String(), channeltypes.NewParams(upgradeTimeout)) - s.ExecuteAndPassGovV1Proposal(ctx, msg, chain, wallet) -} - -// initiateChannelUpgrade creates and submits a governance proposal to execute the message to initiate a channel upgrade -func (s *ChannelTestSuite) initiateChannelUpgrade(ctx context.Context, chain ibc.Chain, wallet ibc.Wallet, portID, channelID string, upgradeFields channeltypes.UpgradeFields) { - govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chain) - s.Require().NoError(err) - s.Require().NotNil(govModuleAddress) - - msg := channeltypes.NewMsgChannelUpgradeInit(portID, channelID, upgradeFields, govModuleAddress.String()) - s.ExecuteAndPassGovV1Proposal(ctx, msg, chain, wallet) -} diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index 6dd0219efc3..91efd2516da 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -850,7 +850,7 @@ func (s *UpgradeTestSuite) TestV8ToV8_1ChainUpgrade_ChannelUpgrades() { chA, err := s.QueryChannel(ctx, chainA, channelA.PortID, channelA.ChannelID) s.Require().NoError(err) - s.initiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.createUpgradeFields(chA)) + s.InitiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.CreateUpgradeFields(chA)) }) t.Run("start relayer", func(t *testing.T) { @@ -1010,25 +1010,3 @@ func (s *UpgradeTestSuite) ClientState(ctx context.Context, chain ibc.Chain, cli return res, nil } - -// createUpgradeFields created the upgrade fields for channel -func (s *UpgradeTestSuite) createUpgradeFields(channel channeltypes.Channel) channeltypes.UpgradeFields { - versionMetadata := feetypes.Metadata{ - FeeVersion: feetypes.Version, - AppVersion: transfertypes.Version, - } - versionBytes, err := feetypes.ModuleCdc.MarshalJSON(&versionMetadata) - s.Require().NoError(err) - - return channeltypes.NewUpgradeFields(channel.Ordering, channel.ConnectionHops, string(versionBytes)) -} - -// initiateChannelUpgrade creates and submits a governance proposal to execute the message to initiate a channel upgrade -func (s *UpgradeTestSuite) initiateChannelUpgrade(ctx context.Context, chain ibc.Chain, wallet ibc.Wallet, portID, channelID string, upgradeFields channeltypes.UpgradeFields) { - govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chain) - s.Require().NoError(err) - s.Require().NotNil(govModuleAddress) - - msg := channeltypes.NewMsgChannelUpgradeInit(portID, channelID, upgradeFields, govModuleAddress.String()) - s.ExecuteAndPassGovV1Proposal(ctx, msg, chain, wallet) -} diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index a2397ce4634..2465234ac8d 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -17,11 +17,13 @@ import ( sdkmath "cosmossdk.io/math" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/ibc-go/e2e/relayer" "github.com/cosmos/ibc-go/e2e/testsuite/diagnostics" feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) const ( @@ -424,6 +426,40 @@ func (s *E2ETestSuite) GetTimeoutHeight(ctx context.Context, chain ibc.Chain) cl return clienttypes.NewHeight(clienttypes.ParseChainID(chain.Config().ChainID), height+1000) } +// CreateUpgradeFields creates upgrade fields for channel with fee middleware +func (s *E2ETestSuite) CreateUpgradeFields(channel channeltypes.Channel) channeltypes.UpgradeFields { + versionMetadata := feetypes.Metadata{ + FeeVersion: feetypes.Version, + AppVersion: transfertypes.Version, + } + versionBytes, err := feetypes.ModuleCdc.MarshalJSON(&versionMetadata) + s.Require().NoError(err) + + return channeltypes.NewUpgradeFields(channel.Ordering, channel.ConnectionHops, string(versionBytes)) +} + +// SetUpgradeTimeoutParam creates and submits a governance proposal to execute the message to update 04-channel params with a timeout of 1s +func (s *E2ETestSuite) SetUpgradeTimeoutParam(ctx context.Context, chain ibc.Chain, wallet ibc.Wallet) { + const timeoutDelta = 1000000000 // use 1 second as relative timeout to force upgrade timeout on the counterparty + govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chain) + s.Require().NoError(err) + s.Require().NotNil(govModuleAddress) + + upgradeTimeout := channeltypes.NewTimeout(channeltypes.DefaultTimeout.Height, timeoutDelta) + msg := channeltypes.NewMsgUpdateChannelParams(govModuleAddress.String(), channeltypes.NewParams(upgradeTimeout)) + s.ExecuteAndPassGovV1Proposal(ctx, msg, chain, wallet) +} + +// InitiateChannelUpgrade creates and submits a governance proposal to execute the message to initiate a channel upgrade +func (s *E2ETestSuite) InitiateChannelUpgrade(ctx context.Context, chain ibc.Chain, wallet ibc.Wallet, portID, channelID string, upgradeFields channeltypes.UpgradeFields) { + govModuleAddress, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chain) + s.Require().NoError(err) + s.Require().NotNil(govModuleAddress) + + msg := channeltypes.NewMsgChannelUpgradeInit(portID, channelID, upgradeFields, govModuleAddress.String()) + s.ExecuteAndPassGovV1Proposal(ctx, msg, chain, wallet) +} + // GetIBCToken returns the denomination of the full token denom sent to the receiving channel func GetIBCToken(fullTokenDenom string, portID, channelID string) transfertypes.DenomTrace { return transfertypes.ParseDenomTrace(fmt.Sprintf("%s/%s/%s", portID, channelID, fullTokenDenom)) From d01186109d763b8ed58919081df8a94ea9efe281 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 30 Jan 2024 16:03:07 +0100 Subject: [PATCH 2/6] delete file --- e2e/_dev-configs/upgrade.yaml | 43 ----------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 e2e/_dev-configs/upgrade.yaml diff --git a/e2e/_dev-configs/upgrade.yaml b/e2e/_dev-configs/upgrade.yaml deleted file mode 100644 index 22e2967f104..00000000000 --- a/e2e/_dev-configs/upgrade.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -chains: - # the entry at index 0 corresponds to CHAIN_A -- chainId: chainA-1 - numValidators: 1 - numFullNodes: 0 - image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE - tag: v8.0.0 # override with CHAIN_A_TAG - binary: simd # override with CHAIN_BINARY - - # the entry at index 1 corresponds to CHAIN_B -- chainId: chainB-1 - numValidators: 1 - numFullNodes: 0 - image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE - tag: main - binary: simd # override with CHAIN_BINARY - -activeRelayer: hermes # override with RELAYER_ID -relayers: - - id: hermes - image: ghcr.io/informalsystems/hermes - tag: "latest" - - id: rly - image: ghcr.io/cosmos/relayer - tag: "latest" - - id: hyperspace - image: ghcr.io/misko9/hyperspace - tag: "20231122v39" - -cometbft: - logLevel: info - -debug: - # setting this value to true will force log collection even if the test passes. - dumpLogs: false - -# Required only for upgrade tests. -# Chain A will be upgraded the specified tag. -# The plan name must be registered as an upgrade handler in the given tag. -upgrade: - planName: "v8.1" - tag: "main" \ No newline at end of file From c7671d55e2c2eec5cace6dd787d73ffc6c1cea73 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 30 Jan 2024 16:28:34 +0100 Subject: [PATCH 3/6] use channel version --- e2e/testsuite/testsuite.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index 2465234ac8d..3d3e9410438 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -430,7 +430,7 @@ func (s *E2ETestSuite) GetTimeoutHeight(ctx context.Context, chain ibc.Chain) cl func (s *E2ETestSuite) CreateUpgradeFields(channel channeltypes.Channel) channeltypes.UpgradeFields { versionMetadata := feetypes.Metadata{ FeeVersion: feetypes.Version, - AppVersion: transfertypes.Version, + AppVersion: channel.Version, } versionBytes, err := feetypes.ModuleCdc.MarshalJSON(&versionMetadata) s.Require().NoError(err) From 733b1d0a921e9cfb70efa2ee5a2c422640d0b9ca Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 30 Jan 2024 19:59:09 +0100 Subject: [PATCH 4/6] add crossing hello test to compatibility matrix --- .../main/transfer-channel-upgrade-chain-a.json | 1 + .../main/transfer-channel-upgrade-chain-b.json | 1 + .../release-v8.1.x/transfer-channel-upgrade-chain-a.json | 1 + .../release-v8.1.x/transfer-channel-upgrade-chain-b.json | 1 + .../unreleased/transfer-channel-upgrade-chain-a.json | 1 + .../unreleased/transfer-channel-upgrade-chain-b.json | 1 + 6 files changed, 6 insertions(+) diff --git a/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-a.json index 2a1a3ea3b92..6c58f999e31 100644 --- a/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-a.json +++ b/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-a.json @@ -11,6 +11,7 @@ ], "test": [ "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Succeeds", "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" ], "relayer-type": [ diff --git a/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-b.json index 20d7267c447..0b780e0b5eb 100644 --- a/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-b.json +++ b/.github/compatibility-test-matrices/main/transfer-channel-upgrade-chain-b.json @@ -11,6 +11,7 @@ ], "test": [ "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Succeeds", "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" ], "relayer-type": [ diff --git a/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-a.json index fb2627bf27b..4de19466899 100644 --- a/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-a.json +++ b/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-a.json @@ -10,6 +10,7 @@ ], "test": [ "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Succeeds", "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" ], "relayer-type": [ diff --git a/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-b.json index fb2627bf27b..4de19466899 100644 --- a/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-b.json +++ b/.github/compatibility-test-matrices/release-v8.1.x/transfer-channel-upgrade-chain-b.json @@ -10,6 +10,7 @@ ], "test": [ "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Succeeds", "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" ], "relayer-type": [ diff --git a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json index fb2627bf27b..4de19466899 100644 --- a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json +++ b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json @@ -10,6 +10,7 @@ ], "test": [ "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Succeeds", "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" ], "relayer-type": [ diff --git a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json index fb2627bf27b..4de19466899 100644 --- a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json +++ b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json @@ -10,6 +10,7 @@ ], "test": [ "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Succeeds", "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" ], "relayer-type": [ From e3b930069099c4c941a1c4e64227631cd24800cf Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 30 Jan 2024 20:27:25 +0100 Subject: [PATCH 5/6] fix --- e2e/tests/transfer/upgrades_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/tests/transfer/upgrades_test.go b/e2e/tests/transfer/upgrades_test.go index 7d6d9713e77..7123deacc43 100644 --- a/e2e/tests/transfer/upgrades_test.go +++ b/e2e/tests/transfer/upgrades_test.go @@ -271,7 +271,7 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ defer wg.Done() chA, err := s.QueryChannel(ctx, chainA, channelA.PortID, channelA.ChannelID) s.Require().NoError(err) - s.InitiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.createUpgradeFields(chA)) + s.InitiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.CreateUpgradeField(chA)) }() wg.Add(1) @@ -279,7 +279,7 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ defer wg.Done() chB, err := s.QueryChannel(ctx, chainB, channelB.PortID, channelB.ChannelID) s.Require().NoError(err) - s.InitiateChannelUpgrade(ctx, chainB, chainBWallet, channelB.PortID, channelB.ChannelID, s.createUpgradeFields(chB)) + s.InitiateChannelUpgrade(ctx, chainB, chainBWallet, channelB.PortID, channelB.ChannelID, s.CreateUpgradeFields(chB)) }() wg.Wait() From 8ca2ea3583aba32a5fcc1d6f37e3d40f5029a151 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 30 Jan 2024 20:59:44 +0100 Subject: [PATCH 6/6] fix --- e2e/tests/transfer/upgrades_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/tests/transfer/upgrades_test.go b/e2e/tests/transfer/upgrades_test.go index 7123deacc43..c1bd43898dd 100644 --- a/e2e/tests/transfer/upgrades_test.go +++ b/e2e/tests/transfer/upgrades_test.go @@ -271,7 +271,7 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ defer wg.Done() chA, err := s.QueryChannel(ctx, chainA, channelA.PortID, channelA.ChannelID) s.Require().NoError(err) - s.InitiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.CreateUpgradeField(chA)) + s.InitiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.CreateUpgradeFields(chA)) }() wg.Add(1)