CurrentSlot
Storage Plain v101 → currentThe current slot number for block production.
Explore chainThe Big Picture
In Aura consensus, time is divided into slots. Each slot has a designated authority who should produce a block. CurrentSlot tells you which slot the chain is currently in. Combined with Authorities and SlotDuration, you can determine who should be producing blocks now.
Why This Matters
Which authority should produce the next block? (CurrentSlot % len(Authorities)) gives you the index. This is how Aura coordinates block production without explicit communication.
Example Scenario
Query CurrentSlot() returns 7891234. If there are 4 authorities, authority at index (7891234 % 4) = 2 should produce this slot's block.
Common Questions
- How fast do slots advance?
- One slot per SlotDuration milliseconds. At 12000ms (12 seconds), that's one slot per 12 seconds.
- What if the expected authority doesn't produce?
- The slot passes empty and the next slot begins. The chain continues with the next authority.
- Is slot number the same as block number?
- Not necessarily. If blocks are missed (empty slots), slot number advances faster than block number. Slot is time-based; block number counts actual blocks.
Use Cases
- Determine which authority should produce the current block
- Monitor block production timing
- Debug consensus synchronization issues
- Build block production monitoring tools
- Research consensus behavior
From Chain Metadata
The current slot of this block. This will be set in `on_initialize`.
Purpose & Usage
Purpose
Track which slot we're in for Aura consensus - determines which authority should produce the current block.
Common Query Patterns
- Query current slot
- Calculate expected block producer
- Monitor slot progression
Stored Value
Current slot number for Aura consensus
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 CurrentSlot storage (no keys - plain value)
const result = await api.query
[stringCamelCase("Aura")]
[stringCamelCase("CurrentSlot")]();
console.log("CurrentSlot:", result.toHuman());Runtime Info
- Pallet
- Aura
- Storage Kind
- Plain
- First Version
- v101
- Current Version
- v393