Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log(downloader): log count instead of distance #5860

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading