DifficultySet
Event Re-added v101 → v219, v233 → v265, v273 → v277, v290 → current #11Emitted when POW registration difficulty is changed.
View events on chainThe Big Picture
Proof-of-work registration lets you join a subnet by solving a computational puzzle instead of burning TAO. The difficulty controls how hard this puzzle is - higher difficulty means more computation (time/electricity) to find a valid solution. Difficulty normally adjusts automatically based on registration rate, but this event fires when it's manually set. Subnet owners might adjust difficulty to control registration pace or in response to unusual conditions.
Why This Matters
POW registration is the 'free' way to join a subnet - you pay with computation instead of TAO. Difficulty determines how much computation you need. A difficulty drop means easier registration (less GPU time). A difficulty spike means harder registration (more GPU time or switching to burn).
Example Scenario
You're mining POW to register on subnet 8. Currently difficulty is 1,000,000 and your GPU finds solutions in about 10 minutes. The subnet owner sets difficulty to 2,000,000. DifficultySet fires. Now your GPU needs about 20 minutes per solution. You might decide to burn TAO instead if time is critical.
Common Questions
- Why would difficulty be manually set instead of auto-adjusting?
- Usually difficulty auto-adjusts based on registration rate. Manual setting happens when the subnet owner wants to override this - perhaps to quickly open registration (lower difficulty) or slow it down (higher difficulty) for some strategic reason.
- What's the relationship between difficulty and GPU time?
- Roughly linear. Double the difficulty = double the expected time to find a solution. But it's probabilistic - you might get lucky quickly or take much longer.
- Should I use POW or burn registration?
- POW costs electricity/time, burn costs TAO directly. Compare your electricity costs and time value against the current burn rate. If you have spare GPU capacity, POW can be cheaper. If time is critical or difficulty is very high, burn might be better.
Use Cases
- Monitor registration difficulty to time your registration
- Track difficulty trends to predict future costs
- Alert when difficulty spikes or drops significantly
- Analyze subnet competitiveness based on difficulty
How to Use This Event
- → Track difficulty on subnets you want to join via POW
- → Monitor for sudden difficulty changes that affect registration strategy
- → Build difficulty history charts for subnets
From Chain Metadata
the difficulty has been set for a subnet.
Triggers
Preconditions
- Caller has admin/sudo privileges
- New difficulty within MinDifficulty and MaxDifficulty bounds
Effects
Postconditions
- Difficulty updated for subnet
- POW registrations must meet new difficulty target
Side Effects
- Affects POW registration computational cost
- May make registration easier or harder immediately
Event Data
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 DifficultySet events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("SubtensorModule") &&
event.method === "DifficultySet"
)
.forEach(({ event }) => {
console.log("DifficultySet:", event.data.toHuman());
});
});On-Chain Activity
Major features with millions of emissions
#26 most emitted event
As of block 7,429,232
Version History
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 11
- First Version
- v101
- Current Version
- v393