multicast: support simultaneous publisher and subscriber#2882
Merged
multicast: support simultaneous publisher and subscriber#2882
Conversation
3d420f1 to
c296a82
Compare
c23397b to
b61258a
Compare
martinsander00
approved these changes
Feb 10, 2026
ccff17e to
4704bab
Compare
martinsander00
approved these changes
Feb 10, 2026
Contributor
martinsander00
left a comment
There was a problem hiding this comment.
Lint issues but lgtm
8729028 to
8723374
Compare
Remove the mutual exclusion between publisher and subscriber modes so a client can both publish and subscribe to multicast groups simultaneously. Daemon: conditionally skip base tunnel creation when the publisher block already created a tunnel with IP, and skip subscriber routes for groups that already have a publisher route with Src set. CLI: add --pub-groups / --sub-groups flags (backward compatible with legacy positional syntax), remove the client-side mutual exclusion validation, and set publisher/subscriber flags independently for overlapping groups. SDK: deduplicate multicast group PKs during user deletion to avoid sending redundant unsubscribe calls that fail due to Updating status. E2E: add pub_codes/sub_codes fields to ConnectMulticastRequest proto and update the RPC handler and helpers.
Merge TestQA_MulticastMultiGroupSimultaneous, TestQA_MulticastAddGroupToExistingUser, and TestQA_MulticastPublisherMultipleGroups into a single TestQA_MulticastMultiGroup that runs three phases: - Phase 1 (selective fan-out): pub on A+B, subA on A, subB on B - Phase 2 (dynamic subscription): subA adds group B, verifies identity preserved - Phase 3 (simultaneous pub+sub): subA reconnects as both pub and sub on group A
The daemon does not support updating an existing multicast service, so both publisher and subscriber roles must be specified in a single connect command. Add an early check in the CLI that queries daemon status and fails with a clear message before modifying onchain state. Update the RFC to document this constraint and note incremental connect as future work.
The ReactivationPreservesAllocations test was calling connect multicast a second time while a service was already running, which is now rejected. Update to disconnect first, then reconnect with both pub groups.
After disconnecting multicast, poll doublezero status --json until the daemon no longer reports a multicast service before attempting to reconnect. This avoids the race where the daemon hasn't fully torn down by the time connect checks for an existing service.
The namely/protoc-all image is abandoned (last updated 2023) and ships outdated protoc v3.21.6. Switch to ghcr.io/jetexe/gobuf which bundles buf with protoc-gen-go v1.36.10 and protoc-gen-go-grpc v1.6.0.
8723374 to
b1a865f
Compare
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.
Summary of Changes
--pub-groupsand--sub-groupsflags ondoublezero connect multicastmulticast publisher/subscriber <groups>) remains supportedTesting Verification