Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
discv5: only store crawl error if no query succeeded #55
discv5: only store crawl error if no query succeeded #55
Changes from 1 commit
d0b17e6
9a1a685
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
actually, could you use the
errorBits
to determine if there is at least one successful FIND_NODE RPC? Then you wouldn't need thesuccess
variable.However,
errorBits
aren't tracked here yet (just saw that), so this also needs fixing. 🙈 Could you also do that? ThedrainBuckets
incrawler_p2p.go
in thelibp2p
package would have the logic of how to do that.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.
updated:
nebula/discv5/crawler.go
Lines 516 to 521 in 9a1a685
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.
ah sorry, I meant
errorBits
isn't even used in this routine. So it will always be 0 as there's no statement that updates the errorBits variable. In case of an error the corresponding bit should be set (even though it's inaccurate because we might exit the loop early)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.
errorBits
is updated atnebula/discv5/crawler.go
Line 481 in 9a1a685
You mean, if we exit the loop early we need to set the error bits to 1 for the buckets that were skipped?
I'll update the
ErrorBits
touint32
as it can contain up to17
bits.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.
lol, I was ctrl+f searching the page for
errorBits
and was afterward expanding the code lines in the GitHub diff viewer. However, this didn't highlight theerrorBits
variable there so I was under the impression that it wasn't used. Sorry for the noise!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.
ErrorBits
is defined incore
and I don't want to mess everything up, so we can assume that bucket 17 (or 239 in discv5 naming) will always be empty and never cause issues 👍🏻