fix: clean up registry after deleting subnet from PocketIC#10428
Open
mraszyk wants to merge 2 commits into
Open
fix: clean up registry after deleting subnet from PocketIC#10428mraszyk wants to merge 2 commits into
mraszyk wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
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_recordsto 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_recordsto 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.
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.
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).