Skip to content

feat(PocketIC): create subnets from new subnet records in the registry - #10976

Draft
mraszyk wants to merge 1 commit into
masterfrom
mraszyk/pocket-ic-create-subnet-from-registry
Draft

feat(PocketIC): create subnets from new subnet records in the registry#10976
mraszyk wants to merge 1 commit into
masterfrom
mraszyk/pocket-ic-create-subnet-from-registry

Conversation

@mraszyk

@mraszyk mraszyk commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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.

`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>
@github-actions github-actions Bot added the feat label Jul 30, 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