Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3653,7 +3653,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}

// If this is a post-merge block, update the execution layer.
if let Some(new_head_execution_block_hash) = new_head_execution_block_hash_opt {
if let Some(new_head_execution_block_hash) =
new_head_execution_block_hash_opt.filter(|h| *h != ExecutionBlockHash::zero())
{
if is_merge_transition_complete {
let finalized_execution_block_hash = finalized_block
.execution_status
Expand Down Expand Up @@ -3704,6 +3706,15 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
head_block_root: Hash256,
head_execution_block_hash: ExecutionBlockHash,
) -> Result<(), Error> {
if head_execution_block_hash == ExecutionBlockHash::zero() {
debug!(
self.log,
"Not sending forkchoice updated";
"msg" => "head block hash is zero"
);
return Ok(());
}

let forkchoice_updated_response = self
.execution_layer
.as_ref()
Expand Down
5 changes: 4 additions & 1 deletion beacon_node/client/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,10 @@ where

// Issue the head to the execution engine on startup. This ensures it can start
// syncing.
if let Some(block_hash) = head.execution_payload_block_hash {
if let Some(block_hash) = head
.execution_payload_block_hash
.filter(|h| *h != ExecutionBlockHash::zero())
{
let finalized_root = head.finalized_checkpoint.root;
let finalized_block = beacon_chain
.store
Expand Down
10 changes: 10 additions & 0 deletions beacon_node/execution_layer/src/engines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ impl<T: EngineApi> Engines<T> {
let latest_forkchoice_state = self.get_latest_forkchoice_state().await;

if let Some(forkchoice_state) = latest_forkchoice_state {
if forkchoice_state.head_block_hash == ExecutionBlockHash::zero() {
debug!(
self.log,
"No need to call forkchoiceUpdated";
"msg" => "head does not have execution enabled",
"id" => &engine.id,
);
return;
}

info!(
self.log,
"Issuing forkchoiceUpdated";
Expand Down