Skip to content

chore: prune streams to deleted subnets#10145

Draft
mraszyk wants to merge 3 commits intomasterfrom
mraszyk/prune-streams-to-deleted-subnets
Draft

chore: prune streams to deleted subnets#10145
mraszyk wants to merge 3 commits intomasterfrom
mraszyk/prune-streams-to-deleted-subnets

Conversation

@mraszyk
Copy link
Copy Markdown
Contributor

@mraszyk mraszyk commented May 8, 2026

This PR implements DSM adjustments to support subnet deletion under the following assumptions:

  • only bounded-wait calls between the local and deleted (remote) subnet;
  • no cycles attached to those calls.

To this end, two changes are needed:

  1. When a subnet is deleted from the registry, the local subnet's outgoing stream to it is now explicitly discarded as part of the same round's execution, after the induction phase. This is safe because all certified stream slices from the deleted subnet (produced before its key was removed from the registry) are inducted before the stream is dropped, and no new certified slices can arrive after deletion. The stream builder's existing route() returning None for deleted subnets already prevents a fresh stream from being recreated. Prior to this change, stale streams to deleted subnets would persist in ReplicatedState indefinitely.

  2. No critical errors are raised for discarded best-effort responses that cannot be routed to the deleted subnet (which is expected).

A new tests ensures that the stream is indeed deleted, no critical errors are raised when dropping a bounded-wait response to the deleted subnet, and rejects responses are generated for requests already in the output queues to the mgmt canister and regular canister on the deleted subnet.

@github-actions github-actions Bot added the chore label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant