Repository navigation
feat(contracts): add multisig perjury denylist via rejectAppealAsPerjury (#1016) - #1026
Conversation
…ury (#688) ADR 031 § Evidence Mechanism B. A single adjudicated bad-faith / false-sworn- declaration appeal locks the filer out of openBlacklistAppeal for a fixed 365-day term — distinct from the rejection cooldown (which throttles volume abuse: three rejections in a rolling window). - New `perjuryDenylistUntilAt[filer]` mapping (public auto-getter) and a gate in `openBlacklistAppeal` alongside the rejection-cooldown gate (`FilerPerjuryDenylisted(until)`). - New `rejectAppealAsPerjury(appealId)` gated to the existing `EMERGENCY_MULTISIG_ROLE` (ADR 009 capability 3 sub-mode — no new role). It mirrors `rejectBlacklistAppeal` exactly (burn bond, record rolling-window rejection, un-suspend + release the per-region relief slot on a fast-tracked appeal) and additionally sets the 365-day denylist. - `PERJURY_DENYLIST_DURATION = 365 days` fixed constant, no governance setter (tied to a concrete finalized appeal, so it is auditable). - Emits `BlacklistAppealRejectedAsPerjury(appealId, filer, until)` in addition to `BlacklistAppealRejected`. Tests: denylist+burn+finalize; blocks filer until the window lapses then lifts; role-gating; fast-track path un-suspends + releases the cap; per-filer isolation; terminal-appeal revert. 46/46 ContentBlacklist tests pass. ADR-031 reconciled: perjury promoted from deferred to as-built (event/error names aligned, removed from the deferred-mechanisms note). `perjuryFlagged` struct flag stays a target-only field — the shipped path signals perjury via the dedicated event instead. Closes #1016. Refs #688. Co-Authored-By: Claude Opus 4.8 <[email protected]>
WalkthroughAdds a perjury denylist mechanism to ChangesPerjury Denylist Mechanism
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Gas snapshotNo gas changes vs base. |
Contracts coverageLine coverage: 90.28% (2265/2509 lines) |
There was a problem hiding this comment.
Code Review
This pull request implements the perjury denylist mechanism outlined in ADR 031. It introduces the rejectAppealAsPerjury function, which allows the emergency multisig to reject an appeal as perjury, burning the bond and banning the filer from opening new appeals for 365 days. The review feedback points out that the check for the perjury ban in openBlacklistAppeal should be evaluated before the volume-based rejection cooldown check to ensure the more severe perjury error is reported first.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
contracts/test/ContentBlacklist.t.sol (2)
729-753: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winPin the exact expiry boundary.
This only proves “revert before expiry” and “succeeds at
until + 1”. IfopenBlacklistAppealwere implemented with<= untilinstead of< until, the suite would still pass. Please add a check atblock.timestamp == untilto lock the intended semantics.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@contracts/test/ContentBlacklist.t.sol` around lines 729 - 753, The perjury denylist test in test_rejectAppealAsPerjury_blocksFilerUntilWindowLapses only covers behavior before expiry and at until + 1, so it does not pin the exact boundary. Update this test around ContentBlacklist.openBlacklistAppeal and perjuryDenylistUntilAt to also assert the expected revert when block.timestamp equals until, using the same FilerPerjuryDenylisted selector, so the intended < until semantics are locked in.
708-725: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the rejection events here.
This test pins the storage effects, but it never checks that
rejectAppealAsPerjuryemits the newBlacklistAppealRejectedAsPerjuryevent or the existingBlacklistAppealRejectedevent required by the PR contract. A regression in observability would still pass.As per path instructions, "Confirm events are emitted for state-changing ops."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@contracts/test/ContentBlacklist.t.sol` around lines 708 - 725, The test `test_rejectAppealAsPerjury_denylistsBurnsAndFinalizes` only checks storage changes and should also verify the emitted events for `rejectAppealAsPerjury`. Add assertions that `blacklist.rejectAppealAsPerjury(appealId)` emits both `BlacklistAppealRejectedAsPerjury` and the existing `BlacklistAppealRejected` event, using the relevant `ContentBlacklist` event names so the state-changing op is covered end to end.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@contracts/test/ContentBlacklist.t.sol`:
- Around line 729-753: The perjury denylist test in
test_rejectAppealAsPerjury_blocksFilerUntilWindowLapses only covers behavior
before expiry and at until + 1, so it does not pin the exact boundary. Update
this test around ContentBlacklist.openBlacklistAppeal and perjuryDenylistUntilAt
to also assert the expected revert when block.timestamp equals until, using the
same FilerPerjuryDenylisted selector, so the intended < until semantics are
locked in.
- Around line 708-725: The test
`test_rejectAppealAsPerjury_denylistsBurnsAndFinalizes` only checks storage
changes and should also verify the emitted events for `rejectAppealAsPerjury`.
Add assertions that `blacklist.rejectAppealAsPerjury(appealId)` emits both
`BlacklistAppealRejectedAsPerjury` and the existing `BlacklistAppealRejected`
event, using the relevant `ContentBlacklist` event names so the state-changing
op is covered end to end.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a0b0f786-a996-4cd1-9497-6b14a1071532
📒 Files selected for processing (3)
adr/031-content-blacklist-appeals-contract.mdcontracts/src/ContentBlacklist.solcontracts/test/ContentBlacklist.t.sol
There was a problem hiding this comment.
Pull request overview
Adds an on-chain “perjury denylist” enforcement path to the ContentBlacklist appeal system: once the emergency multisig adjudicates an appeal as bad-faith (perjury), the filer is prevented from opening new appeals for a fixed 365-day term. This extends the existing abuse-mitigation toolbox beyond the rolling “rejection cooldown” (volume throttling) to penalize a single egregious act.
Changes:
- Introduces
perjuryDenylistUntilAt(publicaddress => uint64) and enforces it inopenBlacklistAppealviaFilerPerjuryDenylisted(until). - Adds
rejectAppealAsPerjury(appealId)gated byEMERGENCY_MULTISIG_ROLE, mirroringrejectBlacklistAppeal(burn + finalize + rejection-window accounting + fast-track cleanup) and additionally setting the denylist + emittingBlacklistAppealRejectedAsPerjury. - Adds a focused test suite for the new path and reconciles ADR-031 to reflect the shipped event/error naming and the “event-signaled” perjury record.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| contracts/src/ContentBlacklist.sol | Implements perjury denylist storage + filing gate + multisig perjury-reject finalization path with dedicated event/error. |
| contracts/test/ContentBlacklist.t.sol | Adds test coverage for denylist behavior, role gating, fast-track cleanup behavior, and per-filer isolation. |
| adr/031-content-blacklist-appeals-contract.md | Updates ADR text/tables to reflect the now-shipped perjury denylist and the event-based perjury record. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR #1026 review: - Check the perjury denylist BEFORE the rejection cooldown in openBlacklistAppeal so a filer who is both denylisted and in a volume cooldown sees the more severe FilerPerjuryDenylisted ban (gemini). - Assert both BlacklistAppealRejectedAsPerjury and BlacklistAppealRejected emit in the happy-path test (coderabbit). - Pin the exact denylist-expiry boundary: still reverts at until-1, lifts at exactly until — locks in the exclusive `> block.timestamp` semantics (coderabbit). - Regenerate contracts/.gas-snapshot (FOUNDRY_PROFILE=ci) — deterministic gas shifted from the added storage read + new tests; this was the CI failure. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Review + CI fixes pushed in c207d59CI failure (gas snapshot): @gemini-code-assist (perjury-before-cooldown ordering): Done — replied + resolved inline. @coderabbitai nitpicks (both addressed):
All 46 ContentBlacklist tests + full suite (675) still pass; fmt/solhint/markdownlint/ADR hygiene green. 🤖 Addressed by Claude Code |
|
Great to see the perjury denylist mechanism fully integrated and verified with the updated test suite. The shift to |
|
Tip For best results, initiate chat on the files or code changes.
Locking in the exact 🐇✅ |
Closes #1016. Sub-issue of #688 — Mechanism B (perjury denylist). Independent of C/D.
What
A single adjudicated bad-faith / false-sworn-declaration appeal now costs the filer the right to open new appeals for a fixed 365-day term. This is distinct from the rejection cooldown (Mechanism A), which throttles volume abuse (three rejections in a rolling window) — perjury penalizes one egregious act.
Changes (
ContentBlacklist.sol)perjuryDenylistUntilAt[filer]mapping (uint64, public auto-getter) + a gate inopenBlacklistAppealalongside the existing rejection-cooldown gate, revertingFilerPerjuryDenylisted(until).rejectAppealAsPerjury(uint256 appealId)gated to the existingEMERGENCY_MULTISIG_ROLE— no new role (ADR 009 capability 3 sub-mode, same 3-of-5 threshold asfastTrackBlacklistAppeal). It mirrorsrejectBlacklistAppealexactly (burn bond, record the rolling-window rejection, and on a fast-tracked appeal un-suspend the entry + release the per-region relief slot), and additionally sets the 365-day denylist.PERJURY_DENYLIST_DURATION = 365 daysfixed constant — no governance setter, since the entry is tied to a concrete finalized appeal (auditable).BlacklistAppealRejectedAsPerjury(appealId, filer, until)in addition toBlacklistAppealRejected, so consumers tracking rejections see both.Off-chain adjudication criteria for "egregious bad faith / false sworn declaration" live in ADR prose, not contract logic.
Tests (
ContentBlacklist.t.sol) — 6 new, 46/46 passhappy-path (denylist 365d + burn + finalize) · blocks the filer until the window lapses then lifts · role-gating (non-multisig reverts) · fast-track path un-suspends + releases the relief cap · per-filer isolation · terminal-appeal revert.
ADR-031 reconciliation
Perjury promoted from deferred to as-built: event/error names aligned to the shipped surface (
BlacklistAppealRejectedAsPerjury,FilerPerjuryDenylisted) and removed from the deferred-mechanisms note.For review — two naming/scope calls
AppealRejectedAsPerjury/FilerPerjuryDenylisted) and the ADR's prior placeholder (BlacklistAppealPerjuryRecorded/FilerOnPerjuryDenylist). I usedBlacklistAppealRejectedAsPerjury(consistent with the codebase'sBlacklistAppeal*event prefix) andFilerPerjuryDenylisted(parallelsFilerInRejectionCooldown). Happy to rename if you prefer the issue's literal names.perjuryFlaggedstruct field (a target-only field in ADR-031) is not added — the shipped path signals perjury via the dedicated event. Left as a target-only field per the "keep spec as target" decision; flag if you'd rather drop it.Checks
forge build --deny warnings(CI profile,--sizes): clean;ContentBlacklist12,479 bytes (well under EIP-170).forge test: 675 pass (incl.InterfaceFreeze);forge fmt --check+solhint+ markdownlint + ADR hygiene all pass.rejectBlacklistAppeal/reverseBlacklistAppeal(nonReentrant, checks-effects-interactions, sametoken.burn) which already pass both onmain, so no new finding class is expected — CI runs them definitively.Refs #688.
Summary by CodeRabbit
New Features
Bug Fixes
Tests