Description
Summary
Reactive origin pull-through — including serving a blob from the node's OWN configured cache.origin (fs/http/s3) — is gated entirely behind cache.node_to_node_pull_through_enabled. A cache-only origin operator that does not want to participate in node→node (paid) pulls therefore cannot reactively serve its own origin at all: a cache miss for a blob present only in its local origin is refused as NotFound.
This surfaced while fixing #1115. That fix made the node→node window branch consult local origins first (via CacheEngine::populate_local, crates/node/src/handlers/client.rs:1115), but only within the window branch — which is still only wired when the node→node flag is on. The broader coupling was intentionally left as this follow-up.
Evidence (file/line)
crates/node/src/runtime/mod.rs:1086—if cfg.cache.node_to_node_pull_through_enabled {wraps both reactive attachments::1089client_handler.attach_pull_through(outer_deadline)(the bufferedpopulatepath), and:1103client_handler.attach_window_pull_through(..)(the window path).
crates/node/src/handlers/client.rs:700/:1157— the buffered serve-miss path only runs whenself.pull_through.get()isSome, i.e. only afterattach_pull_through.crates/node/src/handlers/client.rs:1102— the window path only runs whenself.pull_through_origin.get()isSome, i.e. only afterattach_window_pull_through.- Net: with
node_to_node_pull_through_enabled = false, theOk(false)(cache-miss) arm has no reactive origin path and falls straight toServeRejectReason::CacheMiss, even for a blob the operator holds in its own fs/http/s3 origin.
Why this matters
An origin operator's core function is to serve its own content. Coupling that to a node→node participation flag is surprising: an operator who sets [cache.origin] but leaves node→node off gets silent NotFounds for content it actually has. Local-origin reads front no external USDC (unlike a node→node pull), so the exposure rationale that motivates gating node→node does not apply to them (S3 egress cost is the one nuance — see below).
Proposed direction
Decouple reactive local-origin populate (CacheEngine::populate_local, non-Peer origins) from node_to_node_pull_through_enabled:
- Run
try_local_populateon the cache-miss path whenever the request ispull_authorized(proven channel ownership), independent of the node→node flag — the node→node window/buffered paths stay gated on the flag as today. - Keep the
pull_authorizedgate: an S3 origin has egress cost, so a reactive local pull should still require a funded, owned channel (the following delivery is paid per-voucher). This matches the existing gating on the buffered path. - Consider whether this wants its own opt-in (
cache.reactive_origin_pull_through, default-on when[cache.origin]is set) vs. being implicit — a small design decision worth recording.
Relates to #1115.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
fix(cli): send the ADR 005 client identity binding on decdn fetch (#1115
fix(node): address review — local-populate deadline + timeout race ch…
fix(node): address PR review — displaced doc/attr, timeout metering, …
feat(node): complete reactive origin pull-through — decouple local po…