File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 3737 # # Number of requests performed by single peer in one syncing step
3838 RepeatingFailuresCount * = 2
3939 # # Number of repeating errors before starting rewind process.
40+ StatusStalePeriod * = 5
41+ # # Number of slots before peer's status information could be stale.
4042
4143func shortLog (optblkid: Opt [BlockId ]): string =
4244 if optblkid.isNone ():
@@ -1102,6 +1104,7 @@ proc doPeerUpdateStatus(
11021104 peer: Peer
11031105): Future [bool ] {.async : (raises: [CancelledError ]).} =
11041106 let
1107+ dag = overseer.consensusManager.dag
11051108 peerHead = peer.getHeadBlockId ()
11061109 peerFinalizedCheckpoint = peer.getFinalizedCheckpoint ()
11071110 peerStatusAge = Moment .now () - peer.getStatusLastTime ()
@@ -1129,8 +1132,11 @@ proc doPeerUpdateStatus(
11291132 newPeerHead = peer.getHeadBlockId ()
11301133
11311134 if peerHead.slot >= newPeerHead.slot:
1132- peer.updateScore (PeerScoreStaleStatus )
1133- debug " Peer's status information is stale"
1135+ let stalePeriod =
1136+ (dag.cfg.timeParams.SLOT_DURATION * StatusStalePeriod )
1137+ if peerStatusAge >= stalePeriod:
1138+ peer.updateScore (PeerScoreStaleStatus )
1139+ debug " Peer's status information is stale"
11341140 else :
11351141 # Updating data structures about newly received Peer's status information.
11361142 overseer.updatePeer (peer)
You can’t perform that action at this time.
0 commit comments