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

chore(deps): bump backon #1499

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tokio = { version = "1.21", features = ["sync", "macros", "rt-multi-thread"] }
tokio-stream = "0.1"
futures = "0.3.25"
tempfile = { version = "3.3.0" }
backon = "0.2.0"
backon = "0.4"
comfy-table = "6.1.4"
crossterm = "0.25.0"
tui = "0.19.0"
Expand Down
10 changes: 5 additions & 5 deletions bin/reth/src/p2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
args::DiscoveryArgs,
dirs::{ConfigPath, PlatformPath},
};
use backon::{ConstantBackoff, Retryable};
use backon::{ConstantBuilder, Retryable};
use clap::{Parser, Subcommand};
use reth_db::mdbx::{Env, EnvKind, WriteMap};
use reth_discv4::NatResolver;
Expand Down Expand Up @@ -113,12 +113,12 @@ impl Command {

let fetch_client = network.fetch_client().await?;
let retries = self.retries.max(1);
let backoff = ConstantBackoff::default().with_max_times(retries);
let backoff = ConstantBuilder::default().with_max_times(retries);

match self.command {
Subcommands::Header { id } => {
let header = (move || self.get_single_header(fetch_client.clone(), id))
.retry(backoff)
.retry(&backoff)
.notify(|err, _| println!("Error requesting header: {err}. Retrying..."))
.await?;
println!("Successfully downloaded header: {header:?}");
Expand All @@ -135,7 +135,7 @@ impl Command {
BlockHashOrNumber::Number(number),
)
})
.retry(backoff.clone())
.retry(&backoff)
.notify(|err, _| println!("Error requesting header: {err}. Retrying..."))
.await?;
header.hash()
Expand All @@ -145,7 +145,7 @@ impl Command {
let client = fetch_client.clone();
async move { client.get_block_bodies(vec![hash]).await }
})
.retry(backoff)
.retry(&backoff)
.notify(|err, _| println!("Error requesting block: {err}. Retrying..."))
.await?
.split();
Expand Down