You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(contracts): enforce ADR 030 region-staleness ripening predicate (eject on stale regionLastChanged) #758
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.
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).
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.
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).
Activity
github-actions commentedon Jun 1, 2026
🎯 Triage report
This issue implements the deferred ADR 030 § 52 region-staleness ripening predicate in
ContentBlacklist's scope test, wiring it toCapacityBond's existingregionPrev/regionLastChangedstorage. 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
enhancement,technical,testingtechnicalalready applied.CapacityBondRegionE2E.t.sol(#689), and the contract storage slots are already named. Success criteria are concrete and testable.🔗 Similar issues
CapacityBondRegionE2E.t.solharness and deferred this exact enforcement leg; feat(contracts): enforce ADR 030 region-staleness ripening predicate (eject on stale regionLastChanged) #758 is a direct spin-out, not a duplicate.💡 Notes and suggestions
Implementation checklist:
ContentBlacklist.sol: update the scope-test function to consultCapacityBond.regionPrevandregionLastChanged— 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.CapacityBondto surfaceregionPrev/regionLastChangedtoContentBlacklist, or pass them as call args if the cross-contract call pattern is already established.CapacityBondRegionE2E.t.sol: add time-warp scenarios — (a)regionLastChangedwithin window → node in scope for old region; (b)regionLastChangedoutside window → node not in scope for old region, eject/slash reverts or is ineligible.--deny warningsunderFOUNDRY_PROFILE=ciwill catch any unreachable code introduced by always-reverting branches;forge fmtmust pass; slither/aderyn must not emit new medium/high findings.Key constants to pin down:
REGION_STABILITY_WINDOWvalue — 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:
ContentBlacklistreading fromCapacityBondintroduces a new inter-contract dependency path; confirm it's not circular and that the interface is already declared (or add it).Add this agentic workflows to your repo
To install this agentic workflow, run