initialize KZG crypto before starting network (#5543)
Move KZG trusted setup initialization before `BeaconNode.init` to avoid edge case where network message is received and processed before crypto library has been properly initialized. Followup from #4870.
This commit is contained in:
parent
8c81515bf6
commit
173582ad70
|
@ -2066,9 +2066,7 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai
|
|||
bnStatus = BeaconNodeStatus.Stopping
|
||||
c_signal(ansi_c.SIGTERM, SIGTERMHandler)
|
||||
|
||||
let node = waitFor BeaconNode.init(rng, config, metadata)
|
||||
|
||||
if node.dag.cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
|
||||
if metadata.cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
|
||||
let res =
|
||||
if config.trustedSetupFile.isNone:
|
||||
conf.loadKzgTrustedSetup()
|
||||
|
@ -2077,6 +2075,8 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai
|
|||
if res.isErr():
|
||||
raiseAssert res.error()
|
||||
|
||||
let node = waitFor BeaconNode.init(rng, config, metadata)
|
||||
|
||||
if bnStatus == BeaconNodeStatus.Stopping:
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue