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

Explicitly set bootstrap/fallback nodes #295

Closed
anacrolix opened this issue Mar 11, 2019 · 6 comments
Closed

Explicitly set bootstrap/fallback nodes #295

anacrolix opened this issue Mar 11, 2019 · 6 comments
Labels
P1 High: Likely tackled by core team if no one steps up

Comments

@anacrolix
Copy link
Contributor

Currently bootstrapping the routing table requires connecting to the bootstrap nodes manually. However if (when) the routing table later empties, this process of reconnecting to bootstrap nodes again must be done manually be the user, and isn't clear, or idiomatic for DHT operation. I propose instead to add a callback returning addresses to restart the DHT node when the routing table is empty. See #294 which is directly affected by this behaviour. See also #254 (comment) where this strategy is described. #254 and #283 reduce the impact of this missing feature, but aren't sufficient.

@anacrolix
Copy link
Contributor Author

@jayarjo do you have some insight or concerns?

@jayarjo
Copy link

jayarjo commented Apr 9, 2019

@anacrolix js version of libp2p-kad-dht mentions that it implements Peer Discovery and then it turned out that it's not. So I was following the thread of issues from there and on this one came to conclusion that the whole feature is not really functional at the moment. That's it.

Maybe you folks should remove Peer Discovery badge from js-libp2p-kad-dht readme for now.

@raulk
Copy link
Member

raulk commented Apr 15, 2019

@vasco-santos @jacobheun ^^ could you review @jayarjo's comment?

@jacobheun
Copy link

js version of libp2p-kad-dht mentions that it implements Peer Discovery and then it turned out that it's not.

There's some confusion here that I can hopefully clarify, and we can update libp2p/js-libp2p-kad-dht#44 to be more explicit. Random Walk in the DHT does work, and is quite effective at discovering peers. As far as the peer-discovery interface is concerned, random walk is implementing it. The problem (really just an annoyance, there's no runtime impact) is that Random Walk isn't added to js-libp2p's peer discovery services and instead exists and is managed solely by the DHT. Also, interface-peer-discovery actually needs tests https://github.com/libp2p/interface-peer-discovery/issues/6.

@jayarjo I'm not sure what concern you have with this particular issue. Is it the issue with reconnecting to the Bootstrap peers?

@anacrolix
Copy link
Contributor Author

It's worth noting that (I think) random walk is used heavily in the Go DHT implementation because bootstrap traversals toward a node that actually exists reuses the code that finds addresses for a node, and terminates prematurely (for a bootstrap) upon finding it. Random walk is not standard behaviour for a DHT, afaik, but it has its uses.

@anacrolix
Copy link
Contributor Author

I'm suggesting an option to the DHT:

SetFallbackNodes(func() []PeerInfo)

By default this would be a function returning the default bootstrap nodes in the appropriate form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

No branches or pull requests

5 participants