Merge branch 'dev/etan/af-cacheinit' into feat/splitview

This commit is contained in:
Etan Kissling 2024-04-01 01:00:52 +02:00
commit 3c7ac28359
No known key found for this signature in database
GPG Key ID: B21DA824C5A3D03D
1 changed files with 4 additions and 4 deletions

View File

@ -1136,10 +1136,6 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
head = shortLog(head), tail = shortLog(dag.tail)
quit 1
withState(dag.headState):
when consensusFork >= ConsensusFork.Altair:
dag.headSyncCommittees = forkyState.data.get_sync_committee_cache(cache)
block:
# EpochRef needs an epoch boundary state
assign(dag.epochRefState, dag.headState)
@ -1154,6 +1150,10 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
dag.head = headRef
dag.heads = @[headRef]
withState(dag.headState):
when consensusFork >= ConsensusFork.Altair:
dag.headSyncCommittees = forkyState.data.get_sync_committee_cache(cache)
assign(dag.clearanceState, dag.headState)
if dag.headState.latest_block_root == tail.root: