From d7eb9441cfa6c7b55f405e684b727a14b34bc8e3 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Tue, 7 Feb 2023 11:20:04 +0100 Subject: [PATCH] Reorder loading of db metadata from disk to allow for future changes to schema --- beacon_node/store/src/hot_cold_store.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 35dbbe39c..6825ee707 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -213,17 +213,6 @@ impl HotColdDB, LevelDB> { ); } - if let Some(blob_info) = db.load_blob_info()? { - let oldest_blob_slot = blob_info.oldest_blob_slot; - *db.blob_info.write() = blob_info; - - info!( - db.log, - "Blob info loaded from disk"; - "oldest_blob_slot" => ?oldest_blob_slot, - ); - } - // Ensure that the schema version of the on-disk database matches the software. // If the version is mismatched, an automatic migration will be attempted. let db = Arc::new(db); @@ -239,6 +228,17 @@ impl HotColdDB, LevelDB> { db.store_schema_version(CURRENT_SCHEMA_VERSION)?; } + if let Some(blob_info) = db.load_blob_info()? { + let oldest_blob_slot = blob_info.oldest_blob_slot; + *db.blob_info.write() = blob_info; + + info!( + db.log, + "Blob info loaded from disk"; + "oldest_blob_slot" => ?oldest_blob_slot, + ); + } + // Ensure that any on-disk config is compatible with the supplied config. if let Some(disk_config) = db.load_config()? { db.config.check_compatibility(&disk_config)?;