shresthagrawal / learnp2p

https://learnp2p.org
https://jslibp2p-chat-tutorial.vercel.app
MIT License
26 stars 6 forks source link

Sections on the kad-dht / Kademlia in general contain misleading information on node lookups #32

Closed chadsr closed 3 years ago

chadsr commented 3 years ago

There seems to be some confusion between the original "vanilla" design of Kademlia and S/Kademlia, which are iterative in their node lookup process and the version coined R/Kademlia which utilises a recursive lookup design.

Currently in section 4, chapter 1 (DHTs), this section is incorrect. Secondly in chapter 3 (Kademlia) this section also hints towards the use of recursive node lookups.

The libp2p implementations xx-libp2p-kad-dht currently follow the original iterative lookup algorithm and extend it in parallel following from S/Kademlia, whereas the documentation indicates something recursive, similar to R/Kademlia.

I'm in the process of updating these parts with information that I see as correct according to the iterative lookup algorithm used in xx-libp2p-kad-dht and will happily accept feedback!

Edit: Some further clarification from a core dev which confirms this.

Edit 2: My (maybe COVID infested) brain made a git mess, so I made a clean PR. Ignore the reference to 33 and instead look to PR #34. Apologies.