sudo_set_max_difficulty

Call v138 → current #5

Sets the maximum POW difficulty for a subnet .

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: subnet owners

The Big Picture

Sets a ceiling for POW registration difficulty. Prevents difficulty from becoming prohibitively high during demand spikes.

Use Cases

  • Preventing runaway difficulty
  • Capping registration barriers

Input Parameters

#NameTypeDescription
0
netuid
u16 Subnet/network identifier (0-65535)
1
max_difficulty
u64 max_difficulty (u64)

Permissions

Origin
Root
Required Role

Requirements

  • Caller is root or subnet owner
  • Subnet exists
  • Value >= min_difficulty

Effects

Storage Modified

Postconditions

  • MaxDifficulty updated for subnet

Side Effects

  • Registration difficulty cannot exceed this ceiling

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 });

// Build sudo_set_max_difficulty call
const netuid = 1;
const max_difficulty = 0;

const call = api.tx[stringCamelCase("AdminUtils")][stringCamelCase("sudo_set_max_difficulty")](
  netuid,
  max_difficulty
);

Runtime Info

View Source
Pallet Index
19
Call Index
5
First Version
v138
Current Version
v393