MaxDifficultySet
Event v101 → v127, v133 → v219, v233 → v247, v252 → v265, v273 → v277, v290 → current #34Emitted when maximum POW difficulty is changed.
View events on chainThe 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
Code Examples
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443
const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);
// Subscribe to MaxDifficultySet events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.SubtensorModule.MaxDifficultySet.get(block.hash);
for (const evt of events) {
console.log("MaxDifficultySet:", evt.payload);
}
});Version History
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 34
- First Version
- v101
- Current Version
- v411