Repository navigation
Conversation
`OnGetData()` in `server.go` increases the ban score based in the inv vector count of the received getdata message. When performing IBD between two btcd nodes, the previous block request limit caused the node performing IBD to be banned. Limiting the amount of requested blocks to 505 causes the ban score to not be increased, this way we avoid the ban.
The function extraction makes testing easier, as we have less state to deal with in the tests.
Contributor
Author
|
@kcalvinalvin can you take a look? |
This commit implements TestGetDataAddBanScore, which asserts the behavior of getDataAddBanScore based on the getdata inv vector count and message count.
allocz
force-pushed
the
2026-11-03-fix-ibd-ban
branch
from
November 5, 2026 16:32
2b9642c to
1bb1197
Compare
Roasbeef
approved these changes
Nov 6, 2026
Roasbeef
left a comment
Member
There was a problem hiding this comment.
LGTM. The 505-block cap keeps the getdata ban-score increment at zero, and the global/per-peer in-flight tracking and refill paths still account for the requested blocks.
Validated with go test ./netsync and go test . at this head. I didn't run an end-to-end IBD sync.
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.
Change Description
OnGetData()inserver.goincreases the ban score based in the invvector count of the received getdata message. When performing IBD
between two btcd nodes, the previous block request limit caused the node
performing IBD to be banned.
Limiting the amount of requested blocks to 505 causes the ban score to
not be increased, this way we avoid the ban.
Fixes #2626
Steps to Test
As described in the issue #2626
Pull Request Checklist
Testing
Code Style and Documentation
📝 Please see our Contribution Guidelines for further guidance.