Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM exceed issue: Insufficient resources: memory minimum size of 2092 pages exceeds memory limits #27

Open
hbulgarini opened this issue May 10, 2023 · 5 comments

Comments

@hbulgarini
Copy link
Contributor

When the pallet is added in Trappist, the chain gets stalled and it stops producing blocks. Apparently, the error starts when the validators wants to run PoV function for the parachain:

2023-05-04 17:25:58 Failed to validate candidate para_id=Id(1836) error=InvalidCandidate(WorkerReportedError("execute: execute error: RuntimeConstruction(Other(\"failed to instantiate a new WASM module instance: Insufficient resources: memory minimum size of 2092 pages exceeds memory limits\"))"))

Tests were done running release 0.9.37 during the preparations for Trappist deployment on Rococo.

CC: @kalaninja

@bernardoaraujor
Copy link
Contributor

bernardoaraujor commented May 10, 2023

it seems a runtime wasm including pallet-chess is a few Mb, which is indeed a lot.

this is likely cozy-chess bloating the size.

we are only using a fraction of the crate's functionality, so I wonder if there's a way to strip down all the unused code from the runtime wasm?

There's a few interesting resources here: https://rustwasm.github.io/docs/book/reference/code-size.html

Also dropping this on SE: https://substrate.stackexchange.com/questions/8443/prevent-unused-imports-from-bloating-up-runtime-wasm

@Moliholy
Copy link
Collaborator

Moliholy commented Jun 1, 2023

As discussed with @hbulgarini, he is able to reproduce the problem, but I am not. Instead, everything works fine and all parachains produce blocks without any issue. These are the wasm sizes I get when compiling trappist:

$ ls -liash target/release/wbuild/trappist-runtime/trappist_runtime.*
1787634  2704 -rw-r--r--@ 1 molina  staff   1.3M May 30 17:08 target/release/wbuild/trappist-runtime/trappist_runtime.compact.compressed.wasm
1787600 16232 -rw-r--r--@ 1 molina  staff   7.9M May 30 17:09 target/release/wbuild/trappist-runtime/trappist_runtime.compact.wasm
1787635 15944 -rwxr-xr-x@ 1 molina  staff   7.8M May 30 18:06 target/release/wbuild/trappist-runtime/trappist_runtime.wasm

I don't really know which of the three is causing the issue, to be honest. Do you guys have any clue?

@bernardoaraujor
Copy link
Contributor

what's the size of the trappist runtime without the chess pallet?

@AlexD10S
Copy link
Contributor

Any updates with this issue? I want to help with it.
I have been building a front end app to interact with the Chess pallet, and it would be great to deploy it if we have the chess pallet live.

@hbulgarini
Copy link
Contributor Author

Any updates with this issue? I want to help with it. I have been building a front end app to interact with the Chess pallet, and it would be great to deploy it if we have the chess pallet live.

Not really, since it was removed from trappist runtime we are not much diving into this project anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants