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

Deprecate module #85

Open
8 tasks
vasco-santos opened this issue Jan 10, 2020 · 0 comments
Open
8 tasks

Deprecate module #85

vasco-santos opened this issue Jan 10, 2020 · 0 comments

Comments

@vasco-santos
Copy link
Member

vasco-santos commented Jan 10, 2020

js-libp2p currently uses peer-info to keep a record of the known protocols and multiaddrs of each peer. With the new peerstore, we intend to use it to map protocols and multiaddrs instead of moving peer-info instances around, as discussed on #453

Currently peer-info is being used on the following modules:

Regarding the discovery modules, they only depend on peer-info because the peer-info is currently used for emitting the peer discovered, which is basically obtained from the peer-id. This way, we can simply emit the peer-info and libp2p will be responsible for adding it to the peerStore and track protocols/multiaddrs.

Regarding pubsub, all modules use peer-info to get data related to the peer-id. However, gossipsub also leverages peer-info to validate if the peer to be connected supports the gossipsub protocol. This is currently guaranteed in the MulticodecTopologyvalidations and we do not need to also do this in gossipsub. The only relevant issue is to support floodsub peers into gossipsub, as gossipsub on publish checks if peers are from floodsub, in order to publish to them. This way, the best solution is to provided the peerStore to the gossipsub, same way as the dht is also receiving it.

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

No branches or pull requests

1 participant