Skip to content

Commit

Permalink
Remove metrics from PortalnetConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
njgheorghita committed Oct 3, 2023
1 parent 99e2b9b commit 3409192
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
4 changes: 0 additions & 4 deletions portalnet/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<PathBuf>,
}

Expand Down Expand Up @@ -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,
}
}
Expand Down
6 changes: 3 additions & 3 deletions portalnet/src/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -132,7 +133,6 @@ where
store: Arc<RwLock<TStore>>,
protocol: ProtocolId,
validator: Arc<TValidator>,
metrics: OverlayMetrics,
) -> Self {
let kbuckets = Arc::new(RwLock::new(KBucketsTable::new(
discovery.local_enr().node_id().into(),
Expand All @@ -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,
Expand All @@ -169,7 +169,7 @@ where
phantom_content_key: PhantomData,
phantom_metric: PhantomData,
validator,
metrics,
metrics: PORTALNET_METRICS.overlay.clone(),
}
}

Expand Down
2 changes: 0 additions & 2 deletions portalnet/tests/overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -47,7 +46,6 @@ async fn init_overlay(
store,
protocol,
validator,
PORTALNET_METRICS.overlay.clone(),
)
.await
}
Expand Down
1 change: 0 additions & 1 deletion trin-beacon/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ impl BeaconNetwork {
storage,
ProtocolId::Beacon,
validator,
portal_config.metrics.clone(),
)
.await;

Expand Down
1 change: 0 additions & 1 deletion trin-state/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ impl StateNetwork {
storage,
ProtocolId::State,
validator,
portal_config.metrics.clone(),
)
.await;

Expand Down

0 comments on commit 3409192

Please sign in to comment.