ValidatorPruneLenSet

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

Emitted when validator prune length is changed.

View events on chain
Useful for: validatorssubnet ownersanalyticsdevelopers

The Big Picture

When subnets are full and new validators want to join, existing validators may be pruned (removed) to make room. The validator prune length controls how many of the worst-performing validators are considered for pruning. A longer prune length means more validators are 'at risk' - even mid-tier validators could be pruned. A shorter length means only the absolute worst performers face removal. This affects how competitive and stable the validator set is.

Why This Matters

As a validator, prune length determines your safety margin. With a short prune length, you only risk removal if you're in the bottom few. With a long prune length, even average performance might not be safe. This affects how aggressively you need to compete.

Example Scenario

Subnet 8 has 64 validators and ValidatorPruneLen was 4 (only bottom 4 at risk). The owner wants more competition and increases it to 16. ValidatorPruneLenSet fires. Now bottom 25% of validators are at risk instead of bottom 6%. Mid-tier validators who felt safe now face real pruning pressure.

Common Questions

When does pruning actually happen?
Pruning happens when new validators want to register on a full subnet. The registration mechanism checks the prune length to determine which validators can be replaced.
How is 'worst performing' determined?
Typically by stake or consensus weight. Validators with less stake or lower consensus scores are considered worse performing. Check your subnet's specific pruning criteria.
Can I avoid pruning with more stake?
Usually yes. Higher stake typically moves you up in the validator ranking, away from the prune zone. Performance also matters - stake alone may not save a very poor performer.

Use Cases

  • Monitor validator pruning policy changes
  • Understand validator slot competition dynamics
  • Plan validator strategy around pruning rules
  • Analyze validator turnover rates

How to Use This Event

  • Monitor prune length on subnets where you validate
  • Track changes that affect validator stability
  • Analyze validator turnover patterns

From Chain Metadata

the validator pruning length has been set.

Triggers

Preconditions

  • Caller has admin/sudo privileges
  • New length is within valid range

Effects

Postconditions

  • ValidatorPruneLen updated for subnet
  • Pruning mechanism uses new length

Side Effects

  • Affects how many validators considered for pruning
  • May increase or decrease validator turnover

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 ValidatorPruneLenSet events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("SubtensorModule") &&
      event.method === "ValidatorPruneLenSet"
    )
    .forEach(({ event }) => {
      console.log("ValidatorPruneLenSet:", 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
20
First Version
v101
Current Version
v393