Repository navigation
Description
Follow-up from the review of #1291 (merged). Refs #1181.
#1291 made every appeal-driven suspended toggle bump _blacklistVersion via the _setEntrySuspended choke point, and added tests for the suspend path (fastTrackBlacklistAppeal) and one resume path (reverseBlacklistAppeal). The other write sites have no version assertion.
Nothing is broken today — because every toggle funnels through the one helper, the unasserted paths are structurally correct. The gap is regression coverage: a future direct suspended = ... write bypassing the helper would not be caught, and that is exactly the pre-#1291 state of the code, so it is a realistic regression.
Complete write-site enumeration
| Site | Line | Direction | Version asserted |
|---|---|---|---|
fastTrackBlacklistAppeal |
665 | suspend | yes |
rejectBlacklistAppeal |
673 | resume | no |
rejectAppealAsPerjury |
704 | resume | no |
reverseBlacklistAppeal |
747 | resume | yes |
cleanupExpiredBlacklistAppeal |
808 | resume, guarded if (!entryGone) |
no |
_addHash |
887 | resume-by-re-add | folded into the add bump (correct) |
Work
Each fix is 1-2 lines in a test that already builds the scenario:
-
test_reverseAppeal_clearsSuspendedAndBurnsBond(:362) and the reject-path test (:350) -
test_rejectAppealAsPerjury_fastTracked_unsuspendsAndReleasesCap(~:956) -
cleanupExpiredBlacklistAppealis the priority — it is the only conditional bump site in the contract and neither branch is covered, so a regression that hoists the bump out of theifis currently invisible:!entryGone(RatificationTimeout lapse on a fast-tracked appeal) — must bump. This is a resumption where enforcement re-arms on a timeout with no governance action at all: the most operationally likely resume path in production, and the one a node is least likely to be watching for.entryGone(GlobalOverride, condition c) — must not bump; the removal already bumped, and a second bump is a wasted fleet-wide delta fetch. Existing tests already construct this scenario, so the assertion is nearly free.
The durable invariant
Worth stating in the suite: every test that asserts suspended changed should also assert the version moved. Asserting the flag alone is precisely what let the original missing-bump bug through — the pre-#1291 code had five independent direct suspended writes and no test tied any of them to a shared invariant.
Verify each new assertion the way the #1291 ones were: remove the bump from the path under test and confirm the assertion fails.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity