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

Update async-icq to ibc-go/v8. #151

Merged
merged 43 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
03e13fd
Start conversion to ibc-go/v8. Fix some dependencies.
Taztingo Dec 18, 2023
85f18ee
Fix capability imports.
Taztingo Dec 18, 2023
975dc97
Removed handlers.
Taztingo Dec 19, 2023
eca62fb
Change tmservice to cmtservice.
Taztingo Dec 19, 2023
6247e7f
Remove ibc client and router. Also remove upgrade from router.
Taztingo Dec 19, 2023
3c19ae6
Start updating keepers and fixing errors.
Taztingo Dec 19, 2023
c26a6b5
Add missing methods needed by module.
Taztingo Dec 19, 2023
d5ff864
Fix InitChainer and AppModules.
Taztingo Dec 19, 2023
888830d
Add PreBlocker.
Taztingo Dec 19, 2023
2c2be7b
Remove unused methods in module.go
Taztingo Dec 19, 2023
c4dc26d
update logger and fix out of date functions in relayer.
Taztingo Dec 19, 2023
dabebe1
Update migrations to be compatible with sdk v0.50.
Taztingo Dec 19, 2023
6c59d9c
Update types to use ProtoCodec.
Taztingo Dec 19, 2023
64e4bb4
Remove legacy amino.
Taztingo Dec 19, 2023
ef366ab
I think I properly updated that test?
Taztingo Dec 19, 2023
339ac2d
Update export.
Taztingo Dec 20, 2023
23dd3f8
Fix remaining issues in app, encoding, and genesis.
Taztingo Dec 20, 2023
5f0dd56
Update filename in README.
Taztingo Dec 20, 2023
1da64cb
Update root.go
Taztingo Dec 20, 2023
b080c8e
Fix upgrades.
Taztingo Dec 20, 2023
940f46e
Fix dependencies so it can compile. Remove rosetta for now.
Taztingo Dec 20, 2023
b281b17
Add module basics back temporarily.
Taztingo Dec 21, 2023
efc2f02
Remove ModuleBasics.
Taztingo Dec 21, 2023
267779f
Fix missing address encoders.
Taztingo Dec 21, 2023
2e3dc60
Create new image for icq-host and delete old v7 verison.
Taztingo Dec 21, 2023
1971221
Fix end to end test.
Taztingo Dec 21, 2023
94828c9
Fix go.mod in e2e to tidy up. Fix v8 versioning at a later time.
Taztingo Dec 21, 2023
ce61647
Update upgrade_test for sdk 50.
Taztingo Dec 21, 2023
b0d7060
Update workflow to use v8 tar.
Taztingo Dec 21, 2023
9db1285
Fix dependencies in testing/demo-simapp. They should all be back to w…
Taztingo Dec 22, 2023
cb15279
Got containers for tests to run. Tests are just failing now. Brought …
Taztingo Dec 22, 2023
0b8b8c0
Update proposal to v8.
Taztingo Jan 2, 2024
38ec3e8
Add missing gov commands that are generated from autocli.
Taztingo Jan 2, 2024
6ae5ad4
Update previous_image.
Taztingo Jan 2, 2024
2230f67
format code.
Taztingo Jan 2, 2024
77dfb2e
update image after formatting and linting.
Taztingo Jan 2, 2024
0d2a9d2
comment out test relayer image.
Taztingo Jan 2, 2024
32ab992
use relayer:main image
Reecepbcups Jan 4, 2024
96a44eb
`ValidatorAddressCodec` for export
Reecepbcups Jan 4, 2024
363e7e0
QOL
Reecepbcups Jan 4, 2024
8743199
test: v7.1.1 (SDK v47) -> v8 (SDK v50)
Reecepbcups Jan 4, 2024
cf9cab0
linting
Reecepbcups Jan 4, 2024
2d2dc60
Merge pull request #1 from cosmos/reece/async-icq-tweaks
Taztingo Jan 4, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/async-icq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
run: |
docker image load -i ${{ env.HOST_TAR_PATH }}
docker image load -i ${{ env.CONTROLLER_TAR_PATH }}
docker image load -i testing/previous_images/icq-host_7_0_0.tar
docker image load -i testing/previous_images/icq-host_7_1_1.tar
docker image ls -a

