Skip to content

Commit

Permalink
sdk 50 v2 (#716)
Browse files Browse the repository at this point in the history
* upgrades interchaintest to ibc8 first commit

* initial tidy

* use math lib and use store from 50

* update packages

* remove beginblockevents section in chain_node.go

* bump go

* upgrade workflows

* update lint.yml

* update ibc to use upstream repo

* add finalizeBlockTx

* update hermes config

* update default hermes version

* rm unneeded param

* remove wasm

* remove polkadot

* remove hyperspace

* update go mod + tidy

* update sdk boundary test

* relayer image for sdk boundary test

* bump module to `v8`

* boundary test run in parallel

* fix: bump hermes UidGid

---------

Co-authored-by: catShaark <[email protected]>
Co-authored-by: Charly <[email protected]>
Co-authored-by: Dan Kanefsky <[email protected]>
  • Loading branch information
4 people authored Sep 5, 2023
1 parent 3e17efc commit d39b77e
Show file tree
Hide file tree
Showing 118 changed files with 580 additions and 5,310 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'

- name: checkout interchaintest
uses: actions/checkout@v3
Expand All @@ -35,10 +35,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'
cache: false

- name: checkout interchaintest
Expand All @@ -57,10 +57,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'
cache: false

- name: checkout interchaintest
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
version: v1.54
only-new-issues: true
args: --timeout=5m
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'

- name: checkout interchaintest
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ help: ## Print this help message

.PHONY: interchaintest
interchaintest: gen ## Build interchaintest binary into ./bin
go test -ldflags "-X github.com/strangelove-ventures/interchaintest/v7/internal/version.GitSha=$(shell git describe --always --dirty)" -c -o ./bin/interchaintest ./cmd/interchaintest
go test -ldflags "-X github.com/strangelove-ventures/interchaintest/v8/internal/version.GitSha=$(shell git describe --always --dirty)" -c -o ./bin/interchaintest ./cmd/interchaintest

.PHONY: test
test: ## Run unit tests
Expand Down
25 changes: 13 additions & 12 deletions chain/cosmos/08-wasm-types/client_state.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
Expand All @@ -21,11 +22,11 @@ func (c ClientState) Validate() error {
return nil
}

func (c ClientState) Status(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec) exported.Status {
func (c ClientState) Status(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec) exported.Status {
return exported.Active
}

func (c ClientState) ExportMetadata(store sdk.KVStore) []exported.GenesisMetadata {
func (c ClientState) ExportMetadata(store storetypes.KVStore) []exported.GenesisMetadata {
return []exported.GenesisMetadata{}
}

Expand All @@ -35,20 +36,20 @@ func (c ClientState) ZeroCustomFields() exported.ClientState {

func (c ClientState) GetTimestampAtHeight(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
) (uint64, error) {
return 0, nil
}

func (c ClientState) Initialize(context sdk.Context, marshaler codec.BinaryCodec, store sdk.KVStore, state exported.ConsensusState) error {
func (c ClientState) Initialize(context sdk.Context, marshaler codec.BinaryCodec, store storetypes.KVStore, state exported.ConsensusState) error {
return nil
}

func (c ClientState) VerifyMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
Expand All @@ -62,7 +63,7 @@ func (c ClientState) VerifyMembership(

func (c ClientState) VerifyNonMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
Expand All @@ -77,34 +78,34 @@ func (c ClientState) VerifyNonMembership(
// It must handle each type of ClientMessage appropriately. Calls to CheckForMisbehaviour, UpdateState, and UpdateStateOnMisbehaviour
// will assume that the content of the ClientMessage has been verified and can be trusted. An error should be returned
// if the ClientMessage fails to verify.
func (c ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) error {
func (c ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) error {
return nil
}

func (c ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, msg exported.ClientMessage) bool {
func (c ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, msg exported.ClientMessage) bool {
return true
}

// UpdateStateOnMisbehaviour should perform appropriate state changes on a client state given that misbehaviour has been detected and verified
func (c ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) {
func (c ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) {

}

func (c ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) []exported.Height {
func (c ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) []exported.Height {
return []exported.Height{c.LatestHeight}
}

func (c ClientState) CheckSubstituteAndUpdateState(
ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore,
substituteClientStore sdk.KVStore, substituteClient exported.ClientState,
substituteClientStore storetypes.KVStore, substituteClient exported.ClientState,
) error {
return nil
}

func (c ClientState) VerifyUpgradeAndUpdateState(
ctx sdk.Context,
cdc codec.BinaryCodec,
store sdk.KVStore,
store storetypes.KVStore,
newClient exported.ClientState,
newConsState exported.ConsensusState,
proofUpgradeClient,
Expand Down
4 changes: 2 additions & 2 deletions chain/cosmos/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authTx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/strangelove-ventures/interchaintest/v7/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
"github.com/strangelove-ventures/interchaintest/v8/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
)

type ClientContextOpt func(clientContext client.Context) client.Context
Expand Down
43 changes: 11 additions & 32 deletions chain/cosmos/chain_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import (
"go.uber.org/zap"
"golang.org/x/sync/errgroup"

"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/internal/blockdb"
"github.com/strangelove-ventures/interchaintest/v7/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/internal/blockdb"
"github.com/strangelove-ventures/interchaintest/v8/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
)

// ChainNode represents a node in the test network that is being created
Expand Down Expand Up @@ -417,47 +417,26 @@ func (tn *ChainNode) FindTxs(ctx context.Context, height uint64) ([]blockdb.Tx,
}
txs = append(txs, newTx)
}
if len(blockRes.BeginBlockEvents) > 0 {
beginBlockTx := blockdb.Tx{
Data: []byte(`{"data":"begin_block","note":"this is a transaction artificially created for debugging purposes"}`),
if len(blockRes.FinalizeBlockEvents) > 0 {
finalizeBlockTx := blockdb.Tx{
Data: []byte(`{"data":"finalize_block","note":"this is a transaction artificially created for debugging purposes"}`),
}
beginBlockTx.Events = make([]blockdb.Event, len(blockRes.BeginBlockEvents))
for i, e := range blockRes.BeginBlockEvents {
finalizeBlockTx.Events = make([]blockdb.Event, len(blockRes.FinalizeBlockEvents))
for i, e := range blockRes.FinalizeBlockEvents {
attrs := make([]blockdb.EventAttribute, len(e.Attributes))
for j, attr := range e.Attributes {
attrs[j] = blockdb.EventAttribute{
Key: string(attr.Key),
Value: string(attr.Value),
}
}
beginBlockTx.Events[i] = blockdb.Event{
finalizeBlockTx.Events[i] = blockdb.Event{
Type: e.Type,
Attributes: attrs,
}
}
txs = append(txs, beginBlockTx)
txs = append(txs, finalizeBlockTx)
}
if len(blockRes.EndBlockEvents) > 0 {
endBlockTx := blockdb.Tx{
Data: []byte(`{"data":"end_block","note":"this is a transaction artificially created for debugging purposes"}`),
}
endBlockTx.Events = make([]blockdb.Event, len(blockRes.EndBlockEvents))
for i, e := range blockRes.EndBlockEvents {
attrs := make([]blockdb.EventAttribute, len(e.Attributes))
for j, attr := range e.Attributes {
attrs[j] = blockdb.EventAttribute{
Key: string(attr.Key),
Value: string(attr.Value),
}
}
endBlockTx.Events[i] = blockdb.Event{
Type: e.Type,
Attributes: attrs,
}
}
txs = append(txs, endBlockTx)
}

return txs, nil
}

Expand Down
7 changes: 2 additions & 5 deletions chain/cosmos/codec.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cosmos

import (
"cosmossdk.io/x/upgrade"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -19,14 +20,12 @@ import (
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
"github.com/cosmos/ibc-go/modules/capability"

transfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
ibccore "github.com/cosmos/ibc-go/v7/modules/core"
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
ibcwasm "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos/08-wasm-types"
ibcwasm "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos/08-wasm-types"
)

func DefaultEncoding() testutil.TestEncodingConfig {
Expand All @@ -41,8 +40,6 @@ func DefaultEncoding() testutil.TestEncodingConfig {
gov.NewAppModuleBasic(
[]govclient.ProposalHandler{
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
},
),
params.AppModuleBasic{},
Expand Down
18 changes: 10 additions & 8 deletions chain/cosmos/cosmos_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"sync"

"cosmossdk.io/math"
sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
Expand All @@ -29,12 +30,12 @@ import (
dockertypes "github.com/docker/docker/api/types"
volumetypes "github.com/docker/docker/api/types/volume"
"github.com/docker/docker/client"
wasmtypes "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos/08-wasm-types"
"github.com/strangelove-ventures/interchaintest/v7/chain/internal/tendermint"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/internal/blockdb"
"github.com/strangelove-ventures/interchaintest/v7/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
wasmtypes "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos/08-wasm-types"
"github.com/strangelove-ventures/interchaintest/v8/chain/internal/tendermint"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/internal/blockdb"
"github.com/strangelove-ventures/interchaintest/v8/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
Expand Down Expand Up @@ -822,12 +823,12 @@ func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGene
chainCfg := c.Config()

genesisAmount := types.Coin{
Amount: types.NewInt(10_000_000_000_000),
Amount: sdkmath.NewInt(10_000_000_000_000),
Denom: chainCfg.Denom,
}

genesisSelfDelegation := types.Coin{
Amount: types.NewInt(5_000_000_000_000),
Amount: sdkmath.NewInt(5_000_000_000_000),
Denom: chainCfg.Denom,
}

Expand Down Expand Up @@ -936,6 +937,7 @@ func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGene
}

for _, wallet := range additionalGenesisWallets {

if err := validator0.AddGenesisAccount(ctx, wallet.Address, []types.Coin{{Denom: wallet.Denom, Amount: wallet.Amount}}); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/icza/dyno"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
)

type GenesisKV struct {
Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/osmosis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"strings"

"github.com/strangelove-ventures/interchaintest/v7/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v8/internal/dockerutil"
)

// OsmosisPoolParams defines parameters for creating an osmosis gamm liquidity pool
Expand Down
4 changes: 2 additions & 2 deletions chain/cosmos/poll.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
)

// PollForProposalStatus attempts to find a proposal with matching ID and status.
Expand Down
4 changes: 2 additions & 2 deletions chain/cosmos/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/docker/go-connections/nat"
"go.uber.org/zap"

"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/internal/dockerutil"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/internal/dockerutil"
)

type SidecarProcesses []*SidecarProcess
Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cosmos

import (
"github.com/cosmos/cosmos-sdk/types"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
)

var _ ibc.Wallet = &CosmosWallet{}
Expand Down
Loading

0 comments on commit d39b77e

Please sign in to comment.