WeightsVersionKeySet

Event Re-added v101 → v127, v133 → v219, v233 → v247, v252 → v265, v273 → v277, v290 → current #32

Emitted when the required weights version key is updated.

View events on chain
Useful for: validatorssubnet ownersminersdevelopersanalytics

The Big Picture

The weights version key is a versioning mechanism that ensures validators are running compatible software. When a subnet owner or admin updates this key, it effectively requires all validators to upgrade to a matching version before they can continue setting weights. This is critical for coordinating breaking changes to consensus logic or weight format - validators running old software would submit incompatible weights that could break consensus.

Why This Matters

If you're a validator and the weights version key changes, you must upgrade your software to continue participating. Failing to upgrade means your weights get rejected and you stop earning. This event is your signal to update immediately.

Example Scenario

Subnet 3 is upgrading its validation logic to version 2.0 which changes how weights are calculated. The subnet owner sets WeightsVersionKey to 2. All validators running v1.x software suddenly can't set weights - their transactions fail. They see WeightsVersionKeySet and know they must upgrade to v2.x. Once upgraded, their weights start working again.

Common Questions

How much time do I have to upgrade after a version change?
You should upgrade immediately. From the moment this event fires, your old weights are rejected. Every tempo without valid weights means lost emissions. Subnet owners sometimes announce changes in advance - follow their communication channels.
What happens if I don't upgrade?
Your set_weights transactions will fail with a version mismatch error. You'll stop receiving emissions and could eventually be pruned for inactivity if you go too long without valid weights.
Can I find out what the new version requires?
The version key itself is just a number. You need to check the subnet's documentation or code repository to understand what changes each version includes.

Use Cases

  • Track when subnet requires validator software updates
  • Monitor version enforcement across subnets
  • Alert validators when their version becomes outdated
  • Coordinate subnet-wide software upgrades

How to Use This Event

  • Monitor your subnet for version changes that require updates
  • Track version evolution across subnets
  • Alert systems that trigger when version key changes

From Chain Metadata

weights version key is set for a network.

Triggers

Effects

Postconditions

  • WeightsVersionKey updated for subnet
  • Only weights with matching version key accepted

Side Effects

  • Validators with old version key cannot set weights
  • Forces validators to upgrade their software

Event Data

#NameTypeDescription
0
arg0
u16 Event field #0 (u16)
1
arg1
u64 Event field #1 (u64)

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 });

// Subscribe to WeightsVersionKeySet events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("SubtensorModule") &&
      event.method === "WeightsVersionKeySet"
    )
    .forEach(({ event }) => {
      console.log("WeightsVersionKeySet:", event.data.toHuman());
    });
});

Version History

v101 block 1 2 args
v133 block 1,404,224 2 args
v233 block 4,920,350 2 args
v252 block 5,163,656 2 args
v273 block 5,659,032 2 args
v290 block 5,947,548 2 args Current

Runtime Info

View Source
Pallet Index
7
Event Index
32
First Version
v101
Current Version
v393