At the fork transition ensure we build ontop of the correct parent block hash (#9160)

When producing a block at the fork, treat parent payload status as full

I've been testing on kurtosis and this fixes an issue where we cant propose a block at the fork.

This is a screenshot of the fix. The envelope shows missing because we are missing an SSE event, but the envelope is in fact being imported and the chain is progressing just fine
<img width="652" height="748" alt="image" src="https://github.com/user-attachments/assets/7764a68c-33fb-4987-a691-0af71f0bea02" />


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
Eitan Seri-Levi
2026-04-23 00:43:17 +09:00
committed by GitHub
parent 5a13e37456
commit cfc748309f

View File

@@ -690,13 +690,19 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
let parent_bid = state.latest_execution_payload_bid()?;
// TODO(gloas): need should_extend_payload check here as well
let parent_block_hash = if parent_payload_status == PayloadStatus::Full {
// Build on parent bid's payload.
parent_bid.block_hash
} else {
// Skip parent bid's payload. For genesis this is the EL genesis hash.
parent_bid.parent_block_hash
};
let parent_block_slot = state.latest_block_header().slot;
let parent_is_pre_gloas = !self
.spec
.fork_name_at_slot::<T::EthSpec>(parent_block_slot)
.gloas_enabled();
let parent_block_hash =
if parent_payload_status == PayloadStatus::Full || parent_is_pre_gloas {
// Build on parent bid's payload.
parent_bid.block_hash
} else {
// Skip parent bid's payload. For genesis this is the EL genesis hash.
parent_bid.parent_block_hash
};
// TODO(gloas) this should be BlockProductionVersion::V4
// V3 is okay for now as long as we're not connected to a builder