mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-03 04:44:28 +00:00
Minor simplifications
This commit is contained in:
@@ -305,15 +305,9 @@ impl BlockId {
|
|||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|blob_sidecar| vec.contains(&blob_sidecar.index))
|
.filter(|blob_sidecar| vec.contains(&blob_sidecar.index))
|
||||||
.collect();
|
.collect();
|
||||||
if let Some(max_len) = list
|
let max_len = chain.spec.max_blobs_per_block(block.epoch());
|
||||||
.first()
|
BlobSidecarList::new(list, max_len as usize)
|
||||||
.map(|sidecar| chain.spec.max_blobs_per_block(sidecar.epoch()))
|
.map_err(|e| warp_utils::reject::custom_server_error(format!("{:?}", e)))?
|
||||||
{
|
|
||||||
BlobSidecarList::new(list, max_len as usize)
|
|
||||||
.map_err(|e| warp_utils::reject::custom_server_error(format!("{:?}", e)))?
|
|
||||||
} else {
|
|
||||||
BlobSidecarList::empty_uninitialized()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
None => blob_sidecar_list,
|
None => blob_sidecar_list,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2060,7 +2060,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
|||||||
// We insert a VariableList of BlobSidecars into the db, but retrieve
|
// 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
|
// a plain vec since we don't know the length limit of the list without
|
||||||
// knowing the slot.
|
// 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<Arc<BlobSidecar<E>>> = Vec::<_>::from_ssz_bytes(blobs_bytes)?;
|
let blobs: Vec<Arc<BlobSidecar<E>>> = Vec::<_>::from_ssz_bytes(blobs_bytes)?;
|
||||||
let blobs = if let Some(max_blobs_per_block) = blobs
|
let blobs = if let Some(max_blobs_per_block) = blobs
|
||||||
.first()
|
.first()
|
||||||
|
|||||||
Reference in New Issue
Block a user