ColdkeySwapDisputes

Storage Map v385 → current

Coldkeys whose pending swap has been disputed, with the block the dispute was raised. From v482 a value of zero is a recovery lock instead.

Explore chain
Queried by: stakerswalletsexchangesanalyticsdevelopers

The Big Picture

CheckColdkeySwap tests this map before the allowed-call list, which is why a dispute beats the exemption that normally lets the swap calls through.

Why This Matters

The two swap blocks fail differently and need different handling. An announced coldkey can still finish or abandon its rotation. A disputed one can do nothing at all until root intervenes, so retrying is pointless.

Example Scenario

Every call from a coldkey is rejected, including clear_coldkey_swap_announcement. A non-zero entry here is the reason. ColdkeySwapReset marks its end by a root reset; a root swap_coldkey ends it with ColdkeySwapped.

Use Cases

  • Treat an account as fully halted rather than retryable
  • Monitor for contested key rotations

From Chain Metadata

A map of the coldkey swap disputes from a coldkey to the block number the coldkey swap was disputed.

Purpose & Usage

Purpose

A non-zero entry marks a coldkey as fully halted pending manual resolution and blocks every call from it, including the swap lifecycle calls. From v482 a zero entry, written by reset_coldkey_swap_keep_locked, keeps the coldkey restricted to announcing, disputing, executing and submit_encrypted even with no announcement.

Common Query Patterns

  • Distinguish a halted coldkey from a merely restricted one
  • Explain a call failing with ColdkeySwapDisputed
  • Find accounts awaiting governance resolution

Notes

  • First appears at runtime v385.
  • Optional. Absent means no dispute.
  • Removed by the root calls reset_coldkey_swap and swap_coldkey, and from v482 by a successful swap_coldkey_announced to a different coldkey. reset_coldkey_swap_keep_locked (v482) overwrites it with zero. There is no timeout.
  • From v488 HashedAccounts.register of a classical account also removes that account entry, with no SubtensorModule event (on_register, runtime/src/hashed_auth.rs L869-L870 at d967d1358, runtime v490).
  • clear_coldkey_swap_announcement does not touch this map, so clearing an announcement does not lift a dispute, and from v482 a recovery-locked coldkey cannot submit the clear at all.
  • From v482 dispute_coldkey_swap writes max(now, 1), so a real dispute is never zero, and CheckColdkeySwap reads this map before the announcement map, so the lock holds with no announcement. Through v481 the check applied only while an announcement existed. Source: guards/check_coldkey_swap.rs and macros/dispatches.rs at 8cf229f8e (v482).
Part of: Coldkey Swap

Query Keys

#NameTypeDescription
1
coldkey coldkey
raw: key1
AccountId [u8; 32]key1 (AccountId) (hex -> SS58)

Stored Value

value (u32)

Default Value

None (absent keys return no value)

Optional storage: querying a key that has never been written returns no value (None) — do not assume a zero default.

Relationships

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

// Query ColdkeySwapDisputes storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.SubtensorModule.ColdkeySwapDisputes.getValue(key1);
console.log("ColdkeySwapDisputes:", result);

On-Chain Activity

Write Frequency
●●○○○○ Minimal <10K est. writes

Fewer than 10K writes

#332 most written storage item

Write Source User Extrinsics

Modified via user-submitted extrinsics

As of block 9,385,000

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v385
Current Version
v490