Repository navigation
feat(engine-controller): Let the engine controller set a cloud engine's state limits - #11863
Conversation
…'s state limits `create_engine` takes an optional `resource_limits` (`maximum_state_size`, `maximum_state_delta`), forwarded to the new subnet's `CreateSubnetPayload`. `update_subnet` accepts those two state limits too, in both the proxy's and the registry's scope check; the query limits stay governance-only. For the engine controller as caller, the registry keeps the current value of every limit the payload leaves unset, so its update never resets the limits it may not manage. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 23da228. Security Overview
Detected Code Changes
|
…er limit tests The new registry tests are named `test_…`, lead with the behavior under test, and are laid out in the prepare / run / verify steps. `engine_controller_cannot_update_disallowed_fields` now expects the offending field rather than the exact wording of the panic. `create_engine` converts the limits with an explicit `ResourceLimits::from` instead of a bare `into`, which takes a direct dependency on `ic-registry-resource-limits`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Update unreleased_changelog.md: done
- Are there BREAKING changes? No
- Is a data migration needed? No
- Security review? No
pierugo-dfinity
left a comment
There was a problem hiding this comment.
Approving core-protocol-owned single-line diff rs/tests/consensus/orchestrator/standard_engine_replica_version_test.rs
…e do_update_subnet test module
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_enginetakes an optionalresource_limits(EngineResourceLimits: the two state limits only), forwarded to the new subnet'sCreateSubnetPayload. Omitted, the subnet keeps the protocol defaults as before. The field is anopt, so existing callers are unaffected.update_subnetnow also accepts the state limits inresource_limits. As in #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 allowmaximum_state_sizeandmaximum_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 aCloudEnginesubnet.update_subnetreplacesresource_limitsas 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 withResourceLimits::inherit_from. Governance updates keep the existing replace semantics.Tests:
ensure_only_allowed_fields_set_accepts_state_limitsand_rejects_query_limits.test_engine_controller_sets_state_limits_and_keeps_unset_limits(a state-size-only update keeps the delta and the governance-set query limits) andtest_engine_controller_cannot_set_query_limits, followingSTANDARDS_AND_CONVENTIONS.md.engine_controller_cannot_update_disallowed_fieldsnow expects the offending field rather than the exact panic wording.create_engine_sets_resource_limitschecks that the limits land on the new subnet record.CreateEngineArgsliterals, including thestandard_engine_replica_version_testsystem test, passresource_limits: None.Both
unreleased_changelog.mdfiles are updated.🤖 Generated with Claude Code