Skip to content

Remove QUIC 0-RTT probe connection establishment (ADR 015) #1429

Closed

Description

@alpergundogdu

Decision (2026-07 ADR simplification audit). Filed under the Protocol simplifications milestone — sibling to the original cuts #1396, #1394, #1419. Verdict: DROP. The overhead 0-RTT removes is trivial (one RTT on warm probe reconnects), negligible especially for large-file transfers, and not worth the replay-safety surface.

Proposal: remove QUIC 0-RTT probe establishment (ADR 015)

Status: proposal for discussion, not a decision.

Summary

Delete ADR 015 (adr/015-zero-rtt.md) and the whole 0-RTT mechanism it
specifies. Concretely, remove:

  • The network.enable_0rtt config key and its default-true resolution.
  • The client-side 0-RTT attempt/fallback path (probe_once's into_0rtt()
    branch, the enable_0rtt gate, and the post-exchange ticket linger).
  • The max_tls_tickets(1000) client-cache sizing and the
    SESSION_TICKET_CACHE_SIZE protocol constant.
  • The ProbeHandler::on_accepting override that reads probes as pre-handshake
    early data.
  • The five 0-RTT observability signals (decdn_quic_0rtt_{attempts,accepted, rejected}_total, decdn_quic_session_ticket_cache_size,
    decdn_quic_session_ticket_peers_dropped_total) and the deferred
    decdn_probe_collection_latency_seconds outcome={0rtt_warm,1rtt_cold}
    label.

Every probe connection then completes as a plain 1-RTT QUIC handshake — the
exact behavior we already fall back to today when a ticket is missing or the
server rejects 0-RTT.

Motivation

  1. The benefit is one RTT, and it never compounds. 0-RTT removes exactly
    one round trip, and only on a warm reconnection to a peer for which the
    client already holds a TLS session ticket (ADR 015 §"Impact on Probe
    Latency": cold = 1 RTT, warm-rejected = 1 RTT, warm-accepted = 0 RTT). This
    is a per-connection constant, not a mechanism that scales. Cold probes —
    which include every first contact and, per ADR 037, every breadth-first
    entry in the client's background latency sweep to un-sampled peers — get
    nothing. So the win is confined to repeat probes to already-seen peers.

  2. The feature introduces its own hazard and then spends most of its text
    bounding it.
    0-RTT early data is replayable (ADR 015 §Context). None of
    the replay-safety apparatus in ADR 015 would exist without the feature: the
    ProbeRequest-is-idempotent analysis, the "responders MUST NOT use probe
    receipt to trigger any state change" rule, the "probe handlers MUST be
    annotated 0-RTT-safe" implementation note, the client-side single-emitter
    invariant, and the ticket-lifetime replay window all exist purely to fence a
    force the feature itself creates. Remove 0-RTT and every one of those
    obligations disappears with it.

  3. The safety model is a hand-wired invariant, not a gate. ADR 015
    §"Replay Safety Is Client-Side" is explicit: iroh sets
    max_early_data_size = u32::MAX on every server config, so the QUIC layer
    accepts 0-RTT for any ALPN regardless of handler. Nothing server-side stops a
    state-changing StreamRequest / StoreRequest from being replay-processed;
    the only thing that prevents it is that "exactly one 0-RTT-emitting client
    path" exists, hard-wired to the probe ALPN (ADR 015 §Consequences,
    "Defense-in-depth gap"). Any future probe handler that adds a side effect
    (demand tracking, cache-priority boosting) silently voids replay safety with
    no compile-time or server-side backstop. That is a permanent correctness
    footgun on the probe path, paid for a one-RTT optimization.

  4. The 15s probe cache and ADR 037 already blunt the beneficiary path. The
    probe cache (ADR 001) suppresses repeat client probes for the same hash for
    15s, and ADR 037 makes per-request client probing optional — clients route by
    their RTT map instead. The warm-reconnection pattern 0-RTT optimizes is not
    the dominant probe workload it was when ADR 015 was drafted. (See Counter-
    argument for where it is not blunted — this claim has limits.)

  5. Much of the payoff is still unbuilt, so removal is cheaper now than
    later.
    ADR 015 §Observability records that
    decdn_probe_collection_latency_seconds is deferred because "the node's
    cache-miss probe-collection loop... does not exist yet (no DHT→probe
    candidate path is implemented)." The single largest concrete latency win —
    parallel cold-miss probing to 3-5 DHT candidates — has no code behind it. We
    would be preserving a mechanism whose headline use case is still a TODO.

What removal touches

Blast radius is real but self-contained — no contract surface (ADR 016 is
untouched), no wire-format change (probes still use cdn/probe/v1, just always
1-RTT). Grep-confirmed:

ADRs / docs

  • Delete adr/015-zero-rtt.md (129 lines).
  • adr/architecture.md Ch.2 — remove the ADR 015 entry from the discovery
    chapter (lines ~68, 71, 157).
  • adr/appendix-observability.md — drop the three decdn_quic_0rtt_* counter
    rows (lines ~146-148), the metric-name mapping rows (~321-323), and the
    outcome={0rtt_warm,1rtt_cold} label on
    decdn_probe_collection_latency_seconds (line ~100).
  • ADR 037 refers to cdn/probe/v1 heavily but never to 0-RTT; no edit needed.

Rust (~24 files mention it; the load-bearing removals are few)

  • crates/client-pull/src/probe.rs — remove the into_0rtt() branch, the
    enable_0rtt param, LINGER_MIN/MAX linger, and the ProbeMetrics
    0-RTT hooks; collapse to a plain connect().await.
  • crates/client-pull/src/endpoint.rs:115-117 — drop .max_tls_tickets(...).
  • crates/node/src/handlers/probe.rs — remove the enable_0rtt field and the
    on_accepting override (lines ~151-157, ~510-562); revert to default accept.
  • crates/node/src/probe_client.rs — remove the mirrored 0-RTT metric adapter.
  • crates/node/src/metrics.rs — delete the three counters, the gauge, the
    session_ticket_peers set + note_session_ticket_peer, the
    SESSION_TICKET_CACHE_CEILING const, and the recorder macros (~152-183,
    ~1347-1610, ~2367-2374).
  • crates/protocol/src/lib.rs:55-58 — delete SESSION_TICKET_CACHE_SIZE.
  • crates/node/src/runtime/mod.rs + runtime/reload.rs — unthread
    enable_0rtt from handler wiring and the reload warn-list.
  • crates/node/src/handlers/client/mod.rs:1155 — an incidental comment
    documenting "never into_0rtt()"; simplify.

Config keys

  • crates/common/src/config/types.rs:84 (pub enable_0rtt: Option<bool>),
    resolved.rs:43, and mod.rs (DEFAULT_ENABLE_0RTT, resolver at ~674-683)
    — remove the key. Many mod.rs test fixtures set enable_0rtt: None and drop
    out for free.
  • crates/cli/src/commands/config.rs:89-90 (display line) and :424
    (config-template comment) — remove.

Metrics — the five signals listed in Summary. Label-free, so no dashboards
depend on cardinality.

Tests

  • Delete crates/node/tests/probe_0rtt.rs (664 lines — the single biggest
    chunk of removed code, incl. the rejected-fallback and session-ticket-gauge
    coverage).
  • Prune 0-RTT assertions from crates/node/src/metrics.rs unit tests
    (~2970-3000, 3749-3791) and enable_0rtt: None fixtures in
    crates/cli/tests/config_validate.rs and the node reload/bringup tests.

Rough magnitude: ~1 ADR + 3 doc edits, ~10 Rust files with real logic changes,
~1 config key, ~5 metrics, ~700+ test lines deleted. No migration for operators
(the key defaulted true; behavior after removal equals enable_0rtt = false,
already a supported state).

What we keep

  • cdn/probe/v1 itself — probing is unchanged, always 1-RTT. Node-to-node
    probing stays load-bearing (ADR 037 §"Probe roles"); the client RTT map and
    background latency sweep still run.
  • iroh's built-in TLS session resumption for 1-RTT connections (session
    tickets still let quinn skip a full handshake's crypto work; we simply stop
    sending application bytes as early data). We lose the zero-round-trip, not
    connection reuse.
  • QUIC stream multiplexing on already-open connections (ADR 005) — the primary
    reason steady-state probes are already cheap.

Counter-argument

The strongest honest case for keeping it:

  • It optimizes the single most latency-sensitive path. A cache miss must
    collect probes inside a ~500ms window (ADR 001), and at inter-continental RTT
    (250-300ms) the handshake alone can eat half of it (ADR 015 §Context). One
    saved RTT there is not cosmetic — it can be the difference between a nearby
    peer answering inside the window or not. This win exists at every scale and,
    in aggregate, grows with the network: more nodes and more misses mean more
    warm probe reconnections, each still saving its RTT. That is the opposite of a
    scale-deferral candidate, and it is the reason this proposal is marginal,
    not clear-cut. [your call] whether a non-compounding but hot-path,
    ever-present latency win outweighs a documented-but-thin security footgun.

  • The "beneficiary path is shrinking" claim is only half true. ADR 037 makes
    per-request client probing optional, but it keeps node-to-node probing
    load-bearing and adds an always-on background latency sweep that issues
    cdn/probe/v1 requests to peer-table entries, "breadth first then refresh"
    (ADR 037 §"Client RTT map"). The refresh half of that sweep is exactly the
    warm-reconnection pattern 0-RTT accelerates. So the beneficiary workload is
    shifting, not vanishing — Motivation ADR 002: Specify BLAKE3→keccak256 Merkle proof scheme for on-chain slashing #4 overstates its own case and should not
    be leaned on.

  • The complexity is genuinely modest and already paid. ADR 015
    §Consequences argues iroh's into_0rtt()/Accepting::into_0rtt() carry the
    transport details; the marginal code is the client attempt/fallback, one
    on_accepting override, a sizing call, and metrics. It is built, tested, and
    merged. "Cheap to cut now" (Motivation ADR 001: Specify on-chain node registry contract interface #5) cuts both ways: it is also cheap to
    leave, since the maintenance surface is small and stable.

  • Removing it does not eliminate the replayability footgun so much as relocate
    it.
    The "probe handlers must stay side-effect-free" discipline is good
    hygiene regardless; keeping 0-RTT off by default (enable_0rtt = false)
    rather than deleting the mechanism preserves the option to turn it on if the
    cold-miss probe loop lands and measures a real win. A soft-disable is a
    cheaper experiment-preserving middle path than deletion.

Open questions

  1. Is there any measured probe-latency data yet, or only the ADR's modeled
    250-300ms argument? Without the deferred
    decdn_probe_collection_latency_seconds histogram we have no evidence of the
    real warm-vs-cold split, so we cannot size the benefit we would forgo.
    [your call] on whether to instrument-then-decide rather than delete-now.
  2. If we keep the mechanism but flip DEFAULT_ENABLE_0RTT to false, does that
    capture most of the simplification (no early data emitted, replay footgun
    dormant) while retaining the option? That is strictly less code churn than
    removal and reversible.
  3. Does the node-to-node load-bearing probe path (ADR 037) reconnect to the same
    upstreams often enough that 0-RTT would meaningfully help it specifically?
    This is the one beneficiary that scale does not shrink; it deserves a
    direct answer before deletion.
  4. If 0-RTT is removed and the cold-miss DHT→probe loop later lands wanting it
    back, is the re-introduction cost (client path + one override + metrics)
    acceptable, or do we lose the vetted replay-safety analysis that took ADR 015
    its full length to establish?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions