Persist data columns to store (#6255)

* Persist data columns (from das PR #5196)
This commit is contained in:
Jimmy Chen
2024-08-14 14:36:24 +10:00
committed by GitHub
parent 3a996fbbee
commit 18df7010c3
5 changed files with 67 additions and 23 deletions

View File

@@ -108,14 +108,14 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
let custody_column_count =
custody_subnet_count.saturating_mul(spec.data_columns_per_subnet());
let overflow_cache = DataAvailabilityCheckerInner::new(
let inner = DataAvailabilityCheckerInner::new(
OVERFLOW_LRU_CAPACITY,
store,
custody_column_count,
spec.clone(),
)?;
Ok(Self {
availability_cache: Arc::new(overflow_cache),
availability_cache: Arc::new(inner),
slot_clock,
kzg,
log: log.clone(),
@@ -123,6 +123,12 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
})
}
pub fn get_custody_columns_count(&self) -> usize {
self.availability_cache
.custody_subnet_count()
.saturating_mul(self.spec.data_columns_per_subnet())
}
/// Checks if the block root is currenlty in the availability cache awaiting import because
/// of missing components.
pub fn get_execution_valid_block(