Repository navigation
Description
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):
reconcile_routes(crates/node/src/chain_events/multiplexed_poller.rs) doesif r.errored { continue; }, soon_tick_completedoes not run at all while the poll is failing.on_tick_completestampslast_resyncbefore the read, so a failedfull_snapshotdefers 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.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity