Skip to content

feat(registry): add invariant that cloud engines only contain type4 nodes#9621

Merged
pierugo-dfinity merged 19 commits intomasterfrom
pierugo/registry/invariant-type4-nodes
Apr 2, 2026
Merged

feat(registry): add invariant that cloud engines only contain type4 nodes#9621
pierugo-dfinity merged 19 commits intomasterfrom
pierugo/registry/invariant-type4-nodes

Conversation

@pierugo-dfinity
Copy link
Copy Markdown
Contributor

@pierugo-dfinity pierugo-dfinity commented Mar 27, 2026

This PR adds two invariants to the registry concerning cloud engines:

  • All nodes part of a cloud engine has a node reward type 4 (see design doc), which is already how nodes deny incoming connections from cloud engine nodes in the firewall.
  • No non-cloud engines contain nodes with reward type 4, as otherwise other non-cloud engine nodes would deny incoming connections from them.

@pierugo-dfinity pierugo-dfinity marked this pull request as ready for review March 27, 2026 16:39
@pierugo-dfinity pierugo-dfinity requested a review from a team as a code owner March 27, 2026 16:39
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

@pierugo-dfinity pierugo-dfinity dismissed github-actions[bot]’s stale review March 27, 2026 16:40
  1. Done
  2. No breaking changes
  3. No data migration is needed: Looking at the mainnet’s registry, there are no subnet of type CloudEngine and no nodes of reward type Type4.
  4. No need of a security review
github-merge-queue bot pushed a commit that referenced this pull request Apr 1, 2026
There is a registry
[invariant](https://sourcegraph.com/r/github.com/dfinity/ic@be84ed74ce86fbc7db95edaeba782f4106313dc5/-/blob/rs/registry/canister/src/invariants/subnet.rs#L118-L129)
that enforces that cloud engines must have a free cycles cost schedule.
A separate [PR](#9621) will add a
second invariant enforcing that cloud engines must contain only `type4`
node reward types, as this is already how nodes deny incoming
connections from cloud engine nodes in the
[firewall](#9315).

This PR ensures those two invariants are satisfied when creating cloud
engines in system tests by default (though can still be broken if needed
by calling `with_cost_schedule`/`with_node_reward_type`).

Moreover, note that this means that it becomes a requirement for any
system test running a cloud engine to also have an API BN. As of `HEAD`,
cloud engines already use API BNs to [replicate the
registry](#9222) (because NNS nodes'
firewall blocks them). Existing system tests using cloud engines work
because the nodes' reward types are not set in the registry, thus
default to contacting NNS nodes. Soon ([draft
PR](#9595)), fetching delegations will
also go through API BNs.
This PR thus also adds an API BN to existing tests that use cloud
engines.
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.

I am preemptively approving. This means that no re-review is REQUIRED, but as always, re-review requests are 100% welcome.

@pierugo-dfinity pierugo-dfinity added this pull request to the merge queue Apr 2, 2026
Merged via the queue into master with commit a014a0c Apr 2, 2026
37 checks passed
@pierugo-dfinity pierugo-dfinity deleted the pierugo/registry/invariant-type4-nodes branch April 2, 2026 13:38
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.

2 participants