Skip to content

feat: add production ready sets for trbfv and bfv#942

Merged
ryardley merged 11 commits into
devfrom
params/128b-sets
Nov 6, 2025
Merged

feat: add production ready sets for trbfv and bfv#942
ryardley merged 11 commits into
devfrom
params/128b-sets

Conversation

@0xjei

@0xjei 0xjei commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

This PR adds 128bit security parameters set (production ready) for trbfv and bfv.

Please, note that trbfv requires an explicit set of error_2. Both error_1 and error_2 variances are default to 10 in other cases. To avoid breaking changes, I made error_2 an option to the build and we can just pass None to default to 10.

Summary by CodeRabbit

  • New Features

    • Configurable error variance for BFV operations (new optional parameter)
    • New production-ready BFV parameter presets
    • Parameter encoding/decoding expanded to carry variance metadata
    • CLI/tools updated to accept an --error2-variance option
  • Chores

    • Added a workspace dependency to support big-integer handling

@vercel

vercel Bot commented Oct 31, 2025

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
crisp Skipped Skipped Nov 6, 2025 0:36am
enclave-docs Skipped Skipped Nov 6, 2025 0:36am

@coderabbitai

coderabbitai Bot commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds an optional error2_variance field into BFV parameter definition, encoding/decoding ABI, and parameter-construction APIs; introduces BfvParamSet presets and new build_bfv_params_from_set* helpers; updates call sites and CLI to pass or default the variance; adds a workspace dependency to bfv-helpers Cargo.toml.

Changes

Cohort / File(s) Summary
BFV helpers core
crates/bfv-helpers/Cargo.toml, crates/bfv-helpers/src/lib.rs
Adds num-bigint workspace dep; replaces tuple presets with BfvParamSet constants; adds error2_variance: Option<&'static str> to sets; extends build_bfv_params / build_bfv_params_arc to accept Option<&str>; adds build_bfv_params_from_set / _from_set_arc; expands encode/decode ABI to include error2_variance.
BFV helpers client & tests
crates/bfv-helpers/src/client.rs, crates/tests/tests/integration.rs, crates/trbfv/tests/integration.rs, templates/default/program/src/lib.rs
Update call sites and tests to use new APIs: pass None or use build_bfv_params_from_set_arc(param_set); minor error message formatting change.
Rust SDK call-sites & utils
crates/fhe/src/fhe.rs, crates/fhe/src/utils.rs
Update build_bfv_params_arc(...) invocations to include the additional None argument for error2_variance.
Test utilities & binaries
crates/test-helpers/src/lib.rs, crates/test-helpers/src/bin/fake_encrypt.rs, crates/test-helpers/src/bin/pack_e3_params.rs
get_common_setup now accepts Option<BfvParamSet>; fake_encrypt switched to build_bfv_params_from_set_arc; pack_e3_params adds CLI --error2-variance (Args.error2_variance: Option) and conditionally passes Some/None to builder.
Example app
examples/CRISP/server/src/cli/commands.rs, examples/CRISP/server/src/server/routes/rounds.rs
Replace unpack+call with build_bfv_params_from_set_arc(SET_2048_1032193_1) and update imports.
TypeScript SDK / Enclave
packages/enclave-sdk/src/utils.ts
Adds error2_variance to BFV_PARAMS_SET; extends encodeBfvParams signature and encoded ABI to include error2_variance field in the payload.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as pack_e3_params CLI
    participant TS as Enclave SDK / Caller
    participant Helpers as bfv_helpers
    participant Encoder as encode_bfv_params

    CLI->>TS: optional --error2-variance
    TS->>Helpers: build_bfv_params_from_set_arc(param_set) or build_bfv_params_arc(..., Some/None)
    activate Helpers
    Note right of Helpers `#DDEBF7`: internal variance = provided OR default "10"
    Helpers-->>TS: Arc<BfvParameters (with error2_variance)>
    deactivate Helpers
    TS->>Encoder: encode_bfv_params(params)
    activate Encoder
    Encoder-->>TS: encoded payload { degree, plaintext_modulus, moduli, error2_variance }
    deactivate Encoder
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus areas:
    • crates/bfv-helpers/src/lib.rs — changes to presets, build functions, encode/decode ABI and default variance logic.
    • crates/test-helpers/src/bin/pack_e3_params.rs — CLI parsing and conditional pass-through of variance.
    • packages/enclave-sdk/src/utils.ts — ensure ABI shape matches Rust encode/decode and defaulting behavior.
  • Other call-site edits are mostly mechanical; verify consistent usage of new BfvParamSet helpers and correct passing of Some/None.

Possibly related PRs

Suggested reviewers

  • ryardley
  • hmzakhalid

Poem

🐰 Hopped in the code with a twitch of my nose,
I tucked variance gently where BFV grows,
From Rust to TypeScript, a string now will roam,
Encoded and folded to carry it home. 🎩🌿

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main objective: adding production-ready parameter sets for trbfv and bfv with 128-bit security levels.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch params/128b-sets

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 67f748f and 6ddbc61.

📒 Files selected for processing (7)
  • crates/bfv-helpers/src/client.rs (6 hunks)
  • crates/bfv-helpers/src/lib.rs (14 hunks)
  • crates/test-helpers/src/bin/fake_encrypt.rs (2 hunks)
  • crates/test-helpers/src/lib.rs (3 hunks)
  • examples/CRISP/server/src/cli/commands.rs (2 hunks)
  • examples/CRISP/server/src/server/routes/rounds.rs (2 hunks)
  • templates/default/program/src/lib.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/CRISP/server/src/server/routes/rounds.rs
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: 0xjei
Repo: gnosisguild/enclave PR: 388
File: packages/commons/src/bfv/mod.rs:38-48
Timestamp: 2025-05-07T15:18:20.056Z
Learning: The `build_bfv_params` and related functions in the commons BFV utilities intentionally use panic for error handling as a temporary solution. The team plans to refactor these to use proper Result-based error handling in the future.
📚 Learning: 2025-05-07T15:18:20.056Z
Learnt from: 0xjei
Repo: gnosisguild/enclave PR: 388
File: packages/commons/src/bfv/mod.rs:38-48
Timestamp: 2025-05-07T15:18:20.056Z
Learning: The `build_bfv_params` and related functions in the commons BFV utilities intentionally use panic for error handling as a temporary solution. The team plans to refactor these to use proper Result-based error handling in the future.

Applied to files:

  • templates/default/program/src/lib.rs
  • crates/test-helpers/src/bin/fake_encrypt.rs
  • examples/CRISP/server/src/cli/commands.rs
  • crates/bfv-helpers/src/client.rs
  • crates/test-helpers/src/lib.rs
  • crates/bfv-helpers/src/lib.rs
📚 Learning: 2024-10-22T02:10:34.864Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:82-83
Timestamp: 2024-10-22T02:10:34.864Z
Learning: In the file `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs`, when reviewing test functions like `generate_pk_share`, minor performance optimizations (e.g., minimizing mutex locks) are not a priority.

Applied to files:

  • templates/default/program/src/lib.rs
  • crates/test-helpers/src/bin/fake_encrypt.rs
  • crates/bfv-helpers/src/client.rs
  • crates/test-helpers/src/lib.rs
  • crates/bfv-helpers/src/lib.rs
📚 Learning: 2024-10-23T01:59:42.967Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 156
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:274-274
Timestamp: 2024-10-23T01:59:42.967Z
Learning: In the `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs` file and other test files within this project, hardcoding `CIPHERNODE_SECRET` is acceptable for testing purposes.

Applied to files:

  • templates/default/program/src/lib.rs
  • crates/test-helpers/src/bin/fake_encrypt.rs
  • crates/bfv-helpers/src/client.rs
📚 Learning: 2024-10-03T23:02:41.732Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 133
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:137-139
Timestamp: 2024-10-03T23:02:41.732Z
Learning: In `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs`, using the same RNG instance `rng_test` for generating multiple key shares without advancing its state is acceptable.

Applied to files:

  • templates/default/program/src/lib.rs
  • crates/test-helpers/src/bin/fake_encrypt.rs
  • crates/bfv-helpers/src/client.rs
  • crates/test-helpers/src/lib.rs
  • crates/bfv-helpers/src/lib.rs
📚 Learning: 2024-09-26T03:11:29.311Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 107
File: packages/ciphernode/sortition/src/distance.rs:1-1
Timestamp: 2024-09-26T03:11:29.311Z
Learning: In `packages/ciphernode/core/src/events.rs`, the import statements use the correct and updated `alloy::primitives` module.

Applied to files:

  • crates/test-helpers/src/bin/fake_encrypt.rs
  • examples/CRISP/server/src/cli/commands.rs
  • crates/test-helpers/src/lib.rs
📚 Learning: 2024-10-23T02:03:02.008Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 156
File: packages/ciphernode/keyshare/src/encryption.rs:45-45
Timestamp: 2024-10-23T02:03:02.008Z
Learning: In the `packages/ciphernode/keyshare/src/encryption.rs` file, the environment variable `CIPHERNODE_SECRET` is used for the encryption password. A secure secret management solution is not currently available, but may be considered in future iterations.

Applied to files:

  • crates/test-helpers/src/bin/fake_encrypt.rs
📚 Learning: 2024-11-05T06:48:58.177Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 173
File: packages/ciphernode/config/src/app_config.rs:13-21
Timestamp: 2024-11-05T06:48:58.177Z
Learning: In the `packages/ciphernode/config/src/app_config.rs` file, for the `Contract` enum, the team prefers to use `String` type for `address` fields, relying on parsing to handle validation, instead of using the `Address` type.

Applied to files:

  • examples/CRISP/server/src/cli/commands.rs
📚 Learning: 2025-09-19T11:16:53.825Z
Learnt from: cedoor
Repo: gnosisguild/enclave PR: 752
File: packages/enclave-contracts/contracts/Enclave.sol:15-17
Timestamp: 2025-09-19T11:16:53.825Z
Learning: The Enclave contract in the gnosisguild/enclave repository has not been deployed yet as of September 2025, so storage layout considerations for upgradeable contracts don't apply to current changes.

Applied to files:

  • crates/bfv-helpers/src/lib.rs
🧬 Code graph analysis (6)
templates/default/program/src/lib.rs (1)
crates/bfv-helpers/src/lib.rs (2)
  • build_bfv_params_from_set_arc (111-118)
  • encode_bfv_params (219-233)
crates/test-helpers/src/bin/fake_encrypt.rs (1)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_from_set_arc (111-118)
examples/CRISP/server/src/cli/commands.rs (1)
crates/bfv-helpers/src/lib.rs (2)
  • build_bfv_params_from_set_arc (111-118)
  • encode_bfv_params (219-233)
crates/bfv-helpers/src/client.rs (1)
crates/bfv-helpers/src/lib.rs (2)
  • build_bfv_params_arc (183-205)
  • build_bfv_params_from_set_arc (111-118)
crates/test-helpers/src/lib.rs (1)
crates/trbfv/src/trbfv_config.rs (1)
  • params (34-36)
crates/bfv-helpers/src/lib.rs (2)
crates/trbfv/src/trbfv_config.rs (1)
  • params (34-36)
templates/default/program/src/lib.rs (1)
  • test (39-73)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: test_net
  • GitHub Check: build_enclave_cli
  • GitHub Check: test_contracts
  • GitHub Check: build_sdk
  • GitHub Check: integration_prebuild
  • GitHub Check: rust_unit
  • GitHub Check: rust_integration
  • GitHub Check: Build & Push Image
  • GitHub Check: Build & Push Image
🔇 Additional comments (13)
examples/CRISP/server/src/cli/commands.rs (1)

19-21: LGTM! Clean API simplification.

The migration from tuple-based parameters to the structured BfvParamSet approach is well-executed. The code is now more maintainable and type-safe.

Also applies to: 322-322

crates/bfv-helpers/src/lib.rs (6)

62-76: Excellent design choice for parameter set abstraction.

The BfvParamSet struct provides a much cleaner and type-safe alternative to tuple-based parameter passing. The optional error2_variance field with documented default behavior is well thought out.


140-162: Optional parameter handling is correct.

The implementation correctly defaults error2_variance to the builder's default (10) when None is provided, maintaining backward compatibility while supporting explicit TRBFV requirements.

Also applies to: 183-205


219-233: String encoding for error2_variance is appropriate.

Encoding error2_variance as a DynSolValue::String is the correct approach for handling large BigUint values that may exceed U256 bounds in TRBFV scenarios.


297-310: Error handling for error2_variance is consistent.

The decode path correctly propagates errors from set_error2_variance_str and maintains consistency with the encoding side.


374-419: Comprehensive test coverage for TRBFV.

The tests validate both the basic parameter construction and the encoding/decoding roundtrip for TRBFV parameters with explicit error2_variance. This ensures the large variance value is correctly preserved through serialization.

Also applies to: 470-494


16-60: Verify TRBFV error2_variance for SET_8192_1000_4

crates/bfv-helpers/src/lib.rs defines params::SET_8192_1000_4 with error2_variance = "52309181128222339698631578526730685514457152477762943514050560000" (also used in tests), but I found no derivation/citation/tests in the repo proving this achieves the claimed "128bits security". Provide a documented derivation or reputable reference and add a short note/test showing the security/noise analysis; otherwise remove or demote the "PRODUCTION READY / 128bits security" claim.

templates/default/program/src/lib.rs (1)

29-31: LGTM! Template correctly updated.

The test template now uses the simplified parameter set API, providing a better example for developers.

Also applies to: 42-42

crates/test-helpers/src/bin/fake_encrypt.rs (1)

9-9: LGTM! Test helper updated correctly.

The migration to the structured parameter set improves code clarity in this test utility.

Also applies to: 37-38

crates/bfv-helpers/src/client.rs (3)

43-43: Backward compatibility maintained.

Passing None for error2_variance ensures existing BFV encryption workflows continue to use the default variance of 10 without breaking changes.

Also applies to: 94-94


97-97: Minor formatting improvement.

The error message formatting is now consistent (space after colon), improving readability.


134-243: Tests updated to use parameter sets.

The test refactoring correctly extracts individual fields from the BfvParamSet while using the new helper functions for parameter construction.

crates/test-helpers/src/lib.rs (1)

22-22: Excellent refactoring from tuple to structured type.

Replacing the tuple-based parameter passing with BfvParamSet significantly improves type safety and code maintainability. The default fallback to SET_2048_1032193_1 is appropriate for test scenarios.

Also applies to: 72-93


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 commented Nov 1, 2025

Copy link
Copy Markdown
Contributor Author

ah maybe is failing because I need to update the encoded values for the BFV parameter set. I will work on this on Monday! BTW, @ryardley feel free to start getting a look around if you like the approach / design.

@0xjei 0xjei requested a review from ryardley November 1, 2025 15:43

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/bfv-helpers/src/lib.rs (1)

191-249: Decoding breaks pre-upgrade payloads.

tuple_type now hard-requires the error2_variance string, so any BFV params encoded before this PR (only three fields) will panic at decode. We need a backward-compatible branch (e.g., try 3-field decode first, default variance to “10”) or a versioned payload so existing snapshots/chain data don’t brick.

🧹 Nitpick comments (1)
crates/bfv-helpers/src/lib.rs (1)

35-55: Clarify tuple shapes for the new presets.

SET_2048_1032193_1 omits error2_variance while SET_8192_1000_4 includes it. The mixed tuple arities make it easy to misuse these constants. Please either supply both variances (e.g., (usize, u64, [u64; N], &str) for every preset) or expose helper accessors so downstream code can’t accidentally ignore error2_variance for TRBFV.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c478909 and 67f748f.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • examples/CRISP/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • crates/bfv-helpers/Cargo.toml (1 hunks)
  • crates/bfv-helpers/src/client.rs (6 hunks)
  • crates/bfv-helpers/src/lib.rs (16 hunks)
  • crates/fhe/src/fhe.rs (1 hunks)
  • crates/fhe/src/utils.rs (1 hunks)
  • crates/test-helpers/src/bin/fake_encrypt.rs (1 hunks)
  • crates/test-helpers/src/bin/pack_e3_params.rs (1 hunks)
  • crates/tests/tests/integration.rs (1 hunks)
  • crates/trbfv/tests/integration.rs (1 hunks)
  • examples/CRISP/server/src/cli/commands.rs (1 hunks)
  • examples/CRISP/server/src/server/routes/rounds.rs (1 hunks)
  • packages/enclave-sdk/src/utils.ts (4 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: 0xjei
Repo: gnosisguild/enclave PR: 388
File: packages/commons/src/bfv/mod.rs:38-48
Timestamp: 2025-05-07T15:18:20.056Z
Learning: The `build_bfv_params` and related functions in the commons BFV utilities intentionally use panic for error handling as a temporary solution. The team plans to refactor these to use proper Result-based error handling in the future.
📚 Learning: 2025-05-07T15:18:20.056Z
Learnt from: 0xjei
Repo: gnosisguild/enclave PR: 388
File: packages/commons/src/bfv/mod.rs:38-48
Timestamp: 2025-05-07T15:18:20.056Z
Learning: The `build_bfv_params` and related functions in the commons BFV utilities intentionally use panic for error handling as a temporary solution. The team plans to refactor these to use proper Result-based error handling in the future.

Applied to files:

  • crates/fhe/src/utils.rs
  • crates/tests/tests/integration.rs
  • crates/test-helpers/src/bin/pack_e3_params.rs
  • examples/CRISP/server/src/cli/commands.rs
  • crates/bfv-helpers/src/lib.rs
  • crates/test-helpers/src/bin/fake_encrypt.rs
  • crates/bfv-helpers/src/client.rs
📚 Learning: 2024-10-08T01:48:49.778Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 139
File: packages/ciphernode/aggregator/src/publickey_aggregator.rs:46-46
Timestamp: 2024-10-08T01:48:49.778Z
Learning: In `packages/ciphernode/router/src/hooks.rs`, the `src_chain_id` parameter in `PublicKeyAggregator::new` is correctly handled, even if not explicitly provided during instantiation.

Applied to files:

  • examples/CRISP/server/src/server/routes/rounds.rs
📚 Learning: 2025-08-25T10:28:56.174Z
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 657
File: Cargo.toml:32-34
Timestamp: 2025-08-25T10:28:56.174Z
Learning: The examples/CRISP directory has its own Cargo.toml workspace configuration with members like "server", "wasm-crypto", "program/core", "program/client", etc. The root workspace intentionally excludes "examples/CRISP/server", "examples/CRISP/program", and "examples/CRISP/wasm-crypto" to prevent double workspace membership, which is the correct approach for self-contained example workspaces.

Applied to files:

  • crates/bfv-helpers/Cargo.toml
📚 Learning: 2024-10-22T02:10:34.864Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 145
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:82-83
Timestamp: 2024-10-22T02:10:34.864Z
Learning: In the file `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs`, when reviewing test functions like `generate_pk_share`, minor performance optimizations (e.g., minimizing mutex locks) are not a priority.

Applied to files:

  • crates/bfv-helpers/src/lib.rs
  • crates/test-helpers/src/bin/fake_encrypt.rs
📚 Learning: 2024-10-03T23:02:41.732Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 133
File: packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs:137-139
Timestamp: 2024-10-03T23:02:41.732Z
Learning: In `packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs`, using the same RNG instance `rng_test` for generating multiple key shares without advancing its state is acceptable.

Applied to files:

  • crates/bfv-helpers/src/lib.rs
🧬 Code graph analysis (10)
crates/fhe/src/utils.rs (1)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_arc (121-143)
crates/tests/tests/integration.rs (1)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_arc (121-143)
crates/trbfv/tests/integration.rs (1)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_arc (121-143)
crates/fhe/src/fhe.rs (1)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_arc (121-143)
crates/test-helpers/src/bin/pack_e3_params.rs (2)
crates/test-helpers/src/bin/fake_encrypt.rs (1)
  • main (29-52)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_arc (121-143)
examples/CRISP/server/src/server/routes/rounds.rs (1)
crates/bfv-helpers/src/lib.rs (2)
  • encode_bfv_params (157-171)
  • build_bfv_params_arc (121-143)
examples/CRISP/server/src/cli/commands.rs (1)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_arc (121-143)
crates/bfv-helpers/src/lib.rs (2)
crates/trbfv/src/trbfv_config.rs (1)
  • params (34-36)
templates/default/program/src/lib.rs (1)
  • test (37-72)
crates/test-helpers/src/bin/fake_encrypt.rs (1)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_arc (121-143)
crates/bfv-helpers/src/client.rs (2)
crates/trbfv/src/trbfv_config.rs (1)
  • params (34-36)
crates/bfv-helpers/src/lib.rs (1)
  • build_bfv_params_arc (121-143)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: crisp_e2e
🔇 Additional comments (1)
packages/enclave-sdk/src/utils.ts (1)

96-123: The review concern about contract decoders is incorrect; remove it.

The contract stores e3ProgramParams as opaque bytes and does not decode or validate the tuple structure. The struct E3RequestParams defines it as bytes, and the contract passes it through without interpretation. This means the change from 3-field to 4-field encoding in the SDK is transparent to on-chain logic and will not cause silent parsing failures.

The backend (Rust crates/bfv-helpers) already expects a 4-field tuple with error2_variance, so the SDK change correctly aligns with that expectation. The contract test scripts that still encode 3 fields are separate test setup code and do not indicate a real incompatibility.

No action is required from the developer regarding on-chain decoder synchronization—the concern does not apply here.

Likely an incorrect or invalid review comment.

@0xjei

0xjei commented Nov 3, 2025

Copy link
Copy Markdown
Contributor Author

@ryardley ready!

ryardley
ryardley previously approved these changes Nov 4, 2025

@ryardley ryardley 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.

🎸

Comment thread crates/bfv-helpers/src/lib.rs Outdated
@0xjei 0xjei mentioned this pull request Nov 4, 2025
@vercel vercel Bot temporarily deployed to Preview – crisp November 5, 2025 16:53 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 5, 2025 16:53 Inactive

@ryardley ryardley 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.

🎸 👨🏾‍🎤 🎸

@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 5, 2025 18:17 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp November 5, 2025 18:17 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 6, 2025 00:36 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp November 6, 2025 00:36 Inactive
@ryardley ryardley enabled auto-merge (squash) November 6, 2025 00:38
@ryardley ryardley merged commit bdc1adf into dev Nov 6, 2025
32 of 46 checks passed
@github-actions github-actions Bot deleted the params/128b-sets branch November 13, 2025 03:21
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