Skip to content

Configurable max memory pages#1128

Merged
ascjones merged 1 commit intouse-ink:masterfrom
kvinwang:max-memory-pages
May 25, 2023
Merged

Configurable max memory pages#1128
ascjones merged 1 commit intouse-ink:masterfrom
kvinwang:max-memory-pages

Conversation

@kvinwang
Copy link
Contributor

This PR adds and command line argument --max-memory-pages to cargo contract build.

Background

Contracts on Phala Networks are allowed to use up to 4MB of memory. cargo-contract did enforce the wasm to set max pages to 16. That would cause a build error when our contracts use larger memory:

 [3/5] Optimizing wasm file
[wasm-validator error in module] unexpected true: memory max >= initial, on 
memory
ERROR: Failed to validate wasm: error validating input

@kvinwang kvinwang force-pushed the max-memory-pages branch from ff72a5a to 3df6e5f Compare May 25, 2023 09:28
@ascjones ascjones merged commit 096e440 into use-ink:master May 25, 2023
This was referenced Jul 26, 2023
@smiasojed smiasojed mentioned this pull request Mar 4, 2024
kvinwang added a commit to kvinwang/cargo-contract that referenced this pull request Mar 12, 2024
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

Successfully merging this pull request may close these issues.

2 participants