Repository navigation
Description
Context
ContentBlacklist (PR #684) shipped the ADR 031 appeal lifecycle, but several integrity clauses were intentionally simplified / deferred for that revision (documented in the contract header, contracts/src/ContentBlacklist.sol:22-29). The security audit pass (#777) later surfaced the attack surface these deferrals leave open and scoped them out of the security PR because they need either a snapshot/balance-at-time primitive or an ADR update.
This issue is the single tracking item for all of that deferred ADR-031 appeal-integrity work. Consolidates #779 (security-audit framing, audit findings H-4 / I-3) — closed as a duplicate in favour of this issue.
The four mechanisms below are largely independent and can land incrementally; item 1 (rejection cooldown) is the most self-contained and the current top gap, since the bond is otherwise the only brake on raw appeal-spam.
Scope
1. Rejection cooldown — audit H-4
There is no rate limit on abusive/rejected filers — only the success-path frequency cap (lastRatifiedSuccessAt) throttles ratified filers. An attacker can spam openBlacklistAppeal across distinct live entries, bounded only by bond cost. ADR-031 specifies a rejection cooldown (e.g. N rejections / 90 days → lockout).
- Add
lastRejectionAt[filer]mapping; increment inrejectBlacklistAppeal; check inopenBlacklistAppealagainst a governable window. ~10 lines, ships independently.
2. Perjury denylist
Governance-maintained denylist of filers who submitted false appeals, checked in openBlacklistAppeal; populated on egregious-bad-faith rulings per ADR-031.
- Add
mapping(address => uint256) public perjuryDenylist(address => cooldownUntil); revert with a custom error (e.g.PerjuryDenylisted(filer, cooldownUntil)) whileblock.timestamp < perjuryDenylist[filer]. - Governance-gated setter; cooldown (≈365 days) as a governable constant. Depends on off-chain adjudication criteria being defined.
3. Token-holder standing enforcement + synthetic-standing clawback — audit I-3
StandingPath is recorded but only enum-range validated — any address can file claiming any standing (Publisher / Operator / TokenHolder) without proving it, paying only the bond. ADR-031 §216 admissibility condition (c) requires a balance/standing check.
- Decide the snapshot mechanism (ERC20Votes
getPastVotes, or a simpler balance-at-file-time check) and update ADR-031 §216(c) with the chosen approach before implementation. - At
StandingPath.TokenHolderfiling, snapshot the filer's TOKEN balance; on adverse ruling claw back the bond + a multiplier if the snapshot was transiently inflated (flash-loan / transient deposit). Block-number gate to frustrate same-tx flash loans.
4. Per-(requesting_body, region) concurrent-appeal cap
The per-body cap currently enforces a single per-region hard ceiling (BODY_CONCURRENT_APPEAL_CAP = 3) rather than per-requesting-body identity, so one body can saturate a region's slots.
- Track concurrent appeals per
(requesting_body, region)pair (e.g.mapping(address => mapping(uint8 => uint256))); increment on filing, decrement on resolution; revert with a descriptive error at the per-pair cap.
Tests
One happy-path + one revert-path fixture per mechanism; cover the flash-loan snapshot edge case for the clawback.
Note on already-shipped mitigation
#777 mitigated the related M-1 (per-region cap now counts only fast-tracked appeals, so Open-filing spam can't saturate a region's interim-relief budget) — partial relief, but it does not substitute for item 1.
References
- PR feat(contracts): implement ADR 026/028/030/031/033/036 deltas #684 (out-of-scope follow-ups docs: Generalize architecture to content-agnostic CDN, refocus slashing on bad edges #2 / ADR 002: Specify BLAKE3→keccak256 Merkle proof scheme for on-chain slashing #4) — parent implementation
- Security audit fix(contracts): security audit pass — High + Medium findings #777 (findings H-4, I-3); sibling deferred-work issues CapacityBond.setUnbondingPeriod should mirror the maxEvidenceAgeUs invariant (size-deferred) #778 / Audit residuals + acknowledged postures (deferred from #777) #780
- ADR 031
contracts/src/ContentBlacklist.sol:22-29(simplifications noted in header)
CI reminders (Solidity)
- Run
FOUNDRY_PROFILE=ci forge build --sizes --deny warningsbefore pushing — denylist/cooldown revert paths mustemitbeforerevertif the function is otherwise non-mutating, or solc emits W5740 / mutability warnings that are fatal under--deny warnings. aderyn(fail-on: high) andslither(fail-on: medium) both run in CI; put// slither-disable-next-linedirectives immediately above thefunctiondeclaration forunused-return.forge fmt+solhintrun as pre-commit hooks; resolve 120-char named-args revert disagreements with positional args.- Watch the
CapacityBond/ContentBlacklist--sizesgate — added storage + branches can push bytecode toward the EIP-170 limit.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
github-actions commentedon May 28, 2026
🎯 Triage report
This is a well-scoped follow-up to PR #684, tracking three ADR 031 clauses that were intentionally deferred in the initial
ContentBlacklistimplementation. Each deferral is documented in the contract header (contracts/src/ContentBlacklist.sol:22-29). The work is entirely withincontracts/and has clear, self-contained sub-tasks. Thesecurity+technicallabels already applied are appropriate; addedenhancementandprod-blockingsince these are contract hardening items that need to ship before production.📊 Assessment
enhancement,prod-blocking(added);security,technical(existing)🔗 Similar issues
No duplicates found. PR #684 is the parent implementation this issue tracks follow-up work from.
💡 Notes and suggestions
Sub-task checklist
mapping(address => uint256) public perjuryDenylisttoContentBlacklist. InfileAppeal(or equivalent entry point), revert with a custom error (e.g.,PerjuryDenylisted(address filer, uint256 cooldownUntil)) ifblock.timestamp < perjuryDenylist[msg.sender]. Populate via a governance-gated setter on egregious bad-faith rulings per ADR 031. The 365-day cooldown value should be a governable constant (or hard-coded as365 days).StandingPath.TokenHolderfiling, snapshotTOKEN.balanceOf(msg.sender)and store it alongside the appeal record. On adverse ruling, compare snapshot vs current balance; if snapshot was transiently inflated (possible heuristic: snapshot > current + threshold), claw back bond + multiplier. Consider block-number gating to frustrate same-tx flash loans.(requesting_body, region)cap — Replace or augment theregion-onlyBODY_CONCURRENT_APPEAL_CAPmapping with a nestedmapping(address => mapping(uint8 => uint256)) pendingAppealsPerBodyRegion. Increment on filing, decrement on resolution. Revert with a descriptive error if the per-pair cap is hit.CI reminders
FOUNDRY_PROFILE=ci forge build --sizes --deny warningsbefore pushing — the perjury revert path must useemitbeforerevertif the function is otherwise non-mutating, or solc may emit W5740/mutability warnings that fail CI under--deny warnings.aderyn(fail-on: high) andslither(fail-on: medium) both run in CI; use// slither-disable-next-linedirectives above the function declaration (not the call site) for anyunused-returnfindings.forge fmtandsolhintrun as pre-commit hooks; 120-char line-length disagreements on named-args reverts are best resolved with positional args.Add this agentic workflows to your repo
To install this agentic workflow, run
[-]feat(contracts): ADR 031 deferred clauses — perjury denylist, synthetic-standing clawback, per-body concurrent-appeal cap[/-][+]feat(contracts): ADR-031 deferred ContentBlacklist appeal-integrity mechanisms — rejection cooldown, perjury denylist, standing clawback, per-body concurrent-appeal cap[/+]thiras commentedon Jun 5, 2026
Consolidated #779 into this issue. #779 tracked the same deferred ADR-031 appeal-integrity work from the #777 security-audit angle (rejection cooldown = audit H-4, standing enforcement + synthetic-standing clawback = audit I-3, perjury denylist). Its scope is now folded into the four mechanisms above, the audit lineage (H-4 / I-3, #777) is captured, and priority is raised to
highto match the audit severity. #779 closed as duplicate.feat(contracts): rejection cooldown for blacklist appeals (#688 item …
alpergundogdu commentedon Jun 29, 2026
Decomposition + design decisions
Broken into 5 sub-issues. Mechanism A (rejection cooldown) is already implemented and tested on
main— only docs remain. Key design decisions resolved with the maintainer are recorded inline below.rejectAppealAsPerjuryon existingEMERGENCY_MULTISIG_ROLE; fixed 365dnamespaceIdfiling arg (ownerOf + hasClaimed); TokenHolder via governableAPPEAL_FILER_TOKEN_THRESHOLDImplementation order
B / C1 / D are mutually independent (parallelizable). Do not land #1015 (D) and #1018 (C2) simultaneously — they share the appeal-finalizer accounting sites.
Cross-cutting notes
ContentBlacklist.soldiverges from the ADR-031 spec text (6-state vs 8-state machine, different struct layout, second- vs microsecond timestamps, nounFastTrackAppeal). Implement against the as-built contract, not the ADR struct layout. ADR-031 gets reconciled to as-built across these issues (one coherent edit).rejectAppealAsPerjuryreuses the existing emergency-multisig capability (ADR 009 capability 3) — no new role.Token.solhas no ERC20Votes/getPastVotes, which constrains C2 to balanceOf-at-time (confirms the simpler clawback path).docs(contracts): mark ADR-031 as target spec vs as-built (PR review)
alpergundogdu commentedon Jun 30, 2026
Mechanism A (rejection cooldown): done. Verified already implemented and fully tested on
main—rejectionCooldownWindow+ bounds, the 3-strikeRejectionWindowring, theFilerInRejectionCooldowngate inopenBlacklistAppeal,_recordRejectionfromrejectBlacklistAppeal, and the boundedsetRejectionCooldownWindowsetter; 9 tests attest/ContentBlacklist.t.sol:557-692(lockout-after-three, two-don't-trip, lift-after-window, rolling-window reset, cross-filer isolation, governed-window, setter update/bounds/role-gating). No code gap found.ADR-031 mechanical reconciliation in #1024 (closes #1014). The perjury denylist / standing enforcement / synthetic clawback / per-filer cap remain the forward target in ADR-031, tracked by #1016 / #1017 / #1018 / #1015.
docs(contracts): reconcile ADR-031 mechanical drift to as-built Conte…
feat(contracts): add multisig perjury denylist via rejectAppealAsPerj…
feat(contracts): add per-(filer,region) concurrent fast-track cap alo…
docs(adr): reconcile ADR-011 concurrent-relief cap to the two-tier mo…
feat(contracts): enforce Publisher and TokenHolder standing at appeal…
feat(contracts): enforce Publisher and TokenHolder standing at appeal…
alpergundogdu commentedon Jul 9, 2026
Completed — all four deferred ADR-031 appeal-integrity mechanisms have landed, and
ContentBlacklist.soldocuments them as implemented:filerRejections,setRejectionCooldownWindow) — feat(contracts): rejection cooldown for blacklist appeals (#688 item 1, H-4) #913 (item 1, audit H-4).rejectAppealAsPerjury,perjuryDenylistUntilAt) — feat(contracts): add multisig perjury denylist via rejectAppealAsPerjury (#1016) #1026.REGION_CONCURRENT_RELIEF_CAP+FILER_CONCURRENT_RELIEF_CAP— feat(contracts): add per-(filer,region) concurrent fast-track cap alongside region ceiling (#1015) #1045.No contract work remains. Closing as completed.