[DoS] invalid peer block no longer wedges the net task#102
Open
1440000bytes wants to merge 2 commits into
Open
[DoS] invalid peer block no longer wedges the net task#1021440000bytes wants to merge 2 commits into
1440000bytes wants to merge 2 commits into
Conversation
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.
A single block from a peer that fails consensus validation permanently kills the net task, taking the node's networking fully offline.
In the
NewTipReadyhandler,reorg_to_tip(...)?propagates any error out ofrun():run()'s caller only logs the error and lets the task end:So when a peer sends a block whose body fails state validation — e.g. a transaction with
value out > value in, surfacing asstate error: value in is less than value out(NotEnoughValueIn, raised invalidate_filled_transactionviaprevalidate), the whole net task dies. After that nothing services peer connections, producing an endless stream ofFailed to send peer connection infoandFailed to send response info. The offending peer isn't even dropped (addris discarded).This means any peer can permanently disable a node's networking with one invalid block (remote DoS), and any genuine consensus disagreement bricks the node instead of just rejecting that chain.