-
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: discv5 move #1818
chore: discv5 move #1818
Conversation
80ad5fb
to
024e08b
Compare
8e17857
to
7cb61bc
Compare
5ca3c18
to
eb6e41e
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.
Approving to not be a blocker here. Changes look good, but I think the actual discovery loop should be part of the app, where node, peer manager and discovery is integrated. See my comment below.
@@ -185,6 +158,63 @@ proc findRandomPeers*(wd: WakuDiscoveryV5, pred = none(WakuDiscv5Predicate)): Fu | |||
|
|||
return discoveredRecords | |||
|
|||
proc searchLoop*(wd: WakuDiscoveryV5, peerManager: PeerManager, record: Option[enr.Record]) {.async.} = |
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.
Mmm. Not sure I would have this loop be part of waku_discv5
. Running a discovery loop on an instantiated discv5 instance, feeding discovered records to the peer manager and bringing all of these different components together, belong to the app IMO. I know we're trying to keep app.nim
clean, but I'd say that waku_discv5
should not have knowledge of the peer manager.
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 see your point!
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.
Every test rely on discv5 having a search loop and before that it was node. app
is not tested the same way.
The search loop testing would not be very uniform.
Also, even if app is the place to tie peer manager and discv5 the way it's done is not good IMO we should change it later.
I propose to add a comment & Issue for a later refactor of this part.
b65e0e4
to
eb6e41e
Compare
8996800
to
4fdd0e9
Compare
- Refactor discv5 start, stop & loop. - Fix tests.
4fdd0e9
to
28bf211
Compare
Description
Move discv5 out of node and into app
Changes
track #1812