Skip to content

Commit

Permalink
avoid resetting chain stall detection on lag spike (#6115)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
etan-status committed Mar 21, 2024
1 parent d66a769 commit 3d45c05
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions beacon_chain/validators/beacon_validators.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3d45c05

Please sign in to comment.