avoid resetting chain stall detection on lag spike (#6115)

During lag spike, e.g., from state replays, peer count can temporarily
drop significantly. Should not have to wait another 60 minutes in that
situation just to be back where one started.
This commit is contained in:
Etan Kissling 2024-03-21 04:55:29 +01:00 committed by GitHub
parent d66a769135
commit 3d45c0575a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -258,10 +258,9 @@ proc syncStatus*(node: BeaconNode, head: BlockRef): ChainSyncStatus =
let numPeers = len(node.network.peerPool)
if numPeers <= node.config.maxPeers div 4:
# We may have poor connectivity, wait until more peers are available
warn "Chain appears to have stalled, but have low peers",
numPeers, maxPeers = node.config.maxPeers
node.dag.resetChainProgressWatchdog()
# We may have poor connectivity, wait until more peers are available.
# This could also be intermittent, as state replays while chain is degraded
# may take significant amounts of time, during which many peers are lost
return ChainSyncStatus.Syncing
let