feat: management canister's endpoint list_canisters as inter-canister call#10643
Draft
mraszyk wants to merge 12 commits into
Draft
feat: management canister's endpoint list_canisters as inter-canister call#10643mraszyk wants to merge 12 commits into
mraszyk wants to merge 12 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables the management canister method list_canisters to be executed via inter-canister (subnet) messages by subnet-admin canisters, while remaining disallowed via ingress, and introduces round-instruction accounting/deferral for its (potentially heavy) subnet-wide iteration.
Changes:
- Added
ListCanistersto the management canisterMethodenum and updated routing/effective-canister-id handling so inter-canister calls resolve correctly. - Implemented
list_canistersexecution for subnet messages with explicit round-instruction charging and scheduler deferral when the round instruction budget is exhausted. - Added execution tests and benchmarks covering authorization behavior and round-instruction-limit behavior.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rs/types/types/src/messages/inter_canister.rs | Treats list_canisters as having no effective canister ID for inter-canister message routing. |
| rs/types/types/src/messages/ingress_messages.rs | Marks list_canisters as a subnet method not allowed via ingress. |
| rs/types/management_canister_types/src/lib.rs | Adds ListCanisters to ic00::Method. |
| rs/test_utilities/execution_environment/src/lib.rs | Updates test harness assertions to account for list_canisters consuming round instructions without an effective canister ID. |
| rs/execution_environment/tests/execution_test.rs | Adds state-machine tests for success/rejection and round instruction limit behavior for inter-canister list_canisters. |
| rs/execution_environment/src/scheduler.rs | Defers list_canisters subnet messages once round instruction budget is reached; adds to subnet-message instruction-limit classification. |
| rs/execution_environment/src/query_handler.rs | Refactors query-path list_canisters logic to use shared implementation. |
| rs/execution_environment/src/ic00_permissions.rs | Documents/threads ListCanisters through permissions accounting expectations. |
| rs/execution_environment/src/execution/common.rs | Introduces shared list_canisters implementation and its round-instruction cost model. |
| rs/execution_environment/src/execution_environment/tests.rs | Adds tests asserting ingress rejection behavior for list_canisters. |
| rs/execution_environment/src/execution_environment.rs | Adds subnet-message execution handling for ListCanisters, including conditional round-instruction charging. |
| rs/execution_environment/src/execution_environment_metrics.rs | Adds ListCanisters to subnet message metrics method labeling. |
| rs/execution_environment/src/canister_manager.rs | Allows ListCanisters to be handled as an inter-canister-only management call. |
| rs/execution_environment/benches/management_canister/test_canister/src/main.rs | Adds benchmark helper methods to create gapped canister IDs and call list_canisters. |
| rs/execution_environment/benches/management_canister/test_canister/candid.did | Exposes new benchmark helper endpoints in the test canister interface. |
| rs/execution_environment/benches/management_canister/main.rs | Registers list_canisters benchmark module. |
| rs/execution_environment/benches/management_canister/list_canisters.rs | Adds a Criterion benchmark for list_canisters across subnet sizes. |
| rs/embedders/src/wasmtime_embedder/system_api/sandbox_safe_system_state.rs | Threads ListCanisters through system API state-modification classification. |
| rs/embedders/src/wasmtime_embedder/system_api/routing.rs | Routes list_canisters management calls without an effective canister ID (local subnet). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR allows the management canister's endpoint
list_canistersto be called as inter-canister call by subnet admins.