Skip to content

Commit 10a7a93

Browse files
committed
Improve DSN sync logging
1 parent 8e1937f commit 10a7a93

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

crates/subspace-service/src/sync_from_dsn.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,15 @@ where
320320
let segment_header_downloader = SegmentHeaderDownloader::new(node);
321321

322322
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+
);
323330
pause_sync.store(true, Ordering::Release);
324331

325-
info!(target: LOG_TARGET, ?reason, "Received notification to sync from DSN");
326332
// TODO: Maybe handle failed block imports, additional helpful logging
327333
let import_blocks_from_dsn_fut = import_blocks_from_dsn(
328334
&segment_headers_store,
@@ -349,6 +355,12 @@ where
349355
.map(|diff| diff < chain_constants.confirmation_depth_k().into())
350356
.unwrap_or_default()
351357
{
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+
);
352364
break;
353365
}
354366
}
@@ -357,7 +369,13 @@ where
357369
select! {
358370
result = import_blocks_from_dsn_fut.fuse() => {
359371
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+
);
361379
}
362380
}
363381
_ = wait_almost_synced_fut.fuse() => {

0 commit comments

Comments
 (0)