InitialMaxAllowedUids

Constant Re-added v101 → v377, v385 → current u16

Caps subnet size to ensure network scalability.

Current Value

256
Relevant for: subnet ownersminersvalidatorsdevelopers

The Big Picture

Each subnet has a limited number of slots (UIDs) for miners and validators. This constant sets the initial cap when a subnet is created. Larger subnets allow more participants but increase computational overhead for validators who must evaluate everyone. Subnet owners can adjust this within bounds after creation.

Why This Matters

If you want to join a subnet, you need to know if there's room. Full subnets require you to outperform an existing participant to take their slot (via pruning).

Example

A subnet with MaxAllowedUids of 256 can have at most 256 active neurons. If all slots are full and you register, your registration replaces the lowest-performing neuron. With 4096 UIDs, there's more room but validators have more work evaluating everyone.

Common Questions

Can subnet owners change the maximum?
Yes, via hyperparameter updates, but there are upper limits enforced by the network.
What happens if I'm the 257th registration on a 256-slot subnet?
You don't get rejected - instead, the neuron with the lowest pruning score is removed to make room for you. If you have the lowest score, you get pruned.

From Chain Metadata

Initial maximum allowed network UIDs

Use Cases

  • Registration limits
  • Subnet capacity checks

Value History

VersionBlockChangeValue
v101#1Added4096
v385#7,782,670Changed4096 → 256

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query InitialMaxAllowedUids constant
const value = api.consts[stringCamelCase("SubtensorModule")][stringCamelCase("InitialMaxAllowedUids")];
console.log("InitialMaxAllowedUids:", value.toHuman());

Type Information

Type
u16
Byte Size
2 bytes
Encoding
fixed
Raw Hex
0x0001

Version History

v101 block 1 Added
v385 block 7,782,670 Re-added Current

Runtime Info

Pallet
SubtensorModule
First Version
v101
Latest Version
v101
Current Runtime
v393