LastMechansimStepBlock

Storage Map v101 → v411

Last block when emission mechanism stepped.

Explore chain
Queried by: validatorsminersdevelopersanalytics

The Big Picture

Each subnet runs its consensus and emission cycle at its tempo. LastMechansimStepBlock records when that last happened. Combined with Tempo, you can predict when the next cycle will run.

Why This Matters

When was the last payout? When's the next one? LastMechansimStepBlock + Tempo answers this. Useful for timing weight updates and understanding emission cadence.

Example Scenario

Query LastMechansimStepBlock(netuid=1) returns 7000000. Tempo is 100 blocks. Next epoch runs at block 7000100. If current block is 7000050, you're halfway through the current epoch.

Common Questions

What happens at each step?
Yuma Consensus runs, processing all weights to determine ranks, incentives, dividends. Then PendingEmission is distributed based on these scores.
Can steps be delayed?
Steps run automatically based on block timing. They're not delayed, but if the network is congested, block times might vary slightly.

Use Cases

  • Calculate when last emission occurred
  • Predict next epoch based on tempo
  • Debug emission timing issues
  • Build epoch timing displays
  • Synchronize operations with emission cycles

From Chain Metadata

MAP ( netuid ) --> last_mechanism_step_block

Purpose & Usage

Purpose

Track emission distribution timing - when the subnet last ran consensus and paid rewards.

Common Query Patterns

  • Query by netuid
  • Calculate time since last distribution
  • Predict next epoch timing
Part of: Epoch Processing

Query Keys

#NameTypeDescription
1
netuid
u16 netuid (u16, hashed key component)

Stored Value

last_mechanism_step_block (u64)

RAO -> TAO (/ 10^9)

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 LastMechansimStepBlock storage
const netuid = 1;

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

On-Chain Activity

Write Source Runtime Hook

Modified by runtime hooks (e.g., epoch transitions), not directly by user extrinsics

As of block 7,429,232

Version History

v101 block 1 Added
v123 block 720,235 Internal re-bind
v149 block 3,014,339 Internal re-bind
v166–v194 · runtime versions skipped on chain (never deployed)
v195 block 3,791,350 Internal re-bind
v278–v289 · runtime versions skipped on chain (never deployed)
v290 block 5,947,548 Internal re-bind Current

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v101
Current Version
v411