Skip to content

feat(bfv)!: size BFV for 45 parties and add the large committee - #2542

Open
ctrlc03 wants to merge 30 commits into
large/nodes-fold-threefrom
large/params-n45
Open

ctrlc03 wants to merge 30 commits into
large/nodes-fold-threefrom
large/params-n45

Conversation

@ctrlc03

@ctrlc03 ctrlc03 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Split from #2398 (Zara's work). Stacked on #2531.

Adds the Large committee (N = 45, H = 34, T = 22). The BFV parameter search was sized for 19 parties,
so this PR first resizes it for 45 parties, registers the new parameter sets at new registry indices,
and then adds the committee.

BFV parameters for 45 parties

  • SEARCH_N is 45 for the secure and insecure searches. The error-1 variance constants and the
    builder test vectors follow the new result.
  • The Noir threshold configs, BfvProtocol.sol and crypto-config.json carry the new parameter
    hashes (insecure 0x2898f8a9…a844, secure 0x4f402598…08c3) and the config IDs derived from them.
    bfv_protocol.json and bfv_profiles.json are recomputed independently with ethers.
  • The synchronized profiles use the same search, so their threshold tuples and C6 noise bounds move
    too. sync-secure-8192 gets a new configuration ID (0xe3996b37…) and moves to parameter set 3.
  • The new secure noise bound is 2^144.42, past the secure C6's hard-coded 144/145-bit checks. The
    generator now emits C6_NOISE_BIT (145) and C6_SHIFTED_NOISE_BIT (146), and the statement takes
    them as parameters, with static asserts. A unit test keeps the bound within 145 bits.

Parameter sets at registry indices 3 and 4

setParamSet is append-only, and live registries already hold earlier tuples at indices 0–2. The
new tuples take index 3 (secure-8192) and index 4 (insecure-64); the old ones stay readable.

  • The indexer resolves 3 and 4 through the current profile identity, and reads 0–2 from the
    registry bytes under their frozen IDs, so pre-cutover E3s still backfill.
  • The SDK ParamSet enum, fake_interfold.sol and the contract tests use the new indices.
  • upgrade:v19 prepare registers every parameter set the chain lacks (3 on Mainnet; 3 and 4 on
    Sepolia) and stops if an index holds other bytes. validate checks them all.
    docs/architecture/upgrades.md gives the cutover procedure.

Large committee

  • CiphernodesCommitteeSize::Large and IInterfold.CommitteeSize variant 3, appended after Small.
    Both SS profiles admit it, each with a new configuration ID.
  • ActiveCryptoConfig accepts the size; Interfold.MAX_COMMITTEE_SIZE rises from 19 to 45. The
    SDK, bfv.ts, the harness, the hardhat request task, the EVM enum and the dashboard follow.
  • build-pairs.json builds insecure-64/large and secure-8192/large. Deployment routes, the
    release matrix and the mainnet configuration are unchanged here; feat(contracts)!: route the large committee on testnets and release it #2537 adds them.

Regenerated outputs from one matrix build (stamp 5c2ddf13094ffd62, published to
circuit-artifacts): the VK catalogue, the Honk verifiers for the two Large pairs (the six
existing pairs' Honk verifiers regenerate unchanged), the layout-lock rows for Large, the BFV
VK-binding fixture, and both synchronized Minimum candidate manifests.

Verification

  • Static checks: cargo check, cargo fmt --check, nargo check with the Large committee selected
    for both presets, scripts/circuits/lint.sh, scripts/checks/committee.sh, blueprint check,
    crypto-config.mjs --check --sources, check:crypto-config --full, pnpm check:bindings,
    prettier, tsc --noEmit.
  • Both synchronized Minimum candidates re-qualified with real proofs (secure: 9.6 min,
    26.6 GiB peak). The VK-binding check passes.
  • The historical parameter-set vectors match the live Mainnet and Sepolia paramSetRegistry
    bytes (read-only eth_call); indices 3 and 4 are empty on both chains.
  • CI runs the tests.

Compatibility

Breaking within the unreleased protocol-9 cutover (no separate counter change).

  • Every pair's parameter hash and cryptoConfigId change, and with them the VK catalogue anchors
    and the BFV verifiers deployed for each route.
  • New requests use parameter set 3 or 4; getE3Quote and request reject 0–2, and nodes skip
    request events that name them. Clients that hard-code an index, such as the CRISP server's
    E3_PARAM_SET, move to 3 (secure) or 4 (insecure).
  • The cutover batch calls setParamSet(3, …) on Mainnet and Sepolia and setParamSet(4, …) on
    Sepolia. Before resume, check keccak256(paramSetRegistry(3)) = 0x4f402598…08c3 and
    keccak256(paramSetRegistry(4)) = 0x2898f8a9…a844.
  • The v0.19 cutover plan field paramSet/paramSetRegisteredByBatch becomes
    paramSetsRegisteredByBatch: number[].
  • Nodes that predate the Large variant cannot decode a Large request. Existing committees and
    mainnet routes are unchanged.

@vercel

vercel Bot commented Nov 20, 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 7:53pm UTC
interfold-docs Ready Ready Preview Nov 21, 2026 7:53pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 112 files, which is 12 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.

Check out review usage here.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f494f51 and d77c814.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 112

  • circuits/benchmarks/synchronized-decryption.md
  • circuits/bin/synchronized_secure/threshold/share_decryption/src/main.nr
  • circuits/lib/src/configs/committee/active.nr
  • circuits/lib/src/configs/committee/large/mod.nr
  • circuits/lib/src/configs/committee/mod.nr
  • circuits/lib/src/configs/insecure/threshold.nr
  • circuits/lib/src/configs/secure/threshold.nr
  • circuits/lib/src/configs/synchronized/sync_insecure_64.nr
  • circuits/lib/src/configs/synchronized/sync_secure_8192.nr
  • circuits/lib/src/core/synchronized/threshold_decryption.nr
  • circuits/lib/src/core/synchronized/threshold_decryption_tests.nr
  • circuits/qualification/sync-insecure-64/minimum/manifest.json
  • circuits/qualification/sync-secure-8192/minimum/manifest.json
  • circuits/vk-commitments.json
  • crates/bfv/params/README.md
  • crates/bfv/params/src/builder.rs
  • crates/bfv/params/src/constants.rs
  • crates/bfv/params/src/presets.rs
  • crates/bfv/params/src/profiles.rs
  • crates/bfv/params/src/search/bfv.rs
  • crates/bfv/params/tests/fixtures/README.md
  • crates/bfv/params/tests/fixtures/bfv_profiles.json
  • crates/bfv/params/tests/fixtures/bfv_protocol.json
  • crates/bfv/params/tests/profile_identity.rs
  • crates/committee/README.md
  • crates/committee/src/lib.rs
  • crates/evm/contracts/src/enums.rs
  • crates/evm/indexer/Cargo.toml
  • crates/evm/indexer/src/indexer.rs
  • crates/evm/indexer/tests/fixtures/fake_interfold.sol
  • crates/evm/indexer/tests/integration.rs
  • crates/evm/runtime/src/interfold/events.rs
  • crates/state/request/src/routing/tests.rs
  • crates/testing/system/tests/fixtures/layout_lock.txt
  • crates/zk/benchmarks/src/circuit_benchmark/protocol.rs
  • crates/zk/build/src/lib.rs
  • crates/zk/build/src/tests.rs
  • crates/zk/build/templates/committee_active.nr.in
  • crates/zk/config/src/synchronized.rs
  • crates/zk/prover/src/backend/download.rs
  • crates/zk/prover/src/circuits/aggregation/node_dkg_fold.rs
  • crates/zk/prover/src/commitment_links/c1_to_c2.rs
  • crates/zk/prover/tests/fixtures/layout_lock.txt
  • crates/zk/witness/tests/user_data_encryption_samples.rs
  • docs/architecture/circuit-artifacts.md
  • docs/architecture/committee-selection.md
  • docs/architecture/proof-statements.md
  • docs/architecture/upgrades.md
  • docs/pages/build/best-practices.mdx
  • docs/pages/build/e3-program/complete-example.mdx
  • docs/pages/build/e3-program/secure-process.mdx
  • docs/pages/build/interfold-contract.mdx
  • docs/pages/build/noir-circuits.mdx
  • docs/pages/build/quick-start.mdx
  • docs/pages/build/requesting-an-e3.mdx
  • docs/pages/build/sdk.mdx
  • docs/pages/build/tutorials/custom-zk-circuits.mdx
  • docs/pages/build/tutorials/deploy-to-testnet.mdx
  • docs/pages/internals/dkg.mdx
  • docs/pages/internals/sortition.mdx
  • docs/pages/learn/cryptography.mdx
  • docs/pages/learn/what-is-e3.mdx
  • docs/pages/reference/contracts.mdx
  • docs/pages/reference/glossary.mdx
  • packages/interfold-contracts/bfv.ts
  • packages/interfold-contracts/contracts/Interfold.sol
  • packages/interfold-contracts/contracts/interfaces/IInterfold.sol
  • packages/interfold-contracts/contracts/lib/ActiveCryptoConfig.sol
  • packages/interfold-contracts/contracts/lib/BfvProtocol.sol
  • packages/interfold-contracts/contracts/test/BfvProtocolHarness.sol
  • packages/interfold-contracts/contracts/verifiers/bfv/honk/insecure-64/large/DecryptionAggregatorVerifier.sol
  • packages/interfold-contracts/contracts/verifiers/bfv/honk/insecure-64/large/DkgAggregatorVerifier.sol
  • packages/interfold-contracts/contracts/verifiers/bfv/honk/secure-8192/large/DecryptionAggregatorVerifier.sol
  • packages/interfold-contracts/contracts/verifiers/bfv/honk/secure-8192/large/DkgAggregatorVerifier.sol
  • packages/interfold-contracts/crypto-config.json
  • packages/interfold-contracts/scripts/protocol/types.ts
  • packages/interfold-contracts/scripts/upgrade/v19Cutover.ts
  • packages/interfold-contracts/scripts/utils.ts
  • packages/interfold-contracts/tasks/interfold.ts
  • packages/interfold-contracts/test/BfvProtocol.spec.ts
  • packages/interfold-contracts/test/Deployment/V19Cutover.spec.ts
  • packages/interfold-contracts/test/E3Lifecycle/E3Integration.spec.ts
  • packages/interfold-contracts/test/E3Lifecycle/Sortition.spec.ts
  • packages/interfold-contracts/test/Governance/AccessAndBounds.spec.ts
  • packages/interfold-contracts/test/Interfold.spec.ts
  • packages/interfold-contracts/test/Pricing/DustRotation.spec.ts
  • packages/interfold-contracts/test/Pricing/Pricing.spec.ts
  • packages/interfold-contracts/test/Pricing/PullPaymentsAndAllowlist.spec.ts
  • packages/interfold-contracts/test/Registry/CiphernodeRegistryOwnable.spec.ts
  • packages/interfold-contracts/test/Slashing/CommitteeExpulsion.spec.ts
  • packages/interfold-contracts/test/fixtures/bfv_vk_binding/folded_artifacts.json
  • packages/interfold-contracts/test/fixtures/helpers.ts
  • packages/interfold-contracts/test/fixtures/system.ts
  • packages/interfold-dashboard/src/lib/e3.ts
  • packages/interfold-sdk/README.md
  • packages/interfold-sdk/scripts/compile-circuits.sh
  • packages/interfold-sdk/src/contracts/types.ts
  • packages/interfold-sdk/tests/circuit-selection.test.ts
  • scripts/blueprint/facts/02-clients-compute.json
  • scripts/blueprint/facts/09-foundations.json
  • scripts/blueprint/facts/10-contracts.json
  • scripts/blueprint/facts/12-sdk.json
  • scripts/blueprint/refs/A-system-apps.json
  • scripts/checks/committee.sh
  • scripts/checks/integration-committee.test.ts
  • scripts/circuits/README.md
  • scripts/circuits/bfv-bindings.test.ts
  • scripts/circuits/build-pairs.json
  • scripts/circuits/constants.ts
  • scripts/circuits/test.sh
  • scripts/circuits/verifiers.ts
  • tests/integration/lib/utils.sh

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 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 #2543 November 20, 2026 09:22
@ctrlc03
ctrlc03 removed this pull request from stack #2543 November 21, 2026 16:25
@ctrlc03 ctrlc03 changed the title feat(bfv)!: size the BFV parameter search for 45 parties feat(bfv)!: size BFV for 45 parties and add the large committee Nov 21, 2026
@ctrlc03
ctrlc03 changed the base branch from large/c4-per-limb to large/nodes-fold-three November 21, 2026 16:29
@ctrlc03
ctrlc03 added this pull request to stack #2545 November 21, 2026 16:29
@ctrlc03
ctrlc03 removed this pull request from stack #2545 November 21, 2026 16:38
@ctrlc03
ctrlc03 added this pull request to stack #2546 November 21, 2026 16:38
Split from #2398. Raise the secure-8192 and insecure-64 search to n = 45
(rerun of search_params, the insecure one with lambda 2 and 12-bit
primes), so one parameter set serves every committee up to the large
one. The moduli are unchanged; the threshold error1 variance grows
(secure B_Enc 518814677073081139200, insecure 460800), so the smudging
and user-encryption e0 bounds grow, and the insecure e0 bound gains one
bit. Correctness margins at n = 45: secure 2.07 bits, insecure 2.52 bits.

Both presets' parameter hashes and every configuration identity change
(BfvProtocol.sol, crypto-config.json and the independently recomputed
ethers fixtures). Compiled artifacts, the VK catalogue and the BFV
verifiers are regenerated separately.
ctrlc03 and others added 23 commits November 21, 2026 16:58
- upgrades.md replaces the unresolved registry-index gap with the cutover procedure: register index 3 (secure) and index 4 (insecure, testnets) in the paused governance batch, check the exact bytes before resume, and keep indices 0, 1 and 2 as historical registry reads.
- The developer pages, the committee-selection note and the SDK README name indices 3 and 4.
…er batch

- `upgrade:v19 prepare` registered only the secure index 3, and `validate` checked only that index. Sepolia requests default to the insecure index 4, so a resumed Sepolia would reject them with "BFV param set not registered".
- `prepare` now adds one `setParamSet` call for each parameter set of the chain that the registry lacks, and stops if an index holds other bytes.
- `validate`, and `resume` through it, check every parameter set of the chain.
- The plan records `paramSetsRegisteredByBatch` in place of `paramSet` and `paramSetRegisteredByBatch`.
- The cutover test uses index 3 and covers a batch that registers two sets.
…set 3

sync-secure-8192 takes the SS secure threshold preset, so it follows that preset's move to registry index 3, as sync-insecure-64 already follows index 4.
Pre-cutover E3s at slots 0 and 2 now resolve through the registry bytes rather than a local preset. The fake Interfold gains setParamSet, and a backfill test registers the historical insecure v5 tuple at slot 0: a request under its threshold-only ID is stored with those exact bytes, and a request under another ID at the slot is skipped.
Sepolia index 0 holds the degree-64 v5 tuple of a later redeployment, not the v0.19.x tuple; a fresh Mainnet deployment registers index 3 only; an unregistered historical index fails as not registered before the crypto-config check; clients derive the index from bfvConfiguration in @interfold/contracts/bfv, since the SDK does not export ParamSet; and a rollback leaves indices 3 and 4 registered but inert.
Define a fourth committee size beside minimum, micro and small. It is wire
variant 3 of CiphernodesCommitteeSize and IInterfold.CommitteeSize, so the
published enum values stay. The shared committee owner carries N = 45,
H = 34 and T = 22, and the generated Noir, Solidity and TypeScript bindings
follow it.

- Both SS profiles admit the committee, so each gains a configuration ID
  (SS_INSECURE_64_LARGE_CONFIG_ID, SS_SECURE_8192_LARGE_CONFIG_ID).
  ActiveCryptoConfig accepts the size and returns those IDs.
- build-pairs.json builds insecure-64/large and secure-8192/large. The
  release matrix and the chain deployment routes do not change here.
- The SDK, the hardhat request task, the circuit and committee checks, the
  Rust enum consumers and the docs list the fourth size.

Breaking: nodes that predate the variant cannot decode a Large request.
Three node proofs per step stay within 2^22 at n = 45 (3.71M gates).
The CRISP server rejects E3_COMMITTEE_SIZE above 2 at startup
(theinterfold/CRISP server/src/config.rs), so the settings table must
not offer 3 for the large committee.
The DKG aggregation shape test and the C1/C2 commitment width test
name every canonical committee, and they stopped at small.
The dashboard hard-coded T for Minimum, Micro and Small, so a Large E3 showed 0 of 45 shares required. It now reads COMMITTEES from @interfold/contracts/bfv. The mainnet notes in ActiveCryptoConfig.sol and committee-selection.md say the contract accepts any size whose threshold is set and the configuration keeps mainnet to minimum/micro/small; the circuit-artifacts rewrap no longer splits 'provenance/ publication'.
…meters and the large committee

From the matrix build of stamp 5c2ddf13094ffd62 (published as circuit-artifacts 86a25e3): the named VK catalogue for the eight build pairs; the Honk verifiers, including insecure-64/large and secure-8192/large; the layout locks for CiphernodesCommitteeSize::Large on top of the circuits PR's rows; the BFV VK-binding fixture; and both synchronized Minimum candidate manifests, requalified after the 45-party search (each has a new C6 pin and configuration ID; the C7 and outer pins are unchanged). The benchmark note records the secure C6 gate count after the wider noise checks.
committee-selection.md said Sepolia and local chains set Large; the routes and thresholds that do so come in the next PR. The BfvProtocol spec's invalid-committee case passed parameter set 0, which no longer exists, so it reverted on the parameter set and never reached the committee check; it now uses ss-insecure-64's set. The CommitteeSize encoding test records that the hidden __Invalid sentinel moves from 3 to 4.

This branch was successfully deployed

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