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

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

Merged
merged 23 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ba291fc
feat: change dune and cargo to build mina as a submodule
MartinMinkov Sep 28, 2023
cb91aa9
feat: copy config files from mina submodule and change paths
MartinMinkov Sep 28, 2023
26723fd
fix(test_vectors): update paths to crypto/proof-systems in dump-test-…
MartinMinkov Oct 2, 2023
2ca7383
Merge branch 'main' into feat/mina-submodule-support
MartinMinkov Oct 26, 2023
469231d
refactor(dune): update relative paths for proof-systems and kimchi_bi…
MartinMinkov Oct 27, 2023
631edb5
fix(build-snarkyjs-web.sh, update-snarkyjs-bindings.sh): change SNARK…
MartinMinkov Oct 27, 2023
3f2ccd8
fix(dump-test-vectors.sh): change 'b10' to 'hex' in cargo run command…
MartinMinkov Oct 27, 2023
634f2ab
feat(kimchi): remove kimchi, since it's been moved to mina repo
MartinMinkov Nov 14, 2023
6529e3d
feat: support compiling kimchi from mina repo
MartinMinkov Nov 14, 2023
a702f05
Merge branch 'main' into feat/mina-submodule-support
MartinMinkov Nov 14, 2023
98eb83e
fix(lint.yaml): remove redundant prettier check
MartinMinkov Nov 14, 2023
7ea6187
fix(CODEOWNERS): remove kimchi directory from CODEOWNERS file as it n…
MartinMinkov Nov 15, 2023
c111dca
docs(README.md): remove '/kimchi' directory description as it is no l…
MartinMinkov Dec 13, 2023
7cffd8b
feat: fix scripts for o1js building
MartinMinkov Dec 13, 2023
a1c20d5
Merge branch 'main' into feat/mina-submodule-support
MartinMinkov Dec 13, 2023
4b453f0
chore: update bindings
MartinMinkov Dec 13, 2023
05d5665
feat(build-snarkyjs-node-artifacts.sh): add dune build command for co…
MartinMinkov Dec 13, 2023
225dd0a
chore: update bindings
MartinMinkov Dec 13, 2023
9669d55
Merge branch 'main' into feat/mina-submodule-support
MartinMinkov Dec 14, 2023
58d78b5
move kimchi/{wasm,js} to kimchi_bindings
mitschabaude Dec 18, 2023
b30b566
Merge branch 'main' into feat/mina-submodule-support
mitschabaude Dec 19, 2023
dd2e7e9
fix build scripts
mitschabaude Dec 19, 2023
15b2761
add script to help with dune build
mitschabaude Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ jobs:
run: |
npm init -y
npm i prettier
npx prettier -c kimchi/js/**/*.js js/**/*.js
1 change: 0 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/CODEOWNERS @bkase @mitschabaude @mrmr1993
/kimchi @o1-labs/crypto-eng-reviewers
. @o1-labs/eng
2 changes: 1 addition & 1 deletion MINA_COMMIT
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
The mina commit used to generate the backends for node and web is
40897ede7b1adb595d51c43ba84f05e0e17dd08d
e6fceba0b16e95824f89b553d821a60fcd5f72bd
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

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

I think the instructions in the README has to be changed.

- `/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.
- `/lib` - miscellaneous low-level TypeScript, which underpins o1js and provides generic ways to connect with a proof system and blockchain protocol.
- `/mina-transaction` - TS types and modules that specialize the generic tooling in `/lib` to Mina's zkApp protocol; mostly auto-generated from OCaml.
- `/ocaml` - OCaml library exposing Snarky, Pickles and parts of the Mina transaction logic to JS. Also, OCaml scripts that help auto-generate TypeScript for Mina- and crypto-related types and constants.
Expand Down
6 changes: 3 additions & 3 deletions compiled/node_bindings/plonk_wasm.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9526,20 +9526,20 @@ class Wire {
* @returns {number}
*/
get row() {
const ret = wasm.__wbg_get_wire_row(this.__wbg_ptr);
const ret = wasm.__wbg_get_lookupinfo_max_per_row(this.__wbg_ptr);
return ret >>> 0;
}
/**
* @param {number} arg0
*/
set row(arg0) {
wasm.__wbg_set_wire_row(this.__wbg_ptr, arg0);
wasm.__wbg_set_lookupinfo_max_per_row(this.__wbg_ptr, arg0);
}
/**
* @returns {number}
*/
get col() {
const ret = wasm.__wbg_get_wire_col(this.__wbg_ptr);
const ret = wasm.__wbg_get_lookupinfo_max_joint_size(this.__wbg_ptr);
return ret >>> 0;
}
/**
Expand Down
Binary file modified compiled/node_bindings/plonk_wasm_bg.wasm
Binary file not shown.
10 changes: 5 additions & 5 deletions compiled/node_bindings/plonk_wasm_bg.wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,6 @@ export function caml_vesta_to_affine(a: number): number;
export function caml_vesta_of_affine(a: number): number;
export function caml_vesta_of_affine_coordinates(a: number, b: number, c: number, d: number): number;
export function caml_vesta_affine_deep_copy(a: number): number;
export function __wbg_wire_free(a: number): void;
export function __wbg_get_wire_row(a: number): number;
export function __wbg_set_wire_row(a: number, b: number): void;
export function __wbg_get_wire_col(a: number): number;
export function __wbg_set_wire_col(a: number, b: number): void;
export function lookuppatterns_new(a: number, b: number, c: number, d: number): number;
export function lookupfeatures_new(a: number, b: number, c: number): number;
export function lookupinfo_new(a: number, b: number, c: number): number;
Expand All @@ -693,6 +688,11 @@ export function __wbg_get_lookupinfo_max_joint_size(a: number): number;
export function __wbg_set_lookupinfo_max_joint_size(a: number, b: number): void;
export function __wbg_get_lookupinfo_features(a: number): number;
export function __wbg_set_lookupinfo_features(a: number, b: number): void;
export function __wbg_wire_free(a: number): void;
export function __wbg_set_wire_col(a: number, b: number): void;
export function __wbg_set_wire_row(a: number, b: number): void;
export function __wbg_get_wire_row(a: number): number;
export function __wbg_get_wire_col(a: number): number;
export function wire_create(a: number, b: number): number;
export const memory: WebAssembly.Memory;
export function __wbindgen_malloc(a: number): number;
Expand Down
5,992 changes: 3,806 additions & 2,186 deletions compiled/node_bindings/snarky_js_node.bc.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion compiled/node_bindings/snarky_js_node.bc.map

Large diffs are not rendered by default.

Loading