Upgrade Iroh native backend foundation

This commit is contained in:
Eric Wendland 2026-05-22 15:28:52 +02:00
commit 9d46dd4d0d
11 changed files with 1588 additions and 712 deletions

View file

@ -12,4 +12,8 @@ prefix-scoped capabilities.
## Consequences
The MVP exposes CLI shape and types while deferring iroh-docs API pinning.
The prototype exposes CLI shape and durable local KV state. `iroh-docs 0.95.0`
is pinned and compiles against the daemon-owned `iroh 0.95.1` endpoint
generation, so the remaining work is replacing the bootstrap control-path KV
sync with an Iroh Documents namespace implementation and resource-scoped
authorization checks around namespace access.

View file

@ -18,9 +18,7 @@ Remote geth node-to-node communication is Iroh-only. The daemon will own one
shared Iroh endpoint and register module protocols on ALPNs such as
`/geth/cas/1`, `/geth/kv/1`, `/geth/pipe/1`, and `/geth/ssh-proxy/1`.
The first pinned Iroh integration uses `iroh = 0.90.0`, because newer
Rust-1.85-compatible candidates in the 0.93-0.95 range failed to compile through
a transitive `ed25519-dalek` prerelease dependency. `geth-iroh` wraps
The pinned Iroh integration uses `iroh = 0.95.1`. `geth-iroh` wraps
`iroh::Endpoint::builder()`, configures geth ALPNs with `Builder::alpns`, uses
`Builder::relay_mode`, persists an `iroh::SecretKey` as hex-encoded 32-byte key
material, and shuts down through `Endpoint::close().await`. The default config
@ -30,22 +28,20 @@ uses Iroh's default relay policy; local-only/offline development can set
`relay_map = "<name>"`, validated at config load, and reported in status as
`custom:<name>` without exposing relay URLs.
The native module-backend crates currently available for the intended CAS, KV,
and pubsub replacements are not wired in yet because they require a coordinated
endpoint upgrade. Crates.io metadata checked during this prototype pass resolved
`iroh-blobs 0.97.0`, `iroh-docs 0.95.0`, and `iroh-gossip 0.95.0` as
Rust-1.85-compatible candidates; those crates depend on `iroh 0.95` and cannot
share the daemon-owned `iroh 0.90.0` endpoint. Pulling them in beside the
current endpoint would create parallel Iroh stacks and violate the one-endpoint
daemon invariant. Until the endpoint wrapper upgrades as a unit, `geth status`
reports CAS, KV, and pubsub native backends as blocked and the bootstrap
control-ALPN paths remain explicit.
The native module-backend crates for the intended CAS, KV, and pubsub
replacements now compile against the same endpoint generation:
`iroh-blobs 0.97.0`, `iroh-docs 0.95.0`, and `iroh-gossip 0.95.0`. `geth-iroh`
exposes their native ALPNs so module migrations can register handlers without
creating a second daemon endpoint. `geth status` reports these backends as
ready to wire. The module implementations still use explicit bootstrap
control-ALPN paths until each module is migrated to its native protocol.
Module ALPNs are registered through `geth-iroh`'s protocol router scaffold. The
router owns the default protocol descriptors, rejects duplicate ALPN
registrations, and returns explicit unknown-ALPN errors. It does not yet accept
or dispatch remote streams; peer authentication and module handlers are later
Phase 1 work.
registrations, and returns explicit unknown-ALPN errors. The current daemon
accept loop dispatches geth control, pipe, and SSH-proxy streams directly; the
next backend migrations should attach iroh-blobs, iroh-docs, and iroh-gossip
handlers to the same endpoint instead of creating parallel endpoints.
The target product should use Iroh relay support for practical internet
connectivity and mDNS/LAN discovery for local networks. These are connectivity

View file

@ -102,7 +102,7 @@ Implementation order:
equivalent.
- `[x]` Fallback/stub behavior remains clearly marked where APIs are not yet
pinned.
- `[ ]` Upgrade `geth-iroh` from `iroh 0.90.0` to an endpoint version
- `[x]` Upgrade `geth-iroh` from `iroh 0.90.0` to an endpoint version
compatible with `iroh-blobs`, `iroh-docs`, and `iroh-gossip` without
introducing a second daemon endpoint.
@ -459,8 +459,8 @@ authorization and durable-state boundaries clear.
- `[x]` `geth cas providers <hash>` lists locally known providers.
- `[x]` Tests cover local provider metadata storage.
- `[ ]` Replace the bootstrap control-ALPN transfer with `iroh-blobs`
provider/fetch behavior after the daemon endpoint upgrades to an Iroh
version compatible with `iroh-blobs 0.97.0` or a newer pinned equivalent.
provider/fetch behavior using the daemon-owned `iroh 0.95.1` endpoint and
pinned `iroh-blobs 0.97.0`.
- `[x]` CAS pin and cache policy.
Acceptance criteria: