Skip to content

ContentBlacklist: add getBlacklistVersion() counter + delta sync #1181

Closed

Description

@alpergundogdu

Disposition: IMPLEMENT (ADR 011/019 §3.2).

No version counter/enumeration view, so nodes must replay full event history from genesis on every restart instead of an O(1) version check + bounded delta (contracts/src/ContentBlacklist.sol, crates/node/src/blacklist_watcher.rs).

Action: add a monotonic getBlacklistVersion() (incremented on add/remove) and switch the node's Step-3.2 sync to version-poll + delta fetch.


Filed from the ADR→implementation gap analysis. ADR edits must be made in place with no historical/tombstone text (no "planned but cut" sentences) per repo ADR convention.

Activity

  1. added
    prio:medium
    rust
    area:contracts
    on Jul 15, 2026
  2. yigitdot commented on Jul 18, 2026

    @yigitdot
    Contributor

    Triage note for a later run: automated dispatch skipped this because it mandates both halves and the node half conflicts with a pinned decision.

    The contract half alone would be a clean task: a uint256 blacklistVersion bumped in _addHash/_removeHashRegional plus a view (~20 LOC in contracts/src/ContentBlacklist.sol).

    The node half is the blocker. crates/node/src/blacklist_watcher.rs deliberately encodes the opposite design — its module header and the test cursor_start_is_full_replay_never_persisted are marked "COMPLIANCE PIN: the blacklist watcher must full-replay from the deploy floor." Delta sync only pays off with a persisted last-seen version, and neither this issue nor ADR 011 §Polling says where that cursor lives or how to retire the compliance pin.

    Suggested split: re-scope this issue to contract-only, and file the node-side delta sync separately once the compliance-pin question is decided. As written it is also well over 300 lines (an indexed version field ripples through the event ABI and the Rust decoder).

  3. self-assigned this
    on Jul 18, 2026
  4. yigitdot commented on Jul 18, 2026

    @yigitdot
    Contributor

    Dispatched the contract half only, per the triage note above. PR incoming; it will use Refs #1181, not Closes, so this issue stays open for the node-side delta sync.

    Scope shipped: a monotonic uint256 version counter bumped in _addHash (ContentBlacklist.sol:847) and _removeHashRegional (:863) — the two internal choke points every add/remove path funnels through (_addHash from :370, :383; _removeHashRegional from :387, :395, :706) — plus the getBlacklistVersion() view. No indexed version field added to existing events, since that ripples through the event ABI and the Rust decoder.

    Still open here: the node-side version-poll + delta fetch. It remains blocked on the question the triage note raises — crates/node/src/blacklist_watcher.rs carries a "COMPLIANCE PIN: the blacklist watcher must full-replay from the deploy floor" marker plus the test cursor_start_is_full_replay_never_persisted enforcing it. Delta sync only pays off with a persisted last-seen version, and neither this issue nor ADR 011 §Polling says where that cursor lives or on what terms the compliance pin can be retired. That decision is the remaining blocker.

  5. yigitdot commented on Jul 18, 2026

    @yigitdot
    Contributor

    Contract half shipped in #1291. Issue stays open for the node-side delta sync.

    Two things the implementation surfaced that affect what's left here.

    1. ADR 011 already specifies getBlacklistVersion() — it's declared in the interface at adr/011-content-takedown.md:106 and its semantics are §Blacklist version (:141). So this was a pure implementation gap, not a spec gap; no ADR edit was needed or made.

    2. ADR 011 contradicts itself on whether suspend/resume bumps the counter. Verified:

    • :141 (narrow reading) — "a monotonically increasing counter incremented on every add/remove operation across all paths."
    • :248 and :325 (broad reading) — both state operators detect appeal resumption via "the standard getBlacklistVersion() polling cycle (default 10 minutes)."

    Those can't both hold. Suspension flips isBlacklisted/isBlacklistedInRegion to false and resumption flips them back — node-visible state that is neither an add nor a remove. Under the narrow reading the version never moves across a suspend/resume, so a polling node has no signal and :248/:325 are simply wrong about how resumption is detected.

    #1291 implements the narrow reading (the scope it was given), documents that choice in NatSpec, and pins it with a test — so the behavior is explicit rather than accidental. But this needs settling, and it is squarely part of the node half rather than the contract half: if the broad reading wins, the bump belongs at the suspended write sites and the node's delta-sync must treat a version advance as possibly meaning "an entry became un-blacklisted," not only "an entry was added or removed."

    That interacts directly with the blacklist_watcher.rs compliance-pin question already blocking this issue, so the two are probably best decided together: (a) does suspend/resume bump the version, (b) where does the persisted last-seen-version cursor live, and (c) on what terms can the full-replay compliance pin be retired. All three shape the same delta-sync design.

  6. yigitdot commented on Jul 18, 2026

    @yigitdot
    Contributor

    Review follow-ups from #1291 (contract half, merged) — filed as four issues:

    #1300 and the node-side cursor decision here should be settled together — retiring the blacklist_watcher.rs COMPLIANCE PIN and defining what a delta fetch actually reads are the same design question.

  7. yigitdot commented on Jul 18, 2026

    @yigitdot
    Contributor

    Correction to my previous comment: #1300 originally duplicated the origin-blacklist leg already filed as #1296. I've narrowed #1300 to the hash side (missing indexed version on HashBlacklisted/HashRemoved, and suspend/resume emitting no entry event at all) and pointed it at #1296 for origins.

  8. assigned and unassigned on Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:contractsprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions