-
Notifications
You must be signed in to change notification settings - Fork 8
Rust: Borsh and near_bindgen no-std version & no-std smart contract compiled wasm | Bounty: TBD #18
Comments
do you have an estimated for the bounty value? |
Not at this time apologies. We will update this issue when we do. Priorities are ETH bridge at the moment so perhaps check for bounties related to that in the coming weeks. |
@mattlockyer @nearmax I propose we split the bounty into smaller chunks:
Note, every step should have a measurable impact on the produced Wasm size (the size should go down 😄). |
Closing because of this reference implementation of token with no-std: |
@mattlockyer I think this bounty is still relevant. We need no-std support of both borsh and near-sdk-rs for various reasons. |
Adding the plan on how to implement it: For both crates would like to add support of no-std similarly to how serde did it:
Specifically for borsh, we would need to release a major version, since it will be non-backwards compatible change:
Specifically for near-sdk-rs, we might not need to release major version and only release minor version, since it will probably be a backwards compatible change:
|
borsh-rs has received no_std support: near/borsh#108 @nearmax do we have a team working on no_std support near-sdk-rs? Can we assign them on this issue? |
I think the dev plaform team is already working on this. cc @mikedotexe @austinabell |
Correct. IMO can close this bounty, this is in my current plan and I don't foresee any blockers. |
Disclaimer
This is a big bounty and will likely involve a lot of Rust expertise. Please reach out and comment if you are interested. Bounty value is still TBD
Description
Create a fork/PR of Borsh that is no-std and capable of being used to compile a Near smart contract to wasm.
Context
Currently using
create-near-app --rust [name]
produces a sample project with a compiled Near smart contractstatus_message.wasm
that is approx 120kb in size.Goal: decrease the compiled wasm size by making Borsh no-std compatible.
use borsh::{BorshDeserialize, BorshSerialize};
is NOT no-std compatible.Other details:
use near_sdk::{env, near_bindgen};
is NOT no-std compatible.You can modify the contract to remove:
use std::collections::HashMap;
Borsh:
https://github.com/near/borsh
Near SDK (bindgen):
https://github.com/near/near-sdk-rs
no-std:
https://rust-embedded.github.io/book/intro/no-std.html
The sample rust contract:
https://github.com/near/create-near-app/blob/master/common/contracts/rust/src/lib.rs
Potentially useful:
https://crates.io/crates/no-std-compat
Acceptance Criteria
Bounty
TBD
The text was updated successfully, but these errors were encountered: