diff --git a/beacon_node/store/src/hdiff.rs b/beacon_node/store/src/hdiff.rs index beae02fc75..3ad6a1f0d3 100644 --- a/beacon_node/store/src/hdiff.rs +++ b/beacon_node/store/src/hdiff.rs @@ -665,8 +665,11 @@ impl HierarchyModuli { payload_status: StatePayloadStatus, ) -> Result { // Store all Full states by replaying from their respective Pending state at the same slot. + // Make an exception for the genesis state, which "counts as" Full by virtue of having 0x0 + // in both `latest_block_hash` and `latest_execution_payload_bid.block_hash`. if let StatePayloadStatus::Full = payload_status && slot >= start_slot + && slot != 0 { return Ok(StorageStrategy::ReplayFrom(slot)); } diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 46257db3fb..c9e1b6062c 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -4199,11 +4199,11 @@ impl HotStateSummary { OptionalDiffBaseState::Snapshot(0) }; - let previous_state_root = if state.slot() == 0 - && let StatePayloadStatus::Pending = payload_status - { + let previous_state_root = if state.slot() == 0 { // Set to 0x0 for genesis state to prevent any sort of circular reference. Hash256::zero() + } else if let StatePayloadStatus::Full = payload_status { + get_state_root(state.slot())? } else { get_state_root(state.slot().safe_sub(1_u64)?)? };