Repository navigation
Closed
Description
Sub-issue of #688. Mechanism D — per-(filer, region) concurrent fast-track cap. Complexity M. Independent of B/C.
Problem
The concurrent interim-relief cap is currently keyed on region alone: mapping(bytes32 region => uint256) regionActiveReliefCount, ceiling BODY_CONCURRENT_APPEAL_CAP = 3, counting only fast-tracked appeals. The constant name says "body" but enforcement is purely per-region (ADR-031 §90 justifies this under a one-body-per-region assumption). #688 wants a per-requesting-party cap so a single adversarial filer cannot monopolize all of a region's fast-track relief slots.
Decision (resolved)
- "Requesting body" is interpreted as the filer, not the regional governance body. A per-(filer, region) cap is a meaningful anti-monopolization control and does not contradict ADR-031 §90 (that argument is about governance bodies).
- Retain the existing per-region global ceiling as a second backstop, AND add a per-(filer, region) sub-cap. Both counters coexist. (Rationale: the region ceiling is already built + tested; removing working safety to save one counter isn't worth the regression risk.)
- Cap value stays a fixed constant (no governance setter).
Solution / scope (ContentBlacklist.sol)
- Add
mapping(bytes32 region => mapping(address filer => uint256)) filerRegionActiveRelief+ aFILER_CONCURRENT_RELIEF_CAPconstant. - Rename
BODY_CONCURRENT_APPEAL_CAP→ a region-scoped name (e.g.REGION_CONCURRENT_RELIEF_CAP) to kill the misleading "body" name; update the docstring at the top of the file and theRegionalCapHiterror doc. - Accounting symmetry — mirror the existing
regionActiveReliefCountsites exactly:- Increment both counters in
fastTrackBlacklistAppeal(check the new per-filer cap there too → newFilerReliefCapHit(filer, cap)error). - Decrement both, with the same
!= 0guard, in all four finalizers:rejectBlacklistAppeal,ratifyBlacklistAppealRemoval,reverseBlacklistAppeal,cleanupExpiredBlacklistAppeal. Key the per-filer decrement ona.filer.
- Increment both counters in
- Add a public getter for the per-filer counter.
Test plan (test/ContentBlacklist.t.sol)
- One filer hits the per-filer cap while the region still has global headroom (gets
FilerReliefCapHit). - Two different filers each fast-track up to the region ceiling (per-filer cap doesn't block, region ceiling does).
- Every exit path decrements the per-filer counter (symmetry: a filer freed by reject/ratify/reverse/cleanup can fast-track again).
ADR reconciliation
Update ADR-031 §90 to describe the as-built two-tier model (region ceiling + per-filer sub-cap) and correct the "region key is sufficient" claim.
Agent-suitable: yes. Do NOT land simultaneously with C2 (#688) — shared exit-path accounting sites.
Reacted by github-actions
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Priority
None yet
Activity
docs(contracts): mark ADR-031 as target spec vs as-built (PR review)
docs(contracts): reconcile ADR-031 mechanical drift to as-built Conte…
perf(contracts): cache region/filer in fastTrackBlacklistAppeal (#1015 …
docs(adr): release "the relief slot" not "the body's slot" in unFastT…
docs(adr): finish per-body cap reconciliation in ADR-011 (#1015 review)
docs(adr): reconcile ADR-011 concurrent-relief cap to the two-tier mo…