Skip to content

feat: configure new param set [skip-line-limit]#1576

Merged
ctrlc03 merged 12 commits into
mainfrom
bench/medium-3mod
Jun 4, 2026
Merged

feat: configure new param set [skip-line-limit]#1576
ctrlc03 merged 12 commits into
mainfrom
bench/medium-3mod

Conversation

@0xjei

@0xjei 0xjei commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
  • added 3+ param set
  • added Large committee size
  • removed esi_per_ct

Summary by CodeRabbit

  • New Features

    • Added support for a new "large" committee configuration (20 participants) throughout tooling and scripts.
  • Chores

    • Updated core cryptographic and FHE parameter sets for secure presets.
    • Simplified event/request payloads and related metadata handling.
    • Regenerated parity matrices, benchmark results, and human-readable reports for secure aggregation.
    • Reduced the default secure lambda parameter from 60 to 50.

@0xjei 0xjei self-assigned this Jun 4, 2026
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crisp Ready Ready Preview, Comment Jun 4, 2026 1:20pm
enclave-docs Ready Ready Preview, Comment Jun 4, 2026 1:20pm
enclave-enclave-dashboard Ready Ready Preview, Comment Jun 4, 2026 1:20pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updates secure BFV/DKG parameters and search defaults, adds a large committee with generated parity matrices, regenerates parity matrices for other committee sizes, removes esi_per_ct from event/meta types and threads BFV preset/params through events/handlers, updates CLI tooling, and adds/regenerates benchmark artifacts and reports.

Changes

FHE Parameters, Committee Configuration, Event Schema, and Tooling

Layer / File(s) Summary
FHE Constants: Secure-8192 Parameters and Search Defaults
crates/fhe-params/src/constants.rs
Updates secure_8192 NUM_PARTIES, threshold/DKG plaintext moduli and moduli lists, ERROR1_VARIANCE, search_defaults (SEARCH_N/K/Z), and reduces DEFAULT_SECURE_LAMBDA to 50.
Large Committee Configuration with Parity Matrices
circuits/lib/src/configs/committee/large/mod.nr, circuits/lib/src/configs/committee/large/parity_insecure.nr, circuits/lib/src/configs/committee/large/parity_secure.nr, circuits/lib/src/configs/committee/mod.nr
Adds large committee globals (N_PARTIES=20, T=7, H=15), and generated PARITY_MATRIX modules for insecure and secure presets; registers large in committee namespace.
Parity Matrix Coefficient Regeneration
circuits/lib/src/configs/committee/micro/parity_secure.nr, circuits/lib/src/configs/committee/small/parity_secure.nr, circuits/lib/src/configs/committee/medium/parity_secure.nr
Regenerates numeric coefficients inside existing PARITY_MATRIX constants for micro/small/medium secure presets; shapes/types unchanged.
Secure DKG Numeric Constants and Encryption Bounds
circuits/lib/src/configs/secure/dkg.nr
Updates QIS, PLAINTEXT_MODULUS, Q_MOD_T, centered modulus, multiple bit-size params, and share-encryption bounds/config arrays and message/decryption bit sizes.
Event and Meta Struct Schema Updates
crates/events/src/enclave_event/e3_requested.rs, crates/events/src/enclave_event/ciphernode_selected.rs, crates/request/src/meta.rs
Removes esi_per_ct from E3Requested and E3Meta; CiphernodeSelected now carries params_preset: BfvPreset, params: ArcBytes, and party_id: u64.
Event Handlers and Type Conversion Updates
crates/evm/src/domain/enclave_events.rs, crates/sortition/src/actors/ciphernode_selector.rs, crates/tests/tests/integration.rs
Derives lambda from params_preset metadata; stops populating/using esi_per_ct in event construction and meta population; updates integration test to include params_preset, serialized params, and proof_aggregation_enabled.
CLI and Build Tooling: Large Committee Option
scripts/circuit-constants.ts, scripts/build-circuits.ts, scripts/generate-verifiers.ts
Adds LARGE committee to CIRCUIT_COMMITTEES/ALL_COMMITTEES and COMMITTEE_PARAMS ({ n:20,t:7,h:15 }), and updates CLI help text to list large.

Benchmark Pipeline and Secure Aggregation Test Artifacts

Layer / File(s) Summary
Benchmark Pipeline: Integration Summary Snapshot Handling
circuits/benchmarks/scripts/run_benchmarks.sh
Extracts integration_summary from generated GAS JSON earlier and conditionally passes it to report generation; Stage 3 syncs now rely on earlier snapshot.
Medium Secure Run Metadata and Integration Summary
circuits/benchmarks/results_secure_agg_medium/benchmark_run_meta.json, circuits/benchmarks/results_secure_agg_medium/integration_summary.json
Adds medium secure benchmark metadata (BFV preset secure-8192, committee n=10,h=8,t=4, proof aggregation, threads/jobs, network model) and a full integration summary with operation timings, phase timings, and folded artifacts.
Medium Secure Gas Metrics and Proof Artifacts
circuits/benchmarks/results_secure_agg_medium/crisp_verify_gas.json
Adds verify_gas/calldata_gas metrics and artifact sizes for dkg/user/dec, embeds integration summary excerpt, includes serialized dkg_aggregator and decryption_aggregator proof/public_inputs hex blobs, and test exit codes.
Medium Secure Benchmark Report
circuits/benchmarks/results_secure_agg_medium/report.md
Generated report capturing run provenance, BFV/config details, protocol & circuit benchmarks, artifact/gas tables, integration/phase timings, multithread job breakdowns, and raw input references.
Micro Secure Benchmark Metadata and Report Regeneration
circuits/benchmarks/results_secure_agg_micro/benchmark_run_meta.json, circuits/benchmarks/results_secure_agg_micro/report.md
Adds committee_size_h and committee_threshold_t fields to micro meta; regenerates micro report with DEFAULT_SECURE_LAMBDA=50 and refreshed circuit measurements and timing summaries.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

crisp

Suggested reviewers

  • cedoor
  • ctrlc03
  • hmzakhalid

"I'm a rabbit with a tiny lab,
I hopped through matrices and tab,
I pruned an esi, threaded a preset,
Grew committees large — now run the suite yet! 🐇
Proofs and reports hop in a tidy slab."

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 accurately captures the main objective of the PR: configuring a new parameter set. While it doesn't mention all aspects (large committee, esi_per_ct removal), the primary focus is clearly on the new parameter configuration.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bench/medium-3mod

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 and usage tips.

@0xjei 0xjei changed the title feat: configure new param set for prod feat: configure new param set for prod [skip-line-limit] Jun 4, 2026
@0xjei 0xjei changed the title feat: configure new param set for prod [skip-line-limit] feat: configure new param set [skip-line-limit] Jun 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@circuits/benchmarks/results_secure_agg_micro/report.md`:
- Line 21: The report's λ value is incorrect (shows 55) — update the micro
benchmark report to match the preset and outputs by changing the "λ (smudging /
error)" entry from 55 to 50; verify this aligns with DEFAULT_SECURE_LAMBDA and
the secure-8192 preset (and the integration_summary.json/crisp_verify_gas.json
which show "lambda": 50).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c1aec693-5566-41e6-a3f6-18add39d38d1

📥 Commits

Reviewing files that changed from the base of the PR and between 85f86a1 and c2b2831.

📒 Files selected for processing (28)
  • circuits/benchmarks/results_secure_agg_medium/benchmark_run_meta.json
  • circuits/benchmarks/results_secure_agg_medium/crisp_verify_gas.json
  • circuits/benchmarks/results_secure_agg_medium/integration_summary.json
  • circuits/benchmarks/results_secure_agg_medium/report.md
  • circuits/benchmarks/results_secure_agg_micro/benchmark_run_meta.json
  • circuits/benchmarks/results_secure_agg_micro/crisp_verify_gas.json
  • circuits/benchmarks/results_secure_agg_micro/integration_summary.json
  • circuits/benchmarks/results_secure_agg_micro/report.md
  • circuits/lib/src/configs/committee/large/mod.nr
  • circuits/lib/src/configs/committee/large/parity_insecure.nr
  • circuits/lib/src/configs/committee/large/parity_secure.nr
  • circuits/lib/src/configs/committee/medium/parity_secure.nr
  • circuits/lib/src/configs/committee/micro/parity_secure.nr
  • circuits/lib/src/configs/committee/mod.nr
  • circuits/lib/src/configs/committee/small/parity_secure.nr
  • circuits/lib/src/configs/default/mod.nr
  • circuits/lib/src/configs/secure/dkg.nr
  • circuits/lib/src/configs/secure/threshold.nr
  • crates/events/src/enclave_event/ciphernode_selected.rs
  • crates/events/src/enclave_event/e3_requested.rs
  • crates/evm/src/domain/enclave_events.rs
  • crates/fhe-params/src/constants.rs
  • crates/request/src/meta.rs
  • crates/sortition/src/actors/ciphernode_selector.rs
  • crates/tests/tests/integration.rs
  • scripts/build-circuits.ts
  • scripts/circuit-constants.ts
  • scripts/generate-verifiers.ts
💤 Files with no reviewable changes (5)
  • crates/events/src/enclave_event/ciphernode_selected.rs
  • crates/request/src/meta.rs
  • crates/events/src/enclave_event/e3_requested.rs
  • crates/sortition/src/actors/ciphernode_selector.rs
  • crates/tests/tests/integration.rs

Comment thread circuits/benchmarks/results_secure_agg_micro/report.md Outdated
ctrlc03
ctrlc03 previously approved these changes Jun 4, 2026

@ctrlc03 ctrlc03 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@circuits/benchmarks/scripts/run_benchmarks.sh`:
- Around line 389-393: INTEGRATION_SNAPSHOT is only written on successful
extraction so a previous snapshot can be reused when extraction fails; update
the logic around the INTEGRATION_SNAPSHOT/GAS_JSON_FILE handling so that when
the extraction condition fails you proactively remove/truncate the existing
"${INTEGRATION_SNAPSHOT}" (and analogous snapshots at the other blocks
referenced) instead of leaving stale files; locate the block using the
INTEGRATION_SNAPSHOT and GAS_JSON_FILE variables and add an else branch that
checks for the existing snapshot and deletes or empties it to guarantee
downstream stages cannot read a stale snapshot.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5e2409e8-dbe8-450a-804a-566a63047df2

📥 Commits

Reviewing files that changed from the base of the PR and between c2b2831 and 99a7583.

📒 Files selected for processing (2)
  • circuits/benchmarks/results_secure_agg_micro/report.md
  • circuits/benchmarks/scripts/run_benchmarks.sh

Comment thread circuits/benchmarks/scripts/run_benchmarks.sh
@ctrlc03 ctrlc03 enabled auto-merge (squash) June 4, 2026 12:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/fhe-params/src/presets.rs (1)

537-550: ⚡ Quick win

Add assertions for b and b_chi in search-default tests.

search_defaults() now threads dedicated insecure b/b_chi, but the test only validates n/k/z/lambda. Add explicit checks so regressions on error bounds are caught.

Proposed test update
     let preset = BfvPreset::InsecureThreshold512;
     let defaults = preset.search_defaults().unwrap();
     assert_eq!(defaults.n, INSECURE_SEARCH_N);
     assert_eq!(defaults.k, INSECURE_SEARCH_K);
     assert_eq!(defaults.z, INSECURE_SEARCH_Z);
     assert_eq!(defaults.lambda, DEFAULT_INSECURE_LAMBDA as u32);
+    assert_eq!(defaults.b, INSECURE_B);
+    assert_eq!(defaults.b_chi, INSECURE_B_CHI);

     let preset = BfvPreset::SecureThreshold8192;
     let defaults = preset.search_defaults().unwrap();
     assert_eq!(defaults.n, SEARCH_N);
     assert_eq!(defaults.k, SEARCH_K);
     assert_eq!(defaults.z, SEARCH_Z);
     assert_eq!(defaults.lambda, DEFAULT_SECURE_LAMBDA as u32);
+    assert_eq!(defaults.b, B);
+    assert_eq!(defaults.b_chi, B_CHI);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/fhe-params/src/presets.rs` around lines 537 - 550, The test
test_search_defaults() currently checks only n/k/z/lambda; update it to also
assert the returned error bounds by adding checks for defaults.b and
defaults.b_chi for both presets: for BfvPreset::InsecureThreshold512 assert
defaults.b equals INSECURE_SEARCH_B and defaults.b_chi equals
INSECURE_SEARCH_B_CHI, and for BfvPreset::SecureThreshold8192 assert defaults.b
equals SEARCH_B and defaults.b_chi equals SEARCH_B_CHI; locate these in the same
test around the existing search_defaults() calls and add the two corresponding
assert_eq! lines for each preset.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/fhe-params/src/presets.rs`:
- Around line 537-550: The test test_search_defaults() currently checks only
n/k/z/lambda; update it to also assert the returned error bounds by adding
checks for defaults.b and defaults.b_chi for both presets: for
BfvPreset::InsecureThreshold512 assert defaults.b equals INSECURE_SEARCH_B and
defaults.b_chi equals INSECURE_SEARCH_B_CHI, and for
BfvPreset::SecureThreshold8192 assert defaults.b equals SEARCH_B and
defaults.b_chi equals SEARCH_B_CHI; locate these in the same test around the
existing search_defaults() calls and add the two corresponding assert_eq! lines
for each preset.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: caf8a3d1-9ff0-436c-93f2-57a58c73afe2

📥 Commits

Reviewing files that changed from the base of the PR and between 99a7583 and 7302ea6.

📒 Files selected for processing (2)
  • crates/fhe-params/src/constants.rs
  • crates/fhe-params/src/presets.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/fhe-params/src/constants.rs

@0xjei 0xjei requested a review from ctrlc03 June 4, 2026 13:37
@ctrlc03 ctrlc03 merged commit 2396f43 into main Jun 4, 2026
34 checks passed
@ctrlc03 ctrlc03 deleted the bench/medium-3mod branch June 4, 2026 13:46
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