@@ -22,7 +22,7 @@ use ssz_types::FixedVector;
2222use state_processing:: per_block_processing:: deneb:: kzg_commitment_to_versioned_hash;
2323use std:: collections:: HashSet ;
2424use std:: sync:: Arc ;
25- use tracing:: debug;
25+ use tracing:: { debug, warn } ;
2626use types:: blob_sidecar:: { BlobSidecarError , FixedBlobSidecarList } ;
2727use types:: data_column_sidecar:: DataColumnSidecarError ;
2828use types:: {
@@ -212,31 +212,37 @@ async fn fetch_and_process_blobs_v2<T: BeaconChainTypes>(
212212 } )
213213 . map_err ( FetchEngineBlobError :: RequestFailed ) ?;
214214
215- let ( blobs, proofs) : ( Vec < _ > , Vec < _ > ) = response
215+ let Some ( blobs_and_proofs) = response else {
216+ debug ! ( num_expected_blobs, "No blobs fetched from the EL" ) ;
217+ inc_counter ( & metrics:: BLOBS_FROM_EL_MISS_TOTAL ) ;
218+ return Ok ( None ) ;
219+ } ;
220+
221+ let ( blobs, proofs) : ( Vec < _ > , Vec < _ > ) = blobs_and_proofs
216222 . into_iter ( )
217- . filter_map ( |blob_and_proof_opt| {
218- blob_and_proof_opt. map ( |blob_and_proof| {
219- let BlobAndProofV2 { blob, proofs } = blob_and_proof;
220- ( blob, proofs)
221- } )
223+ . map ( |blob_and_proof| {
224+ let BlobAndProofV2 { blob, proofs } = blob_and_proof;
225+ ( blob, proofs)
222226 } )
223227 . unzip ( ) ;
224228
225229 let num_fetched_blobs = blobs. len ( ) ;
226230 metrics:: observe ( & metrics:: BLOBS_FROM_EL_RECEIVED , num_fetched_blobs as f64 ) ;
227231
228- // Partial blobs response isn't useful for PeerDAS, so we don't bother building and publishing data columns.
229232 if num_fetched_blobs != num_expected_blobs {
230- debug ! (
231- info = "Unable to compute data columns" ,
232- num_fetched_blobs, num_expected_blobs, "Not all blobs fetched from the EL"
233+ // This scenario is not supposed to happen if the EL is spec compliant.
234+ // It should either return all requested blobs or none, but NOT partial responses.
235+ // If we attempt to compute columns with partial blobs, we'd end up with invalid columns.
236+ warn ! (
237+ num_fetched_blobs,
238+ num_expected_blobs, "The EL did not return all requested blobs"
233239 ) ;
234240 inc_counter ( & metrics:: BLOBS_FROM_EL_MISS_TOTAL ) ;
235241 return Ok ( None ) ;
236- } else {
237- inc_counter ( & metrics:: BLOBS_FROM_EL_HIT_TOTAL ) ;
238242 }
239243
244+ inc_counter ( & metrics:: BLOBS_FROM_EL_HIT_TOTAL ) ;
245+
240246 if chain
241247 . canonical_head
242248 . fork_choice_read_lock ( )
0 commit comments