From ca934b7cb5256c1dff6aabd3f6e055e9fb9cc954 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Wed, 1 Feb 2023 17:55:24 +0100 Subject: [PATCH] Fix rebase conflicts --- beacon_node/http_api/src/block_id.rs | 5 ++++- beacon_node/store/src/hot_cold_store.rs | 10 +++++++--- beacon_node/store/src/metadata.rs | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/beacon_node/http_api/src/block_id.rs b/beacon_node/http_api/src/block_id.rs index 9e152dc61..e8d463bbe 100644 --- a/beacon_node/http_api/src/block_id.rs +++ b/beacon_node/http_api/src/block_id.rs @@ -218,7 +218,10 @@ impl BlockId { chain: &BeaconChain, ) -> Result>, warp::Rejection> { let root = self.root(chain)?.0; - match chain.get_blobs(&root) { + let Some(data_availability_boundary) = chain.data_availability_boundary() else { + return Err(warp_utils::reject::custom_not_found("Eip4844 fork disabled".into())); + }; + match chain.get_blobs(&root, data_availability_boundary) { Ok(Some(blob)) => Ok(Arc::new(blob)), Ok(None) => Err(warp_utils::reject::custom_not_found(format!( "Blob with block root {} is not in the store", diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 562a6bc51..201a78afd 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -237,11 +237,15 @@ impl HotColdDB, LevelDB> { if let Some(path) = blobs_db_path { let new_blob_info = if open_blobs_db { db.blobs_db = Some(LevelDB::open(path.as_path())?); - Some(BlobInfo { blobs_db: true }) + let mut new_blob_info = blob_info.clone().unwrap_or_default(); + new_blob_info.blobs_db = true; + new_blob_info } else { - Some(BlobInfo { blobs_db: false }) + let mut new_blob_info = blob_info.clone().unwrap_or_default(); + new_blob_info.blobs_db = false; + new_blob_info }; - db.compare_and_set_blob_info_with_write(blob_info, new_blob_info)?; + db.compare_and_set_blob_info_with_write(blob_info, Some(new_blob_info))?; info!( db.log, "Blobs DB initialized"; diff --git a/beacon_node/store/src/metadata.rs b/beacon_node/store/src/metadata.rs index 92117254f..6c3761eb8 100644 --- a/beacon_node/store/src/metadata.rs +++ b/beacon_node/store/src/metadata.rs @@ -126,6 +126,8 @@ pub struct BlobInfo { pub oldest_blob_slot: Option, /// A separate blobs database is in use. pub blobs_db: bool, + /// The slot after which blobs are available (>=). + pub oldest_blob_slot: Option, } impl StoreItem for BlobInfo {