Skip to content

test(zk-prover): measure a node's proving pipeline on secure-8192 - #2534

Open
ctrlc03 wants to merge 6 commits into
large/circuit-outputsfrom
large/node-measure
Open

ctrlc03 wants to merge 6 commits into
large/circuit-outputsfrom
large/node-measure

Conversation

@ctrlc03

@ctrlc03 ctrlc03 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Split from #2398 (Zara's work). Stacked on #2541 (large/circuit-outputs), at the top of the stack: nothing depends on it, so it
can merge after the rest. Review #2533 first; it adds the limb circuits this measures.

Opt-in measurement tests for the node's proving pipeline on secure-8192, to size the committee work
that follows. They change no production code. Every test returns at once unless MEASURE_RUN=1
(and its own gate) is set and the active circuit artifacts match the measured preset and committee.
CI's selected suites do not include this target; a plain cargo test (pnpm rust:test) runs the
tests as no-ops. Run them with E3_ZK_PROVER_SKIP_FIXTURE_BUILD=1: without it the crate's build
script can switch circuits/bin to the default insecure-64/minimum pair, and the measurements
then skip.

  • trbfv_node_dkg_pipeline_measure: party 0 proves C0, C1, C2a/C2b (chunk chains), every C3 proof
    of the node, C4a/C4b as recipient (each a limb chain and the final C4) and the node fold, as the
    node's handlers request them. MEASURE_C3_POOL=1 proves the C3 batch through a TaskPool sized
    like a node's, each C3 a light job with a quarter of the units and bb threads, as
    e3-multithread admits it. MEASURE_NODES_FOLD=1 times the aggregator's nodes_fold over H node
    proofs.
  • trbfv_c3_chonk_stack_measure: the C3 chain for each app build in MEASURE_C3_APPS, to compare
    stack sizes.
  • trbfv_c3_concurrency_measure: the same C3 slots proved with 1, 2 and 4 proofs at a time. The
    slots wrap over the committee's peer slots, so MEASURE_C3_COUNT may exceed them.
  • trbfv_decryption_measure: the node's C6, and with MEASURE_AGGREGATOR=1 the C6 Chonk root and
    C7.
  • trbfv_aggregator_pk_aggregation_measure: the aggregator's C5.

C5 and C7 are proved non-ZK (CircuitVariant::Default), as the aggregators prove them for
in-circuit verification; the other proofs use the variants their production handlers use.

Output lines (the measure: … header, skipping:, SKIP, PREP, MEASURE, BB, STEP,
PHASE, TOTAL, NOTE, FAIL) are described in tests/common/node_pipeline_measure.rs. The
harness is parameterized by committee
(MEASURE_COMMITTEE: small, micro or minimum); it has no large-committee (n = 45) case yet,
because this stack adds Large only later.

Verification

Only static checks ran; the tests are opt-in and need a secure-8192 build, so CI does not run them.

  • cargo check -p e3-zk-prover --all-targets; cargo fmt --all --check; cargo clippy -p e3-zk-prover --tests reports nothing in the new files.
  • node scripts/blueprint/check.mjs (no --fix): same counts as without the change.

Compatibility

Tests only. No protocol, storage, wire or artifact change.

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
interfold-dashboard Ready Ready Preview Nov 20, 2026 9:49am UTC
interfold-docs Ready Ready Preview Nov 20, 2026 9:49am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3b4da1e and 0268524.

Files selected for processing: 2

  • crates/zk/prover/tests/common/node_pipeline_measure.rs
  • crates/zk/prover/tests/node_pipeline_trbfv_measure.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ctrlc03
ctrlc03 added this pull request to stack #2538 November 20, 2026 08:50
@ctrlc03
ctrlc03 removed this pull request from stack #2538 November 20, 2026 09:11
@ctrlc03
ctrlc03 changed the base branch from large/c4-per-limb to large/circuit-outputs November 20, 2026 09:11
@ctrlc03
ctrlc03 added this pull request to stack #2543 November 20, 2026 09:22
zahrajavar and others added 6 commits November 20, 2026 09:38
Opt-in measurements (`MEASURE_RUN=1`, other gates per test, skipped otherwise) of the trBFV
pipeline on secure-8192 at the committee in `MEASURE_COMMITTEE` (`small` by default, or `minimum`).
Output lines (MEASURE, BB, STEP, PHASE, TOTAL, NOTE) are described in
`tests/common/node_pipeline_measure.rs`.

- One node's DKG proving: C0, C1, C2a/C2b, every C3, C4a/C4b as recipient and the node fold, with
  the C3 batch optionally proved through a node-sized task pool (`MEASURE_C3_POOL=1`) and the
  aggregator's `nodes_fold` timed (`MEASURE_NODES_FOLD=1`).
- C3 Chonk stack size: the C3 chain for each app build in `MEASURE_C3_APPS`.
- C3 throughput with 1, 2 and 4 concurrent proofs (`MEASURE_C3_CONCURRENCY=1`).
- Threshold decryption: the node's C6, and with `MEASURE_AGGREGATOR=1` the C6 Chonk root and C7.
- The aggregator's C5.

Split from #2398.
…ment

The C2 chunk and C4 limb circuits only ship a default key, so staging them as
leaves asserted on a missing EVM key. Stage each chunked leaf's chunk circuits
from chunk_circuits, size the C3 concurrency runs with with_bb_threads instead
of mutating HARDWARE_CONCURRENCY, drop the nested c3_set MEASURE line, and
correct stale wording.
handle_pk_aggregation_proof and handle_decrypted_shares_aggregation_proof prove
C5 and C7 with CircuitVariant::Default (noir-recursive-no-zk), because the DKG and
decryption aggregators verify them in-circuit. The measurement proved both with
Provable::prove, which is the ZK recursive variant under a different key, so it
timed a proof the aggregator never makes.
…tee's slots

The measurement took MEASURE_C3_COUNT slots (default 24) after the node's own, so a
committee with fewer peer slots (minimum has 2 * L) indexed past the last party's
share and panicked. A count above the peer slots now repeats them; the circuit
cost does not depend on the slot.
With MEASURE_C3_POOL=1 the c3 phase printed its duration without the
`PHASE c3 start <unix_ms>` line every other phase has. Phases::start and
Phases::end now print both lines for a phase `run` cannot wrap.

Also keep the C3 chain MEASURE label free of spaces, like every other label, and
list the PREP, FAIL and `STEP c3 proofs=` lines the harness prints.
…e build

The e3-zk-prover build script runs `pnpm build:circuits --skip-if-built` for the default
insecure-64/minimum pair, which replaces a secure-8192 `circuits/bin`. The run recipe and the SKIP
line now name E3_ZK_PROVER_SKIP_FIXTURE_BUILD=1.

The module doc also lists the gate lines, says that the c3 phase covers each C3's native
encryption, and excepts the concurrency measurement from sequential proving.

This branch was successfully deployed

2 active deployments
Preview – interfold-docs — 02685243 Deployed Nov 20, 2026 by vercel[bot]
Preview – interfold-dashboard — 02685243 Deployed Nov 20, 2026 by vercel[bot]
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.

2 participants