UsedSpaceOf

Storage Map v257 → current

Tracks commitment space usage for rate limiting.

Explore chain
Queried by: validatorsminersdevelopers

The Big Picture

To prevent commitment spam, each account has a space limit per interval tracked here.

Use Cases

  • Check available commitment space before submission
  • Debug space limit errors

From Chain Metadata

Maps (netuid, who) -> usage (how many “bytes” they've committed) in the RateLimit window

Purpose & Usage

Purpose

Prevent spam by limiting how much commitment data each account can store per interval.

Common Query Patterns

  • Query to check remaining space before submitting
Part of: On-Chain Commitments

Query Keys

#NameTypeDescription
1
key1
u16 key1 (u16)
2
key2
AccountId key2 (AccountId) (hex -> SS58)

Stored Value

value (UsageTracker)

Relationships

Modified By

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

// Query UsedSpaceOf storage
const key1 = 0;
const key2 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query
  [stringCamelCase("Commitments")]
  [stringCamelCase("UsedSpaceOf")](
  key1,
  key2
);

console.log("UsedSpaceOf:", result.toHuman());

Runtime Info

View Source
Pallet
Commitments
Storage Kind
Map
First Version
v257
Current Version
v393