mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-03-03 23:51:22 +00:00
--stop-at-synced-epoch (#3464)
* --stop-at-synced-epoch This allows benchmarking the initial sync (only forward sync, 1s error margin). Might be useful in CI, with a timeout, as a sanity check.
This commit is contained in:
parent
a84ab5d47f
commit
e4b7dbf330
@ -261,10 +261,17 @@ type
|
||||
name: "verify-finalization" }: bool
|
||||
|
||||
stopAtEpoch* {.
|
||||
desc: "A positive epoch selects the epoch at which to stop"
|
||||
hidden
|
||||
desc: "The wall-time epoch at which to exit the program. (for testing purposes)"
|
||||
defaultValue: 0
|
||||
name: "stop-at-epoch" }: uint64
|
||||
|
||||
stopAtSyncedEpoch* {.
|
||||
hidden
|
||||
desc: "The synced epoch at which to exit the program. (for testing purposes)"
|
||||
defaultValue: 0
|
||||
name: "stop-at-synced-epoch" }: uint64
|
||||
|
||||
metricsEnabled* {.
|
||||
desc: "Enable the metrics server"
|
||||
defaultValue: false
|
||||
|
@ -1118,6 +1118,10 @@ proc onSecond(node: BeaconNode) =
|
||||
# Nim GC metrics (for the main thread)
|
||||
updateThreadMetrics()
|
||||
|
||||
if node.config.stopAtSyncedEpoch != 0 and node.dag.head.slot.epoch >= node.config.stopAtSyncedEpoch:
|
||||
notice "Shutting down after having reached the target synced epoch"
|
||||
bnStatus = BeaconNodeStatus.Stopping
|
||||
|
||||
proc runOnSecondLoop(node: BeaconNode) {.async.} =
|
||||
let sleepTime = chronos.seconds(1)
|
||||
const nanosecondsIn1s = float(chronos.seconds(1).nanoseconds)
|
||||
|
Loading…
x
Reference in New Issue
Block a user