From cf0e6b6d579aefee73a28a39db63313bf30a22ba Mon Sep 17 00:00:00 2001 From: Tommy Verrall <60836166+tommyv1987@users.noreply.github.com> Date: Tue, 4 Jul 2023 12:28:11 +0200 Subject: [PATCH] Update app.go override wasm limits --- app/app.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index a0c2741b..41e220fe 100644 --- a/app/app.go +++ b/app/app.go @@ -290,6 +290,14 @@ type WasmApp struct { configurator module.Configurator } +// overrideWasmVariables overrides the wasm variables to: +// - allow for larger wasm files +func overrideWasmVariables() { + // Override Wasm size limitation from WASMD. + wasmtypes.MaxWasmSize = 3 * 1024 * 1024 + wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize +} + // NewWasmApp returns a reference to an initialized WasmApp. func NewWasmApp( logger log.Logger, @@ -305,7 +313,7 @@ func NewWasmApp( wasmOpts []wasm.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *WasmApp { - wasmtypes.MaxWasmSize = 1200 * 1024 // set this to 1.2MB + overrideWasmVariables() appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry