diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1648983a534..e81db2f3e37 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -163,16 +163,15 @@ jobs: # the old gaiad binary version is hardcoded, need to be updated each major release. - name: Install Old Gaiad run: | - git checkout v18.1.0 - make build - cp ./build/gaiad ./build/gaiadold - go clean -modcache + curl -LO https://github.com/cosmos/gaia/releases/download/v18.1.0/gaiad-v18.1.0-linux-amd64 + chmod a+x gaiad-v18.1.0-linux-amd64 + mkdir build + mv ./gaiad-v18.1.0-linux-amd64 ./build/gaiadold if: env.GIT_DIFF - name: Install New Gaiad run: | - git checkout - - curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm.x86_64.so - curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm.aarch64.so + curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v2.0.0/libwasmvm.x86_64.so + curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v2.0.0/libwasmvm.aarch64.so uname -m sudo cp "./libwasmvm.$(uname -m).so" /usr/lib/ make build diff --git a/Dockerfile b/Dockerfile index cb5bbda131b..2da0ed4ae07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,11 @@ ENV PACKAGES="curl make git libc-dev bash file gcc linux-headers eudev-dev" RUN apk add --no-cache $PACKAGES # See https://github.com/CosmWasm/wasmvm/releases -ARG WASMVM_VERSION=v1.5.0 +ARG WASMVM_VERSION=v2.0.0 ADD https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a ADD https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a -RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 2687afbdae1bc6c7c8b05ae20dfb8ffc7ddc5b4e056697d0f37853dfe294e913 -RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 465e3a088e96fd009a11bfd234c69fb8a0556967677e54511c084f815cf9ce63 +RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 3b478b3e51d31e53ce9324a8895d2cd7278af5179b9a02ea55d8627958e42afa +RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ca08bb7b73b49b483611d9755bb8455620bb8c0faf3014400908ed49bf3b19a5 RUN cp "/lib/libwasmvm_muslc.$(uname -m).a" /lib/libwasmvm_muslc.a COPY go.mod go.sum* ./ diff --git a/Makefile b/Makefile index cf658272b3b..b0f7bbd383d 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ include contrib/devtools/Makefile check_version: ifneq ($(GO_SYSTEM_VERSION), $(REQUIRE_GO_VERSION)) - @echo "ERROR: Go version 1.21 is required for $(VERSION) of Gaia." + @echo "ERROR: Go version 1.22 is required for $(VERSION) of Gaia." exit 1 endif @@ -150,7 +150,7 @@ distclean: clean GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_VERSION) -COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') +COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //') # create tag and run goreleaser without publishing # errors are possible while running goreleaser - the process can run for >30 min diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index a983bb0f6b0..68c90607a30 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -2,6 +2,7 @@ package helpers import ( "encoding/json" + "os" "testing" "time" @@ -125,6 +126,11 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs func setup() (*gaiaapp.GaiaApp, gaiaapp.GenesisState) { db := dbm.NewMemDB() + dir, err := os.MkdirTemp("", "gaia-test-app") + if err != nil { + panic(err) + } + appOptions := make(simtestutil.AppOptionsMap, 0) emptyWasmOpts := []wasmkeeper.Option{} appOptions[server.FlagInvCheckPeriod] = 5 @@ -136,7 +142,7 @@ func setup() (*gaiaapp.GaiaApp, gaiaapp.GenesisState) { nil, true, map[int64]bool{}, - gaiaapp.DefaultNodeHome, + dir, appOptions, emptyWasmOpts, ) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 1bf672101a4..3d06fb0aac9 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -3,7 +3,7 @@ package keepers import ( "fmt" "os" - "strings" + "path/filepath" feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper" feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" @@ -80,7 +80,6 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - wasmapp "github.com/CosmWasm/wasmd/app" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -469,6 +468,7 @@ func NewAppKeeper( // Must be called on PFMRouter AFTER TransferKeeper initialized appKeepers.PFMRouterKeeper.SetTransferKeeper(appKeepers.TransferKeeper) + wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOpts) if err != nil { panic("error while reading wasm config: " + err.Error()) @@ -481,16 +481,16 @@ func NewAppKeeper( appKeepers.BankKeeper, appKeepers.StakingKeeper, distrkeeper.NewQuerier(appKeepers.DistrKeeper), - appKeepers.IBCKeeper.ChannelKeeper, + appKeepers.IBCFeeKeeper, appKeepers.IBCKeeper.ChannelKeeper, appKeepers.IBCKeeper.PortKeeper, appKeepers.scopedWasmKeeper, appKeepers.TransferKeeper, bApp.MsgServiceRouter(), bApp.GRPCQueryRouter(), - homePath, + wasmDir, wasmConfig, - strings.Join(wasmapp.AllCapabilities(), ","), + wasmkeeper.BuiltInCapabilities(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), wasmOpts..., ) diff --git a/app/sim_test.go b/app/sim_test.go index b69cd58ab5f..1aa27fbf42a 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -70,7 +70,6 @@ func TestAppStateDeterminism(t *testing.T) { appHashList := make([]json.RawMessage, numTimesToRunPerSeed) appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = gaia.DefaultNodeHome appOptions[server.FlagInvCheckPeriod] = sim.FlagPeriodValue for i := 0; i < numSeeds; i++ { @@ -89,13 +88,16 @@ func TestAppStateDeterminism(t *testing.T) { } db := dbm.NewMemDB() + dir, err := os.MkdirTemp("", "gaia-simulation") + require.NoError(t, err) + appOptions[flags.FlagHome] = dir app := gaia.NewGaiaApp( logger, db, nil, true, map[int64]bool{}, - gaia.DefaultNodeHome, + dir, appOptions, emptyWasmOption, interBlockCacheOpt(), @@ -117,7 +119,7 @@ func TestAppStateDeterminism(t *testing.T) { blockedAddresses := app.BlockedModuleAccountAddrs(app.ModuleAccountAddrs()) - _, _, err := simulation.SimulateFromSeed( + _, _, err = simulation.SimulateFromSeed( t, os.Stdout, app.BaseApp, diff --git a/go.mod b/go.mod index 988acd57e6d..2c9bcddd973 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cosmos/gaia/v19 -go 1.22.3 +go 1.22.4 require ( cosmossdk.io/api v0.7.5 @@ -17,7 +17,7 @@ require ( cosmossdk.io/x/feegrant v0.1.1 cosmossdk.io/x/tx v0.13.3 cosmossdk.io/x/upgrade v0.1.4 - github.com/CosmWasm/wasmd v0.50.0 + github.com/CosmWasm/wasmd v0.51.0 github.com/cometbft/cometbft v0.38.9 github.com/cometbft/cometbft-db v0.12.0 github.com/cosmos/cosmos-db v1.0.2 @@ -48,7 +48,6 @@ require ( cloud.google.com/go/iam v1.1.8 // indirect cloud.google.com/go/storage v1.41.0 // indirect github.com/golang/protobuf v1.5.4 // indirect - // github.com/gravity-devs/liquidity v1.6.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/grpc v1.64.0 // indirect @@ -65,7 +64,7 @@ require ( github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/CosmWasm/wasmvm v1.5.0 // indirect + github.com/CosmWasm/wasmvm/v2 v2.0.0 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -192,7 +191,7 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect diff --git a/go.sum b/go.sum index 87708100939..b54fce514ba 100644 --- a/go.sum +++ b/go.sum @@ -239,10 +239,10 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmd v0.50.0 h1:NVaGqCSTRfb9UTDHJwT6nQIWcb6VjlQl88iI+u1+qjE= -github.com/CosmWasm/wasmd v0.50.0/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= -github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw= -github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= +github.com/CosmWasm/wasmd v0.51.0 h1:3A2o20RrdF7P1D3Xb+R7A/pHbbHWsYCDXrHLa7S0SC8= +github.com/CosmWasm/wasmd v0.51.0/go.mod h1:7TSaj5HoolghujuVWeExqmcUKgpcYWEySGLSODbnnwY= +github.com/CosmWasm/wasmvm/v2 v2.0.0 h1:IqNCI2G0mvs7K6ej17/I28805rVqnu+Y1cWDqIdwb08= +github.com/CosmWasm/wasmvm/v2 v2.0.0/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -1165,8 +1165,8 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= diff --git a/tests/integration/ibcfee_test.go b/tests/integration/ibcfee_test.go index 4e5d1df1476..ad2810e54f5 100644 --- a/tests/integration/ibcfee_test.go +++ b/tests/integration/ibcfee_test.go @@ -49,7 +49,7 @@ func TestIBCFeeTestSuite(t *testing.T) { func (suite *IBCFeeTestSuite) SetupTest() { ante.UseFeeMarketDecorator = false - ibctesting.DefaultTestingAppInit = GaiaAppIniter + ibctesting.DefaultTestingAppInit = GaiaAppIniterTempDir suite.coordinator = ibctesting.NewCoordinator(suite.T(), 3) suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) diff --git a/tests/integration/interchain_security_test.go b/tests/integration/interchain_security_test.go index 9b86c9ea2f5..4f2331e3bb0 100644 --- a/tests/integration/interchain_security_test.go +++ b/tests/integration/interchain_security_test.go @@ -28,7 +28,7 @@ func init() { // concrete app types returned by the relevant app initers. ccvSuite = integration.NewCCVTestSuite[*gaiaApp.GaiaApp, *appConsumer.App]( // Pass in ibctesting.AppIniters for gaia (provider) and consumer. - GaiaAppIniter, icstestingutils.ConsumerAppIniter, []string{}) + GaiaAppIniterTempDir, icstestingutils.ConsumerAppIniter, []string{}) ante.UseFeeMarketDecorator = false } diff --git a/tests/integration/test_utils.go b/tests/integration/test_utils.go index 4132f480f2a..de7955f33ce 100644 --- a/tests/integration/test_utils.go +++ b/tests/integration/test_utils.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "math/rand" + "os" "testing" "time" @@ -27,6 +28,28 @@ import ( var app *gaiaApp.GaiaApp +// Some tests require a random directory to be created when running IBC testing suite with gaia. +// This is due to how CosmWasmVM initializes the VM - all IBC testing apps must have different dirs so they don't conflict. +func GaiaAppIniterTempDir() (ibctesting.TestingApp, map[string]json.RawMessage) { + tmpDir, err := os.MkdirTemp("", "") + if err != nil { + panic(err) + } + app = gaiaApp.NewGaiaApp( + log.NewNopLogger(), + dbm.NewMemDB(), + nil, + true, + map[int64]bool{}, + tmpDir, + gaiaApp.EmptyAppOptions{}, + gaiaApp.EmptyWasmOptions) + + testApp := ibctesting.TestingApp(app) + + return testApp, app.ModuleBasics.DefaultGenesis(app.AppCodec()) +} + // GaiaAppIniter implements ibctesting.AppIniter for the gaia app func GaiaAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { app = gaiaApp.NewGaiaApp(