-
Notifications
You must be signed in to change notification settings - Fork 182
Enhancement: Fix Kademlia DHT Bootstrap by Using Connected Peers as Fallback #943
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
base: main
Are you sure you want to change the base?
Conversation
@SuchitraSwain Could you please rebase your branch on the latest main branch? |
@SuchitraSwain : HI Suchitra, wish if you could resolve the merge conflicts. Re-ran the CI/Cd pipeline. Please arrive at a good conclusion on the test results. CCing @sumanjeet0012 |
@seetadev please Re-ran the CI/Cd pipeline. |
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.
@SuchitraSwain There are a couple of issues in this PR:
1. The branch contains some previous commits from another branch. Please rebase it on the latest main branch.
2. The main objective of this PR is to ensure that, in case of fewer peers in the routing table, the connected peers are used for the random walk, But here this logic is used in multiple places like find node which is not required.
3. I have also added comments regarding some minor issues in this PR.
) | ||
|
||
# Fallback to connected peers if routing table has insufficient peers | ||
MIN_PEERS_THRESHOLD = 5 # Configurable minimum |
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.
Constants should be placed at top.
connected_peers = self.host.get_connected_peers() | ||
if connected_peers: | ||
# Sort connected peers by distance to target and use as response | ||
from .utils import sort_peer_ids_by_distance |
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.
import statements should be placed at top.
issue: #905
### What was wrong?
### How was it fixed?
A fallback mechanism was implemented in the DHT query logic:
✅ Benefits
To-Do
Cute Animal Picture