Skip to content

OriginAssignment: vetted-publisher instant origins (collapse assignment into publisher vetting) #1491

Closed

Description

@alpergundogdu

Supersedes and closes #1107 and #1113. Vet the publisher wallet once; after that it self-serves every origin instantly. Closes both the no-delta-add problem (#1107) and the too-heavy routine flow (#1113) with one primitive.

Core change

Only the wallet is vetted (not per-operator sets), so the cold path stops carrying an operator set. proposeAssignment(ns, operators) / activateAssignment are replaced by a pure publisher-vetting lifecycle; all origin seating flows through an instant addOrigin. Net: one and only one "origin seated" event (OriginAdded).

Trust model: governance alone decides who is a network-trusted publisher; a vetted publisher then picks freely among bonded operators for its own namespaces. Backstops are reactive (removeOrigin, blacklist + prune) plus a proactive un-vet. Content integrity is orthogonal (BLAKE3-verified), so this only touches the authorized-origin cache-warming / origin-directory surface, not paid delivery.

Contract surface (OriginAssignment.sol)

  • Vetting (cold, governance-gated, one-time): requestVetting() (requires namespaceCount(caller) > 0) → timelock → grantVetting(publisher) (GOVERNANCE_ROLE); cancelVettingRequest(); setPublisherVetted(publisher, bool) governance override (instant grant / un-vet rogue). New isVettedPublisher mapping; pending state becomes a per-publisher readyAt.
  • Origins (hot, vetted-gated, instant): addOrigin(ns, operator) — delta seat, carries all operator validation (owner, vetted, isActive, not-blacklisted, cap, dup); removeOrigin (renamed revokeAssignment, instant delta remove); pruneBlacklistedOrigin (renamed pruneBlacklistedAssignment).
  • Enumerable namespace index (replaces node genesis replay): EnumerableSet.UintSet of namespaces with ≥1 origin, maintained on the 0↔1 transitions by addOrigin / removeOrigin / pruneBlacklistedOrigin. Paginated views assignedNamespaceCount() + assignedNamespaceAt(i).
  • Events: VettingRequested, VettingRequestCancelled, PublisherVetted, OriginAdded, OriginRemoved, BlacklistedOriginPruned. Removed: AssignmentProposed/ProposalCancelled/Activated/Revoked.
  • Reads (getOrigins, isAuthorizedOrigin) unchanged; getPendingAssignment → getPendingVetting. IPublisherRegistryOwnership gains namespaceCount(address).

Rust (crates/node/src/dht/chain_origin_directory.rs + crates/incentive binding)

  • Cold-start discovery: delete the windowed log replay + start-block cursor. Replace with a paginated point read — assignedNamespaceCount() → assignedNamespaceAt(i) → getOrigins(ns). Authoritative, no configured start block.
  • Live watcher (liveness only): OriginAdded (re-read getOrigins) / OriginRemoved / BlacklistedOriginPruned; drop the AssignmentActivated arm. Events now only signal when to re-read, not history.
  • Drop the origin-directory replay window / start-block config knobs. Node read semantics (authoritative getOrigins re-read, fail-closed retry) unchanged.

CLI (decdn publish)

  • New request-vetting → requestVetting().
  • assign <ns> <operator...> repoints proposeAssignment → addOrigin (per-operator; clear PublisherNotVetted guidance).
  • New revoke → removeOrigin. Drop the propose-only/ready_at/replaced_prior output.

ADR + tests

Deferred

1h timelock floor (#1113 Proposal B — far less pressing now), cross-publisher vetted-operator pool (#1113 A.1), probationary cache-warming trust (#1113 A.3).

Activity

  1. added
    design:adr
    area:cli
    area:contracts
    rust
    on Jul 28, 2026
  2. added this to the v0.1 milestone on Jul 28, 2026
  3. thiras commented on Jul 29, 2026

    @thiras
    Contributor

    Scope note from the #1510 audit: the enumerable-namespace-index half of this issue has already shipped in #1497/#1504 and should come out of the remaining scope.

    • contracts/src/OriginAssignment.sol:86 has EnumerableSet.UintSet _assignedNamespaces, with assignedNamespaceCount() (:313) and assignedNamespaces(uint256 offset, uint256 limit) (:326) — the paginated page form rather than this issue's per-index assignedNamespaceAt(i), so don't add the latter.
    • crates/node/src/dht/chain_origin_directory.rs no longer replays: bootstrap_cache pins a block and pages assignedNamespaces, cursor_start seeds the live tail with persist: None, and the origin_directory_from_block config knob is gone. The "delete the windowed log replay + start-block cursor" bullet is done.
    • The AssignmentActivated watcher arm is still present, so the "drop the AssignmentActivated arm" bullet lands with the event rename, not before it.

    What remains is the actual redesign: the publisher-vetting lifecycle (requestVetting / grantVetting / setPublisherVetted, isVettedPublisher, per-publisher readyAt), instant addOrigin / removeOrigin / pruneBlacklistedOrigin, removal of proposeAssignment / activateAssignment / _pending / assignmentTimelock, the sol! binding rewrite in crates/incentive/src/origin_assignment.rs, the CLI rewrite off status=proposed_pending_dao (crates/cli/src/commands/publish.rs:307), ADR 011/016, and the Foundry + e2e work.

  4. self-assigned this
    on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliarea:contractsdesign:adrrust

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions