CurrentSlot

Storage Plain v101 → current

The current slot number for block production.

Explore chain
Queried by: validatorsdevelopersanalytics

The 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

Default Value

0 0x0000000000000000

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 CurrentSlot storage (no keys - plain value)
const result = await api.query.Aura.CurrentSlot.getValue();
console.log("CurrentSlot:", result);

On-Chain Activity

Write Frequency
●●●●●○ High 1M–10M est. writes

1M to 10M writes

#93 most written storage item

Write Source Runtime Hook

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

As of block 9,385,000

Runtime Info

Pallet
Aura
Storage Kind
Plain
First Version
v101
Current Version
v490