mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Small fixes for the genesis state
This commit is contained in:
@@ -665,8 +665,11 @@ impl HierarchyModuli {
|
||||
payload_status: StatePayloadStatus,
|
||||
) -> Result<StorageStrategy, Error> {
|
||||
// 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));
|
||||
}
|
||||
|
||||
@@ -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)?)?
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user