Ensures validators run compatible software.
Current Value
0Relevant for: validatorssubnet ownersdevelopers
The Big Picture
When validators set weights, they must include a version key matching the subnet's expected version. This ensures validators run compatible software. If a subnet updates its validation mechanism, it increments the version key, forcing validators to update before they can continue setting weights.
Why This Matters
If your validator uses outdated software, your set_weights calls will fail version validation. Keep your validator software updated to match the subnet's expected version.
Example
A subnet updates from validation v2 to v3, changing WeightsVersionKey from 2 to 3. Validators still running v2 software have their set_weights calls rejected until they upgrade. This forces coordinated upgrades.
Common Questions
- How do I find the current version key?
- Query WeightsVersionKey storage for your subnet. Your validator software should include this in set_weights calls.
- What if I'm running old software?
- Your weight-setting calls fail. You won't earn emissions until you upgrade. The subnet continues without you until you update.
Use Cases
- Weight validation
- Version checks
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 InitialWeightsVersionKey constant
const value = await api.constants.SubtensorModule.InitialWeightsVersionKey();
console.log("InitialWeightsVersionKey:", value);
// Balance: divide by 10^9 for TAO
const tao = value / 1_000_000_000n;Type Information
- Type
- u64
- Byte Size
- 8 bytes
- Encoding
- fixed
- Raw Hex
- 0x0000000000000000
Runtime Info
- Pallet
- SubtensorModule
- First Version
- v101
- Latest Version
- v101
- Current Runtime
- v411