Skip to content

Conversation

@noot
Copy link
Contributor

@noot 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

@JannikSt JannikSt requested a review from Copilot July 9, 2025 20:29
Copy link
Contributor

Copilot AI left a 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::Service into CLI and heartbeat logic
  • Remove old iroh dependencies 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::new and message-handling flows. Adding basic tests (e.g., instantiating a Service, 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 Context is very general and may clash with other contexts. Consider renaming it to something more specific like ServiceContext or P2pContext for clarity.
struct Context {

@noot
Copy link
Contributor Author

noot commented Jul 11, 2025

closing in favour of #622

@noot noot closed this Jul 11, 2025
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.

2 participants