-
Notifications
You must be signed in to change notification settings - Fork 53
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
chore: stop connecting to out peers until target is reached #2823
chore: stop connecting to out peers until target is reached #2823
Conversation
You can find the image built from this PR at
Built from 9a53969 |
You can find the image built from this PR at
Built from 9a53969 |
Thanks for that @gabrielmer ! nwaku/waku/node/peer_manager/peer_manager.nim Line 732 in 93e9ba2
|
So before the fix that I added, That's why I'm fixing |
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.
LGTM! Thanks for the clarification! 💯 🥳
Thanks to this enhancement, I understand that the precondition controlled in the next point:
nwaku/waku/node/peer_manager/peer_manager.nim
Line 724 in 317c83d
if outRelayPeers.len >= pm.outRelayPeersTarget: |
...still remains at the end of the connectToRelayPeers
proc. In other words, we make sure that the this condition is met: outRelayPeers.len < pm.outRelayPeersTarget
Great catch 🙌 !
Exactly! This was still controlled but it wasn't precise, we would overshoot most of the times and could dial up to 9 more peers than the target |
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.
Yes, it looks ok.
Description
We're currently attempting establish more
out connections
than our target. We are trying to connect 10 peers at a time, and we still dial 10 even if our target is less than 10.When investigating #2780, I noticed that the issue started right after we tried to connect to more nodes than we could.
Making a small fix so we stick more precisely to our targets.
Changes
outRelayPeersTarget