Skip to content

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

Closed
ctrlc03 wants to merge 8 commits into
large/release-largefrom
large/node-measure
Closed

ctrlc03 wants to merge 8 commits into
large/release-largefrom
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 #2537 (large/release-large), 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; once requested, it fails unless 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 requested
measurements then fail at the artifact check.

  • 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:, 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, minimum or large); Large is selectable but has not been
run.

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.

Update 2026-11-21: rebased onto main (#2524–#2530) and Fable review fixes

  • The opt-in gate fails rather than skips after opt-in; the recipe gives the full command; sequential C3 prints a NOTE; the aggregator measurement fills the Chonk slots with copies of one C6 proof; the crate README lists the target. Large is selectable.

@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 21, 2026 4:29pm UTC
interfold-docs Ready Ready Preview Nov 21, 2026 4:29pm 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 59 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 6cd6c50 and 4fc4d22.

Files selected for processing: 3

  • crates/zk/prover/README.md
  • 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
@ctrlc03
ctrlc03 force-pushed the large/circuit-outputs branch from cca5e27 to 3b4da1e Compare November 20, 2026 09:48
@ctrlc03
ctrlc03 force-pushed the large/circuit-outputs branch from 3b4da1e to f28a1a5 Compare November 20, 2026 17:22
zahrajavar and others added 8 commits November 21, 2026 16:24
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.
…uit artifacts

With MEASURE_RUN=1 and the phase flag set, a missing or mismatched active artifact stamp printed SKIP and passed, so an automated benchmark could report an empty run as a success. The opt-out skip stays; after opt-in the mismatch now panics with the build command.
…Chonk inputs

The run recipe still said a wrong artifact set skips; since the opt-in gate it fails, and the recipe now gives the full command and notes that Large is selectable. The sequential C3 mode prints a NOTE, because production runs four light C3 jobs at once. The aggregator measurement fills the T other Chonk slots with copies of this node's C6 proof, as the C6 Chonk e2e does, instead of proving T extra C6 proofs. The crate README lists the target.
@ctrlc03

ctrlc03 commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Closed: opt-in measurement tests, not needed for the large committee and not run on this stack. The branch large/node-measure (4fc4d2242) stays, so this can return as its own PR if the numbers are wanted.

@ctrlc03 ctrlc03 closed this Nov 21, 2026

This branch was successfully deployed

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