Skip to content

ContentBlacklist: events carry no indexed version, so ADR 011 § Polling delta fetch is not implementable #1300

Closed

Description

@yigitdot

Follow-up from the review of #1291 (merged). Refs #1181 — this blocks the node half of that issue.

Scope note: the origin-blacklist leg of this was already filed as #1296 (with more detail, including that origin enforcement flows through OriginAssignment rather than the version poll). This issue covers the hash side only; see #1296 for origins.

#1291 shipped getBlacklistVersion(), which answers "did anything change?" in O(1). It does not yet let a node answer "what changed?" — the piece that actually eliminates the full replay.

1. Entry events carry no version field

ADR 011 § Polling (adr/011-content-takedown.md:509) specifies:

Delta fetching relies on contract event logs: HashBlacklisted and OriginBlacklisted events include an indexed version field, enabling efficient eth_getLogs queries filtered by version range.

and the ADR interface at :109-110 declares uint256 indexed version on HashBlacklisted and HashRemoved.

The implemented events (ContentBlacklist.sol:286-287) are HashBlacklisted(bytes32 indexed region, bytes32 indexed hash, string reason) and HashRemoved(bytes32 indexed region, bytes32 indexed hash) — no version. So a node cannot resolve a version range to a set of changes; it must fall back to block-range scanning from the deploy block, which is the cost this counter exists to remove.

2. Suspend/resume advances the version but emits no entry event at all

Sharper than the missing field, and specific to what #1291 added. _setEntrySuspended emits nothing; the only logs are the appeal events (BlacklistAppealFastTracked / ...Rejected / ...Reversed / ...Lapsed). So even once version-indexed entry events land, a delta-fetcher keyed on HashBlacklisted/HashRemoved as § Polling describes sees the version move with no matching log, and either concludes nothing changed — silently under-enforcing a resumed hash, the exact compliance failure the poll cycle exists to prevent — or falls back to a full re-sync.

A node could derive the delta from the appeal events, but that is a second log source the ADR does not describe. Whatever is chosen, § Polling needs to say it.

Why this was excluded from #1291

Deliberate, and stated in that PR's description: adding an indexed version is an event-ABI change that ripples into the Rust decoder. The node delta-sync half of #1181 is already deferred — crates/node/src/blacklist_watcher.rs carries a COMPLIANCE PIN requiring full replay from the deploy floor, and the test cursor_start_is_full_replay_never_persisted pins it — so nothing consumes the counter yet and there is no live breakage.

Sequencing note: this issue, #1296, and the node-side cursor decision in #1181 should be settled together — retiring the compliance pin and defining what a delta fetch actually reads are the same design question.

Activity

  1. added
    kind:feature
    design:adr
    prio:medium
    area:contracts
    on Jul 18, 2026
  2. yigitdot commented on Jul 18, 2026

    @yigitdot
    ContributorAuthor

    Deferred from the #1297/#1298/#1299 batch (#1304) rather than folded in. Two findings from that pass that the joint #1296 + #1181 design should start from:

    1. The ADR/impl event divergence is wider than this issue describes. It is not just a missing version field — the declared and shipped events are structurally incompatible:

    adr/011-content-takedown.md:109-110 ContentBlacklist.sol:288-289
    HashBlacklisted (bytes32 indexed blake3Hash, uint256 indexed version, uint256 effectiveAt, string region, string reason, bool emergency) (bytes32 indexed region, bytes32 indexed hash, string reason)
    HashRemoved (bytes32 indexed blake3Hash, uint256 indexed version, string region) (bytes32 indexed region, bytes32 indexed hash)

    Different topic0, and topic1 carries the opposite meaning (ADR: hash; impl: region). effectiveAt/emergency/string region do not exist on-chain at all. So reconciling § Interface is not an additive field change — it is the same rewrite #1296 is already scoped to, which is why these should land together rather than piecemeal.

    (Related: ADR 031:241's "HashBlacklisted already indexes the hash" is true of the implementation, but in a different topic slot than ADR 011 states.)

    2. The under-enforcement risk in §2 is not live today. Worth recording so the compliance-pin decision isn't made against a phantom urgency: crates/node/src/blacklist_watcher.rs:19-25 retains seen-but-unevicted entries in known — including suspended and out-of-scope ones — and re-scopes the whole set on every on_tick_complete pass, explicitly because an appeal reversal/lapse or a CapacityBond.updateRegion emits no ContentBlacklist event. A resume is therefore caught by the re-scope pass, not silently missed. The cost of the missing entry event is re-scope latency and a full-replay boot, not a compliance gap.

    The single Rust decode site, for whenever the ABI does change: crates/incentive/src/content_blacklist.rs:91,94 (the sol! block), consumed by blacklist_watcher.rs at :71,274,275,362,365,386,401 and re-exported to e2e via crates/e2e/src/bindings.rs:32. No TS or checked-in ABI JSON declares these events.

    One behavior change from #1304 that touches this issue's premise: _setEntrySuspended now no-ops (no version bump) when the entry was removed mid-appeal, so a future delta-fetcher will not see version advances with no corresponding state change from that path.

  3. yigitdot commented on Jul 19, 2026

    @yigitdot
    ContributorAuthor

    An independent review of #1304 reached §2 of this issue from a different direction, which I think strengthens the case here.

    Reviewing the _setEntrySuspended guard for silent-failure patterns, the finding was: suspend/resume is invisible to any log-only indexer, and after #1304 it is not fully visible via the counter either. A no-op resume (entry removed mid-appeal) now produces an unchanged version and no event — identical, from outside, to nothing having happened. The only discriminator is an earlier HashRemoved, which requires the observer to have maintained full entry lifecycle state.

    The suggested resolution was the one this issue is already circling:

    event HashSuspensionChanged(bytes32 indexed region, bytes32 indexed hash, bool suspended);

    emitted from the choke point. That collapses the whole class — a real toggle is an event, a no-op is the absence of one — without any consumer having to reason about counter semantics, and it gives log-replay indexers parity with the eth_call re-scope the Rust watcher does today.

    Worth noting for whoever picks this up: it is cheap (one log on an already-warm path) and, unlike the uint256 indexed version field on HashBlacklisted/HashRemoved, it is purely additive — no existing topic0 changes, so it does not touch the sol! bindings' decode path for the two events the watcher already filters on. It could land ahead of, and independently of, the ABI reconciliation this issue is blocked on.

    One correction to my earlier comment's framing while I'm here: I said the watcher's re-scope pass means the missing event costs only latency. That holds, but it is worth being precise that crates/node/src/blacklist_watcher.rs does not consume getBlacklistVersion() at all — the only reference to it anywhere in crates/ is a comment in crates/common/src/config/mod.rs. So the NatSpec and ADR text describing operators detecting resumption "off the getBlacklistVersion() poll cycle" currently describes a consumer that does not exist. That does not make the docs wrong as a spec, but it does mean nothing today would catch the counter being wrong — another reason the event is the more robust signal.

  4. self-assigned this
    on Jul 19, 2026
  5. thiras commented on Jul 20, 2026

    @thiras
    Contributor

    Resolved by #1326 (contract) and #1330 (node).

    Both halves this issue raised are closed:

    1. Entry events carry no version — fixed. HashBlacklisted and HashRemoved now carry the post-change version (ContentBlacklist.sol:299,302).

    One deliberate deviation from the ADR text this issue quoted: version is non-indexed. EVM topic filters match by set membership, not range, so an indexed version would not have enabled the "eth_getLogs filtered by version range" the ADR promised. The delta fetch keys on a block range from the persisted cursor and uses version to order and gap-check. ADR 011 § Polling was rewritten to describe that rather than a query the EVM cannot serve.

    2. Suspend/resume advanced the version but emitted no event — fixed by the new HashSuspensionUpdated(region, hash, version, suspended), emitted from the _setEntrySuspended choke point (:982). Every _blacklistVersion bump now has exactly one matching log, so a delta consumer can never see the counter move with no event.

    The node consumes it in #1330: a resume re-checks scope immediately instead of waiting out the rescan cadence.

    The sequencing note asked that this settle together with #1296 and the #1181 cursor decision — #1296 closed alongside, and #1181 is handled in #1331.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:contractsdesign:adrkind:featureprio:medium

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions