Repository navigation
ensemble/iroh: humds peer across the internet through the n0 relay mesh - #107
Merged
Merged
Conversation
adiled
force-pushed
the
iroh-relay-internet-p2p
branch
from
November 8, 2026 18:33
aaeef0e to
6ab2e66
Compare
… own relay
Turning the relay on was half of it. The dial built its address from
`iroh-ip:` hints alone, with no address lookup behind it, so a humd
behind NAT was dialled at a private IP that never answers. Attaching
the dialer's own home relay would not have helped: n0 runs separate
relays per region, and a relay only forwards to endpoints connected
to it.
- humd binds with iroh's n0 preset: the relay mesh plus n0's DNS
address lookup. Each humd publishes its home relay under its node
id, so an `iroh:<node>` hint alone is enough to dial it, and a
stale IP or relay heals by lookup.
- humd advertises `iroh-relay:<url>` beside its `iroh-ip:` hints once
a home relay answers (bounded at 5s), and the dial path reads it,
which skips the lookup.
- `bind_direct()` is direct-only again, so the hermetic tests stay
off the network. The keyed binds that are no longer direct are
renamed `bind_with_key{,_on}`.
- ensemble/tests/iroh_relay.rs proves both paths against the live n0
mesh, each with an unroutable IP hint in the NAT's place. They are
`#[ignore]`d so CI never depends on n0. The DNS case fails on the
original relay-only change and passes on this one.
adiled
added a commit
that referenced
this pull request
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets humds on separate networks, each behind its own NAT, find and reach each other through the public n0 relay mesh. No port forwarding needed.
Why turning the relay on wasn't enough. The first commit switched
RelayMode::DisabledtoDefault, which lets a humd hold a home relay. But the dial path built its address fromiroh-ip:hints only, and theMinimalpreset has no address lookup. So a dialer still sent to the peer's private IP, and the dial hung there. Attaching the dialer's own relay doesn't fix it either: n0 runs separate relays per region (use1, usw1, euc1, aps1), and a relay only forwards to endpoints connected to it.What this does
presets::N0: the relay mesh plus n0's DNS address lookup (pkarr, relay URL only, no IPs published). Aniroh:<node>hint alone is enough to dial a humd anywhere, and stale addresses recover through the lookup.iroh-relay:<url>alongside itsiroh-ip:hints once a home relay answers, waiting at most 5s at boot. The dial path parses that hint, so the DNS lookup is skipped.bind_direct()is direct-only again, so the hermetic tests stay off the network. The keyed binds humd uses are renamedbind_direct_with_key{,_on}→bind_with_key{,_on}.endpoint_addr_from_hints, with unit tests.Proof
ensemble/tests/iroh_relay.rs(#[ignore]d so CI doesn't depend on n0): two humds exchange a tone with an unroutableiroh-ip:standing in for the NAT. One reaches the other through its advertised relay, the other by node id through DNS. Both pass against the live mesh. As a negative control, the DNS case run against the first commit's endpoint config hangs on all 4 dial attempts.The ensemble README still says the daemon is direct-only and the relay is unproven. That doc update is left for a follow-up.