From 1b109f0a868c9401000695c4d80fb122925f3c6a Mon Sep 17 00:00:00 2001 From: Kevin Yang <5478483+k-yang@users.noreply.github.com> Date: Mon, 3 Jun 2024 21:37:09 -0500 Subject: [PATCH] feat(wasm)!: increase contract size limit to 3MB (#1906) * feat(wasm): increase contract size limit to 3MB * chore: update changelog --- app/app.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/app.go b/app/app.go index 10f9d6480..e10e1ca3d 100644 --- a/app/app.go +++ b/app/app.go @@ -125,6 +125,14 @@ func GetWasmOpts(nibiru NibiruApp, appOpts servertypes.AppOptions) []wasmkeeper. return wasmOpts } +// overrideWasmVariables overrides the wasm variables to: +// - allow for larger wasm files +func overrideWasmVariables() { + // Override Wasm size limitation from WASMD. + wasmtypes.MaxWasmSize = 3 * 1024 * 1024 // 3MB + wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize +} + // NewNibiruApp returns a reference to an initialized NibiruApp. func NewNibiruApp( logger log.Logger, @@ -135,6 +143,7 @@ func NewNibiruApp( appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *NibiruApp { + overrideWasmVariables() appCodec := encodingConfig.Marshaler legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry