You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The heap data of a smart contract execution is stored in a Wasm linear memory. Only zero or one linear memories can exist in the current Wasm standard. The maximum size of a linear memory is 4GB because it is addressed by uint32 offsets in 1 byte steps.
Right now, we ensure the upper memory limit is unset by the contract:
fncheck_wasm_memories(module:&Module) -> VmResult<()>{// ...if limits.maximum() != None{returnErr(VmError::static_validation_err("Wasm contract memory's maximum must be unset. The host will set it for you.",));}Ok(())}
If we wanted we could implement the limit the following way at any time: take a Wasm blob, deserialize, set the maximum of the first linear memory, re-serialize, compile. This is not very elegant and has the disadvantage that the memory limit is stored as part of the compiled modules. So it cannot be adjusted without invalidating cached modules.
A proper solution is discussed here, which is what we wait for right now: wasmerio/wasmer#1360
The text was updated successfully, but these errors were encountered:
The heap data of a smart contract execution is stored in a Wasm linear memory. Only zero or one linear memories can exist in the current Wasm standard. The maximum size of a linear memory is 4GB because it is addressed by uint32 offsets in 1 byte steps.
Right now, we ensure the upper memory limit is unset by the contract:
If we wanted we could implement the limit the following way at any time: take a Wasm blob, deserialize, set the maximum of the first linear memory, re-serialize, compile. This is not very elegant and has the disadvantage that the memory limit is stored as part of the compiled modules. So it cannot be adjusted without invalidating cached modules.
A proper solution is discussed here, which is what we wait for right now: wasmerio/wasmer#1360
The text was updated successfully, but these errors were encountered: