diff --git a/beacon_chain/consensus_object_pools/attestation_pool.nim b/beacon_chain/consensus_object_pools/attestation_pool.nim index c3b90a10e..64890c6e2 100644 --- a/beacon_chain/consensus_object_pools/attestation_pool.nim +++ b/beacon_chain/consensus_object_pools/attestation_pool.nim @@ -795,7 +795,6 @@ proc getBeaconHead*( proc selectOptimisticHead*( pool: var AttestationPool, wallTime: BeaconTime): Opt[BeaconHead] = ## Trigger fork choice and returns the new head block. - # TODO rename this to get_optimistic_head let newHeadRoot = pool.forkChoice.get_head(pool.dag, wallTime) if newHeadRoot.isErr: error "Couldn't select head", err = newHeadRoot.error diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index 90b522fea..35764206f 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -2246,9 +2246,6 @@ proc pruneHistory*(dag: ChainDAGRef, startup = false) = break proc loadExecutionBlockHash*(dag: ChainDAGRef, bid: BlockId): Eth2Digest = - if dag.cfg.consensusForkAtEpoch(bid.slot.epoch) < ConsensusFork.Bellatrix: - return ZERO_HASH - let blockData = dag.getForkedBlock(bid).valueOr: return ZERO_HASH diff --git a/beacon_chain/gossip_processing/block_processor.nim b/beacon_chain/gossip_processing/block_processor.nim index 021978777..1339c77ca 100644 --- a/beacon_chain/gossip_processing/block_processor.nim +++ b/beacon_chain/gossip_processing/block_processor.nim @@ -605,11 +605,14 @@ proc storeBlock*( self.consensusManager[].updateHead(newHead.get.blck) template callForkchoiceUpdated(attributes: untyped) = - discard await elManager.forkchoiceUpdated( - headBlockHash = self.consensusManager[].optimisticExecutionPayloadHash, - safeBlockHash = newHead.get.safeExecutionPayloadHash, - finalizedBlockHash = newHead.get.finalizedExecutionPayloadHash, - payloadAttributes = none attributes) + if NewPayloadStatus.noResponse != payloadStatus and + not self.consensusManager[].optimisticExecutionPayloadHash.isZero: + discard await elManager.forkchoiceUpdated( + headBlockHash = + self.consensusManager[].optimisticExecutionPayloadHash, + safeBlockHash = newHead.get.safeExecutionPayloadHash, + finalizedBlockHash = newHead.get.finalizedExecutionPayloadHash, + payloadAttributes = none attributes) case self.consensusManager.dag.cfg.consensusForkAtEpoch( newHead.get.blck.bid.slot.epoch)