Skip to content
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
12 changes: 6 additions & 6 deletions crates/cli/commands/src/p2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + Hardforks + EthereumHardforks>

let header = (move || get_single_header(fetch_client.clone(), id))
.retry(backoff)
.notify(|err, _| println!("Error requesting header: {err}. Retrying..."))
.notify(|err, _| tracing::warn!(target: "reth::cli", error = %err, "Error requesting header. Retrying..."))
.await?;
println!("Successfully downloaded header: {header:?}");
tracing::info!(target: "reth::cli", ?header, "Successfully downloaded header");
}

Subcommands::Body { args, id } => {
Expand All @@ -51,13 +51,13 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + Hardforks + EthereumHardforks>
let hash = match id {
BlockHashOrNumber::Hash(hash) => hash,
BlockHashOrNumber::Number(number) => {
println!("Block number provided. Downloading header first...");
tracing::info!(target: "reth::cli", "Block number provided. Downloading header first...");
let client = fetch_client.clone();
let header = (move || {
get_single_header(client.clone(), BlockHashOrNumber::Number(number))
})
.retry(backoff)
.notify(|err, _| println!("Error requesting header: {err}. Retrying..."))
.notify(|err, _| tracing::warn!(target: "reth::cli", error = %err, "Error requesting header. Retrying..."))
.await?;
header.hash()
}
Expand All @@ -67,7 +67,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + Hardforks + EthereumHardforks>
client.get_block_bodies(vec![hash])
})
.retry(backoff)
.notify(|err, _| println!("Error requesting block: {err}. Retrying..."))
.notify(|err, _| tracing::warn!(target: "reth::cli", error = %err, "Error requesting block. Retrying..."))
.await?
.split();
if result.len() != 1 {
Expand All @@ -77,7 +77,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + Hardforks + EthereumHardforks>
)
}
let body = result.into_iter().next().unwrap();
println!("Successfully downloaded body: {body:?}")
tracing::info!(target: "reth::cli", ?body, "Successfully downloaded body")
}
Subcommands::Rlpx(command) => {
command.execute().await?;
Expand Down
Loading