Repository navigation
fix(relay): prevent cross-relay aliasing on home_on_every_relay and isolate relay_slow - #26
Merged
Merged
Conversation
…eclaim idle non-home dials - Replace `presets::N0` with `presets::Minimal` in `iroh/tests/relay_slow.rs` so deterministic secret keys do not publish to or pull foreign relay addresses from public Pkarr/DNS. - Replace the 8x `yield_now` wait in `concurrent_insert_and_remove_relay_keeps_removed_tombstone_consistent` with explicit `Notify` synchronization once `ActorMessage::RelayRemoved` is queued on `actor_sender` behind the paused `RelayInserted`. - Disable `RelayActor::active_relay_handle_for_endpoint`'s `endpoints_present` cross-relay shortcut when `Builder::home_on_every_relay` is set while keeping `TransportsSender`'s `unwrap_or(0)` fallback intact: unowned allowed relays dial their own relay URL genuinely on `relay[0]`, whereas absent foreign relays fail QUIC path validation (`RELAY_PATH_LOST_MAX = 2`) without borrowing another relay's connection or establishing a misnamed path. - Extend `ActiveRelayActor`'s 60 s `RELAY_INACTIVE_CLEANUP_TIME` deadline during disconnected undeliverable flushes only when outgoing datagrams were actually queued, and honor that idle deadline across both `run_dialing` and `sleep_backoff` so a blackholed non-home relay exits and is reaped instead of retrying until endpoint shutdown. Co-authored-by: darksky <darksky@cue.surf>
CommaBot
force-pushed
the
ember/no-cross-relay-alias
branch
from
November 20, 2026 20:22
f5102d3 to
fdb906b
Compare
CommaBot
pushed a commit
to AFK-surf/monoid
that referenced
this pull request
Nov 20, 2026
Pin iroh and iroh-relay across client, mesh-transport, station mesh addon, and load tools to 0d8d64f82289a6726cd7edb1671d38a1ce56d0fc (zzj3720/iroh#26). Co-authored-by: darksky <darksky@cue.surf>
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.
Summary
iroh/tests/relay_slow.rs:73, 183(presets::N0→presets::Minimal): Stopsrelay_slowtests (which bind deterministic keys[1; 32]/[2; 32]) from querying or publishing to public N0 Pkarr/DNS while preserving all transport, path-selector, 600 ms slow-relay switch, new-connection race, and 17-peer zero-loss assertions.concurrent_insert_and_remove_relay_keeps_removed_tombstone_consistent(iroh/src/endpoint.rs,iroh/src/socket.rs): Replaces the 8×yield_nowloop with a test-onlyNotify(notify_next_relay_remove_queued) fired onceActorMessage::RelayRemovedis enqueued onactor_senderbehind the pausedRelayInserted.Builder::home_on_every_relay+ non-home idle cleanup (iroh/src/socket/transports/relay/actor.rs):home_on_every_relaysent to a relay URLR_extrathat owned no single-relay transport,TransportsSender(transports.rs:1347) routed it torelay[0]viaunwrap_or(0), andRelayActor::active_relay_handle_for_endpoint(actor.rs:1866-1884) saw the peer inrelay[0]'sendpoints_presentand sentR_extra's packets overrelay[0]'s WebSocket—establishing a path namedRelay(R_extra)whose traffic and RTT actually belonged torelay[0].TransportsSender'sunwrap_or(0)is intentionally preserved so legitimate unowned allowed URLs (nativeallowPublicRelaysemergency fallback whenoursare down, and workspace custom relays#theirson the main endpoint) still reachrelay[0];RelayActor::active_relay_handle_for_endpointnow skips theendpoints_presentcross-URL shortcut whenhome_on_every_relayis enabled and dialsR_extradirectly (is_home_relay = false).ActiveRelayActor::run_dialingresetinactive_timeouton every 3 sUNDELIVERABLE_DATAGRAM_TIMEOUTtick even when the outgoing queue was empty, andsleep_backoffdid not pollinactive_timeoutat all—allowing a blackholed non-home relay whose handshake kept timing out at 10 s to retry forever until endpoint shutdown even after QUIC exhausted its2 / 6path budget.flush_undeliverable_datagramsnow extendsinactive_deadline(RELAY_INACTIVE_CLEANUP_TIME = 60 s) only when outgoing datagrams were actually queued, and bothrun_dialingandsleep_backoffexit promptly onceinactive_timeoutelapses with nothing new queued.home_on_every_relay == false, including innerLeafLinksscope endpoints androute_lookup_reads_endpoints_present_and_asks_no_actor) retain upstream'sendpoints_presentshortcut unchanged.Product Behavior Change: Workspace Custom Relays (
#theirs) on the Main Endpointrelay[0]already had a station inendpoints_present(e.g. after exchanging traffic over an officialoursrelay first and then learning#theirsviasetWays→addAddr, or on subsequent connections to that station), packets addressed to#theirson the main endpoint were borrowed ontorelay[0]'s official WebSocket rather than opening a connection to#theirs.home_on_every_relayborrowedrelay[0](sent(&relay_d) == 0while opening a path namedRelay(url_d)) onceendpoints_presentcontained the peer is runtime-verified by the pre-fix failure ofendpoint::tests::home_on_every_relay_does_not_borrow_another_relay_for_unowned_urls. How productMeshfeeds#theirsandrelayAllowlistto the main endpoint (client/core-ts/src/mesh.ts:969, 993-996, 1431, 1472-1474, 1607,client/shell/src/iroh_ops.rs:345-349,client/iroh-wasm/src/lib.rs:98-102) is a code-reading deduction (note: on a cold firstconnectbeforeendpoints_presentwas populated, an allowed#theirsURL could already be dialed onrelay[0]; and on web,#theirsenters the main endpoint'srelayAllowlistonly after#rebindatmesh.ts:1431).#theirsis permitted by the main endpoint's allowlist and outgoing packets are addressed to it,relay[0]genuinely connects to#theirsvia a non-homeActiveRelayActor(is_home_relay = false):#theirsURL on the main endpoint (relay[0]), shared across all QUIC connections/peers on that endpoint.EndpointId(Mesh.#secret), distinct from the per-relay derived key (pinnedKey(secret, relay)) used by single-relay#exploreendpoints (mesh.ts:2638).#theirssends keepalives/ACKs, each outgoing datagram extendsRELAY_INACTIVE_CLEANUP_TIME(60 s). Once no outgoing datagrams are queued for#theirs(connection closed,#theirsdisabled viaset_disabled_relays/ Hot Relays narrowing, peer absent afterRELAY_PATH_LOST_MAX = 2, or handshake blackholed), the non-homeActiveRelayActorexits and is reaped after 60 s.Verification
socket::transports::relay::actor::tests::non_home_blackhole_relay_exits_after_inactive_cleanup_time(paused-clock regression: confirmed runtime failure when empty 3 s flushes extendinactive_deadline; passes with fix, verifying 5× 10 s blackhole dial timeouts + backoffs exit and reap byt=62 swith 0 dials across+105 safterwards, while a connected extra non-home relay carrying periodic traffic stays active pastt=102 sand exits after60 sidle).endpoint::tests::home_on_every_relay_does_not_borrow_another_relay_for_unowned_urls(strictsent(&relay_c) > c_before+ directrelay_loss_stats == Some((0, 2, 2))assertion forRELAY_PATH_LOST_MAXexhaustion +> RELAY_REOPENsilence check).endpoint::tests::concurrent_insert_and_remove_relay_keeps_removed_tombstone_consistentsocket::transports::relay::full unit suite (24/24),iroh-relayunit suite (16/16),relay_slowintegration suite (3/3), andwasm32-unknown-unknownchecks (tls-ringandtls-ring,unstable-custom-transports).