Skip to content

node: dead/redundant watcher surface after #1110 — subscribe_changes and the node_address_watcher_* gauges #1231

Closed

Description

@thiras

Two pieces of surface that #1110 either revealed or made redundant. Both are small; grouped because they're the same kind of cleanup and each needs a judgement call rather than a mechanical delete.

1. StakerSet::subscribe_changes has zero production consumers

ChainStakerSet maintains a broadcast::Sender<StakerChange> (capacity 128) and republishes on every membership change. The only call site of subscribe_changes in the whole repo is a unit test of ConfigStakerSet (dht/staker_set.rs). Nothing in production subscribes.

So changes_tx is dead weight kept alive by the trait method. Removing it drops changes_tx, CHANGES_CHANNEL_CAPACITY, StakerChange, a trait method, and a test.

Judgement call: is this a planned extension point (something should be reacting to membership changes and doesn't yet), or genuinely unused? If the former, the gap is the bug, not the channel.

2. node_address_watcher_* is now perfectly correlated with staker_set_watcher_*

Before #1226 these tracked two independent loops. They now describe one shared capacity-bond loop, so node_address_watcher_{restarts_total,down_seconds,cycle_established} move in lockstep with their staker-set counterparts whenever pull-through is enabled — one loop's health reported twice.

#1226 deliberately kept both (gated on the bindings projection existing) rather than retire one, because freezing node_address_watcher_down_seconds at 0 forever would be an alert that can never fire — silently worse than deleting the family.

Judgement call: retiring the family is dashboard/alert-breaking, so it needs whoever owns the Grafana config. The alternative is to keep both and document the correlation (already noted in chain_staker_set's module doc).

Follow-up from #1110 / #1226.

Metadata

Metadata

Assignees

Labels

prio:lowrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions