MaxDifficultySet

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

Emitted when maximum POW difficulty is changed.

View events on chain
Useful for: minersvalidatorssubnet ownersanalyticsdevelopers

The Big Picture

PoW difficulty can spike during high demand, but there's a ceiling - it can't go above MaxDifficulty. This protects registrants from impossibly hard puzzles during demand surges. Even if competition is fierce, the difficulty is capped at a solvable level.

Why This Matters

MaxDifficulty is the hardest PoW registration can get. Even during massive demand, difficulty won't exceed this. Understanding the ceiling helps you estimate maximum GPU time/electricity costs and decide if PoW is viable even in worst-case conditions.

Example Scenario

Subnet 9 had MaxDifficulty of 10,000,000 making PoW impractical during high demand. They lower it to 5,000,000. MaxDifficultySet fires. Even during busy periods, PoW is now more feasible - the worst-case solve time is cut roughly in half.

Common Questions

What happens if demand would push difficulty above MaxDifficulty?
It's capped at MaxDifficulty. Registration throughput might not keep up with demand, but individual puzzles don't get harder than the cap.
Is MaxDifficulty common to hit?
On hot subnets with lots of PoW registrations, yes. On quieter subnets, you might never see it. Track historical difficulty to understand your subnet.
If difficulty is at max, should I switch to burn?
Compare: MaxDifficulty PoW cost (electricity, time) vs current burn cost. Sometimes burn is cheaper at max difficulty; sometimes PoW still wins. Calculate for your situation.

Use Cases

  • Track maximum PoW registration costs
  • Plan GPU resource allocation with difficulty ceiling
  • Monitor subnet PoW economics
  • Build registration planning tools

How to Use This Event

  • Track maximum difficulty as worst-case PoW cost
  • Monitor ceiling changes affecting registration planning
  • Build difficulty prediction tools

From Chain Metadata

setting max difficulty on a network.

Triggers

Preconditions

  • Caller has admin/sudo privileges

Effects

Postconditions

  • MaxDifficulty updated for subnet

Side Effects

  • Sets ceiling for POW difficulty

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