swactor/crates/iroh-driver
Zachery Aaron Shores-Chmielewski c42bf5e983 demo: rename xtask demo command; dashboard-established data-plane edges
Rename `cargo xtask provisioning-reconciler-demo` to `cargo xtask demo`
(CLI dispatch, help, child re-exec argv, launch spec strings, module dir
xtask/src/provisioning_demo -> xtask/src/demo).

Add iteration-1 data-plane edges, established from Fleet Control:

- Fleet Control "edge" button -> POST /control/edge (new
  ControlCommand::EstablishEdge) -> supervisor actor resolves the node's
  advertised EndpointAddr (stashed in NodeRuntime by AnnounceActor) and
  provisions a real outbound EdgeRuntime (arena ring lease, recorder
  WorkerPort, EDGE_ALPN send pump) in a new edge pump thread.
- Node gains EDGE_ALPN, an actor bridge decoding EdgeProvision gossip,
  and a NodeEdgeAgent that provisions its (single) inbound edge, polls
  it, mirrors observations onto the node.edge telemetry channel
  (render-only), and answers EdgeAck gossip which terminates the
  supervisor's provision retries. Node teardown replaces its inbound on
  re-provision; supervisor replaces sessions per node and tears them
  down on node exit/replacement/shutdown.
- The edge pump runs on the engine's blocking pool with sole session
  ownership (commands in, state mirror + feed lines out): the connect
  handshake blocks its thread and must not run on a Tokio worker or
  share a lock with the actor. Connects are bounded (10s) so a dead
  node faults its session instead of wedging edge polling.
- iroh-driver: retain_telemetry_connections() opts an application out
  of the driver-owned TELEMETRY_ALPN ingress so the node's pull server
  can drain those connections itself (the actor-bridge pump would
  otherwise claim them).
- Dashboard: edges array in the reconciler snapshot, per-node edge
  badges and edge button in Fleet Control, node_edges render mirror.
2026-08-17 00:11:20 +04:00
..
src demo: rename xtask demo command; dashboard-established data-plane edges 2026-08-17 00:11:20 +04:00
tests refactor: datastream crate is now telemetry 2026-08-15 12:18:56 +04:00
Cargo.toml Move all edge logic into data-plane; reduce iroh-driver to a byte-transport port 2026-08-16 21:49:45 +04:00
IROH_DRIVER_SPEC.md Move all edge logic into data-plane; reduce iroh-driver to a byte-transport port 2026-08-16 21:49:45 +04:00
README.md refactor: datastream crate is now telemetry 2026-08-15 12:18:56 +04:00

iroh-driver

iroh-driver is the iroh-backed transport bridge for the actorized distribution stack. It owns the concrete iroh endpoint, QUIC connections, relay configuration, peer authorization, and frame shuttling between iroh and swactor actor mailboxes.

Engine ownership

The driver runs on a caller-supplied swactor EngineHandle — the single engine that owns the node's Tokio substrate. All accepts, reads, dials, writes, retries, and teardown are scheduled through that handle; the driver stores no raw Tokio handle and performs no ambient-runtime detection (ENGINE_SPEC.md §7).

let driver = IrohDriver::with_engine(engine.handle(), config)?;

The driver validates that the engine provides the tasks, timers, and io capabilities before binding the endpoint or starting any background work (ENGINE_SPEC.md). Endpoint construction runs as an engine-hosted task; with_engine blocks on a synchronous channel until the endpoint is bound (or fails), so callers need not enter or possess the raw substrate runtime.

Engine-hosted progression

All adapter progression — actor-bridge ingress/egress, telemetry ingress, and edge ingress — is driven by an engine-hosted interval pump installed via install_actor_bridge_pump. Applications do not (and cannot) manually pump these adapters; the single engine owns progression for the node's lifetime (ENGINE_SPEC.md). snapshot is a pure-synchronous read of driver state, callable from any thread. The shutdown method closes the endpoint via an engine-hosted task, blocking on a synchronous channel until completion.