mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-20 10:18:35 +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,8 +605,11 @@ proc storeBlock*(
|
|||||||
self.consensusManager[].updateHead(newHead.get.blck)
|
self.consensusManager[].updateHead(newHead.get.blck)
|
||||||
|
|
||||||
template callForkchoiceUpdated(attributes: untyped) =
|
template callForkchoiceUpdated(attributes: untyped) =
|
||||||
|
if NewPayloadStatus.noResponse != payloadStatus and
|
||||||
|
not self.consensusManager[].optimisticExecutionPayloadHash.isZero:
|
||||||
discard await elManager.forkchoiceUpdated(
|
discard await elManager.forkchoiceUpdated(
|
||||||
headBlockHash = self.consensusManager[].optimisticExecutionPayloadHash,
|
headBlockHash =
|
||||||
|
self.consensusManager[].optimisticExecutionPayloadHash,
|
||||||
safeBlockHash = newHead.get.safeExecutionPayloadHash,
|
safeBlockHash = newHead.get.safeExecutionPayloadHash,
|
||||||
finalizedBlockHash = newHead.get.finalizedExecutionPayloadHash,
|
finalizedBlockHash = newHead.get.finalizedExecutionPayloadHash,
|
||||||
payloadAttributes = none attributes)
|
payloadAttributes = none attributes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user