-
Notifications
You must be signed in to change notification settings - Fork 27
feature: update worker to use libp2p node #619
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
noot
commented
Jul 9, 2025
- implement worker libp2p node with handling of required request-response message types
- update worker to use libp2p node when started
- remove iroh from worker
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 replaces the custom Iroh-based P2P implementation in the worker with a new libp2p-backed p2p::Node, persists and loads the node keypair in SystemState, and removes obsolete seed-based utilities.
- Persist/load libp2p keypair instead of seeding Iroh and generating IDs
- Wire new
crate::p2p::Serviceinto CLI and heartbeat logic - Remove old
irohdependencies and utility functions
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/worker/src/utils/p2p.rs | Deleted obsolete Iroh-based seed/id utilities |
| crates/worker/src/state/system_state.rs | Persist/load p2p::Keypair instead of seeds/IDs |
| crates/worker/src/p2p/mod.rs | New Service using external p2p crate |
| crates/worker/src/cli/command.rs | Updated CLI to build new libp2p service |
| crates/worker/src/operations/heartbeat/service.rs | Updated heartbeat to use PeerId |
| crates/worker/src/operations/compute_node.rs | Adjusted pool ID types and logging |
| crates/worker/src/docker/**/*.rs | Removed P2P seed substitutions in task bridge |
| crates/worker/Cargo.toml | Added p2p workspace dependency |
| crates/p2p/src/lib.rs | Exposed Keypair alias for external crate |
Comments suppressed due to low confidence (2)
crates/worker/src/p2p/mod.rs:34
- [nitpick] There are no unit or integration tests for the new
Service::newand message-handling flows. Adding basic tests (e.g., instantiating aService, sending a mock request, verifying the response) would help ensure correctness.
pub(crate) fn new(
crates/worker/src/p2p/mod.rs:126
- [nitpick] The name
Contextis very general and may clash with other contexts. Consider renaming it to something more specific likeServiceContextorP2pContextfor clarity.
struct Context {
|
closing in favour of #622 |