Skip to content

node: origin deny-set follow-ups from the #1380 review #1398

Closed

Description

@thiras

Deferred non-blocking findings from the multi-agent review of #1380. The blocking set landed in 6edc7b2f; these are the remainder.

1. drop_origin_peer's retry signal is inert

blacklist_watcher.rs returns Recheck::Failed on a nodeIdOf RPC error, which clears last_rescan to "pull the next pass forward". But rescan iterates distinct_hashes() — it has no origin leg, so the failed peer removal is never re-attempted at any cadence. The doc comment describes a retry that does not happen.

Either carry a pending_peer_drops: HashSet<Address> on WatcherState and drain it in on_tick_complete, or return Recheck::NoAction and delete the claim. As written it pays for a retry mechanism and gets none of it — plus a transient blip costs a full deny-set re-scope against the RPC endpoint that just failed.

2. set_origin fails open on a durable-write error

self.store.insert_blacklist_origin(origin.into())?;   // <-- `?` skips the line below
self.denylist.apply_chain_origin(origin, blacklisted);

A store error skips the in-memory apply entirely, so the node keeps serving the newly-blacklisted origin until a later tick succeeds. The doc three lines above argues the opposite policy ("over-denying a de-listed origin is a service complaint; under-denying a listed one is a compliance failure"). Applying in-memory first costs nothing: the tick still aborts, the cursor still holds, and an unpersisted entry is simply lost on restart — identical to today.

3. isOriginBlacklisted is dead ABI

Declared in the sol! block with the rationale "read at boot to reconcile the deny-set"; nothing calls it. Two doc comments promise the reconcile and store.rs correctly argues it is impossible (nothing enumerates the set on-chain). The content_deny.rs doc was corrected in 6edc7b2f; the ABI entry and the content_blacklist.rs comment remain.

Concretely this matters for emergency origins: isOriginBlacklisted honours auto-expiry in the view, but expiry emits no event until someone calls the permissionless expireEmergencyOrigin, so an event-tail-only projection over-denies a lapsed emergency origin indefinitely. That is the conservative direction, so not urgent — but either wire a per-restored-address eth_call reconcile or drop the declaration.

4. ClientHandlerDeps.content_deny fails open by omission

The field is pub and new() seeds it to an empty deny-set, so a construction site that forgets to wire it is indistinguishable from an operator who denies nothing. The doc argues against Option on the grounds that it "would only add a way to fail open" — but the current shape is the silent fail-open. Make it a required parameter of new(); the function already carries #[allow(clippy::too_many_arguments)].

5. In-flight streams are not terminated on a takedown

ADR 011 § On Blacklist Event: "In-flight streams for a blacklisted hash are terminated at the next MB boundary. The client receives a HashBlacklisted error." deliver has a natural voucher-boundary hook and consults nothing. Note the ADR clause is not satisfiable as written — HashBlacklisted is classified delivery-side, so StreamResponse::validate excludes it mid-stream. Pre-existing for the governance path too; needs either an implementation or an ADR amendment.

6. Peer-table re-entry for the origin-only path

Carried over from the original PR. PeerTable::remove is advisory; re-entry is closed only for addOperator (ejection drops the operator from the announce gate's staked set). setOriginBlacklist / emergencyAddOrigin do not eject, so that peer re-enters on its next announce. Closing it needs an origin deny-set inside decdn_gossip's AnnounceGate. removed_peer_is_readmitted_by_its_next_announce pins the gap.

7. cache.pinned_hashes ∩ content.denied_hashes is unreconciled

A hash in both is held forever by the pin (excluded from LRU eviction) while the serve gate refuses it — arguably the worst combination on a takedown. resolve_config already has the cross-section-check precedent (ensure_region_when_publishing_global_into). Cheap error or warning naming both keys.

8. Smaller

  • DeniedHashes::diff / ::contains are dead; the reload delta is computed in CacheEngine::set_denied. Pick one.
  • PinDiff is now returned by a deny path; rename to HashSetDiff or accept the wart.
  • parse_denied_origins reuses parse_nonzero_address, whose error says "set it to the deployed contract address" — wrong advice for an operator EOA denylist.
  • e2e: no origin_blacklist_compliance journey. Needs setOriginBlacklist added to the sol! write surface plus a ChainFixture helper. This is also the only thing that would catch future ABI drift in the newly hand-written origin declarations.

🤖 Generated with Claude Code

Activity

  1. added
    rust
    on Jul 22, 2026
  2. self-assigned this
    on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

rust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions