Skip to content

feat(contracts): ADR 030 enforcement — wire regionPrev/regionLastChanged into the blacklist-scope ripening predicate #761

Closed

Description

@yigitdot

Context

ADR 030 (§ 52 blacklist-scope / § Eligibility checks) defines a region-ripening predicate: a node is in scope for a blacklist entry iff the entry is global, OR entry.region == regionHint, OR (block.timestamp - effective < REGION_STABILITY_WINDOW AND entry.region == regionPrev). This keeps the previous region's entries — and slash exposure under them — applying until a region change has ripened, foreclosing reactive region-flip evasion.

CapacityBond already stores the inputs (regionPrev, regionLastChanged, updateRegion cooldown), but no contract reads them in this revision. Per the region-attestation storage doc (contracts/src/CapacityBond.sol:264-272):

No contract reads it in this revision — ContentBlacklist's scope test currently covers only GLOBAL ∪ region; the ripening leg lands with the ADR 030 enforcement PR.

This issue tracks that deferred enforcement PR.

Scope

  • Implement the ADR 030 § Eligibility ripening predicate against regionPrev / regionLastChanged, including the read-time effective = regionLastChanged != 0 ? regionLastChanged : max(firstBondedAt, regionGateActivatedAt) fallback and the one-time regionGateActivatedAt contract-global timestamp (ADR 030 § Region-stability window).
  • Wire it into ContentBlacklist's scope/slash-eligibility test (currently GLOBAL ∪ region only) and, where applicable, the appeals-standing path-2 check (ADR 011 § Standing).
  • Cover the resulting cross-contract behavior — in particular the eject/slash-eligibility path triggered when a region change has not yet ripened / falls outside the attestation window, which was the literal ask of test(contracts): full ADR 030 updateRegion e2e — EIP-712 + ed25519 registerNode signing harness #689 scope item 3 but had no production code to test.

Background

Split out of #689 / #760. The #689 e2e test (CapacityBondRegionE2E.t.sol) covers the existing blacklist-driven ContentBlacklist → CapacityBond.ejectNode cross-contract path and documents inline that the region-window-triggered eligibility is deferred here. Once this lands, extend that suite with the ripening-predicate assertions.

References

Activity

  1. added
    kind:feature
    prio:medium
    on Jun 1, 2026
  2. added
    kind:test
    on Jun 1, 2026
  3. github-actions commented on Jun 1, 2026

    @github-actions

    🎯 Triage report

    This is the deferred ADR 030 enforcement PR split out from #689/#760. It closes the gap between the regionPrev/regionLastChanged storage already in CapacityBond and the currently GLOBAL ∪ region-only scope test in ContentBlacklist. The three-leg ripening predicate must be wired into both the blacklist scope/slash-eligibility path and the ADR 011 appeals-standing path-2 check, plus the regionGateActivatedAt contract-global timestamp needs to be introduced. Scope is clearly bounded and well-referenced.

    📊 Assessment

    Dimension Value Reasoning
    Type Feature Net-new enforcement logic that doesn't exist on-chain yet
    Labels testing added (existing: enhancement, technical, medium) Issue explicitly calls for extending CapacityBondRegionE2E.t.sol with ripening-predicate assertions
    Coding agent Needs more info Predicate logic and storage pointers are well-defined; two gaps remain: (1) REGION_STABILITY_WINDOW value is not stated in the issue (must be read from ADR 030 directly), and (2) the appeals-standing path-2 wiring ("where applicable") is underspecified — it's unclear whether full standing-check propagation is in scope or only the eligibility flag

    🔗 Similar issues

    💡 Notes and suggestions

    Implementation checklist:

    • Introduce regionGateActivatedAt as a one-time-settable contract-global in CapacityBond (or ContentBlacklist?) — ADR 030 § Region-stability window specifies semantics; confirm which contract owns it
    • Implement effective read-time fallback: regionLastChanged != 0 ? regionLastChanged : max(firstBondedAt, regionGateActivatedAt)
    • Extend ContentBlacklist's scope predicate from GLOBAL ∪ regionHint to the three-leg form
    • Update slash-eligibility path to use the same predicate (or share a helper)
    • Clarify and implement ADR 011 § Standing path-2 — the issue flags it as "where applicable"; confirm with ADR 011 whether the ripening window affects standing gating or only eligibility
    • Extend CapacityBondRegionE2E.t.sol with: (a) in-window ripening — regionPrev entry still applies; (b) post-window — regionPrev entry no longer applies; (c) regionGateActivatedAt bootstrap edge case (first-ever bonded node, regionLastChanged == 0)

    CI gotcha: The scope test changes in ContentBlacklist touch slash-gating logic; run both forge test and slither/aderyn before opening the PR — the nonReentrant + always-reverting stub trap (see CLAUDE.md) is likely in this area.

    Dependency note: The e2e leg depends on the CapacityBondRegionE2E.t.sol harness from #689, which is itself blocked on #669 (IEd25519Verifier). The pure predicate-logic unit tests (no signature path) can ship independently; only the full cross-contract ripening e2e needs #689 to land first.

    Generated by Agentic Triage for issue #761 · sonnet46 613.7K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  4. self-assigned this
    on Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:featurekind:testprio:medium

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions