LastMechansimStepBlock
Storage Map v101 → v411Last block when emission mechanism stepped.
Explore chainThe 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
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | netuid | u16 | netuid (u16, hashed key component) |
Stored Value
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
Modified by runtime hooks (e.g., epoch transitions), not directly by user extrinsics
As of block 7,429,232
Version History
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v101
- Current Version
- v411