diff --git a/mev-boost-rs/src/service.rs b/mev-boost-rs/src/service.rs index 3e43d086..d3ece007 100644 --- a/mev-boost-rs/src/service.rs +++ b/mev-boost-rs/src/service.rs @@ -13,6 +13,7 @@ use serde::Deserialize; use std::{future::Future, net::Ipv4Addr, pin::Pin, task::Poll}; use tokio::task::{JoinError, JoinHandle}; use url::Url; +use tracing::info; #[derive(Debug, Deserialize)] pub struct Config { @@ -60,16 +61,23 @@ impl Service { pub fn from(config: Config) -> Self { let relays = parse_relay_endpoints(&config.relays); - if relays.is_empty() { - tracing::error!("no valid relays provided; please restart with correct configuration"); - } - Self { host: config.host, port: config.port, relays, network: config.network } } /// Spawns a new [`RelayMux`] and [`BlindedBlockProviderServer`] task pub fn spawn(self, context: Option) -> Result { let Self { host, port, relays, network } = self; + + if relays.is_empty() { + tracing::error!("no valid relays provided; please restart with correct configuration"); + } else { + let count = relays.len(); + info!("configured with {count} relays"); + for relay in &relays { + info!(?relay, "configured with relay"); + } + } + let context = if let Some(context) = context { context } else { Context::try_from(&network)? }; let relays = relays.into_iter().map(Relay::from); diff --git a/mev-rs/src/relay.rs b/mev-rs/src/relay.rs index 9432a32a..a85d1e92 100644 --- a/mev-rs/src/relay.rs +++ b/mev-rs/src/relay.rs @@ -12,7 +12,7 @@ use ethereum_consensus::{ use std::{fmt, ops::Deref}; use url::Url; -#[derive(Clone, Debug)] +#[derive(Clone)] pub struct RelayEndpoint { url: Url, public_key: BlsPublicKey, @@ -29,6 +29,13 @@ impl TryFrom for RelayEndpoint { } } +impl fmt::Debug for RelayEndpoint { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { + write!(f, "{0}", self.url) + } +} + + #[derive(Clone)] pub struct Relay { provider: BlockProvider,