ink
ink copied to clipboard
CodeRejected error when deploying ink! 5 contract compiled with Rust 1.87
Problem
When compiling an ink! 5 smart contract using Rust 1.87, the resulting .contract file fails to deploy via https://ui.use.ink/instantiate.
The error shown is:
CodeRejected
The contract's code was found to be invalid during validation.The most likely cause of this is that an API was used which is not supported by thenode. This happens if an older node is used with a new version of ink!. Try updatingyour node to the newest available version.A more detailed error can be found on the node console if debug messages are enabledby supplying `-lruntime::contracts=debug`.
Can't load the module into wasmi!
The logs of the node:
DEBUG tokio-runtime-worker runtime::contracts: Module creation failed: Error { kind: Wasm(BinaryReaderError { inner: BinaryReaderErrorInner { message: "bulk memory support is not enabled", offset: 496, needed_hint: None } }) }
DEBUG tokio-runtime-worker runtime::contracts: New code rejected on validation: Can't load the module into wasmi!
Using the same contract, compiling with Rust 1.86 works correctly! And is only for inkv5
Steps to Reproduce
- Set Rust version to 1.87:
rustup update - Build in debug mode
cargo contract build - Upload the resulting
.contractfile to https://ui.use.ink/instantiate
Additional precision: the deployment fails when the contract is built on debug mode. It works fine when it is built on release mode.