MaxWeightsLimit

Storage Map v101 → current

Maximum weights a validator can set.

Explore chain
Queried by: validatorsdeveloperssubnet owners

The Big Picture

Validators can't weight unlimited neurons. MaxWeightsLimit caps how many UIDs can receive non-zero weights. This focuses validator attention and prevents computational explosion in consensus calculations.

Why This Matters

Setting weights? You can't weight more than this many neurons. Forces focused evaluation rather than weighting everything.

Example Scenario

Query MaxWeightsLimit(netuid=1) returns 512. Your set_weights call can include at most 512 UIDs with non-zero weights. More will be rejected or truncated.

Common Questions

Why limit weights?
Computational efficiency. Consensus calculations scale with weight matrix size. Also forces validators to prioritize - who actually deserves weight?
What if I want to weight everyone?
You can't if there are more neurons than MaxWeightsLimit. Prioritize the best performers and leave others at zero.

Use Cases

  • Check maximum weights allowed before setting
  • Build weight validation in validator software
  • Understand consensus participation limits
  • Debug weight rejection errors
  • Design subnet weight parameters

Purpose & Usage

Purpose

Limit weight matrix density - prevents validators from weighting too many neurons.

Common Query Patterns

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

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

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

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

Runtime Info

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