Skip to content

router: add DialOptions.OnProgress hook for route-setup progress observability #4055

Description

@0pcom

Problem

pkg/router DialOptions exposes no per-hop / noise-handshake progress observer. A caller that dials a route can only see the terminal result (success / failure) — not the intermediate "found 2-hop path via X → establishing route group → noise handshake → up" progression.

This came up building the streaming proxy interstitial (#4054): the chunked-streamed interstitial can only show a coarse per-attempt progress line + reload-on-success, because the granular route-setup narrative is not observable. The stream infra fabricates nothing — it surfaces only the signals that exist. The mux telemetry harness likewise only synthesizes coarse RouteEstablished/failed events around its own DialRoutes.

Proposal

Add an optional OnProgress func(RouteSetupEvent) callback to DialOptions (and the route-group/DialRoutes path), emitting structured events as setup proceeds:

  • route(s) found — candidate paths, hop count, intermediary PKs
  • route-group establishment start / per-leg
  • noise handshake start / complete / deadline-exceeded (per leg)
  • rule installation
  • final up / failed (with reason)

Opt-in, nil-safe (no callback = today's behavior), no data-plane cost.

Consumers this unblocks

  1. Streaming interstitial (feat(interstitial): stream live route-setup progress via chunked encoding #4054) — the real "2-hop via X → handshake → up" play-by-play instead of per-attempt guesses.
  2. Route visualizer — live route-setup animation + failure surfacing.
  3. Per-proxy status pages (feat(proxy): per-proxy status hosts + HTTPS interstitial permit-gate #4050/feat(proxy-status): serve status over browse-origin real cert + AA contrast #4053) — the live "is-my-connection-up" liveness signal folded into the mux view.
  4. Route-drop diagnosis (Implement visor restart from hypervisor #80) — the same hook makes the intermittent noise-handshake-deadline directly observable at the dial site rather than only in scattered logs.

Notes

Separate from the interstitial/status work already merged; this is the missing router-side seam those features want. Keep it a pure observability addition — no behavior change when the callback is unset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions