diff --git a/portalnet/src/config.rs b/portalnet/src/config.rs index 8b9c093cd..ad429e98a 100644 --- a/portalnet/src/config.rs +++ b/portalnet/src/config.rs @@ -3,8 +3,6 @@ use std::path::PathBuf; use ethereum_types::H256; -use crate::metrics::overlay::OverlayMetrics; -use crate::metrics::portalnet::PORTALNET_METRICS; use ethportal_api::types::bootnodes::Bootnodes; use ethportal_api::types::cli::TrinConfig; use ethportal_api::types::distance::Distance; @@ -24,7 +22,6 @@ pub struct PortalnetConfig { pub internal_ip: bool, pub no_stun: bool, pub node_addr_cache_capacity: usize, - pub metrics: OverlayMetrics, pub enr_file_location: Option, } @@ -57,7 +54,6 @@ impl Default for PortalnetConfig { internal_ip: false, no_stun: false, node_addr_cache_capacity: NODE_ADDR_CACHE_CAPACITY, - metrics: PORTALNET_METRICS.overlay.clone(), enr_file_location: None, } } diff --git a/portalnet/src/overlay.rs b/portalnet/src/overlay.rs index bbf1a986c..221b4be07 100644 --- a/portalnet/src/overlay.rs +++ b/portalnet/src/overlay.rs @@ -27,6 +27,7 @@ use crate::{ discovery::{Discovery, UtpEnr}, find::query_info::{FindContentResult, RecursiveFindContentResult}, metrics::overlay::OverlayMetrics, + metrics::portalnet::PORTALNET_METRICS, overlay_service::{ OverlayCommand, OverlayRequest, OverlayRequestError, OverlayService, RequestDirection, UTP_CONN_CFG, @@ -132,7 +133,6 @@ where store: Arc>, protocol: ProtocolId, validator: Arc, - metrics: OverlayMetrics, ) -> Self { let kbuckets = Arc::new(RwLock::new(KBucketsTable::new( discovery.local_enr().node_id().into(), @@ -149,7 +149,7 @@ where config.ping_queue_interval, protocol.clone(), Arc::clone(&utp_socket), - metrics.clone(), + PORTALNET_METRICS.overlay.clone(), Arc::clone(&validator), config.query_timeout, config.query_peer_timeout, @@ -169,7 +169,7 @@ where phantom_content_key: PhantomData, phantom_metric: PhantomData, validator, - metrics, + metrics: PORTALNET_METRICS.overlay.clone(), } } diff --git a/portalnet/tests/overlay.rs b/portalnet/tests/overlay.rs index bced89e2e..261ac99b5 100644 --- a/portalnet/tests/overlay.rs +++ b/portalnet/tests/overlay.rs @@ -16,7 +16,6 @@ use ethportal_api::utils::bytes::hex_encode_upper; use portalnet::{ config::PortalnetConfig, discovery::{Discovery, Discv5UdpSocket}, - metrics::portalnet::PORTALNET_METRICS, overlay::{OverlayConfig, OverlayProtocol}, storage::{ContentStore, DistanceFunction, MemoryContentStore}, types::messages::{Content, Message, ProtocolId}, @@ -47,7 +46,6 @@ async fn init_overlay( store, protocol, validator, - PORTALNET_METRICS.overlay.clone(), ) .await } diff --git a/trin-beacon/src/network.rs b/trin-beacon/src/network.rs index fc2be91e6..d2a73fe3b 100644 --- a/trin-beacon/src/network.rs +++ b/trin-beacon/src/network.rs @@ -48,7 +48,6 @@ impl BeaconNetwork { storage, ProtocolId::Beacon, validator, - portal_config.metrics.clone(), ) .await; diff --git a/trin-state/src/network.rs b/trin-state/src/network.rs index 0131631f9..fbdc95fc1 100644 --- a/trin-state/src/network.rs +++ b/trin-state/src/network.rs @@ -54,7 +54,6 @@ impl StateNetwork { storage, ProtocolId::State, validator, - portal_config.metrics.clone(), ) .await;