diff --git a/beacon_node/lighthouse_network/src/config.rs b/beacon_node/lighthouse_network/src/config.rs index 025dd236481..58e785c0e45 100644 --- a/beacon_node/lighthouse_network/src/config.rs +++ b/beacon_node/lighthouse_network/src/config.rs @@ -193,8 +193,7 @@ impl Config { /// Sets the listening address to use both an ipv4 and ipv6 address. The discv5 ip_mode and /// table filter is adjusted accordingly to ensure addresses that are present in the enr are /// globally reachable. - /// TODO: add Quic support IPV6 port when https://github.com/libp2p/rust-libp2p/issues/4165 - /// gets addressed. + #[allow(clippy::too_many_arguments)] pub fn set_ipv4_ipv6_listening_addresses( &mut self, v4_addr: Ipv4Addr, @@ -592,4 +591,4 @@ pub const fn is_global_ipv6(addr: &Ipv6Addr) -> bool { || is_documentation(addr) || is_unique_local(addr) || is_unicast_link_local(addr)) -} +} \ No newline at end of file diff --git a/beacon_node/lighthouse_network/src/discovery/enr_ext.rs b/beacon_node/lighthouse_network/src/discovery/enr_ext.rs index 77c4f0e43a7..3c558ae56d1 100644 --- a/beacon_node/lighthouse_network/src/discovery/enr_ext.rs +++ b/beacon_node/lighthouse_network/src/discovery/enr_ext.rs @@ -6,8 +6,8 @@ use libp2p::core::multiaddr::Protocol; use libp2p::identity::{ed25519, secp256k1, KeyType, Keypair, PublicKey}; use tiny_keccak::{Hasher, Keccak}; -const QUIC_ENR_KEY: &'static str = "quic"; -const QUIC6_ENR_KEY: &'static str = "quic6"; +const QUIC_ENR_KEY: &str = "quic"; +const QUIC6_ENR_KEY: &str = "quic6"; /// Extend ENR for libp2p types. pub trait EnrExt { @@ -397,4 +397,4 @@ mod tests { assert_eq!(enr.node_id(), node_id); } -} +} \ No newline at end of file diff --git a/beacon_node/lighthouse_network/src/discovery/mod.rs b/beacon_node/lighthouse_network/src/discovery/mod.rs index d9f79a537f7..79271abd053 100644 --- a/beacon_node/lighthouse_network/src/discovery/mod.rs +++ b/beacon_node/lighthouse_network/src/discovery/mod.rs @@ -1240,6 +1240,6 @@ mod tests { assert_eq!(results.len(), 2); // when a peer belongs to multiple subnet ids, we use the highest ttl. - assert_eq!(results.get(&enr1.peer_id()).unwrap(), &instant1); + assert_eq!(results.get(&enr1).unwrap(), &instant1); } -} +} \ No newline at end of file diff --git a/beacon_node/lighthouse_network/src/service/mod.rs b/beacon_node/lighthouse_network/src/service/mod.rs index 4f8727362db..35ba4ea99d7 100644 --- a/beacon_node/lighthouse_network/src/service/mod.rs +++ b/beacon_node/lighthouse_network/src/service/mod.rs @@ -416,10 +416,8 @@ impl Network { for listen_multiaddr in config.listen_addrs().listen_addresses() { // If QUIC is disabled, ignore listening on QUIC ports - if config.disable_quic_support { - if listen_multiaddr.iter().any(|v| v == MProtocol::QuicV1) { + if config.disable_quic_support && listen_multiaddr.iter().any(|v| v == MProtocol::QuicV1) { continue; - } } match self.swarm.listen_on(listen_multiaddr.clone()) { @@ -1601,4 +1599,4 @@ impl Network { pub async fn next_event(&mut self) -> NetworkEvent { futures::future::poll_fn(|cx| self.poll_network(cx)).await } -} +} \ No newline at end of file diff --git a/beacon_node/network/src/nat.rs b/beacon_node/network/src/nat.rs index 2e923420ea3..b109ae71709 100644 --- a/beacon_node/network/src/nat.rs +++ b/beacon_node/network/src/nat.rs @@ -110,17 +110,13 @@ pub fn construct_upnp_mappings( let mut udp_sockets = Vec::new(); // Set the discovery UDP port mapping - if !config.disable_discovery { - if set_udp_mapping(config.disc_port).is_ok() { - udp_sockets.push(config.disc_port); - } + if !config.disable_discovery && set_udp_mapping(config.disc_port).is_ok() { + udp_sockets.push(config.disc_port); } // Set the quic UDP port mapping - if !config.disable_quic_support { - if set_udp_mapping(config.quic_port).is_ok() { - udp_sockets.push(config.quic_port) - } + if !config.disable_quic_support && set_udp_mapping(config.quic_port).is_ok() { + udp_sockets.push(config.quic_port) } // report any updates to the network service. @@ -203,4 +199,4 @@ pub fn remove_mappings(tcp_port: Option, udp_ports: &[u16], log: &slog::Log Err(e) => debug!(log, "UPnP failed to remove mappings"; "error" => %e), } } -} +} \ No newline at end of file