Skip to content

Commit c3a0757

Browse files
authored
Correct /nat API for libp2p (#6677)
* Fix nat API
1 parent f3b7888 commit c3a0757

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,6 @@ impl<E: EthSpec> NetworkBehaviour for PeerManager<E> {
141141
debug!(self.log, "Failed to dial peer"; "peer_id"=> ?peer_id, "error" => %ClearDialError(error));
142142
self.on_dial_failure(peer_id);
143143
}
144-
FromSwarm::ExternalAddrConfirmed(_) => {
145-
// We have an external address confirmed, means we are able to do NAT traversal.
146-
metrics::set_gauge_vec(&metrics::NAT_OPEN, &["libp2p"], 1);
147-
}
148144
_ => {
149145
// NOTE: FromSwarm is a non exhaustive enum so updates should be based on release
150146
// notes more than compiler feedback

common/system_health/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,14 @@ pub fn observe_nat() -> NatState {
235235

236236
let libp2p_ipv4 = lighthouse_network::metrics::get_int_gauge(
237237
&lighthouse_network::metrics::NAT_OPEN,
238-
&["libp2p"],
238+
&["libp2p_ipv4"],
239239
)
240240
.map(|g| g.get() == 1)
241241
.unwrap_or_default();
242242

243243
let libp2p_ipv6 = lighthouse_network::metrics::get_int_gauge(
244244
&lighthouse_network::metrics::NAT_OPEN,
245-
&["libp2p"],
245+
&["libp2p_ipv6"],
246246
)
247247
.map(|g| g.get() == 1)
248248
.unwrap_or_default();

0 commit comments

Comments
 (0)