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

network-libp2p: Migrate AutoNAT v1 protocol to v2 #2955

Merged
merged 2 commits into from
Oct 10, 2024
Merged

Conversation

Eligioo
Copy link
Member

@Eligioo Eligioo commented Oct 4, 2024

What's in this pull request?

Transition from AutoNAT v1 protocol to v2
Main differences:

  • autonat v1 allowed testing reachability for the node. autonat v2 allows testing reachability for an individual address.
  • autonat v2 provides a mechanism for nodes to verify whether the peer actually successfully dialled an address.
  • autonat v2 provides a mechanism for nodes to dial an IP address different from the requesting node's observed IP address without risking amplification attacks. autonat v1 disallowed such dials to prevent amplification attacks.

This PR should contribute improving the issues stated by #276

Pull request checklist

  • All tests pass. The project builds and runs.
  • I have resolved any merge conflicts.
  • I have resolved all clippy and rustfmt warnings.

@Eligioo Eligioo requested a review from jsdanielh October 4, 2024 13:33
@Eligioo Eligioo added the testnet-restart Change breaks the protocol and requires a testnet restart label Oct 4, 2024
Copy link
Member

@nibhar nibhar left a comment

Choose a reason for hiding this comment

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

LGTM, but i have limited knowledge of the inner workings of libp2p here. Probably a good idea to have another reviewer as well.

network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/tests/network.rs Show resolved Hide resolved
network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/src/autonat.rs Show resolved Hide resolved
network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/src/autonat.rs Outdated Show resolved Hide resolved
network-libp2p/src/network_types.rs Show resolved Hide resolved
@jsdanielh
Copy link
Member

@Eligioo I guess that with autonat v2, this is no longer needed.

@jsdanielh jsdanielh merged commit 4d07918 into albatross Oct 10, 2024
7 checks passed
@jsdanielh jsdanielh deleted the stefan/autonat2 branch October 10, 2024 21:53
@jsdanielh jsdanielh added this to the Nimiq PoS Mainnet milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testnet-restart Change breaks the protocol and requires a testnet restart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants