Repository navigation
Description
Summary
Prefetch (speculative acquisition) has an opt-in operator gate, prefetch.require_authorized_origin, that restricts acquisition to hashes whose namespace has a currently-authorized on-chain origin. The reactive cache-miss pull-through path has no equivalent gate — it is permissionless by design, serving and warm-caching any hash a paying client requests regardless of whether the content has any authorized origin. Some operators may not want to relay or cache unclaimed content (no namespace / no authorized origin) for policy or legal reasons, and today they have no knob for it.
Evidence in the ADRs
-
ADR 022 § Recommended configuration —
prefetch.require_authorized_origin(defaulttrue): prefetch fires only if the FIND_VALUE candidate set contains at least one operator currently authorized as origin viaOriginAssignment.getOrigins(namespaceId)(withnamespaceId == 0resolving to the default-open allow-list). -
ADR 022 § Scope and limits explicitly carves the reactive path out of that gate:
"The cache role remains permissionless: any bonded operator may serve any hash they have, and the cache-miss pull-through path used to fulfill an in-flight
cdn/client/v1StreamRequestfrom a paying customer is unaffected by these knobs."and notes truly-unclaimed hashes "get no prefetch ever" but can still be pulled-through/served reactively (operators can only opt in to caching them via explicit pinning — there is no symmetric way to opt out of pull-through for them).
-
ADR 037 § Node serving: window-paced pull-through + § Seed-leech caps govern the reactive path with
pull_ahead_bytes,max_unrecouped_leech_bytes, andshare_ratio. These bound economic exposure (unrecouped bytes), not content authorization. ADR 037 line 72 says therequire_authorized_origingate "compose[s] with these caps where an operator wants the additional restriction," which is in mild tension with ADR 022's flat statement that pull-through is "unaffected by these knobs" — the composition is asserted but not actually specified for the reactive path.
The gap
The seed-leech caps answer "how much speculative loss will I absorb?" They do not answer "do I want to be a relay/cache for content that has no DAO-ratified origin at all?" An operator who wants to serve only authorized-origin content (or refuse unclaimed namespaces) can set that posture for prefetch but not for the request-driven pull-through path that actually does the bulk of warming. ContentBlacklist (ADR 011/031) is a reactive denylist of specific objectionable hashes — not a proactive allow-list posture, and it requires governance to enumerate bad hashes rather than letting an operator default-deny unclaimed content.
Proposed direction (for discussion)
Add an optional operator-policy gate on the reactive pull-through path, mirroring the prefetch gate but default-permissive to preserve current behavior — e.g. pull_through.require_authorized_origin (default false). When enabled, the node refuses to initiate an upstream pull and the associated cache-warming write for a hash whose namespace has no currently-authorized origin via OriginAssignment.getOrigins(namespaceId) (same registry-cache + fail-closed-on-RPC-unavailable pattern the prefetch gate uses), returning NotFound to the requesting client. This reuses existing machinery and is purely additive.
Open design questions
- Default value. Prefetch's gate defaults
true; the reactive path is intentionally permissionless. A pull-through gate almost certainly defaultsfalseto avoid changing network behavior — confirm. - Already-held ranges. The seed-leech caps "never refuse to serve a range already held." For a content-policy gate an operator might want to refuse even held ranges. Is this a pull-initiation gate only, or also a serve gate? (The latter overlaps
ContentBlacklistsemantics.) - Reconcile the ADRs. ADR 022 § Scope and limits ("unaffected by these knobs") vs. ADR 037 line 72 ("compose ... where an operator wants the additional restriction") should be made consistent once this is decided — likely a small ADR 022/037 amendment rather than a new ADR.
namespaceId == 0/ default-open. Decide whether default-open allow-list hashes count as "authorized" for the reactive gate the same way they do for prefetch.
Scope
Primarily an ADR/design decision (touches ADR 022 § Scope and limits and ADR 037 § Seed-leech caps / Cross-ADR Impact). The cdn/client/v1 pull-through handler that this gate would hook into does not exist yet (its bring-up is tracked separately per ADR 037 § Cross-ADR Impact → ADR 005), so this can be resolved as a design clause before that handler lands.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
github-actions commentedon Jun 5, 2026
🎯 Triage report
This issue identifies a policy-gate asymmetry: prefetch has an opt-in
require_authorized_originguard, but the reactive cache-miss pull-through path is intentionally permissionless with no equivalent knob. The reporter proposes addingpull_through.require_authorized_origin(defaultfalse) to mirror the prefetch gate while preserving current network behavior. The issue also surfaces a concrete ADR inconsistency — ADR 022 says pull-through is "unaffected by these knobs" while ADR 037 line 72 asserts they "compose" — that must be resolved before thecdn/client/v1handler is implemented.📊 Assessment
consistency,adr-review,missing-decision(+ existingtechnical)namespaceId == 0treatment) require team consensus before any implementation can start. The target handler (cdn/client/v1) also does not exist yet.🔗 Similar issues
OriginAssignmentregistry-cache used by the prefetch gate; the live subscription work done there is directly reusable for any pull-through gateprefetch.require_authorized_origingate whose absence on the reactive path is the core of this issue💡 Notes and suggestions
Design questions that need team sign-off before implementation:
Default value — Almost certainly
falseto preserve the intentionally-permissive cache role. Confirm explicitly in the ADR amendment so downstream implementers don't have to guess.Scope of the gate: pull-initiation only vs. serve gate — The seed-leech caps "never refuse to serve a range already held." A content-policy gate for already-held blobs would overlap
ContentBlacklistsemantics (ADR 011/031). Recommend deciding upfront and documenting: likely this is a pull-initiation gate only (matching the prefetch gate's behavior), withContentBlacklistremaining the mechanism for refusing held blobs.ADR reconciliation — ADR 022 § Scope and limits says pull-through is "unaffected by these knobs"; ADR 037 line 72 says they "compose ... where an operator wants the additional restriction." These can't both be fully right. The resolution is likely a targeted amendment to ADR 022 § Scope and limits to allow for an opt-in gate (not remove the permissionless default, just add the knob). A new ADR is probably not warranted — a small amendment to both 022 and 037 should be sufficient.
namespaceId == 0/ default-open allow-list — Decide whether hashes in the default-open namespace count as "authorized" for the reactive gate the same way they do for prefetch. This is the same decision already made for prefetch, so consistency strongly favors reusing that logic unchanged.Implementation sketch (once design is settled):
pull_through.require_authorized_origin: bool(defaultfalse) to the node config schema incrates/commoncdn/client/v1pull-through handler (tracks with ADR 005 bring-up)OriginDirectorytrait + registry-cache (already wired for prefetch via DHT prefetch: live FindValue→probe→pull-through acquisition + OriginAssignment subscription (AC 7 of #650) #820)NotFoundto the requesting client when the gate rejects a pulldecdn_pull_through_rejected_unauthorized_totalor similar)Pre-conditions:
cdn/client/v1pull-through handler exists (tracked per ADR 037 → ADR 005)OriginAssignmentsubscription from DHT prefetch: live FindValue→probe→pull-through acquisition + OriginAssignment subscription (AC 7 of #650) #820 mergedAdd this agentic workflows to your repo
To install this agentic workflow, run
Merge origin/main into claude/heuristic-volhard-c7ef1e
docs(config): note pull-through gate is a no-op without node-to-node …
feat(node): gate reactive pull-through on authorized origin (#821) (#917