Skip to content

feat(bfv)!: register the 45-party parameter sets at indices 3 and 4 - #2539

Closed
ctrlc03 wants to merge 8 commits into
large/params-n45from
large/param-sets-reindex
Closed

ctrlc03 wants to merge 8 commits into
large/params-n45from
large/param-sets-reindex

Conversation

@ctrlc03

@ctrlc03 ctrlc03 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Split from #2398 (Zara's work). Stacked on #2542 (large/params-n45); review that one first.

setParamSet is append-only, and the live registries hold earlier tuples at indices 0, 1 and 2
(Mainnet 0, 1, 2; Sepolia 0 and 2). The 45-party tuples from #2542 therefore take new indices, and
the old ones stay readable as history.

  • The 45-party tuples take registry indices 3 (secure-8192) and 4 (insecure-64).
  • The indexer resolves indices 3 and 4 only through a current profile identity. It reads 0, 1 and 2
    from the registry bytes under their frozen threshold-only ID (v5 at 0 and 2, v1 at 0 and 1).
    bfv_protocol.json keeps the v0.19 and v1 tuples as historical vectors.
  • The SDK ParamSet enum, fake_interfold.sol and the contract tests follow 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, and the build docs name the new
    indices.

Verification

Static checks only; CI runs the tests.

  • cargo check --all-targets for the affected crates (including the indexer tests, with the
    Solidity fixtures built), cargo fmt --check, node scripts/blueprint/check.mjs,
    node scripts/circuits/crypto-config.mjs --check --sources, prettier, tsc --noEmit for
    interfold-contracts.
  • The historical vectors were compared with the live Mainnet and Sepolia paramSetRegistry bytes
    (read-only eth_call); indices 3 and 4 are empty on both chains.

Compatibility

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

  • New requests use parameter set 3 or 4. getE3Quote and request reject 0, 1 and 2, and nodes
    skip request events that name them. Clients that hard-code 0 or 2, such as the CRISP server's
    E3_PARAM_SET (separate repository), must change with the release.
  • 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 is now
    paramSetsRegisteredByBatch: number[].
  • The VK catalogue, the Solidity verifiers, the BFV VK-binding fixture and the layout-lock fixtures
    are regenerated in chore(circuits): regenerate the circuit outputs of the large stack #2541 (large/circuit-outputs), near the top of
    the stack. Until then this PR's circuit, verifier and layout-lock checks fail
    by design.

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

  • 8479ea19a: sync-secure-8192 follows the SS secure preset to parameter set 3.
  • 7892192aa: blueprint refs moved by the rebase.
  • 79f015a64: an indexer backfill test reads a historical slot from the registry (stored with the registry bytes under the v5 ID; another ID at that slot is skipped). This is the path the 55 live pre-cutover E3s take.
  • 5300997b9: registry facts corrected: Sepolia index 0 is the later degree-64 redeployment, a fresh Mainnet deployment registers index 3 only, an unregistered index fails as not registered, clients use bfvConfiguration(...).paramSet from @interfold/contracts/bfv, and a rollback leaves indices 3 and 4 registered but inert.

@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 3:27pm UTC
interfold-docs Ready Ready Preview Nov 21, 2026 3:27pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 20, 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 f177b67 and 5300997.

Files ignored due to path filters: 1

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

  • crates/bfv/params/src/presets.rs
  • crates/bfv/params/tests/fixtures/README.md
  • crates/bfv/params/tests/fixtures/bfv_protocol.json
  • crates/bfv/params/tests/profile_identity.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
  • docs/architecture/committee-selection.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/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/learn/cryptography.mdx
  • packages/interfold-contracts/contracts/Interfold.sol
  • packages/interfold-contracts/contracts/lib/BfvProtocol.sol
  • packages/interfold-contracts/crypto-config.json
  • packages/interfold-contracts/scripts/protocol/types.ts
  • packages/interfold-contracts/scripts/upgrade/v19Cutover.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/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/helpers.ts
  • packages/interfold-contracts/test/fixtures/system.ts
  • packages/interfold-sdk/README.md
  • packages/interfold-sdk/src/contracts/types.ts
  • scripts/blueprint/facts/02-clients-compute.json
  • scripts/blueprint/facts/09-foundations.json
  • scripts/blueprint/refs/A-system-apps.json
  • scripts/circuits/bfv-bindings.test.ts
  • 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 and others added 8 commits November 21, 2026 14:26
- Registration is append-only and live registries hold earlier tuples at indices 0, 1 and 2, so the 45-party tuples cannot take indices 0 and 2 in place.
- ON_CHAIN_PARAMETER_SETS maps index 3 to secure-8192 and index 4 to insecure-64. BfvProtocol.sol and crypto-config.json are regenerated.
- The indexer resolves indices 3 and 4 only through a current profile identity. It reads indices 0, 1 and 2 from the registry bytes under their frozen threshold-only ID: v5 at indices 0 and 2, v1 at indices 0 and 1.
- bfv_protocol.json keeps the v0.19 tuples as historical v5 vectors, computed independently with ethers.
- The SDK ParamSet enum, the fake Interfold fixture and the test inputs follow the new indices.

BREAKING CHANGE: new requests use parameter set 3 (secure-8192) or 4 (insecure-64). Indices 0, 1 and 2 are historical.
- 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.
@ctrlc03

ctrlc03 commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Folded into #2542 so that each PR in the stack passes CI on its own: main requires template_integration, which cannot pass on a PR that changes circuits without their regenerated outputs. This PR's commits and description are unchanged inside #2542; its review threads stay here.

@ctrlc03 ctrlc03 closed this Nov 21, 2026

This branch was successfully deployed

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

1 participant