- name: Run Test
Expand Down
Binary file added modules/async-icq/.Makefile.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion modules/async-icq/client/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cli
import (
"fmt"

"github.com/cosmos/ibc-apps/modules/async-icq/v7/types"
"github.com/cosmos/ibc-apps/modules/async-icq/v8/types"
"github.com/spf13/cobra"

"github.com/cosmos/cosmos-sdk/client"
Expand Down
192 changes: 103 additions & 89 deletions modules/async-icq/e2e/go.mod

Large diffs are not rendered by default.

465 changes: 280 additions & 185 deletions modules/async-icq/e2e/go.sum

Large diffs are not rendered by default.

32 changes: 20 additions & 12 deletions modules/async-icq/e2e/icq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ import (
"encoding/json"
"testing"

"github.com/cosmos/cosmos-sdk/crypto/keyring"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/strangelove-ventures/interchaintest/v7"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/relayer"
"github.com/strangelove-ventures/interchaintest/v7/testreporter"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/relayer"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"
ibccore "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"

icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types"
ibccore "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
)

func hostEncoding() *moduletestutil.TestEncodingConfig {
Expand Down Expand Up @@ -64,6 +65,12 @@ func TestInterchainQueries(t *testing.T) {
UidGid: "1025:1025",
}

relayerImage := ibc.DockerImage{
Repository: "ghcr.io/cosmos/relayer",
Version: "main",
UidGid: "1025:1025",
}

cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
{
ChainName: "controller",
Expand Down Expand Up @@ -114,6 +121,7 @@ func TestInterchainQueries(t *testing.T) {
r := interchaintest.NewBuiltinRelayerFactory(
ibc.CosmosRly,
zaptest.NewLogger(t),
relayer.DockerImage(&relayerImage),
relayer.StartupFlags("--processor", "events", "--block-history", "100"),
).Build(t, client, network)

Expand Down Expand Up @@ -170,7 +178,7 @@ func TestInterchainQueries(t *testing.T) {
func() {
err := r.StopRelayer(ctx, eRep)
if err != nil {
t.Logf("an error occured while stopping the relayer: %s", err)
t.Logf("an error occurred while stopping the relayer: %s", err)
}
},
)
Expand Down
5 changes: 3 additions & 2 deletions modules/async-icq/e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"os"
"strings"

"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"

testutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
)

var (
Expand Down
43 changes: 13 additions & 30 deletions modules/async-icq/e2e/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@ package e2e

import (
"context"
"encoding/json"
"fmt"
"testing"
"time"

upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
cosmosproto "github.com/cosmos/gogoproto/proto"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"
"github.com/docker/docker/client"
"github.com/strangelove-ventures/interchaintest/v7"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"
)

const (
chainName = "simapp"
upgradeName = "v2" // x/params migration
upgradeName = "v3" // default handler, SDK v47 -> SDK v50.

haltHeightDelta = uint64(9) // will propose upgrade this many blocks in the future
blocksAfterUpgrade = uint64(7)
Expand All @@ -31,14 +29,14 @@ const (

var (
// baseChain is the current version of the chain that will be upgraded from
// docker image load -i ../prev_builds/icq-host_7_0_0.tar
// docker image load -i ../prev_builds/icq-host_7_1_1.tar
baseChain = ibc.DockerImage{
Repository: "icq-host",
Version: "v7.0.0",
Version: "v7.1.1",
UidGid: "1025:1025",
}

// make local-image
// make local-image-icq
upgradeTo = ibc.DockerImage{
Repository: "icq-host",
Version: "local",
Expand Down Expand Up @@ -106,23 +104,6 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, upgradeRepo, upgradeDockerT

ValidatorVoting(t, ctx, chain, proposalID, height, haltHeight)
UpgradeNodes(t, ctx, chain, client, haltHeight, upgradeRepo, upgradeDockerTag)

// Validate the ICQ subspace -> keeper migration was successful.
cmd := []string{
chain.Config().Bin, "q", "interchainquery", "params", "--output=json", "--node", chain.GetRPCAddress(),
}
stdout, _, err := chain.Exec(ctx, cmd, nil)
fmt.Println("stdout", string(stdout))
require.NoError(t, err, "error fetching icq params")

var params icqtypes.Params
err = json.Unmarshal(stdout, &params)
require.NoError(t, err, "error unmarshalling icq params")

t.Logf("params: %+v", params)
require.Equal(t, false, params.HostEnabled, "HostEnabled not equal to expected value")
require.Equal(t, []string{"/cosmos.bank.v1beta1.Query/AllBalances"}, params.AllowQueries, "AllowQueries not equal to expected value")

}

func SubmitUpgradeProposal(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, upgradeName string, haltHeight uint64) string {
Expand All @@ -137,7 +118,9 @@ func SubmitUpgradeProposal(t *testing.T, ctx context.Context, chain *cosmos.Cosm
},
}

proposal, err := chain.BuildProposal(upgradeMsg, "Chain Upgrade "+upgradeName, "Summary desc", "ipfs://CID", fmt.Sprintf(`500000000%s`, chain.Config().Denom))
proposer := user.FormattedAddress()
expedited := false
proposal, err := chain.BuildProposal(upgradeMsg, "Chain Upgrade "+upgradeName, "Summary desc", "ipfs://CID", fmt.Sprintf(`500000000%s`, chain.Config().Denom), proposer, expedited)
require.NoError(t, err, "error building proposal")

txProp, err := chain.SubmitProposal(ctx, user.KeyName(), proposal)
Expand Down Expand Up @@ -180,7 +163,7 @@ func ValidatorVoting(t *testing.T, ctx context.Context, chain *cosmos.CosmosChai
err := chain.VoteOnProposalAllValidators(ctx, proposalID, cosmos.ProposalVoteYes)
require.NoError(t, err, "failed to submit votes")

_, err = cosmos.PollForProposalStatus(ctx, chain, height, height+haltHeightDelta, proposalID, cosmos.ProposalStatusPassed)
_, err = cosmos.PollForProposalStatusV8(ctx, chain, height, height+haltHeightDelta, proposalID, cosmos.ProposalStatusPassedV8)
Reecepbcups marked this conversation as resolved.
Show resolved Hide resolved
require.NoError(t, err, "proposal status did not change to passed in expected number of blocks")

timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*45)
Expand Down
Loading
Loading