Skip to content
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

kademlia fixes #266

Merged
merged 18 commits into from
Sep 26, 2024
Merged

kademlia fixes #266

merged 18 commits into from
Sep 26, 2024

Conversation

turuslan
Copy link
Contributor

@turuslan turuslan commented Sep 9, 2024

  • fix priority_queue order was reversed
  • evict disconnected peers
  • fix didn't select enough peers from buckets
  • reverse bucket indices
  • remove lazy bucket allocation, last bucket held different peers

Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
@turuslan turuslan requested a review from xDimon September 9, 2024 07:47
@kamilsa kamilsa requested a review from igor-egorov September 19, 2024 05:05
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
@turuslan turuslan requested a review from xDimon September 25, 2024 04:33
@@ -434,7 +446,7 @@ namespace libp2p::protocol::kademlia {
}

peer_ids = peer_routing_table_->getNearestPeers(
NodeId(msg.key), config_.closerPeerCount * 2);
NodeId::hash(msg.key), config_.closerPeerCount * 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NodeId::hash(msg.key), config_.closerPeerCount * 2);
NodeId::hash(msg.key), std::max(config_.closerPeerCount * 2, config_.query_initial_peers));

Not a change request, only a suggestion if this could be considered as a reasonable edit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, the change could be applied here and forth

@turuslan turuslan merged commit 55a46f3 into master Sep 26, 2024
4 checks passed
@turuslan turuslan deleted the fix/kad branch September 26, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants