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: remove peer routing search-for-self #1051

Closed
wants to merge 1 commit into from

Conversation

achingbrain
Copy link
Member

The peer routing module starts a recurring process that searches for
peers close to our peer id.

This makes the DHT module query the network for peers. Thing is the
DHT module is already doing this because periodically searching for
peers close to us is in the DHT spec so this ends up making redundant
queries.

This PR removes the recurring task configured by the peer routing module.

The peer routing module starts a recurring process that searches for
peers close to our peer id.

This makes the DHT module query the network for peers.  Thing is the
DHT module is already doing this because periodically searching for
peers close to us is in the DHT spec so this ends up making redundant
queries.

This PR removes the recurring task configured by the peer routing module.
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

What about a libp2p configuration with the delegates only?

@achingbrain
Copy link
Member Author

achingbrain commented Dec 6, 2021

Why would a client need to tell a delegate node to to query for themselves? They'd be doing that in the background to keep their routing tables up to date anyway, right?

@vasco-santos
Copy link
Member

vasco-santos commented Dec 7, 2021

We use this to find and add peers to our PeerStore (and potentially connect with them), as part of the bootstrap process. These can include relevant peers like relays to use as auto relay nodes, as well as peers to fill in the pubsub mesh.

A follow up of this measure, would be to at some point drop connections with bootstrap peers when the peer balances its connections and figures out what are the most valuable peers to connect #744

@vasco-santos
Copy link
Member

More information on the reasoning in #704

@achingbrain
Copy link
Member Author

achingbrain commented Dec 7, 2021

So I guess we either

a - exclude the DHT from the peer routing search-for-self timer
b - disable search for self in the DHT by default
c - make the dht delegate module support the same semantics as the dht spec and query for it's own peer id occasionally

a) breaks the PeerRoutingModule abstraction while b) seems like we are managing ambient peer discovery at the wrong level. c) adds another timer, though I guess you'd be unlikely to run the dht module and the delegate at the same time?

@achingbrain
Copy link
Member Author

You could even merge libp2p-delegated-content-routing and libp2p-delegated-peer-routing to create libp2p-delegated-dht?

@achingbrain
Copy link
Member Author

Option a: #1055

@achingbrain achingbrain deleted the fix/remove-peer-routing-refresh branch July 15, 2022 18:32
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.

2 participants