Skip to content

Commit

Permalink
update wasm simapp image with higher max gas
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba committed Jan 8, 2025
1 parent 6bc666c commit 3b0a74e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
6 changes: 3 additions & 3 deletions modules/light-clients/08-wasm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ RUN go mod download

# Since it is not easy to fully cache a RUN script download of libwasmvm, we use two different stages
# and copy the correct file in the final stage. The multistage setup also helps speed up the build process
FROM alpine:3.18 AS amd64-stage
FROM alpine:3.21 AS amd64-stage
ARG LIBWASM_VERSION
ADD https://github.com/CosmWasm/wasmvm/releases/download/${LIBWASM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a


FROM alpine:3.18 AS arm64-stage
FROM alpine:3.21 AS arm64-stage
ARG LIBWASM_VERSION
ADD https://github.com/CosmWasm/wasmvm/releases/download/${LIBWASM_VERSION}/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a

Expand All @@ -44,6 +44,6 @@ COPY --from=libwasm-stage /lib/libwasmvm_muslc.* /lib/
RUN go build -mod=readonly -tags "netgo ledger muslc" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger muslc," -w -s -linkmode=external -extldflags "-Wl,-z,muldefs -static"' -trimpath -o /go/build/ ./...


FROM alpine:3.18
FROM alpine:3.21
COPY --from=builder /go/build/simd /bin/simd
ENTRYPOINT ["simd"]
12 changes: 12 additions & 0 deletions modules/light-clients/08-wasm/testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ import (
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
cmtcrypto "github.com/cometbft/cometbft/crypto"
cmted25519 "github.com/cometbft/cometbft/crypto/ed25519"
cmttypes "github.com/cometbft/cometbft/types"

wasm "github.com/cosmos/ibc-go/modules/light-clients/08-wasm"
wasmkeeper "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper"
Expand Down Expand Up @@ -977,6 +978,17 @@ func (app *SimApp) InitChainer(ctx sdk.Context, req *abci.InitChainRequest) (*ab
if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()); err != nil {
panic(err)
}

paramsProto, err := app.ConsensusParamsKeeper.ParamsStore.Get(ctx)
if err != nil {
return nil, err
}
params := cmttypes.ConsensusParamsFromProto(paramsProto)

Check failure on line 986 in modules/light-clients/08-wasm/testing/simapp/app.go

View workflow job for this annotation

GitHub Actions / lint

import-shadowing: The name 'params' shadows an import name (revive)
params.Block.MaxGas = 100_000_000
if err := app.ConsensusParamsKeeper.ParamsStore.Set(ctx, params.ToProto()); err != nil {
return nil, err
}

return app.ModuleManager.InitGenesis(ctx, genesisState)
}

Expand Down
14 changes: 13 additions & 1 deletion modules/light-clients/08-wasm/testing/simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
corestore "cosmossdk.io/core/store"
"cosmossdk.io/log"
confixcmd "cosmossdk.io/tools/confix/cmd"
txsigning "cosmossdk.io/x/tx/signing"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
Expand All @@ -27,6 +28,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/client/snapshot"
"github.com/cosmos/cosmos-sdk/codec"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/server"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
Expand Down Expand Up @@ -64,11 +66,17 @@ func NewRootCmd() *cobra.Command {
initClientCtx := client.Context{}.
WithCodec(encodingConfig.Codec).
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
WithTxConfig(encodingConfig.TxConfig).
WithLegacyAmino(encodingConfig.Amino).
WithInput(os.Stdin).
WithAccountRetriever(types.AccountRetriever{}).
WithAddressCodec(addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())).
WithValidatorAddressCodec(addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix())).
WithConsensusAddressCodec(addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix())).
WithHomeDir(simapp.DefaultNodeHome).
WithViper("") // In simapp, we don't use any prefix for env variables.
WithViper(""). // uses by default the binary name as prefix
WithAddressPrefix(sdk.GetConfig().GetBech32AccountAddrPrefix()).
WithValidatorPrefix(sdk.GetConfig().GetBech32ValidatorAddrPrefix())

rootCmd := &cobra.Command{
Use: "simd",
Expand Down Expand Up @@ -96,6 +104,10 @@ func NewRootCmd() *cobra.Command {
txConfigOpts := tx.ConfigOptions{
EnabledSignModes: enabledSignModes,
TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx),
SigningOptions: &txsigning.Options{
AddressCodec: initClientCtx.InterfaceRegistry.SigningContext().AddressCodec(),
ValidatorAddressCodec: initClientCtx.InterfaceRegistry.SigningContext().ValidatorAddressCodec(),
},
}
txConfigWithTextual, err := tx.NewTxConfigWithOptions(
codec.NewProtoCodec(encodingConfig.InterfaceRegistry),
Expand Down

0 comments on commit 3b0a74e

Please sign in to comment.