From 65bb2836be807a1f4cf1e3cf926a15e906b01488 Mon Sep 17 00:00:00 2001 From: Stefan <22667037+qu0b@users.noreply.github.com> Date: Mon, 2 Feb 2026 11:12:22 +0100 Subject: [PATCH] fix: set slot_number to latest_block_header.slot in Gloas fork upgrade (#8726) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- consensus/state_processing/src/upgrade/gloas.rs | 4 +++- consensus/types/src/execution/execution_payload_header.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/consensus/state_processing/src/upgrade/gloas.rs b/consensus/state_processing/src/upgrade/gloas.rs index 50b78ecb05..5c9f5ccc24 100644 --- a/consensus/state_processing/src/upgrade/gloas.rs +++ b/consensus/state_processing/src/upgrade/gloas.rs @@ -64,7 +64,9 @@ pub fn upgrade_state_to_gloas( 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, diff --git a/consensus/types/src/execution/execution_payload_header.rs b/consensus/types/src/execution/execution_payload_header.rs index 06a8e11c34..b262767887 100644 --- a/consensus/types/src/execution/execution_payload_header.rs +++ b/consensus/types/src/execution/execution_payload_header.rs @@ -275,7 +275,7 @@ impl ExecutionPayloadHeaderElectra { } impl ExecutionPayloadHeaderFulu { - pub fn upgrade_to_gloas(&self) -> ExecutionPayloadHeaderGloas { + pub fn upgrade_to_gloas(&self, slot_number: u64) -> ExecutionPayloadHeaderGloas { ExecutionPayloadHeaderGloas { parent_hash: self.parent_hash, fee_recipient: self.fee_recipient, @@ -295,7 +295,7 @@ impl ExecutionPayloadHeaderFulu { 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, } } }