fix(dkg): verify deal signature before marking a dealer dealt#856
Merged
Conversation
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
requested review from
jdubpark,
lucas2brh and
stevemilk
as code owners
July 21, 2026 05:19
stevemilk
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
markDealersDealtrecorded a dealer as having dealt based only on a bounds check ofdeal.Index. A forged deal carrying another dealer's index would mark that dealer dealt, shielding a genuinely-missing dealer frominvalidateMissingDealers.Fix
Verify each deal's Schnorr signature against the dealer's registered
DkgPubKeybefore recording it. The signed message matches kyberDeal.MarshalBinary(little-endianuint32index followed by the cipher). Verification is deterministic pure compute over consensus-shared state (block deals + on-chain pubkeys), runs on all nodes under the existingisV190Roundgate, and adds no new KV reads — soGasUsedand the resultingDealtDealersset stay identical across nodes.Tests
TestMarkDealersDealt_VerifiesSignature(valid / forged-key / unsigned)issue: none