# max_regs_per_block (/docs/hyperparameters/max-regs-per-block)

`max_regs_per_block` caps how many neurons can register on a subnet within
one 12-second block. It is a burst limiter: even when the burn cost is low
and demand spikes, at most this many UIDs can turn over per block, which
protects existing neurons from being pruned en masse in a single block.
Anyone scripting registrations should expect rejections beyond the cap;
root/governance sets it, with a mainnet default of 1
([`SubtensorInitialMaxRegistrationsPerBlock`](/code/runtime/src/lib.rs#L802)
in `runtime/src/lib.rs`).

## How it works [#how-it-works]

Each successful registration increments the `RegistrationsThisBlock`
counter ([`do_register`](/code/pallets/subtensor/src/subnets/registration.rs#L38-L132),
step 11, in
`pallets/subtensor/src/subnets/registration.rs`), and the counter is reset
to zero every block by
[`update_registration_prices_for_networks`](/code/pallets/subtensor/src/subnets/registration.rs#L473-L515)
(same file), which runs in `on_initialize`.

The cap is checked against that counter in two places:

* Root registration:
  [`do_root_register`](/code/pallets/subtensor/src/coinbase/root.rs#L77-L188)
  (`pallets/subtensor/src/coinbase/root.rs`) fails with
  [`TooManyRegistrationsThisBlock`](/code/pallets/subtensor/src/macros/errors.rs#L61)
  when the block's registrations reach
  `get_max_registrations_per_block`, and additionally caps the interval at
  3 × [`target_regs_per_interval`](/docs/hyperparameters/target-regs-per-interval).
* The registration validity helper
  [`checked_allowed_register`](/code/pallets/subtensor/src/lib.rs#L2802-L2823)
  (`pallets/subtensor/src/lib.rs`) reports a subnet as closed for the
  block once the counter reaches the cap, alongside the
  [`registration_allowed`](/docs/hyperparameters/registration-allowed)
  gate and the same 3 × target interval cap.

Because the burn cost also bumps multiplicatively after every registration
in a block ([`burn_increase_mult`](/docs/hyperparameters/burn-increase-mult)),
the price and the cap work together against registration floods.

Drag the cap below to see how it slices bursts block by block:

<HyperparamRegsPerBlockChart />

## Reading and setting [#reading-and-setting]

```
btcli sudo get --netuid N --name max_regs_per_block
```

Root/governance only:
[`sudo_set_max_registrations_per_block`](/code/pallets/admin-utils/src/lib.rs#L950-L970)
in the
AdminUtils pallet requires the root origin and takes a plain integer (u16).
It is not settable by the subnet owner via `btcli sudo set`.

## Related [#related]

[`registration_allowed`](/docs/hyperparameters/registration-allowed) ·
[`target_regs_per_interval`](/docs/hyperparameters/target-regs-per-interval) ·
[`immunity_period`](/docs/hyperparameters/immunity-period) ·
[`max_allowed_uids`](/docs/hyperparameters/max-allowed-uids) ·
[`burn_increase_mult`](/docs/hyperparameters/burn-increase-mult) ·
[`min_burn`](/docs/hyperparameters/min-burn)
