Skip to content

Commit 1095d60

Browse files
committed
Minor simplifications
1 parent de01f92 commit 1095d60

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

beacon_node/http_api/src/block_id.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,9 @@ impl BlockId {
305305
.into_iter()
306306
.filter(|blob_sidecar| vec.contains(&blob_sidecar.index))
307307
.collect();
308-
if let Some(max_len) = list
309-
.first()
310-
.map(|sidecar| chain.spec.max_blobs_per_block(sidecar.epoch()))
311-
{
312-
BlobSidecarList::new(list, max_len as usize)
313-
.map_err(|e| warp_utils::reject::custom_server_error(format!("{:?}", e)))?
314-
} else {
315-
BlobSidecarList::empty_uninitialized()
316-
}
308+
let max_len = chain.spec.max_blobs_per_block(block.epoch());
309+
BlobSidecarList::new(list, max_len as usize)
310+
.map_err(|e| warp_utils::reject::custom_server_error(format!("{:?}", e)))?
317311
}
318312
None => blob_sidecar_list,
319313
};

beacon_node/store/src/hot_cold_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
20602060
// We insert a VariableList of BlobSidecars into the db, but retrieve
20612061
// a plain vec since we don't know the length limit of the list without
20622062
// knowing the slot.
2063-
// The encoding of a VariableList is same as a regular vec.
2063+
// The encoding of a VariableList is the same as a regular vec.
20642064
let blobs: Vec<Arc<BlobSidecar<E>>> = Vec::<_>::from_ssz_bytes(blobs_bytes)?;
20652065
let blobs = if let Some(max_blobs_per_block) = blobs
20662066
.first()

0 commit comments

Comments
 (0)