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

build(deps): bump ibc-go to v3.0.0 and wasmd to v0.27.0 #875

Merged
merged 16 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: deps
module: none
pull_request: 875
description: Updated ibc-go to v3.0.0 and wasmd to v0.27.0
backward_compatible: false
date: 2022-05-26T08:14:55.307849038Z
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ proto-lint:
proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=master

TM_URL = https://github.com/tendermint/tendermint/v0.34.16/proto/tendermint
TM_URL = https://github.com/tendermint/tendermint/v0.34.19/proto/tendermint
GOGO_PROTO_URL = https://github.com/regen-network/protobuf/cosmos
COSMOS_URL = https://github.com/cosmos/cosmos-sdk/v0.45.1/proto/cosmos
COSMOS_URL = https://github.com/cosmos/cosmos-sdk/v0.45.4/proto/cosmos
COSMOS_PROTO_URL = https://github.com/regen-network/cosmos-proto/master
CONFIO_URL = https://github.com/confio/ics23/v0.6.3
IBC_URL = https://github.com/cosmos/ibc-go/v2.2.0/proto/ibc
IBC_URL = https://github.com/cosmos/ibc-go/v3.0.0/proto/ibc

TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
TM_ABCI_TYPES = third_party/proto/tendermint/abci
Expand Down
8 changes: 4 additions & 4 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
channelkeeper "github.com/cosmos/ibc-go/v2/modules/core/04-channel/keeper"
ibcante "github.com/cosmos/ibc-go/v2/modules/core/ante"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"

feeskeeper "github.com/desmos-labs/desmos/v3/x/fees/keeper"

Expand All @@ -18,7 +18,7 @@ import (
type HandlerOptions struct {
ante.HandlerOptions

IBCChannelkeeper channelkeeper.Keeper
IBCkeeper *ibckeeper.Keeper
FeesKeeper feeskeeper.Keeper
TxCounterStoreKey sdk.StoreKey
WasmConfig wasmTypes.WasmConfig
Expand Down Expand Up @@ -58,6 +58,6 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCChannelkeeper),
ibcante.NewAnteDecorator(options.IBCkeeper),
), nil
}
44 changes: 26 additions & 18 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/authz"
"github.com/cosmos/cosmos-sdk/x/feegrant"

ibcclient "github.com/cosmos/ibc-go/v2/modules/core/02-client"
ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client"

"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -86,15 +86,15 @@ import (
"github.com/cosmos/cosmos-sdk/x/mint"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
ibctransfer "github.com/cosmos/ibc-go/v2/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v2/modules/core"
ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper"
ibctransfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"

"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
Expand Down Expand Up @@ -436,11 +436,18 @@ func NewDesmosApp(

// Create Transfer Keepers
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName),
app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper,
app.AccountKeeper, app.BankKeeper, scopedIBCTransferKeeper,
appCodec,
keys[ibctransfertypes.StoreKey],
app.GetSubspace(ibctransfertypes.ModuleName),
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.AccountKeeper,
app.BankKeeper,
scopedIBCTransferKeeper,
)
transferModule := ibctransfer.NewAppModule(app.TransferKeeper)
transferIBCModule := ibctransfer.NewIBCModule(app.TransferKeeper)

// Create fees keeper
app.FeesKeeper = feeskeeper.NewKeeper(app.appCodec, app.GetSubspace(feestypes.ModuleName))
Expand Down Expand Up @@ -475,6 +482,7 @@ func NewDesmosApp(
app.BankKeeper,
app.FeesKeeper,
)
profilesIBCModule := profiles.NewIBCModule(app.appCodec, app.ProfileKeeper)

// Create posts keeper and module
app.PostsKeeper = postskeeper.NewKeeper(
Expand All @@ -498,8 +506,8 @@ func NewDesmosApp(

// Create static IBC router, add transfer route, then set and seal it
ibcRouter := porttypes.NewRouter()
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule)
ibcRouter.AddRoute(profilestypes.ModuleName, profilesModule)
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule)
ibcRouter.AddRoute(profilestypes.ModuleName, profilesIBCModule)

// create evidence keeper with router
evidenceKeeper := evidencekeeper.NewKeeper(
Expand Down Expand Up @@ -589,7 +597,7 @@ func NewDesmosApp(
params.NewAppModule(app.ParamsKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
transferModule,
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),

// Custom modules
fees.NewAppModule(app.appCodec, app.FeesKeeper),
Expand Down Expand Up @@ -762,7 +770,7 @@ func NewDesmosApp(
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
ibc.NewAppModule(app.IBCKeeper),
transferModule,
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),

// Custom modules
fees.NewAppModule(appCodec, app.FeesKeeper),
Expand Down Expand Up @@ -792,7 +800,7 @@ func NewDesmosApp(
FeegrantKeeper: app.FeeGrantKeeper,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
},
IBCChannelkeeper: app.IBCKeeper.ChannelKeeper,
IBCkeeper: app.IBCKeeper,
FeesKeeper: app.FeesKeeper,
TxCounterStoreKey: keys[wasm.StoreKey],
WasmConfig: wasmConfig,
Expand Down
33 changes: 25 additions & 8 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
Expand All @@ -29,18 +30,20 @@ import (

profilestypes "github.com/desmos-labs/desmos/v3/x/profiles/types"

wasmsim "github.com/CosmWasm/wasmd/x/wasm/simulation"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/simapp"
Expand Down Expand Up @@ -97,6 +100,20 @@ func SetupSimulation(dirPrefix, dbName string) (simtypes.Config, dbm.DB, string,
}
}
}
// set sim params to overwrite wasmd default reflect.wasm path
simParams := simtypes.AppParams{
wasmsim.OpReflectContractPath: json.RawMessage(`"../testutil/wasm/reflect.wasm"`),
}

bz, err := json.Marshal(simParams)
if err != nil {
return simtypes.Config{}, nil, "", nil, false, sdkerrors.Wrap(err, "marshal sim custom params")
}
config.ParamsFile = filepath.Join(dir, "sim-params.json")
err = ioutil.WriteFile(config.ParamsFile, bz, 0o600)
if err != nil {
return simtypes.Config{}, nil, "", nil, false, sdkerrors.Wrap(err, "write temp sim params")
}

return config, db, dir, logger, skip, err
}
Expand All @@ -115,7 +132,7 @@ func TestFullAppSimulation(t *testing.T) {

app := NewDesmosApp(
logger, db, nil, true, map[int64]bool{},
DefaultNodeHome, simapp.FlagPeriodValue, MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt,
t.TempDir(), simapp.FlagPeriodValue, MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt,
)
require.Equal(t, appName, app.Name())

Expand Down Expand Up @@ -155,7 +172,7 @@ func TestAppImportExport(t *testing.T) {
}()

app := NewDesmosApp(
logger, db, nil, true, map[int64]bool{}, DefaultNodeHome,
logger, db, nil, true, map[int64]bool{}, t.TempDir(),
simapp.FlagPeriodValue, MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt,
)
require.Equal(t, appName, app.Name())
Expand Down Expand Up @@ -199,7 +216,7 @@ func TestAppImportExport(t *testing.T) {

newApp := NewDesmosApp(
log.NewNopLogger(), newDB, nil, true, map[int64]bool{},
DefaultNodeHome, simapp.FlagPeriodValue, MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt,
t.TempDir(), simapp.FlagPeriodValue, MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt,
)
require.Equal(t, appName, newApp.Name())

Expand Down Expand Up @@ -265,7 +282,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
}()

app := NewDesmosApp(
logger, db, nil, true, map[int64]bool{}, DefaultNodeHome,
logger, db, nil, true, map[int64]bool{}, t.TempDir(),
simapp.FlagPeriodValue, MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt,
)
require.Equal(t, appName, app.Name())
Expand Down Expand Up @@ -313,7 +330,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
}()

newApp := NewDesmosApp(
log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, DefaultNodeHome,
log.NewNopLogger(), newDB, nil, true, map[int64]bool{}, t.TempDir(),
simapp.FlagPeriodValue, MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt,
)
require.Equal(t, appName, newApp.Name())
Expand Down Expand Up @@ -366,7 +383,7 @@ func TestAppStateDeterminism(t *testing.T) {
db := dbm.NewMemDB()

app := NewDesmosApp(
logger, db, nil, true, map[int64]bool{}, DefaultNodeHome,
logger, db, nil, true, map[int64]bool{}, t.TempDir(),
simapp.FlagPeriodValue, MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, interBlockCacheOpt(),
)

Expand Down
8 changes: 4 additions & 4 deletions contrib/images/desmos-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ WORKDIR /code
COPY . /code/

# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta10/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 5b7abfdd307568f5339e2bea1523a6aa767cf57d6a8c72bc813476d790918e44
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 7d2239e9f25e96d0d4daba982ce92367aacf0cbd95d2facb8442268f2b1cc1fc

ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta10/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 2f44efa9c6c1cda138bd1f46d8d53c5ebfe1f4a53cf3457b01db86472c4917ac
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479

# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.${arch}.a /usr/local/lib/libwasmvm_muslc.a
Expand Down
29 changes: 15 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ require (
github.com/CosmWasm/wasmd v0.23.1-0.20220303200417-f35a13fa1209
github.com/armon/go-metrics v0.4.0
github.com/btcsuite/btcd v0.22.1
github.com/cosmos/cosmos-sdk v0.45.1
github.com/cosmos/cosmos-sdk v0.45.4
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/ibc-go/v2 v2.2.0
github.com/cosmos/ibc-go/v3 v3.0.0
github.com/ethereum/go-ethereum v1.10.18
github.com/ghodss/yaml v1.0.0
github.com/gogo/protobuf v1.3.3
Expand All @@ -25,7 +25,7 @@ require (
github.com/stretchr/testify v1.7.1
github.com/tendermint/tendermint v0.34.19
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac
google.golang.org/grpc v1.45.0
google.golang.org/protobuf v1.28.0
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -35,7 +35,7 @@ require (
filippo.io/edwards25519 v1.0.0-beta.2 // indirect
github.com/99designs/keyring v1.1.6 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/CosmWasm/wasmvm v1.0.0-beta10 // indirect
github.com/CosmWasm/wasmvm v1.0.0 // indirect
github.com/DataDog/zstd v1.4.5 // indirect
github.com/Workiva/go-datastructures v1.0.53 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down Expand Up @@ -88,14 +88,15 @@ require (
github.com/klauspost/compress v1.13.6 // indirect
github.com/lib/pq v1.10.4 // indirect
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -106,32 +107,32 @@ require (
github.com/rs/cors v1.8.2 // indirect
github.com/rs/zerolog v1.26.0 // indirect
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.10.1 // indirect
github.com/spf13/viper v1.11.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tendermint/btcd v0.1.1 // indirect
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/zondax/hid v0.9.0 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
nhooyr.io/websocket v1.8.6 // indirect
)

replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76

// Our wasmd branch is: https://github.com/desmos-labs/wasmd v0.25.x-desmos
github.com/CosmWasm/wasmd => github.com/desmos-labs/wasmd v0.23.1-0.20220413083021-fa1cedbbcb54
// Our wasmd branch is: https://github.com/desmos-labs/wasmd v0.27.x-desmos
github.com/CosmWasm/wasmd => github.com/desmos-labs/wasmd v0.23.1-0.20220525160858-4494e885f34a

// Our cosmos-sdk branch is: https://github.com/desmos-labs/cosmos-sdk v0.45.x-desmos
github.com/cosmos/cosmos-sdk => github.com/desmos-labs/cosmos-sdk v0.43.0-alpha1.0.20220426103939-9153245ddee6
Expand Down
Loading