don't send fcUs every block if in lc-opt regime and block putatively finalized (#5248)
This commit is contained in:
parent
6de3c49512
commit
af37a96dbd
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue