Don't wait for genesis to start network (#1249)
This commit is contained in:
parent
8140b4458c
commit
047f354e9b
|
@ -30,7 +30,6 @@ import
|
||||||
|
|
||||||
const
|
const
|
||||||
genesisFile* = "genesis.ssz"
|
genesisFile* = "genesis.ssz"
|
||||||
timeToInitNetworkingBeforeGenesis = chronos.seconds(30)
|
|
||||||
hasPrompt = not defined(withoutPrompt)
|
hasPrompt = not defined(withoutPrompt)
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -861,12 +860,7 @@ proc start(node: BeaconNode) =
|
||||||
let
|
let
|
||||||
head = node.blockPool.head
|
head = node.blockPool.head
|
||||||
finalizedHead = node.blockPool.finalizedHead
|
finalizedHead = node.blockPool.finalizedHead
|
||||||
|
genesisTime = node.beaconClock.fromNow(toBeaconTime(Slot 0))
|
||||||
let genesisTime = node.beaconClock.fromNow(toBeaconTime(Slot 0))
|
|
||||||
|
|
||||||
if genesisTime.inFuture and genesisTime.offset > timeToInitNetworkingBeforeGenesis:
|
|
||||||
info "Waiting for the genesis event", genesisIn = genesisTime.offset
|
|
||||||
waitFor sleepAsync(genesisTime.offset - timeToInitNetworkingBeforeGenesis)
|
|
||||||
|
|
||||||
info "Starting beacon node",
|
info "Starting beacon node",
|
||||||
version = fullVersionStr,
|
version = fullVersionStr,
|
||||||
|
@ -884,6 +878,9 @@ proc start(node: BeaconNode) =
|
||||||
cat = "init",
|
cat = "init",
|
||||||
pcs = "start_beacon_node"
|
pcs = "start_beacon_node"
|
||||||
|
|
||||||
|
if genesisTime.inFuture:
|
||||||
|
notice "Waiting for genesis", genesisIn = genesisTime.offset
|
||||||
|
|
||||||
waitFor node.initializeNetworking()
|
waitFor node.initializeNetworking()
|
||||||
node.run()
|
node.run()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue