-
Notifications
You must be signed in to change notification settings - Fork 339
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: simplify kademlia topology build up #2427
Conversation
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.
In general looks good but some code this PR deletes (e.g.: in the connectNeighbours
) were quick & dirty optimization done before the 1.0 release which took topology buildup on our staging from ~10 min to ~2-3 min. Were these changes benchmarked for regression?
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @acud and @metacertain)
pkg/topology/kademlia/kademlia.go, line 315 at r1 (raw file):
if po < depth { return false, true, nil
Unacassarry new line.
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.
We benchmarked this on the main-net and there was no significant difference in build up time. We have a new branch now which optimizes kademlia on top of this simplification which should result in quicker build up compared to master.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @acud and @metacertain)
Some notes about the tests for this PR: The /topology endpoint was queried on a 30 second interval for 20 times for each branch: On simplify-kad branch: depth 12 was reached by min ~5 On master branch: depth 11 was reached by min ~4 On the master run for example, depth 12 was never reached, because of small population size in bin 12. |
PR removes the
overSaturationPeers
check inconnectNeighbours
, and the second iterator neighborhood connector. We have more PRs up now that prunes oversaturated bins (which this PR causes to happen) and more optimizations to increase build up time.This change is