Skip to content

node: staker-set resync is cadence-driven only; no outage-triggered re-enumeration #1812

Closed

Description

@thiras

Follow-up to #1561, which asked for a "resync-on-extended-outage" path for the active-staker set.

That issue is closed by #1806, but the resolution was that a resync already exists and the code comments claiming otherwise were stale: RegistrySink::on_tick_complete re-enumerates getRegisteredNodes every REGISTRY_RESYNC_INTERVAL (15 min). What #1561 literally asked for — a re-enumeration triggered by the watcher recovering from a gap — is still absent, and it is a distinct behaviour.

Why the cadence is not equivalent

The cadence slips in exactly the scenario an outage-triggered resync would cover, for two independent reasons (both verified against the code):

  1. reconcile_routes (crates/node/src/chain_events/multiplexed_poller.rs) does if r.errored { continue; }, so on_tick_complete does not run at all while the poll is failing.
  2. on_tick_complete stamps last_resync before the read, so a failed full_snapshot defers a further interval.

So after a long RPC outage the set can stay drifted well past one interval, and the first thing that repairs it is a cadence tick that happens to land after recovery — up to 15 minutes late, with no relationship to when the watcher came back.

Why it was left out of #1806

The sink cannot see the recovery edge. LogSink exposes only apply and on_tick_complete (crates/node/src/chain_events/resumable_watcher.rs), and neither carries the tick outcome; the error/recovery state lives in multiplexed_poller's RouteState::errored / established. Adding the trigger means extending the watcher framework, which is a larger change than the doc correction #1806 was scoped to.

Suggested approach

Add an on_recovered-style hook — either a third LogSink method with a default no-op, or a WatcherHook on Route alongside the existing on_established / on_backoff / on_tick_success / on_task_panic. RegistrySink then forces a resync by clearing last_resync, reusing RegistryChainReads::full_snapshot with no new enumeration code.

All five watchers on the shared poller would benefit, so the hook is worth doing at the framework level rather than in the registry sink alone.

Pairs with #1810, which covers the missing observability on the existing resync path.

Activity

  1. added
    prio:medium
    rust
    on Aug 24, 2026
  2. self-assigned this
    on Aug 24, 2026
  3. moved this from Backlog to In progress in deCDNon Aug 24, 2026
  4. moved this from In progress to Done in deCDNon Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

prio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions