Skip to content

feat: CON-1716 Allow SetupInitialDkg requests to be answered by subnets other than NNS#9782

Merged
eichhorl merged 12 commits into
masterfrom
eichhorl/allow-initial-dkg-on-different-subnet
Apr 23, 2026
Merged

feat: CON-1716 Allow SetupInitialDkg requests to be answered by subnets other than NNS#9782
eichhorl merged 12 commits into
masterfrom
eichhorl/allow-initial-dkg-on-different-subnet

Conversation

@eichhorl
Copy link
Copy Markdown
Contributor

@eichhorl eichhorl commented Apr 9, 2026

Background

SetupInitialDkg is a management canister call that can only be made by canisters residing on the NNS. Typically, this management canister call is triggered by proposals that create or recover a subnet. Similarly, it will also be used to create cloud engines.

Upon receiving such a SetupInitialDkg request, the receiving subnet will perform two instances of the NiDKG protocol. The result yields the key material of the new or recovered subnet, from which also the subnet ID is derived.

Problem

Today, SetupInitialDkg requests are exclusively handled by the NNS subnet. This has some disadvantages, which are exacerbated by the advent of cloud engines:

  1. The code implementing the remote NiDKG protocol exclusively runs on NNS.
  2. The protocol is comparatively expensive and puts some load on the NNS.
  3. So far, execution of this management canister call was gated by proposals. This may no longer be the case for cloud engines.
  4. When handled on the NNS, cloud engine creations compete for the same resources as critical recovery proposals.
  5. Problems surfacing on the NNS subnet may have higher impact compared to other subnets.

Proposed Solution

Instead of always handling SetupInitialDkg request on the NNS, this PR proposes the ability to optionally specify the subnet to which the request should be routed. Specifically, this would allow the key material for cloud engines to be created on a different subnet than the one handling critical recovery proposals.

To do this, we extend the SetupInitialDKGArgs (and consequently, the Create/RecoverSubnetPayload) with an optional SubnetId field, to which the request will be routed.

Note that, although these changes have not been deployed to the mainnet NNS canisters yet, system tests using mainnet NNS canisters already pass. This is because the new argument is still ignored by the mainnet canisters, which means they fall back to the old behavior (SetupInitialDkg is routed to the NNS).

Future Work

  • Notify dashboard teams of the new arguments added to create and recover subnet proposals.
  • Select a designated SetupInitialDkg subnet for handling Cloud Engine creations, for instance the II subnet.

@eichhorl eichhorl added the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Apr 21, 2026
@eichhorl eichhorl changed the title Draft: feat: Allow initial DKG on different subnets feat: CON-1716 Allow SetupInitialDKG requests to be answered by subnets other than NNS Apr 21, 2026
@github-actions github-actions Bot added the feat label Apr 21, 2026
@eichhorl eichhorl changed the title feat: CON-1716 Allow SetupInitialDKG requests to be answered by subnets other than NNS feat: CON-1716 Allow SetupInitialDkg requests to be answered by subnets other than NNS Apr 22, 2026
@eichhorl eichhorl marked this pull request as ready for review April 22, 2026 06:33
@eichhorl eichhorl requested review from a team as code owners April 22, 2026 06:33
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@eichhorl eichhorl removed the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Apr 22, 2026
@eichhorl eichhorl dismissed github-actions[bot]’s stale review April 22, 2026 13:33
  1. Done.
  2. No breaking changes.
  3. No data migration needed.
  4. No security review needed. Conceptually this is analogous to ReshareChainKey requests being routed to the II subnet during subnet creations/recoveries, which is done to reshare an ECDSA/Schnorr/Vetkd key at the same time.
Copy link
Copy Markdown
Contributor

@daniel-wong-dfinity-org daniel-wong-dfinity-org left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for Governance.

Comment thread rs/tests/nns/create_subnet_test.rs Outdated
Comment thread rs/tests/nns/create_subnet_test.rs Outdated
Comment thread rs/registry/canister/src/mutations/do_split_subnet.rs
eichhorl and others added 2 commits April 23, 2026 18:17
Co-authored-by: Daniel Wong <97631336+daniel-wong-dfinity-org@users.noreply.github.com>
Co-authored-by: Daniel Wong <97631336+daniel-wong-dfinity-org@users.noreply.github.com>
@eichhorl eichhorl enabled auto-merge April 23, 2026 16:53
@eichhorl eichhorl added this pull request to the merge queue Apr 23, 2026
Merged via the queue into master with commit a95a31e Apr 23, 2026
63 of 64 checks passed
@eichhorl eichhorl deleted the eichhorl/allow-initial-dkg-on-different-subnet branch April 23, 2026 18:00
dsarlis pushed a commit to dsarlis/ic that referenced this pull request May 5, 2026
…ng and rental (dfinity#10027)

Creating, recovering or splitting a subnet requires new key material for
the nodes comprising the subnet. This key material needs to be generated
by a different subnet. Until recently, this key generation was
exclusively done by the NNS. Since
dfinity#9782 however, it may be done by any
subnet (and specifically, _not_ the NNS).

The linked PR already updated proposals for creating and recovering
subnets to optionally specify which subnet should be responsible for
generating the initial key material.

This PR similarly updates the remaining two proposal types that also
cause new key material to be generated, namely subnet splitting and
subnet rental (which is a subnet creation).
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.

5 participants