-
Notifications
You must be signed in to change notification settings - Fork 547
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
[o1js-main] Add o1js-stub to Mina repo in place of SnarkyJS #14461
Conversation
This reverts commit 75f49e0c09faed96c13978db6b390acedcdb3756.
…hanges-o1jsmain Feat/port rosetta zkapp changes o1jsmain
!ci-build-me |
!ci-build-me |
…to feat/add-o1js-stubs
!ci-build-me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve the CODEOWNERS change -- what tags me as a blocker on (I delegate the protocol and infra review to others even those GitHub will say it's ✅ )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first pass. Some comments:
- That would be nice to provide a way to check the version of o1js-bindings has been imported. I cannot be sure that the code has not been modified.
- It would be nice that
dune build
buildsplonk_wasm
. cargo doesn't seem to be run when we usedune build src/lib
. I would have expected it does. - I'm not sure
kimchi
is the best name for the wasm/js deps. - I think it is already in o1js-bindings, but I see, when running
dune build src/lib/o1js_stub
:
warning: free variables in primitive code "tsSrs" (/home/soc/codes/o1-labs/mina/_build/default/src/lib/crypto/kimchi/js/bindings.js:13)
vars: tsBindings
code providing tsSrs (/home/soc/codes/o1-labs/mina/_build/default/src/lib/crypto/kimchi/js/bindings.js:13) may miss dependencies: tsBindings
- Nix build is not happy. But I think it is already on o1js-main
- Some commit messages could be squashed to clear the history, like d850951, 16716c9, f07fa96, e59e805, 3403057, 1ba5689, 645a768
- I am a bit lost with some git merge, not sure why it is there.
Questions:
- Do we run
cargo fmt
andclippy
for plonk_wasm? - I do see some commits remove crypto/kimchi/js/js_backend, but it is still in my tree. Any reason?
- Why don't we run
prettier
on JS files?
src/lib/crypto/kimchi/js/README.md
Outdated
need to run | ||
|
||
``` | ||
dune build src/lib/marlin_plonk_bindings/js/test/nodejs/nodejs_test.bc.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be changed to the right repo.
src/lib/crypto/kimchi/js/README.md
Outdated
|
||
``` | ||
dune build src/lib/marlin_plonk_bindings/js/test/nodejs/nodejs_test.bc.js | ||
src/lib/marlin_plonk_bindings/js/test/nodejs/copy_over.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/lib/crypto/kimchi/js/README.md
Outdated
Similarly, to run the web tests in `test/web`, you can run | ||
|
||
``` | ||
dune build src/lib/marlin_plonk_bindings/js/test/web/web_test.bc.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/lib/crypto/kimchi/js/README.md
Outdated
|
||
``` | ||
dune build src/lib/marlin_plonk_bindings/js/test/web/web_test.bc.js | ||
src/lib/marlin_plonk_bindings/js/test/web/copy_over.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
Hey @dannywillems I want to answer to some of your comments!
I just did this locally and verified that there is no change introduced. I cloned the version of o1js which has this Mina PR checked out (o1-labs/o1js#1133) and redid what Martin did: copy the Feel free to do the same if you want to verify it: gregor@p340:~$ rm -rf o1/o1js/src/mina/src/lib/crypto/kimchi/wasm
gregor@p340:~$ cp -r o1/mina/src/lib/snarkyjs/src/bindings/kimchi/wasm o1/o1js/src/mina/src/lib/crypto/kimchi/wasm
gregor@p340:~$ cd o1/o1js/src/mina
gregor@p340:~/o1/o1js/src/mina$ git diff
diff --git a/src/lib/crypto/kimchi/wasm/Cargo.toml b/src/lib/crypto/kimchi/wasm/Cargo.toml
index 65cde66006..18f9721adb 100644
--- a/src/lib/crypto/kimchi/wasm/Cargo.toml
+++ b/src/lib/crypto/kimchi/wasm/Cargo.toml
@@ -30,12 +30,12 @@ ark-ec = { version = "0.3.0", features = ["parallel"] }
ark-poly = { version = "0.3.0", features = ["parallel"] }
# proof-systems
-poly-commitment = { path = "../../proof-systems/poly-commitment" }
-groupmap = { path = "../../proof-systems/groupmap" }
-mina-curves = { path = "../../proof-systems/curves" }
-o1-utils = { path = "../../proof-systems/utils" }
-mina-poseidon = { path = "../../proof-systems/poseidon" }
-kimchi = { path = "../../proof-systems/kimchi", features = ["wasm_types"] }
+poly-commitment = { path = "../../../../../crypto/proof-systems/poly-commitment" }
+groupmap = { path = "../../../../../crypto/proof-systems/groupmap" }
+mina-curves = { path = "../../../../../crypto/proof-systems/curves" }
+o1-utils = { path = "../../../../../crypto/proof-systems/utils" }
+mina-poseidon = { path = "../../../../../crypto/proof-systems/poseidon" }
+kimchi = { path = "../../../../../crypto/proof-systems/kimchi", features = ["wasm_types"] }
array-init = "2.0.0"
base64 = "0.13.0" |
@MartinMinkov I agree with @dannywillems. The original location in the Mina repo was in
Yeah this is already in o1js-bindings. Not really in the scope of this PR but I'm happy to push a small commit that fixes it.
Already in o1js-main, not in scope for this PR
@dannywillems I suspect you mean #14683 which was merged into this PR. It was necessary to fix the rosetta integration test in the Mina repo, which depended on o1js. Since o1js is no longer accessible from the mina repo, the test had to be refactored.
I requested it on this PR: #14461 (comment)
I assume you mean why don't we run it in CI? All of our JS developers will probably run prettier in their editors when auto-formatting on save. In o1js-bindings we also had the GH action that you added which ran prettier in CI. I think adding a similar CI job here is out of scope of this PR, we don't have any JS CI now in Mina. But it could be a useful follow-up, when we also add the o1js-stubs compilation test. |
LGTM for the follow-up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in Rosetta here come from commits outside the scope of this work. Would it be best to merge those changes separately (if you mean to merge them) so this PR only changes related files? Regardless, I'm approving since changes come from an already approved branch.
!ci-build-me |
I opened the follow-up issue: #14741 listing my comments above. |
Regarding #14461 (review), I totally do agree we should not include changes that are unrelated to the PR. In addition to that, we must enforce cleaning commits before merging. Seeing in the git history multiple commits with the same message and with the same goal, resulting from multiple attempts, should be forbidden. Before review, the history should be cleaned, and when a review starts, the OP should not modify previous commits, but only write on top of it, and request a new review after the OP cleaned the additional commits. |
Summary
Addresses #14466
🔗 o1js: o1-labs/o1js#1133
🔗 o1js-bindings: o1-labs/o1js-bindings#159
This PR aims to add support for building mina as a submodule of
o1js
. To do so, the following was done:snarkyjs
submoduleo1js_stub
module, that has the same dependencies as o1js. The goal with this module is to have a way for Mina CI to check that o1js can still be successfully compiled after changes are made. This gives a safety net to not totally break things if changes to the dependencies are made.kimchi
library from o1js-bindings intosrc/lib/crypto
. This is to make sure that we can compileo1js_stub
since we need the WASM dependencies generated from the library, as well as to support a longer term plan to create a o1 crypto repo that recombines the wasm bindings with o1caml-rust stubs.snarkyjs