-
Notifications
You must be signed in to change notification settings - Fork 927
Open
Labels
Description
Description
This function looks slow to me:
lighthouse/beacon_node/store/src/hot_cold_store.rs
Lines 2531 to 2541 in e5b4983
/// Fetch all keys in the data_column column with prefix `block_root` | |
pub fn get_data_column_keys(&self, block_root: Hash256) -> Result<Vec<ColumnIndex>, Error> { | |
self.blobs_db | |
.iter_column_from::<Vec<u8>>(DBColumn::BeaconDataColumn, block_root.as_slice()) | |
.take_while(|res| { | |
res.as_ref() | |
.is_ok_and(|(key, _)| key.starts_with(block_root.as_slice())) | |
}) | |
.map(|key| key.and_then(|(key, _)| parse_data_column_key(key).map(|key| key.1))) | |
.collect() | |
} |
It is reading the data columns from the database just to work out how many columns there are. I think we could calculate the number of columns from E::number_of_columns()
, without doing any reads? We'd just need to account for the fact that some columns are expected to be missing based on custody count