Skip to content

fix(dkg): verify deal signature before marking a dealer dealt#856

Merged
0xHansLee merged 1 commit into
dkg/devfrom
fix-verify-deal-signature-in-mark-dealt
Jul 23, 2026
Merged

fix(dkg): verify deal signature before marking a dealer dealt#856
0xHansLee merged 1 commit into
dkg/devfrom
fix-verify-deal-signature-in-mark-dealt

Conversation

@0xHansLee

Copy link
Copy Markdown
Contributor

Problem

markDealersDealt recorded a dealer as having dealt based only on a bounds check of deal.Index. A forged deal carrying another dealer's index would mark that dealer dealt, shielding a genuinely-missing dealer from invalidateMissingDealers.

Fix

Verify each deal's Schnorr signature against the dealer's registered DkgPubKey before recording it. The signed message matches kyber Deal.MarshalBinary (little-endian uint32 index followed by the cipher). Verification is deterministic pure compute over consensus-shared state (block deals + on-chain pubkeys), runs on all nodes under the existing isV190Round gate, and adds no new KV reads — so GasUsed and the resulting DealtDealers set stay identical across nodes.

Tests

  • TestMarkDealersDealt_VerifiesSignature (valid / forged-key / unsigned)

issue: none

markDealersDealt recorded DealtDealers for a dealer based only on a bounds
check of deal.Index. Deals come from vote extensions and are unauthenticated,
so a Byzantine validator could broadcast a forged deal carrying any dealer's
index and shield a genuinely-missing dealer from invalidateMissingDealers.

Verify each deal's Schnorr signature against the dealer's registered dkgPubKey
before recording it. The signed message matches kyber dkg.Deal.MarshalBinary
(little-endian uint32 Index followed by the EncryptedDeal cipher); invalid
signatures are skipped. Verification is deterministic, so all nodes agree in
the FinalizeBlock path.
@0xHansLee 0xHansLee self-assigned this Jul 22, 2026
@0xHansLee
0xHansLee merged commit 28c6fa8 into dkg/dev Jul 23, 2026
6 checks passed
@0xHansLee
0xHansLee deleted the fix-verify-deal-signature-in-mark-dealt branch July 23, 2026 06:57
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