paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Limit heap pages in state machine #14364

Closed fgamundi closed 1 year ago

fgamundi commented 1 year ago

Description

If the on-chain heap pages value is set to a really high value, the client will fail with an error similar to:

Error: Service(Application(Application(VersionInvalid("cannot create module: failed to parse WebAssembly module: Invalid input WebAssembly code at offset 9784: memory size must be at most 65536 pages (4GiB)"))))

This PR limits the heap pages requested by the state machine to a known good value, to avoid stalling the chain in case it's incorrectly set.

cla-bot-2021[bot] commented 1 year ago

User @fgamundi, please sign the CLA here.

paritytech-cicd-pr commented 1 year ago

The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable-int Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2977072

bkchr commented 1 year ago

The pr is not correct. We can not just introduce some random upper limit as done here.

These things should be discussed in the associated issue: https://github.com/paritytech/polkadot-sdk/issues/71