-
Notifications
You must be signed in to change notification settings - Fork 226
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
Boostrap empty RT and Optimize allocs when we discover new peers #631
Conversation
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.
Need to finish off go-libp2p-core PR but otherwise LGTM. Thanks!
@@ -504,9 +561,6 @@ func (dht *IpfsDHT) peerStoppedDHT(ctx context.Context, p peer.ID) { | |||
// A peer that does not support the DHT protocol is dead for us. | |||
// There's no point in talking to anymore till it starts supporting the DHT protocol again. | |||
dht.routingTable.RemovePeer(p) | |||
|
|||
// since we lost a peer from the RT, we should do this here | |||
dht.fixRTIfNeeded() |
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.
Should we not do this? The idea was to fix our routing table if we drop below some number of peers.
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.
I guess the periodic bootstrap will help.
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.
@Stebalien Should have added a comment here. The dht.routingTable.RemovePeer
call will result into a call to the Peer Removed callback which in turns calls fixRTIfNeeded
.
@Stebalien Have made the change in core & peerstore. Thanks ! |
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.
Merge when ready.
@Stebalien
For #387(one part of it) and #594:
SupportProtocols
and reduce allocs in RT when we add a new peer.Please review associated PRs: