-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Unsupported Wasm Opcode after updating nightly toolchain #13636
Comments
Maybe related to this rust-lang/rust#109326? Please test with the nightly from the 20.03 when it is available and report back! Ty. |
Yesterday compiling https://github.com/gear-dapps/app also failed with Today I updated the nightly toolchain to |
fine, when I have updated my toolchain to:
Anything is ok for now. Although I am still curious whether those Wasm Opcodes are necessary for the substrate runtime @bkchr , I doubt this revert rust-lang/rust#109326 is just a temp fix, it will add it back in future? If rust toolchain still use those changes, maybe substrate need to update the check for wasm code. Anyway, I close this issue for now. |
LLVM was reverted because it broke a lot of things. As long as the new LLVM isn't back and doesn't bring back these op codes I assume that it was some kind of bug. If we see that the LLVM upgrade brings this back, we will need to investigate it! Ty for the report @atenjin! |
binaryen v111 enables |
Okay thank you! I also just checked and every major browser has enabled it, maybe time to also enable it in our executor? But for Parachains we will need to be able to support this at runtime, to be able to let the relay chain runtime decide on when to enable this feature. |
Hmm... we could enable it, but AFAIK we'd need to add some mechanism for versioning the PVFs' execution environment so that we can enable this in a controlled fashion. (paritytech/polkadot-sdk#917) cc @s0me0ne-unkn0wn We could also just pass |
Yeah, this is what I meant with my complicated sentence :P |
Enabling it for Wasmtime through parametrization would be great, but I'm afraid it would require some time... First, we must add a new execution environment parameter that controls WASM features (we do not have one yet) and wait for the supermajority to upgrade. Then, I have to push with paritytech/polkadot#6805. Otherwise, we'll have to do a runtime upgrade to enable it. Sounds doable, though, the only question is how urgent it is. |
No real point in enabling it if it's not going to be supported by the executor though; it'll still fail, just a little later.
Since AFAIK we can still force rustc to emit code without this feature it's not super urgent, but time's slowly running out. I wouldn't be surprised if the |
Yes. For now we should pass |
I'm still getting this on latest Rust Nightly with latest Substrate |
I've just started working on this, and it seems that with this very proposal, the only problem is its support in |
Fixes #495. Since the `wasmtime` dependency has been bumped from 1.x to 6.x, the old nightly was not good anymore since some inline stuff the new crate is using was still not stable back then. Hence, I bumped the nightly to a more recent version. Nevertheless, it cannot be TOO recent because of [this issue](paritytech/substrate#13636) (which maybe has been fixed in 0.9.40 @weichweich?). Anyway, updating to the new toolchain version added a whole bunch of Clippy warnings which I also addressed in this PR, among which there was one about the wrong declaration of the `parity-scale-codec` package, which I have now used with its original name everywhere, instead of aliasing it to `codec`. --------- Co-authored-by: Adel Golghalyani <48685760+Ad96el@users.noreply.github.com>
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
After I update the nightly toolchain for the newest version:
After I compile the substrate or any substrate based blockchain, the check for the runtime will appear the following error:
I'm familiar with substrate very well, so I know this error is caused by the crate
parity-wasm
that developed by parity to check and decode and etc to handle wasm file.This error comes from
So the unknown Opcode is 0xc0 (192), while the function
deserialize_buffer
comes from crateparity-wasm
.And for current substrate (at least for the branch
polkadot-0.9.39
), theparity-wasm
is using the version0.45.0
In this version, the Opcode 0xc0 is under the control of feature
sign_ext
I know that substrate runtime wasm should be limited in the most concise Wasm specification.
So I'm not sure whether the Opcode group
sign_ext
is under the required Wasm specification for the Substrate runtime.If it's needed, fix this issue is very simple.
However if it's not needed, it's strange why rust toolchain need to add those group Opcode in normal Wasm file.
At least I can ensure that, for the toolchain
nightly-1.70.0(2023-03-18)
is will appear this problem, whilenight-1.68.0
not. Not sure fornightly-1.69.0
Steps to reproduce
rust toolchain version:
stable:
1.68.0 (2c8cc3432 2023-03-06)
nightly:
1.70.0-nightly (4a04d086c 2023-03-18)
substrate version: branch:
polkadot-0.9.39
how to reproduce:
build any substrate project, and run the node directly. It will meet the error and exit for the error
The text was updated successfully, but these errors were encountered: