WeightsSetRateLimitSet

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

Emitted when the rate limit for setting weights is changed.

View events on chain
Useful for: validatorssubnet ownersanalyticsdevelopers

The Big Picture

Validators can't spam weight updates - they're rate limited. This parameter sets how many blocks must pass between weight submissions. Lower limits allow faster updates (more responsive consensus but more chain load). Higher limits force slower updates (less responsive but lighter chain load). Subnet owners tune this for their needs.

Why This Matters

If you submit weights too soon after your last submission, the transaction fails. The rate limit sets your minimum interval. Changes affect your validation cadence - a longer limit means you can update less frequently, which might delay your response to miner quality changes.

Example Scenario

Subnet 7 had a 100-block rate limit (~20 minutes). To reduce chain spam, it's increased to 200 blocks (~40 minutes). WeightsSetRateLimitSet fires. Your validator that was updating every 20 minutes must now wait 40 minutes between updates. Adjust your timing accordingly.

Common Questions

What happens if I try to set weights before the limit expires?
Your transaction fails with a rate limit error. You lose the transaction fee and your weights don't update. Wait until the limit passes.
Does the rate limit apply to commit-reveal separately?
Typically yes - commits and reveals have their own timing. But check your subnet's specific implementation for how rate limits interact with commit-reveal.
Can I check my remaining cooldown?
Track your last weight-set block and compare to current block. If current - last >= limit, you can submit. Otherwise, wait.

Use Cases

  • Track how often validators can update weights
  • Plan validation frequency around rate limits
  • Monitor subnet consensus update policies
  • Build rate-limit-aware validator automation

How to Use This Event

  • Monitor rate limits on subnets you validate
  • Build rate-limit-aware validation timing
  • Track rate limit policies across subnets

From Chain Metadata

weights set rate limit has been set for a subnet.

Triggers

Effects

Postconditions

  • WeightsSetRateLimit updated for subnet

Side Effects

  • Validators must wait longer between weight updates

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 WeightsSetRateLimitSet events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("SubtensorModule") &&
      event.method === "WeightsSetRateLimitSet"
    )
    .forEach(({ event }) => {
      console.log("WeightsSetRateLimitSet:", event.data.toHuman());
    });
});

Version History

v101 block 1 2 args
v133 block 1,404,224 2 args
v233 block 4,920,350 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
22
First Version
v101
Current Version
v393