@@ -285,34 +285,35 @@ pub fn reconstruct_blobs<E: EthSpec>(
285
285
cell_ids. push ( data_column. index ) ;
286
286
}
287
287
288
- kzg. recover_cells_and_compute_kzg_proofs ( & cell_ids, & cells)
289
- . map_err ( |e| format ! ( "Failed to recover cells and compute KZG proofs: {e:?}" ) )
290
- . and_then ( |( cells, _kzg_proofs) | {
291
- let num_cells_original_blob = cells. len ( ) / 2 ;
292
- let blob_bytes = cells
293
- . into_iter ( )
294
- . take ( num_cells_original_blob)
295
- . flat_map ( |cell| cell. into_iter ( ) )
296
- . collect ( ) ;
297
- let blob = Blob :: < E > :: new ( blob_bytes) . map_err ( |e| format ! ( "{e:?}" ) ) ?;
298
- let kzg_commitment = first_data_column
299
- . kzg_commitments
300
- . get ( row_index)
301
- . ok_or ( format ! ( "Missing KZG commitment for blob {row_index}" ) ) ?;
302
- let kzg_proof = compute_blob_kzg_proof :: < E > ( kzg, & blob, * kzg_commitment)
303
- . map_err ( |e| format ! ( "{e:?}" ) ) ?;
304
-
305
- BlobSidecar :: < E > :: new_with_existing_proof (
306
- row_index,
307
- blob,
308
- signed_block,
309
- first_data_column. signed_block_header . clone ( ) ,
310
- & first_data_column. kzg_commitments_inclusion_proof ,
311
- kzg_proof,
312
- )
313
- . map ( Arc :: new)
314
- . map_err ( |e| format ! ( "{e:?}" ) )
315
- } )
288
+ let ( cells, _kzg_proofs) = kzg
289
+ . recover_cells_and_compute_kzg_proofs ( & cell_ids, & cells)
290
+ . map_err ( |e| format ! ( "Failed to recover cells and compute KZG proofs: {e:?}" ) ) ?;
291
+
292
+ let num_cells_original_blob = cells. len ( ) / 2 ;
293
+ let blob_bytes = cells
294
+ . into_iter ( )
295
+ . take ( num_cells_original_blob)
296
+ . flat_map ( |cell| cell. into_iter ( ) )
297
+ . collect ( ) ;
298
+
299
+ let blob = Blob :: < E > :: new ( blob_bytes) . map_err ( |e| format ! ( "{e:?}" ) ) ?;
300
+ let kzg_commitment = first_data_column
301
+ . kzg_commitments
302
+ . get ( row_index)
303
+ . ok_or ( format ! ( "Missing KZG commitment for blob {row_index}" ) ) ?;
304
+ let kzg_proof = compute_blob_kzg_proof :: < E > ( kzg, & blob, * kzg_commitment)
305
+ . map_err ( |e| format ! ( "{e:?}" ) ) ?;
306
+
307
+ BlobSidecar :: < E > :: new_with_existing_proof (
308
+ row_index,
309
+ blob,
310
+ signed_block,
311
+ first_data_column. signed_block_header . clone ( ) ,
312
+ & first_data_column. kzg_commitments_inclusion_proof ,
313
+ kzg_proof,
314
+ )
315
+ . map ( Arc :: new)
316
+ . map_err ( |e| format ! ( "{e:?}" ) )
316
317
} )
317
318
. collect :: < Result < Vec < _ > , _ > > ( ) ?
318
319
. into ( ) ;
0 commit comments