WeightsVersionKey
Storage Map v101 → currentRequired version key for setting weights .
Explore chainThe Big Picture
Subnets can require validators to run specific software versions via WeightsVersionKey. If your validator's version key doesn't match, your set_weights call is rejected. This ensures all validators use compatible evaluation logic - preventing stale or buggy validators from corrupting consensus.
Why This Matters
Your weights aren't being accepted? Check WeightsVersionKey. Subnets can require specific versions to ensure fair evaluation. If you're running old software, you'll be rejected until you update.
Example Scenario
Query WeightsVersionKey(netuid=1) returns 2100. Your validator must send version 2100 with set_weights. If your software sends version 2000, the call fails. Update your validator software to the required version.
Common Questions
- What happens if my version is wrong?
- Your set_weights call is rejected with an error. Your weights don't get recorded, which means you don't participate in consensus - potentially losing dividend earnings.
- How do I know what version I'm running?
- Check your bittensor library version. The version key is typically embedded in the library and sent automatically with weight calls.
- Who sets this value?
- Subnet owners can update WeightsVersionKey. When they release new evaluation logic, they bump the version to force validators to update.
- Is 0 a valid value?
- When WeightsVersionKey is 0, version checking is disabled - any version is accepted. This is common on permissive subnets.
Use Cases
- Check if your validator software is compatible
- Debug weight-setting failures due to version mismatch
- Plan software updates when version requirements change
- Build version compatibility checking tools
- Monitor subnet version requirements across the network
Purpose & Usage
Purpose
Ensure validators are running compatible software - weights from outdated software are rejected.
Common Query Patterns
- Query by netuid before setting weights
- Monitor for version changes that require updates
- Verify your software version is compatible
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | key1 | u16 | key1 (u16) |
Stored Value
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 WeightsVersionKey storage
const key1 = 0;
const result = await api.query
[stringCamelCase("SubtensorModule")]
[stringCamelCase("WeightsVersionKey")](
key1
);
console.log("WeightsVersionKey:", result.toHuman());Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v101
- Current Version
- v393