Load the state corresponding to head payload status yay

This commit is contained in:
Michael Sproul
2026-03-26 16:03:55 +11:00
parent ac5357532b
commit 12f5ab04f3
2 changed files with 17 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ use std::{
};
use types::{
AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpec, ExecutionBlockHash, Hash256,
Slot,
Slot, StatePayloadStatus,
};
pub const DEFAULT_PRUNE_THRESHOLD: usize = 256;
@@ -69,6 +69,19 @@ pub enum PayloadStatus {
Pending = 2,
}
impl PayloadStatus {
/// Convert a `PayloadStatus` into the equivalent `StatePayloadStatus`.
///
/// This maps `Empty` onto `StatePayloadStatus::Pending` because empty and pending fork choice
/// nodes correspond to the exact same state.
pub fn as_state_payload_status(self) -> StatePayloadStatus {
match self {
Self::Empty | Self::Pending => StatePayloadStatus::Pending,
Self::Full => StatePayloadStatus::Full,
}
}
}
/// Spec's `ForkChoiceNode` augmented with ProtoNode index.
pub struct IndexedForkChoiceNode {
pub root: Hash256,