-
Notifications
You must be signed in to change notification settings - Fork 344
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: kademlia oversaturation based on an exponential decay formula #2530
Conversation
pkg/topology/kademlia/kademlia.go
Outdated
if o.BitSuffixLength == 0 { | ||
o.BitSuffixLength = defaultBitSuffixLength | ||
} | ||
|
||
for i := 0; i < int(swarm.MaxBins); i++ { | ||
} | ||
|
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.
An empty loop? To what purpose?
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.
hence the 'in progress' label :) thank you!
func defaultOverSaturationCalc(bin uint8) int { | ||
return int(math.Round(50 * math.Exp(-float64(bin)/8.0))) | ||
} | ||
|
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 the 50 and the 8.0 be constants declared above? Otherwise this completely hides the actual bin limits inside this function.
Kudos, SonarCloud Quality Gate passed!
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This PR was closed because it has been stalled for 5 days with no activity. |
8692c8c
to
ef98984
Compare
Kudos, SonarCloud Quality Gate passed!
|
Codecov Report
@@ Coverage Diff @@
## master #2530 +/- ##
==========================================
- Coverage 63.57% 63.53% -0.05%
==========================================
Files 236 236
Lines 26557 26561 +4
==========================================
- Hits 16884 16875 -9
- Misses 8154 8168 +14
+ Partials 1519 1518 -1
Continue to review full report at Codecov.
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This PR was closed because it has been stalled for 5 days with no activity. |
Bin oversaturation count is calculated using an exponential decay formula.
The goal is to give more weight to shallower bins (relative to how they are now) as they make up the majority of known peers.
This should improve connectivity and decrease hops in syncing protocols.
This change is