mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
SubmitDecryptionShare stored the share in a map keyed by partyID, which dedups, but incremented a separate ShareCount on every call and compared THAT to the threshold. One party calling three times on a 3-of-5 session drove ShareCount to 3 and flipped the session to StatusProcessing, so a single share holder satisfied the quorum and the value t-of-n exists to protect was released to it. Proven: three calls from partyID 1 left ShareCount == 3. The share set is now the only source of truth — ShareCount is len(Shares) — and a repeat submission from a party that already contributed is refused outright. The sibling implementations in mpcvm/fhe already dedup before counting. Tests: TestOnePartyCannotReachDecryptionThreshold, TestDistinctPartiesReachDecryptionThreshold. Co-authored-by: Hanzo Dev <[email protected]>