Skip to content

feat: ic0_subnet_self_node_count - #11132

Merged
eichhorl merged 22 commits into
masterfrom
eichhorl/ic0_subnet_self_node_count
Aug 18, 2026
Merged

feat: ic0_subnet_self_node_count#11132
eichhorl merged 22 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 7bf17b3.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/embedders/src/wasm_utils/validation.rs
    Add subnet_self_node_count system API variant in get_valid_system_apis_common
Enhancement ► rs/embedders/src/wasmtime_embedder/linker.rs
    Wrap and expose ic0.subnet_self_node_count syscall in linker
Enhancement ► rs/embedders/src/wasmtime_embedder/system_api.rs
    Implement ic0_subnet_self_node_count in SystemApiImpl
Enhancement ► rs/embedders/src/wasmtime_embedder/system_api_complexity.rs
    Add SUBNET_SELF_NODE_COUNT complexity cost
Enhancement ► rs/embedders/tests/system_api.rs
    Update is_supported to include SubnetSelfNodeCount, and test availability handling
Enhancement ► rs/embedders/tests/wasmtime_embedder.rs
    Import ic0_subnet_self_node_count in wasm64 tests
Enhancement ► rs/execution_environment/src/query_handler/query_cache/tests.rs
    Include SubnetSelfNodeCount in supported system APIs for query cache tests
Enhancement ► rs/execution_environment/tests/hypervisor.rs
    Add WAT for ic0.subnet_self_node_count and related tests for node count behavior
Enhancement ► rs/interfaces/src/execution_environment.rs
    Add SubnetSelfNodeCount to SystemApiCallId and SystemApi trait signature ic0_subnet_self_node_count
Enhancement ► rs/test_utilities/execution_environment/src/lib.rs
    Add with_subnet_size builder to configure subnet size and related node IDs

Comment thread rs/interfaces/src/execution_environment.rs
@eichhorl
eichhorl enabled auto-merge August 18, 2026 09:50
@eichhorl
eichhorl added this pull request to the merge queue Aug 18, 2026
Merged via the queue into master with commit d54472d Aug 18, 2026
40 checks passed
@eichhorl
eichhorl deleted the eichhorl/ic0_subnet_self_node_count branch August 18, 2026 10:58
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.

2 participants