refactor: new proof aggregation [skip-line-limit]#1516
Conversation
- C3: private ct limbs, public ct_commitment output (Poseidon DS_CIPHERTEXT) - C6: public ct_commitment input, witness-only ct0/ct1, verify limb hash - c3_fold: inner public inputs [Field; 3]; Rust fold + layout metadata - Flow-trace note on cross-phase ct_commitment vs user_data_encryption Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
- Redesign c3_fold: one inner ShareEncryption ZK proof + optional prior c3_fold non-ZK proof - Pub outputs: per-party pk, msg, ct slots; skip acc verification when is_first_step - Add generate_c3_fold_step and generate_sequential_c3_fold; inner C3 uses extract_output(ct_commitment) - Remove C3FoldMerge circuit and CircuitName variant; update vk helper and lint-circuits Made-with: Cursor
- Add c2ab_fold, c3ab_fold, c4ab_fold, c6_fold, nodes_fold, node_fold, dkg_aggregator, and decryption_aggregator Noir bins - Remove legacy recursive_aggregation fold and wrapper trees; refresh c3_fold - Document aggregation bins in flow-trace; extend lint-circuits.sh checks
|
Could you do an early review of the new recursive-aggregation circuits? @zahrajavar @0xjei |
sure, will get a proper look tomorrow 🙏 |
|
agreed in chat on fixing the C3 fold stuff |
- Expand c3_fold and c3ab_fold public IO to N_PARTIES * L_THRESHOLD slots. - Assert C2 share commitments against C3 for every party/limb in node_fold. - Sync nodes_fold C3AB_FOLD_PUBLIC_LEN with c3ab_fold; use ASCII comments for nargo. - Update zk-prover accumulator, VK wiring, events, multithread, and integration tests.
- Add c3_fold_kernel Noir package and wire recursive aggregation build - Implement sequential C3 fold in c3_accumulator; export generate_sequential_c3_fold only - Add recursive_aggregation e2e tests (two inner ShareEncryption proofs) - Update prover, circuit helpers, Proof extract_input/output, multithread, flow-trace
- Add c6_fold_kernel Noir package for genesis accumulator (aligned with c3_fold_kernel). - Make c6_fold always verify the non-ZK accumulator like c3_fold. - Add CircuitName::C6FoldKernel and generate_sequential_c6_fold in aggregation/c6_accumulator.rs. - Move c3 accumulator into circuits/aggregation/ with a small mod.rs. - Copy c6_fold_kernel artifacts in integration test circuit staging. - Extend recursive_aggregation e2e tests (C6 ABI, staged kernel, two-step fold + verify).
- Add NODE_FOLD_PIPELINE (c2ab_fold, c3ab_fold, c4ab_fold, node_fold) JSON load + staged VK tests. - Stage the same bins in integration test default/recursive_aggregation fixture copy.
…ator tests - Add node_fold_correlated_e2e_tests for full node_fold prove + verify with correlated C1/C2/C3 chain - Add tests/common/node_fold_witness.rs (PK sample, share computation, per-slot C3 encrypt) - Rename recursive_aggregation_e2e_tests to fold_accumulators_e2e_tests; clarify module docs - Re-export load_vk_artifacts and fold witness helpers from test_utils for integration tests - Add dev-dependencies fhe-traits, ndarray, rand for witness builders
- Add nodes_fold_kernel and always verify accumulator in nodes_fold (c3/c6-style genesis) - Add NodeDkgFold / sequential nodes_fold + DkgAggregation provers; remove proof_fold path - Pad UltraHonkZKProof witness bytes to 508 fields for dkg_aggregator and decryption_aggregator - Wire NodeProofAggregator, multithread ZkRequest arms, events, integration fixtures, flow-trace
- Fix cargo fmt --check failures from pre-push hook
| assert(nodes_fold_public[4 + i * NODE_FOLD_PUBLIC_LEN] == party_ids[i]); | ||
| } | ||
|
|
||
| // Cross-node C2 share grid (see `node_fold` public layout). |
There was a problem hiding this comment.
@cedoor Isn't this checking party_i.c3_pk[j] == party_j.c0_pk ?
The comment should be "cross-node C0 --> C3"
|
In handle_encryption_key_received() function here We are missing this check in the first sync point Verifies C0 commitment binding for ALL parties (N checks): hash(pk_j) == C0_j.pk_commit (for each party j)This checks bfv_public_key matches the pk_commitment in the C0 proof's public values.We need a check like this |
Summary
Refactors proof aggregation around ad-hoc Noir bins under
circuits/bin/recursive_aggregation/, replacing the old genericfold/andwrapper/trees. Aggregation is expressed as explicit fold + aggregator circuits with clear public layouts and key hashes.Recursive aggregation layout
c2ab_foldc3_foldShareEncryption+ optional priorc3_foldnon-ZK proof (is_first_step,slot_index).c3ab_foldc3_foldoutputs.c4ab_foldnode_foldc2ab_fold,c3ab_fold,c4ab_foldwith same-party assertions between stages.nodes_foldHnode_foldproofs (one honest slot per step), chained with priornodes_fold.dkg_aggregatornodes_foldproof + C5 (pk_aggregation) ZK; enforces cross-node grids and C5↔node public links.c6_foldT+1C6 (ThresholdShareDecryption) rows for the phase-7 path.decryption_aggregatorc6_foldproof + C7 ZK; ties folded C6 columns toc7_public.Removed:
recursive_aggregation/fold/andrecursive_aggregation/wrapper/(legacy two-proof fold and generic wrappers).How reviewers can test
Compile recursive-aggregation circuits (needed for zk-prover tests that read
circuits/bin/...):Barretenberg — integration tests expect
bbonPATH; they print a skip message if it’s missing.Optional zk-prover integration targets (not run by default CI for this crate yet):
CI still runs
e3-zk-prover’sintegration_testsandlocal_e2e_testsonly; these two are for local / follow-up CI if you wire them in.What those zk-prover tests cover
fold_accumulators_e2e_testsgenerate_sequential_c3_fold/generate_sequential_c6_fold(prove + verify), slot counts from compiledc3_fold/c6_foldJSON, staging of recursive-aggregation artifacts, and loading the node_fold pipeline (C2ab → C3ab → C4ab →node_fold) without a full correlated DKG witness story.node_fold_correlated_e2e_testsnode_foldprove + verify.