diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index ae160431cd..ac55d5e55d 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -3353,7 +3353,8 @@ impl BeaconChain { } } } - 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())), } } diff --git a/beacon_node/beacon_chain/src/data_availability_checker_v2.rs b/beacon_node/beacon_chain/src/data_availability_checker_v2.rs index fcff5605a4..d499ef35ce 100644 --- a/beacon_node/beacon_chain/src/data_availability_checker_v2.rs +++ b/beacon_node/beacon_chain/src/data_availability_checker_v2.rs @@ -91,7 +91,7 @@ impl AvailabilityCache for DataAvailabilityChecker { type Availability = Availability; type ReconstructionResult = DataColumnReconstructionResult; - /// Returns the custody context used by this checker. + /// Returns the custody context. fn custody_context(&self) -> &Arc> { &self.custody_context } diff --git a/beacon_node/beacon_chain/src/data_availability_router.rs b/beacon_node/beacon_chain/src/data_availability_router.rs index 630a2bbb93..c2ed0b1ddc 100644 --- a/beacon_node/beacon_chain/src/data_availability_router.rs +++ b/beacon_node/beacon_chain/src/data_availability_router.rs @@ -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: 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>; /// Returns all cached data columns for the given block root, if any. @@ -192,12 +192,11 @@ pub trait AvailabilityCache: 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 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> { - 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, diff --git a/beacon_node/beacon_chain/src/lib.rs b/beacon_node/beacon_chain/src/lib.rs index a030557c52..2c7746c896 100644 --- a/beacon_node/beacon_chain/src/lib.rs +++ b/beacon_node/beacon_chain/src/lib.rs @@ -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; diff --git a/beacon_node/beacon_chain/src/payload_verification_types.rs b/beacon_node/beacon_chain/src/payload_verification_types.rs deleted file mode 100644 index 94c8b6cb5e..0000000000 --- a/beacon_node/beacon_chain/src/payload_verification_types.rs +++ /dev/null @@ -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 { - pub state: BeaconState, - pub consensus_context: ConsensusContext, -} - -/// 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 { - pub payload: Arc>, - pub import_data: PayloadImportData, - pub payload_verification_outcome: PayloadVerificationOutcome, -} - -impl AvailabilityPendingExecutedPayload { - pub fn new( - payload: Arc>, - import_data: PayloadImportData, - payload_verification_outcome: PayloadVerificationOutcome, - ) -> Self { - Self { - payload, - import_data, - payload_verification_outcome, - } - } - - pub fn as_payload(&self) -> &SignedExecutionPayloadEnvelope { - &self.payload - } -} - -pub enum PayloadProcessStatus { - /// 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>, BlockImportSource), - /// Payload is fully valid, but not yet imported. It's cached in the da_checker while awaiting - /// columns. - ExecutionValidated(Arc>), -} diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 6f82c672d2..d9d5a2f289 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -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, - ) -> Result< - ( - SignedBeaconBlockHash, - SignedPayloadEnvelopeContentsTuple, - BeaconState, - ), - BlockError, - > { - self.set_current_slot(slot); - todo!() - } - pub async fn add_block_at_slot( &self, slot: Slot, diff --git a/beacon_node/store/src/metrics.rs b/beacon_node/store/src/metrics.rs index 2f83457b63..93c9840586 100644 --- a/beacon_node/store/src/metrics.rs +++ b/beacon_node/store/src/metrics.rs @@ -251,13 +251,6 @@ pub static BEACON_BLOBS_CACHE_HIT_COUNT: LazyLock> = LazyLock "Number of hits to the store's blob cache", ) }); -pub static BEACON_PAYLOAD_ENVELOPE_CACHE_HIT_COUNT: LazyLock> = - 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> = LazyLock::new(|| { try_create_int_gauge( "store_beacon_block_cache_size",