You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure where this calculation comes from. It is probably a typo in the docs. maxLastSuccessfulOutboundThreshold is expected to grow as the bucket size (K) grows (see plot below), because it is less likely to hit each individual peer during the refresh. Hence the code is correct, and the doc is wrong: it should be l1 / l2 and not l1 * l2.
According to the documentation, a node can be removed from the routing table if it has “not been useful within the time period during which they are probabilistically expected to have been utilized in a refresh”. This duration is calculated using the following equation in the documentation:
However, in the implementation found in
dht.go
, the equation is slightly modified to:go-libp2p-kad-dht/dht.go
Lines 319 to 335 in 18a758c
After calculating this value, the result is multiplied by two because “IPFS defines useful as responding within 2x the time it takes any other peer from our routing table to respond to us.”
As a result, the difference between the expectation from a peer in the implementation and the documentation is:
Implementation: 1h26m26.313713864s
Documentation: 41m31.780054951s
Difference: ~45m
Is this discrepancy intended? Where can I find an explanation for this calculation? Did I miss something?
Since I was unsure whether it was a documentation or implementation issue, I decided to post directly in this repository.
The text was updated successfully, but these errors were encountered: