Repository navigation
Description
Problem
The blacklist compliance watcher (crates/node/src/blacklist_watcher.rs) is the only one of the six LogSink watchers with no health observability. Unlike slash / reputation-indexer / capacity-bond / origin-directory — each of which wires on_established(metric_hook(&metrics, Metrics::<name>_watcher_cycle_established)) and on_backoff(metric_hook(&metrics, Metrics::<name>_watcher_backoff_started)) — blacklist wires neither. A grep for metric_hook|on_backoff|on_established|Metrics in blacklist_watcher.rs returns nothing.
This became more acute in #1282 (#1236): blacklist moved off the runtime tasks JoinSet — whose shutdown-drain log_join_result used to surface a task panic at warn! — onto a detached resumable_watcher::spawn(...) / AbortOnDrop, whose JoinHandle is never awaited. So a panic in the blacklist task is now discarded silently, and there is no metric to reveal a wedged/backing-off loop either.
Why it matters: a dead blacklist loop means the node keeps serving content that is blacklisted after the failure (the module header calls this "the node's only local protection against the slash for serving blacklisted content") with nothing in logs or metrics. The realistic risk is low — a genuine Rust panic is unlikely under the workspace anti-panic clippy policy, and RPC errors are already logged by the poll loop's backoff — but the observability gap is real and blacklist alone lacks the metric seam its five peers have.
Proposed fix
Give blacklist the same watcher-health surface as the other five:
- Add a
blacklist_watcher_cycle_establishedcounter/gauge andblacklist_watcher_backoff_startedtocrates/node/src/metrics.rs, extending the existing watcher downtime-recorder macro family (the one refactor(node): collapse the 6 watcher backoff/cycle recorders into a second macro family #1266 collapsed the six recorders into). - Wire them in
blacklist_watcher::spawnvia.on_established(metric_hook(&metrics, ...))/.on_backoff(metric_hook(&metrics, ...)), which means threading anArc<Metrics>intospawn(currently not passed) and the runtime call site (runtime/mod.rs).
Optionally, also restore panic visibility for the detached task (e.g. a thin supervisor that logs on unexpected exit), though the metric hooks are the higher-value, lower-cost piece and bring blacklist to parity with its peers.
Context
Follow-up from #1282 (issues #1255 / #1236). Surfaced by the silent-failure review agent during that PR. Reference: crates/node/src/blacklist_watcher.rs, crates/node/src/metrics.rs, crates/node/src/runtime/mod.rs (blacklist spawn site).
Risk
Low — additive observability; touches the metrics macro family, one spawn signature, and one runtime call site.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
feat(node): uniform watcher liveness, panic, and enforcement observab…
thiras commentedon Jul 19, 2026
Resolved by #1325 (merged to
mainas 0b5ce92), which addressed the blacklist watcher lacking health metrics (now at full parity with its five peers) as part of the uniform six-watcher observability batch.