From 94aa2cef67be27a648862e6db60f0fbcc3b51e06 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Sat, 14 Jan 2023 16:40:38 +0100 Subject: [PATCH] Log info loaded from disk --- beacon_node/store/src/hot_cold_store.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 2c60205eb..caa7c92a3 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -166,7 +166,11 @@ impl HotColdDB, LevelDB> { let mut db = HotColdDB { split: RwLock::new(Split::default()), anchor_info: RwLock::new(None), - blob_info: RwLock::new(None), + blob_info: RwLock::new( + spec.eip4844_fork_epoch + .is_some() + .then(|| BlobInfo::default()), + ), cold_db: LevelDB::open(cold_path)?, hot_db: LevelDB::open(hot_path)?, block_cache: Mutex::new(LruCache::new(config.block_cache_size)), @@ -212,8 +216,17 @@ impl HotColdDB, LevelDB> { ); } - if db.spec.eip4844_fork_epoch.is_some() { - *db.blob_info.write() = db.load_blob_info()?.or(Some(BlobInfo::default())); + if let Some(blob_info) = db.load_blob_info()? { + let dab_slot = blob_info.data_availability_boundary.slot; + let dab_state_root = blob_info.data_availability_boundary.state_root; + *db.blob_info.write() = Some(blob_info); + + info!( + db.log, + "Blob info loaded from disk"; + "data_availability_boundary_slot" => dab_slot, + "data_availability_boundary_state" => ?dab_state_root, + ); } // Ensure that the schema version of the on-disk database matches the software.