From e6bf6a928c7f1b432ec67e841158129cf1bbbede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Mon, 6 Jul 2026 18:14:28 -0300 Subject: [PATCH] fix: use the head slot for the DB staleness check --- bin/ethlambda/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ethlambda/src/main.rs b/bin/ethlambda/src/main.rs index b933b928..850a92af 100644 --- a/bin/ethlambda/src/main.rs +++ b/bin/ethlambda/src/main.rs @@ -649,17 +649,17 @@ async fn fetch_initial_state( .as_millis() as u64; let current_slot = now_ms.saturating_sub(genesis.genesis_time * 1000) / MILLISECONDS_PER_SLOT; - let finalized_slot = store.latest_finalized().slot; - let gap = current_slot.saturating_sub(finalized_slot); + let head_slot = store.head_slot(); + let gap = current_slot.saturating_sub(head_slot); if gap <= MAX_RESUMABLE_DB_STATE_AGE { info!( - finalized_slot, + head_slot, current_slot, gap, "Resuming from existing DB state" ); return Ok(store); } warn!( - finalized_slot, + head_slot, current_slot, gap, "Existing DB state is stale; falling through to checkpoint sync" ); }