Skip to content

Commit

Permalink
Merge pull request #895 from public-awesome/spoorthi/bump-wasmd
Browse files Browse the repository at this point in the history
feat: bump wasmd to v0.43.0
  • Loading branch information
jhernandezb authored Oct 17, 2023
2 parents e0598b9 + 49b407c commit 8dad63b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 40 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ WORKDIR /code
COPY . /code/

# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a
RUN echo "8ea2e3b5fae83e671da2bb51115adc88591045953f509955ec38dc02ea5a7b94 /lib/libwasmvm_muslc.a" | sha256sum -c
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a
RUN echo "324c1073cb988478d644861783ed5a7de21cfd090976ccc6b1de0559098fbbad /lib/libwasmvm_muslc.a" | sha256sum -c

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
Expand Down
27 changes: 0 additions & 27 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net/http"
"os"
"path/filepath"
"strings"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
Expand Down Expand Up @@ -166,25 +165,6 @@ var (
EmptyWasmOpts []wasmkeeper.Option
)

// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals

// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to
// produce a list of enabled proposals to pass into wasmd app.
func GetEnabledProposals() []wasm.ProposalType { //nolint:staticcheck
if EnableSpecificProposals == "" {
if ProposalsEnabled == "true" {
return wasm.EnableAllProposals //nolint:staticcheck
}
return wasm.DisableAllProposals //nolint:staticcheck
}
chunks := strings.Split(EnableSpecificProposals, ",")
proposals, err := wasm.ConvertToProposals(chunks) //nolint:staticcheck
if err != nil {
panic(err)
}
return proposals
}

func getGovProposalHandlers() []govclient.ProposalHandler {
govProposalHandlers := make([]govclient.ProposalHandler, 0)
// this line is used by starport scaffolding # stargate/app/govProposalHandlers
Expand Down Expand Up @@ -354,7 +334,6 @@ func NewStargazeApp(
encodingConfig sgappparams.EncodingConfig,
appOpts servertypes.AppOptions,
wasmOpts []wasmkeeper.Option,
enabledProposals []wasm.ProposalType, //nolint:staticcheck
baseAppOptions ...func(*baseapp.BaseApp),
) *App {
appCodec, cdc := encodingConfig.Codec, encodingConfig.Amino
Expand Down Expand Up @@ -526,7 +505,6 @@ func NewStargazeApp(
govRouter := legacygovtypes.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, legacygovtypes.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
// AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). // COME HERE
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))

Expand Down Expand Up @@ -664,11 +642,6 @@ func NewStargazeApp(
globalfeeModule := globalfeemodule.NewAppModule(appCodec, app.GlobalFeeKeeper)
govRouter.AddRoute(globalfeemoduletypes.RouterKey, globalfeemodulekeeper.NewProposalHandler(app.GlobalFeeKeeper))

// The gov proposal types can be individually enabled
if len(enabledProposals) != 0 {
govRouter.AddRoute(wasmtypes.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, enabledProposals)) //nolint:staticcheck
}

ibcRouter.AddRoute(wasmtypes.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper))
app.IBCKeeper.SetRouter(ibcRouter)

Expand Down
2 changes: 0 additions & 2 deletions cmd/starsd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ func newApp(
encCfg,
appOpts,
wasmOpts,
app.GetEnabledProposals(),
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))),
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
Expand Down Expand Up @@ -288,7 +287,6 @@ func appExport(
encCfg,
appOpts,
emptyWasmOpts,
app.GetEnabledProposals(),
)

if height != -1 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/starsd/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"
)

var LibwasmVersion = "1.4.0"
var LibwasmVersion = "1.4.1"

func CheckLibwasmVersion(_ *cobra.Command, _ []string) error {
version, err := wasmvmapi.LibwasmvmVersion()
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/public-awesome/stargaze/v12
go 1.21

require (
github.com/CosmWasm/wasmd v0.42.0
github.com/CosmWasm/wasmvm v1.4.0
github.com/CosmWasm/wasmd v0.43.0
github.com/CosmWasm/wasmvm v1.4.1
github.com/armon/go-metrics v0.4.1
github.com/cometbft/cometbft v0.37.2
github.com/cosmos/cosmos-proto v1.0.0-beta.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg6
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/wasmd v0.42.0 h1:4xZ7GHLrJp3P8qN0wsWOpk5qYLHW9AM5fgcDFPi/p90=
github.com/CosmWasm/wasmd v0.42.0/go.mod h1:DiEyBjHxzkEENYqQhHyka+r4HfR72stSPUtGv+Yh/UU=
github.com/CosmWasm/wasmvm v1.4.0 h1:84I3MlvvzcOo2z+ed0ztPi7eeDNk6/sYuK76uyXP1nI=
github.com/CosmWasm/wasmvm v1.4.0/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc=
github.com/CosmWasm/wasmd v0.43.0 h1:4xQAiNf6Ej+TuYe4PXwrtVJ9C+xyFrbsdqHH/kU9Vxk=
github.com/CosmWasm/wasmd v0.43.0/go.mod h1:gpri8YvkRErBz+qDme5jOThGZmSlHfyN532bWibXOl4=
github.com/CosmWasm/wasmvm v1.4.1 h1:YgodVlBrXa2HJZzOXjWDH0EIRwQzK3zuA73dDPRRLS4=
github.com/CosmWasm/wasmvm v1.4.1/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc=
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/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
Expand Down
4 changes: 2 additions & 2 deletions testutil/simapp/simapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func New(t *testing.T) *stargazeapp.App {
}

app := stargazeapp.NewStargazeApp(logger, db, nil, true, map[int64]bool{}, dir, 0, encoding,
simapp.EmptyAppOptions{}, stargazeapp.EmptyWasmOpts, stargazeapp.GetEnabledProposals())
simapp.EmptyAppOptions{}, stargazeapp.EmptyWasmOpts)

genesisState := stargazeapp.NewDefaultGenesisState(app.AppCodec())
genesisState = genesisStateWithValSet(t, app, genesisState, valSet, []authtypes.GenesisAccount{acc}, balance)
Expand Down Expand Up @@ -101,7 +101,7 @@ func setup(withGenesis bool, invCheckPeriod uint, dir string) (*stargazeapp.App,
db := tmdb.NewMemDB()
encoding := stargazeapp.MakeEncodingConfig()
a := stargazeapp.NewStargazeApp(log.NewNopLogger(), db, nil, true,
map[int64]bool{}, dir, invCheckPeriod, encoding, simapp.EmptyAppOptions{}, stargazeapp.EmptyWasmOpts, stargazeapp.GetEnabledProposals())
map[int64]bool{}, dir, invCheckPeriod, encoding, simapp.EmptyAppOptions{}, stargazeapp.EmptyWasmOpts)
if withGenesis {
return a, stargazeapp.NewDefaultGenesisState(encoding.Codec)
}
Expand Down

0 comments on commit 8dad63b

Please sign in to comment.