LastMechansimStepBlock
Storage Map v101 → v490 · 1 shape changeLast 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
Migration Notes
key type changed from u16 to NetUid
Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.
Query Keys
| # | Name | Type | Description |
|---|---|---|---|
| 1 | netuid | NetUid u16 | netuid (NetUid, hashed key component) |
Stored Value
last_mechanism_step_block (u64)
RAO -> TAO (/ 10^9)
Default Value
Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.
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
1M to 10M writes
#137 most written storage item
Modified by both user extrinsics and runtime hooks
As of block 9,385,000
Version History
- key :
u16→NetUid
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v101
- Current Version
- v490