Skip to content

refactor: split always-on base topology from --subnet workload selection#64

Merged
lwshang merged 1 commit into
feat/default-fiduciary-and-test-threshold-keysfrom
lwshang/refactor_subnets_selection
Jun 2, 2026
Merged

refactor: split always-on base topology from --subnet workload selection#64
lwshang merged 1 commit into
feat/default-fiduciary-and-test-threshold-keysfrom
lwshang/refactor_subnets_selection

Conversation

@lwshang
Copy link
Copy Markdown
Contributor

@lwshang lwshang commented Jun 2, 2026

Builds on top of #63.

Problem

The --subnet enum conflates two different kinds of subnet:

  • Always-on base topologynns, fiduciary, test-threshold-keys. Created unconditionally to mirror mainnet / provide infrastructure.
  • User-selectable workload subnetsapplication, system, verified-application, bitcoin, sns.

Mixing them makes the selection logic hard to reason about and produced contradictory docs: "only explicitly specified subnets are added" vs. "nns/fiduciary/test-threshold-keys are always implied".

(There's no correctness issue today — pocket-ic models nns/fiduciary/test-threshold-keys as singleton Option<SubnetSpec> fields, so the repeated with_*_subnet() calls are idempotent. This is purely about a clean mental model.)

Change

Split the two categories explicitly:

  • Create nns, fiduciary, and test-threshold-keys unconditionally up front as base topology, independent of --subnet.
  • Remove TestThresholdKeys from the --subnet enum — it's new in feat: always-on fiduciary/test-threshold-keys subnets; split base topology from --subnet #63 and never shipped, so no back-compat burden. --subnet=test-threshold-keys is now rejected.
  • Keep nns and fiduciary as accepted-but-ignored --subnet values for backward compatibility.
  • Update SPEC.md and README.md to describe the two categories, removing the contradiction.

Runtime behavior is unchanged; this is a clarity / API-surface refactor.

🤖 Generated with Claude Code

The --subnet enum conflated two kinds of subnet: always-on base topology
(NNS, fiduciary, test-threshold-keys) and user-selectable workload subnets.
This made the selection logic hard to reason about and produced contradictory
docs ("only explicitly specified subnets are added" vs. "nns/fiduciary/
test-threshold-keys are always implied").

Split them explicitly:
- Create NNS, fiduciary, and test-threshold-keys unconditionally up front as
  base topology, independent of --subnet.
- Remove TestThresholdKeys from the --subnet enum (new in the parent change,
  never shipped, so no back-compat burden).
- Keep nns and fiduciary as accepted-but-ignored --subnet values for backward
  compatibility.

Behavior is unchanged at runtime; this is a clarity/API-surface refactor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lwshang lwshang requested a review from a team as a code owner June 2, 2026 14:26
@lwshang lwshang merged commit 2c41bdf into feat/default-fiduciary-and-test-threshold-keys Jun 2, 2026
11 checks passed
@lwshang lwshang deleted the lwshang/refactor_subnets_selection branch June 2, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant