Skip to content

feat: management canister's endpoint list_canisters as inter-canister call#10643

Draft
mraszyk wants to merge 12 commits into
masterfrom
mraszyk/list-canisters-replicated
Draft

feat: management canister's endpoint list_canisters as inter-canister call#10643
mraszyk wants to merge 12 commits into
masterfrom
mraszyk/list-canisters-replicated

Conversation

@mraszyk

@mraszyk mraszyk commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

This PR allows the management canister's endpoint list_canisters to be called as inter-canister call by subnet admins.

@github-actions github-actions Bot added the feat label Jul 3, 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

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 ListCanisters to the management canister Method enum and updated routing/effective-canister-id handling so inter-canister calls resolve correctly.
  • Implemented list_canisters execution 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants