Skip to content

feat(contracts): add per-(filer,region) concurrent fast-track cap alongside region ceiling (#688) #1015

Closed

Description

@alpergundogdu

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 + a FILER_CONCURRENT_RELIEF_CAP constant.
  • 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 the RegionalCapHit error doc.
  • Accounting symmetry — mirror the existing regionActiveReliefCount sites exactly:
    • Increment both counters in fastTrackBlacklistAppeal (check the new per-filer cap there too → new FilerReliefCapHit(filer, cap) error).
    • Decrement both, with the same != 0 guard, in all four finalizers: rejectBlacklistAppeal, ratifyBlacklistAppealRemoval, reverseBlacklistAppeal, cleanupExpiredBlacklistAppeal. Key the per-filer decrement on a.filer.
  • 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions