@@ -2705,15 +2705,15 @@ async fn weak_subjectivity_sync_easy() {
27052705 let num_initial_slots = E :: slots_per_epoch ( ) * 11 ;
27062706 let checkpoint_slot = Slot :: new ( E :: slots_per_epoch ( ) * 9 ) ;
27072707 let slots = ( 1 ..num_initial_slots) . map ( Slot :: new) . collect ( ) ;
2708- weak_subjectivity_sync_test ( slots, checkpoint_slot, None ) . await
2708+ weak_subjectivity_sync_test ( slots, checkpoint_slot, None , true ) . await
27092709}
27102710
27112711#[ tokio:: test]
27122712async fn weak_subjectivity_sync_single_block_batches ( ) {
27132713 let num_initial_slots = E :: slots_per_epoch ( ) * 11 ;
27142714 let checkpoint_slot = Slot :: new ( E :: slots_per_epoch ( ) * 9 ) ;
27152715 let slots = ( 1 ..num_initial_slots) . map ( Slot :: new) . collect ( ) ;
2716- weak_subjectivity_sync_test ( slots, checkpoint_slot, Some ( 1 ) ) . await
2716+ weak_subjectivity_sync_test ( slots, checkpoint_slot, Some ( 1 ) , true ) . await
27172717}
27182718
27192719#[ tokio:: test]
@@ -2727,7 +2727,7 @@ async fn weak_subjectivity_sync_unaligned_advanced_checkpoint() {
27272727 slot <= checkpoint_slot - 3 || slot > checkpoint_slot
27282728 } )
27292729 . collect ( ) ;
2730- weak_subjectivity_sync_test ( slots, checkpoint_slot, None ) . await
2730+ weak_subjectivity_sync_test ( slots, checkpoint_slot, None , true ) . await
27312731}
27322732
27332733#[ tokio:: test]
@@ -2741,7 +2741,7 @@ async fn weak_subjectivity_sync_unaligned_unadvanced_checkpoint() {
27412741 slot <= checkpoint_slot || slot > checkpoint_slot + 3
27422742 } )
27432743 . collect ( ) ;
2744- weak_subjectivity_sync_test ( slots, checkpoint_slot, None ) . await
2744+ weak_subjectivity_sync_test ( slots, checkpoint_slot, None , true ) . await
27452745}
27462746
27472747// Regression test for https://github.com/sigp/lighthouse/issues/4817
@@ -2753,7 +2753,7 @@ async fn weak_subjectivity_sync_skips_at_genesis() {
27532753 let end_slot = E :: slots_per_epoch ( ) * 4 ;
27542754 let slots = ( start_slot..end_slot) . map ( Slot :: new) . collect ( ) ;
27552755 let checkpoint_slot = Slot :: new ( E :: slots_per_epoch ( ) * 2 ) ;
2756- weak_subjectivity_sync_test ( slots, checkpoint_slot, None ) . await
2756+ weak_subjectivity_sync_test ( slots, checkpoint_slot, None , true ) . await
27572757}
27582758
27592759// Checkpoint sync from the genesis state.
@@ -2766,13 +2766,24 @@ async fn weak_subjectivity_sync_from_genesis() {
27662766 let end_slot = E :: slots_per_epoch ( ) * 2 ;
27672767 let slots = ( start_slot..end_slot) . map ( Slot :: new) . collect ( ) ;
27682768 let checkpoint_slot = Slot :: new ( 0 ) ;
2769- weak_subjectivity_sync_test ( slots, checkpoint_slot, None ) . await
2769+ weak_subjectivity_sync_test ( slots, checkpoint_slot, None , true ) . await
2770+ }
2771+
2772+ // Test checkpoint sync without providing blobs - backfill should fetch them.
2773+ #[ tokio:: test]
2774+ async fn weak_subjectivity_sync_without_blobs ( ) {
2775+ let start_slot = 4 ;
2776+ let end_slot = E :: slots_per_epoch ( ) * 4 ;
2777+ let slots = ( start_slot..end_slot) . map ( Slot :: new) . collect ( ) ;
2778+ let checkpoint_slot = Slot :: new ( E :: slots_per_epoch ( ) * 2 ) ;
2779+ weak_subjectivity_sync_test ( slots, checkpoint_slot, None , false ) . await
27702780}
27712781
27722782async fn weak_subjectivity_sync_test (
27732783 slots : Vec < Slot > ,
27742784 checkpoint_slot : Slot ,
27752785 backfill_batch_size : Option < usize > ,
2786+ provide_blobs : bool ,
27762787) {
27772788 // Build an initial chain on one harness, representing a synced node with full history.
27782789 let num_final_blocks = E :: slots_per_epoch ( ) * 2 ;
@@ -2874,7 +2885,11 @@ async fn weak_subjectivity_sync_test(
28742885 . weak_subjectivity_state (
28752886 wss_state,
28762887 wss_block. clone ( ) ,
2877- wss_blobs_opt. clone ( ) ,
2888+ if provide_blobs {
2889+ wss_blobs_opt. clone ( )
2890+ } else {
2891+ None
2892+ } ,
28782893 genesis_state,
28792894 )
28802895 . unwrap ( )
0 commit comments