Skip to content

Commit

Permalink
don't fcU on blocks for which block processor received no newPayload …
Browse files Browse the repository at this point in the history
…reply
  • Loading branch information
tersec committed Feb 14, 2023
1 parent 32f6309 commit 0be833d
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions beacon_chain/gossip_processing/block_processor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,7 @@ proc newExecutionPayload*(
return Opt.none PayloadExecutionStatus

debug "newPayload: inserting block into execution engine",
parentHash = executionPayload.parent_hash,
blockHash = executionPayload.block_hash,
stateRoot = shortLog(executionPayload.state_root),
receiptsRoot = shortLog(executionPayload.receipts_root),
prevRandao = shortLog(executionPayload.prev_randao),
blockNumber = executionPayload.block_number,
gasLimit = executionPayload.gas_limit,
gasUsed = executionPayload.gas_used,
timestamp = executionPayload.timestamp,
extraDataLen = executionPayload.extra_data.len,
baseFeePerGas = $executionPayload.base_fee_per_gas,
numTransactions = executionPayload.transactions.len
executionPayload = shortLog(executionPayload)

# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/paris.md#request
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/shanghai.md#request
Expand Down Expand Up @@ -525,9 +514,8 @@ proc storeBlock*(

# Grab the new head according to our latest attestation data; determines how
# async this needs to be.
let
newHead = attestationPool[].selectOptimisticHead(
wallSlot.start_beacon_time)
let newHead = attestationPool[].selectOptimisticHead(
wallSlot.start_beacon_time)

if newHead.isOk:
template eth1Monitor(): auto = self.consensusManager.eth1Monitor
Expand Down Expand Up @@ -557,8 +545,10 @@ proc storeBlock*(
headExecutionPayloadHash =
self.consensusManager.dag.loadExecutionBlockRoot(newHead.get.blck)
wallSlot = self.getBeaconTime().slotOrZero
if headExecutionPayloadHash.isZero:
# Blocks without execution payloads can't be optimistic.
if headExecutionPayloadHash.isZero or
NewPayloadStatus.noResponse == payloadStatus:
# Blocks without execution payloads can't be optimistic, and don't try
# to fcU to a block the EL hasn't seen
self.consensusManager[].updateHead(newHead.get.blck)
elif not self.consensusManager.dag.is_optimistic newHead.get.blck.root:
# Not `NOT_VALID`; either `VALID` or `INVALIDATED`, but latter wouldn't
Expand Down

0 comments on commit 0be833d

Please sign in to comment.