Skip to content

Commit 0c1686e

Browse files
arnetheduckzah
authored andcommitted
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
1 parent fa27ce7 commit 0c1686e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

beacon_chain/consensus_object_pools/blockchain_dag.nim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,10 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
10971097

10981098
dag.backfill = block:
10991099
let backfillSlot = db.finalizedBlocks.low.expect("tail at least")
1100-
if backfillSlot < dag.tail.slot:
1100+
if backfillSlot <= dag.horizon:
1101+
# Backfill done, no need to load anything
1102+
BeaconBlockSummary()
1103+
elif backfillSlot < dag.tail.slot:
11011104
let backfillRoot = db.finalizedBlocks.get(backfillSlot).expect(
11021105
"low to be loadable")
11031106

0 commit comments

Comments
 (0)