From f810239377d60a022bd4de72a5e66991684bb84e Mon Sep 17 00:00:00 2001 From: Grga Date: Mon, 22 Sep 2025 09:15:40 +0200 Subject: [PATCH 1/6] Updated circuit generation process --- website/docs/developers/circuits.md | 30 +++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/website/docs/developers/circuits.md b/website/docs/developers/circuits.md index cf0b8a69a..1b6c157e7 100644 --- a/website/docs/developers/circuits.md +++ b/website/docs/developers/circuits.md @@ -233,11 +233,33 @@ proof types: - Protocol compliance validation - Regression testing for circuit changes -## Circuit Constraint Extraction +### Circuit Generation Process + +Since these constraint capabilities are missing, mina rust nodes requires +externally generated circuit data. The following process describes how circuits +are created and distributed using the original Mina codebase: -For a comprehensive technical overview of circuit constraint extraction, see the -[circuit_blobs module documentation](https://o1-labs.github.io/mina-rust/api-docs/ledger/proofs/circuit_blobs/index.html) -in the ledger crate. + + +1. Build mina OCAML node from source with commit after + [`6961849`](https://github.com/MinaProtocol/mina/commit/6961849f17d564c39e7d45e01e3ddda9a09602a4) + +2. Running the circuit generation process using the branch above + - Launch the OCaml node which produces circuit cache data in + `/tmp/coda_cache_dir` + - The branch dumps the usual circuit data plus extra data specifically + required by mina rust nodes + - The process also dumps blocks for use in tests + - Integration with mainline Mina would streamline future circuit generation + +3. The generated circuit blobs are then: + - Committed to the dedicated repository: + https://github.com/o1-labs/circuit-blobs + - Released as GitHub releases for versioning and distribution ### Overview From 82465965805b42c1930fb702bd2c104e9e586979 Mon Sep 17 00:00:00 2001 From: Grga Date: Mon, 22 Sep 2025 12:00:44 +0200 Subject: [PATCH 2/6] Update website/docs/developers/circuits.md Co-authored-by: Danny Willems --- website/docs/developers/circuits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/developers/circuits.md b/website/docs/developers/circuits.md index 1b6c157e7..be3011602 100644 --- a/website/docs/developers/circuits.md +++ b/website/docs/developers/circuits.md @@ -245,7 +245,7 @@ are created and distributed using the original Mina codebase: And CI is updated to check for latest circuits --> -1. Build mina OCAML node from source with commit after +1. Build mina OCaml node from source with commit after [`6961849`](https://github.com/MinaProtocol/mina/commit/6961849f17d564c39e7d45e01e3ddda9a09602a4) 2. Running the circuit generation process using the branch above From 4cc8fcd66363f812fe939257a1bed26641770673 Mon Sep 17 00:00:00 2001 From: Grga Date: Mon, 22 Sep 2025 12:00:53 +0200 Subject: [PATCH 3/6] Update website/docs/developers/circuits.md Co-authored-by: Danny Willems --- website/docs/developers/circuits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/developers/circuits.md b/website/docs/developers/circuits.md index be3011602..a6aef9da4 100644 --- a/website/docs/developers/circuits.md +++ b/website/docs/developers/circuits.md @@ -235,7 +235,7 @@ proof types: ### Circuit Generation Process -Since these constraint capabilities are missing, mina rust nodes requires +Since these constraint capabilities are missing, the Mina rust nodes require externally generated circuit data. The following process describes how circuits are created and distributed using the original Mina codebase: From cc44ef61cf5df2c621e3c7d271aad27e14580a43 Mon Sep 17 00:00:00 2001 From: Grga Date: Mon, 22 Sep 2025 12:01:00 +0200 Subject: [PATCH 4/6] Update website/docs/developers/circuits.md Co-authored-by: Danny Willems --- website/docs/developers/circuits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/developers/circuits.md b/website/docs/developers/circuits.md index a6aef9da4..2ff1e852e 100644 --- a/website/docs/developers/circuits.md +++ b/website/docs/developers/circuits.md @@ -252,7 +252,7 @@ are created and distributed using the original Mina codebase: - Launch the OCaml node which produces circuit cache data in `/tmp/coda_cache_dir` - The branch dumps the usual circuit data plus extra data specifically - required by mina rust nodes + required by the Mina rust nodes - The process also dumps blocks for use in tests - Integration with mainline Mina would streamline future circuit generation From 0a93541a42e4b7da712981a67981df09384accb8 Mon Sep 17 00:00:00 2001 From: Grga Date: Mon, 22 Sep 2025 14:45:22 +0200 Subject: [PATCH 5/6] Review fixes --- website/docs/developers/circuits.md | 30 ++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/website/docs/developers/circuits.md b/website/docs/developers/circuits.md index 2ff1e852e..014adb6e3 100644 --- a/website/docs/developers/circuits.md +++ b/website/docs/developers/circuits.md @@ -239,11 +239,13 @@ Since these constraint capabilities are missing, the Mina rust nodes require externally generated circuit data. The following process describes how circuits are created and distributed using the original Mina codebase: - +:::warning Work in Progress + +This should be updated when new mina release happens that contains code to +export circuits, and when command to export circuits is added, and CI is updated +to check for latest circuits + +::: 1. Build mina OCaml node from source with commit after [`6961849`](https://github.com/MinaProtocol/mina/commit/6961849f17d564c39e7d45e01e3ddda9a09602a4) @@ -252,8 +254,10 @@ are created and distributed using the original Mina codebase: - Launch the OCaml node which produces circuit cache data in `/tmp/coda_cache_dir` - The branch dumps the usual circuit data plus extra data specifically - required by the Mina rust nodes - - The process also dumps blocks for use in tests + required by the Mina rust nodes, see + [Circuit somponents](#circuit-components) + - The process also dumps blocks for use in tests, see + [Testing strategy](#testing-strategy) - Integration with mainline Mina would streamline future circuit generation 3. The generated circuit blobs are then: @@ -261,6 +265,18 @@ are created and distributed using the original Mina codebase: https://github.com/o1-labs/circuit-blobs - Released as GitHub releases for versioning and distribution +### Circuit Components + +Each circuit consists of multiple components that are loaded and cached +independently: + +- **Gates**: Circuit constraint definitions in JSON format (`*_gates.json`) +- **Internal Variables**: Constraint variable mappings in binary format + (`*_internal_vars.bin`) +- **Rows Reverse**: Row-wise constraint data in binary format (`*_rows_rev.bin`) +- **Verifier Indices**: Pre-computed verification data with SHA256 integrity + checks + ### Overview Circuit constraints for the Mina Rust node are sourced from the From e2aac1411464a747f14823883d0533c9baaf0c01 Mon Sep 17 00:00:00 2001 From: Grga Date: Mon, 22 Sep 2025 15:03:58 +0200 Subject: [PATCH 6/6] Update website/docs/developers/circuits.md Co-authored-by: Danny Willems --- website/docs/developers/circuits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/developers/circuits.md b/website/docs/developers/circuits.md index 014adb6e3..da8689066 100644 --- a/website/docs/developers/circuits.md +++ b/website/docs/developers/circuits.md @@ -241,7 +241,7 @@ are created and distributed using the original Mina codebase: :::warning Work in Progress -This should be updated when new mina release happens that contains code to +This should be updated when a release of the OCaml node happens that contains code to export circuits, and when command to export circuits is added, and CI is updated to check for latest circuits