Skip to content

refactor(crypto): centralize BFV protocol identity derivation - #2341

Merged
ctrlc03 merged 4 commits into
mainfrom
refactor/2197-stack-parameters
Oct 26, 2026
Merged

ctrlc03 merged 4 commits into
mainfrom
refactor/2197-stack-parameters

Conversation

@neogiacomo

@neogiacomo neogiacomo commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Part 1/6 of #2197's BFV configuration stack, based on main. Review and merge predecessors first; review follow-ups are kept in #2353.

  • Put scheme/version domains and exact parameter/configuration-ID derivation in e3-fhe-params.
  • Make runtime admission and the historical indexer use that owner without decoding/re-encoding registry bytes for identity checks.
  • Keep independent current/historical ABI/hash vectors, current-only request admission, and explicit historical indexer handling.
  • Enable CI for dependent PRs targeting stack branches, without changing publication protections.

Current baseline and verification

Restacked on main ea058724ef630d864614ddcd1887033e2793fdc4, including #2349's coordinated Noir rc.3 / BB 6.0.0 upgrade. Protocol 9, generation 2, and BFV domain v5 are inherited; this layer adds no counter change. Published #2341 was already on this baseline and its tip is preserved.

Whole-stack current evidence is recorded in #2353, not in architecture documentation. It includes frozen identity/metadata/source checks, 300 independently rederived latest VKs and 12 Solidity verifiers, a fresh default-source build matching all 102 published key/hash/anchor files, 853 prepared contract tests, seven SDK WASM proof tests, and nine native leaf plus three fold/node proof tests against latest. Do not treat historical beta.26/BB5.2 results as current qualification.

Matching CI run 40299772538 passed for 5f0d129f8721. All seven matching stack CI runs are green, and #2353 is ready for review. Rewritten branches were published using recorded exact leases and ordinary hooks. These cumulative whole-stack results do not claim every follow-up fix already exists in this individual layer.

Compatibility and limits

Relative to current main, the read-only review found no further parameter/configuration-ID/domain, committee order, T+1/H, proof multiplicity, public-input layout, production ABI/storage/events, durable-schema, or wire-format change. Frozen vectors remain independent; current slot-0/slot-2 admission and explicit historical handling remain intact. Human protocol review is still required.

Review references: artifact boundaries, proof statements, threshold decryption, protocol history, and upgrades.

#2346 explicitly reconciles 18/42 catalogue expectations with main's already-breaking toolchain cutover. Main's matching rc.3/BB6 verifier/artifact combination remains supported; protocol-8/beta.26/BB5.2 compatibility is not promised. Source stamps are preserved, not relabelled. Old-data replay and mixed-peer formats are unchanged, but no new live mixed-fleet/replay qualification is claimed. Rollback stays within the matching protocol-9 baseline and never decreases counters.

Fresh all-pair source-bound release qualification, historical #2195 replay/recurring-file measurement, exhaustive live-fleet/release qualification, and matching immutable public pins/public-release E2E for CRISP draft #6 remain separate. CRISP stays release-blocked. No migration, governance action, merge, tag, release, deployment, or artifact publication is performed or authorized.

Stack: #2341 → #2342 → #2343 → #2344 → #2345 → #2346 → #2353.

Summary by CodeRabbit

  • New Features

    • Added shared BFV protocol identity calculations and compatibility checks for current and historical configurations.
    • CI now runs for pull requests targeting any branch.
  • Documentation

    • Clarified BFV protocol identity, compatibility, and parameter-handling guidance.

@vercel

vercel Bot commented Oct 22, 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 Oct 26, 2026 9:29am UTC
interfold-docs Ready Ready Preview Oct 26, 2026 9:29am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 62ec6dc and 5f0d129.

Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 8a573cf and 62ec6dc.

📒 Files selected for processing: 2
  • AGENTS.md
  • crates/fhe-params/README.md
🚧 Files skipped from review as they are similar to previous changes: 1
  • crates/fhe-params/README.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The pull request centralizes BFV parameter and configuration identity helpers in e3-fhe-params, updates the builder, EVM decoder, and indexer to use them, and adds frozen compatibility vectors and tests. It also expands CI pull-request triggers to all target branches.

Changes: BFV protocol identity

Layer / File(s) Summary
Shared identity API and compatibility vectors
crates/fhe-params/src/*, crates/fhe-params/tests/*, crates/fhe-params/Cargo.toml, crates/fhe-params/README.md, AGENTS.md
e3-fhe-params exposes BFV scheme, parameter-hash, and configuration-ID helpers. Frozen current and historical vectors drive compatibility tests, including checks for exact encoded parameter bytes. Documentation describes the vectors and identity constraints.
Identity use in runtime and build code
crates/zk/build/src/*, crates/zk/build/templates/*, crates/evm/src/interfold/events.rs, crates/indexer/src/indexer.rs, docs/architecture/*
The builder, EVM event decoder, and indexer use shared identity helpers for current or historical configuration IDs. Tests use fixture values or shared helpers. Architecture docs describe protocol identity ownership.

CI pull request branch coverage

Layer / File(s) Summary
Pull request trigger scope
.github/workflows/ci.yml
The pull_request trigger no longer limits CI runs to pull requests targeting main or dev.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Possibly related issues

  • theinterfold/interfold#2319: The changes implement the issue’s described BFV parameter and circuit/configuration identity consolidation.
  • theinterfold/CRISP#2: The changes centralize BFV identity formulas and add compatibility checks for downstream consumers.

Suggested reviewers: ctrlc03, hmzakhalid

Merge Risk: Minimal · up to 62ec6

The BFV identity refactor preserves current and historical behavior while broadening pull-request CI coverage. No material merge-blocking risk is established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 8 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: centralizing BFV protocol identity derivation.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 8 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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

Comment @coderabbitai help to get the list of available commands.

@neogiacomo
neogiacomo added this pull request to stack #2347 October 23, 2026 09:02
@neogiacomo neogiacomo linked an issue Oct 23, 2026 that may be closed by this pull request
8 tasks
neogiacomo added a commit that referenced this pull request Oct 23, 2026
Resolve the AGENTS.md wording conflict in favor of the reviewed documentation rule, including domain docs. Carry forward the README cleanup and proposal removal from #2341 without changing #2342 implementation or tests.
@ctrlc03
ctrlc03 force-pushed the refactor/2197-stack-parameters branch from 3f96a03 to ee46ab8 Compare October 25, 2026 09:46
Share parameter hashing and current circuit domains across the builder, node admission, and indexer. Preserve ABI bytes, configuration IDs, and explicit historical v1 verification. Keep circuit message width in e3-zk-config.

Related to #2197; foundation for the configuration-consolidation stack.
Dependent review layers target the preceding feature branch. Do not silently skip the main CI workflow merely because the PR base is not main or dev; retain the existing path-based job selection and publication protections.
Remove the implementation proposal, trim source-derived README inventories, and put the concise documentation rule in the first stack layer. Retain independent protocol compatibility tests and fixture provenance unchanged.
Restore the existing artifact and proof documentation without the added implementation summaries. Preserve only the formatter-required line wrap; README compatibility guidance, fixture provenance, AGENTS policy, and tests remain unchanged.

This branch was successfully deployed

2 active deployments
Preview – interfold-docs — 5f0d129f Deployed Oct 26, 2026 by vercel[bot]
Preview – interfold-dashboard — 5f0d129f Deployed Oct 26, 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.

refactor(crypto): centralize BFV parameters and circuit identities

2 participants