Skip to content

docs(adr): add DAO-governed origin assignment authority - #390

Merged
alpergundogdu merged 15 commits into
mainfrom
docs/issue-189-origin-assignment
May 5, 2026
Merged

alpergundogdu merged 15 commits into
mainfrom
docs/issue-189-origin-assignment

Conversation

@thiras

@thiras thiras commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #189 by adding a DAO authority for origin server assignment, distributed across 9 existing draft ADRs (no new ADR per the planning decision).

  • Introduces a publisher/namespace identity primitive (ADR 002) and an OriginAssignment contract (ADR 011) for DAO-governed positive authority over which operators may act as origins for which content.
  • Strict-gating model: origin role requires DAO authorization for content in registered namespaces. Cache role remains permissionless. The default-open namespace (namespaceId == 0) preserves long-tail / permissionless serving for unregistered content.
  • Lifecycle: publisher proposes operator set → DAO ratifies via standard timelock → activated. Blacklisting an operator atomically removes them from every namespace's authorized set via cross-contract removeAllAssignments.
  • Runtime: ProbeResponse extended with an is_origin field; signing is_origin: true without authorization is a phantom-origin slashing offense (ADR 005).
  • Governance bounds: new safety bounds for min-redundancy floor, assignment timelock, namespace caps, and transfer timelock (ADR 009).

Test plan

  • pre-commit run --all-files passes (markdownlint, cargo fmt, cargo clippy, cargo deny)
  • All new anchors resolve and cross-references between the 9 edited ADRs use the standard adr/NNN-name.md#anchor convention
  • Reviewer audit: every question in issue docs: evaluate DAO as authority for origin server assignment #189's "Questions to answer" section has substantive treatment somewhere in the edited ADR set — 7/7 covered (Q1 problem framing in ADR 011 §"Why positive authority is part of governance"; Q2 scope in ADR 011 §"Origin Assignment Authority" + ADR 002 §"Publisher Identity and Namespaces"; Q3 ContentBlacklist interaction in ADR 011 §"Interaction with ContentBlacklist"; Q4 multi-origin redundancy in ADR 003 §"Content withholding" + ADR 011 §"Minimum-redundancy invariant"; Q5 namespace-level on-chain cost in ADR 011 contract interface + ADR 002 §"Default-open namespace"; Q6 ADR 016 changes throughout that file; Q7 permissionless property explicitly amended in ADR 001 §Consequences + ADR 011 §"Permissionless property")
  • Reviewer audit: design is reconstructable from any starting ADR (002, 005, 011, or 016) via in-document links — gaps closed in commit 03352fd (ADR 011 §"ADRs Affected" entries 001/002/003/005/009/016/022 now follow the same [ADR NNN](NNN-name.md) convention as the existing ADR 026 entry; ADR 002 §"Why this lives in ADR 002" now anchor-links the four downstream ADRs it names)

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 2, 2026 07:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ADR set to specify a DAO-governed “positive authority” mechanism for origin assignment, introducing publisher/namespace identity and an OriginAssignment registry while preserving permissionless caching and a default-open namespace (namespaceId == 0).

Changes:

  • Adds publisher/namespace identity primitives (ADR 002) and defines DAO-ratified origin operator sets per namespace (ADR 011), with blacklist integration.
  • Extends the probe protocol to include a signed is_origin signal and ties it to slashing semantics (ADR 005), with supporting updates across discovery/payments/network ADRs.
  • Updates governance bounds and contract interaction docs to include new contracts, roles, and deployment wiring (ADR 009, ADR 016).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
adr/architecture.md Updates high-level architecture to reflect cache-permissionless vs DAO-gated origin role for registered namespaces.
adr/001-network.md Aligns network consequences with origin gating + minimum redundancy for registered namespaces.
adr/002-content-addressing.md Introduces publisher identity, namespaces, default-open namespace semantics, and PublisherRegistry interface.
adr/003-payments.md Reframes redundancy/withholding mitigation around DAO-supervised origin sets for registered namespaces.
adr/005-protocol.md Adds is_origin to ProbeResponse and defines authorization + phantom-origin slashing rules.
adr/009-governance.md Adds safety bounds for origin assignment and publisher/namespace governance parameters.
adr/011-content-takedown.md Adds origin assignment authority section and integrates origin blacklisting with assignment eviction.
adr/016-contract-interactions.md Adds PublisherRegistry/OriginAssignment to inventories, graphs, role matrix, and reentrancy tables.
adr/022-content-discovery.md Clarifies terminology and adds origin-only discovery flow via on-chain origin sets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adr/022-content-discovery.md Resolved
Comment thread adr/009-governance.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
Comment thread adr/005-protocol.md Resolved
Comment thread adr/005-protocol.md Resolved
Comment thread adr/011-content-takedown.md Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a framework for publisher identity and origin assignment authority, defining the PublisherRegistry and OriginAssignment contracts to manage namespaces and authorized origin operators. The changes integrate these primitives into the network topology, protocol probes, governance parameters, and slashing mechanisms, establishing a DAO-governed model for content origins. Feedback identifies several technical issues, including the lack of historical state lookups in the OriginAssignment interface required for slashing verification, potential gas limit exhaustion in bulk assignment removals, and the need for uniqueness validation in operator sets to prevent bypassing redundancy invariants. Additionally, a correction to the documented contract deployment sequence is required to resolve circular dependencies.

