diff --git a/beacon_chain/consensus_object_pools/block_dag.nim b/beacon_chain/consensus_object_pools/block_dag.nim index b45339da6..fafe5d75f 100644 --- a/beacon_chain/consensus_object_pools/block_dag.nim +++ b/beacon_chain/consensus_object_pools/block_dag.nim @@ -61,7 +61,7 @@ func init*( T: type BlockRef, root: Eth2Digest, blck: phase0.SomeBeaconBlock | altair.SomeBeaconBlock | phase0.TrustedBeaconBlock | altair.TrustedBeaconBlock): BlockRef = - BlockRef.init(root, Eth2Digest(), blck.slot) + BlockRef.init(root, ZERO_HASH, blck.slot) func init*( T: type BlockRef, root: Eth2Digest, diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index 74feaee54..84ce0afbf 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -752,8 +752,7 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB, # Load head -> finalized, or all summaries in case the finalized block table # hasn't been written yet for blck in db.getAncestorSummaries(head.root): - let newRef = BlockRef.init( - blck.root, default(Eth2Digest), blck.summary.slot) + let newRef = BlockRef.init(blck.root, ZERO_HASH, blck.summary.slot) if headRef == nil: doAssert blck.root == head.root headRef = newRef diff --git a/beacon_chain/trusted_node_sync.nim b/beacon_chain/trusted_node_sync.nim index 659da79b7..08d9e4bf6 100644 --- a/beacon_chain/trusted_node_sync.nim +++ b/beacon_chain/trusted_node_sync.nim @@ -20,9 +20,6 @@ type summaries: Table[Eth2Digest, BeaconBlockSummary] slots: seq[Option[Eth2Digest]] -const - emptyHash = Eth2Digest() - proc updateSlots(cache: var DbCache, root: Eth2Digest, slot: Slot) = # The slots mapping stores one linear block history - we construct it by # starting from a given root/slot and walking the known parents as far back @@ -40,7 +37,7 @@ proc updateSlots(cache: var DbCache, root: Eth2Digest, slot: Slot) = let slot = v[].slot for i in slot.int + 1..