Skip to content

docs(adr): OriginAssignment edge cases + PublisherRegistry setters (#450 §C.2 + §C.3) - #461

Merged
alpergundogdu merged 2 commits into
mainfrom
adr/450-pr6-origin-publisher
May 7, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
adr/450-pr6-origin-publisher

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

Sixth and final slice of #450. Closes the two §C bullets — OriginAssignment edge cases (§C.2) and PublisherRegistry cap/timelock setters (§C.3).

What's added

ADR 011 § Contract: OriginAssignment additions:

Function Purpose
cancelAssignmentProposal(namespaceId) Publisher-only explicit cancellation of a pending proposal (alternative to overwriting via re-propose)
revokeAssignment(...) clarified Reverts on non-member operator (typo protection); retains existing under-redundancy-allowed semantics for urgent revocations
activateAssignment(...) clarified Auto-clears the pending proposal on validation revert (single failure-mode-single-recovery)
New event AssignmentProposalCancelled(namespaceId, proposer, autoCleared) Fires for both publisher-initiated cancellation and auto-clear paths

ADR 011 § Edge cases (new subsection):

Pins seven previously-implicit behaviors:

  • Empty operator array reverts (use revokeAssignment for removal — explicit intent)
  • Pending proposals never expire (publisher manages lifecycle; cancel-and-re-propose if governance is unresponsive)
  • Re-proposal overwrites the existing pending proposal and resets readyAt; emits AssignmentProposalCancelled + AssignmentProposed
  • Activation-revert auto-clears the pending proposal so the publisher can re-propose without an explicit cancel
  • ContentBlacklist-unbound deployment-window: activateAssignment skips the blacklist check and validates only against StakingRegistry.isActive; setContentBlacklist(address(0)) reverts to prevent regression
  • revokeAssignment of non-member operator reverts (typo protection)
  • revokeAssignment dropping below minRedundancy is allowed by design (urgent path)

ADR 002 § Contract: PublisherRegistry additions:

Element Purpose
setMaxNamespacesPerPublisher(newMax) GOVERNANCE_ROLE; bounded [1, 1000] per ADR 009
setNamespaceTransferTimelock(newTimelock) GOVERNANCE_ROLE; bounded [24h, 30d] per ADR 009
maxNamespacesPerPublisher() / namespaceTransferTimelock() Read views
MaxNamespacesPerPublisherUpdated / NamespaceTransferTimelockUpdated events Per-setter, indexable change history
§93 prose update Drop "governance-controlled parameter store" framing; values stored on PublisherRegistry itself, per planning #14

Decisions baked in (per planning conversation)

Decision Pick
Proposal cancellation Publisher-only cancelAssignmentProposal, callable any time before activateAssignment
Proposal expiry Never (publisher manages lifecycle)
Multiple pending proposals New proposeAssignment overwrites; resets readyAt
Activation-revert Auto-clear the pending proposal; emit AssignmentProposalCancelled(autoCleared=true)
revokeAssignment of non-member Revert (typo protection)
revokeAssignment below min-redundancy Allowed (existing spec retained; urgent revocations need this)
ContentBlacklist unbound during deploy Skip blacklist check; validate against StakingRegistry only; setContentBlacklist(address(0)) reverts
PublisherRegistry parameter source Own contract storage with governance setters; drop "parameter store" framing
Per-setter events Standard pattern, mirrors PR 1 / PR 3 / PR 4

#450 status after this PR merges

All 13 acceptance bullets closed:

  • ✓ §A.1 VotingEscrow interface block (#456)
  • ✓ §A.2 FeeRouter interface block (#458)
  • ✓ §A.3 SafetyReserve interface block (#459)
  • ✓ §A.4 DelegatorBuyer minimal interface (#459)
  • ✓ §B.1 StakingRegistry.isActive(operator) (#455)
  • ✓ §B.2 nodeIdOf return type aligned (#455)
  • ✓ §B.3 commitEpochReceiptRoot / commitEpochSummary full spec (#460)
  • ✓ §B.4 FeeRouter tunability setters (#458)
  • ✓ §B.5 PaymentChannel.setFeeRouter setter spec (#455)
  • ✓ §B.6 StakingRegistry → SafetyReserve redirect call signature (#459)
  • ✓ §C.1 FeeRouter zero-address constructor (#458)
  • ✓ §C.2 OriginAssignment edge cases (this PR)
  • ✓ §C.3 PublisherRegistry cap/timelock setters (this PR)

Test plan

  • pre-commit run --files adr/002-content-addressing.md adr/011-content-takedown.md clean
  • Render the new "Edge cases" subsection in ADR 011 between the interface block and "### Lifecycle" — verify the bullet list reads coherently
  • Verify the ADR 002 §93 prose change drops the "parameter store" framing and reads naturally with the new setter declarations above

Related

🤖 Generated with Claude Code

 §C.2 + §C.3)

Last slice of #450. Closes the two §C bullets: pin OriginAssignment
edge-case behaviors (§C.2) and surface PublisherRegistry's governable-
parameter setters (§C.3).

ADR 011 § Contract: OriginAssignment additions:

- cancelAssignmentProposal(namespaceId) — publisher-only escape for
  pending proposals (vs the implicit overwrite via re-propose).
- activateAssignment now documented to auto-clear pending proposals on
  validation revert (single failure-mode-single-recovery).
- revokeAssignment now reverts on non-member operator (typo protection);
  retains the existing under-redundancy-allowed semantics for urgent
  revocations.
- New AssignmentProposalCancelled event with autoCleared flag.

ADR 011 § Edge cases (new subsection):

Pins seven previously-implicit behaviors:
- Empty operator array reverts (use revokeAssignment for removal)
- Pending proposals never expire (publisher manages lifecycle)
- Re-proposal overwrites and resets timelock counter; emits cancel + propose
- Activation-revert auto-clears the pending proposal
- ContentBlacklist-unbound deployment-window: skip blacklist check, validate
  only against StakingRegistry; setContentBlacklist(address(0)) reverts
  to prevent regression
- revokeAssignment of non-member operator reverts (typo protection)
- revokeAssignment dropping below minRedundancy is allowed by design
  (urgent path; off-chain consumers observe under-redundancy via getOrigins)

ADR 002 § Contract: PublisherRegistry additions:

- setMaxNamespacesPerPublisher(newMax) and setNamespaceTransferTimelock
  (newTimelock) setters, GOVERNANCE_ROLE-gated with bounds enforced at
  the contract layer per ADR 009 (max [1, 1000], timelock [24h, 30d]).
- maxNamespacesPerPublisher() and namespaceTransferTimelock() views.
- MaxNamespacesPerPublisherUpdated and NamespaceTransferTimelockUpdated
  events.
- §93 prose updated: drop "governance-controlled parameter store" framing;
  values live on PublisherRegistry itself (per planning #14).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@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 updates the content addressing and takedown ADRs to include governable parameters and refined assignment logic. Key changes include adding setters and safety bounds for namespace limits and transfer timelocks in the PublisherRegistry, as well as introducing a proposal cancellation mechanism and auto-clearing logic in OriginAssignment. Feedback focuses on ensuring documentation consistency by using seconds instead of human-readable time units for all parameter bounds and defaults to prevent implementation errors.

Comment thread adr/002-content-addressing.md Resolved
Comment thread adr/002-content-addressing.md Resolved
…review)

Address Gemini review on PR #461: pin all timelock bounds to seconds
(the unit the contract actually enforces) with human-readable forms in
parentheses for cross-reference. Affects:

- Solidity setter comment: "[86400, 2592000] (in seconds; 24 h – 30 days)"
  replaces the prior "[24h, 30d] (in seconds)" mixed form.
- Prose §93: bounds and defaults stated as both seconds and
  human-readable; the contract-layer enforcement is in seconds.

Convention now clear: on-chain bounds are seconds; human-readable forms
are an aid to the reader, not the source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alpergundogdu
alpergundogdu merged commit 356a39e into main May 7, 2026
16 of 18 checks passed
@alpergundogdu
alpergundogdu deleted the adr/450-pr6-origin-publisher branch May 7, 2026 14:47
alpergundogdu added a commit that referenced this pull request May 7, 2026
Switch summaryWindow / challengeWindow rows to seconds-primary
formatting (human-readable in parens), matching the convention
established in PR #461 for namespaceTransferTimelock — seconds is the
unit the contract setter actually consumes.

claimWindow stays in epochs (it's a count, not a wall-clock duration);
note added that the contract derives the seconds-domain deadline
internally via the immutable epochLength multiplier.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
alpergundogdu added a commit that referenced this pull request May 7, 2026
…ation, ReceiptFraud offense) (#462)

* docs(adr): pin gap-fix items left open by #450 (timing bounds, commitEpochSummary validation, receipt-fraud offense)

Three deferred items from the audit follow-up are pinned here as a
single coherent block, since they share the "lock down what was still
vague after the #450 surface-gap audit" theme.

ADR 026 §11 — timing-window safety bounds:
- summaryWindow: 7 days default, [3 days, 14 days] bounds — gives
  honest operators time to aggregate receipts off-chain (lower) without
  delaying gauge finality more than a month at the most permissive
  setting (upper).
- challengeWindow: 7 days default, [3 days, 14 days] bounds — gives
  bonded challengers time to verify signatures + identity-diversity
  heuristics (lower) without indefinitely delaying gauge payouts (upper).
- claimWindow: 26 epochs default, [13, 52] epochs bounds — promoted
  from §2 prose to the canonical bounds table.
- Cross-parameter invariant: claimWindow > challengeWindow enforced at
  the setter layer so a frozen-with-undetected-fraud summary cannot
  outlive the challenge window before the operator's claim resolves.

ADR 027 §4 — commitEpochSummary validation rules:
- New "commitEpochSummary validation rules" subsection explicitly pins
  six checks the contract MUST enforce: argument-struct consistency,
  epoch validity (epochId < currentEpoch), summary-window-open timing,
  cryptographic anti-griefing (summary.aggregateRoot == current MMR
  root), last-write-wins replacement during the summary window, and
  trust-then-challenge for the operator-asserted fields.
- Third-party submission preserved (per the existing prose) — the
  cryptographic check on aggregateRoot makes the submitter's identity
  irrelevant for correctness; relayers can submit on operators' behalf
  without trust assumptions.

ADR 014 + ADR 027 §5 — receipt-fraud offense:
- New OffenseType.ReceiptFraud appended to the canonical enum (preserving
  the existing four ordinals so SafetyReserve indexing stays stable).
- New ISlashJudge.submitReceiptFraudChallenge(challengedNode, epochId,
  fraudEvidence) entry point. No counter-evidence window — Merkle
  inclusion/exclusion proofs against the operator's own on-chain
  aggregateRoot are cryptographically dispositive.
- Receipt-fraud preimage formula added to §3 evidenceHash spec:
  keccak256(abi.encode(uint8(OffenseType.ReceiptFraud), epochId,
  aggregateRoot)) — stable across alternate fraud-evidence formats
  (different Merkle proofs against the same aggregateRoot produce the
  same evidenceHash).
- ADR 027 §5 bond model: 100 TOKEN bond (matches existing challengeBond,
  governable [10, 1000]); 5/15/50% escalating slash percentage on
  successful challenge; 50/30/20 challenger / SafetyReserve / burn
  distribution; 50/50 burn-or-to-operator on unsuccessful — all
  matching the four existing offense types. Over-claimed claimedBytes
  / claimedDistinctClients fields zeroed for the epoch on success
  (gauge eligibility forfeiture stacks with the stake slash).

Closes the three "honest gaps that remain (deferred to #451 lock-down)"
flagged in the cross-PR audit on the #450 series.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(adr): unit consistency on §11 timing-window bounds (Gemini review)

Switch summaryWindow / challengeWindow rows to seconds-primary
formatting (human-readable in parens), matching the convention
established in PR #461 for namespaceTransferTimelock — seconds is the
unit the contract setter actually consumes.

claimWindow stays in epochs (it's a count, not a wall-clock duration);
note added that the contract derives the seconds-domain deadline
internally via the immutable epochLength multiplier.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

ADR surface-gap audit: missing interface blocks and unspecified function signatures across the unified contract surface

1 participant