MinAllowedWeights

Storage Map v101 → v490 · 1 shape change

Minimum weights a validator must set.

Explore chain
Queried by: validatorsdeveloperssubnet owners

The Big Picture

Validators must evaluate a minimum number of neurons. This prevents validators from focusing on only a few favorites and ensures broader consensus participation. Sparse weight matrices would undermine the distributed evaluation system.

Why This Matters

Setting weights? You must weight at least this many neurons. Too few weights = rejected submission. Ensures validators actually evaluate the network.

Example Scenario

Query MinAllowedWeights(netuid=1) returns 100. Your set_weights call must include at least 100 UIDs. Setting weights on only 50 neurons will fail.

Common Questions

What if there aren't enough neurons?
If SubnetworkN < MinAllowedWeights, you weight all neurons. The minimum is capped by actual neuron count.
Can I weight UIDs with zero weight?
Typically yes - zero weight still counts toward the minimum. You're evaluating them as 'not worthy' rather than ignoring them.

Use Cases

  • Check minimum weights required before setting
  • Build weight validation in validator software
  • Understand consensus participation requirements
  • Debug weight rejection errors
  • Design subnet weight parameters

From Chain Metadata

MAP ( netuid ) --> min_allowed_weights

Purpose & Usage

Purpose

Prevent sparse weight matrices - validators must evaluate at least this many neurons.

Common Query Patterns

  • Query by netuid
  • Validate weight submissions
  • Plan weight-setting strategy

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

min_allowed_weights (u16)

Default Value

1024 0x0004

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

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 MinAllowedWeights storage
const netuid = 1;

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

On-Chain Activity

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

Fewer than 10K writes

#258 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