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
From Chain Metadata
MAP ( netuid ) --> max_weight_limit
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | netuid | u16 | netuid (u16, hashed key component) |
Stored Value
max_weight_limit (u16)
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 MaxWeightsLimit storage
const netuid = 1;
const result = await api.query.SubtensorModule.MaxWeightsLimit.getValue(netuid);
console.log("MaxWeightsLimit:", result);Version History
v101 block 1 Added
v123 block 720,235 Internal re-bind
v149 block 3,014,339 Internal re-bind
v166–v194 · runtime versions skipped on chain (never deployed)
v195 block 3,791,350 Internal re-bind
v278–v289 · runtime versions skipped on chain (never deployed)
v290 block 5,947,548 Internal re-bind Current
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v101
- Current Version
- v411