You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in order to access rust natively, we need to use a ffi from nodejs to rust - neon-rs looks like a good choice
setting this up requires us to add a new build pipeline that builds the new native rust artefacts and makes them available in o1js
currently, the default is to compile Rust to WASM and OCaml to JS - this is the only backend we currently support. There are a few small differences between web and node but they are mostly similar.
We need to set up the ffi and integrate it into our build pipeline (when running npm run build:bindings we now need to build the rust artefacts too)
So this was/is kind of hard to test without an actual method implemented. I've found a couple of candidates in the poseidon-block-ciper functions (we've captured this in another issue somewhere).
I've since found some issues with the plonk-wasm code that make integrating a native function a little more difficult and should be changed in the wasm-bindings such that some of the code can be re-used.
Great news, I managed to prove to myself that the native Rust library leads to passing tests! I didn’t change much, so I really did expect this to work…. it’s been a real struggle trying to get everything to build and get copied to where I expect it to be. I actually ended up just moving the .node (dynamic library) file into the bindings repo and editing some js (no, not ts) code that imports plonk_wasm , then I replaced the two functions that I re-wrote.
Now, on to building for as many targets as possible.
in order to access rust natively, we need to use a ffi from nodejs to rust - neon-rs looks like a good choice
setting this up requires us to add a new build pipeline that builds the new native rust artefacts and makes them available in o1js
currently, the default is to compile Rust to WASM and OCaml to JS - this is the only backend we currently support. There are a few small differences between web and node but they are mostly similar.
We need to set up the ffi and integrate it into our build pipeline (when running
npm run build:bindings
we now need to build the rust artefacts too)acceptance criteria:
npm run build:bindings
generates neon-rs and wasm artefactsThe text was updated successfully, but these errors were encountered: