NEAR-DevHub / neardevhub-contract

DevHub Portal Product Contract (Hosted on NEAR Blockchain) – Includes other instances (e.g. Infrastructure, Events)
https://neardevhub.org
19 stars 15 forks source link

Code fails to generate correct devgovgigs.wasm with Rust 1.70.0 version #30

Closed Tguntenaar closed 1 year ago

Tguntenaar commented 1 year ago

Description:

The current version of the code is unable to generate the correct devgovgigs.wasm file when using the latest version of Rust (1.70). As a workaround, it was necessary to install Rust 1.67.1, set it as the default toolchain, and add the wasm32-unknown-unknown target.

Steps to Reproduce

Install the latest version of Rust (1.70.0)

$ rustup update
$ rustup update stable
$ ./build.sh

In my case I used rustup default stable-aarch64-apple-darwin

Then deploy using the near-cli and call the new func.

$ near contract deploy etc
near contract call-function as-transaction id new json-args {} prepaid-gas '100.000 TeraGas' attached-deposit '0 NEAR' sign-as [id] network-config testnet sign-with-seed-phrase '[seedphrase]' --seed-phrase-hd-path '[hdpath]' send

Actual Behavior

The contract is able to deploy but calling new gives:

Error: An error occurred during a `FunctionCall` Action, parameter is debug message.
CompilationError(PrepareError(Deserialization))

Additional Information

Operating System: macOS Monetery 12.5

Possible Work around

Set Rust 1.67.1 as the default toolchain using

$ rustup toolchain install 1.67.1

$ rustup default 1.67.1

$ rustup target add wasm32-unknown-unknown

$ ./build.sh

$ near contract deploy etc..

$ near contract call-function etc..

Expected Behavior

The code should generate the correct devgovgigs.wasm file using the latest version of Rust (1.70) without the need to install an older version and perform additional steps.

Tguntenaar commented 1 year ago

I found this issue while setting up my environment with @ailisp

frol commented 1 year ago

It is a known issue: https://github.com/near/nearcore/issues/9143.

We are waiting for resolution from nearcore team. Keep using Rust 1.69 until there is a solution.

robert-zaremba commented 1 year ago

workspace-rs will have to be updated as well.