diff --git a/Cargo.lock b/Cargo.lock index d42bcd8fc17..24371930e67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,18 +90,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.4" @@ -2687,9 +2675,8 @@ dependencies = [ [[package]] name = "discv5" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f170f4f6ed0e1df52bf43b403899f0081917ecf1500bfe312505cc3b515a8899" +version = "0.10.4" +source = "git+https://github.com/ackintosh/discv5.git?rev=279671c83fd5acea3422c5772f767238723cff40#279671c83fd5acea3422c5772f767238723cff40" dependencies = [ "aes", "aes-gcm", @@ -2700,18 +2687,17 @@ dependencies = [ "enr", "fnv", "futures", - "hashlink 0.9.1", + "hashlink", "hex", "hkdf", "lazy_static", "libp2p-identity", - "lru 0.12.5", "more-asserts", "multiaddr", "parking_lot", "rand 0.8.5", "smallvec", - "socket2 0.5.10", + "socket2 0.6.3", "tokio", "tracing", "uint 0.10.0", @@ -3953,9 +3939,6 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", -] [[package]] name = "hashbrown" @@ -3979,15 +3962,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "hashlink" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" -dependencies = [ - "hashbrown 0.14.5", -] - [[package]] name = "hashlink" version = "0.11.0" @@ -5079,7 +5053,7 @@ dependencies = [ "futures", "futures-timer", "getrandom 0.2.16", - "hashlink 0.11.0", + "hashlink", "hex_fmt", "libp2p-core", "libp2p-identity", @@ -5239,7 +5213,7 @@ dependencies = [ "futures", "futures-timer", "getrandom 0.2.16", - "hashlink 0.11.0", + "hashlink", "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", @@ -7571,7 +7545,7 @@ dependencies = [ "bitflags 2.10.0", "fallible-iterator", "fallible-streaming-iterator", - "hashlink 0.11.0", + "hashlink", "libsqlite3-sys", "smallvec", "sqlite-wasm-rs", @@ -10498,7 +10472,7 @@ checksum = "631a50d867fafb7093e709d75aaee9e0e0d5deb934021fcea25ac2fe09edc51e" dependencies = [ "arraydeque", "encoding_rs", - "hashlink 0.11.0", + "hashlink", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 71398530fe4..0935005e7b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,7 +127,8 @@ delay_map = "0.4" deposit_contract = { path = "common/deposit_contract" } directory = { path = "common/directory" } dirs = "3" -discv5 = { version = "0.10", features = ["libp2p"] } +# TODO: switch to crates.io once released. +discv5 = { git = "https://github.com/ackintosh/discv5.git", rev = "279671c83fd5acea3422c5772f767238723cff40", features = ["libp2p"] } doppelganger_service = { path = "validator_client/doppelganger_service" } educe = "0.6" eip_3076 = { path = "common/eip_3076" } diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 74bf1ccd764..1bd24398d84 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -69,6 +69,7 @@ use lighthouse_network::PeerId; use lighthouse_version::version_with_platform; use logging::{SSELoggingComponents, crit}; use network::{NetworkMessage, NetworkSenders}; +use network_utils::discovery_metrics::scrape_discovery_metrics; use network_utils::enr_ext::EnrExt; use parking_lot::RwLock; pub use publish_blocks::{ @@ -2962,6 +2963,9 @@ pub fn serve( .and(warp::path::end()) .then(|task_spawner: TaskSpawner| { task_spawner.blocking_json_task(Priority::P1, move || { + // discv5 metrics are not pushed continuously; pull fresh values from the discv5 + // global metrics so that observe_nat() reads up-to-date contactability results. + scrape_discovery_metrics(); Ok(api_types::GenericResponse::from(observe_nat())) }) }); diff --git a/boot_node/src/config.rs b/boot_node/src/config.rs index 5b13b95c973..20baa08cc8f 100644 --- a/boot_node/src/config.rs +++ b/boot_node/src/config.rs @@ -218,6 +218,9 @@ impl BootNodeConfigSerialization { Some(SocketAddrV4::new(ipv4, ipv4_port)), Some(SocketAddrV6::new(ipv6, ipv6_port, 0, 0)), ), + lighthouse_network::discv5::ListenConfig::FromSockets { .. } => { + unreachable!("FromSockets is not used in Lighthouse") + } }; BootNodeConfigSerialization {