Comment thread adr/005-protocol.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
thiras added a commit that referenced this pull request May 2, 2026
- Phantom-origin slashing: add namespaceOfAt and isAuthorizedOriginAt
  historical views with checkpoint storage; SlashJudge evaluates against
  on-chain state at the response timestamp, not current state. Bounded
  by Max evidence age (ADR 009).
- Replace cross-contract removeAllAssignments (unbounded gas) with
  runtime-check pattern: blacklisted operators are treated as
  unauthorized at probe / peer-table / slashing time regardless of
  stale OriginAssignment state. Permissionless pruneBlacklistedAssignment
  for lazy storage cleanup.
- Reorder ADR 016 deployment: PublisherRegistry → OriginAssignment →
  ContentBlacklist (resolves circular dependency on construction).
- Origin-only discovery in ADR 022: DHT remains primary; on-chain
  OriginAssignment.getOrigins is fallback with operator → NodeId
  mapping via StakingRegistry.getActiveNodes.
- Add operator-uniqueness validation to proposeAssignment (prevents
  bypassing minRedundancy via duplicates).
- Add cross-parameter invariant 1 ≤ minRedundancy ≤ maxOriginsPerNamespace
  to ADR 009.
- Add StakingRegistry.isActive to ADR 016 proposeAssignment guards
  (table now matches the prose and ADR 011).
- Update ADR 011 ADRs Affected re: ADR 022 — DHT STORE remains
  permissionless; origin authorization enforced at probe time.
- Update ADR 013 v1 baseline to include is_origin in ProbeResponse
  signed-fields table.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@thiras
thiras requested a review from Copilot May 2, 2026 08:59
@thiras

thiras commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
Comment thread adr/009-governance.md Resolved
Comment thread adr/003-payments.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/011-content-takedown.md Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive governance framework for content origins, establishing publisher identities and namespaces to link content hashes to responsible parties. It adds the PublisherRegistry and OriginAssignment contracts, enabling DAO-supervised origin sets with protocol-enforced redundancy floors and a new 'phantom-origin' slashing mechanism. The protocol is updated to include an is_origin flag in probe responses, and discovery mechanisms now include on-chain fallbacks for finding authorized origins. Feedback focuses on completing the contract interfaces by adding missing governable setters and garbage collection functions, resolving signature discrepancies in documentation tables, and ensuring the ContentBlacklist supports historical lookups necessary for the proposed slashing logic.

Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
thiras added a commit that referenced this pull request May 2, 2026
Resolves Copilot inline comments on commit 52119cc:

- ADR 011 §Decision and §Lifecycle, ADR 011 Consequences: replace
  "atomically removes" / "atomically evicted" / "no stale entries"
  language with the actual model (runtime check is the security primitive;
  storage cleanup via pruneBlacklistedAssignment is lazy and permissionless).
- ADR 011 §Hash Evasion: fix pruneBlacklistedAssignments → singular
  pruneBlacklistedAssignment to match the interface.
- ADR 011 IOriginAssignment + ADR 016 GOVERNANCE_ROLE row + reentrancy
  table: add the missing setMaxOriginsPerNamespace setter (ADR 009 already
  documents the parameter as governable).
- ADR 003 §Withholding mitigations: scope the "any staked operator may
  serve" line to the default-open bootstrap window; post-activation,
  withholding mitigation is the allow-list's redundancy floor.
- ADR 016 deployment dependency graph: drop stale CB → OA edge
  (ContentBlacklist no longer cross-calls OriginAssignment).
- ADR 016 OriginAssignment construction notes: pruneBlacklistedAssignment
  reverts (not no-op) until the ContentBlacklist address is bound,
  matching the post-deploy initialization section.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@thiras
thiras marked this pull request as draft May 2, 2026 09:32
@alpergundogdu

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a formal on-chain governance framework for origin node assignments, establishing PublisherRegistry and OriginAssignment contracts to manage content namespaces and authorized operator sets. The origin role becomes DAO-governed for both registered namespaces and default-open content, while the cache-only role remains permissionless. Key protocol updates include an is_origin flag in probe responses and the implementation of phantom-origin slashing to enforce authorization. Feedback focused on improving the readability of the ADR documentation by simplifying complex sentence structures in several files.

Comment thread adr/001-network.md Resolved
Comment thread adr/003-payments.md Resolved
Comment thread adr/011-content-takedown.md Resolved
@alpergundogdu

Copy link
Copy Markdown
Contributor

Design issue surfaced during reconstructability audit: single-claim creates stranded-hash + squatting.

Two failure modes the PR doesn't address with (namespaceId, blake3Hash) first-write-wins:

  1. Stranded hash. Namespace owner loses keys / disappears / goes hostile → no escape valve. revokeAssignment / proposeAssignment / namespace transfer all require the current owner. adr/002-content-addressing.md:43 forward-references "ADR 016 for the dispute resolution rules and the consequences if a second claim is rejected" — but adr/016-contract-interactions.md:584 just says revert(). No recovery path.
  2. Squatting. Anyone can grab popular hashes (e.g., ubuntu-24.04.iso's BLAKE3) before the real publisher does. No anti-squatting mechanism.

Proposed fix: multi-claim, no coordination required. Drop the one-claim rule; let any namespace independently claim any hash. Mechanical changes:

  • namespaceOf(hash) returns uint256[] (set of claiming namespaces, time-ordered).
  • claimContent only reverts on duplicate by the same namespace; other namespaces' prior claims do not block.
  • SlashJudge's phantom-origin predicate becomes an OR-search over the claiming-namespace set at the response timestamp — bounded by K, typically ≤ 3 for popular content, 0–1 for long-tail.
  • ProbeResponse schema unchanged — the signer asserts authorization as a property of the world (is_origin: true for this hash at this time); the protocol verifies that property holds against any one claiming authority. No claimed_namespace field needed.
  • ContentBlacklist, OriginAssignment.proposeAssignment, min-redundancy floor, default-open allow-list: all unchanged. Blacklisting is hash-keyed; per-namespace operator sets and redundancy invariants are namespace-keyed; neither is namespace-uniqueness-keyed.

What it loses: the framing of a claim as "official publisher of this content." That framing was never load-bearing — slashing, takedown, and probe verification are hash-keyed and operator-keyed, never publisher-keyed.

What it gains:

  • Squatting becomes pointless: claiming a hash you don't intend to serve gates nothing.
  • Stranded-hash recovers automatically: another publisher just claims independently and starts serving.
  • Design matches reality: Microsoft, Cloudflare, GitHub Releases, and mirrors all legitimately serve the same bytes; the protocol shouldn't pretend one of them is "the" author.
  • Per-namespace effective redundancy floors sum network-wide — strictly better availability than today.

Diff scope: ADR 002 (claim semantics + interface views), ADR 011 § Historical state and slashing evidence (OR-search predicate), ADR 016 § PublisherRegistry table (drop first-write-wins guard). ADR 005, ADR 003, ADR 009, default-open allow-list, and OriginAssignment semantics are untouched.

Amending now.

@alpergundogdu

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive framework for publisher identity and origin assignment authority across the network. It defines namespaces, content claims, and the PublisherRegistry and OriginAssignment contracts to manage authorized origin sets with protocol-enforced redundancy invariants. The ProbeResponse protocol is updated to include an is_origin flag, supported by a new phantom-origin slashing mechanism. Feedback addresses the need for interface consistency in IOriginAssignment, correction of a type mismatch in pseudo-code logic, and clarification of checkpoint pruning rules to ensure security. Suggestions were also provided to align contract interaction tables with multi-claim semantics and simplify function signatures in the role matrix.

Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/005-protocol.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
@alpergundogdu

Copy link
Copy Markdown
Contributor

Filed #399 capturing the is_origin removal as a follow-up — the field doesn't earn its weight at protocol level (phantom-origin slashing is self-justifying; routing/payment/takedown/min-redundancy all work without it). This PR lands as-is; the unwind happens separately. Registration, namespace lifecycle, OriginAssignment.proposeAssignment / activateAssignment / getOrigins, default-open allow-list, and min-redundancy invariants all stay — only the historical-state SlashJudge views (namespaceOfAt, isAuthorizedOriginAt) and checkpoint pruning machinery go.

@alpergundogdu

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request establishes a decentralized framework for publisher identity and origin assignment authority, introducing the PublisherRegistry and OriginAssignment contracts to manage content namespaces and DAO-authorized origin sets. The changes formalize the distinction between permissionless cache roles and governed origin roles while establishing redundancy floors for content availability. Feedback focuses on enhancing documentation clarity by simplifying verbose descriptions of storage cleanup and optimizing the layout of the contract inventory table for better readability.

Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
@thiras
thiras marked this pull request as ready for review May 5, 2026 12:32
@alpergundogdu

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a formal system for publisher identity and origin assignment by adding the PublisherRegistry and OriginAssignment contracts. These changes establish a DAO-governed framework for authorizing origin operators, implementing redundancy floors, and managing content namespaces. Review feedback highlights a potential 'claim-censor' vulnerability in the default-open logic and suggests improving gas efficiency through batch content claims. Additionally, suggestions were made to streamline the DAO ratification process for high-churn assignments, restrict namespace transfer finalization to the new owner, and ensure operator status is re-verified during activation.

Comment thread adr/002-content-addressing.md Resolved
Comment thread adr/002-content-addressing.md Resolved
Comment thread adr/002-content-addressing.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/011-content-takedown.md Resolved
Comment thread adr/016-contract-interactions.md Resolved
thiras and others added 6 commits May 5, 2026 14:43
Resolves #189. Distributes the design across 9 existing draft ADRs (no
new ADR) per planning direction:

- ADR 002: publisher/namespace identity primitive + IPublisherRegistry
- ADR 011: Origin Assignment Authority section + IOriginAssignment;
  DAO ratifies publisher-proposed operator sets via the standard
  timelock path
- ADR 005: ProbeResponse extended with is_origin field; phantom-origin
  slashing for false origin claims in registered namespaces
- ADR 016: PublisherRegistry and OriginAssignment added to inventory,
  deployment order, call graph, role matrix, and reentrancy analysis
- ADR 009: new governable parameters with safety bounds
  (min-redundancy, assignment timelock, namespace caps, transfer
  timelock) and rationale
- ADR 022: resolves "publisher" terminology collision; documents
  origin-only discovery via OriginAssignment.getOrigins
- ADR 001: rewrites the unconditional permissionless-origin claim;
  cache role permissionless, origin role DAO-gated for registered
  namespaces
- ADR 003: rewrites multi-origin redundancy as DAO-supervised via the
  OriginAssignment min-redundancy invariant
- architecture.md: high-level overview reflects the role split

The default-open namespace (namespaceId == 0) preserves the
permissionless / long-tail story for unregistered content.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- Phantom-origin slashing: add namespaceOfAt and isAuthorizedOriginAt
  historical views with checkpoint storage; SlashJudge evaluates against
  on-chain state at the response timestamp, not current state. Bounded
  by Max evidence age (ADR 009).
- Replace cross-contract removeAllAssignments (unbounded gas) with
  runtime-check pattern: blacklisted operators are treated as
  unauthorized at probe / peer-table / slashing time regardless of
  stale OriginAssignment state. Permissionless pruneBlacklistedAssignment
  for lazy storage cleanup.
- Reorder ADR 016 deployment: PublisherRegistry → OriginAssignment →
  ContentBlacklist (resolves circular dependency on construction).
- Origin-only discovery in ADR 022: DHT remains primary; on-chain
  OriginAssignment.getOrigins is fallback with operator → NodeId
  mapping via StakingRegistry.getActiveNodes.
- Add operator-uniqueness validation to proposeAssignment (prevents
  bypassing minRedundancy via duplicates).
- Add cross-parameter invariant 1 ≤ minRedundancy ≤ maxOriginsPerNamespace
  to ADR 009.
- Add StakingRegistry.isActive to ADR 016 proposeAssignment guards
  (table now matches the prose and ADR 011).
- Update ADR 011 ADRs Affected re: ADR 022 — DHT STORE remains
  permissionless; origin authorization enforced at probe time.
- Update ADR 013 v1 baseline to include is_origin in ProbeResponse
  signed-fields table.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The default-open namespace was carved out of OriginAssignment as a
permissionless escape hatch for unclaimed content, leaving phantom-origin
claims for default-open hashes non-slashable, no DAO-accountable party
for takedown, and no redundancy floor for long-tail availability.

Extends OriginAssignment with a single global DAO-maintained allow-list
keyed by namespaceId == 0, reusing the existing per-namespace storage and
checkpoint history. Lifecycle is single-step governance under the
standard 48h Governor timelock — no propose/ratify split, no second
timelock parameter. Bootstrap rule: permissive (any active staker
authorized) until the first non-empty activation flips
defaultOpenAllowlistActive permanently and emits
DefaultOpenAllowlistActivated. New parameters defaultOpenMinRedundancy
(5–500, default 10) and defaultOpenMaxOrigins (20–500, default 100) with
cross-parameter invariants enforced at the contract layer. Probe-time
and slashing rules collapse to a uniform branch — no namespaceId == 0
special case downstream; isAuthorizedOriginAt(0, op, t) returns true for
t < defaultOpenActivatedAt so pre-activation probes are not retroactively
slashable.

Updates ADRs 001, 002, 005, 009, 011, 016, 022, architecture.md, and the
PoC/production seams appendix to remove the carve-out language and point
at the new ADR 011 §Default-open allow-list.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Resolves Copilot inline comments on commit 52119cc:

- ADR 011 §Decision and §Lifecycle, ADR 011 Consequences: replace
  "atomically removes" / "atomically evicted" / "no stale entries"
  language with the actual model (runtime check is the security primitive;
  storage cleanup via pruneBlacklistedAssignment is lazy and permissionless).
- ADR 011 §Hash Evasion: fix pruneBlacklistedAssignments → singular
  pruneBlacklistedAssignment to match the interface.
- ADR 011 IOriginAssignment + ADR 016 GOVERNANCE_ROLE row + reentrancy
  table: add the missing setMaxOriginsPerNamespace setter (ADR 009 already
  documents the parameter as governable).
- ADR 003 §Withholding mitigations: scope the "any staked operator may
  serve" line to the default-open bootstrap window; post-activation,
  withholding mitigation is the allow-list's redundancy floor.
- ADR 016 deployment dependency graph: drop stale CB → OA edge
  (ContentBlacklist no longer cross-calls OriginAssignment).
- ADR 016 OriginAssignment construction notes: pruneBlacklistedAssignment
  reverts (not no-op) until the ContentBlacklist address is bound,
  matching the post-deploy initialization section.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Three reviewer agents flagged the same redundancies after round 2:
- bootstrap rule restated 4× with subtle wording variations
- runtime-check + lazy-prune pattern explained in 4 places
- Solidity comment block re-stated the prose Lifecycle below it
- "Unassigned" subsection was nested under "Default-open allow-list"
- "Permissionless property" paragraph hedged twice over

Compress to a single canonical Bootstrap subsection; replace later
restatements with cross-references. Trim the setDefaultOpenAllowlist
interface comment to a one-line pointer. Promote the unassigned-namespaces
paragraph to its own §Unassigned namespaces section. Tighten the Decision
bullet, Lifecycle step 4, the Permissionless property paragraph, and the
Consequences bullet to point at §Interaction with ContentBlacklist and
§Default-open allow-list rather than re-explain.

No semantic change — same model, fewer words.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Closes the link-hygiene gaps surfaced by the issue #189 reconstructability
audit. Two starting ADRs (002 and 011) named other ADRs in plain text where
the convention elsewhere in the same files uses [ADR NNN](NNN-name.md):

- ADR 002 §"Why this lives in ADR 002": the four ADRs named as referrers
  (011, 016, 005, 022) are now anchored links, with 011 and 005 pointing
  at the specific subsections (#origin-assignment-authority and the
  cdn/probe/v1 anchor) that justify ADR 002's role.
- ADR 011 §"ADRs Affected": the seven plain-bold entries (001, 002, 003,
  005, 009, 016, 022) now match the format already used for the ADR 026
  entry in the same list. ADR 002 deep-links to
  #publisher-identity-and-namespaces; ADR 005 deep-links to
  #cdnprobev1--latency-probe (matching the existing intra-document
  reference at the §Interaction with ContentBlacklist bullet).

No semantic change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
alpergundogdu and others added 8 commits May 5, 2026 14:43
Three medium-priority readability comments from the post-link-fix Gemini
review. All address the same shape — a single sentence stacking two or
three clauses joined by em-dashes or semicolons — and split into shorter
sentences without changing technical content:

- ADR 001 §Consequences (positive #2): the origin-role description ran
  three concepts together (DAO-governance / registered vs default-open /
  bootstrap window). Now three sentences plus a See: line.
- ADR 003 §Withholding (minimum-redundancy bullet): replace the
  semicolon-joined "owners propose; governance ratifies" with two
  sentences.
- ADR 011 §Decision (positive-authority bullet): same propose/ratify
  pair, same split.

No semantic change. All anchor links preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous one-namespace-per-hash + first-write-wins rule created two
failure modes the PR did not address:

- Stranded hashes: a namespace owner who lost keys, abandoned, or refused
  cooperation stranded every hash they had claimed, with no escape valve
  for another publisher or the DAO. The lifecycle (revocation, transfer)
  all required the current owner.
- Squatting: any party could pre-claim popular hashes (e.g. a future
  release ISO's BLAKE3) and block the legitimate publisher.

ADR 002 forward-referenced "ADR 016 for the dispute resolution rules and
the consequences if a second claim is rejected"; ADR 016 only said
revert(). The cross-reference promised more than it delivered.

Drop the one-claim rule. Allow any non-zero namespace to claim any hash
independently; reverts only on duplicate by the same namespace
(idempotency). The set of operators authorized to serve the hash as
origin is the union across claiming namespaces, plus the default-open
allow-list when the claim set is empty.

Mechanical changes:

- ADR 002 § Default-open namespace + new § Multi-claim semantics:
  reframe claim from "authorial ownership" (never load-bearing) to
  "registration as a responsible origin authority". `namespaceOf` and
  `namespaceOfAt` return `uint256[]` instead of scalar; `claimContent`
  no longer reverts on cross-namespace duplicates. Storage becomes a
  per-hash append-only `(namespaceId, claimedAt)` array.
- ADR 011 § Historical state and slashing evidence: `SlashJudge`
  predicate becomes an OR-search over the claiming-namespace set at
  the response timestamp. The `ProbeResponse` schema is unchanged —
  the signer asserts authorization as a property of the world; the
  protocol verifies it holds against any one claiming authority. No
  `claimed_namespace` field added.
- ADR 016 § PublisherRegistry: drop "first-write-wins across non-zero
  namespaces" guard from `claimContent` row.

Untouched: ContentBlacklist (hash-keyed, namespace-agnostic),
OriginAssignment.proposeAssignment / activateAssignment / revokeAssignment
(per-namespace, agnostic to how many namespaces claim a given hash),
min-redundancy floor (per-namespace at activation; effective network-wide
redundancy is now the sum across claiming namespaces — strictly better),
default-open allow-list, ADR 005 ProbeResponse schema, ADR 003 § Content
withholding, ADR 009 governance parameters.

What we lose: the framing of an on-chain claim as "the official publisher
of this content." That framing was never load-bearing on any protocol
primitive — slashing, takedown, and probe verification are hash-keyed and
operator-keyed, never publisher-keyed.

What we gain:

- Squatting becomes pointless: claiming a hash you do not intend to serve
  gates nothing.
- Stranded hashes recover automatically: another publisher just claims
  independently and starts serving.
- Per-namespace effective redundancy floors sum network-wide.
- Design matches reality: Microsoft, Cloudflare, GitHub Releases, and
  mirrors all legitimately serve the same bytes with no need for the
  protocol to pretend one of them is the sole author.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Five medium-priority Gemini comments on the multi-claim flip — two were
direct fallout from the type change (`namespaceOf` now returns an array),
three were pre-existing nits worth fixing in the same pass.

- ADR 005 § cdn/probe/v1 (`is_origin` rules and SlashJudge clause): the
  pseudo-code calls `OriginAssignment.isAuthorizedOrigin(namespaceOf(hash),
  operator)` and `…isAuthorizedOriginAt(namespaceOfAt(hash, t), operator,
  t)` — both type-mismatch after the array return. Replaced with the
  ∃-quantifier over the claiming set, with default-open as the
  empty-set fallback. Pointed the SlashJudge clause at ADR 011 §
  Historical state and slashing evidence rather than restate the
  predicate inline.
- ADR 011 § Contract: OriginAssignment: added the missing
  `setContentBlacklist(address)` interface method. ADR 016 already
  references it as a post-deploy initialization step; the interface
  block was the orphan.
- ADR 011 § Historical state and slashing evidence (pruning paragraph):
  spell out the two invariants pruning must respect — never prune the
  currently-active checkpoint (`revokedAt == type(uint64).max`); always
  retain the most recent checkpoint whose `activatedAt` precedes the
  start of the current evidence window so binary-search lookups at the
  window's lower edge stay valid.
- ADR 016 § Off-Chain Read API: `namespaceOf` row updated to
  `returns (uint256[])` with a one-line pointer to ADR 002 § Multi-claim
  semantics.
- ADR 016 § Role matrix (Governor → OriginAssignment row):
  `activateAssignment` takes only `namespaceId` (operators come from the
  pending proposal); add the new `setContentBlacklist(address)` setter.

No semantic change beyond the pruning invariants (which were implied by
the threat model but not explicitly stated).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Folding the unwind described in #399 (closed) directly into this PR per
team direction — clean up at introduction time rather than land then
remove. Confirmed during this work that no Rust code or Solidity
contracts reference these symbols on main, so the change is ADR-only.

Origin status was being signaled in two redundant places: on the wire
via `ProbeResponse.is_origin`, and on chain via `OriginAssignment`. The
on-chain view is authoritative; the wire bit is just a cached
restatement. Phantom-origin slashing is the offense category that exists
to deter lying about that wire bit — i.e., it only exists *because*
is_origin exists. Remove the wire bit and the attack surface and the
slashing category disappear together.

What origin status was actually controlling at the protocol layer:

- Routing / discovery: handled by `OriginAssignment.getOrigins(ns)`,
  which clients and watchtowers query off-chain.
- Payment economics: same `rate_per_mb` for origins and caches; nothing
  to differentiate.
- Takedown compliance: `ContentBlacklist` is hash-keyed; serving a
  blacklisted hash is slashable for any node, origin or cache.
- Min-redundancy: enforced contract-side at activation; probe-time
  signaling is unrelated.
- BLAKE3 verification: bytes are bytes; clients verify the hash
  regardless of who served them.

So the wire bit was load-bearing on nothing except itself.

Mechanical changes:

- ADR 005 § cdn/probe/v1: drop `is_origin` from `ProbeResponse`, drop
  the `is_origin` rules paragraph, drop `is_origin` from the signature
  field set, drop the phantom-origin entry from the slashing-categories
  enumeration (now 2 categories: phantom-announcement, rate-manipulation).
- ADR 011 § Origin Assignment Authority: drop `isAuthorizedOriginAt`
  from `IOriginAssignment`. Drop § Historical state and slashing
  evidence in full — the OR-search predicate, checkpoint storage,
  pruning invariants, and re-authorization handling were all in service
  of phantom-origin SlashJudge; none has another consumer.
- ADR 011 § Interaction with ContentBlacklist: drop probe-time /
  requester-side / SlashJudge bullets. Replace with off-chain
  cross-reference pattern: callers of `getOrigins(ns)` filter against
  `ContentBlacklist.isOriginBlacklisted` themselves.
- ADR 011 lifecycle step 3 + Default-open intro + ADRs Affected (ADR 005):
  reframe to drop probe-time signaling.
- ADR 002 § Multi-claim semantics: drop SlashJudge OR-search reference;
  trim to the routing/discovery framing.
- ADR 002 IPublisherRegistry: drop `namespaceOfAt(hash, t)` historical
  view (only consumer was SlashJudge). Storage simplifies from
  per-hash append-only `(namespaceId, claimedAt)` array to per-hash
  `uint256[]` set; ordering / timestamps no longer load-bearing.
- ADR 002 "Why this lives in ADR 002": drop ADR 005 link (no probe-time
  enforcement to cross-reference).
- ADR 016 § Off-Chain Read API + § Reentrancy table + storage notes:
  drop `isAuthorizedOriginAt` rows; simplify storage to current-state
  `EnumerableSet` only (no checkpoint history, no GC pruning).
- ADR 013 § Signed-fields table: drop `is_origin` from `ProbeResponse`
  signed-field set (this matches the new ADR 005 baseline; the v1 ALPN
  is unchanged because the field never shipped on a deployed network).
- ADR 022 § Origin discovery + ADRs Affected (ADR 011): reframe — no
  probe-time `is_origin` validation; clients intersect probed peers
  against the off-chain `getOrigins(ns)` set.
- ADR architecture.md § Origin Integration: drop "advertise itself as
  origin" framing; origin status surfaces via `getOrigins(ns)` only.
- ADR appendix-poc-production-seams.md § Default-open allow-list row:
  drop "rejects is_origin: true claims (slashable phantom-origin)";
  reframe to "off-chain consumers consult getOrigins(0) to filter
  unauthorized origins".

What stays untouched: ContentBlacklist (hash-keyed, never cared about
origin status), OriginAssignment.proposeAssignment / activateAssignment
/ revokeAssignment (per-namespace, namespace-agnostic to claims),
min-redundancy invariant (per-namespace at activation), default-open
allow-list, governable parameters, all publisher and DAO workflows.
PublisherRegistry registration and namespace lifecycle are unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Two medium-priority comments on the is_origin unwind, both stylistic:

- ADR 011 § Hash Evasion (origin-blacklisting bullet): the blacklisted-
  origin runtime-removal description still listed "probes, peer-table
  validation, slashing evaluation" — a stale enumeration after the
  unwind (probe-time origin check no longer exists; phantom-origin
  slashing no longer exists). Trim to "Effectively removed at runtime;
  storage cleanup is lazy and permissionless via
  pruneBlacklistedAssignment", with the cross-reference to § Interaction
  with ContentBlacklist preserved.
- ADR 016 § Contract Inventory: row 10 (OriginAssignment) had a single
  table cell carrying constructor args + default-open bootstrap +
  governance entry points + ContentBlacklist binding rationale.
  Trimmed the cell to constructor args plus a one-line pointer; moved
  the bootstrap / governance / binding detail into a new
  § OriginAssignment construction notes subsection between the table
  and § Post-Deployment Initialization. Same content, restructured for
  table readability.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Two ADRs not previously touched by this PR were left inconsistent with
the new OriginAssignment surface introduced in ADR 011:

- ADR 012 § Eclipse Attack Mitigation: the rejection of "Option A —
  Origin-backed nodes as fallback" was framed as a flat refusal to
  expose origin status on-chain, which now reads as a contradiction
  with `OriginAssignment.getOrigins(ns)`. Reframe to reject origin
  status as a *trust* mechanism (still true) while acknowledging the
  new on-chain primitive as an *availability commitment* (publisher's
  min-redundancy commitment, not a node-quality ranking). The original
  design invariant — "no external origin URL is ever exposed" — is
  preserved: `OriginAssignment` records only operator Ethereum
  addresses, never backend URLs. Clients still verify content via
  BLAKE3 and score peers via reputation / probes regardless of
  authorized-origin status.
- ADR 019 § Phase 1 Step 6: the existing wording said "the protocol
  treats all staked nodes identically." Post-PR-390 false — recognised
  origin status for registered namespaces requires
  `OriginAssignment.proposeAssignment` (publisher) and DAO ratification
  via timelock; for default-open content it requires the DAO-maintained
  allow-list (subject to the bootstrap rule). Reword Step 6 to keep the
  cache-only-is-permissionless framing and add a paragraph spelling
  out the on-chain authorisation flow for operators who want origin
  status, with the explicit note that it runs on the publisher's /
  governance's timeline rather than the operator's onboarding flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Surfaced during a walkthrough of the on-chain "given a hash, find an
authorized origin NodeId" path. The operator-address → NodeId step was
the only one in the chain that required paginating getActiveNodes;
every other lookup (namespaceOf, getOrigins, isOriginBlacklisted) is
already O(1) per call. Adding a typed per-operator view collapses that
step to a single read.

Storage already exists — addressToNodeId is a public mapping populated
atomically inside registerNode (ADR 001 § Constraints, ADR 003 § NodeId-
to-Ethereum Binding) — so this is purely a typed-view addition that
also bundles the active flag to save a second read against
nodes[nodeId].active.

- adr/003-payments.md: declare nodeIdOf alongside the existing
  StakingRegistry storage block, with a comment pointing at the two
  consumers (ADR 016 read API, ADR 022 origin discovery).
- adr/016-contract-interactions.md: row added to § Off-Chain Read API
  table noting the per-operator binding+activity lookup as the
  canonical step in the on-chain origin-discovery fallback.
- adr/022-content-discovery.md: § Origin discovery fallback now points
  at nodeIdOf for per-operator NodeId resolution, replacing the bulk
  paginated getActiveNodes path. Notes that the chain of reads
  (namespaceOf → getOrigins → nodeIdOf → isOriginBlacklisted) is
  batchable via the standard Multicall3 aggregator on Arbitrum without
  prescribing the implementation, since batching is a client-library
  concern that does not affect protocol semantics.

Strict 1:1 binding (ADR 001 § Constraints line 340) means a single-
valued return is correct as-is; if the design ever loosens to N:1
(multiple NodeIds per stake — currently rejected), this view would
need to widen to bytes32[] memory and the OriginAssignment min-
redundancy story would need rework.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alpergundogdu
alpergundogdu force-pushed the docs/issue-189-origin-assignment branch from 2e250cb to 58c1bfa Compare May 5, 2026 13:44
@alpergundogdu

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive framework for publisher identity and origin assignment authority. It establishes the PublisherRegistry for managing namespaces and content claims, and the OriginAssignment contract for DAO-governed authorization of origin nodes. The changes distinguish between the permissionless cache role and the governance-gated origin role, implementing a minimum-redundancy invariant for content availability. Additionally, it defines a "default-open" namespace for unclaimed content with a permissive bootstrap window, updates discovery protocols to include on-chain fallbacks, and integrates these new primitives across existing ADRs for governance, payments, and network topology. I have no feedback to provide.

@alpergundogdu
alpergundogdu merged commit a3df13c into main May 5, 2026
9 checks passed
@alpergundogdu
alpergundogdu deleted the docs/issue-189-origin-assignment branch May 5, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: evaluate DAO as authority for origin server assignment

3 participants