feat: let the engine controller update subnets via update_subnet#10434
Draft
pietrodimarco-dfinity wants to merge 2 commits into
Draft
feat: let the engine controller update subnets via update_subnet#10434pietrodimarco-dfinity wants to merge 2 commits into
pietrodimarco-dfinity wants to merge 2 commits into
Conversation
283cee4 to
c439f7d
Compare
b2e8bd4 to
2263047
Compare
Add an `update_engine` method to the engine controller canister that forwards a full `UpdateSubnetPayload` to the registry's `update_subnet` (which the engine controller is now an authorized caller of), restricted to the single authorized caller. This lets it update any field of the subnets it manages, e.g. toggling `is_halted` to halt/resume an engine. Adds the candid declaration, re-exports `UpdateSubnetPayload`, and a PocketIC integration test that halts then resumes a created engine subnet (asserting `SubnetRecord.is_halted` flips) plus an auth-rejection test.
7985705 to
8d36c9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace the halt-specific
halt_enginemethod with a generalupdate_engine(UpdateSubnetPayload)method on the engine controller canister. It forwards the full payload straight to the registry'supdate_subnet, so the single authorized caller can update any field of an engine subnet (e.g. toggleis_haltedto halt/resume it) instead of just a hardcoded flag.Details
update_engineis a thin pass-through toregistry.update_subnet, restricted to the single authorized caller.UpdateSubnetPayloadso clients can build the payload without depending onregistry-canisterdirectly.UpdateSubnetPayload(and all transitively-referenced types) toengine_controller.did, kept in sync with the exported service.Stacking
Stacked on #10433 (registry
update_subnetauth relaxation, which makes the engine controller an authorized caller). Kept as a draft until #10433 merges.Testing
PocketIC integration test halts then resumes a freshly-created engine subnet (asserting
SubnetRecord.is_haltedflips) plus an auth-rejection test, and the candidservice_equaltest. Bothengine_controller_canister_testandengine_controller_integration_testpass locally.