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

feat: add autonat support #1298

Merged
merged 12 commits into from
Mar 14, 2023
Merged

feat: add autonat support #1298

merged 12 commits into from
Mar 14, 2023

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Jul 19, 2022

Implements the autonat spec to give us confidence in our external addresses and to open the door to things like switching DHT server mode on automatically, hole punching, v2 circuit relay etc.

Depends on:

Fixes #1005

Implements the [autonat](https://github.com/libp2p/specs/blob/master/autonat/README.md)
spec to give us confidence in our external addresses and to open the
door to things like switching DHT server mode on automatically, hole
punching, v2 circuit relay etc.

Depends on:

- [ ] libp2p/js-libp2p-interfaces#269
@achingbrain
Copy link
Member Author

achingbrain commented Jul 19, 2022

Testing locally, I get different port numbers from every connection during identify.

E.g. I have uPNP hole punching which opens /ip4/${PUBLIC_IP}/tcp/4002 - the observedAddr reported by identify is like /ip4/${PUBLIC_IP}/tcp/61253, /ip4/${PUBLIC_IP}/tcp/61254 etc. We end up with a different observed address for every connection and we can't use autonat to confirm/delete them fast enough so the list grows and grows and grows.

We need to handle this better before merging. Either:

  1. Limit the number of unconfirmed, observed addresses we store
  2. Ignore identify observedAddrs
  3. Something else?

@mpetrunic
Copy link
Member

Okay, I managed to bring it up to speed with the current master branch. @achingbrain How do you test that locally and observe?

@mpetrunic mpetrunic marked this pull request as ready for review February 28, 2023 12:21
@achingbrain achingbrain merged commit d6c8601 into master Mar 14, 2023
@achingbrain achingbrain deleted the feat/autonat branch March 14, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Autonat support
2 participants