Add StatePayloadStatus to BlockReplayer

This commit is contained in:
Michael Sproul
2026-02-23 21:14:27 +11:00
parent 9bdf44c76c
commit a3f31835ab
3 changed files with 104 additions and 46 deletions

View File

@@ -12,6 +12,7 @@ mod payload;
mod signed_bls_to_execution_change;
mod signed_execution_payload_bid;
mod signed_execution_payload_envelope;
mod state_payload_status;
pub use bls_to_execution_change::BlsToExecutionChange;
pub use eth1_data::Eth1Data;
@@ -41,3 +42,4 @@ pub use payload::{
pub use signed_bls_to_execution_change::SignedBlsToExecutionChange;
pub use signed_execution_payload_bid::SignedExecutionPayloadBid;
pub use signed_execution_payload_envelope::SignedExecutionPayloadEnvelope;
pub use state_payload_status::StatePayloadStatus;

View File

@@ -0,0 +1,18 @@
use serde::{Deserialize, Serialize};
/// Payload status as it applies to a `BeaconState` post-Gloas.
///
/// A state can either be a post-state for a block (in which case we call it `Pending`) or a
/// payload envelope (`Full`). When handling states it is often necessary to know which of these
/// two variants is required.
///
/// Note that states at skipped slots could be either `Pending` or `Full`, depending on whether
/// the payload for the most-recently applied block was also applied.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum StatePayloadStatus {
/// For states produced by `process_block` executed on a `BeaconBlock`.
Pending,
/// For states produced by `process_execution_payload` on a `ExecutionPayloadEnvelope`.
Full,
}