-
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
feat(discv5): update filter predicate #1918
Conversation
You can find the image built from this PR at
|
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 like this also include changes related to the other PR's ENR updating? My comments on that PR still holds, but in general agree with caching the predicate on the discv5 object.
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 for the PR! I've added a few comments that I hope you find useful
@@ -314,8 +320,12 @@ proc subscriptionsListener*(wd: WakuDiscoveryV5, topicSubscriptionQueue: AsyncEv | |||
if unsubRes.isErr(): | |||
debug "ENR shard removal failed", reason= $unsubRes.error | |||
|
|||
if subRes.isOk() and unsubRes.isOk(): | |||
debug "ENR updated successfully" | |||
if subRes.isErr() and unsubRes.isErr(): |
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 this better be an or
?
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.
if either one succeed then add the log message and update the predicate.
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.
Failing is not that bad in this case.
Description
I changed the way the discovery predicate is computed. Instead of passing a record to
searchLoop
it uses the record already in discv5 if possible. Also, when the ENR is updated the predicate is too.Changes
Follow up from #1875