This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
Closest peers query is not efficient #86
Labels
exp/wizard
Extensive knowledge (implications, ramifications) required
P1
High: Likely tackled by core team if no one steps up
status/ready
Ready to be worked
By default,
dht.getClosestPeers
is crawling all the network to find the closestPeers, which takes a long time and hits heavily the CPU when we have a large number of peers.This was also a problem observed in #85 , as this took a lot of time and returned a large set of peers, which ended up failing the
dht.put
for lack of response of several peers. Moreover, queries also have an impact onrandom-walk
performance.We need a deterministic way of ending this network query, as well as to refactor
closestPeers
andput
to be more fault tolerant.We should stream the query and have an abort logic that would allow us to stop the query at a certain point. In addition, we need to have a smarter connection manager to full enable this.
cc @jacobheun @dirkmc
The text was updated successfully, but these errors were encountered: