libp2p / go-libp2p-pubsub

The PubSub implementation for go-libp2p
https://github.com/libp2p/specs/tree/master/pubsub
Other
309 stars 178 forks source link

Fix: Own our CertifiedAddrBook #555

Closed MarcoPolo closed 1 month ago

MarcoPolo commented 2 months ago

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

MarcoPolo commented 1 month ago

@vyzo this is ready

MarcoPolo commented 1 month ago

Hmm, need to investigate why the test is failing.

MarcoPolo commented 1 month ago

Hmm, need to investigate why the test is failing.

It's the resource manager being IP aware :)