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

net/discovery: Do not propagate external addr with different peerIDs #6380

Merged
merged 6 commits into from
Nov 7, 2024

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Nov 6, 2024

This PR ensures that external addresses with different PeerIDs are not propagated to the higher layer of the network code.

While at it, this ensures that libp2p only adds the /p2p/peerid part to the discovered address if it does not contain it already.

This is a followup from:

cc @paritytech/networking

@lexnv lexnv self-assigned this Nov 6, 2024
@lexnv lexnv added T0-node This PR/Issue is related to the topic “node”. I5-enhancement An additional feature request. labels Nov 6, 2024
substrate/client/network/src/discovery.rs Outdated Show resolved Hide resolved
substrate/client/network/src/litep2p/discovery.rs Outdated Show resolved Hide resolved
@nazar-pc
Copy link
Contributor

nazar-pc commented Nov 7, 2024

On a somewhat similar note if external address was provided explicitly via CLI options this automatic discovery should be disabled

Copy link
Contributor

@michalkucharczyk michalkucharczyk left a comment

Choose a reason for hiding this comment

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

From what I can say looks good.

@lexnv lexnv added this pull request to the merge queue Nov 7, 2024
Merged via the queue into master with commit bb8c7a3 Nov 7, 2024
194 of 197 checks passed
@lexnv lexnv deleted the lexnv/p2p-external-addr branch November 7, 2024 13:30
paritytech-ci pushed a commit that referenced this pull request Nov 7, 2024
…6380)

This PR ensures that external addresses with different PeerIDs are not
propagated to the higher layer of the network code.

While at it, this ensures that libp2p only adds the `/p2p/peerid` part
to the discovered address if it does not contain it already.

This is a followup from:
- #6298

cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: Dmitry Markin <[email protected]>
lexnv added a commit that referenced this pull request Nov 15, 2024
…6380)

This PR ensures that external addresses with different PeerIDs are not
propagated to the higher layer of the network code.

While at it, this ensures that libp2p only adds the `/p2p/peerid` part
to the discovered address if it does not contain it already.

This is a followup from:
- #6298

cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: Dmitry Markin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants