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

fix(dcutr): exchange address candidates #4624

Merged
merged 22 commits into from
Oct 26, 2023
Merged

fix(dcutr): exchange address candidates #4624

merged 22 commits into from
Oct 26, 2023

Conversation

thomaseizinger
Copy link
Contributor

Description

In a serious of refactorings, we seem to have introduced a bug where we where exchanged the external addresses of our node as part of libp2p-dcutr. This is ironically quite pointless. If we have external addresses, then there is no need for hole-punching (i.e. DCUtR).

Instead of gathering external addresses, we use an LRU cache to store our observed addresses. Repeatedly observed addresses will be tried first which should increase the success rate of a hole-punch.

Resolves: #4496.

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix and the test.

One comment, otherwise looks good to me.

protocols/dcutr/src/behaviour.rs Outdated Show resolved Hide resolved
@thomaseizinger
Copy link
Contributor Author

The dcutr example currently does not work. I attempted to fix this in #4672.

examples/dcutr/src/main.rs Show resolved Hide resolved
protocols/dcutr/src/behaviour.rs Outdated Show resolved Hide resolved
Co-authored-by: Max Inden <mail@max-inden.de>
@mergify

This comment was marked as resolved.

examples/dcutr/src/main.rs Show resolved Hide resolved
examples/dcutr/src/main.rs Outdated Show resolved Hide resolved
@mergify

This comment was marked as resolved.

protocols/dcutr/Cargo.toml Outdated Show resolved Hide resolved
Cargo.lock Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@mergify

This comment was marked as resolved.

@thomaseizinger
Copy link
Contributor Author

Let's merge #4549 before this one.

@mergify

This comment was marked as resolved.

@mergify mergify bot merged commit fc6efaf into master Oct 26, 2023
72 checks passed
@mergify mergify bot deleted the fix/dcutr-candidates branch October 26, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dcutr: consider more than just external addresses
2 participants