From 1095d60a40be20dd3c229b759fc3c228b51e51e3 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 6 Jan 2025 14:38:40 +1100 Subject: [PATCH] Minor simplifications --- beacon_node/http_api/src/block_id.rs | 12 +++--------- beacon_node/store/src/hot_cold_store.rs | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/beacon_node/http_api/src/block_id.rs b/beacon_node/http_api/src/block_id.rs index d29c89fa7c..6db05c6b80 100644 --- a/beacon_node/http_api/src/block_id.rs +++ b/beacon_node/http_api/src/block_id.rs @@ -305,15 +305,9 @@ impl BlockId { .into_iter() .filter(|blob_sidecar| vec.contains(&blob_sidecar.index)) .collect(); - if let Some(max_len) = list - .first() - .map(|sidecar| chain.spec.max_blobs_per_block(sidecar.epoch())) - { - BlobSidecarList::new(list, max_len as usize) - .map_err(|e| warp_utils::reject::custom_server_error(format!("{:?}", e)))? - } else { - BlobSidecarList::empty_uninitialized() - } + let max_len = chain.spec.max_blobs_per_block(block.epoch()); + BlobSidecarList::new(list, max_len as usize) + .map_err(|e| warp_utils::reject::custom_server_error(format!("{:?}", e)))? } None => blob_sidecar_list, }; diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 44dbdc8cdc..b313051b41 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -2060,7 +2060,7 @@ impl, Cold: ItemStore> HotColdDB // We insert a VariableList of BlobSidecars into the db, but retrieve // a plain vec since we don't know the length limit of the list without // knowing the slot. - // The encoding of a VariableList is same as a regular vec. + // The encoding of a VariableList is the same as a regular vec. let blobs: Vec>> = Vec::<_>::from_ssz_bytes(blobs_bytes)?; let blobs = if let Some(max_blobs_per_block) = blobs .first()