Guides/EVM/Precompiles

Subnet

Reference for the deployed SubnetPrecompile.

View as Markdown
PropertyValue
Rust implementationSubnetPrecompile
Solidity interfaceISubnet
Address0x0000000000000000000000000000000000000803
StatusDeployed

Registers subnets and exposes selected subnet configuration. State-changing functions are payable.

Registration

registerNetwork has three overloads:

registerNetwork(bytes32)
registerNetwork(bytes32,string,string,string,string,string,string,string)
registerNetwork(bytes32,string,string,string,string,string,string,string,string)

Views

getActivityCutoff(uint16)
getActivityCutoffFactor(uint16)
getAdjustmentAlpha(uint16)
getAlphaSigmoidSteepness(uint16)
getAlphaValues(uint16)
getBondsMovingAverage(uint16)
getBondsResetEnabled(uint16)
getCommitRevealWeightsEnabled(uint16)
getCommitRevealWeightsInterval(uint16)
getDifficulty(uint16)
getImmunityPeriod(uint16)
getKappa(uint16)
getLiquidAlphaEnabled(uint16)
getMaxBurn(uint16)
getMaxDifficulty(uint16)
getMaxWeightLimit(uint16)
getMinAllowedWeights(uint16)
getMinBurn(uint16)
getMinDifficulty(uint16)
getNetworkPowRegistrationAllowed(uint16)
getNetworkRegistrationAllowed(uint16)
getNetworkRegistrationBlock(uint16)
getRegisteredSubnetCounter(uint16)
getOwnerCutAutoLockEnabled(uint16)
getRho(uint16)
getServingRateLimit(uint16)
getWeightsSetRateLimit(uint16)
getWeightsVersionKey(uint16)
getYuma3Enabled(uint16)
isSubnetDissolving(uint16)
getSubnetDissolutionStatus(uint16)
getSubnetMetadata(uint16)
getSubnetCapacityConfig(uint16)
getMechanismEmissionSplit(uint16)
getBurnConfig(uint16)
getGlobalNetworkLimits()
getGlobalRateLimits()
getGlobalProtocolConfig()

The grouped configuration views return stable typed fields rather than raw storage encodings. Fixed-point burn multipliers are returned as raw U64F64 bits.

getRegisteredSubnetCounter returns a monotonic generation number for a netuid. It increments on every successful registration, allowing a contract to distinguish a reused netuid even when it did not retain the previous registration block.

getSubnetDissolutionStatus returns (isDissolving, cleanupInProgress, cleanupPhase). Phase 0 means that detailed cleanup has not started. Active cleanup uses stable, append-only phase codes:

CodeCleanup work
1Root claimable dividends
2Root claimed dividends
3Calculate stake value
4Settle stakes
5Clear alpha
6Clear hotkey totals
7Clear stake locks
8Clear decaying stake locks
9Finish stake cleanup
10Clear protocol liquidity
11Purge subnet commitments
12Clear network membership
13Clear network parameters
14Clear network maps
15Update root weights
16Clear childkey takes
17Clear childkeys
18Clear parentkeys
19Clear last hotkey emissions
20Clear last-epoch hotkey alpha
21Clear transaction rate-limit records
22Clear network locks
23Clear decaying network locks

The runtime does not currently store a per-subnet future dissolution block. The authorized dissolution calls execute dissolution immediately, while the generic scheduler stores calls by agenda position rather than maintaining a typed netuid-to-dissolution lookup. Consequently, there is no truthful, bounded per-subnet scheduled-block view to expose.

Configuration

setActivityCutoff(uint16,uint16)
setActivityCutoffFactor(uint16,uint32)
setAdjustmentAlpha(uint16,uint64)
setAlphaSigmoidSteepness(uint16,uint16)
setAlphaValues(uint16,uint16,uint16)
setBondsMovingAverage(uint16,uint64)
setBondsResetEnabled(uint16,bool)
setCommitRevealWeightsEnabled(uint16,bool)
setCommitRevealWeightsInterval(uint16,uint64)
setDifficulty(uint16,uint64)
setImmunityPeriod(uint16,uint16)
setKappa(uint16,uint16)
setLiquidAlphaEnabled(uint16,bool)
setMaxDifficulty(uint16,uint64)
setMinAllowedWeights(uint16,uint16)
setMinDifficulty(uint16,uint64)
setNetworkPowRegistrationAllowed(uint16,bool)
setNetworkRegistrationAllowed(uint16,bool)
setOwnerCutAutoLockEnabled(uint16,bool)
setRho(uint16,uint16)
setServingRateLimit(uint16,uint64)
setWeightsVersionKey(uint16,uint64)
setYuma3Enabled(uint16,bool)
toggleTransfers(uint16,bool)

Legacy no-op functions

These released selectors remain routed but intentionally do not change state:

setWeightsSetRateLimit(uint16,uint64)
setMinBurn(uint16,uint64)
setMaxBurn(uint16,uint64)

Changing their behavior in place would break their released semantics. The real AdminUtils operations therefore use the V2 selectors below.

Added subnet operations

FunctionSource extrinsic
setSubnetIdentitySubtensorModule.set_subnet_identity
updateSubnetSymbolSubtensorModule.update_symbol
triggerEpochSubtensorModule.trigger_epoch

Added AdminUtils operations

FunctionSource extrinsic
setBondsPenaltyAdminUtils.sudo_set_bonds_penalty
setMaxAllowedUidsAdminUtils.sudo_set_max_allowed_uids
setMaxBurnV2AdminUtils.sudo_set_max_burn
setMechanismCountAdminUtils.sudo_set_mechanism_count
setMechanismEmissionSplitAdminUtils.sudo_set_mechanism_emission_split
setMinBurnV2AdminUtils.sudo_set_min_burn
setOwnerCutEnabledAdminUtils.sudo_set_owner_cut_enabled
setOwnerImmuneNeuronLimitAdminUtils.sudo_set_owner_immune_neuron_limit
setTempoAdminUtils.sudo_set_tempo
trimToMaxAllowedUidsAdminUtils.sudo_trim_to_max_allowed_uids

Each listed AdminUtils call accepts a signed subnet owner as well as Root. The precompile exposes only the signed path and dispatches the highest-level extrinsic so owner limits, freeze windows, and other runtime checks remain in force. Root-only calls are classified as not EVM-callable in the coverage audit.

These functions dispatch the listed highest-level extrinsics as the mapped signed caller.

Source: subnet.sol