Skip to content
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

[develop] Add support to build bindings using mina as a submodule in o1js repo #222

Merged
merged 17 commits into from
Dec 19, 2023

Conversation

MartinMinkov
Copy link
Contributor

@MartinMinkov MartinMinkov commented Dec 13, 2023

Description

Addresses o1-labs/o1js#1096

🔗 Mina: MinaProtocol/mina#14649
🔗 o1js: o1-labs/o1js#1318

This PR makes mina buildable as a submodule of o1js. To do so, the following changes have been made:

  1. Moved kimchi into mina repo.
    • This was done for several reasons. Firstly, we want to replace the snarkyjs submodule in the mina repo with an o1js stub module with the same dependencies as o1js, but just checks compiling. This test ensures o1js can be compiled if anything changes in the mina repo.
    • Secondly, there is a longer-term plan internally to create a o1 crypto repo that will combine the wasm bindings with the ocaml-rust stubs, and it's easier to colocate these libraries in the mina repo as of now.
  2. Changes the dune files in a few places to accommodate the mina submodule in o1js
  3. Changes the build scripts to accommodate the mina submodule in o1js
  4. Removed codeowners entry for kimchi

…vectors.sh and dune files

feat(dump-test-vectors.sh): add debug statements to print current working directory for better troubleshooting
fix(dune): update chmod command to reflect new path to crypto/proof-systems for correct permissions setting
…s to correctly export test vectors in hexadecimal format
@@ -51,7 +51,7 @@
(modules snarky_js_types)
(link_flags (-linkall))
(modes native)
(libraries mina_base fields_derivers_zkapps yojson)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have done this in a different commit than the one udpating the artefacts.

@@ -20,6 +20,7 @@
pickles_base
pickles.limb_vector
pickles_types
key_cache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@@ -34,7 +35,7 @@
data_hash_lib
hash_prefixes
fields_derivers
fields_derivers_zkapps
fields_derivers.zkapps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@@ -3,13 +3,8 @@
set -e

pushd ../../../mina/src/lib/crypto/proof-systems/poseidon/export_test_vectors
<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@@ -9,7 +9,6 @@ The repo is included as a git submodule in the [o1js repo](https://github.com/o1
- `/compiled` - compiled JS and Wasm artifacts produced by `js_of_ocaml` and `wasm-bindgen` from Rust and OCaml source code. We keep these artifacts in the source tree so that developing on o1js can be done with standard JS tooling and doesn't require setting up the full OCaml/Rust build pipeline.
- `/crypto` - pure TS implementations of a subset of the crypto primitives we use, including finite field and elliptic curve arithmetic. This is used by mina-signer (a pure TS package) to hash and sign transactions.
- `/js` - JS-side wrappers for the artifacts located in `/compiled`, which differs between the Node.js and web versions of o1js. Includes code for setting up workers to support using `rayon` in Rust.
- `/kimchi` - bindings to the [Kimchi proof system](https://o1-labs.github.io/proof-systems/kimchi/overview.html) which is implemented in Rust. This contains a Wasm compatibility layer written in Rust as well as a `js_of_ocaml`-to-`wasm-bindgen` glue layer written in JS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More changes have to be made in this file I think, for instance the build instructions.

@mitschabaude mitschabaude merged commit 9910553 into develop Dec 19, 2023
1 check passed
@mitschabaude mitschabaude deleted the feat/mina-submodule-support-develop branch December 19, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants