Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou'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. View limit details
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. |
Architecture changeFrom Experimental. The page goes away when the pull request closes. |
9f8294f to
55eee2e
Compare
55eee2e to
5dcc59b
Compare
…ommitments At 28 honest parties C4 is a 2^24 circuit, over a node's 13 GiB per-job budget. Its openings and sums are independent per limb, and the aggregate commitment C6 reads is one SAFE sponge over the normalized limbs in order, so prove each limb separately and carry that sponge between them. The last limb squeezes the unchunked C4 commitment; C6 is unchanged. - aggregate_limb holds C4's per-limb statement (checked openings, sum, reverse and center); the unchunked execute and the limb circuits share it. - share_decryption_limb_0/1/2 each start the aggregate sponge at their limb's fixed position, so every absorb position is static. The final share_decryption circuit verifies the three limbs, links them from the fresh sponge and returns the aggregate commitment, then the limb key tree. - c4ab_fold and the VK tree anchor the key tree; peers check it when verifying a C4. The C4 output layout names the trailing key tree. - The limb circuits are published in the default variant only, as the C2 chunk circuits are. - The circuit identity lock gains rows for the limb circuit names, appended after the existing variants.
…length C4 now also outputs its key tree, so c4ab_fold's C4_PUBLIC_LEN is one field more than what the fold passes on. The node and nodes folds call their length C4_FOLDED_LEN, as they already do for C2.
…anchor test The limb keys are VK_PATHS 29..=31; 25..=28 are the C6 Chonk keys, so the expected node tree used the wrong keys and the mutation loop counted the limb keys as C6 descendants.
The peer C4 handler now checks the final C4's limb key tree. Run the key-tree test over C4 as well as C2, so a regression to the bare outer-proof check fails.
No circuit calls ShareDecryption::execute since C4 is proven per limb; only the chain test used it as its oracle. Keep C4's role as module docs, take the one-shot commitment from aggregate_canonical_shares in the test, and point the blueprint at the limb statement and the chain check.
The final C4 returns its limb key tree after the aggregate commitment. Say so in the link's layout and row comment, and end the C4 test signals with a key tree as a real final C4 does.
Naming C4_FOLDED_LEN added two lines to node_fold, nodes_fold and nodes_fold_kernel, which left ten blueprint references two lines short.
chunk_circuits returns the C4 limb circuits too, so the comment that named only C2 chunks was stale.
The final C4 proof now ends on two outputs (the aggregate commitment, then the limb key tree), but the C2-to-C4 row bound still asked for one field after the row. With one modulus the row one past the roster passed the bound and compared C2's commitments with C4's aggregate. Unreachable today (three moduli, roster-mapped rows); the bound is exact again.
…selection The benchmark configuration lists share_decryption_limb_0/1/2 for both modes, so the default selection has 18 secure and 17 insecure cases.
f745f44 to
f7c2a0e
Compare
What and why
Split from #2398 (Zara's work). Stacked on #2532 (
large/c6-chonk); review that one first.At 28 honest parties C4 is a 2^24 circuit, over a node's 13 GiB per-job budget. Its openings and sums
are independent per CRT limb, and the aggregate commitment C6 reads is one SAFE sponge over the
normalized limbs in order. So this proves each limb separately and carries that sponge between them,
the way C2 is already proven as a chunk chain. The last limb squeezes the unchunked C4 commitment, so
C6 and every commitment link are unchanged.
share_decryption_limb_0/1/2each run C4's statement for one limb (aggregate_limb: checkedopenings of the H dealer shares, sum, reverse and center) and continue the aggregate sponge from
the state the previous limb left. Each limb starts at its own fixed sponge position, so every
absorb position is static and each limb has its own circuit.
share_decryptioncircuit verifies the three limb proofs, each with its own key, linksthem from the fresh sponge (
DS_SHARE_DECRYPTION_CHAIN_STATE) and returns the aggregate commitmentthen the hash of the limb keys.
c4ab_foldfolds that key hash into its own key hash next to the C4 key, and the VK tree's C4 nodeis
hash(C4, C4 chain, C4, C4 chain), so the anchor pins every limb circuit. A peer verifying a C4directly compares the key tree with its own limb keys (
zk_verify_share_proof_bundle, secret-sharedprofile only; the synchronized C4 stays a single circuit).
key_treefield. The C4→C6 links extractcommitmentbyname from the tail, so they still find it. The C2→C4 link's row bound now requires both C4 outputs
(aggregate commitment and key tree) after a row.
publishes them in the
defaultvariant alone, as it does the C2 chunks.required-artifacts.jsonlists them.
aggregate_limb(one limb, opening the C2 commitments) and the synchronized C4(
aggregate_canonical_shares) share the per-limb arithmetic (aggregate_canonical_limb), sothere is one definition of the sum, reverse and center step.
node_fold,nodes_foldandnodes_fold_kernelcall the lengthc4ab_foldpasses onC4_FOLDED_LEN, now one field shorter thanc4ab_fold::C4_PUBLIC_LEN, as they already do for C2.Verification
Per the current stack policy, tests are not run here; CI runs them. Static checks run on this branch:
nargo checkandnargo compileof thedkg,recursive_aggregationand synchronized circuitworkspaces;
scripts/circuits/lint.sh.cargo check -p e3-zk-config -p e3-zk-witness -p e3-zk-build -p e3-zk-prover -p e3-zk-benchmarks --all-targetsand
cargo check --workspace --all-targets, which only fails in thee3-evm,e3-evm-clientande3-indexertests for missing generated contract bindings;cargo fmt --all --check.prettier --checkon the changed Markdown and JSON.node scripts/blueprint/check.mjs(without--fix) moves no reference relative to main.Tests this change adds or extends, for CI:
nargo testincircuits/lib:limb_chain_equals_the_unchunked_c4_commitment(the three limbsteps, chained, return the unchunked C4 commitment) and the chain's tamper tests.
cargo test -p e3-zk-witness --test dkg_samples:limb_chain_aggregate_equals_the_unchunked_commitmentpins that the limb chain's aggregate equalsthe unchunked C4 commitment on a real sample.
-p e3-zk-config --test circuit_identity,-p e3-zk-build, the C4/C6 commitment link tests, andthe C4 cases of
local_e2e_testsandnode_fold_correlated_e2e_tests.-p e3-net --lib layout_lock,-p e3-slashing --lib layout_lock,-p e3-zk-prover --lib layout_lock,-p e3-tests --test layout_lock) gain rows for the three newCircuitNamevariants. They are not regenerated on this branch.Compatibility
Breaking within the unreleased protocol-9 cutover (no separate counter change): drain-and-resync.
c4ab_foldand the VK tree's C4 node change, with them every nodes-tree anchor andthe DKG wrapper (
BfvPkVerifier). The C6 tree and the decryption wrapper do not depend on C4. Thedeployed verifiers and artifacts from before this change do not accept the new proofs; drain
first. Rollback: drain, then restore the previous binary and artifacts.
C4 public output gains one trailing field (the limb key tree).
CircuitName::DkgShareDecryptionLimb0/1/2areappended after the existing variants, so stored encodings keep their indices. Limb proofs are never
persisted or gossiped.
circuits/vk-commitments.json), the Solidity verifiers, the BFV VK-bindingfixture and the layout-lock fixtures are regenerated once, from one matrix build, in chore(circuits): regenerate the circuit outputs of the large stack #2541 (
large/circuit-outputs), near the top ofthe stack. Until then this PR's circuit, verifier and layout-lock checks
fail by design.