feat(PocketIC): create subnets from new subnet records in the registry - #10976
Draft
mraszyk wants to merge 1 commit into
Draft
feat(PocketIC): create subnets from new subnet records in the registry#10976mraszyk wants to merge 1 commit into
mraszyk wants to merge 1 commit into
Conversation
`rs/pocket_ic_server` already syncs registry versions and their content from the registry canister to the registry used by PocketIC. This extends that sync by creating a new subnet in PocketIC (enhancing its topology) for every subnet record that has been added to the registry (e.g., by the registry canister's `create_subnet` endpoint) and for which no subnet exists yet. The subnet's canister ranges are taken from the routing table synced from the registry canister and its kind is derived from the subnet type in the subnet record. Since PocketIC must hold the private keys of the subnet's nodes and the master secret key of its NI-DKG transcript (which `setup_initial_dkg` discards), the subnet's nodes, keys, CUP contents, and threshold signing public key are generated by PocketIC and pushed back to the registry canister. All remaining settings of the subnet record are preserved: `add_subnet_local_registry_records` now derives the subnet record from the one in the registry, only overriding the membership, DKG interval length, and chain key config. A value of 0 for the ingress/block size limits is treated as unspecified because those limits are consumed raw (a value of 0 would make the subnet reject every ingress message). Also delete stale canister ranges registry shards: PocketIC stores the whole routing table in a single shard whereas the registry canister may split it into multiple shards, and consumers read the union of all shards, so leftover shards would result in duplicate canister ranges. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
rs/pocket_ic_serveralready syncs registry versions and their content from the registry canister to the registry used by PocketIC. This extends that sync by creating a new subnet in PocketIC (enhancing its topology) for every subnet record that has been added to the registry (e.g., by the registry canister'screate_subnetendpoint) and for which no subnet exists yet.The subnet's canister ranges are taken from the routing table synced from the registry canister and its kind is derived from the subnet type in the subnet record. Since PocketIC must hold the private keys of the subnet's nodes and the master secret key of its NI-DKG transcript (which
setup_initial_dkgdiscards), the subnet's nodes, keys, CUP contents, and threshold signing public key are generated by PocketIC and pushed back to the registry canister. All remaining settings of the subnet record are preserved:add_subnet_local_registry_recordsnow derives the subnet record from the one in the registry, only overriding the membership, DKG interval length, and chain key config. A value of 0 for the ingress/block size limits is treated as unspecified because those limits are consumed raw (a value of 0 would make the subnet reject every ingress message).Also delete stale canister ranges registry shards: PocketIC stores the whole routing table in a single shard whereas the registry canister may split it into multiple shards, and consumers read the union of all shards, so leftover shards would result in duplicate canister ranges.