Passer au contenu

Bitcoin accepté au paiement  |  Expédié depuis Laval, QC, Canada  |  Soutien expert depuis 2016

Peer Eviction Logic

Network & Protocol

Definition

Peer eviction logic is the routine inside Bitcoin Core, implemented as AttemptToEvictConnection(), that decides which existing inbound peer to drop when the node has filled all of its inbound connection slots and a new peer wants in. By default a node accepts up to 125 connections; with eleven reserved for outbound use, roughly 114 inbound slots can fill up, and once they do the node must make room intelligently rather than simply refusing all newcomers.

Protecting the honest minority

The function is written with extreme care to avoid handing an attacker an easy path to network partitioning. Instead of evicting at random, it first protects a small number of peers across several distinct, hard-to-forge characteristics: peers with the lowest ping (network proximity), the longest connection time (loyalty), peers grouped by network range (netgroup diversity), and peers that have recently relayed valid blocks or transactions. Whatever remains after these protections is the candidate pool for eviction, and the youngest of those is dropped.

Why it resists abuse

Connection slots are a finite resource, so an attacker who could reliably force eviction of honest peers could slowly squeeze a victim toward isolation. By anchoring protection to qualities that cost real money or real time to fake, such as low latency from many networks sustained over long periods, the eviction logic makes that squeeze impractical. The mechanism was originally added as a denial-of-service mitigation.

This logic complements outbound defenses. See the outbound connection slots entry and the broader topic of eclipse-attack resistance.

In Simple Terms

Peer eviction logic is the routine inside Bitcoin Core, implemented as AttemptToEvictConnection(), that decides which existing inbound peer to drop when the node has filled…

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Glossaire du minage

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Comparer les mineurs