mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: support DNS in reth.toml for trusted_nodes (#9864)
This commit is contained in:
@ -73,7 +73,6 @@ eyre.workspace = true
|
||||
fdlimit.workspace = true
|
||||
confy.workspace = true
|
||||
rayon.workspace = true
|
||||
backon.workspace = true
|
||||
|
||||
# tracing
|
||||
tracing.workspace = true
|
||||
|
||||
@ -5,7 +5,6 @@ use crate::{
|
||||
hooks::OnComponentInitializedHook,
|
||||
BuilderContext, NodeAdapter,
|
||||
};
|
||||
use backon::{ConstantBuilder, Retryable};
|
||||
use eyre::Context;
|
||||
use rayon::ThreadPoolBuilder;
|
||||
use reth_auto_seal_consensus::MiningMode;
|
||||
@ -238,17 +237,11 @@ impl LaunchContextWith<WithConfigs> {
|
||||
if !self.attachment.config.network.trusted_peers.is_empty() {
|
||||
info!(target: "reth::cli", "Adding trusted nodes");
|
||||
|
||||
// resolve trusted peers if they use a domain instead of dns
|
||||
let resolved = futures::future::try_join_all(
|
||||
self.attachment.config.network.trusted_peers.iter().map(|peer| async move {
|
||||
let backoff = ConstantBuilder::default()
|
||||
.with_max_times(self.attachment.config.network.dns_retries);
|
||||
(move || { peer.resolve() })
|
||||
.retry(&backoff)
|
||||
.notify(|err, _| warn!(target: "reth::cli", "Error resolving peer domain: {err}. Retrying..."))
|
||||
.await
|
||||
})).await?;
|
||||
self.attachment.toml_config.peers.trusted_nodes.extend(resolved);
|
||||
self.attachment
|
||||
.toml_config
|
||||
.peers
|
||||
.trusted_nodes
|
||||
.extend(self.attachment.config.network.trusted_peers.clone());
|
||||
}
|
||||
Ok(self)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user