Problem
In crates/keyshare/src/threshold_keyshare.rs at line 802, the code currently hardcodes CiphernodesCommitteeSize::Small when building PK generation proof requests. This is a ticking time bomb for the following reasons:
-
Runtime panics: CiphernodesCommitteeSize::Medium and CiphernodesCommitteeSize::Large both call unreachable!() in their values() method implementation, which will panic at runtime.
-
Verification failures: Once the aggregator starts verifying proofs, any mismatch between the actual committee size and the hardcoded Small (n=5, h=5, threshold=2) will cause verification failures, as the circuit parameters for PK generation must match the real committee size.
Task
Replace the hardcoded CiphernodesCommitteeSize::Small literal by deriving the CiphernodesCommitteeSize from the actual committee/aggregator configuration:
- Read the committee size or member count used by the aggregator/Committee struct
- Map it to the appropriate
CiphernodesCommitteeSize variant
- Use that derived value wherever
CiphernodesCommitteeSize::Small appears in threshold_keyshare.rs
This will ensure circuit parameters for PK generation match the real committee size and avoid verification mismatches.
Context
Problem
In
crates/keyshare/src/threshold_keyshare.rsat line 802, the code currently hardcodesCiphernodesCommitteeSize::Smallwhen building PK generation proof requests. This is a ticking time bomb for the following reasons:Runtime panics:
CiphernodesCommitteeSize::MediumandCiphernodesCommitteeSize::Largeboth callunreachable!()in theirvalues()method implementation, which will panic at runtime.Verification failures: Once the aggregator starts verifying proofs, any mismatch between the actual committee size and the hardcoded Small (n=5, h=5, threshold=2) will cause verification failures, as the circuit parameters for PK generation must match the real committee size.
Task
Replace the hardcoded
CiphernodesCommitteeSize::Smallliteral by deriving theCiphernodesCommitteeSizefrom the actual committee/aggregator configuration:CiphernodesCommitteeSizevariantCiphernodesCommitteeSize::Smallappears in threshold_keyshare.rsThis will ensure circuit parameters for PK generation match the real committee size and avoid verification mismatches.
Context