Skip to content
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

Update peer-exchange branch with PeerRecord api changes #257

Merged
merged 6 commits into from
Jan 30, 2020

Conversation

yusefnapora
Copy link
Contributor

Hey @vyzo, this PR is based on the branch for #234 and just updates it to work with the various name changes that have happened to the signed peer records PR (libp2p/go-libp2p-core#73).

let me know if you have any questions & also feel free to comment on the -core PR if you think we need to change the API at all before merge.

@yusefnapora yusefnapora requested a review from vyzo January 23, 2020 15:40
gossipsub.go Outdated
@@ -3,6 +3,7 @@ package pubsub
import (
"context"
"fmt"
"github.com/libp2p/go-libp2p-core/record"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put this together with our other imports? Here it is mixed with system imports.

gossipsub.go Outdated
@@ -820,21 +828,24 @@ func (gs *GossipSubRouter) makePrune(p peer.ID, topic string) *pb.ControlPrune {
return p != xp
})

cab, peerstoreSupportsSignedAddrs := peerstore.GetCertifiedAddrBook(gs.p.host.Peerstore())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call the variable something shorter? This is an eyesore.

gossipsub.go Outdated
Comment on lines 315 to 319
rec, ok := r.(*peer.PeerRecord)
if !ok {
log.Warnf("bogus routing record obtained through px: envelope payload is not PeerRecord")
}
if rec.PeerID != p {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a control flow issue here; if !ok then rec.PeerID is a nil pointer dereference, which could crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching that 👍

@vyzo vyzo merged commit bb1fd4a into feat/prune-px Jan 30, 2020
@vyzo vyzo deleted the prune-px/peer-record-renaming branch January 30, 2020 13:36
@vyzo vyzo restored the prune-px/peer-record-renaming branch February 28, 2020 11:25
@vyzo vyzo deleted the prune-px/peer-record-renaming branch April 14, 2020 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants