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

[kad] Update local routing table on new connections after protocol confirmation. #1821

Merged
merged 3 commits into from
Nov 5, 2020

Conversation

romanb
Copy link
Contributor

@romanb romanb commented Nov 3, 2020

This is a proposal for closing #1611. In order to avoid adding peers to the local routing table which use a different protocol name and thus actually a different overlay network, only update the local routing table for newly established connections once the associated connection handler reports that the protocol has been confirmed. The configured protocol is confirmed on a connection once the first inbound or outbound substream is successfully negotiated.

In order to avoid adding peers to the local routing table
which use a different protocol name and thus a different
overlay network, only update the local routing table
for newly established connections once the associated
connection handler reports that the protocol has been
confirmed.
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.

Great! Thanks for fixing this.

In Substrate we use manual insertion, but only check the protocol identifier before passing a node back to Kademlia. In case we never get around to deeper inspections of nodes, we might as well revert paritytech/substrate#6549 once this is released.

@romanb romanb merged commit 689eeaf into libp2p:master Nov 5, 2020
@romanb romanb deleted the kad-delay-routing-update branch November 5, 2020 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

protocols/kad: Node with incompatible protocol name can be added to routing table
2 participants