Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nat_open no longer reports correctly on latest unstable (v5.1.0) #5384

Closed
jimmygchen opened this issue Mar 10, 2024 · 4 comments
Closed

nat_open no longer reports correctly on latest unstable (v5.1.0) #5384

jimmygchen opened this issue Mar 10, 2024 · 4 comments

Comments

@jimmygchen
Copy link
Member

Description

The nat_open metric exposed via the /metrics endpoint and the lighthouse/ui/health endpoint doesn't seem to be reporting the status anymore on latest unstable. It seems to be related to the change from #5314.

Version

unstable (v5.1.0 release candidate)

Present Behaviour

  • nat_open metric not available on /metrics.
  • nat_open always false on lighthouse/ui/health even when the node is reachable from external nodes.

Expected Behaviour

nat_open metric should be available and should return true if node is reachable.

@AgeManning
Copy link
Member

I think we now report two kinds. One for tcp and one for udp. So we have to update our metrics and this RPC request I think.

@ackintosh
Copy link
Member

ackintosh commented Mar 18, 2024

Based on my understanding, before #5314, nat_open was determined by check_nat. check_nat would classify it as open (increment NAT_OPEN counter) if either of the conditions below were true.

if ADDRESS_UPDATE_COUNT.as_ref().map(|v| v.get()).unwrap_or(0) != 0
|| NETWORK_INBOUND_PEERS.as_ref().map(|v| v.get()).unwrap_or(0) != 0_i64

Now, nat_open is determined by observe_nat. observe_nat classifies it as open (returns true) only if both of the conditions below are true:

discv5_nat && libp2p_nat

So a quick solution that comes to my mind is to update observe_nat to return true if either of the conditions are true like below:

-    discv5_nat && libp2p_nat
+    discv5_nat || libp2p_nat

What do you think? cc @jxs

@jxs
Copy link
Member

jxs commented Mar 18, 2024

thanks for noticing and submitting this Jimmy, and Akihito for the fix! Submitted #5427 5427

@ackintosh
Copy link
Member

The fix has been released in https://github.com/sigp/lighthouse/releases/tag/v5.1.2 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants