Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

dht.provide fails if any closest peer is blacklisted #105

Open
kumavis opened this issue Apr 22, 2019 · 3 comments
Open

dht.provide fails if any closest peer is blacklisted #105

kumavis opened this issue Apr 22, 2019 · 3 comments

Comments

@kumavis
Copy link
Contributor

kumavis commented Apr 22, 2019

reproduction / error flow

  • get peer blacklisted somehow
  • call dht.provide()
  • blacklisted peer in getClosestPeers
  • async/each over peers and call this.network.sendMessage(peer, msg, cb)
  • blacklist error causes whole async/each to end with error

waterfall([
(cb) => this.providers.addProvider(key, this.peerInfo.id, cb),
(cb) => this.getClosestPeers(key.buffer, cb),
(peers, cb) => {
const msg = new Message(Message.TYPES.ADD_PROVIDER, key.buffer, 0)
msg.providerPeers = peers.map((p) => new PeerInfo(p))
each(peers, (peer, cb) => {
this._log('putProvider %s to %s', key.toBaseEncodedString(), peer.toB58String())
this.network.sendMessage(peer, msg, cb)
}, cb)
}
], (err) => callback(err))

suggestions:

  • ignore all errors?
  • filter peers by not-blacklisted before async/each => sendMessage
@kumavis
Copy link
Contributor Author

kumavis commented Apr 22, 2019

for reference my peers are usually blacklisted for "no transport for peer"

@jacobheun
Copy link
Contributor

Since the network is still fairly unstable having peers in the dht that are no longer dialable is going to be an issue we need to address. The blacklisting is likely due to this.

The provide shouldn't ignore the errors, I think it should continue trying further peers until it hits kValue (20) peers. Also, if we fail to connect to the peer they should probably get removed from the table or at least penalized up to some threshold before removal.

If we don't provide to enough peers we risk findProviders having a higher failure rate for other peers.

Right now getClosestProviders returns only kValue peers. It would be great to be able to continue to pull from it until we've messaged enough peers.

@kumavis
Copy link
Contributor Author

kumavis commented May 10, 2019

was also encountering this here

dht.network.sendRequest(peer, msg, callback)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants