Skip to content

Commit 2e62387

Browse files
authored
feat: use max retries for debug consensus rpc client (#20257)
1 parent 3113325 commit 2e62387

File tree

1 file changed

+9
-2
lines changed
  • crates/consensus/debug-client/src/providers

1 file changed

+9
-2
lines changed

crates/consensus/debug-client/src/providers/rpc.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::BlockProvider;
2-
use alloy_provider::{Network, Provider, ProviderBuilder};
2+
use alloy_provider::{ConnectionConfig, Network, Provider, ProviderBuilder};
33
use alloy_transport::TransportResult;
44
use futures::{Stream, StreamExt};
55
use reth_node_api::Block;
@@ -25,7 +25,14 @@ impl<N: Network, PrimitiveBlock> RpcBlockProvider<N, PrimitiveBlock> {
2525
convert: impl Fn(N::BlockResponse) -> PrimitiveBlock + Send + Sync + 'static,
2626
) -> eyre::Result<Self> {
2727
Ok(Self {
28-
provider: Arc::new(ProviderBuilder::default().connect(rpc_url).await?),
28+
provider: Arc::new(
29+
ProviderBuilder::default()
30+
.connect_with_config(
31+
rpc_url,
32+
ConnectionConfig::default().with_max_retries(u32::MAX),
33+
)
34+
.await?,
35+
),
2936
url: rpc_url.to_string(),
3037
convert: Arc::new(convert),
3138
})

0 commit comments

Comments
 (0)