Skip to content

feat(sentinel): auto-manage multicast publishers#272

Merged
karl-dz merged 6 commits intomainfrom
bgm/sentinel_mcast_allowlist
Feb 26, 2026
Merged

feat(sentinel): auto-manage multicast publishers#272
karl-dz merged 6 commits intomainfrom
bgm/sentinel_mcast_allowlist

Conversation

@bgm-malbeclabs
Copy link
Collaborator

@bgm-malbeclabs bgm-malbeclabs commented Feb 26, 2026

Summary

Auto-joins validators to configured multicast publisher groups on onboarding. At startup, resolves configured group codes to onchain PDAs; on each new access pass, idempotently adds the validator to every configured multicast group's
publisher allowlist.

Changes

  • Multicast publisher allowlisting on validator onboarding: after issuing an access pass, the polling sentinel iterates configured multicast group PDAs and calls add_multicast_publisher_allowlist for each. Skips groups the validator is already in (idempotency via get_access_pass pre-check). Failures are logged and metered but don't block onboarding.
  • Startup group code resolution ΓÇö new resolve_multicast_group_codes fetches all MulticastGroup accounts from the DZ Ledger and maps configured codes to PDAs. Rejects duplicate codes (regardless of status) and only resolves Activated groups.
  • get_access_pass and add_multicast_publisher_allowlist on DzRpcClientType: new trait methods + implementations on DzRpcClient, enabling mock-based testing.
  • Configurable group codes: new multicast_group_codes setting (comma-separated, env: SENTINEL__MULTICAST_GROUP_CODES). When empty (default), allowlisting is disabled.
  • Timeout on add_multicast_publisher_allowlist: wraps send_and_confirm_transaction in tokio::time::timeout(60s), matching existing billing RPC pattern.

Testing

  • Add tests for multicast group code resolution (duplicates, status filtering, not-found, happy path) and 5 tests for settings parsing.

@bgm-malbeclabs bgm-malbeclabs requested review from Copilot, karl-dz and vihu and removed request for karl-dz and vihu February 26, 2026 16:06
@bgm-malbeclabs bgm-malbeclabs changed the title mcast pub for sentinel feat(sentinel): auto-manage multicast publishers Feb 26, 2026
Copy link

Copilot AI left a comment

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 adds multicast publisher allowlisting functionality to the sentinel service. When validators are onboarded and granted access passes, they are automatically added to configured multicast publisher groups.

Changes:

  • Added multicast_group_codes configuration setting for specifying which multicast groups to auto-join validators to
  • Implemented multicast group code resolution at startup to convert codes to on-chain PDAs
  • Integrated allowlist addition into the validator onboarding flow with proper error handling and metrics

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/sentinel/src/settings.rs Added multicast_group_codes setting with parsing logic to support comma-separated group codes
crates/sentinel/src/main.rs Added startup logic to resolve multicast group codes to PDAs and pass them to PollingSentinel
crates/sentinel/src/sentinel/poller.rs Added multicast_group_pdas field and integrated allowlist addition into validator onboarding loop with metrics
crates/sentinel/src/client/doublezero_ledger.rs Implemented add_multicast_publisher_allowlist and resolve_multicast_group_codes methods with trait support
crates/sentinel/CHANGELOG.md Added changelog entry for the new feature

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

@bgm-malbeclabs bgm-malbeclabs self-assigned this Feb 26, 2026
@bgm-malbeclabs bgm-malbeclabs force-pushed the bgm/sentinel_mcast_allowlist branch from 84eb2a4 to 57e4b82 Compare February 26, 2026 16:57
bgm-malbeclabs and others added 4 commits February 26, 2026 11:42
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vihu vihu force-pushed the bgm/sentinel_mcast_allowlist branch from 57e4b82 to e188cc7 Compare February 26, 2026 18:42
Furthermore:
- Reject duplicate codes
- Add timeout
- Add tests
martinsander00
martinsander00 previously approved these changes Feb 26, 2026
@karl-dz karl-dz merged commit 84f6341 into main Feb 26, 2026
6 checks passed
@karl-dz karl-dz deleted the bgm/sentinel_mcast_allowlist branch February 26, 2026 20:00
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.

5 participants