From 976e039e3760b6d808de49327cbc3ea264004120 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Mon, 14 Apr 2025 10:38:38 +0200 Subject: [PATCH] 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 --- eth/dropper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/dropper.go b/eth/dropper.go index 3b7d9d1afa..30fdcaaaac 100644 --- a/eth/dropper.go +++ b/eth/dropper.go @@ -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.