@@ -38,19 +38,18 @@ use crate::observed_data_sidecars::ObservationStrategy;
3838pub use error:: { Error as AvailabilityCheckError , ErrorCategory as AvailabilityCheckErrorCategory } ;
3939use types:: non_zero_usize:: new_non_zero_usize;
4040
41- /// The LRU Cache stores `PendingComponents`, which can store up to `MAX_BLOBS_PER_BLOCK` blobs each.
41+ /// The LRU Cache stores `PendingComponents`, which store block and its associated blob data:
4242///
4343/// * Deneb blobs are 128 kb each and are stored in the form of `BlobSidecar`.
4444/// * From Fulu (PeerDAS), blobs are erasure-coded and are 256 kb each, stored in the form of 128 `DataColumnSidecar`s.
4545///
4646/// With `MAX_BLOBS_PER_BLOCK` = 48 (expected in the next year), the maximum size of data columns
47- /// in `PendingComponents` is ~12.29 MB. Setting this to 64 means the maximum size of the cache is
48- /// approximately 0.8 GB.
47+ /// in `PendingComponents` is ~12.29 MB. Setting this to 32 means the maximum size of the cache is
48+ /// approximately 0.4 GB.
4949///
50- /// Under normal conditions, the cache should only store the current pending block, but could
51- /// occasionally spike to 2-4 for various reasons e.g. components arriving late, but would very
52- /// rarely go above this, unless there are many concurrent forks.
53- pub const OVERFLOW_LRU_CAPACITY : NonZeroUsize = new_non_zero_usize ( 64 ) ;
50+ /// `PendingComponents` are now never removed from the cache manually are only removed via LRU
51+ /// eviction to prevent race conditions (#7961), so we expect this cache to be full all the time.
52+ pub const OVERFLOW_LRU_CAPACITY : NonZeroUsize = new_non_zero_usize ( 32 ) ;
5453pub const STATE_LRU_CAPACITY_NON_ZERO : NonZeroUsize = new_non_zero_usize ( 32 ) ;
5554pub const STATE_LRU_CAPACITY : usize = STATE_LRU_CAPACITY_NON_ZERO . get ( ) ;
5655
@@ -584,8 +583,8 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
584583
585584 // Check indices from cache again to make sure we don't publish components we've already received.
586585 let Some ( existing_column_indices) = self . cached_data_column_indexes ( block_root) else {
587- return Ok ( DataColumnReconstructionResult :: RecoveredColumnsNotImported (
588- "block already imported" ,
586+ return Err ( AvailabilityCheckError :: Unexpected (
587+ "block no longer exists in the data availability checker" . to_string ( ) ,
589588 ) ) ;
590589 } ;
591590
0 commit comments