mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-18 09:27:05 +00:00
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*(
|
proc selectOptimisticHead*(
|
||||||
pool: var AttestationPool, wallTime: BeaconTime): Opt[BeaconHead] =
|
pool: var AttestationPool, wallTime: BeaconTime): Opt[BeaconHead] =
|
||||||
## Trigger fork choice and returns the new head block.
|
## 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)
|
let newHeadRoot = pool.forkChoice.get_head(pool.dag, wallTime)
|
||||||
if newHeadRoot.isErr:
|
if newHeadRoot.isErr:
|
||||||
error "Couldn't select head", err = newHeadRoot.error
|
error "Couldn't select head", err = newHeadRoot.error
|
||||||
|
@ -2246,9 +2246,6 @@ proc pruneHistory*(dag: ChainDAGRef, startup = false) =
|
|||||||
break
|
break
|
||||||
|
|
||||||
proc loadExecutionBlockHash*(dag: ChainDAGRef, bid: BlockId): Eth2Digest =
|
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:
|
let blockData = dag.getForkedBlock(bid).valueOr:
|
||||||
return ZERO_HASH
|
return ZERO_HASH
|
||||||
|
|
||||||
|
@ -605,11 +605,14 @@ proc storeBlock*(
|
|||||||
self.consensusManager[].updateHead(newHead.get.blck)
|
self.consensusManager[].updateHead(newHead.get.blck)
|
||||||
|
|
||||||
template callForkchoiceUpdated(attributes: untyped) =
|
template callForkchoiceUpdated(attributes: untyped) =
|
||||||
discard await elManager.forkchoiceUpdated(
|
if NewPayloadStatus.noResponse != payloadStatus and
|
||||||
headBlockHash = self.consensusManager[].optimisticExecutionPayloadHash,
|
not self.consensusManager[].optimisticExecutionPayloadHash.isZero:
|
||||||
safeBlockHash = newHead.get.safeExecutionPayloadHash,
|
discard await elManager.forkchoiceUpdated(
|
||||||
finalizedBlockHash = newHead.get.finalizedExecutionPayloadHash,
|
headBlockHash =
|
||||||
payloadAttributes = none attributes)
|
self.consensusManager[].optimisticExecutionPayloadHash,
|
||||||
|
safeBlockHash = newHead.get.safeExecutionPayloadHash,
|
||||||
|
finalizedBlockHash = newHead.get.finalizedExecutionPayloadHash,
|
||||||
|
payloadAttributes = none attributes)
|
||||||
|
|
||||||
case self.consensusManager.dag.cfg.consensusForkAtEpoch(
|
case self.consensusManager.dag.cfg.consensusForkAtEpoch(
|
||||||
newHead.get.blck.bid.slot.epoch)
|
newHead.get.blck.bid.slot.epoch)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user