MaxAllowedUids

Storage Map v101 → current

Maximum neurons allowed on subnet .

Explore chain
Queried by: minersvalidatorssubnet ownersdevelopersanalytics

The Big Picture

Each subnet has a fixed number of slots (MaxAllowedUids). UIDs range from 0 to MaxAllowedUids-1. When full, new registrations must replace existing neurons via pruning. This creates the competitive pressure that drives quality - slots are scarce, so only good performers keep them.

Why This Matters

How many neurons compete on this subnet? MaxAllowedUids tells you the size of the playing field. Compare to current registrations (SubnetworkN) to see if there's room or if you'll need to beat someone.

Example Scenario

Query MaxAllowedUids(netuid=1) returns 256. This subnet has 256 neuron slots. Query SubnetworkN(netuid=1) and if it returns 256, the subnet is full - new registrations will prune the lowest performer.

Common Questions

Can this change?
Yes, subnet owners can adjust MaxAllowedUids within protocol limits. Increasing it opens more slots; decreasing it may trigger pruning of lowest performers.
What's a typical value?
Common values range from 64 to 4096 depending on the subnet's design. Smaller subnets are more competitive per slot; larger subnets allow more participants.
How does this affect earnings?
More neurons = more competition = smaller share per neuron (if emissions are fixed). But larger subnets may also have more total activity and emissions.
Is there a relationship with validators?
MaxAllowedValidators limits how many of these UIDs can be validators. The rest are miners.

Use Cases

  • Check if a subnet has room for new registrations
  • Understand subnet scale and competition level
  • Plan registration strategy based on capacity
  • Design subnet parameters for desired network size
  • Build subnet capacity and utilization dashboards

Purpose & Usage

Purpose

Control subnet capacity - the total number of neuron slots available.

Common Query Patterns

  • Query by netuid to check capacity
  • Compare with SubnetworkN to see available slots
  • Plan registration based on capacity
Part of: Neuron RegistrationNeuron Pruning

Query Keys

#NameTypeDescription
1
key1
u16 key1 (u16)

Stored Value

value (u16)

Relationships

Modified By

Related Events

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 MaxAllowedUids storage
const key1 = 0;

const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("MaxAllowedUids")](
  key1
);

console.log("MaxAllowedUids:", result.toHuman());

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v101
Current Version
v393