Skip to content

Commit 46403c3

Browse files
MSalopekmergify[bot]
authored andcommitted
deps!: use fixed cosmwasm version (v0.51.0) (#3230)
* deps!: use fixed cosmwasm version (v0.51.0) * update build * update makefile * update upgrade test with wasmvm version * update upgrade test with wasmvm version * update upgrade test with wasmvm version * update upgrade test with wasmvm version * fix: handle tests broken by libwasmvm * update simtests app dir * appease linter * update simtests app dir * appease linter * apply nits (cherry picked from commit 59574b5)
1 parent 3d52af7 commit 46403c3

File tree

11 files changed

+63
-34
lines changed

11 files changed

+63
-34
lines changed

.github/workflows/test.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,15 @@ jobs:
163163
# the old gaiad binary version is hardcoded, need to be updated each major release.
164164
- name: Install Old Gaiad
165165
run: |
166-
git checkout v18.1.0
167-
make build
168-
cp ./build/gaiad ./build/gaiadold
169-
go clean -modcache
166+
curl -LO https://github.com/cosmos/gaia/releases/download/v18.1.0/gaiad-v18.1.0-linux-amd64
167+
chmod a+x gaiad-v18.1.0-linux-amd64
168+
mkdir build
169+
mv ./gaiad-v18.1.0-linux-amd64 ./build/gaiadold
170170
if: env.GIT_DIFF
171171
- name: Install New Gaiad
172172
run: |
173-
git checkout -
174-
curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm.x86_64.so
175-
curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm.aarch64.so
173+
curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v2.0.0/libwasmvm.x86_64.so
174+
curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v2.0.0/libwasmvm.aarch64.so
176175
uname -m
177176
sudo cp "./libwasmvm.$(uname -m).so" /usr/lib/
178177
make build

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ ENV PACKAGES="curl make git libc-dev bash file gcc linux-headers eudev-dev"
88
RUN apk add --no-cache $PACKAGES
99

1010
# See https://github.com/CosmWasm/wasmvm/releases
11-
ARG WASMVM_VERSION=v1.5.0
11+
ARG WASMVM_VERSION=v2.0.0
1212
ADD https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
1313
ADD https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
14-
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 2687afbdae1bc6c7c8b05ae20dfb8ffc7ddc5b4e056697d0f37853dfe294e913
15-
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 465e3a088e96fd009a11bfd234c69fb8a0556967677e54511c084f815cf9ce63
14+
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 3b478b3e51d31e53ce9324a8895d2cd7278af5179b9a02ea55d8627958e42afa
15+
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ca08bb7b73b49b483611d9755bb8455620bb8c0faf3014400908ed49bf3b19a5
1616
RUN cp "/lib/libwasmvm_muslc.$(uname -m).a" /lib/libwasmvm_muslc.a
1717

1818
COPY go.mod go.sum* ./

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ include contrib/devtools/Makefile
100100

101101
check_version:
102102
ifneq ($(GO_SYSTEM_VERSION), $(REQUIRE_GO_VERSION))
103-
@echo "ERROR: Go version 1.21 is required for $(VERSION) of Gaia."
103+
@echo "ERROR: Go version 1.22 is required for $(VERSION) of Gaia."
104104
exit 1
105105
endif
106106

@@ -150,7 +150,7 @@ distclean: clean
150150

151151
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
152152
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_VERSION)
153-
COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm | sed 's/.* //')
153+
COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //')
154154

155155
# create tag and run goreleaser without publishing
156156
# errors are possible while running goreleaser - the process can run for >30 min

app/helpers/test_helpers.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package helpers
22

33
import (
44
"encoding/json"
5+
"os"
56
"testing"
67
"time"
78

@@ -125,6 +126,11 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
125126

126127
func setup() (*gaiaapp.GaiaApp, gaiaapp.GenesisState) {
127128
db := dbm.NewMemDB()
129+
dir, err := os.MkdirTemp("", "gaia-test-app")
130+
if err != nil {
131+
panic(err)
132+
}
133+
128134
appOptions := make(simtestutil.AppOptionsMap, 0)
129135
emptyWasmOpts := []wasmkeeper.Option{}
130136
appOptions[server.FlagInvCheckPeriod] = 5
@@ -136,7 +142,7 @@ func setup() (*gaiaapp.GaiaApp, gaiaapp.GenesisState) {
136142
nil,
137143
true,
138144
map[int64]bool{},
139-
gaiaapp.DefaultNodeHome,
145+
dir,
140146
appOptions,
141147
emptyWasmOpts,
142148
)

app/keepers/keepers.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package keepers
33
import (
44
"fmt"
55
"os"
6-
"strings"
6+
"path/filepath"
77

88
feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper"
99
feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types"
@@ -80,7 +80,6 @@ import (
8080
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
8181
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
8282

83-
wasmapp "github.com/CosmWasm/wasmd/app"
8483
"github.com/CosmWasm/wasmd/x/wasm"
8584
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
8685
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
@@ -469,6 +468,7 @@ func NewAppKeeper(
469468
// Must be called on PFMRouter AFTER TransferKeeper initialized
470469
appKeepers.PFMRouterKeeper.SetTransferKeeper(appKeepers.TransferKeeper)
471470

471+
wasmDir := filepath.Join(homePath, "wasm")
472472
wasmConfig, err := wasm.ReadWasmConfig(appOpts)
473473
if err != nil {
474474
panic("error while reading wasm config: " + err.Error())
@@ -481,16 +481,16 @@ func NewAppKeeper(
481481
appKeepers.BankKeeper,
482482
appKeepers.StakingKeeper,
483483
distrkeeper.NewQuerier(appKeepers.DistrKeeper),
484-
appKeepers.IBCKeeper.ChannelKeeper,
484+
appKeepers.IBCFeeKeeper,
485485
appKeepers.IBCKeeper.ChannelKeeper,
486486
appKeepers.IBCKeeper.PortKeeper,
487487
appKeepers.scopedWasmKeeper,
488488
appKeepers.TransferKeeper,
489489
bApp.MsgServiceRouter(),
490490
bApp.GRPCQueryRouter(),
491-
homePath,
491+
wasmDir,
492492
wasmConfig,
493-
strings.Join(wasmapp.AllCapabilities(), ","),
493+
wasmkeeper.BuiltInCapabilities(),
494494
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
495495
wasmOpts...,
496496
)

app/sim_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ func TestAppStateDeterminism(t *testing.T) {
7070

7171
appHashList := make([]json.RawMessage, numTimesToRunPerSeed)
7272
appOptions := make(simtestutil.AppOptionsMap, 0)
73-
appOptions[flags.FlagHome] = gaia.DefaultNodeHome
7473
appOptions[server.FlagInvCheckPeriod] = sim.FlagPeriodValue
7574

7675
for i := 0; i < numSeeds; i++ {
@@ -89,13 +88,16 @@ func TestAppStateDeterminism(t *testing.T) {
8988
}
9089

9190
db := dbm.NewMemDB()
91+
dir, err := os.MkdirTemp("", "gaia-simulation")
92+
require.NoError(t, err)
93+
appOptions[flags.FlagHome] = dir
9294
app := gaia.NewGaiaApp(
9395
logger,
9496
db,
9597
nil,
9698
true,
9799
map[int64]bool{},
98-
gaia.DefaultNodeHome,
100+
dir,
99101
appOptions,
100102
emptyWasmOption,
101103
interBlockCacheOpt(),
@@ -117,7 +119,7 @@ func TestAppStateDeterminism(t *testing.T) {
117119

118120
blockedAddresses := app.BlockedModuleAccountAddrs(app.ModuleAccountAddrs())
119121

120-
_, _, err := simulation.SimulateFromSeed(
122+
_, _, err = simulation.SimulateFromSeed(
121123
t,
122124
os.Stdout,
123125
app.BaseApp,

go.mod

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/cosmos/gaia/v19
22

3-
go 1.22.3
3+
go 1.22.4
44

55
require (
66
cosmossdk.io/api v0.7.5
@@ -17,7 +17,7 @@ require (
1717
cosmossdk.io/x/feegrant v0.1.1
1818
cosmossdk.io/x/tx v0.13.3
1919
cosmossdk.io/x/upgrade v0.1.4
20-
github.com/CosmWasm/wasmd v0.50.0
20+
github.com/CosmWasm/wasmd v0.51.0
2121
github.com/cometbft/cometbft v0.38.9
2222
github.com/cometbft/cometbft-db v0.12.0
2323
github.com/cosmos/cosmos-db v1.0.2
@@ -48,7 +48,6 @@ require (
4848
cloud.google.com/go/iam v1.1.8 // indirect
4949
cloud.google.com/go/storage v1.41.0 // indirect
5050
github.com/golang/protobuf v1.5.4 // indirect
51-
// github.com/gravity-devs/liquidity v1.6.0
5251
github.com/grpc-ecosystem/grpc-gateway v1.16.0
5352
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
5453
google.golang.org/grpc v1.64.0 // indirect
@@ -65,7 +64,7 @@ require (
6564
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
6665
github.com/99designs/keyring v1.2.2 // indirect
6766
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
68-
github.com/CosmWasm/wasmvm v1.5.0 // indirect
67+
github.com/CosmWasm/wasmvm/v2 v2.0.0 // indirect
6968
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
7069
github.com/DataDog/zstd v1.5.5 // indirect
7170
github.com/Microsoft/go-winio v0.6.1 // indirect
@@ -192,7 +191,7 @@ require (
192191
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
193192
github.com/rogpeppe/go-internal v1.12.0 // indirect
194193
github.com/rs/cors v1.8.3 // indirect
195-
github.com/rs/zerolog v1.32.0 // indirect
194+
github.com/rs/zerolog v1.33.0 // indirect
196195
github.com/sagikazarmark/locafero v0.4.0 // indirect
197196
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
198197
github.com/sasha-s/go-deadlock v0.3.1 // indirect

go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25
239239
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
240240
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
241241
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
242-
github.com/CosmWasm/wasmd v0.50.0 h1:NVaGqCSTRfb9UTDHJwT6nQIWcb6VjlQl88iI+u1+qjE=
243-
github.com/CosmWasm/wasmd v0.50.0/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk=
244-
github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw=
245-
github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc=
242+
github.com/CosmWasm/wasmd v0.51.0 h1:3A2o20RrdF7P1D3Xb+R7A/pHbbHWsYCDXrHLa7S0SC8=
243+
github.com/CosmWasm/wasmd v0.51.0/go.mod h1:7TSaj5HoolghujuVWeExqmcUKgpcYWEySGLSODbnnwY=
244+
github.com/CosmWasm/wasmvm/v2 v2.0.0 h1:IqNCI2G0mvs7K6ej17/I28805rVqnu+Y1cWDqIdwb08=
245+
github.com/CosmWasm/wasmvm/v2 v2.0.0/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck=
246246
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
247247
github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4=
248248
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=
11651165
github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo=
11661166
github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
11671167
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
1168-
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
1169-
github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
1168+
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
1169+
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
11701170
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
11711171
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
11721172
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=

tests/integration/ibcfee_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestIBCFeeTestSuite(t *testing.T) {
4949

5050
func (suite *IBCFeeTestSuite) SetupTest() {
5151
ante.UseFeeMarketDecorator = false
52-
ibctesting.DefaultTestingAppInit = GaiaAppIniter
52+
ibctesting.DefaultTestingAppInit = GaiaAppIniterTempDir
5353
suite.coordinator = ibctesting.NewCoordinator(suite.T(), 3)
5454
suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1))
5555
suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2))

tests/integration/interchain_security_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func init() {
2828
// concrete app types returned by the relevant app initers.
2929
ccvSuite = integration.NewCCVTestSuite[*gaiaApp.GaiaApp, *appConsumer.App](
3030
// Pass in ibctesting.AppIniters for gaia (provider) and consumer.
31-
GaiaAppIniter, icstestingutils.ConsumerAppIniter, []string{})
31+
GaiaAppIniterTempDir, icstestingutils.ConsumerAppIniter, []string{})
3232

3333
ante.UseFeeMarketDecorator = false
3434
}

tests/integration/test_utils.go

+23
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66
"math/rand"
7+
"os"
78
"testing"
89
"time"
910

@@ -27,6 +28,28 @@ import (
2728

2829
var app *gaiaApp.GaiaApp
2930

31+
// Some tests require a random directory to be created when running IBC testing suite with gaia.
32+
// This is due to how CosmWasmVM initializes the VM - all IBC testing apps must have different dirs so they don't conflict.
33+
func GaiaAppIniterTempDir() (ibctesting.TestingApp, map[string]json.RawMessage) {
34+
tmpDir, err := os.MkdirTemp("", "")
35+
if err != nil {
36+
panic(err)
37+
}
38+
app = gaiaApp.NewGaiaApp(
39+
log.NewNopLogger(),
40+
dbm.NewMemDB(),
41+
nil,
42+
true,
43+
map[int64]bool{},
44+
tmpDir,
45+
gaiaApp.EmptyAppOptions{},
46+
gaiaApp.EmptyWasmOptions)
47+
48+
testApp := ibctesting.TestingApp(app)
49+
50+
return testApp, app.ModuleBasics.DefaultGenesis(app.AppCodec())
51+
}
52+
3053
// GaiaAppIniter implements ibctesting.AppIniter for the gaia app
3154
func GaiaAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) {
3255
app = gaiaApp.NewGaiaApp(

0 commit comments

Comments
 (0)