libp2p / libp2p/go-libp2p

AutoNAT v2 dialerHost should not have the UDP black hole detector

Open
#3,491 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

This issue distills findings from a systematic cross-implementation evaluation of AutoNAT v2, conducted by [ProbeLab](https://probelab.io/). The final report of the investigation is available in the following [link](https://github.com/probe-lab/autonat-perf-audit/blob/main/docs/final-report.md).

The AutoNAT v2 `dialerHost` shares the main host's UDP black hole counter in read-only mode [config.go#L240-L246](https://github.com/libp2p/go-libp2p/blob/v0.48.0/config/config.go#L240-L246). Read-only mode treats any state other than `Allowed` as `Blocked` [black_hole_detector.go#L254-L262](https://github.com/libp2p/go-libp2p/blob/v0.48.0/p2p/net/swarm/black_hole_detector.go#L254-L262), so when the main host is in `Probing` (zero history), the dialerHost refuses every QUIC dial-back with `E_DIAL_REFUSED`.

Observed behaviour:

- Fresh servers, low-traffic nodes, and isolated testbeds can stay in `Probing` → every QUIC dial-back is refused.
- `E_DIAL_REFUSED` is discarded from v2 confidence by [AddRefusal](https://github.com/libp2p/go-libp2p/blob/v0.48.0/p2p/host/basic/addrs_reachability_tracker.go#L689-L692) (it does not call `AddOutcome`), so the client's QUIC address doesn't flip to Unreachable — but it never accumulates positive evidence either, and stays stuck in `Unknown`.
- AutoNAT v1 had the same problem and was fixed in [[#2529](https://github.com/libp2p/go-libp2p/pull/2529)](https://github.com/libp2p/go-libp2p/pull/2529) by disabling the detector on the v1 dialer entirely.

Proposal: apply the v1 approach — pass `nil` counters to `makeAutoNATV2Host()` so the detector doesn't run on the dialerHost. The dialerHost only dials addresses clients explicitly request to test; the detector has no useful role there.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at makeAutoNATV2Host and inspect the counter wiring referenced in config/config.go, then review the read-only behavior in p2p/net/swarm/black_hole_detector.go. Compare the AutoNAT v1 fix in #2529 and verify that the v2 dialerHost no longer refuses requested QUIC dial-backs because of the main host's detector state.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.