Page MenuHomePhabricator

Replace automatic bans with discouragement filter
ClosedPublic

Authored by jasonbcox on Jun 10 2020, 17:18.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABCc5c01c8243f5: Replace automatic bans with discouragement filter
Summary

This patch improves performance and resource usage around IP
addresses that are banned for misbehavior. They're already not
actually banned, as connections from them are still allowed,
but they are preferred for eviction if the inbound connection
slots are full.

Stop treating these like manually banned IP ranges, and instead
just keep them in a rolling Bloom filter of misbehaving nodes,
which isn't persisted to disk or exposed through the ban
framework. The effect remains the same: preferred for eviction,
avoided for outgoing connections, and not relayed to other peers.

Also change the name of this mechanism to better reflect reality;
they're not banned, just discouraged.

Contains release notes and several interface improvements by
John Newbery.

Partial backport of Core PR19219
https://github.com/bitcoin/bitcoin/pull/19219/commits/b6a3448435678b945a89275993c3f51c7215ec09

Test Plan

ninja check check-functional

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

jasonbcox edited the summary of this revision. (Show Details)

The original PR was refactored and split into two commits.
I've cut this diff down to just the first commit, as it
contains the behavior change and is easier to review alone.

deadalnix requested changes to this revision.Jun 11 2020, 17:34
deadalnix added a subscriber: deadalnix.

There are instances where we ban, such as the use of the wrong net magic, that also need to be modified.

This revision now requires changes to proceed.Jun 11 2020, 17:34
This revision is now accepted and ready to land.Jun 11 2020, 21:30