@@ -320,9 +320,15 @@ where
320
320
let segment_header_downloader = SegmentHeaderDownloader :: new ( node) ;
321
321
322
322
while let Some ( reason) = notifications. next ( ) . await {
323
+ info ! (
324
+ target: LOG_TARGET ,
325
+ ?reason,
326
+ ?last_completed_segment_index,
327
+ ?last_processed_block_number,
328
+ "Received notification to sync from DSN, deactivating substrate sync"
329
+ ) ;
323
330
pause_sync. store ( true , Ordering :: Release ) ;
324
331
325
- info ! ( target: LOG_TARGET , ?reason, "Received notification to sync from DSN" ) ;
326
332
// TODO: Maybe handle failed block imports, additional helpful logging
327
333
let import_blocks_from_dsn_fut = import_blocks_from_dsn (
328
334
& segment_headers_store,
@@ -349,6 +355,12 @@ where
349
355
. map ( |diff| diff < chain_constants. confirmation_depth_k ( ) . into ( ) )
350
356
. unwrap_or_default ( )
351
357
{
358
+ debug ! (
359
+ target: LOG_TARGET ,
360
+ best_block = ?info. best_number,
361
+ ?target_block_number,
362
+ "Node is almost synced, stopping DSN sync until the next notification"
363
+ ) ;
352
364
break ;
353
365
}
354
366
}
@@ -357,7 +369,13 @@ where
357
369
select ! {
358
370
result = import_blocks_from_dsn_fut. fuse( ) => {
359
371
if let Err ( error) = result {
360
- warn!( target: LOG_TARGET , %error, "Error when syncing blocks from DSN" ) ;
372
+ warn!(
373
+ target: LOG_TARGET ,
374
+ %error,
375
+ ?last_completed_segment_index,
376
+ ?last_processed_block_number,
377
+ "Error when syncing blocks from DSN, stopping DSN sync until the next notification"
378
+ ) ;
361
379
}
362
380
}
363
381
_ = wait_almost_synced_fut. fuse( ) => {
0 commit comments