Repository navigation
Fix four cases where bad network data could stop a node (#311) - #311
Merged
minuszka merged 2 commits intoOct 19, 2026
Merged
Conversation
Backport four upstream fixes for inputs that could stop the node instead of being rejected: - net: a partially downloaded compact block that a failed reconstruction already used is refused instead of reaching an assert, and PartiallyDownloadedBlock returns an error instead of asserting (bitcoin#26898, bitcoin#33296, via dash#7398). - llmq: DKG contributions, complaints and justifications with an invalid signature are rejected before batch verification, and the batch verifier never aggregates an invalid signature (the remaining part of dash 31142da9). - bls: AsyncVerifyContributionShare() treats a missing verification vector as a failed check (dash 1132a25b). - llmq: a justification naming the member index one past the end is rejected; member lookups by index go through GetMemberAtIndex() (dash 590236a2). Tests: unit regressions for each fix. The compact block cases live in a new blockencodings_fill_tests suite because CI excludes blockencodings_tests. Also copy the LLMQ params by value in llmq_quorum_base_tests, which kept a reference to a temporary.
Wait for each surviving node's current-epoch announcements and complete verdict before entering the signing window. Keep mocktime moving while waiting for signature recovery at a fixed height so share requests, connection retries and recovery backoff can progress. Keep the timeout and the mined-commitment and shadow-state assertions.
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.
Issue being fixed or feature implemented
Upstream Dash fixed several cases where malformed input could stop a node instead of being rejected. Four of them were still missing from this branch: one in compact block relay and three in the LLMQ/DKG code. This backports them. The related fixes from Dash v23.1.8 are already here (#310).
What was done?
net: in theBLOCKTXNhandler, a partially downloaded block whose header a previousFillBlock()already cleared is refused (the request is removed and the peer scored) instead of being reconstructed again.PartiallyDownloadedBlock::InitData(),IsTxAvailable()andFillBlock()return an error instead of asserting. These are the bitcoin#26898 and bitcoin#33296 parts of backport: compact block relay hardening (bitcoin#26898, #27626, #27743, #26969, #29412, #32646, #33296) dashpay/dash#7398; the rest of #7398 (parallel compact block downloads and related refactoring) is not part of this PR.llmq:PreVerifyMessage()rejects DKG contributions, complaints and justifications whose signature is not a valid BLS object, andBatchVerifyMessageSigs()never aggregates an invalid signature. This is the remaining part of dashpay/dash@31142da9; its intake checks are already in this branch.bls:AsyncVerifyContributionShare()treats a null verification vector as a failed check, like the plural variant (dashpay/dash@1132a25b).llmq: a justification naming member indexmembers.size()is rejected; index lookups go through the newGetMemberAtIndex()(dashpay/dash@590236a2).blockencodings_fill_tests: a second fill of the same partial block, and a secondInitData(). They are not inblockencodings_testsbecause CI excludes that suite for unrelated failures.bls_tests: the upstream case for the null verification vector.evo_dip3_activation_tests:dkg_justification_index_boundregisters masternodes, builds a DKG session and checks that the last member index is accepted andmembers.size()and beyond are rejected.llmq_quorum_base_tests: copy the LLMQ params by value; the test kept a reference to a temporary.Not ported: the upstream functional case for compact blocks (
p2p_compactblocks.py). That test does not run on this branch at all yet: the Python test framework does not decode thevchBlockSigfield of this fork'scmpctblockmessage.How Has This Been Tested?
blockencodings.cpp, an invalid memory access in the BLS case, and the index case acceptsmembers.size()). With the changes, they pass, as do the 13 affected unit suites,feature_llmq_dkgerrors.pyandp2p_llmq_signing_vectors.py.feature_llmq_dkgerrors.pyandp2p_llmq_signing_vectors.pyon both transports, and the two helper regression steps.Breaking Changes
None. Honest peers and valid messages are handled as before; the new checks only reject inputs that previously stopped the process. Consensus rules, RPC, wallet, wire and data formats are unchanged.
Checklist: