Repository navigation
Description
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()(requiresnamespaceCount(caller) > 0) → timelock →grantVetting(publisher)(GOVERNANCE_ROLE);cancelVettingRequest();setPublisherVetted(publisher, bool)governance override (instant grant / un-vet rogue). NewisVettedPublishermapping; pending state becomes a per-publisherreadyAt. - Origins (hot, vetted-gated, instant):
addOrigin(ns, operator)— delta seat, carries all operator validation (owner, vetted,isActive, not-blacklisted, cap, dup);removeOrigin(renamedrevokeAssignment, instant delta remove);pruneBlacklistedOrigin(renamedpruneBlacklistedAssignment). - Enumerable namespace index (replaces node genesis replay):
EnumerableSet.UintSetof namespaces with ≥1 origin, maintained on the 0↔1 transitions byaddOrigin/removeOrigin/pruneBlacklistedOrigin. Paginated viewsassignedNamespaceCount()+assignedNamespaceAt(i). - Events:
VettingRequested,VettingRequestCancelled,PublisherVetted,OriginAdded,OriginRemoved,BlacklistedOriginPruned. Removed:AssignmentProposed/ProposalCancelled/Activated/Revoked. - Reads (
getOrigins,isAuthorizedOrigin) unchanged;getPendingAssignment→getPendingVetting.IPublisherRegistryOwnershipgainsnamespaceCount(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-readgetOrigins) /OriginRemoved/BlacklistedOriginPruned; drop theAssignmentActivatedarm. Events now only signal when to re-read, not history. - Drop the origin-directory replay window / start-block config knobs. Node read semantics (authoritative
getOriginsre-read, fail-closed retry) unchanged.
CLI (decdn publish)
- New
request-vetting→requestVetting(). assign <ns> <operator...>repointsproposeAssignment→addOrigin(per-operator; clearPublisherNotVettedguidance).- New
revoke→removeOrigin. Drop the propose-only/ready_at/replaced_prioroutput.
ADR + tests
- ADR 011 § Origin Assignment Authority rewritten to the two-plane model (publisher vetting = governance; origin add/remove = self-serve instant); ADR 016 inventory/interface updated.
- Foundry: vetting lifecycle,
addOriginguards + delta invariant (adding B can't be blocked by A's transient state — the OriginAssignment: no incremental timelocked path to add a second origin — must re-propose (and re-timelock) the whole live set #1107 regression), un-vet forces slow path; namespace-index invariant (namespace enters on 0→1, leaves on ≥1→0 via either remove path); re-blessInterfaceFreeze. - e2e: rename helpers, vet-then-add flow,
removeOriginevent rename.
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).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
thiras commentedon Jul 29, 2026
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:86hasEnumerableSet.UintSet _assignedNamespaces, withassignedNamespaceCount()(:313) andassignedNamespaces(uint256 offset, uint256 limit)(:326) — the paginated page form rather than this issue's per-indexassignedNamespaceAt(i), so don't add the latter.crates/node/src/dht/chain_origin_directory.rsno longer replays:bootstrap_cachepins a block and pagesassignedNamespaces,cursor_startseeds the live tail withpersist: None, and theorigin_directory_from_blockconfig knob is gone. The "delete the windowed log replay + start-block cursor" bullet is done.AssignmentActivatedwatcher arm is still present, so the "drop theAssignmentActivatedarm" bullet lands with the event rename, not before it.What remains is the actual redesign: the publisher-vetting lifecycle (
requestVetting/grantVetting/setPublisherVetted,isVettedPublisher, per-publisherreadyAt), instantaddOrigin/removeOrigin/pruneBlacklistedOrigin, removal ofproposeAssignment/activateAssignment/_pending/assignmentTimelock, thesol!binding rewrite incrates/incentive/src/origin_assignment.rs, the CLI rewrite offstatus=proposed_pending_dao(crates/cli/src/commands/publish.rs:307), ADR 011/016, and the Foundry + e2e work.feat(contracts): vetted-publisher instant origins (#1491)
chore: knock off six low-LOC / doc-only issues (#1555, #1558, #1559, #…