use eyre::eyre;
use reth_network_types::{PeersConfig, SessionsConfig};
use reth_prune_types::PruneModes;
use reth_stages_types::ExecutionStageThresholds;
use serde::{Deserialize, Deserializer, Serialize};
use std::{
ffi::OsStr,
fs,
path::{Path, PathBuf},
time::Duration,
};
const EXTENSION: &str = "toml";
pub const DEFAULT_BLOCK_INTERVAL: usize = 5;
#[derive(Debug, Clone, Default, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct Config {
pub stages: StageConfig,
#[serde(skip_serializing_if = "Option::is_none")]
pub prune: Option<PruneConfig>,
pub peers: PeersConfig,
pub sessions: SessionsConfig,
}
impl Config {
pub fn from_path(path: impl AsRef<Path>) -> eyre::Result<Self> {
let path = path.as_ref();
match fs::read_to_string(path) {
Ok(cfg_string) => {
toml::from_str(&cfg_string).map_err(|e| eyre!("Failed to parse TOML: {e}"))
}
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
if let Some(parent) = path.parent() {
fs::create_dir_all(parent)
.map_err(|e| eyre!("Failed to create directory: {e}"))?;
}
let cfg = Self::default();
let s = toml::to_string_pretty(&cfg)
.map_err(|e| eyre!("Failed to serialize to TOML: {e}"))?;
fs::write(path, s).map_err(|e| eyre!("Failed to write configuration file: {e}"))?;
Ok(cfg)
}
Err(e) => Err(eyre!("Failed to load configuration: {e}")),
}
}
pub fn peers_config_with_basic_nodes_from_file(
&self,
peers_file: Option<&Path>,
) -> PeersConfig {
self.peers
.clone()
.with_basic_nodes_from_file(peers_file)
.unwrap_or_else(|_| self.peers.clone())
}
pub fn save(&self, path: &Path) -> Result<(), std::io::Error> {
if path.extension() != Some(OsStr::new(EXTENSION)) {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
format!("reth config file extension must be '{EXTENSION}'"),
));
}
std::fs::write(
path,
toml::to_string(self)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string()))?,
)
}
pub fn update_prune_config(&mut self, prune_config: PruneConfig) {
self.prune = Some(prune_config);
}
}
#[derive(Debug, Clone, Default, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct StageConfig {
pub headers: HeadersConfig,
pub bodies: BodiesConfig,
pub sender_recovery: SenderRecoveryConfig,
pub execution: ExecutionConfig,
pub prune: PruneStageConfig,
pub account_hashing: HashingConfig,
pub storage_hashing: HashingConfig,
pub merkle: MerkleConfig,
pub transaction_lookup: TransactionLookupConfig,
pub index_account_history: IndexHistoryConfig,
pub index_storage_history: IndexHistoryConfig,
pub etl: EtlConfig,
}
impl StageConfig {
pub fn execution_external_clean_threshold(&self) -> u64 {
self.merkle
.clean_threshold
.max(self.account_hashing.clean_threshold)
.max(self.storage_hashing.clean_threshold)
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct HeadersConfig {
pub downloader_max_concurrent_requests: usize,
pub downloader_min_concurrent_requests: usize,
pub downloader_max_buffered_responses: usize,
pub downloader_request_limit: u64,
pub commit_threshold: u64,
}
impl Default for HeadersConfig {
fn default() -> Self {
Self {
commit_threshold: 10_000,
downloader_request_limit: 1_000,
downloader_max_concurrent_requests: 100,
downloader_min_concurrent_requests: 5,
downloader_max_buffered_responses: 100,
}
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct BodiesConfig {
pub downloader_request_limit: u64,
pub downloader_stream_batch_size: usize,
pub downloader_max_buffered_blocks_size_bytes: usize,
pub downloader_min_concurrent_requests: usize,
pub downloader_max_concurrent_requests: usize,
}
impl Default for BodiesConfig {
fn default() -> Self {
Self {
downloader_request_limit: 200,
downloader_stream_batch_size: 1_000,
downloader_max_buffered_blocks_size_bytes: 2 * 1024 * 1024 * 1024, downloader_min_concurrent_requests: 5,
downloader_max_concurrent_requests: 100,
}
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct SenderRecoveryConfig {
pub commit_threshold: u64,
}
impl Default for SenderRecoveryConfig {
fn default() -> Self {
Self { commit_threshold: 5_000_000 }
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct ExecutionConfig {
pub max_blocks: Option<u64>,
pub max_changes: Option<u64>,
pub max_cumulative_gas: Option<u64>,
#[serde(
serialize_with = "humantime_serde::serialize",
deserialize_with = "deserialize_duration"
)]
pub max_duration: Option<Duration>,
}
impl Default for ExecutionConfig {
fn default() -> Self {
Self {
max_blocks: Some(500_000),
max_changes: Some(5_000_000),
max_cumulative_gas: Some(30_000_000 * 50_000),
max_duration: Some(Duration::from_secs(10 * 60)),
}
}
}
impl From<ExecutionConfig> for ExecutionStageThresholds {
fn from(config: ExecutionConfig) -> Self {
Self {
max_blocks: config.max_blocks,
max_changes: config.max_changes,
max_cumulative_gas: config.max_cumulative_gas,
max_duration: config.max_duration,
}
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct PruneStageConfig {
pub commit_threshold: usize,
}
impl Default for PruneStageConfig {
fn default() -> Self {
Self { commit_threshold: 1_000_000 }
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct HashingConfig {
pub clean_threshold: u64,
pub commit_threshold: u64,
}
impl Default for HashingConfig {
fn default() -> Self {
Self { clean_threshold: 500_000, commit_threshold: 100_000 }
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct MerkleConfig {
pub clean_threshold: u64,
}
impl Default for MerkleConfig {
fn default() -> Self {
Self { clean_threshold: 5_000 }
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct TransactionLookupConfig {
pub chunk_size: u64,
}
impl Default for TransactionLookupConfig {
fn default() -> Self {
Self { chunk_size: 5_000_000 }
}
}
#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct EtlConfig {
pub dir: Option<PathBuf>,
pub file_size: usize,
}
impl Default for EtlConfig {
fn default() -> Self {
Self { dir: None, file_size: Self::default_file_size() }
}
}
impl EtlConfig {
pub const fn new(dir: Option<PathBuf>, file_size: usize) -> Self {
Self { dir, file_size }
}
pub fn from_datadir(path: &Path) -> PathBuf {
path.join("etl-tmp")
}
pub const fn default_file_size() -> usize {
500 * (1024 * 1024)
}
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct IndexHistoryConfig {
pub commit_threshold: u64,
}
impl Default for IndexHistoryConfig {
fn default() -> Self {
Self { commit_threshold: 100_000 }
}
}
#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct PruneConfig {
pub block_interval: usize,
#[serde(alias = "parts")]
pub segments: PruneModes,
}
impl Default for PruneConfig {
fn default() -> Self {
Self { block_interval: DEFAULT_BLOCK_INTERVAL, segments: PruneModes::none() }
}
}
impl PruneConfig {
pub fn has_receipts_pruning(&self) -> bool {
self.segments.receipts.is_some() || !self.segments.receipts_log_filter.is_empty()
}
pub fn merge(&mut self, other: Option<Self>) {
let Some(other) = other else { return };
let Self {
block_interval,
segments:
PruneModes {
sender_recovery,
transaction_lookup,
receipts,
account_history,
storage_history,
receipts_log_filter,
},
} = other;
if self.block_interval == DEFAULT_BLOCK_INTERVAL {
self.block_interval = block_interval;
}
self.segments.sender_recovery = self.segments.sender_recovery.or(sender_recovery);
self.segments.transaction_lookup = self.segments.transaction_lookup.or(transaction_lookup);
self.segments.receipts = self.segments.receipts.or(receipts);
self.segments.account_history = self.segments.account_history.or(account_history);
self.segments.storage_history = self.segments.storage_history.or(storage_history);
if self.segments.receipts_log_filter.0.is_empty() && !receipts_log_filter.0.is_empty() {
self.segments.receipts_log_filter = receipts_log_filter;
}
}
}
fn deserialize_duration<'de, D>(deserializer: D) -> Result<Option<Duration>, D::Error>
where
D: Deserializer<'de>,
{
#[derive(Deserialize)]
#[serde(untagged)]
enum AnyDuration {
#[serde(deserialize_with = "humantime_serde::deserialize")]
Human(Option<Duration>),
Duration(Option<Duration>),
}
AnyDuration::deserialize(deserializer).map(|d| match d {
AnyDuration::Human(duration) | AnyDuration::Duration(duration) => duration,
})
}
#[cfg(test)]
mod tests {
use super::{Config, EXTENSION};
use crate::PruneConfig;
use alloy_primitives::Address;
use reth_network_peers::TrustedPeer;
use reth_prune_types::{PruneMode, PruneModes, ReceiptsLogPruneConfig};
use std::{collections::BTreeMap, path::Path, str::FromStr, time::Duration};
fn with_tempdir(filename: &str, proc: fn(&std::path::Path)) {
let temp_dir = tempfile::tempdir().unwrap();
let config_path = temp_dir.path().join(filename).with_extension(EXTENSION);
proc(&config_path);
temp_dir.close().unwrap()
}
fn with_config_path(test_fn: fn(&Path)) {
let config_dir = tempfile::tempdir().expect("creating test fixture failed");
let config_path =
config_dir.path().join("example-app").join("example-config").with_extension("toml");
test_fn(&config_path);
config_dir.close().expect("removing test fixture failed");
}
#[test]
fn test_load_path_works() {
with_config_path(|path| {
let config = Config::from_path(path).expect("load_path failed");
assert_eq!(config, Config::default());
})
}
#[test]
fn test_load_path_reads_existing_config() {
with_config_path(|path| {
let config = Config::default();
if let Some(parent) = path.parent() {
std::fs::create_dir_all(parent).expect("Failed to create directories");
}
std::fs::write(path, toml::to_string(&config).unwrap())
.expect("Failed to write config");
let loaded = Config::from_path(path).expect("load_path failed");
assert_eq!(config, loaded);
})
}
#[test]
fn test_load_path_fails_on_invalid_toml() {
with_config_path(|path| {
let invalid_toml = "invalid toml data";
if let Some(parent) = path.parent() {
std::fs::create_dir_all(parent).expect("Failed to create directories");
}
std::fs::write(path, invalid_toml).expect("Failed to write invalid TOML");
let result = Config::from_path(path);
assert!(result.is_err());
})
}
#[test]
fn test_load_path_creates_directory_if_not_exists() {
with_config_path(|path| {
let parent = path.parent().unwrap();
assert!(!parent.exists());
let config = Config::from_path(path).expect("load_path failed");
assert_eq!(config, Config::default());
assert!(parent.exists());
assert!(path.exists());
});
}
#[test]
fn test_store_config() {
with_tempdir("config-store-test", |config_path| {
let config = Config::default();
std::fs::write(
config_path,
toml::to_string(&config).expect("Failed to serialize config"),
)
.expect("Failed to write config file");
})
}
#[test]
fn test_store_config_method() {
with_tempdir("config-store-test-method", |config_path| {
let config = Config::default();
config.save(config_path).expect("Failed to store config");
})
}
#[test]
fn test_load_config() {
with_tempdir("config-load-test", |config_path| {
let config = Config::default();
std::fs::write(
config_path,
toml::to_string(&config).expect("Failed to serialize config"),
)
.expect("Failed to write config file");
let loaded_config = Config::from_path(config_path).unwrap();
assert_eq!(config, loaded_config);
})
}
#[test]
fn test_load_execution_stage() {
with_tempdir("config-load-test", |config_path| {
let mut config = Config::default();
config.stages.execution.max_duration = Some(Duration::from_secs(10 * 60));
std::fs::write(
config_path,
toml::to_string(&config).expect("Failed to serialize config"),
)
.expect("Failed to write config file");
let loaded_config = Config::from_path(config_path).unwrap();
assert_eq!(config, loaded_config);
})
}
#[test]
fn test_backwards_compatibility() {
let alpha_0_0_8 = r"#
[stages.headers]
downloader_max_concurrent_requests = 100
downloader_min_concurrent_requests = 5
downloader_max_buffered_responses = 100
downloader_request_limit = 1000
commit_threshold = 10000
[stages.bodies]
downloader_request_limit = 200
downloader_stream_batch_size = 1000
downloader_max_buffered_blocks_size_bytes = 2147483648
downloader_min_concurrent_requests = 5
downloader_max_concurrent_requests = 100
[stages.sender_recovery]
commit_threshold = 5000000
[stages.execution]
max_blocks = 500000
max_changes = 5000000
[stages.account_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.storage_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.merkle]
clean_threshold = 50000
[stages.transaction_lookup]
chunk_size = 5000000
[stages.index_account_history]
commit_threshold = 100000
[stages.index_storage_history]
commit_threshold = 100000
[peers]
refill_slots_interval = '1s'
trusted_nodes = []
connect_trusted_nodes_only = false
max_backoff_count = 5
ban_duration = '12h'
[peers.connection_info]
max_outbound = 100
max_inbound = 30
[peers.reputation_weights]
bad_message = -16384
bad_block = -16384
bad_transactions = -16384
already_seen_transactions = 0
timeout = -4096
bad_protocol = -2147483648
failed_to_connect = -25600
dropped = -4096
[peers.backoff_durations]
low = '30s'
medium = '3m'
high = '15m'
max = '1h'
[sessions]
session_command_buffer = 32
session_event_buffer = 260
[sessions.limits]
[sessions.initial_internal_request_timeout]
secs = 20
nanos = 0
[sessions.protocol_breach_request_timeout]
secs = 120
nanos = 0
[prune]
block_interval = 5
[prune.parts]
sender_recovery = { distance = 16384 }
transaction_lookup = 'full'
receipts = { before = 1920000 }
account_history = { distance = 16384 }
storage_history = { distance = 16384 }
[prune.parts.receipts_log_filter]
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' = { before = 17000000 }
'0xdac17f958d2ee523a2206206994597c13d831ec7' = { distance = 1000 }
#";
let _conf: Config = toml::from_str(alpha_0_0_8).unwrap();
let alpha_0_0_11 = r"#
[prune.segments]
sender_recovery = { distance = 16384 }
transaction_lookup = 'full'
receipts = { before = 1920000 }
account_history = { distance = 16384 }
storage_history = { distance = 16384 }
[prune.segments.receipts_log_filter]
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' = { before = 17000000 }
'0xdac17f958d2ee523a2206206994597c13d831ec7' = { distance = 1000 }
#";
let _conf: Config = toml::from_str(alpha_0_0_11).unwrap();
let alpha_0_0_18 = r"#
[stages.headers]
downloader_max_concurrent_requests = 100
downloader_min_concurrent_requests = 5
downloader_max_buffered_responses = 100
downloader_request_limit = 1000
commit_threshold = 10000
[stages.total_difficulty]
commit_threshold = 100000
[stages.bodies]
downloader_request_limit = 200
downloader_stream_batch_size = 1000
downloader_max_buffered_blocks_size_bytes = 2147483648
downloader_min_concurrent_requests = 5
downloader_max_concurrent_requests = 100
[stages.sender_recovery]
commit_threshold = 5000000
[stages.execution]
max_blocks = 500000
max_changes = 5000000
max_cumulative_gas = 1500000000000
[stages.execution.max_duration]
secs = 600
nanos = 0
[stages.account_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.storage_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.merkle]
clean_threshold = 50000
[stages.transaction_lookup]
commit_threshold = 5000000
[stages.index_account_history]
commit_threshold = 100000
[stages.index_storage_history]
commit_threshold = 100000
[peers]
refill_slots_interval = '5s'
trusted_nodes = []
connect_trusted_nodes_only = false
max_backoff_count = 5
ban_duration = '12h'
[peers.connection_info]
max_outbound = 100
max_inbound = 30
max_concurrent_outbound_dials = 10
[peers.reputation_weights]
bad_message = -16384
bad_block = -16384
bad_transactions = -16384
already_seen_transactions = 0
timeout = -4096
bad_protocol = -2147483648
failed_to_connect = -25600
dropped = -4096
bad_announcement = -1024
[peers.backoff_durations]
low = '30s'
medium = '3m'
high = '15m'
max = '1h'
[sessions]
session_command_buffer = 32
session_event_buffer = 260
[sessions.limits]
[sessions.initial_internal_request_timeout]
secs = 20
nanos = 0
[sessions.protocol_breach_request_timeout]
secs = 120
nanos = 0
#";
let conf: Config = toml::from_str(alpha_0_0_18).unwrap();
assert_eq!(conf.stages.execution.max_duration, Some(Duration::from_secs(10 * 60)));
let alpha_0_0_19 = r"#
[stages.headers]
downloader_max_concurrent_requests = 100
downloader_min_concurrent_requests = 5
downloader_max_buffered_responses = 100
downloader_request_limit = 1000
commit_threshold = 10000
[stages.total_difficulty]
commit_threshold = 100000
[stages.bodies]
downloader_request_limit = 200
downloader_stream_batch_size = 1000
downloader_max_buffered_blocks_size_bytes = 2147483648
downloader_min_concurrent_requests = 5
downloader_max_concurrent_requests = 100
[stages.sender_recovery]
commit_threshold = 5000000
[stages.execution]
max_blocks = 500000
max_changes = 5000000
max_cumulative_gas = 1500000000000
max_duration = '10m'
[stages.account_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.storage_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.merkle]
clean_threshold = 50000
[stages.transaction_lookup]
commit_threshold = 5000000
[stages.index_account_history]
commit_threshold = 100000
[stages.index_storage_history]
commit_threshold = 100000
[peers]
refill_slots_interval = '5s'
trusted_nodes = []
connect_trusted_nodes_only = false
max_backoff_count = 5
ban_duration = '12h'
[peers.connection_info]
max_outbound = 100
max_inbound = 30
max_concurrent_outbound_dials = 10
[peers.reputation_weights]
bad_message = -16384
bad_block = -16384
bad_transactions = -16384
already_seen_transactions = 0
timeout = -4096
bad_protocol = -2147483648
failed_to_connect = -25600
dropped = -4096
bad_announcement = -1024
[peers.backoff_durations]
low = '30s'
medium = '3m'
high = '15m'
max = '1h'
[sessions]
session_command_buffer = 32
session_event_buffer = 260
[sessions.limits]
[sessions.initial_internal_request_timeout]
secs = 20
nanos = 0
[sessions.protocol_breach_request_timeout]
secs = 120
nanos = 0
#";
let _conf: Config = toml::from_str(alpha_0_0_19).unwrap();
}
#[test]
fn test_backwards_compatibility_prune_full() {
let s = r"#
[prune]
block_interval = 5
[prune.segments]
sender_recovery = { distance = 16384 }
transaction_lookup = 'full'
receipts = { distance = 16384 }
#";
let _conf: Config = toml::from_str(s).unwrap();
let s = r"#
[prune]
block_interval = 5
[prune.segments]
sender_recovery = { distance = 16384 }
transaction_lookup = 'full'
receipts = 'full'
#";
let err = toml::from_str::<Config>(s).unwrap_err().to_string();
assert!(err.contains("invalid value: string \"full\""), "{}", err);
}
#[test]
fn test_prune_config_merge() {
let mut config1 = PruneConfig {
block_interval: 5,
segments: PruneModes {
sender_recovery: Some(PruneMode::Full),
transaction_lookup: None,
receipts: Some(PruneMode::Distance(1000)),
account_history: None,
storage_history: Some(PruneMode::Before(5000)),
receipts_log_filter: ReceiptsLogPruneConfig(BTreeMap::from([(
Address::random(),
PruneMode::Full,
)])),
},
};
let config2 = PruneConfig {
block_interval: 10,
segments: PruneModes {
sender_recovery: Some(PruneMode::Distance(500)),
transaction_lookup: Some(PruneMode::Full),
receipts: Some(PruneMode::Full),
account_history: Some(PruneMode::Distance(2000)),
storage_history: Some(PruneMode::Distance(3000)),
receipts_log_filter: ReceiptsLogPruneConfig(BTreeMap::from([
(Address::random(), PruneMode::Distance(1000)),
(Address::random(), PruneMode::Before(2000)),
])),
},
};
let original_filter = config1.segments.receipts_log_filter.clone();
config1.merge(Some(config2));
assert_eq!(config1.block_interval, 10);
assert_eq!(config1.segments.sender_recovery, Some(PruneMode::Full));
assert_eq!(config1.segments.transaction_lookup, Some(PruneMode::Full));
assert_eq!(config1.segments.receipts, Some(PruneMode::Distance(1000)));
assert_eq!(config1.segments.account_history, Some(PruneMode::Distance(2000)));
assert_eq!(config1.segments.storage_history, Some(PruneMode::Before(5000)));
assert_eq!(config1.segments.receipts_log_filter, original_filter);
}
#[test]
fn test_conf_trust_nodes_only() {
let trusted_nodes_only = r"#
[peers]
trusted_nodes_only = true
#";
let conf: Config = toml::from_str(trusted_nodes_only).unwrap();
assert!(conf.peers.trusted_nodes_only);
let trusted_nodes_only = r"#
[peers]
connect_trusted_nodes_only = true
#";
let conf: Config = toml::from_str(trusted_nodes_only).unwrap();
assert!(conf.peers.trusted_nodes_only);
}
#[test]
fn test_can_support_dns_in_trusted_nodes() {
let reth_toml = r#"
[peers]
trusted_nodes = [
"enode://0401e494dbd0c84c5c0f72adac5985d2f2525e08b68d448958aae218f5ac8198a80d1498e0ebec2ce38b1b18d6750f6e61a56b4614c5a6c6cf0981c39aed47dc@34.159.32.127:30303",
"enode://e9675164b5e17b9d9edf0cc2bd79e6b6f487200c74d1331c220abb5b8ee80c2eefbf18213989585e9d0960683e819542e11d4eefb5f2b4019e1e49f9fd8fff18@berav2-bootnode.staketab.org:30303"
]
"#;
let conf: Config = toml::from_str(reth_toml).unwrap();
assert_eq!(conf.peers.trusted_nodes.len(), 2);
let expected_enodes = vec![
"enode://0401e494dbd0c84c5c0f72adac5985d2f2525e08b68d448958aae218f5ac8198a80d1498e0ebec2ce38b1b18d6750f6e61a56b4614c5a6c6cf0981c39aed47dc@34.159.32.127:30303",
"enode://e9675164b5e17b9d9edf0cc2bd79e6b6f487200c74d1331c220abb5b8ee80c2eefbf18213989585e9d0960683e819542e11d4eefb5f2b4019e1e49f9fd8fff18@berav2-bootnode.staketab.org:30303",
];
for enode in expected_enodes {
let node = TrustedPeer::from_str(enode).unwrap();
assert!(conf.peers.trusted_nodes.contains(&node));
}
}
}