mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 14:28:37 +00:00
Thread more payload status
This commit is contained in:
@@ -36,7 +36,7 @@ use crate::{
|
||||
execution::{
|
||||
Eth1Data, ExecutionPayloadHeaderBellatrix, ExecutionPayloadHeaderCapella,
|
||||
ExecutionPayloadHeaderDeneb, ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderFulu,
|
||||
ExecutionPayloadHeaderRef, ExecutionPayloadHeaderRefMut,
|
||||
ExecutionPayloadHeaderRef, ExecutionPayloadHeaderRefMut, StatePayloadStatus,
|
||||
},
|
||||
fork::{Fork, ForkName, ForkVersionDecode, InconsistentFork, map_fork_name},
|
||||
light_client::consts::{
|
||||
@@ -1265,6 +1265,24 @@ impl<E: EthSpec> BeaconState<E> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Determine the payload status of this state.
|
||||
///
|
||||
/// Prior to Gloas this is always `Pending`.
|
||||
///
|
||||
/// Post-Gloas, the definition of the `StatePayloadStatus` is:
|
||||
///
|
||||
/// - `Full` if this state is the result of envelope processing.
|
||||
/// - `Pending` if this state is the result of block processing.
|
||||
pub fn payload_status(&self) -> StatePayloadStatus {
|
||||
if !self.fork_name_unchecked().gloas_enabled() {
|
||||
StatePayloadStatus::Pending
|
||||
} else if self.is_parent_block_full() {
|
||||
StatePayloadStatus::Full
|
||||
} else {
|
||||
StatePayloadStatus::Pending
|
||||
}
|
||||
}
|
||||
|
||||
/// Return `true` if the validator who produced `slot_signature` is eligible to aggregate.
|
||||
///
|
||||
/// Spec v0.12.1
|
||||
|
||||
Reference in New Issue
Block a user