This commit is contained in:
Eitan Seri- Levi
2026-02-03 22:07:49 -08:00
parent 0a111f51af
commit 16611452c5
7 changed files with 8 additions and 101 deletions

View File

@@ -3353,7 +3353,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}
}
ReconstructionOutcome::Payload(_data_column_reconstruction_result) => todo!(),
// TODO(gloas) handle data column reconstruction for gloas.
ReconstructionOutcome::Payload(_data_column_reconstruction_result) => return Err(BlockError::InternalError("Not yet implemented for gloas".to_owned())),
}
}

View File

@@ -91,7 +91,7 @@ impl<T: BeaconChainTypes> AvailabilityCache<T> for DataAvailabilityChecker<T> {
type Availability = Availability<T::EthSpec>;
type ReconstructionResult = DataColumnReconstructionResult<T::EthSpec>;
/// Returns the custody context used by this checker.
/// Returns the custody context.
fn custody_context(&self) -> &Arc<CustodyContext<T::EthSpec>> {
&self.custody_context
}

View File

@@ -31,7 +31,7 @@ use types::{
Slot,
};
/// Unified result from write operations that can come from either DA checker.
/// Unified result from operations that can come from either DA checker.
///
/// This enum allows callers to handle availability from both v1 (blocks) and v2 (payloads)
/// through a single type, with downstream processing handled by `BeaconChain::process_availability_outcome()`.
@@ -138,7 +138,7 @@ pub trait AvailabilityCache<T: BeaconChainTypes>: Send + Sync {
/// V2 returns `DataColumnReconstructionResult` with payload availability.
type ReconstructionResult;
/// Returns the custody context used by this checker.
/// Returns the custody context.
fn custody_context(&self) -> &Arc<CustodyContext<T::EthSpec>>;
/// Returns all cached data columns for the given block root, if any.
@@ -192,12 +192,11 @@ pub trait AvailabilityCache<T: BeaconChainTypes>: Send + Sync {
/// Router that directs data availability checker operations to the appropriate version based on fork.
///
/// This wraps both the legacy (v1) and Gloas (v2) DA checkers, providing:
/// - Unified operations that dispatch to the correct checker based on fork
/// - Fork-aware routing for write operations that return `AvailabilityOutcome`
/// This wraps both the legacy (v1) and Gloas (v2) DA checkers, providing unified operations
/// that dispatch to the correct checker based on fork.
///
/// After Gloas is fully activated and v1 is deprecated, this router can be deleted and
/// we can use the Gloas DA checker directly.
/// we can use the V2 DA checker directly.
pub struct DataAvailabilityRouter<T: BeaconChainTypes, V1, V2>
where
V1: AvailabilityCache<
@@ -267,19 +266,6 @@ where
}
}
/// Query data columns from both checkers, returning the first match.
///
/// Use this when you don't know which fork the block belongs to, or during
/// the transition period when data might be in either checker.
pub fn get_data_columns_any(
&self,
block_root: Hash256,
) -> Option<DataColumnSidecarList<T::EthSpec>> {
self.v1
.get_data_columns(block_root)
.or_else(|| self.v2.get_data_columns(block_root))
}
pub fn is_data_column_cached(
&self,
slot: Slot,

View File

@@ -44,7 +44,6 @@ pub mod observed_block_producers;
pub mod observed_data_sidecars;
pub mod observed_operations;
mod observed_slashable;
pub mod payload_verification_types;
pub mod persisted_beacon_chain;
pub mod persisted_custody;
mod persisted_fork_choice;

View File

@@ -1,53 +0,0 @@
use std::sync::Arc;
use state_processing::ConsensusContext;
use types::{BeaconState, BlockImportSource, EthSpec, SignedExecutionPayloadEnvelope};
use crate::PayloadVerificationOutcome;
#[derive(Debug, Clone, PartialEq)]
pub struct PayloadImportData<E: EthSpec> {
pub state: BeaconState<E>,
pub consensus_context: ConsensusContext<E>,
}
/// A payload that has completed payload verification by an EL client but does not
/// have all requisite column data to get imported into fork choice.
///
/// Note: The number of expected blobs is not available from this type directly since
/// blob commitments are in the block's execution payload bid, not the payload envelope.
/// Use the associated block to get this information.
#[derive(Clone)]
pub struct AvailabilityPendingExecutedPayload<E: EthSpec> {
pub payload: Arc<SignedExecutionPayloadEnvelope<E>>,
pub import_data: PayloadImportData<E>,
pub payload_verification_outcome: PayloadVerificationOutcome,
}
impl<E: EthSpec> AvailabilityPendingExecutedPayload<E> {
pub fn new(
payload: Arc<SignedExecutionPayloadEnvelope<E>>,
import_data: PayloadImportData<E>,
payload_verification_outcome: PayloadVerificationOutcome,
) -> Self {
Self {
payload,
import_data,
payload_verification_outcome,
}
}
pub fn as_payload(&self) -> &SignedExecutionPayloadEnvelope<E> {
&self.payload
}
}
pub enum PayloadProcessStatus<E: EthSpec> {
/// Payload is not in any pre-import cache. Payload may be in the data-base or in the fork-choice.
Unknown,
/// Payload is currently processing but not yet validated.
NotValidated(Arc<SignedExecutionPayloadEnvelope<E>>, BlockImportSource),
/// Payload is fully valid, but not yet imported. It's cached in the da_checker while awaiting
/// columns.
ExecutionValidated(Arc<SignedExecutionPayloadEnvelope<E>>),
}

View File

@@ -2697,25 +2697,6 @@ where
self.chain.slot_clock.set_slot(slot.into());
}
// TODO(gloas) this is a stub implementation for now
// we need payload processing functionality for this function
// to work
pub async fn add_payload_envelope_at_slot(
&self,
slot: Slot,
_state: BeaconState<E>,
) -> Result<
(
SignedBeaconBlockHash,
SignedPayloadEnvelopeContentsTuple<E>,
BeaconState<E>,
),
BlockError,
> {
self.set_current_slot(slot);
todo!()
}
pub async fn add_block_at_slot(
&self,
slot: Slot,

View File

@@ -251,13 +251,6 @@ pub static BEACON_BLOBS_CACHE_HIT_COUNT: LazyLock<Result<IntCounter>> = LazyLock
"Number of hits to the store's blob cache",
)
});
pub static BEACON_PAYLOAD_ENVELOPE_CACHE_HIT_COUNT: LazyLock<Result<IntCounter>> =
LazyLock::new(|| {
try_create_int_counter(
"store_beacon_payload_envelope_cache_hit_total",
"Number of hits to the store's payload envelope cache",
)
});
pub static STORE_BEACON_BLOCK_CACHE_SIZE: LazyLock<Result<IntGauge>> = LazyLock::new(|| {
try_create_int_gauge(
"store_beacon_block_cache_size",