Fix: ipv4/ipv6_contactable metrics never updated#300
Open
ackintosh wants to merge 6 commits into
Open
Conversation
…pdated Reproduces a bug in Config::build() where the inverted condition `if self.config.enr_update` always sets auto_nat_listen_duration to None (since enr_update defaults to true), preventing the auto-NAT timer from ever starting and leaving ipv4_contactable/ipv6_contactable permanently false.
1e82d6c to
cb3a6f6
Compare
jxs
requested changes
Apr 27, 2026
Member
jxs
left a comment
There was a problem hiding this comment.
Hi, Akihito, thanks for looking into this! Can we separate the clippy PR into a separate PR? I am also wondering if we can test in a more isolated way as this test is quite complex and needs flags to not affect other tests
Member
|
can you solve the merge conflicts @ackintosh? Should be good to go after |
# Conflicts: # src/service.rs
Member
Author
|
@jxs I've updated this PR, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
METRICS.ipv4_contactableandMETRICS.ipv6_contactablenever being updated due to an inverted condition inConfig::build()Fixcargo clippyerrorsSuppressclippy::collapsible_matchwith explanatory comments where PendingEntry::value()requires&mut self` and cannot be used in a pattern guardBackground
Config::build()contained an inverted boolean condition:Because
enr_updatedefaults to true, this condition was always true, soauto_nat_listen_durationwas unconditionally overwritten withNone. As a result:ConnectivityStatenever started an incoming-connection timerreceived_incoming_connection()always returned earlyMETRICS.ipv4_contactableandMETRICS.ipv6_contactableremained false permanently regardless of actual reachabilityNotes & open questions
Change checklist