find.nim:369 lookOnce dispatches alpha peers per round, then blocks on collectCompleted(timeout) for the whole batch before starting the next round. A single slow peer stalls the entire round up to the timeout.
go-libp2p's query.run() keeps up to alpha queries continuously in flight over a channel, refilling a slot as soon as any query returns, so lookup wall-clock tracks throughput rather than the slowest peer per round.
Proposed work:
- Refactor
lookOnce/iterativeLookup so that instead of awaiting a full batch, it maintains alpha in-flight dispatches and re-dispatches the next-closest unqueried peer whenever one completes.
- Preserve existing stop conditions and inflight-cancellation bookkeeping.
Impact: lookup latency, especially with straggler peers. High.
find.nim:369 lookOncedispatchesalphapeers per round, then blocks oncollectCompleted(timeout)for the whole batch before starting the next round. A single slow peer stalls the entire round up to the timeout.go-libp2p's
query.run()keeps up toalphaqueries continuously in flight over a channel, refilling a slot as soon as any query returns, so lookup wall-clock tracks throughput rather than the slowest peer per round.Proposed work:
lookOnce/iterativeLookupso that instead of awaiting a full batch, it maintainsalphain-flight dispatches and re-dispatches the next-closest unqueried peer whenever one completes.Impact: lookup latency, especially with straggler peers. High.