-
Notifications
You must be signed in to change notification settings - Fork 0
Bootstrap and replication fixes #259
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
Conversation
Reviewed the latest changes (post-review fixes). No issues found. Changes in this update:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
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.
Pull request overview
This PR addresses critical P2P replication and routing issues in a Kademlia DHT implementation by introducing bounded replication windows, routing eligibility gating, and reducing log noise.
Changes:
- Adds chain-state-based routing eligibility checks to prevent non-active supernodes from participating in the DHT routing table
- Implements bounded replication key scanning (200k keys per cycle) with stable cursor advancement to enable incremental progress on large backlogs
- Refactors replication key assignment to use one-pass logic instead of per-peer re-scanning, reducing complexity and resource usage
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| p2p/kademlia/bootstrap.go | Returns active supernode IDs as allowlist from chain state and triggers routing table pruning |
| p2p/kademlia/dht.go | Implements routing eligibility gating infrastructure and filters ineligible nodes from routing operations |
| p2p/kademlia/node_activity.go | Adds eligibility checks to node activity monitoring and ping success handlers |
| p2p/kademlia/replication.go | Implements bounded key scanning, one-pass key assignment, and stable window-based cursor advancement |
| p2p/kademlia/store.go | Updates interface to accept maxKeys parameter for bounded queries |
| p2p/kademlia/store/mem/mem.go | Updates signature to match new interface |
| p2p/kademlia/store/sqlite/replication.go | Implements bounded query with limit extension for same-timestamp keys and context cancellation checks |
| p2p/kademlia/store/sqlite/sqlite.go | Reduces log noise by treating context timeout/cancellation as Info instead of Error |
| p2p/kademlia/redundant_data.go | Updates call to use unlimited keys for cleanup operations |
| docs/p2p-replication-and-routing-changes-2026-01-13.md | Comprehensive documentation of changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.