reth_dns_discovery/
config.rsuse crate::tree::LinkEntry;
use std::{
collections::HashSet,
num::{NonZeroU32, NonZeroUsize},
time::Duration,
};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct DnsDiscoveryConfig {
pub lookup_timeout: Duration,
pub max_requests_per_sec: NonZeroUsize,
pub recheck_interval: Duration,
pub dns_record_cache_limit: NonZeroU32,
pub bootstrap_dns_networks: Option<HashSet<LinkEntry>>,
}
impl Default for DnsDiscoveryConfig {
fn default() -> Self {
Self {
lookup_timeout: Duration::from_secs(5),
max_requests_per_sec: NonZeroUsize::new(3).unwrap(),
recheck_interval: Duration::from_secs(60 * 30),
dns_record_cache_limit: NonZeroU32::new(1_000).unwrap(),
bootstrap_dns_networks: Some(Default::default()),
}
}
}