Skip to content

Client: implement proxy-warming trigger #1174

Closed

Description

@alpergundogdu

Disposition: IMPLEMENT (ADR 037).

The node-side window-paced pull-through exists, but the client trigger that routes a miss through a nearby non-holder (RTT-threshold + margin, RTT-only ranking) is absent (crates/client-pull/src/discovery.rs:102, probe.rs), so the regional cold-start mechanism never engages.

Action: implement the client proxy-warming decision + routing per ADR 037.


Filed from the ADR→implementation gap analysis. ADR edits must be made in place with no historical/tombstone text (no "planned but cut" sentences) per repo ADR convention.

Activity

  1. added
    prio:high
    rust
    on Jul 15, 2026
  2. yigitdot commented on Jul 18, 2026

    @yigitdot
    Contributor

    Triage note for a later run: automated dispatch skipped this because ADR 037 explicitly defers the constants the trigger needs, and the subsystem it reads from does not exist.

    1. The ADR defers its own numbers. The parameter table at adr/037-regional-proxy-warming.md:101-105 lists proxy_warming.rtt_threshold_ms, margin_ms, and max_wait_ms as "operator/client-set" with no default, and rtt_map.staleness_secs as "client-set". Line :113 says outright: "Concrete defaults for the latency and budget parameters are modeled before locking." Only enabled = true is pinned — and a default-on feature with no default thresholds is incoherent, so an implementer must invent all four.

    What is pinned and needs no decision: the trigger predicate shape (:27), RTT-only ranking invariant to self-attested region (:132, :161), fallback ordering (:32), and the no-op-on-cold-start behavior (:42, :169).

    2. The prerequisite subsystem is missing. ADR 037:38-42 requires a per-peer RTT map (NodeId -> (rtt_estimate_us, last_sampled_us), EWMA-smoothed, LRU-bounded ~4096, staleness eviction) plus a bounded background latency sweep issuing sentinel-hash probes within the ADR 001 probe rate budget. None of it exists: crates/client-pull/src/probe.rs:162-174 computes a per-call rtt_ms and discards it, and the only ranking state is the in-request Probed vec at discovery.rs:130-160. There is also no client-side reputation-floor filter, which the candidate pool requires (:28), and the "reserved sentinel hash that nodes MUST NOT count toward demand" is a node-side protocol contract that doesn't exist either.

    So the narrow scope the issue describes ("RTT-threshold + margin, RTT-only ranking") is not implementable standalone — the trigger consults a map that isn't there.

    Size: ~120-180 non-test LOC for the trigger and routing if the RTT map is assumed; ~500-700 across client-pull, config-types, cli, and node with the map, sweep, and sentinel-hash contract included.

    Suggested split: (a) an ADR amendment locking the four constants; (b) a prerequisite issue for the per-peer RTT map + background latency sweep; (c) this issue, reduced to the trigger and routing, dispatchable once both land.

  3. self-assigned this
    on Jul 21, 2026
  4. removed their assignment
    on Jul 21, 2026
  5. thiras commented on Aug 1, 2026

    @thiras
    Contributor

    Audit note (2026-08-01, HEAD b2a9651): the trigger this issue asks for shipped in #1357 (ed9c624) — proxy_warming_order (crates/client-pull/src/discovery.rs:736), the RttMap, pinned CLI defaults (threshold 150 ms / margin 30 ms, crates/common/src/cli/fetch.rs:149-160), wired into decdn fetch (crates/cli/src/commands/fetch.rs:315-317). The triage blockers (no RTT map, unpinned constants) are lifted.

    What remains, per the in-code deferrals:

    • fallback uses only the first candidate — "a real fallback needs a second payment channel … deliberate follow-up work" (discovery.rs:730-734)
    • no max_wait_ms progress deadline
    • the feature is opt-in default-off, deliberately diverging from ADR 037's default-on (crates/common/src/cli/fetch.rs:139-140)

    Suggest either scoping this issue down to that residue or closing it in favor of a narrower one; as titled ("implement proxy-warming trigger") it reads unstarted when it is mostly done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

prio:highrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions