mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 22:06:21 +00:00
fix pruned backfill summary (fixes #4552)
When enabling pruned history mode, the backfill summary as it was computed with full backfilling may be pruned - don't try to load it on init
This commit is contained in:
parent
fa27ce76a3
commit
0c1686eb20
@ -1097,7 +1097,10 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
|
|||||||
|
|
||||||
dag.backfill = block:
|
dag.backfill = block:
|
||||||
let backfillSlot = db.finalizedBlocks.low.expect("tail at least")
|
let backfillSlot = db.finalizedBlocks.low.expect("tail at least")
|
||||||
if backfillSlot < dag.tail.slot:
|
if backfillSlot <= dag.horizon:
|
||||||
|
# Backfill done, no need to load anything
|
||||||
|
BeaconBlockSummary()
|
||||||
|
elif backfillSlot < dag.tail.slot:
|
||||||
let backfillRoot = db.finalizedBlocks.get(backfillSlot).expect(
|
let backfillRoot = db.finalizedBlocks.get(backfillSlot).expect(
|
||||||
"low to be loadable")
|
"low to be loadable")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user