mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
Clean up
This commit is contained in:
@@ -33,6 +33,7 @@ http_api = { workspace = true }
|
||||
hyper = { workspace = true }
|
||||
lighthouse_network = { workspace = true }
|
||||
monitoring_api = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
sensitive_url = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
slasher = { workspace = true }
|
||||
@@ -41,7 +42,6 @@ strum = { workspace = true }
|
||||
task_executor = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
types = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
node_test_rig = { path = "../testing/node_test_rig" }
|
||||
|
||||
@@ -32,6 +32,7 @@ pub use libp2p::{
|
||||
};
|
||||
use logging::crit;
|
||||
use lru::LruCache;
|
||||
use network_utils::discovery_metrics;
|
||||
use ssz::Encode;
|
||||
use std::num::NonZeroUsize;
|
||||
use std::{
|
||||
@@ -45,7 +46,6 @@ use std::{
|
||||
};
|
||||
use tokio::sync::mpsc;
|
||||
use tracing::{debug, error, info, trace, warn};
|
||||
use network_utils::discovery_metrics;
|
||||
use types::{ChainSpec, EnrForkId, EthSpec};
|
||||
|
||||
mod subnet_predicate;
|
||||
@@ -687,7 +687,10 @@ impl<E: EthSpec> Discovery<E> {
|
||||
min_ttl,
|
||||
retries,
|
||||
});
|
||||
metrics::set_gauge(&discovery_metrics::DISCOVERY_QUEUE, self.queued_queries.len() as i64);
|
||||
metrics::set_gauge(
|
||||
&discovery_metrics::DISCOVERY_QUEUE,
|
||||
self.queued_queries.len() as i64,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -722,7 +725,10 @@ impl<E: EthSpec> Discovery<E> {
|
||||
}
|
||||
}
|
||||
// Update the queue metric
|
||||
metrics::set_gauge(&discovery_metrics::DISCOVERY_QUEUE, self.queued_queries.len() as i64);
|
||||
metrics::set_gauge(
|
||||
&discovery_metrics::DISCOVERY_QUEUE,
|
||||
self.queued_queries.len() as i64,
|
||||
);
|
||||
processed
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ pub mod peerdb;
|
||||
|
||||
use crate::peer_manager::peerdb::client::ClientKind;
|
||||
use libp2p::multiaddr;
|
||||
use network_utils::discovery_metrics;
|
||||
use network_utils::enr_ext::{peer_id_to_node_id, EnrExt};
|
||||
pub use peerdb::peer_info::{
|
||||
ConnectionDirection, PeerConnectionStatus, PeerConnectionStatus::*, PeerInfo,
|
||||
@@ -33,7 +34,6 @@ pub use peerdb::sync_status::{SyncInfo, SyncStatus};
|
||||
use std::collections::{hash_map::Entry, HashMap, HashSet};
|
||||
use std::net::IpAddr;
|
||||
use strum::IntoEnumIterator;
|
||||
use network_utils::discovery_metrics;
|
||||
use types::data_column_custody_group::{
|
||||
compute_subnets_from_custody_group, get_custody_groups, CustodyIndex,
|
||||
};
|
||||
|
||||
@@ -10,12 +10,12 @@ bytes = { workspace = true }
|
||||
clap = { workspace = true }
|
||||
clap_utils = { workspace = true }
|
||||
eth2_network_config = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
ethereum_ssz = { workspace = true }
|
||||
hex = { workspace = true }
|
||||
lighthouse_network = { workspace = true }
|
||||
log = { workspace = true }
|
||||
logging = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
@@ -13,6 +13,5 @@ parking_lot = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
tiny-keccak = { version = "2", features = ["keccak"] }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
hex = { workspace = true }
|
||||
hex = { workspace = true }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use std::sync::LazyLock;
|
||||
use metrics::*;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
pub static NAT_OPEN: LazyLock<Result<IntGaugeVec>> = LazyLock::new(|| {
|
||||
try_create_int_gauge_vec(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
pub mod discovery_metrics;
|
||||
pub mod enr_ext;
|
||||
pub mod listen_addr;
|
||||
pub mod unused_port;
|
||||
pub mod discovery_metrics;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use lighthouse_network::{types::SyncState, NetworkGlobals};
|
||||
use network_utils::discovery_metrics;
|
||||
use parking_lot::RwLock;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use sysinfo::{CpuExt, DiskExt, NetworkExt, NetworksExt, System, SystemExt};
|
||||
use network_utils::discovery_metrics;
|
||||
use types::EthSpec;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
@@ -220,33 +220,21 @@ impl NatState {
|
||||
|
||||
/// Observes if NAT traversal is possible.
|
||||
pub fn observe_nat() -> NatState {
|
||||
let discv5_ipv4 = metrics::get_int_gauge(
|
||||
&discovery_metrics::NAT_OPEN,
|
||||
&["discv5_ipv4"],
|
||||
)
|
||||
.map(|g| g.get() == 1)
|
||||
.unwrap_or_default();
|
||||
let discv5_ipv4 = metrics::get_int_gauge(&discovery_metrics::NAT_OPEN, &["discv5_ipv4"])
|
||||
.map(|g| g.get() == 1)
|
||||
.unwrap_or_default();
|
||||
|
||||
let discv5_ipv6 = metrics::get_int_gauge(
|
||||
&discovery_metrics::NAT_OPEN,
|
||||
&["discv5_ipv6"],
|
||||
)
|
||||
.map(|g| g.get() == 1)
|
||||
.unwrap_or_default();
|
||||
let discv5_ipv6 = metrics::get_int_gauge(&discovery_metrics::NAT_OPEN, &["discv5_ipv6"])
|
||||
.map(|g| g.get() == 1)
|
||||
.unwrap_or_default();
|
||||
|
||||
let libp2p_ipv4 = metrics::get_int_gauge(
|
||||
&discovery_metrics::NAT_OPEN,
|
||||
&["libp2p_ipv4"],
|
||||
)
|
||||
.map(|g| g.get() == 1)
|
||||
.unwrap_or_default();
|
||||
let libp2p_ipv4 = metrics::get_int_gauge(&discovery_metrics::NAT_OPEN, &["libp2p_ipv4"])
|
||||
.map(|g| g.get() == 1)
|
||||
.unwrap_or_default();
|
||||
|
||||
let libp2p_ipv6 = metrics::get_int_gauge(
|
||||
&discovery_metrics::NAT_OPEN,
|
||||
&["libp2p_ipv6"],
|
||||
)
|
||||
.map(|g| g.get() == 1)
|
||||
.unwrap_or_default();
|
||||
let libp2p_ipv6 = metrics::get_int_gauge(&discovery_metrics::NAT_OPEN, &["libp2p_ipv6"])
|
||||
.map(|g| g.get() == 1)
|
||||
.unwrap_or_default();
|
||||
|
||||
NatState {
|
||||
discv5_ipv4,
|
||||
|
||||
@@ -30,10 +30,10 @@ ethereum_ssz = { workspace = true }
|
||||
execution_layer = { workspace = true }
|
||||
hex = { workspace = true }
|
||||
lighthouse_network = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
lighthouse_version = { workspace = true }
|
||||
log = { workspace = true }
|
||||
malloc_utils = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
rayon = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -58,6 +58,7 @@ lighthouse_version = { workspace = true }
|
||||
logging = { workspace = true }
|
||||
malloc_utils = { workspace = true }
|
||||
metrics = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
serde_yaml = { workspace = true }
|
||||
@@ -67,7 +68,6 @@ task_executor = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = { workspace = true }
|
||||
types = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
validator_client = { workspace = true }
|
||||
validator_manager = { path = "../validator_manager" }
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ fork_choice = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
hex = { workspace = true }
|
||||
logging = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
reqwest = { workspace = true }
|
||||
sensitive_url = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
@@ -25,4 +26,3 @@ task_executor = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
types = { workspace = true }
|
||||
network_utils = { workspace = true }
|
||||
|
||||
Reference in New Issue
Block a user