Skip to content

Clarify authorized-origin gate scope: namespace-wide vs per-operator #1368

Closed

Description

@yigitdot

Found while reviewing #1366 (G-NODE-08).

pull_origin_gate_blocks (crates/node/src/handlers/client/mod.rs:293) is:

gate.is_some_and(|dir| !dir.has_origin(hash))

which resolves through DirectoryCache::has_any (crates/node/src/dht/chain_origin_directory.rs:199). That asks whether any active operator authorizes the hash's namespace — the operator running the node is never compared against the assignment.

Consequence: a node whose [cache.origin] happens to hold H will fill and serve it opaquely as soon as H's namespace has any active authorized origin, even if the DAO assigned that namespace exclusively to a different operator. The gate is a namespace-level 'is this content claimed by someone' check, not an operator-level 'am I the origin for this' check.

ADR 037 §85 phrases it as namespace-scoped ("a hash whose namespace has no currently-authorized origin"), so this may well be deliberate. But the naming throughout (pull_through_require_authorized_origin, is_authorized_origin, "recognized origin") reads as the stronger per-operator guarantee, which is how #1366's journey originally described it.

Ask: confirm the intended scope.

  • If namespace-wide is intended, it's worth a sentence in ADR 037 saying explicitly that a non-assigned operator holding the bytes may still serve them, since that is the surprising half.
  • If per-operator was intended, the gate needs the operator comparison and has_any is too weak.

Either way an executable assertion would pin it: a second operator, a hash assigned only to that operator, and an assertion about whether this node serves it. #1366 deliberately does not encode either reading pending this decision — see the note on NodeFixture::launch_authorized_origin.

Activity

  1. added
    design:adr
    design:missing-decision
    rust
    prio:medium
    on Jul 22, 2026
  2. self-assigned this
    on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

design:adrdesign:missing-decisionprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions