mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
The dropper periodically disconnects random peers to create churn. This was blind to peer quality. Add inclusion-based peer protection using two categories: 1. Total inclusions: protects peers with the highest cumulative count of delivered txs that were included on chain 2. Recent inclusions (EMA): protects peers with the best recent inclusion rate, giving newly productive peers faster protection Each category independently protects the top 10% of inbound and top 10% of dialed peers. The union of both sets is protected. Only peers with positive scores qualify. The dropper defines its own PeerInclusionStats struct and callback type (getPeerInclusionStatsFunc) so any stats provider (e.g. a transaction tracker) can plug in without a package dependency. The callback is nil by default (protection disabled until wired). The protectionCategories slice is designed for easy extension — adding a new category requires only appending a struct with a name, scoring function, and protection fraction. |
||
|---|---|---|
| .. | ||
| catalyst | ||
| downloader | ||
| ethconfig | ||
| fetcher | ||
| filters | ||
| gasestimator | ||
| gasprice | ||
| protocols | ||
| syncer | ||
| tracers | ||
| api_admin.go | ||
| api_backend.go | ||
| api_backend_test.go | ||
| api_debug.go | ||
| api_debug_test.go | ||
| api_miner.go | ||
| backend.go | ||
| dropper.go | ||
| handler.go | ||
| handler_eth.go | ||
| handler_eth_test.go | ||
| handler_snap.go | ||
| handler_test.go | ||
| peer.go | ||
| peerset.go | ||
| state_accessor.go | ||
| sync.go | ||
| sync_test.go | ||