Skip to content

feat: ic0_subnet_self_node_count - #11132

Open
eichhorl wants to merge 21 commits into
masterfrom
eichhorl/ic0_subnet_self_node_count
Open

feat: ic0_subnet_self_node_count#11132
eichhorl wants to merge 21 commits into
masterfrom
eichhorl/ic0_subnet_self_node_count

Conversation

@eichhorl

@eichhorl eichhorl commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Implement a new system API function allowing a canister to determine the size of its current subnet. This will be helpful for flexible outcalls, in which a canister can individually specify how many replicas should perform a request, and how many of them should produce a response. This only makes sense within the context of the own subnet size.

Specified here (draft): dfinity/developer-docs#254

@github-actions github-actions Bot added the feat label Aug 13, 2026
Base automatically changed from eichhorl/http-cost-bound to master August 14, 2026 12:49
@eichhorl
eichhorl marked this pull request as ready for review August 14, 2026 14:17
@eichhorl
eichhorl requested a review from a team as a code owner August 14, 2026 14:17
@zeropath-ai

zeropath-ai Bot commented Aug 14, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 45d660d.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/embedders/src/wasm_utils/validation.rs
    Add subnet_self_node_count system API entry point
Enhancement ► rs/embedders/src/wasmtime_embedder/linker.rs
    Wrap ic0.subnet_self_node_count in linker module
Enhancement ► rs/embedders/src/wasmtime_embedder/system_api.rs
    Implement ic0_subnet_self_node_count API method
Enhancement ► rs/embedders/src/wasmtime_embedder/system_api_complexity.rs
    Add SUBNET_SELF_NODE_COUNT complexity constant
Enhancement ► rs/embedders/tests/system_api.rs
    Update supported APIs to include SubnetSelfNodeCount
Enhancement ► rs/embedders/tests/wasmtime_embedder.rs
    Import ic0.subnet_self_node_count in Wasmtime tests
Enhancement ► rs/execution_environment/src/query_handler/query_cache/tests.rs
    Include SystemApiCallId::SubnetSelfNodeCount in expected list
Enhancement ► rs/execution_environment/tests/hypervisor.rs
    Add subnet_self_node_count test scaffolding and WAT example
Enhancement ► rs/interfaces/src/execution_environment.rs
    Extend SystemApiCallId enum with SubnetSelfNodeCount and declare ic0_subnet_self_node_count in SystemApi trait
Enhancement ► rs/test_utilities/execution_environment/src/lib.rs
    Add with_subnet_size builder to configure subnet size in tests

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant