fix(service): deal from the finalize-time sealed share to prevent polynomial divergence#89
Conversation
…ynomial divergence Resharing dealers recomputed their fromRound DistKeyShare live at deal time, but kyber interpolates the first oldT QUAL members at call time, so a QUAL that filled up after finalization yielded a share on a different polynomial than the coeffs already submitted on-chain, and every verifier complained. loadFromRoundShare now deals from the share sealed at finalization (cache -> sealed store -> live recomputation fallback), and FinalizeDKG snapshots that share only after the finalization-stage wait so the QUAL is fuller before it is sealed.
|
Verified the deal-from-sealed behavior holds (across ~86 reshares the recompute-fallback warning never fired, and replacing the sealed share is what causes divergence — proving dealing sources from the sealed store, not a live recompute). One security issue and two smaller items surfaced: The seal isn't bound to its storage slot.
Minor: the cache-hit and sealed-hit paths ( |
|
The core fix is sound: Coverage note: review covers all three changed files in full. Review iteration 1 · Commit a0897f5 · 2026-07-21T10:06:26Z |
Problem
kyber's resharing
DistKeyShare()interpolates the firstoldThresholdmembers of the QUAL at call time — any subset recovers the same secret (GPK) but a different polynomial. The share was computed at two different instants: at finalize (QUAL still draining) the coeffs went on-chain and were sealed; at the next round's deal generationbuildResharingPrevDKGrecomputedDistKeyShare()on the live instance whose QUAL had since filled up, landing on a different polynomial. Every verifier then correctly complained → the round froze permanently.Fix
loadFromRoundShareresolves cache → sealed store → (fallback only) live recomputation with a Warn, and is used by bothbuildResharingPrevDKGandrebuildResharingPrevDKG. On-chain coeffs, the sealed share, dealing, and partial decryption now all originate from the one finalize-time computation.waitForFinalizationRegistrations, soDistKeyShare()interpolates over a fuller QUAL.Tests
TestGetResharingPrevDKG_PrefersSealedFinalizeShareissue: #86