-
Notifications
You must be signed in to change notification settings - Fork 54
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(peer-exchange): start px discv5 loop after discv5 has started #1407
Conversation
@@ -489,7 +487,10 @@ proc startNode(node: WakuNode, conf: WakuNodeConf, | |||
await connectToNodes(node, dynamicBootstrapNodes, "dynamic bootstrap") | |||
except: | |||
return err("failed to connect to dynamic bootstrap nodes: " & getCurrentExceptionMsg()) | |||
|
|||
|
|||
if conf.peerExchange: |
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 checking. Before we were also running runPeerExchangeDiscv5Loop
if conf.peerExchangeNode != ""
, but not only if conf.peerExchange
. Is this intended? :)
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, because only a service node has to run discv5. Nodes that only specify a peer-exchange-node
act as client.
(In a future refactor, client nodes should be able to use peer exchange without mounting the protocol.)
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.
thanks! lgtm!
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 ✅
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. Seems indeed like your failing test is the one investigated in #1368
The peer exchange discv5 loop was stared before discv5 was listening, causing the loop to immediately stop.
This PR fixes this issue.