feat: add support for detecting and logging per address reachability via libp2p AutoNAT v2 (#16100)

**What type of PR is this?**
Feature

**What does this PR do? Why is it needed?**

This PR adds support for detecting and logging per address reachability
via libp2p AutoNAT v2. See
https://github.com/libp2p/go-libp2p/releases/tag/v0.42.0 for details.
This PR also upgrades Prysm to libp2p v0.42.0

**Which issues(s) does this PR fix?**

Fixes #https://github.com/OffchainLabs/prysm/issues/16098

**Other notes for review**

**Acknowledgements**

- [x] I have read
[CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md).
- [x] I have included a uniquely named [changelog fragment
file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd).
- [x] I have added a description to this PR with sufficient context for
reviewers to understand this PR.
This commit is contained in:
Aarsh Shah
2025-12-11 15:56:52 +04:00
committed by GitHub
parent dda5ee3334
commit 0fc9ab925a
18 changed files with 277 additions and 204 deletions

View File

@@ -224,6 +224,11 @@ var (
Name: "enable-upnp",
Usage: "Enable the service (Beacon chain or Validator) to use UPnP when possible.",
}
// EnableAutoNATFlag enables AutoNAT v2 service for per-address reachability detection.
EnableAutoNATFlag = &cli.BoolFlag{
Name: "enable-autonat",
Usage: "Enable AutoNAT v2 service for per-address reachability detection. Helps diagnose connectivity issues behind NAT/firewalls.",
}
// ConfigFileFlag specifies the filepath to load flag values.
ConfigFileFlag = &cli.StringFlag{
Name: "config-file",