Skip to content

fix(coordinator): preserve notifier subscriptions on startup#527

Open
fedejinich wants to merge 3 commits into
mainfrom
feat/notifier-restart-subscriptions
Open

fix(coordinator): preserve notifier subscriptions on startup#527
fedejinich wants to merge 3 commits into
mainfrom
feat/notifier-restart-subscriptions

Conversation

@fedejinich

Copy link
Copy Markdown
Collaborator

Description

  • Stop coordinator startup from unsubscribing from block and log streams before subscribing again.
  • Keep UnsubscribeBlocks / UnsubscribeLogs on the explicit cancellation paths only.
  • Add notifier tests covering duplicate block/log subscriptions from the same broker identity.

Motivation and Context

Coordinator-only restarts should not create a window where block/log notifiers stop targeting the coordinator's stable broker identity. Keeping subscriptions in place allows persisted broker queues to retain notifications while the coordinator reconnects.

This PR does not add a new broker queue retention/TTL policy; the current broker wrapper still uses LocalChannel ack-based retention.

How Has This Been Tested?

  • cargo test -p coordinator -p block-indexer -p log-indexer --locked
  • bash .hooks/format-code.sh --check
  • RISC0_SKIP_BUILD=1 cargo clippy -p coordinator -p block-indexer -p log-indexer --all-targets --all-features --locked -- -D warnings
  • Pre-push hook passed while publishing the branch.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (code improvement without changing existing functionality)

@fedejinich fedejinich marked this pull request as ready for review June 8, 2026 00:10
@fedejinich fedejinich requested a review from illuque as a code owner June 8, 2026 00:10
Copilot AI review requested due to automatic review settings June 8, 2026 00:10
@fedejinich fedejinich requested a review from asoto-iov as a code owner June 8, 2026 00:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adjusts coordinator startup behavior to avoid unsubscribing from block/log notifier streams during restarts, preventing a gap where notifications might not be routed to the coordinator’s stable broker identity.

Changes:

  • Removed implicit “cleanup” unsubscribe calls from start_event_monitoring / start_block_monitoring, keeping unsubscribes only on explicit cancellation paths.
  • Added notifier unit tests to ensure duplicate SubscribeBlocks / SubscribeLogs requests from the same broker identity are handled idempotently (no duplicate consumer entries, no duplicate notifications).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/coordinator/src/monitor.rs Removes startup-time unsubscribe calls so coordinator restarts don’t temporarily drop notifier subscriptions.
crates/block-indexer/src/notifier.rs Adds a test asserting duplicate block subscriptions from the same client are effectively idempotent.
crates/log-indexer/src/notifier.rs Adds a test asserting duplicate log subscriptions (same client + same address) are effectively idempotent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings June 9, 2026 16:13
@fedejinich fedejinich force-pushed the feat/notifier-restart-subscriptions branch from de5a557 to d51afe5 Compare June 9, 2026 16:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@fedejinich fedejinich force-pushed the feat/notifier-restart-subscriptions branch from d51afe5 to 099ed0f Compare June 9, 2026 16:36
Copilot AI review requested due to automatic review settings June 11, 2026 14:33
@fedejinich fedejinich force-pushed the feat/notifier-restart-subscriptions branch from 099ed0f to e69d0a7 Compare June 11, 2026 14:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@asoto-iov asoto-iov added this pull request to the merge queue Jun 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants