-
Notifications
You must be signed in to change notification settings - Fork 251
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
Deserialization error on contract call after rust update #1035
Comments
Hi @alexvelicu, thanks for reporting this! The error is an unfortunate consequence of [toolchain]
channel = "1.69" I'll submit a PR in |
The latest release `nearcore` currently doesn't support Rust 1.70. This commit fixes that for users who use `rustup` by pinning the Rust version to 1.69. Motivated by near/near-sdk-rs#1035
Closing this as fixed as PR was merged to |
Hi, This PR adds an option to the `set` method to refund part of the deposit that covers unused storage to the caller (fixes #6). ### Invariants I think there are three invariants to maintain with this feature: 1. No refunds for storage that is in use. 1. No double spending: same deposit cannot be withdrawn multiple times. 1. A caller cannot withdraw more than they deposited in the call. I ensured the first two invariants by reusing the existing `storage_withdraw` implementation. I ensured the third invariant by checking that we don't refund more than what was in the attached balance: 4e0581d#diff-bc8da1acc242fddbedebb84935fc8bb893ed6bb4044090dbed4b2e53fc817b02R153 ### Integration tests I added an integration test suite to convince myself that the implementation is correct. If you want to keep the integration tests, I'm happy to add CI for them in a follow up PR. ### Rust 1.69 I added a `rust-toolchain.toml` file to pin Rust 1.69 as `nearcore` doesn't support Rust 1.70 yet (more info: near/near-sdk-rs#1035) ### Reviewing I implemented this feature to gain more experience with NEAR smart contract development. As a result, in spite of my best efforts, it's possible that I overlooked something important, so please review carefully.
We have integrated a near contract in our development.
When we compile / build / test / deploy the contract with
cargo 1.66.1 (ad779e08b 2023-01-10)
rustup 1.25.1 (bb60b1e89 2022-07-12)
We can call the contract, execute view, no errors.
After updating to rustup 1.26.0 (5af9b9484 2023-04-05)
Contract call returns Querying [object Object] failed: wasm execution failed with error: CompilationError(PrepareError(Deserialization))
Also on call to set values we get a receipt with
This can be reproduced on
https://github.com/near-examples/hello-near-rust/tree/main/contract
Any suggestions?
The text was updated successfully, but these errors were encountered: