Skip to content

Check for terminal block during proposer preparation #3058

@paulhauner

Description

@paulhauner

Description

The merge transition block is the first post-Bellatrix block to include a non-default ExecutionPayload. The execution_payload.parent_hash value is computed here:

let terminal_pow_block_hash = execution_layer
.get_terminal_pow_block_hash(spec)
.await
.map_err(BlockProductionError::TerminalPoWBlockLookupFailed)?;

According to the validator guide, we're supposed to call forkchoiceUpdated (fcU) before producing that block with the head_block_hash set to the value returned from ExecutionLayer::get_terminal_pow_block_hash.

In #3043, I've added the functionality to give the EL a "heads-up" for payload production via a PayloadAttributes value in a fcU call. However, I haven't handled the edge-case of the transition block.

To handle the edge case, I think we need to call ExecutionLayer::get_terminal_pow_block_hash in BeaconChain::prepare_proposer_async whenever we're post-Bellatrix but the head block does not have execution enabled. If we get a terminal pow block hash, then we should use that value as the head_block_root rather than the value that's presently on the head block.

We might actually be able to do it a bit cleaner, where the call to get_terminal_pow_block_hash is done in BeaconChain::update_execution_engine_forkchoice_async. I'm not sure what the best implementation is, yet.

Importantly, with our current implementation, we'll just fail to give advance notice of the terminal block. However, we'll still produce a block since we'll do a valid fcU call immediately before we try to produce the transition payload.

Metadata

Metadata

Assignees

Labels

bellatrixRequired to support the Bellatrix Upgrade

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions