Skip to content

Commit

Permalink
feat: upgrade wasm/libwasmvm/bls-eth to 0.41.0/1.3.0/1.32.0 (#587)
Browse files Browse the repository at this point in the history
fixes #586
  • Loading branch information
hussein-aitlahcen authored Aug 31, 2023
2 parents ffa1341 + 4ccaaab commit 1910288
Show file tree
Hide file tree
Showing 199 changed files with 16,241 additions and 4,703 deletions.
12 changes: 6 additions & 6 deletions tools/libwasmvm/libwasmvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@
wasmvm = pkgs.fetchFromGitHub {
owner = "CosmWasm";
repo = "wasmvm";
rev = "v1.2.3"; # wasmd 0.40
hash = "sha256-GscUMJ0Tkg77S9IYA9komyKKoa1AyVXSSaU8hw3ZNwk=";
rev = "v1.3.0"; # wasmd 0.41.0
hash = "sha256-rsTYvbkYpDkUE4IvILdSL3hXMgAWxz5ltGotJB2t1e4=";
};
in
{
packages.libwasmvm =
craneLib.buildPackage (
{
name = "libwasmvm";
version = "1.2.3";
version = wasmvm.rev;
src = "${wasmvm}/libwasmvm";
doCheck = false;
inherit CARGO_BUILD_TARGET;
} // (if pkgs.stdenv.isLinux then {
cargoBuildCommand = "cargo build --release --example=muslc";
cargoBuildCommand = "cargo build --release --example=wasmvmstatic";
installPhase = ''
mkdir -p $out/lib
mv target/${CARGO_BUILD_TARGET}/release/examples/libmuslc.a $out/lib/libwasmvm.${builtins.head (pkgs.lib.strings.splitString "-" system)}.a
mv target/${CARGO_BUILD_TARGET}/release/examples/libwasmvmstatic.a $out/lib/libwasmvm.${builtins.head (pkgs.lib.strings.splitString "-" system)}.a
'';
} else if pkgs.stdenv.isDarwin then {
# non-static dylib build on macOS
cargoBuildCommand = "cargo build --release";
installPhase = ''
mkdir -p $out/lib
mv target/${CARGO_BUILD_TARGET}/release/deps/libwasmvm.dylib $out/lib/libwasmvm.dylib
mv target/${CARGO_BUILD_TARGET}/release/deps/libwasmvm.dylib $out/lib/libwasmvm.dylib
'';
} else throwBadSystem)
);
Expand Down
40 changes: 18 additions & 22 deletions uniond/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ var (
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ibcfeetypes.ModuleName: nil,
wasm.ModuleName: {authtypes.Burner}, // TODO(aeryz): is this necessary?
wasmtypes.ModuleName: {authtypes.Burner}, // TODO(aeryz): is this necessary?
// this line is used by starport scaffolding # stargate/app/maccPerms
}
)
Expand All @@ -236,15 +236,15 @@ func init() {

// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to
// produce a list of enabled proposals to pass into wasmd app.
func GetEnabledProposals() []wasm.ProposalType {
func GetEnabledProposals() []wasmtypes.ProposalType {
if EnableSpecificProposals == "" {
if ProposalsEnabled == "true" {
return wasm.EnableAllProposals
return wasmtypes.EnableAllProposals
}
return wasm.DisableAllProposals
return wasmtypes.DisableAllProposals
}
chunks := strings.Split(EnableSpecificProposals, ",")
proposals, err := wasm.ConvertToProposals(chunks)
proposals, err := wasmtypes.ConvertToProposals(chunks)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -291,7 +291,7 @@ type UnionApp struct {
FeeGrantKeeper feegrantkeeper.Keeper
GroupKeeper groupkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
WasmKeeper wasm.Keeper
WasmKeeper wasmkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -322,8 +322,8 @@ func New(
invCheckPeriod uint,
encodingConfig appparams.EncodingConfig,
appOpts servertypes.AppOptions,
enabledProposals []wasm.ProposalType,
wasmOpts []wasm.Option,
enabledProposals []wasmtypes.ProposalType,
wasmOpts []wasmkeeper.Option,
baseAppOptions ...func(*baseapp.BaseApp),
) *UnionApp {
appCodec := encodingConfig.Marshaler
Expand All @@ -349,7 +349,7 @@ func New(
govtypes.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey,
feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, ibcwasmtypes.StoreKey, icahosttypes.StoreKey,
capabilitytypes.StoreKey, group.StoreKey, icacontrollertypes.StoreKey, consensusparamtypes.StoreKey,
unionmoduletypes.StoreKey, ibcfeetypes.StoreKey, wasm.StoreKey,
unionmoduletypes.StoreKey, ibcfeetypes.StoreKey, wasmtypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down Expand Up @@ -390,7 +390,7 @@ func New(
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasm.ModuleName)
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName)
// this line is used by starport scaffolding # stargate/app/scopedKeeper

// add keepers
Expand Down Expand Up @@ -594,9 +594,9 @@ func New(

availableCapabilities := strings.Join(AllCapabilities(), ",")

app.WasmKeeper = wasm.NewKeeper(
app.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
keys[wasm.StoreKey],
keys[wasmtypes.StoreKey],
app.AccountKeeper,
app.BankKeeper,
app.StakingKeeper,
Expand All @@ -615,10 +615,6 @@ func New(
wasmOpts...,
)

if len(enabledProposals) != 0 {
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, enabledProposals))
}

govConfig := govtypes.DefaultConfig()
govKeeper := govkeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -661,7 +657,7 @@ func New(

ibcRouter := ibcporttypes.NewRouter()
ibcRouter.AddRoute(icahosttypes.SubModuleName, icaHostIBCModule).
AddRoute(wasm.ModuleName, wasmStack).
AddRoute(wasmtypes.ModuleName, wasmStack).
AddRoute(ibctransfertypes.ModuleName, transferIBCModule)
// this line is used by starport scaffolding # ibc/app/router
app.IBCKeeper.SetRouter(ibcRouter)
Expand Down Expand Up @@ -751,7 +747,7 @@ func New(
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
unionmoduletypes.ModuleName,
wasm.ModuleName,
wasmtypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
)

Expand Down Expand Up @@ -779,7 +775,7 @@ func New(
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
unionmoduletypes.ModuleName,
wasm.ModuleName,
wasmtypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/endBlockers
)

Expand Down Expand Up @@ -812,7 +808,7 @@ func New(
vestingtypes.ModuleName,
consensusparamtypes.ModuleName,
unionmoduletypes.ModuleName,
wasm.ModuleName,
wasmtypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
}
app.mm.SetOrderInitGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -861,7 +857,7 @@ func New(
},
IBCKeeper: app.IBCKeeper,
WasmConfig: &wasmConfig,
TXCounterStoreKey: keys[wasm.StoreKey],
TXCounterStoreKey: keys[wasmtypes.StoreKey],
},
)
if err != nil {
Expand Down Expand Up @@ -1067,7 +1063,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(unionmoduletypes.ModuleName)
paramsKeeper.Subspace(wasm.ModuleName)
paramsKeeper.Subspace(wasmtypes.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace

return paramsKeeper
Expand Down
6 changes: 3 additions & 3 deletions uniond/cmd/uniond/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"strings"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
dbm "github.com/cometbft/cometbft-db"
tmcfg "github.com/cometbft/cometbft/config"
tmcli "github.com/cometbft/cometbft/libs/cli"
Expand Down Expand Up @@ -286,7 +286,7 @@ func (a appCreator) newApp(
a.encodingConfig,
appOpts,
app.GetEnabledProposals(),
[]wasm.Option{},
[]wasmkeeper.Option{},
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))),
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
Expand Down Expand Up @@ -329,7 +329,7 @@ func (a appCreator) appExport(
a.encodingConfig,
appOpts,
app.GetEnabledProposals(),
[]wasm.Option{},
[]wasmkeeper.Option{},
)

if height != -1 {
Expand Down
22 changes: 11 additions & 11 deletions uniond/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ go 1.20
require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.0
github.com/CosmWasm/wasmd v0.40.0
github.com/CosmWasm/wasmvm v1.2.3
github.com/CosmWasm/wasmd v0.41.0
github.com/CosmWasm/wasmvm v1.3.0
github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db v0.7.0
github.com/cosmos/cosmos-sdk v0.47.2
github.com/cometbft/cometbft-db v0.8.0
github.com/cosmos/cosmos-sdk v0.47.4
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v7 v7.0.1
github.com/cosmos/ibc-go/v7 v7.2.0
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
Expand Down Expand Up @@ -126,6 +126,7 @@ require (
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.7.16 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand All @@ -141,14 +142,14 @@ require (
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.15.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/prysmaticlabs/fastssz v0.0.0-20220628121656-93dfe28febab // indirect
github.com/prysmaticlabs/gohashtree v0.0.3-alpha // indirect
github.com/rakyll/statik v0.1.7 // indirect
Expand All @@ -157,13 +158,12 @@ require (
github.com/rs/zerolog v1.29.1 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/spf13/viper v1.16.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e // indirect
github.com/tidwall/btree v1.6.0 // indirect
Expand Down
Loading

0 comments on commit 1910288

Please sign in to comment.