-
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
Return the correct number of remaining bootstrap requests. #2125
Conversation
Thanks for the nice gesture. 😃 |
Thanks @rubdos. Very much appreciated. Would you mind including the diff below to prevent future regressions? diff --git a/protocols/kad/src/behaviour/test.rs b/protocols/kad/src/behaviour/test.rs
index 7f73c1d8..f22b4b65 100644
--- a/protocols/kad/src/behaviour/test.rs
+++ b/protocols/kad/src/behaviour/test.rs
@@ -196,6 +196,10 @@ fn bootstrap() {
}
first = false;
if ok.num_remaining == 0 {
+ assert_eq!(
+ swarm.behaviour_mut().queries.size(), 0,
+ "Expect no remaining queries when `num_remaining` is zero.",
+ );
let mut known = HashSet::new();
for b in swarm.behaviour_mut().kbuckets.iter() {
for e in b.iter() { |
And please also add an entry to the changelog: diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md
index db0b9f0d..18c03d53 100644
--- a/protocols/kad/CHANGELOG.md
+++ b/protocols/kad/CHANGELOG.md
@@ -13,8 +13,11 @@
- Remove false `debug_assert` on `connected_peers` (see [PR 2120]).
+- Return correct number of remaining bootstrap requests (see [PR 2125]).
+
[PR 2087]: https://github.com/libp2p/rust-libp2p/pull/2087
[PR 2120]: https://github.com/libp2p/rust-libp2p/pull/2120
+[PR 2125]: https://github.com/libp2p/rust-libp2p/pull/2125
# 0.30.0 [2021-04-13] |
Fixes libp2p#2121 Co-authored-by: Max Inden <mail@max-inden.de> Co-authored-by: @izolyomi
2e6c989
to
8729fd8
Compare
Done, amended the commit, @mxinden. Thanks for the quick replies. Here's to contributing some more in the near future :-) |
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.
Here's to contributing some more in the near future :-)
🚀 always welcome. Let me know if you need any help.
As per the discussion on #2121
I can confirm that the bootstrap process seems to go a lot better now :-)
@izolyomi, I included you as
Co-authored-by
in the commit, but don't have an email address for it. Let me know if you want a change there.