Repository navigation
feat(registry): Let the engine controller make a cloud engine cool down - #11519
Conversation
Adds `cooling_down` to the small set of `UpdateSubnetPayload` fields the engine controller canister may set, alongside `subnet_admins` and `is_halted`. The engine controller can thus let a cloud engine subnet quiesce -- drain its subnet queues and its streams while executing no canister messages and serving no queries -- before halting it. The scope check exists twice, once in the engine controller proxy (`ensure_only_allowed_fields_set`) and once as a defence-in-depth check in the registry (`ensure_engine_controller_payload_scope`); both are widened, and their exhaustive destructuring keeps them from drifting. Everything else stays rejected for that caller. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The scope expansion is consistently enforced at both layers and adequately tested.
Pull request overview
Enables the engine controller to set cooling_down for CloudEngine subnets before halting them.
Changes:
- Allows
cooling_downthrough both scope validators. - Adds tests for enabling and disabling cooldown.
- Updates interface comments and changelogs.
File summaries
| File | Description |
|---|---|
rs/registry/canister/unreleased_changelog.md |
Documents the expanded registry scope. |
rs/registry/canister/src/mutations/do_update_subnet.rs |
Permits and tests registry cooldown updates. |
rs/engine_controller/unreleased_changelog.md |
Documents engine-controller support. |
rs/engine_controller/engine_controller.did |
Corrects the declared scope comment. |
rs/engine_controller/canister/tests.rs |
Tests cooldown payload validation. |
rs/engine_controller/canister/canister.rs |
Allows cooling_down through the proxy. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):
-
Update
unreleased_changelog.md(if there are behavior changes, even if they are
non-breaking). -
Are there BREAKING changes?
-
Is a data migration needed?
-
Security review?
How to Satisfy This Automatic Review
-
Go to the bottom of the pull request page.
-
Look for where it says this bot is requesting changes.
-
Click the three dots to the right.
-
Select "Dismiss review".
-
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
|
✅ No security or compliance issues detected. Reviewed everything up to a1744c6. Security Overview
Detected Code Changes
|
…roller-cooling-down # Conflicts: # rs/engine_controller/engine_controller.did
Addresses review feedback: turn the inline enumerations of the allowed fields (`subnet_admins`, `is_halted`, `cooling_down`) into bulleted lists so they are easier to skim and adding a field later touches a single line. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…'s state limits (dfinity#11863) Lets the engine controller canister set a cloud engine subnet's state limits (`maximum_state_size`, `maximum_state_delta`), both when it creates the subnet and afterwards. Today every cloud engine subnet is created with the protocol defaults, whatever hardware its nodes have, and the engine controller cannot change them later. A subnet is only as big as its smallest node, so an engine on small nodes needs tighter limits than the defaults, and an engine whose nodes are upgraded should be able to grow its limits again. **`create_engine`** takes an optional `resource_limits` (`EngineResourceLimits`: the two state limits only), forwarded to the new subnet's `CreateSubnetPayload`. Omitted, the subnet keeps the protocol defaults as before. The field is an `opt`, so existing callers are unaffected. **`update_subnet`** now also accepts the state limits in `resource_limits`. As in dfinity#11519, the scope check exists twice: in the engine controller proxy (`ensure_only_allowed_fields_set`) and as the registry's defence-in-depth check (`ensure_engine_controller_payload_scope`). Both are widened to allow `maximum_state_size` and `maximum_state_delta`. The query limits (`maximum_query_instructions`, `maximum_query_walltime_seconds`) remain rejected for this caller, along with every other field, and the registry still requires the target to be a `CloudEngine` subnet. `update_subnet` replaces `resource_limits` as a whole, so an engine controller update would otherwise reset limits it is not allowed to manage, for example query limits set by a proposal. For the engine controller as caller, the registry therefore keeps the current value of every limit the payload leaves unset, as ic-admin does client-side with `ResourceLimits::inherit_from`. Governance updates keep the existing replace semantics. **Tests:** - Proxy: `ensure_only_allowed_fields_set_accepts_state_limits` and `_rejects_query_limits`. - Registry: `test_engine_controller_sets_state_limits_and_keeps_unset_limits` (a state-size-only update keeps the delta and the governance-set query limits) and `test_engine_controller_cannot_set_query_limits`, following `STANDARDS_AND_CONVENTIONS.md`. `engine_controller_cannot_update_disallowed_fields` now expects the offending field rather than the exact panic wording. - PocketIC: `create_engine_sets_resource_limits` checks that the limits land on the new subnet record. - Existing `CreateEngineArgs` literals, including the `standard_engine_replica_version_test` system test, pass `resource_limits: None`. Both `unreleased_changelog.md` files are updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Adds
cooling_downto the small set ofUpdateSubnetPayloadfields the enginecontroller canister may set, alongside
subnet_adminsandis_halted. Theengine controller can thus let a cloud engine subnet quiesce -- drain its subnet
queues and its streams while executing no canister messages and serving no
queries (see #11495) -- before halting it.
The scope check exists twice: once in the engine controller proxy
(
ensure_only_allowed_fields_set) and once as a defence-in-depth check in theregistry (
ensure_engine_controller_payload_scope). Both are widened, and theirexhaustive destructuring of
UpdateSubnetPayloadkeeps them from drifting.Every other field remains rejected for that caller, and the registry still
requires the target subnet to be of type
CloudEngine.The stale comment in
engine_controller.did, which claimed onlysubnet_idandsubnet_adminscould be set, now names the actual surface.Tests: the registry's
engine_controller_cannot_set_cooling_downbecomesengine_controller_can_set_cooling_down, asserting the flag round-trips bothways on a
CloudEnginesubnet; the proxy gainsensure_only_allowed_fields_set_accepts_cooling_down, and its combined-fieldstest now sets all three allowed fields.
🤖 Generated with Claude Code