diff --git a/beacon_node/lighthouse_network/src/discovery/enr.rs b/beacon_node/lighthouse_network/src/discovery/enr.rs index 859c3a89430..9c0b3fe99b2 100644 --- a/beacon_node/lighthouse_network/src/discovery/enr.rs +++ b/beacon_node/lighthouse_network/src/discovery/enr.rs @@ -241,7 +241,7 @@ fn compare_enr(local_enr: &Enr, disk_enr: &Enr) -> bool { && local_enr.tcp4() == disk_enr.tcp4() && local_enr.tcp6() == disk_enr.tcp6() // quic ports must match - && local_enr.quic() == disk_enr.quic() + && local_enr.quic4() == disk_enr.quic4() && local_enr.quic6() == disk_enr.quic6() // must match on the same fork && local_enr.get(ETH2_ENR_KEY) == disk_enr.get(ETH2_ENR_KEY) diff --git a/beacon_node/lighthouse_network/src/discovery/enr_ext.rs b/beacon_node/lighthouse_network/src/discovery/enr_ext.rs index feff96fe775..10ccfb2678d 100644 --- a/beacon_node/lighthouse_network/src/discovery/enr_ext.rs +++ b/beacon_node/lighthouse_network/src/discovery/enr_ext.rs @@ -34,7 +34,7 @@ pub trait EnrExt { fn multiaddr_quic(&self) -> Vec; /// Returns the quic port if one is set. - fn quic(&self) -> Option; + fn quic4(&self) -> Option; /// Returns the quic6 port if one is set. fn quic6(&self) -> Option; @@ -62,7 +62,7 @@ impl EnrExt for Enr { } /// Returns the quic port if one is set. - fn quic(&self) -> Option { + fn quic4(&self) -> Option { self.get_decodable(QUIC_ENR_KEY).and_then(Result::ok) } @@ -71,7 +71,7 @@ impl EnrExt for Enr { self.get_decodable(QUIC6_ENR_KEY).and_then(Result::ok) } - /// Returns a list of multiaddrs if the ENR has an `ip` and either a `tcp` or `udp` key **or** an `ip6` and either a `tcp6` or `udp6`. + /// Returns a list of multiaddrs if the ENR has an `ip` and either a `tcp`, `quic` or `udp` key **or** an `ip6` and either a `tcp6` `quic6` or `udp6`. /// The vector remains empty if these fields are not defined. fn multiaddr(&self) -> Vec { let mut multiaddrs: Vec = Vec::new(); @@ -81,7 +81,7 @@ impl EnrExt for Enr { multiaddr.push(Protocol::Udp(udp)); multiaddrs.push(multiaddr); } - if let Some(quic) = self.quic() { + if let Some(quic) = self.quic4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Udp(quic)); multiaddr.push(Protocol::QuicV1); @@ -214,7 +214,7 @@ impl EnrExt for Enr { fn multiaddr_quic(&self) -> Vec { let mut multiaddrs: Vec = Vec::new(); // Check for quic first as it is less likely - if let Some(quic_port) = self.quic() { + if let Some(quic_port) = self.quic4() { if let Some(ip) = self.ip4() { let mut multiaddr: Multiaddr = ip.into(); multiaddr.push(Protocol::Udp(quic_port));