LastRateLimitedBlock

Storage Map v273 → current

Block of last rate-limited operation by key type.

Explore chain
Queried by: developers

The Big Picture

Many operations are rate-limited. This storage tracks the last block for each rate-limited operation type, enabling the chain to enforce cooldowns.

Use Cases

  • Check rate limit status
  • Debug rate limit errors
  • Build rate-aware tooling

From Chain Metadata

============================ ==== Rate Limiting ===== ============================ MAP ( RateLimitKey ) --> Block number in which the last rate limited operation occured

Purpose & Usage

Purpose

General rate limiting tracking for various operations.

Common Query Patterns

  • Query by rate limit key

Query Keys

#NameTypeDescription
1
key1
RateLimitKey key1 (RateLimitKey)

Stored Value

Value in RAO (÷10⁹ for TAO)

RAO -> TAO (/ 10^9)

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 LastRateLimitedBlock storage
const key1 = 0 as any /* RateLimitKey */;

const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("LastRateLimitedBlock")](
  key1
);

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

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v273
Current Version
v393