Skip to content

Missing subnet() and isReplicated() functions in new Internet Computer module #265

Open
@Demali-876

Description

@Demali-876

I'd like to request keeping the subnet() and isReplicated() functions in the new InternetComputer module.

Looking at the implementation in ExperimentalInternetComputer, they're simply wrappers around primitive functions that already exist:

public let subnet : () -> Principal = Prim.canisterSubnet;
public let isReplicated : () -> Bool = Prim.isReplicatedExecution;

These functions provide valuable functionality with minimal maintenance overhead since they directly expose existing primitives. They're important for determining a canister's subnet context and execution mode, which i think is pretty useful. I also think this could be even more useful if in the future subnet information is made available through the management canister. This would create a pathway for canisters to programmatically determine and react to subnet state which i think is pretty cool.

Since the underlying primitives already exist, exposing them through the standard library would maintain backward compatibility while giving developers access to these important system details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions