chore(coprocessor): upgrade tfhe-rs to 1.6.0 with dedicated OPRF key#2353
chore(coprocessor): upgrade tfhe-rs to 1.6.0 with dedicated OPRF key#2353
Conversation
83302d0 to
79e69ec
Compare
Coprocessor Changed Lines CoverageCoverage of added/modified lines in Per-file breakdownDiff CoverageDiff: origin/main...HEAD, staged and unstaged changes
Summary
coprocessor/fhevm-engine/fhevm-engine-common/src/keys.rscoprocessor/fhevm-engine/gw-listener/src/sks_key.rscoprocessor/fhevm-engine/tfhe-worker/src/bin/utils.rs |
| /// produces the same plaintext for all seeds with a given key. | ||
| #[tokio::test] | ||
| #[serial(db)] | ||
| async fn test_fhe_random_bounded() -> Result<(), Box<dyn std::error::Error>> { |
There was a problem hiding this comment.
In my understanding the OprfServerKey introduced in 1.6.0 is a different key from the PBS bootstrapping key, so it produces different outputs for the same seeds. With upper_bound=4 for FheUint4 there are only 4 possible values, and seeds 1 and 7 both happened to map to 0 with the new key.
The fix here use seeds 0 and 42 (proven to differ in test_fhe_random_basic) and set the type 1 bound to 16 (full FheUint4 range) so the bounded path generates the same 4 random bits as the unbounded path.
Hopefully this is correct rationale for the reason that this test was failing after the upgrade.
4bb3873 to
9b4069a
Compare
PanGan21
left a comment
There was a problem hiding this comment.
[AUTOMATED]
Code Review
No blocking issues found. Checked for bugs, guideline compliance, and error handling.
What was reviewed:
- Correctness of
oprf_keythreading through all threeServerKey::into_raw_parts()/from_raw_parts()call sites (keys.rs,gw-listener/sks_key.rs,tfhe-worker/utils.rs) — all consistent ✓ use_dedicated_oprf_key(true)placement in the key generation config — correct ✓- Test changes in
random.rs: seed[0; 16]is a valid PRF input with no degenerate behavior; bound=16 forFheUint4avoids the small-range collision documented in the inline comment ✓ - The removed misleading comment
// rerandomisation keyswitching key excludedwas factually wrong (the key IS included) — removing it is a fix ✓ - Version mismatch between coprocessor (1.6.0) and kms-connector/sdk (1.5.1) is acknowledged in the PR; tfhe-rs handles it gracefully via backward-compatibility version upgrading (
oprf_key: Nonefor old keys, falling back to PBS key for fheRand) ✓
One informational note (non-blocking): The dedicated OPRF key security isolation only takes effect for keys freshly generated with the new 1.6.0 config. Keys deserialized from pre-1.6.0 format will transparently fall back to using the bootstrapping key for fheRand — correct behavior but worth confirming in the rollout plan that key regeneration is part of the deployment.
Summary
tfhe1.5.4→1.6.0,tfhe-versionable0.6.2→0.7.0, andtfhe-zk-pok0.8.0→0.8.1in the coprocessor workspace.use_dedicated_oprf_key(true)) in the key generation config and propagates it through all server key derivation paths, so that fheRand uses a key isolated from the compute bootstrapping key.Note
kms-connectorandsdk/rust-sdkare not upgraded and remain ontfhe = "=1.5.1". Upgrading those two workspaces requires a KMS release that supports tfhe 1.6.0.