-
Notifications
You must be signed in to change notification settings - Fork 632
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
WebAssembly contracts built with the Rust toolchain 1.70 or later cannot be deployed #9143
Comments
NB: when the network deploys 1.35 and votes on the new protocol version the deploys should start working again. |
With 1.70 toolchain, the contracts are by default compiled in a way which requires updates to wasmer 2.4.1 as well. I looked also into replacing usage of once_cell crate but sadly std::sync::OnceLock doesn’t implement wait method. Co-authored-by: Jakob Meier <mail@jakobmeier.ch> Co-authored-by: Simonas Kazlauskas <git@kazlauskas.me> Issue: near/create-near-app#2009 Issue: #9143
Integration tests fail as well with |
How can i know more about it? as far as i can see the 1.35 rc1 build has been released and the voting was expected to start on 27th. How can i know the outcome of the voting? |
The protocol upgrade has happened, so this should be resolved now. Your contracts built with newer versions of the Rust toolchain should work just fine. |
…ging toolchain (#832) # Description Currently impossible to update toolchain, it's related to [NEAR issue](near/nearcore#9143). And it is impossible to do `cargo update`, because [issue](rust-cli/anstyle#118 (comment)). - Updated clippy requirements to `nightly-2023-08-24`, without updating `rust-toolchain`. - Fixed clippy issues, related to clippy requirements for `nightly-2023-08-24` version.
…ging toolchain (#832) # Description Currently impossible to update toolchain, it's related to [NEAR issue](near/nearcore#9143). And it is impossible to do `cargo update`, because [issue](rust-cli/anstyle#118 (comment)). - Updated clippy requirements to `nightly-2023-08-24`, without updating `rust-toolchain`. - Fixed clippy issues, related to clippy requirements for `nightly-2023-08-24` version.
If you attempt to deploy a contract built with the Rust toolchain version 1.70 or later the deployment of the contract will likely fail with an error message along the lines of "deserialize".
This is because in Rust 1.70 the version of LLVM was upgraded to 16.0 series, and in this version of LLVM a WebAssembly proposal – sign extensions – was enabled by default. This proposal has introduced new instructions that aren't supported by the NEAR protocol contract runtime at this point in time. Whenever these instructions occur in the deployed WebAssembly module, the deployment will immediately fail.
There are a couple of approaches you can take in order to maintain the contract in a deployable state:
RUSTFLAGS
environment variable and the-Zbuild-std
cargo flag):env RUSTFLAGS='-Ctarget-cpu=mvp' cargo build -Zbuild-std=panic_abort,std ...
; orenv RUSTFLAGS='-Ctarget-feature=-sign-ext' cargo build -Zbuild-std=panic_abort,std ...
.The text was updated successfully, but these errors were encountered: