Repository navigation
docs(adr): correct region-scope enforcement drift in ADRs 011/014/016/030/031 - #1446
Conversation
…/030/031 ADR 014 § Blacklist violation item 7 claimed node region "is not stored on-chain in CapacityBond" and that "all blacklist violations are treated as globally scoped". Both are false against merged code: SlashJudge resolves global ∪ current-region ∪ ripening-prev-region on-chain via RegionScopeLib and ICapacityBondRegionView, reading regionHint / regionPrev / regionLastChanged off CapacityBond. This is compliance-relevant documentation — it describes what the enforcement layer can and cannot do — so the correction runs through every ADR that repeated the assumption or the API names behind it. ADR 014: - Rewrite item 7 as the actual three-leg scope predicate, including the ripening window anchored to the served responseTs (not challenge time) and the BlacklistAfterResponse / HashNotBlacklisted revert split. - Expand item 6 into the explicit entry-liveness predicate (suspension, emergency lapse at block.timestamp, effectiveAt rather than addedAt). - Replace the "no new NodeInfo fields" bullet with the region-scope read surface, and the non-existent isBlacklisted/getEntry calls with getHashEntry per scope leg. - Update the blacklist-challenge gas row for the added scope reads (regionScopeData measured at ~15k). - Keep the one thing that genuinely is not enforced: pre-positioned region misdeclaration. ADR 011: - region is bytes32 at every layer, not bytes2 with a string boundary. A declarable region is up to 16 bytes, so a two-byte key could not represent most of the space it must cover. - Correct the view surface to isHashBlacklisted / isHashBlacklistedInRegion / getHashEntry, and document isHashBlacklistedForOperator — the serve-time counterpart of the slash gate, which node polling and the pre-cache check should be using. - Drop the claim that a challenge during interim relief reverts with a distinct BlacklistEntrySuspended error; suspension folds into the liveness predicate and surfaces as HashNotBlacklisted. ADR 016: region is on-chain — what stays off-chain is discovery ranking, not scope enforcement; fix the stale getEntry call in the call graph. ADR 030 / ADR 031: retarget the dangling bytes2 citations, and give the appeal record its own slot for the full-word region key. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Warning Review limit reached
Next review available in: 20 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (4)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
Updates multiple ADRs to correct documentation drift around on-chain region-scope enforcement for blacklist challenges and serve-time blacklist views, aligning the written spec with the merged Solidity implementation (regional scope legs, CapacityBond region state, and updated ContentBlacklist view surface).
Changes:
- Re-specifies blacklist-challenge scope/liveness logic (global + current-region + ripening-prev-region) and related revert semantics in ADR 014.
- Corrects region representation to
bytes32end-to-end (including appeal surfaces and event indexing rationale) across ADRs 011/031 and updates downstream references in ADRs 016/030. - Updates cross-contract call-graph documentation to reflect
getHashEntry(region, hash)and region-scope reads via the narrowregionScopeDataview.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| adr/031-content-blacklist-appeals-contract.md | Updates appeal record + events to use bytes32 region keys and adjusts indexing rationale. |
| adr/030-node-region-self-attestation.md | Updates region-scope discussion to reference bytes32 packed keys and scope-check boundary conversion. |
| adr/016-contract-interactions.md | Corrects “region off-chain” claim and updates blacklist challenge external-call inventory. |
| adr/014-on-chain-verification.md | Rewrites blacklist-violation verification steps to match on-chain regional scope + enforceability timing. |
| adr/011-content-takedown.md | Updates IContentBlacklist spec block to bytes32 regions and expands/renames hash blacklist view surface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…-3d5817 # Conflicts: # adr/011-content-takedown.md # adr/016-contract-interactions.md
Why
ADR 014 § Blacklist violation item 7 claimed node region "is not stored on-chain in
CapacityBond" and that consequently "all blacklist violations are treated as globally scoped".Both statements are false against merged code.
SlashJudge._regionalLiveBeforeresolves global ∪ current-region ∪ ripening-prev-region on-chain viaRegionScopeLibandICapacityBondRegionView, readingregionHint/regionPrev/regionLastChangedoffCapacityBond.This is compliance-relevant documentation — it describes what the enforcement layer can and cannot do — so the correction runs through every ADR that repeated the assumption or the API names behind it. Docs only; no contract or Rust changes.
ADR 014 — the primary fix
responseTsrather than challenge-submission time (and why — the flip-then-stall evasion), and theBlacklistAfterResponsevsHashNotBlacklistedrevert split.block.timestamp; the anchor iseffectiveAt, notaddedAt.NodeInfofor PoC" → the actual region-scope read surface. "SlashJudgecallsContentBlacklist.isBlacklisted(hash)andgetEntry(hash)" → neither function exists; it callsgetHashEntry(region, blobHash)once per scope leg.regionScopeDatameasured at ~15k viaforge test --gas-report, so the row moves to ~75k–95k, noting the global leg short-circuits.ADR 011 — region representation and the view surface
regionisbytes32at every layer, notbytes2with astringboundary and a_toBytes2canonicalization step. A declarable region is a self-attested string of up to 16 bytes, so a two-byte key could not represent most of the space it must cover — narrowing it would silently put regions out of reach of takedown coverage.isHashBlacklisted/isHashBlacklistedInRegion/getHashEntry, andisHashBlacklistedForOperatordocumented — the serve-time counterpart of the slash gate, which the node polling fallback and the pre-cache check should be using rather than the global-only view.BlacklistEntrySuspendederror. No such error exists; suspension folds into the liveness predicate and surfaces asHashNotBlacklisted, so the revert does not distinguish a suspended entry from a never-blacklisted one.ADR 016 / 030 / 031
getEntry()call in the cross-contract call graph.bytes2gas note, which no longer exists. Retargeted, and the appeal record gets its own slot for the full-word region key (ADR 031's own as-built caveat already recordedbytes32).Verification
make -C adr check-refs— bare-reference, anchor, and section-numbering guards passpre-commit run --files <the five ADRs>— all applicable hooks passcontracts/src/{SlashJudge,ContentBlacklist,CapacityBond,RegionScopeLib}.solNot in this PR
ADR 011's appeal entry points still use the short names (
fastTrackAppeal,rejectAppeal, …) where merged code and ADR 031 use the*BlacklistAppealforms, and itsBlacklistEntrystruct is broader than the mergedHashEntry(which has noblake3Hash/reason/suspendedAtUs). Both are separate drift axes from region scope; flagging rather than folding in.🤖 Generated with Claude Code