Fixes GossipSub's Peer Exchange (PX) after go-libp2p's change to stop consuming signed peer records into its Certified Address book.
I'll briefly summarize the problem and this solution here, but for more context please follow the links below.
The problem:
GossipSub's PX relied on go-libp2p's Identify consuming the signed peer record and inserting it into the host's peerstore.
go-libp2p's Identify was updated to avoid saving the signed peer records because:
They were not consumed anywhere. (by go-libp2p)
We need to filter the addresses to avoid polluting the address book with local addresses.
GossipSub's PX silently broke as it depended on an up to date CertifiedAddrBook on the host, but it was effectively unused.
The proposed solution in this PR:
Use the emitted events from go-libp2p to maintain gossipsub's own Certified Address Book.
A slightly more long term solution would be for go-libp2p to support services https://github.com/libp2p/go-libp2p/issues/1993 that can provide resources that can be shared amongst other services/protocols. Imagine if two services needed a certified address book, then it would make sense to have a separate service that could provide an up to date address book.
For now potentially duplicating data if multiple services require a certified addr book seems like an okay solution.
Related though, is anyone aware of other protocols that depend on the host's certified address book?
This is blocked until the next go-libp2p release that includes https://github.com/libp2p/go-libp2p/pull/2759, but please still review.
Fixes GossipSub's Peer Exchange (PX) after go-libp2p's change to stop consuming signed peer records into its Certified Address book.
I'll briefly summarize the problem and this solution here, but for more context please follow the links below.
The problem:
The proposed solution in this PR:
A slightly more long term solution would be for go-libp2p to support services https://github.com/libp2p/go-libp2p/issues/1993 that can provide resources that can be shared amongst other services/protocols. Imagine if two services needed a certified address book, then it would make sense to have a separate service that could provide an up to date address book.
For now potentially duplicating data if multiple services require a certified addr book seems like an okay solution.
Related though, is anyone aware of other protocols that depend on the host's certified address book?
Fixes https://github.com/libp2p/go-libp2p/issues/2754 Related to: https://github.com/libp2p/go-libp2p/issues/2355