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.
Description
The merge transition block is the first post-Bellatrix block to include a non-default
ExecutionPayload. Theexecution_payload.parent_hashvalue is computed here:lighthouse/beacon_node/beacon_chain/src/execution_payload.rs
Lines 264 to 267 in c3a793f
According to the validator guide, we're supposed to call forkchoiceUpdated (fcU) before producing that block with the
head_block_hashset to the value returned fromExecutionLayer::get_terminal_pow_block_hash.In #3043, I've added the functionality to give the EL a "heads-up" for payload production via a
PayloadAttributesvalue 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_hashinBeaconChain::prepare_proposer_asyncwhenever 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 thehead_block_rootrather 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_hashis done inBeaconChain::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.