-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Own our CertifiedAddrBook #555
Conversation
gossipsub.go
Outdated
@@ -522,6 +529,45 @@ func (gs *GossipSubRouter) Attach(p *PubSub) { | |||
} | |||
} | |||
|
|||
func (gs *GossipSubRouter) manageAddrBook() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we just not return anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should, the error is ignored anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you return nothing and log errors?
These are just swallowed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks reasonable, let me know when it is ready to merge.
e3c2e92
to
699a45b
Compare
@vyzo this is ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit, otherwise lgtm
&event.EvtPeerConnectednessChanged{}, | ||
}) | ||
if err != nil { | ||
log.Errorf("failed to subscribe to peer identification events: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and return, as it may panic trying to access sub.Out in the loop
Hmm, need to investigate why the test is failing. |
It's the resource manager being IP aware :) |
1a80eaa
to
94969bd
Compare
This is blocked until the next go-libp2p release that includes libp2p/go-libp2p#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 libp2p/go-libp2p#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 libp2p/go-libp2p#2754
Related to: libp2p/go-libp2p#2355