Repository navigation
Description
Context
Follow-up to #795 (scope 2). PR #817 landed scope 1 — multi-relay config + a reachability-gated endpoint swap (RelayMode::Custom). That swaps only the relay leg; the endpoint still builds on presets::N0, which keeps the n0-hosted DNS/pkarr address-lookup leg (PkarrPublisher::n0_dns() / DnsAddressLookup::n0_dns()). So an "isolated" network still depends on n0 infrastructure for NodeId→address discovery.
This issue tracks the remaining work for full n0 independence.
Scope
1. Self-hosted discovery (primary)
Replace the n0 DNS/pkarr leg with operator-configurable discovery. Decision captured during #795/#817 planning: support both mechanisms, operator-selectable by which config keys are present:
- Custom pkarr + DNS URLs — new config keys wiring
PkarrPublisher::builder(url)(publish) andDnsAddressLookup::builder(origin_domain)(resolve). Operators run their own pkarr relay + DNS. Closest to n0's model; supports dynamic addresses. - Static peer map (
MemoryLookup) — NodeId→address mappings (relay URL + IPs per peer) supplied directly in config. Fully offline/isolated, no discovery infra to run; addresses must be known ahead of time.
iroh 0.98.2 supports all of this by composing on presets::Minimal + .address_lookup(..) instead of presets::N0. The node's wiring layer (not the leaf crates) should select the provider — see appendix-poc-production-seams.md.
Implementation notes:
- Switching off
presets::N0means re-supplying the crypto provider and the relay/discovery legs explicitly. Confirm the exact builder surface against the pinned iroh version before coding. - A short ADR note (or appendix update) is warranted once the discovery provider becomes operator-configurable.
2. Validate-time relay URL checks (small, from #817 review)
Currently a malformed network.relay_urls entry is only rejected at node bring-up (parse_relay_urls in crates/node/src/runtime/mod.rs), which already names the offending entry. decdn config validate reports such a config as valid. Add a lightweight URL parse check at config-resolution/validate time (e.g. url::Url in crates/common, no iroh dep needed) so config validate fails fast and names the bad entry — matching how S3 endpoint/bucket fields are validated. Note this makes resolve_network (or a validation pass) fallible.
Out of scope
- Multi-relay config + the relay-leg swap — done in feat(node): multi-relay config + reachability-gated endpoint bring-up (#795) #817.
- Pinning an official/maintained iroh-relay container image in the
contracts/localrig (operators currently supplyIROH_RELAY_IMAGE) — track separately if desired.
References
- iroh: support multiple relays + self-hosted discovery for isolated deployments #795 (parent), feat(node): multi-relay config + reachability-gated endpoint bring-up (#795) #817 (scope 1 implementation)
crates/node/src/runtime/mod.rs—build_endpoint,parse_relay_urlscrates/common/src/config/{types.rs,resolved.rs,mod.rs}— config surface
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
github-actions commentedon Jun 5, 2026
🎯 Triage report
Scope 2 of the iroh n0-independence initiative (#795), spawned after PR #817 landed multi-relay support. The two tasks are well-bounded: (1) replace
presets::N0's DNS/pkarr discovery leg with an operator-selectable backend (custom pkarr+DNS URLs or staticMemoryLookup), and (2) a small, additive fix to makedecdn config validatecatch malformed relay URLs at parse time rather than at daemon start. Both tasks have named files, specific iroh APIs, and clear success criteria.📊 Assessment
enhancement,technical,rust,prod-blockingare all accurate; no additions needed🔗 Similar issues
💡 Notes and suggestions
Scope 1 — self-hosted discovery
Files to touch:
crates/common/src/config/types.rs+resolved.rs— new config fields for pkarr URL, DNS origin domain, and static peer map entriescrates/node/src/runtime/mod.rs—build_endpoint: switch frompresets::N0topresets::Minimal + .address_lookup(..)when custom discovery config is presentImplementation checklist:
presets::Minimalbuilder surface in the pinned iroh 0.98.2 — specifically what must be re-supplied (crypto provider, relay driver) when not usingpresets::N0network.discovery.pkarr_url+network.discovery.dns_origin(for custom pkarr+DNS) andnetwork.discovery.peersmap (NodeId→{relay_url, addrs}) for staticMemoryLookupbuild_endpoint, detect which config keys are present and compose the appropriateAddressLookupimpl; fall back topresets::N0if none are set (back-compat)presets::N0adr/appendix-poc-production-seams.mddocumenting the discovery-provider seamWatch out for:
presets::N0may wire the relay driver AND the pkarr publisher in one call — switching topresets::Minimalmeans both legs must be configured explicitly, not just the lookup side.Scope 2 — validate-time relay URL checks
This is a clean, isolated fix with a clear analogue in the S3 field validation.
crates/common/src/config/resolved.rs(or a dedicated validation pass), callurl::Url::parse()on each entry innetwork.relay_urlsresolve_network(or the validation path) fallible — update callers accordinglydecdn config validatewith a deliberately malformed URL should exit non-zero and print the bad entryPriority order: Scope 2 is small and independent — good candidate to land first or in a separate PR to unblock operator tooling quickly.
Add this agentic workflows to your repo
To install this agentic workflow, run
thiras commentedon Jun 5, 2026
Carried over from #795 before it closes (via PR #817). One loose "also consider" item from #795 isn't yet captured in this issue's scope and would otherwise be orphaned when #817 merges and closes #795:
crates/gossip/src/service.rsbuilds onpresets::Minimal(no relay, no discovery). Decide whether the gossip endpoint should share the same operator-configurable relay/discovery config as the node endpoint, or stay relay-less by design.(The other #795 straggler — pinning an official iroh-relay container image for the
contracts/localrig — is already noted under this issue's Out of scope.)feat(common): validate-time relay URL parse check (#818) (#828)
refactor(config): address PR review on discovery (#818)
docs(config): correct NodeId form wording + pkarr redaction comment (#…
feat(node): operator-configurable self-hosted discovery (#818) (#829)
fix(config): expand ${VAR} in [network.discovery] fields (#863)