fix(coordinator): preserve notifier subscriptions on startup#527
Open
fedejinich wants to merge 3 commits into
Open
fix(coordinator): preserve notifier subscriptions on startup#527fedejinich wants to merge 3 commits into
fedejinich wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
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/SubscribeLogsrequests 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.
de5a557 to
d51afe5
Compare
d51afe5 to
099ed0f
Compare
099ed0f to
e69d0a7
Compare
asoto-iov
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
UnsubscribeBlocks/UnsubscribeLogson the explicit cancellation paths only.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
LocalChannelack-based retention.How Has This Been Tested?
cargo test -p coordinator -p block-indexer -p log-indexer --lockedbash .hooks/format-code.sh --checkRISC0_SKIP_BUILD=1 cargo clippy -p coordinator -p block-indexer -p log-indexer --all-targets --all-features --locked -- -D warningsTypes of changes