Repository navigation
Description
Summary
ContentBlacklist.getBlacklistVersion() (added in #1291) bumps on hash add/remove and appeal suspend/resume, but not on setOriginBlacklist. PR #1291 also added test_getBlacklistVersion_unaffectedByNonEntryOperations, which asserts origin blacklisting does not move the counter — locking that choice in. This contradicts ADR 011 as currently written, so the spec and the implementation need to be reconciled one way or the other. Flagged during the #1291 review.
The inconsistency
ADR 011 (adr/011-content-takedown.md) says origins are part of the version mechanism:
§ Interface(lines 111–112):OriginBlacklisted(address indexed operatorAddress, uint256 indexed version, string reason)andOriginRemoved(..., uint256 indexed version)— both carry an indexedversion.§ Blacklist version(line 143): "incremented on every add/remove operation across all paths."§ Polling(line 509): "Delta fetching relies on contract event logs:HashBlacklistedandOriginBlacklistedevents include an indexedversionfield, enabling efficienteth_getLogsqueries filtered by version range." A node only fetches deltas when the version advances — so if origin changes don't bump it, an origin blacklist/removal is invisible to the poll.
The implementation already diverges from that:
ContentBlacklist.sol:445setOriginBlacklistdoes not touch_blacklistVersion.- It emits
OriginBlacklistUpdated(address indexed origin, bool blacklisted)(ContentBlacklist.sol:292) — a single toggle event with noversionfield, not the ADR'sOriginBlacklisted/OriginRemovedpair. So the origin event model had already drifted from ADR 011 before feat(contracts): add ContentBlacklist.getBlacklistVersion() monotonic counter #1291. contracts/test/ContentBlacklist.t.sol:179(test_getBlacklistVersion_unaffectedByNonEntryOperations, origin case at :188) now asserts the no-bump behavior.
Why it's not a live bug today (but still needs resolving)
Origin blacklist enforcement does not currently ride the node's blacklist version-poll:
crates/node/src/blacklist_watcher.rshas zero references to origins — it only tracks hash entries.- Per ADR 011 lines 490/497, origin enforcement flows through
OriginAssignment: off-chain consumers cross-referenceContentBlacklist.isOriginBlacklisted(operator)at selection time, and stale entries are cleaned up lazily/permissionlessly viaOriginAssignment.pruneBlacklistedAssignment.
So nothing breaks right now. But the ADR-described version-delta path (the node half deferred by #1181) would silently skip origins if it were built to the current § Polling text, and the spec/impl/test currently disagree.
Decision needed (pick one, then align the other artifacts)
Option A — code is right, ADR is stale (looks most likely). Origins are enforced via OriginAssignment cross-reference, not the hash version-poll. If so:
- Correct ADR 011
§ Polling(line 509) to stop listingOriginBlacklistedamong the version-range-fetched events. - Correct the
§ Interfaceevents (lines 111–112) to match the shippedOriginBlacklistUpdated(origin, bool)with noversionfield, and tighten§ Blacklist version(line 143) "across all paths" to mean hash entries + suspend/resume only. - Keep the test; maybe rename its intent comment to state the exclusion is deliberate per the corrected ADR.
Option B — ADR is right, code is incomplete. Origins belong in the version mechanism. If so:
- Bump
_blacklistVersioninsetOriginBlacklist. - Emit versioned
OriginBlacklisted/OriginRemovedevents (ABI change; ripples into the Rust decoder). - Flip the origin assertion in
test_getBlacklistVersion_unaffectedByNonEntryOperations.
Either way, the goal is that adr/011-content-takedown.md, ContentBlacklist.sol, and the test tell the same story. ADR is the source of truth (per CLAUDE.md), so if Option A is chosen the ADR must be edited to reflect reality rather than left contradicting the code.
References
- Parent: ContentBlacklist: add
getBlacklistVersion()counter + delta sync #1181 (this is a spin-off; ContentBlacklist: addgetBlacklistVersion()counter + delta sync #1181 tracks the node delta-sync half) - Contract PR: feat(contracts): add ContentBlacklist.getBlacklistVersion() monotonic counter #1291
adr/011-content-takedown.mdlines 111–112, 143, 490, 497, 509contracts/src/ContentBlacklist.sol:292,:445contracts/test/ContentBlacklist.t.sol:179
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
fix(contracts): no phantom blacklist version bump on removed-mid-appe…
thiras commentedon Jul 20, 2026
Resolved by #1326 (
4a527b1), which took Option A — code is right, ADR was stale.Verified on
main:setOriginBlacklist(ContentBlacklist.sol:464) still does not touch_blacklistVersion; it emitsOriginBlacklistUpdated(origin, blacklisted)with no version. The counter bumps only in_addHash,_removeHashRegional, and_setEntrySuspended.OriginBlacklistUpdated(address indexed operatorAddress, bool blacklisted)in place of the never-implemented versionedOriginBlacklisted/OriginRemovedpair.OriginAssignmentcross-reference, so a delta-fetcher built to that text no longer skips origins.test_getBlacklistVersion_unaffectedByNonEntryOperationskeeps its origin no-bump assertion, now matching the corrected ADR rather than contradicting it.ADR, contract, and test tell the same story.