Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Test Improvements #4660

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
618947d
chore: adding scaffolding function and workflow for v8 upgrade
chatton Sep 5, 2023
c1e3359
chore: adding basic scaffolding for upgrade test
chatton Sep 6, 2023
b41931c
chore: duplicating sdk function temporarily
chatton Sep 6, 2023
635bc3c
chore: happy path test passing
chatton Sep 6, 2023
46be834
chore: adding proposal to modify allowed clients list
chatton Sep 6, 2023
4455333
chore: remove proposal id
chatton Sep 6, 2023
7a50bd6
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
charleenfei Sep 8, 2023
94eb0d5
linter
charleenfei Sep 8, 2023
26841f9
update params for ExecuteGovProposalV1
charleenfei Sep 8, 2023
9c13c40
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 11, 2023
eb1fe98
chore: use actualBalance Int64 values
chatton Sep 11, 2023
283f9dd
chore: add conditional check for tmjson/json libraries
chatton Sep 11, 2023
860fb84
chore: hard code image to PR
chatton Sep 11, 2023
307f28f
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 12, 2023
f7482c0
chore: bumping go.mod versions to version with migration fix
chatton Sep 12, 2023
df0d044
chore: merge conflicts
chatton Sep 12, 2023
a4f47ac
chore: run upgrade tests when upgrade_test.go changes
chatton Sep 12, 2023
9a830a1
chore: adding better comment to the custom MustProtoMarshalJSON
chatton Sep 12, 2023
1299b98
chore: removing dupliated function and use the sdk fn directly
chatton Sep 12, 2023
b883409
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 12, 2023
f469dc3
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 13, 2023
6c7d4cf
Merge branch 'cian/issue#4216-add-v7-to-v8-e2e-upgrade-test' of https…
chatton Sep 13, 2023
ecd9a33
chore: bumping sdk version to latest commit
chatton Sep 13, 2023
882b657
chore: merge main
chatton Sep 13, 2023
4b4fa7b
chore: merge main
chatton Sep 13, 2023
591203c
chore: fixed usage of s.ExecuteGovV1Proposal
chatton Sep 13, 2023
4a8b708
chore: update E2E to assert human readable denom
chatton Sep 13, 2023
f863354
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 13, 2023
8aa8b38
chore: adding ibc transfers to all upgrade tests, adding rly workflow…
chatton Sep 13, 2023
1b80c4f
chore: correct logic around proposal id
chatton Sep 14, 2023
20c810f
chore: addressing PR feedback
chatton Sep 14, 2023
55d9e01
chore: adding restart to relayer
chatton Sep 14, 2023
c0faf67
chore: fix proposal id logic
chatton Sep 14, 2023
ed168a3
chore: merge main
chatton Sep 14, 2023
8c9831f
chore: merge v7 v8 upgrade branch
chatton Sep 14, 2023
b76b9c9
Merge branch 'cian/issue#4216-add-v7-to-v8-e2e-upgrade-test' into cia…
chatton Sep 14, 2023
d37c0a0
chore: corrected HumanReadableDenomFeatureReleases
chatton Sep 14, 2023
46fd3ba
chore: correcting upgrade chain
chatton Sep 14, 2023
ef727b6
chore: addressed PR feedback
chatton Sep 14, 2023
2a4f154
Merge branch 'cian/issue#4645-v7-to-v8-upgrade-test-part-2' into cian…
chatton Sep 14, 2023
2c25cba
chore: specify rly image
chatton Sep 14, 2023
411baf5
chore: specify version
chatton Sep 14, 2023
63b3390
Merge branch 'main' into cian/issue#4646-investigate-failing-testv6to…
chatton Sep 14, 2023
f161345
Merge branch 'main' into cian/issue#4646-investigate-failing-testv6to…
chatton Sep 18, 2023
9f03a4a
chore: merge main
chatton Sep 18, 2023
781cc55
chore: fix invalid method name
chatton Sep 18, 2023
bb85ac4
Merge branch 'main' into cian/issue#4646-investigate-failing-testv6to…
chatton Sep 18, 2023
9fc53f2
Merge branch 'main' into cian/issue#4646-investigate-failing-testv6to…
chatton Sep 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 90 additions & 5 deletions .github/workflows/e2e-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:


jobs:
upgrade-v5:
upgrade-v5-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
Expand All @@ -24,8 +24,9 @@ jobs:
test-entry-point: "TestUpgradeTestSuite"
test: "TestIBCChainUpgrade"
upload-logs: true
relayer-type: hermes

upgrade-v6:
upgrade-v6-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-icad
Expand All @@ -37,8 +38,9 @@ jobs:
test-entry-point: "TestUpgradeTestSuite"
test: "TestV5ToV6ChainUpgrade"
upload-logs: true
relayer-type: hermes

upgrade-v7:
upgrade-v7-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
Expand All @@ -50,8 +52,9 @@ jobs:
test-entry-point: "TestUpgradeTestSuite"
test: "TestV6ToV7ChainUpgrade"
upload-logs: true
relayer-type: hermes

upgrade-v7_1:
upgrade-v7_1-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
Expand All @@ -63,8 +66,9 @@ jobs:
test-entry-point: "TestUpgradeTestSuite"
test: "TestV7ToV7_1ChainUpgrade"
upload-logs: true
relayer-type: hermes

upgrade-v8:
upgrade-v8-hermes:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
Expand All @@ -76,3 +80,84 @@ jobs:
test-entry-point: "TestUpgradeTestSuite"
test: "TestV7ToV8ChainUpgrade"
upload-logs: true
relayer-type: hermes

upgrade-v5-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
chain-a-tag: v4.4.1
chain-b-tag: v4.4.1
chain-upgrade-tag: v5.1.0
upgrade-plan-name: "normal upgrade"
test-entry-point: "TestUpgradeTestSuite"
test: "TestIBCChainUpgrade"
upload-logs: true
relayer-type: rly
relayer-image: ghcr.io/cosmos/relayer
relayer-tag: latest

upgrade-v6-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-icad
chain-binary: icad
chain-a-tag: v0.3.5
chain-b-tag: v0.3.5
chain-upgrade-tag: v0.4.1
upgrade-plan-name: "ibc-go/v6"
test-entry-point: "TestUpgradeTestSuite"
test: "TestV5ToV6ChainUpgrade"
upload-logs: true
relayer-type: rly
relayer-image: ghcr.io/cosmos/relayer
relayer-tag: latest

upgrade-v7-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
chain-a-tag: v6.1.0
chain-b-tag: v6.1.0
chain-upgrade-tag: v7.0.0
upgrade-plan-name: "v7"
test-entry-point: "TestUpgradeTestSuite"
test: "TestV6ToV7ChainUpgrade"
upload-logs: true
relayer-type: rly
relayer-image: ghcr.io/cosmos/relayer
relayer-tag: latest

upgrade-v7_1-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
chain-a-tag: v7.0.0
chain-b-tag: v7.0.0
chain-upgrade-tag: v7.1.0
upgrade-plan-name: "v7.1"
test-entry-point: "TestUpgradeTestSuite"
test: "TestV7ToV7_1ChainUpgrade"
upload-logs: true
relayer-type: rly
relayer-image: ghcr.io/cosmos/relayer
relayer-tag: latest

upgrade-v8-rly:
uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main
with:
chain-image: ghcr.io/cosmos/ibc-go-simd
chain-binary: simd
chain-a-tag: v7.0.0
chain-b-tag: v7.0.0
chain-upgrade-tag: main # TODO: update this to a real tag once v8 is released
upgrade-plan-name: "v8"
test-entry-point: "TestUpgradeTestSuite"
test: "TestV7ToV8ChainUpgrade"
upload-logs: true
relayer-type: rly
relayer-image: ghcr.io/cosmos/relayer
relayer-tag: latest
4 changes: 4 additions & 0 deletions e2e/tests/transfer/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() {

expected := testvalues.IBCTransferAmount
s.Require().Equal(expected, actualBalance.Int64())

if testvalues.DenomMetadataFeatureReleases.IsSupported(chainBVersion) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

s.AssertHumanReadableDenom(ctx, chainB, chainADenom, channelA)
}
})

if testvalues.TokenMetadataFeatureReleases.IsSupported(chainBVersion) {
Expand Down
40 changes: 40 additions & 0 deletions e2e/tests/upgrades/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/gogoproto/proto"

// intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
interchaintest "github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
Expand All @@ -20,6 +21,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

e2erelayer "github.com/cosmos/ibc-go/e2e/relayer"
"github.com/cosmos/ibc-go/e2e/testsuite"
"github.com/cosmos/ibc-go/e2e/testvalues"
v7migrations "github.com/cosmos/ibc-go/v8/modules/core/02-client/migrations/v7"
Expand Down Expand Up @@ -563,6 +565,14 @@ func (s *UpgradeTestSuite) TestV6ToV7ChainUpgrade() {
s.UpgradeChain(ctx, chainA, chainAUpgradeProposalWallet, testCfg.UpgradeConfig.PlanName, testCfg.ChainConfigs[0].Tag, testCfg.UpgradeConfig.Tag)
})

// see this issue https://github.com/informalsystems/hermes/issues/3579
// this restart is a temporary workaround to a limitation in hermes requiring a restart
// in some cases after an upgrade.
tc := testsuite.LoadConfig()
if tc.RelayerConfig.Type == e2erelayer.Hermes {
s.RestartRelayer(ctx, relayer)
}

t.Run("check that the tendermint clients are active again after upgrade", func(t *testing.T) {
status, err := s.QueryClientStatus(ctx, chainA, testvalues.TendermintClientID(0))
s.Require().NoError(err)
Expand Down Expand Up @@ -669,6 +679,21 @@ func (s *UpgradeTestSuite) TestV7ToV7_1ChainUpgrade() {
expectedTotalEscrow := sdk.NewCoin(chainADenom, sdkmath.NewInt(testvalues.IBCTransferAmount))
s.Require().Equal(expectedTotalEscrow, actualTotalEscrow) // migration has run and total escrow amount has been set
})

t.Run("IBC token transfer from chainA to chainB, to make sure the upgrade did not break the packet flow", func(t *testing.T) {
transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "")
s.AssertTxSuccess(transferTxResp)
})

t.Run("packets are relayed", func(t *testing.T) {
s.AssertPacketRelayed(ctx, chainA, channelA.PortID, channelA.ChannelID, 1)

actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom())
s.Require().NoError(err)

expected := testvalues.IBCTransferAmount * 2
s.Require().Equal(expected, actualBalance.Int64())
})
}

func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() {
Expand Down Expand Up @@ -748,6 +773,21 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() {
t.Run("query human readable ibc denom", func(t *testing.T) {
s.AssertHumanReadableDenom(ctx, chainB, chainADenom, channelA)
})

t.Run("IBC token transfer from chainA to chainB, to make sure the upgrade did not break the packet flow", func(t *testing.T) {
transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "")
s.AssertTxSuccess(transferTxResp)
})

t.Run("packets are relayed", func(t *testing.T) {
s.AssertPacketRelayed(ctx, chainA, channelA.PortID, channelA.ChannelID, 1)

actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom())
s.Require().NoError(err)

expected := testvalues.IBCTransferAmount * 2
s.Require().Equal(expected, actualBalance.Int64())
})
}

// RegisterInterchainAccount will attempt to register an interchain account on the counterparty chain.
Expand Down
6 changes: 6 additions & 0 deletions e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ func (s *E2ETestSuite) StopRelayer(ctx context.Context, ibcrelayer ibc.Relayer)
s.Require().NoError(err)
}

// RestartRelayer restarts the given relayer.
func (s *E2ETestSuite) RestartRelayer(ctx context.Context, ibcrelayer ibc.Relayer) {
s.StopRelayer(ctx, ibcrelayer)
s.StartRelayer(ibcrelayer)
}

// CreateUserOnChainA creates a user with the given amount of funds on chain A.
func (s *E2ETestSuite) CreateUserOnChainA(ctx context.Context, amount int64) ibc.Wallet {
chainA, _ := s.GetChains()
Expand Down
5 changes: 5 additions & 0 deletions e2e/testvalues/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,8 @@ var LocalhostClientFeatureReleases = semverutil.FeatureReleases{
"v7.1",
},
}

// DenomMetadataFeatureReleases represents the releases the human readable denom feature was released in.
var DenomMetadataFeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8",
}
Loading