Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

DIAL to every peers in WantManager when get a hash ? #1698

Closed
LiMoMoMo opened this issue Nov 7, 2018 · 5 comments
Closed

DIAL to every peers in WantManager when get a hash ? #1698

LiMoMoMo opened this issue Nov 7, 2018 · 5 comments
Labels
kind/support A question or request for support

Comments

@LiMoMoMo
Copy link

LiMoMoMo commented Nov 7, 2018

  • Version: 0.32.3
  • Platform:
  • Subsystem: bitswap

Type:

Question

Severity:

Very Low

Description:

i added output in the libp2p module to figure out how it works.
i found that when i fetch a date(get(hash)), the libp2p dial to every peers that it connected.
the libp2p.network.findProviders(cid, maxProviders, callback) reveive paragrams to restrict the provider per request, but if when the dht is not enable, the paragrams input is not useful.

the signal-server in my demo has only 5 or 6 peers connected, its OK. But if the server connected by
hundreds nodes, connect to every nodes in the net may cause heavy performance burden.

Steps to reproduce the error:

@alanshaw
Copy link
Member

alanshaw commented Nov 8, 2018

@jacobheun does this sound like expected behaviour?

@jacobheun
Copy link
Contributor

So currently maxProviders isn't passed to the content providers in libp2p as it's not yet supported. A default time is passed https://github.com/ipfs/js-ipfs-bitswap/blob/v0.21.0/src/network.js#L105, which is currently 10 seconds. So assuming you find 100 providers in that 10 seconds, you'd try to connect to all of them.

This is the expected behavior, but we should probably look at adding support for maxProviders before we start turning on the dht by default. cc @vasco-santos

@alanshaw
Copy link
Member

alanshaw commented Dec 4, 2018

@LiMoMoMo does that answer you question?

@jacobheun
Copy link
Contributor

FYI: we now support the improved options in libp2p 0.24 and the latest kad-dht. I've got a PR for bitswap, ipfs/js-ipfs-bitswap#183, to update the call. Hopefully we can get this into the js-ipfs 0.34 release.

@LiMoMoMo
Copy link
Author

@LiMoMoMo does that answer you question?

yes, thank you !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/support A question or request for support
Projects
None yet
Development

No branches or pull requests

3 participants