probe-lab / zikade

A Go implementation of the libp2p Kademlia DHT specification
Other
12 stars 3 forks source link

SearchValue update peers with newer record #28

Open iand opened 1 year ago

iand commented 1 year ago

Migrated from https://github.com/libp2p/go-libp2p-kad-dht/issues/945

When searching for an IPNS or PK record, we will store the updated version of that record with all the closest peers that we have found while querying. If the query aborts after the three closest haven't returned anyone closer, we still update the remaining 17 peers that we haven't contacted and store our currently known "best" record with them. However, these 17 peers may also hold the same record - we just don't know because we haven't contacted them yet.

I would change the logic in V2 to only store the updated record with peers that provably returned a stale record during the query operation.