mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Return HTTP 404 for pruned blob requests (#6331)
* Return HTTP 404 for pruned blob requests
This commit is contained in:
@@ -274,10 +274,27 @@ impl BlockId {
|
||||
warp_utils::reject::custom_not_found(format!("beacon block with root {}", root))
|
||||
})?;
|
||||
|
||||
// Error if the block is pre-Deneb and lacks blobs.
|
||||
let blob_kzg_commitments = block.message().body().blob_kzg_commitments().map_err(|_| {
|
||||
warp_utils::reject::custom_bad_request(
|
||||
"block is pre-Deneb and has no blobs".to_string(),
|
||||
)
|
||||
})?;
|
||||
|
||||
// Return the `BlobSidecarList` identified by `self`.
|
||||
let blob_sidecar_list = chain
|
||||
.get_blobs(&root)
|
||||
.map_err(warp_utils::reject::beacon_chain_error)?;
|
||||
let blob_sidecar_list = if !blob_kzg_commitments.is_empty() {
|
||||
chain
|
||||
.store
|
||||
.get_blobs(&root)
|
||||
.map_err(|e| warp_utils::reject::beacon_chain_error(e.into()))?
|
||||
.ok_or_else(|| {
|
||||
warp_utils::reject::custom_not_found(format!(
|
||||
"no blobs stored for block {root}"
|
||||
))
|
||||
})?
|
||||
} else {
|
||||
BlobSidecarList::default()
|
||||
};
|
||||
|
||||
let blob_sidecar_list_filtered = match indices.indices {
|
||||
Some(vec) => {
|
||||
|
||||
Reference in New Issue
Block a user