Skip to content
Commit 9795d946 authored by Aaro Altonen's avatar Aaro Altonen Committed by GitHub
Browse files

Make peer evictions less aggressive (#14619)



* Make peer evictions less aggressive

The original implementation of peer eviction prioritized aliveness over
connection stability which made the peer count unstable for some users.

As this may cause discomfort or infrastructure alerts if stability is
tracked, adjust the eviction to be less aggressive by only evicting
peers when the node has fully stalled. This causes the node to have some
peers who are inactive and won't send any block announcements.
These nodes are removed if the local node is able to receive at least
one block announcement from one of its peers as the inactivity of the
substream is detected when a notification is sent.

If the node won't send or receive any block annoucements for 30 seconds,
it's considered stalled and it will evict all peers,
causing `ProtocolController` to accept and establish connections from new
peers.

* Update client/network/sync/src/engine.rs

Co-authored-by: default avatarDmitry Markin <[email protected]>

* Track last send and received notification simultaneously

---------

Co-authored-by: default avatarDmitry Markin <[email protected]>
Co-authored-by: parity-processbot <>
parent 9a4e66c8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment