Skip to content

feat(contracts): enforce ADR 030 region-staleness ripening predicate (eject on stale regionLastChanged) #758

Closed

Description

@yigitdot

Context

Spun out of #689 (ADR 030 updateRegion e2e). While wiring the full registerNode → updateRegion → ejectNode test against the production Ed25519Verifier, we confirmed that the region-staleness ripening predicate is not yet enforced on-chain.

CapacityBond stores regionPrev / regionLastChanged but, per the contract's own // Storage — region attestation (ADR 030) comment:

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.

ejectNode is purely BLACKLIST_ROLE-gated and has no linkage to regionLastChanged. So the #689 scope item "cover the cross-contract ejectNode path triggered when regionLastChanged falls outside the attestation window" describes behavior that does not exist yet. #689 instead covers the eject path that exists today (BLACKLIST_ROLE eject bumps registrationNonce, invalidating a replayed registration signature).

Scope

  • Implement the ADR 030 § 52 blacklist-scope ripening predicate: a node is in scope iff the entry is global, OR entry.region == regionHint, OR (block.timestamp - effective < REGION_STABILITY_WINDOW AND entry.region == regionPrev) — consulting regionPrev / regionLastChanged at scope-test / slash-eligibility time.
  • Add the e2e leg deferred from test(contracts): full ADR 030 updateRegion e2e — EIP-712 + ed25519 registerNode signing harness #689: eject (or slash-eligibility) triggered when regionLastChanged falls outside the stability window, driven by the CapacityBondRegionE2E.t.sol registration harness.

References

Activity

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

    @github-actions

    🎯 Triage report

    This issue implements the deferred ADR 030 § 52 region-staleness ripening predicate in ContentBlacklist's scope test, wiring it to CapacityBond's existing regionPrev/regionLastChanged storage. It also adds the e2e Foundry test leg (stale-region → slash-eligibility/eject) that was explicitly deferred from #689. The contract storage is already in place; this is purely the enforcement logic and corresponding test coverage.

    📊 Assessment

    Dimension Value Reasoning
    Type Feature New on-chain enforcement logic that does not exist yet (the storage slots are present but unread).
    Labels enhancement, technical, testing Solidity feature addition + cross-contract scope-test logic + new Foundry e2e harness; technical already applied.
    Coding agent Suitable Scope is precisely defined (ADR 030 § 52 predicate verbatim), the parent harness exists in CapacityBondRegionE2E.t.sol (#689), and the contract storage slots are already named. Success criteria are concrete and testable.

    🔗 Similar issues

    💡 Notes and suggestions

    Implementation checklist:

    • In ContentBlacklist.sol: update the scope-test function to consult CapacityBond.regionPrev and regionLastChanged — a node is in scope iff: (a) entry is GLOBAL, (b) entry.region == regionHint, OR (c) block.timestamp - effectiveTimestamp < REGION_STABILITY_WINDOW && entry.region == regionPrev.
    • Expose a read function (or extend an existing one) on CapacityBond to surface regionPrev/regionLastChanged to ContentBlacklist, or pass them as call args if the cross-contract call pattern is already established.
    • Decide and document whether slash-eligibility check is a separate code path from the eject path, or unified — ADR 030 § 52 says "scope-test / slash-eligibility time", implying shared predicate.
    • In CapacityBondRegionE2E.t.sol: add time-warp scenarios — (a) regionLastChanged within window → node in scope for old region; (b) regionLastChanged outside window → node not in scope for old region, eject/slash reverts or is ineligible.
    • Verify CI flags: --deny warnings under FOUNDRY_PROFILE=ci will catch any unreachable code introduced by always-reverting branches; forge fmt must pass; slither/aderyn must not emit new medium/high findings.

    Key constants to pin down: REGION_STABILITY_WINDOW value — check whether ADR 030 or an existing contract constant already defines it, or if it needs to be added as a governable parameter.

    Cross-contract call note: ContentBlacklist reading from CapacityBond introduces a new inter-contract dependency path; confirm it's not circular and that the interface is already declared (or add it).

    Generated by Agentic Triage for issue #758 · sonnet46 529.7K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:featurekind:test

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions