Hyperparameters

max_allowed_uids

Neuron slot capacity of the subnet — registrations beyond it prune the lowest-scoring UID.

View as Markdown

max_allowed_uids is the number of neuron slots (UIDs) a subnet has. Subnet owners size it to match how many miners and validators they actually want; participants care because a full subnet means every new registration evicts someone.

How it works

While the neuron count is below max_allowed_uids, a registration simply appends a new UID (append_neuron). Once full, get_neuron_to_prune selects the lowest-emission prunable neuron and replace_neuron hands its slot to the entrant (pallets/subtensor/src/subnets/registration.rs) — see immunity_period for who is protected.

Raising the value with btcli sudo set is straightforward, but lowering it below the current neuron count is rejected (MaxAllowedUIdsLessThanCurrentUIds in pallets/admin-utils/src/lib.rs); the setter also enforces the range between the subnet's minimum and the chain-wide cap of 256. To shrink an occupied subnet, use btcli sudo trim, which calls trim_to_max_allowed_uids (pallets/subtensor/src/subnets/uids.rs): it removes the lowest-emission neurons while preserving temporally and owner-immune UIDs, refuses to act if immune UIDs would exceed 80% of the new capacity, then compacts the surviving UIDs to the left. Trimming is heavily rate-limited (about 30 days between trims).

UID lifecycle playground

A subnet's slot grid, shaded by emission. When it is full, registering prunes the lowest-emission prunable uid. I = inside immunity_period, O = owner-immune, dashed outline = next prune target. Pruning falls back onto immune uids when 2 or fewer non-immune uids remain (chain default: 10). Focused on max_allowed_uids: the grid itself is the capacity — empty slots (+) absorb registrations for free, and once the boundary is hit every entrant must evict someone.

0O
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29I
30I
31I

Press a register button to add a neuron.

Filled / capacity

32 / 32

Immune (new)

3

Within immunity_period

Owner-immune

1 / 1

Never pruned

Next pruned

uid 29

Lowest emission, prunable

32 slots
6 regs
1

Reading and setting

btcli sudo get --netuid N --name max_allowed_uids

The value is a plain integer slot count:

btcli sudo set --netuid N --name max_allowed_uids --value 256

immunity_period, owner_immune_neuron_limit, serving_rate_limit, min_burn, max_regs_per_block