Skip to content

iroh: support multiple relays + self-hosted discovery for isolated deployments #795

Description

@alpergundogdu

Context

PR #794 wired the node's iroh endpoint to honor a single [network] relay_url
(env DECDN_RELAY_URL): when set, it swaps the public n0 relay map for one
self-hosted relay via RelayMode::Custom(RelayMap::from(url)), with a TCP
reachability probe at bring-up (probe_relay in
crates/node/src/runtime/mod.rs). That's enough for a single-relay internal
testnet.

Two gaps remain for production / fully-isolated deployments:

1. Multiple relays

RelayMap already supports multiple entries (RelayMap::try_from_iter), but the
config surface is a single relay_url: Option<String>. We should accept a list
(e.g. relay_urls: Vec<String>, keeping relay_url as a back-compat alias) so
operators get relay redundancy / failover rather than a single point of failure.
Decide reachability semantics for N relays — e.g. require ≥1 reachable at boot
rather than all.

2. Self-hosted discovery (full n0 independence)

Even with a custom relay, presets::N0 keeps the n0 DNS (pkarr) address-lookup
for NodeId→address resolution, so an isolated network still depends on n0
infrastructure for discovery. For true isolation we'd swap in a self-hosted
pkarr/DNS lookup (or a static EndpointAddr provider) instead of
PkarrPublisher::n0_dns() / DnsAddressLookup::n0_dns().

Also consider

  • The gossip endpoint (crates/gossip/src/service.rs) uses presets::Minimal
    (no relay, no discovery) — decide whether it should share the same relay
    config.
  • An official/maintained iroh-relay container image (the contracts/local rig
    currently requires operators to supply IROH_RELAY_IMAGE themselves).

Tracked out of PR #794 to keep that change small.

Activity

  1. added
    kind:feature
    rust
    on Jun 3, 2026
  2. github-actions commented on Jun 3, 2026

    @github-actions

    🎯 Triage report

    Tracked out of PR #794, this issue extends the single-relay config to support relay redundancy and full n0-independence for isolated deployments. Two distinct sub-problems: (1) widening the config surface to relay_urls: Vec<String> with back-compat alias and multi-relay reachability semantics, and (2) replacing PkarrPublisher::n0_dns() / DnsAddressLookup::n0_dns() with a self-hosted or static discovery provider. Secondary question on whether the gossip endpoint (presets::Minimal) should share relay config.

    📊 Assessment

    Dimension Value Reasoning
    Type Feature Capability gap, no existing regression; extends config surface and iroh wiring
    Labels enhancement, technical, prod-blocking, rust Production-isolation requirement; affects crates/node and crates/gossip Rust code; not needed for PoC single-relay testnet but required for fully self-hosted prod
    Coding agent Needs more info Scope 1 (multi-relay config) is well-defined and mechanical. Scope 2 (self-hosted discovery) requires a design decision on which pkarr/DNS provider to use and whether to introduce a new config key — that decision isn't captured yet.

    🔗 Similar issues

    💡 Notes and suggestions

    Sub-task checklist

    • Config schema (crates/common/src/config/): add relay_urls: Vec<String>, keep relay_url: Option<String> as a deprecated alias that, if set, is merged into relay_urls. Update config-types if OriginUrl/validation types are reused.
    • Endpoint builder (crates/node/src/runtime/mod.rs): call RelayMap::try_from_iter over the list; keep the existing TCP probe_relay loop but change semantics to "≥1 reachable at boot" (log a warning for unreachable relays rather than hard-failing).
    • Self-hosted discovery (Scope 2 — needs design decision first): add discovery_url: Option<String> or similar; wire PkarrPublisher::from_url() / DnsAddressLookup::from_url() when set, falling back to n0 DNS when absent. Confirm iroh API surface before coding.
    • Gossip endpoint (crates/gossip/src/service.rs): decide and document whether presets::Minimal should be upgraded to share relay config (likely yes for isolated deployments, but gossip currently has no relay config plumbing).
    • iroh-relay image: consider pinning an official/community iroh-relay image reference in contracts/local/docker-compose.yml so operators don't need to supply IROH_RELAY_IMAGE.
    • Docs / ADR: if discovery provider becomes operator-configurable, a short ADR note or appendix update is warranted.

    Design note on reachability semantics: failing hard if all relays are unreachable is correct; logging and continuing if ≥1 is up matches how most relay-backed systems behave. Recommend surfacing unreachable relay URLs in the admin RPC health endpoint.

    Generated by Agentic Triage for issue #795 · sonnet46 505.9K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. self-assigned this
    on Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:featureprio:mediumrust

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions