fix: set slot_number to latest_block_header.slot in Gloas fork upgrade (#8726)

During the Fulu→Gloas state upgrade, the latestExecutionPayloadHeader's
slot_number was hardcoded to 0. This caused beacon state root divergence
between Lighthouse and Lodestar at the Gloas fork boundary (slot 8).

Set slot_number to pre.latest_block_header.slot to match Lodestar's
behavior and correctly carry forward the slot of the last block.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Stefan
2026-02-02 11:12:22 +01:00
committed by GitHub
parent a17c447680
commit 65bb2836be
2 changed files with 5 additions and 3 deletions

View File

@@ -64,7 +64,9 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
current_sync_committee: pre.current_sync_committee.clone(),
next_sync_committee: pre.next_sync_committee.clone(),
// Execution - upgrade header from Fulu to Gloas
latest_execution_payload_header: pre.latest_execution_payload_header.upgrade_to_gloas(),
latest_execution_payload_header: pre
.latest_execution_payload_header
.upgrade_to_gloas(pre.latest_block_header.slot.into()),
// Capella
next_withdrawal_index: pre.next_withdrawal_index,
next_withdrawal_validator_index: pre.next_withdrawal_validator_index,

View File

@@ -275,7 +275,7 @@ impl<E: EthSpec> ExecutionPayloadHeaderElectra<E> {
}
impl<E: EthSpec> ExecutionPayloadHeaderFulu<E> {
pub fn upgrade_to_gloas(&self) -> ExecutionPayloadHeaderGloas<E> {
pub fn upgrade_to_gloas(&self, slot_number: u64) -> ExecutionPayloadHeaderGloas<E> {
ExecutionPayloadHeaderGloas {
parent_hash: self.parent_hash,
fee_recipient: self.fee_recipient,
@@ -295,7 +295,7 @@ impl<E: EthSpec> ExecutionPayloadHeaderFulu<E> {
blob_gas_used: self.blob_gas_used,
excess_blob_gas: self.excess_blob_gas,
block_access_list_root: Hash256::zero(),
slot_number: 0,
slot_number,
}
}
}