-
Notifications
You must be signed in to change notification settings - Fork 939
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
Inconsequent Kademlia bootstrapping events #2121
Comments
Great catch @izolyomi! From taking a quick look, the issue seems to be here: rust-libp2p/protocols/kad/src/behaviour.rs Lines 1108 to 1124 in c1ef4bf
The code does two things:
- let num_remaining = remaining.len().saturating_sub(1) as u32;
+ let num_remaining = remaining.len() as u32; @izolyomi do you want to send in a patch?
This is normal. The variation is the result of the code below: rust-libp2p/protocols/kad/src/behaviour.rs Lines 1073 to 1106 in c1ef4bf
|
@mxinden Thanks for the quick reply and confirmation. I've also had my suspicion on the As the patch seems to be trivial, I can easily send a one-liner if you prefer the usual Github PR workflow, but feel free to resolve it in any faster way if that's more practical on your side. 🤷 |
Fixes libp2p#2121 Co-authored-with: Max Inden <mail@max-inden.de> Co-authored-with: @izolyomi
Fixes libp2p#2121 Co-authored-by: Max Inden <mail@max-inden.de> Co-authored-by: @izolyomi
Fixes libp2p#2121 Co-authored-by: Max Inden <mail@max-inden.de> Co-authored-by: @izolyomi
Following events coming from the Kademlia protocol, I always receive bootstrapping events in the following pattern:
I.e. there are always two different events with
num_remaining: 0
at the end. I think there must be a bug in either the discovery algorithm or the counter (for remaining peerids to be discovered) has an off by one error.I've also seen that the initial value of the counter varies from 11 to 13. This might be normal to be undeterministic though, I'm not completely familiar with all internal details of this DHT implementation.
The text was updated successfully, but these errors were encountered: