This repository was archived by the owner on Jan 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
feature: update worker to use libp2p node #619
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
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
Contributor
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 {
Contributor
Author
|
closing in favour of #622 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.