@@ -14,7 +14,7 @@ mod tests;
14
14
15
15
use crate :: blob_verification:: { GossipBlobError , GossipVerifiedBlob } ;
16
16
use crate :: block_verification_types:: AsBlock ;
17
- use crate :: data_column_verification:: KzgVerifiedCustodyDataColumn ;
17
+ use crate :: data_column_verification:: { KzgVerifiedCustodyDataColumn , KzgVerifiedDataColumn } ;
18
18
#[ cfg_attr( test, double) ]
19
19
use crate :: fetch_blobs:: fetch_blobs_beacon_adapter:: FetchBlobsBeaconAdapter ;
20
20
use crate :: kzg_utils:: blobs_to_data_column_sidecars;
@@ -358,17 +358,24 @@ async fn compute_custody_columns_to_import<T: BeaconChainTypes>(
358
358
// `DataAvailabilityChecker` requires a strict match on custody columns count to
359
359
// consider a block available.
360
360
let mut custody_columns = data_columns_result
361
- . map ( |mut data_columns| {
362
- data_columns. retain ( |col| custody_columns_indices. contains ( & col. index ) ) ;
361
+ . map ( |data_columns| {
363
362
data_columns
363
+ . into_iter ( )
364
+ . filter ( |col| custody_columns_indices. contains ( & col. index ) )
365
+ . map ( |col| {
366
+ KzgVerifiedCustodyDataColumn :: from_asserted_custody (
367
+ KzgVerifiedDataColumn :: from_execution_verified ( col) ,
368
+ )
369
+ } )
370
+ . collect :: < Vec < _ > > ( )
364
371
} )
365
372
. map_err ( FetchEngineBlobError :: DataColumnSidecarError ) ?;
366
373
367
374
// Only consider columns that are not already observed on gossip.
368
- if let Some ( observed_columns) = chain_adapter_cloned. known_for_proposal (
375
+ if let Some ( observed_columns) = chain_adapter_cloned. data_column_known_for_proposal (
369
376
ProposalKey :: new ( block. message ( ) . proposer_index ( ) , block. slot ( ) ) ,
370
377
) {
371
- custody_columns. retain ( |col| !observed_columns. contains ( & col. index ) ) ;
378
+ custody_columns. retain ( |col| !observed_columns. contains ( & col. index ( ) ) ) ;
372
379
if custody_columns. is_empty ( ) {
373
380
return Ok ( vec ! [ ] ) ;
374
381
}
@@ -378,26 +385,13 @@ async fn compute_custody_columns_to_import<T: BeaconChainTypes>(
378
385
if let Some ( known_columns) =
379
386
chain_adapter_cloned. cached_data_column_indexes ( & block_root)
380
387
{
381
- custody_columns. retain ( |col| !known_columns. contains ( & col. index ) ) ;
388
+ custody_columns. retain ( |col| !known_columns. contains ( & col. index ( ) ) ) ;
382
389
if custody_columns. is_empty ( ) {
383
390
return Ok ( vec ! [ ] ) ;
384
391
}
385
392
}
386
393
387
- // KZG verify data columns before publishing. This prevents blobs with invalid
388
- // KZG proofs from the EL making it into the data availability checker. We do not
389
- // immediately add these blobs to the observed blobs/columns cache because we want
390
- // to allow blobs/columns to arrive on gossip and be accepted (and propagated) while
391
- // we are waiting to publish. Just before publishing we will observe the blobs/columns
392
- // and only proceed with publishing if they are not yet seen.
393
- let verified = chain_adapter_cloned
394
- . verify_data_columns_kzg ( custody_columns)
395
- . map_err ( FetchEngineBlobError :: KzgError ) ?;
396
-
397
- Ok ( verified
398
- . into_iter ( )
399
- . map ( KzgVerifiedCustodyDataColumn :: from_asserted_custody)
400
- . collect ( ) )
394
+ Ok ( custody_columns)
401
395
} ,
402
396
"compute_custody_columns_to_import" ,
403
397
)
0 commit comments