-
Notifications
You must be signed in to change notification settings - Fork 638
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
Error happened while deserializing the module (stop using parity_wasm) #8358
Comments
Currently we only support the wasm-core-1 specification and nothing more. This is true across the runtime stack and isn’t a limitation imposed by just pwasm_utils/parity_wasm alone. I would expect the compilers to provide the options on which extensions are usable by the target. Rust/LLVM, for example, allow toggling many of them pretty much arbitrarily (exceptions are things like the The finite-wasm work that we’re looking to land this upcoming quarter (so~on) will replace pwasm-utils code and does have the code to support many more webassembly extensions, but we'll still need to implement the proposals throughout the rest of the pipeline. Doing so may require NEPs for each extension and thus the process may end up taking a significant amount of time while those processes conclude. |
thanks! I noticed that both wasmparser and parity_wasm is used for deserializing the contract and without checking further thought that parity_wasm (which seems to be archived) was something left from earlier days. But if it is as you say that the wasm runtime used does not support these instructions then I understand it's a bit more work involved. For the sign-ext opcodes, it seems quite easy to mitigate using |
NFT webapp: show nft owner thumbnail from near.social smaller quickjs libraries for smaller contract signext lowering for targeting wasm 1.0 spec ( near/nearcore#8358 )
I searched for ways to disable the Thus, I will likely pursue the |
Describe the bug
When calling any contract deployed with emscripten or optimized by binaryen after the WebAssembly sign-ext features where introduced you'll get the error "Error happened while deserializing the module"
This is because nearvm use of parity_wasm parser which does not recognize the sign-ext WebAssembly opcodes.
To Reproduce
Deploy a contract with wasm opcode 192 (0xC0)
i32.extend8_s
Expected behavior
nearvm should not fail to deserialize the module
Screenshots
Version (please complete the following information):
Additional context
To mitigate the problem for now it's possible to use
wasm-opt
(from binaryen) on the WebAssembly binary file with the--signext-lowering
option.See how it was mitigated in my use case here:
petersalomonsen/quickjs-rust-near@8168133
The text was updated successfully, but these errors were encountered: