-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: implement relay connectivity loop #642
Conversation
Jenkins BuildsClick to see older builds (18)
|
57fdd45
to
d17ce1f
Compare
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.
Cool PR! looking fwd to see it in action on desktop 🚀
Just left some minor comments.
@@ -73,40 +94,112 @@ func (pm *PeerManager) connectivityLoop(ctx context.Context) { | |||
case <-ctx.Done(): | |||
return | |||
case <-t.C: | |||
pm.pruneInRelayConns() | |||
pm.connectToRelayPeers() |
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.
In line 92, we probably need to add a defer t.Stop()
} else if direction == network.DirOutbound { | ||
outPeers = append(outPeers, p) | ||
} | ||
} |
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.
Is it worth to add a pm.logger.Error
line indicating the cause of error while attempting to retrieve the direction?
waku/v2/peermanager/peer_manager.go
Outdated
} | ||
pm.logger.Info("Successfully disconnected connection towards peer", |
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 probably makes sense to either remove this log line, or change it into Debug
, since this is what we expect should happen most of the time, it will probably introduce too much noise in the logs
pm.logger.Info("Successfully disconnected connection towards peer", | |
pm.logger.Info("Successfully disconnected connection towards peer", |
Co-authored-by: richΛrd <[email protected]>
Description
Implemented a relay connectivity loop similar to https://github.com/waku-org/nwaku/pull/1482/files.
Changes
Tests
All unit tests passed.