@@ -120,37 +120,37 @@ func (s *Service) FinalizeSidecars(
120120 // caught up. We don't need to process sidecars unless they are within DA period.
121121 //
122122 //#nosec: G115 // SyncingToHeight will never be negative.
123- if s .chainSpec .WithinDAPeriod (blk .GetSlot (), math .Slot (syncingToHeight )) {
124- // If blobs were passed in (normal consensus mode), use them
123+ if ! s .chainSpec .WithinDAPeriod (blk .GetSlot (), math .Slot (syncingToHeight )) {
124+ // Here outside Data Availability window. Just log if needed
125125 if len (blobs ) > 0 {
126- return processBlobsFunc (blobs )
126+ s .logger .Info (
127+ "Skipping blob processing outside of Data Availability Period" ,
128+ "slot" , blk .GetSlot ().Base10 (), "head" , syncingToHeight ,
129+ )
127130 }
128-
129- // Check the block to see if there should be blobs
130- expectedBlobs := len (blk .GetBody ().GetBlobKzgCommitments ())
131- if expectedBlobs == 0 {
132- return nil // No blobs expected for this block
133- }
134-
135- // Queue the blob fetch request to be handled asynchronously
136- err := s .blobFetcher .QueueBlobRequest (blk .GetSlot (), blk )
137- if err != nil {
138- // TODO: should we log and continue here instead of erroring out?
139- return fmt .Errorf ("failed to queue blob fetch request for slot %d: %w" , blk .GetSlot ().Unwrap (), err )
140- }
141-
142- // Return immediately without waiting for blobs
143- // The background fetcher will handle retrieval and storage
144131 return nil
145132 }
146133
147- // Here outside Data Availability window. Just log if needed
134+ // If blobs were passed in (normal consensus mode), use them
148135 if len (blobs ) > 0 {
149- s .logger .Info (
150- "Skipping blob processing outside of Data Availability Period" ,
151- "slot" , blk .GetSlot ().Base10 (), "head" , syncingToHeight ,
152- )
136+ return processBlobsFunc (blobs )
153137 }
138+
139+ // Check the block to see if there should be blobs
140+ expectedBlobs := len (blk .GetBody ().GetBlobKzgCommitments ())
141+ if expectedBlobs == 0 {
142+ return nil // No blobs expected for this block
143+ }
144+
145+ // Queue the blob fetch request to be handled asynchronously
146+ err := s .blobFetcher .QueueBlobRequest (blk )
147+ if err != nil {
148+ // TODO: should we log and continue here instead of erroring out?
149+ return fmt .Errorf ("failed to queue blob fetch request for slot %d: %w" , blk .GetSlot ().Unwrap (), err )
150+ }
151+
152+ // Return immediately without waiting for blobs
153+ // The background fetcher will handle retrieval and storage
154154 return nil
155155}
156156
0 commit comments