Skip to content

feat: allow unlimited number of gen4 nodes#10448

Open
NikolaMilosa wants to merge 8 commits into
masterfrom
nim-allowing-arbitrary-number-of-nodes
Open

feat: allow unlimited number of gen4 nodes#10448
NikolaMilosa wants to merge 8 commits into
masterfrom
nim-allowing-arbitrary-number-of-nodes

Conversation

@NikolaMilosa

Copy link
Copy Markdown
Contributor

This pull request allows node providers to add more type4.x nodes (excluding type4.5 for now see #10393).

This is needed to allow for provisioning on-demand nodes in the cloud and registering them with the network.

@github-actions github-actions Bot added the feat label Jun 11, 2026
@NikolaMilosa NikolaMilosa changed the title feat: allow theoretically unlimited number of gen4 nodes feat: allow unlimited number of gen4 nodes Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the registry canister’s node-add flow to relax max_rewardable_nodes enforcement for certain Gen4 node reward types, enabling node providers to register more cloud/on-demand nodes (while explicitly keeping type4.5 subject to the existing quota rule).

Changes:

  • Bypasses the max_rewardable_nodes quota check when adding nodes of reward types type4.1type4.4.
  • Keeps the quota check enforced for type4.5.
  • Adds unit tests covering the bypass behavior for type4.1type4.4 and continued enforcement for type4.5.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rs/registry/canister/src/mutations/node_management/do_add_node.rs Outdated
Comment thread rs/registry/canister/src/mutations/node_management/do_add_node.rs Outdated
@NikolaMilosa NikolaMilosa marked this pull request as ready for review June 16, 2026 09:27
@NikolaMilosa NikolaMilosa requested a review from a team as a code owner June 16, 2026 09:27

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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

@zeropath-ai

zeropath-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 74ce942.

Security Overview
Detected Code Changes
Change Type Relevant files
Configuration changes ► rs/registry/canister/src/mutations/node_management/do_add_node.rs
    Define sentinel constant for excessive number of type 4 nodes
    Add logic to bypass max_rewardable_nodes quota for type4.1-type4.4 nodes
► rs/registry/canister/unreleased_changelog.md
    Document temporary bypass of max_rewardable_nodes quota for type4.1-type4.4
Enhancement ► rs/registry/canister/src/mutations/node_management/do_add_node.rs
    Add tests to verify behavior of type4.1-type4.4 nodes and type4.5 quota enforcement

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like, this could cause problems space problems in the Registry canister... I mean, an alternative is just to have a very large (but finite!) limit, right??

Comment thread rs/registry/canister/src/mutations/node_management/do_add_node.rs Outdated
Comment thread rs/registry/canister/src/mutations/node_management/do_add_node.rs Outdated
Comment thread rs/registry/canister/src/mutations/node_management/do_add_node.rs
Comment thread rs/registry/canister/unreleased_changelog.md Outdated
// Validate node operator's max_rewardable_nodes quota.
let num_remaining_nodes =
num_in_registry_same_type.saturating_sub(num_removed_same_ip_same_type);
if num_remaining_nodes >= max_rewardable_nodes_same_type {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

did you get an answer on whether == max is bad? Seems like the original code (where == max was considered bad) was buggy. If it is bad, I'd like to know why, but I'm not going to block on this, because at least we are not regressing; if it was a bug before, at least we are not introducing a NEW bug.

It is probably worth explaining in comments why == max is considered bad, because that is highly unintuitive.

Comment thread rs/registry/canister/unreleased_changelog.md Outdated
Comment thread rs/registry/canister/src/mutations/node_management/do_add_node.rs Outdated
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.

3 participants