diff --git a/beacon_node/store/src/errors.rs b/beacon_node/store/src/errors.rs index 8aa7a43c75..451fccbf02 100644 --- a/beacon_node/store/src/errors.rs +++ b/beacon_node/store/src/errors.rs @@ -76,6 +76,11 @@ pub enum Error { stored_slot: Slot, }, MigrationError(String), + LoadAnchorInfo(Box), + LoadSplit(Box), + LoadBlobInfo(Box), + LoadDataColumnInfo(Box), + LoadConfig(Box), } pub trait HandleUnavailable { diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 063a95b2a8..d5427ec8ee 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -2432,7 +2432,8 @@ impl, Cold: ItemStore> HotColdDB /// Load the anchor info from disk. fn load_anchor_info(hot_db: &Hot) -> Result { Ok(hot_db - .get(&ANCHOR_INFO_KEY)? + .get(&ANCHOR_INFO_KEY) + .map_err(|e| Error::LoadAnchorInfo(e.into()))? .unwrap_or(ANCHOR_UNINITIALIZED)) } @@ -2515,7 +2516,9 @@ impl, Cold: ItemStore> HotColdDB /// Load the blob info from disk, but do not set `self.blob_info`. fn load_blob_info(&self) -> Result, Error> { - self.hot_db.get(&BLOB_INFO_KEY) + self.hot_db + .get(&BLOB_INFO_KEY) + .map_err(|e| Error::LoadBlobInfo(e.into())) } /// Store the given `blob_info` to disk. @@ -2560,7 +2563,9 @@ impl, Cold: ItemStore> HotColdDB /// Load the blob info from disk, but do not set `self.data_column_info`. fn load_data_column_info(&self) -> Result, Error> { - self.hot_db.get(&DATA_COLUMN_INFO_KEY) + self.hot_db + .get(&DATA_COLUMN_INFO_KEY) + .map_err(|e| Error::LoadDataColumnInfo(e.into())) } /// Store the given `data_column_info` to disk. @@ -2619,7 +2624,9 @@ impl, Cold: ItemStore> HotColdDB /// Load previously-stored config from disk. fn load_config(&self) -> Result, Error> { - self.hot_db.get(&CONFIG_KEY) + self.hot_db + .get(&CONFIG_KEY) + .map_err(|e| Error::LoadConfig(e.into())) } /// Write the config to disk. @@ -2629,7 +2636,9 @@ impl, Cold: ItemStore> HotColdDB /// Load the split point from disk, sans block root. fn load_split_partial(&self) -> Result, Error> { - self.hot_db.get(&SPLIT_KEY) + self.hot_db + .get(&SPLIT_KEY) + .map_err(|e| Error::LoadSplit(e.into())) } /// Load the split point from disk, including block root.