Skip to content

fix: clean up registry after deleting subnet from PocketIC#10428

Open
mraszyk wants to merge 2 commits into
masterfrom
mraszyk/pic-delete-subnet-cleanup-registry
Open

fix: clean up registry after deleting subnet from PocketIC#10428
mraszyk wants to merge 2 commits into
masterfrom
mraszyk/pic-delete-subnet-cleanup-registry

Conversation

@mraszyk

@mraszyk mraszyk commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This PR fixes subnet deletion in PocketIC by removing stale (subnet) registry records (orphaned after removing the subnet from the subnet list and routing table) as well as updating threshold signing registry records (defense-in-depth since threshold keys are only on "named" subnets which cannot be deleted).

@github-actions github-actions Bot added the fix label Jun 10, 2026
@mraszyk mraszyk marked this pull request as ready for review June 10, 2026 12:18
@mraszyk mraszyk requested a review from a team as a code owner June 10, 2026 12:18
@mraszyk mraszyk requested a review from Copilot June 10, 2026 13:40

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 PR fixes PocketIC subnet deletion when the registry feature is enabled by tombstoning subnet-local registry keys (and removing now-unused chain-key registry records) so the registry does not retain orphaned records after a subnet is removed from the routing table and subnet list.

Changes:

  • Add remove_subnet_local_registry_records to tombstone per-subnet/per-node registry keys (CUP contents, subnet record, threshold signing pubkey, node records, TLS certs, and node crypto keys).
  • Add remove_chain_key_registry_records to tombstone chain-key enabled-subnet-list records when a chain key no longer applies to any subnet.
  • Update PocketIC subnet deletion to invoke the above cleanup and add unit tests verifying tombstoning behavior.

Reviewed changes

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

File Description
rs/state_machine_tests/src/tests.rs Adds tests that validate registry tombstoning for subnet-local records and removed chain-key records.
rs/state_machine_tests/src/lib.rs Introduces helper functions to tombstone subnet-local and chain-key registry records via RegistryRecord entries with value: None.
rs/pocket_ic_server/src/pocket_ic.rs Calls the new cleanup helpers during subnet deletion to remove orphaned registry records and unused chain-key registry entries.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants