set doNotDropBefore to 10 minutes

The protection period is meant for peers to have time to start
contribution, but at the moment we have no logic related to
"start contribute", so the number is a bit arbitrary.

The logic in setting this based on the drop interval is from the other
side of things: for not protecting a new node too long. What I wanted
to avoid is protecting a node for too long, while the whole old
peerset can be changed. Actually, for this it would be better to
use peerDropIntervalMin ....

Let's make it independent for now, then we can consider again later.
I would like this number to be bigger than the time a the dropped
peer needs to find a replacement. 10min sounds safe to start with,
then we can checked the effect when it is rolled out, and adjust.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2025-04-14 10:38:38 +02:00
parent 2a9372ea5f
commit 976e039e37
No known key found for this signature in database
GPG key ID: 0FE274EE8C95166E

View file

@ -35,7 +35,7 @@ const (
// Interval between peer drop events (uniform between min and max)
peerDropIntervalMax = 7 * time.Minute
// Avoid dropping peers for some time after connection
doNotDropBefore = 2 * peerDropIntervalMax
doNotDropBefore = 10 * time.Minute
// How close to max should we initiate the drop timer. O should be fine,
// dropping when no more peers can be added. Larger numbers result in more
// aggressive drop behavior.