MaxAllowedUids

Storage Map v101 → v490 · 1 shape change

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

From Chain Metadata

MAP ( netuid ) --> max_allowed_uids

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

Migration Notes

v424 v432 Breaking

key type changed from u16 to NetUid

Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.

Query Keys

#NameTypeDescription
1
netuid
NetUid u16netuid (NetUid, hashed key component)

Stored Value

max_allowed_uids (u16)

Default Value

256 0x0001

Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.

Default changed

  • v101 → 4096
  • v385 → 256 Current

Relationships

Modified By

Related Events

Code Examples

import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query MaxAllowedUids storage
const netuid = 1;

const result = await api.query.SubtensorModule.MaxAllowedUids.getValue(netuid);
console.log("MaxAllowedUids:", result);

On-Chain Activity

Write Frequency
●●○○○○ Minimal <10K est. writes

Fewer than 10K writes

#257 most written storage item

Write Source Calls + Hooks

Modified by both user extrinsics and runtime hooks

As of block 9,385,000

Version History

v101 block 1 Added
v425–v431 · runtime versions skipped on chain (never deployed)
v432 block 8,636,190 Shape changed Current
  • key : u16 → NetUid

Runtime Info

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