Skip to content

Commit

Permalink
log(downloader): log count instead of distance (#5860)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored Dec 26, 2023
1 parent 742c3e2 commit 8d6e976
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/net/downloaders/src/bodies/bodies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,20 +313,20 @@ where
}

// Check if the provided range is the next expected range.
let count = *range.end() - *range.start() + 1; // range is inclusive
let is_next_consecutive_range = *range.start() == *self.download_range.end() + 1;
let distance = *range.end() - *range.start();
if is_next_consecutive_range {
// New range received.
tracing::trace!(target: "downloaders::bodies", ?range, "New download range set");
info!(target: "downloaders::bodies", distance, "Downloading bodies {range:?}");
info!(target: "downloaders::bodies", count, ?range, "Downloading bodies");
self.download_range = range;
return Ok(())
}

// The block range is reset. This can happen either after unwind or after the bodies were
// written by external services (e.g. BlockchainTree).
tracing::trace!(target: "downloaders::bodies", ?range, prev_range = ?self.download_range, "Download range reset");
info!(target: "downloaders::bodies", distance, "Downloading bodies {range:?}");
info!(target: "downloaders::bodies", count, ?range, "Downloading bodies");
self.clear();
self.download_range = range;
Ok(())
Expand Down

0 comments on commit 8d6e976

Please sign in to comment.