1. 14 Aug, 2020 1 commit
  2. 03 Apr, 2020 2 commits
    • Petar Maymounkov's avatar
      Emit events during async query. (#504) · 5a41195e
      Petar Maymounkov authored
      * Add Kademlia async lookup implementation (replaces prior implementation)
      * Add lookup events that allow full lookup reconstruction from logs
      * Introduce lookup stopping condition, based on parameter "beta"
      Co-authored-by: default avatarAdin Schmahmann <adin.schmahmann@gmail.com>
      5a41195e
    • Adin Schmahmann's avatar
      Asynchronous lookups (#498) · 94cf4811
      Adin Schmahmann authored
      * feat(query): fully async implementation of Kademlia lookup. peers returned from the lookup are not guaranteed to be alive (i.e. we're only guaranteed to have dialed the closest beta peers to the target), but given stable and correct routing tables the expectation that most of the peers returned are alive is high.
      * feat(query): add wrapper lookup followup function to followup after the lookup is completed and ensure that the closest k returned peers from a lookup have been queried even for beta < k
      * refactor(query) modified the structure returned from lookups to be a useful subset of the full query state instead of the entire query state
      * feat(options): beta parameter exposed as the Resiliency parameter
      * feat(routing): do not mark the routing table as updated after a FindPeer query
      * feat(routing): FindPeer can return addresses even if not Connected as long as it was either recently connected (CanConnect) or was discovered during the lookup
      * feat(bootstrap): bootstrap logic now uses GetClosestPeers instead of FindPeer
      * refactor(dht): stopFn no longer takes any state
      * fix(test): changed GetClosestPeers test to only assume beta instead of k peers since that is now more appropriate given the query logic changes and that the routing tables in that test are bad, i.e. a ring network with arbitrary peerIDs
      Co-authored-by: default avatarPetar Maymounkov <petarm@gmail.com>
      Co-authored-by: default avatarAarsh Shah <aarshkshah1992@gmail.com>
      94cf4811