Skip to main content

Overview

Slot messages provide updates about slot progression and status changes on the Solana blockchain. Slots are the fundamental unit of time in Solana, occurring approximately every 400ms.

SubscribeUpdateSlot

Slot status update message.
message SubscribeUpdateSlot {
  uint64 slot = 1;
  optional uint64 parent = 2;
  SlotStatus status = 3;
  optional string dead_error = 4;
}

Fields

slot
uint64
required
The slot number being updated.
parent
uint64
The parent slot number. Most slots have a parent, but this field may be absent in certain edge cases (e.g., genesis slot).
status
SlotStatus
required
The current status of this slot. See SlotStatus below for possible values.
dead_error
string
Error message if the slot is marked as dead (status = SLOT_DEAD). Describes why the slot was abandoned. Empty for other statuses.

Examples

Processed Slot

{
  "slot": 250000000,
  "parent": 249999999,
  "status": "SLOT_PROCESSED"
}

Confirmed Slot

{
  "slot": 250000000,
  "parent": 249999999,
  "status": "SLOT_CONFIRMED"
}

Finalized Slot

{
  "slot": 250000000,
  "parent": 249999999,
  "status": "SLOT_FINALIZED"
}

Dead Slot

{
  "slot": 250000000,
  "parent": 249999999,
  "status": "SLOT_DEAD",
  "dead_error": "TooManyDuplicateShreds"
}

SlotStatus

Enum defining the possible states of a slot.
enum SlotStatus {
  SLOT_PROCESSED = 0;
  SLOT_CONFIRMED = 1;
  SLOT_FINALIZED = 2;
  SLOT_FIRST_SHRED_RECEIVED = 3;
  SLOT_COMPLETED = 4;
  SLOT_CREATED_BANK = 5;
  SLOT_DEAD = 6;
}

Status Values

SLOT_PROCESSED
0
The slot has been processed by a validator. This is the earliest status indicating that transactions in this slot have been executed. May still be subject to rollback.
SLOT_CONFIRMED
1
The slot has been confirmed by a supermajority of the cluster. More reliable than processed, but still potentially subject to rollback in extreme circumstances.
SLOT_FINALIZED
2
The slot has been finalized (rooted). This is the final state for a valid slot. Once finalized, a slot is permanent and cannot be rolled back.
SLOT_FIRST_SHRED_RECEIVED
3
The first shred (packet of data) for this slot has been received. This is the earliest signal that work on a slot has begun. Only sent if you enable interslot_updates in your slot filter.
SLOT_COMPLETED
4
All shreds for the slot have been received and the slot is complete. Only sent if you enable interslot_updates in your slot filter.
SLOT_CREATED_BANK
5
A bank (execution context) has been created for this slot. Only sent if you enable interslot_updates in your slot filter.
SLOT_DEAD
6
The slot has been marked as dead and abandoned. This can happen for various reasons (e.g., fork, duplicate shreds, validator errors). Check the dead_error field for details.

Status Progression

Slots typically progress through these states:
  1. SLOT_FIRST_SHRED_RECEIVED (if interslot_updates enabled) - First data received
  2. SLOT_CREATED_BANK (if interslot_updates enabled) - Execution context created
  3. SLOT_COMPLETED (if interslot_updates enabled) - All data received
  4. SLOT_PROCESSED - Transactions executed
  5. SLOT_CONFIRMED - Confirmed by supermajority
  6. SLOT_FINALIZED - Permanently finalized
Alternatively, at any point:
  • SLOT_DEAD - Slot abandoned

Subscription Options

Basic Slot Subscription

Receive only major status updates (processed, confirmed, finalized):
{
  "slots": {
    "all_slots": {}
  },
  "commitment": "CONFIRMED"
}

Commitment-Filtered Slots

Receive only updates matching your commitment level:
{
  "slots": {
    "finalized_only": {
      "filter_by_commitment": true
    }
  },
  "commitment": "FINALIZED"
}

Inter-Slot Updates

Receive all status updates including intermediate states:
{
  "slots": {
    "detailed_slots": {
      "interslot_updates": true
    }
  }
}

Both Options Combined

{
  "slots": {
    "filtered_detailed": {
      "filter_by_commitment": true,
      "interslot_updates": true
    }
  },
  "commitment": "CONFIRMED"
}

Use Cases

Tracking Chain Progress

Monitor slot progression to track blockchain progress:
if (update.slot) {
  const slot = update.slot;
  console.log(`Slot ${slot.slot}: ${slot.status}`);
  
  if (slot.status === 'SLOT_FINALIZED') {
    console.log(`Slot ${slot.slot} is now permanent`);
  }
}

Detecting Forks and Rollbacks

Monitor dead slots to detect potential chain issues:
if (update.slot && update.slot.status === 'SLOT_DEAD') {
  console.warn(`Slot ${update.slot.slot} was abandoned: ${update.slot.dead_error}`);
  // Handle potential rollback
}

Measuring Slot Timing

Use inter-slot updates to measure slot production timing:
const slotTiming = {};

if (update.slot) {
  const slot = update.slot.slot;
  const status = update.slot.status;
  
  if (!slotTiming[slot]) {
    slotTiming[slot] = {};
  }
  
  slotTiming[slot][status] = Date.now();
  
  if (status === 'SLOT_FINALIZED' && slotTiming[slot]['SLOT_FIRST_SHRED_RECEIVED']) {
    const duration = slotTiming[slot]['SLOT_FINALIZED'] - slotTiming[slot]['SLOT_FIRST_SHRED_RECEIVED'];
    console.log(`Slot ${slot} took ${duration}ms from first shred to finalization`);
  }
}

Commitment-Based Processing

Process data based on slot commitment level:
if (update.slot) {
  const slot = update.slot;
  
  switch (slot.status) {
    case 'SLOT_PROCESSED':
      // Fast but potentially unstable data
      console.log('Processing slot data (may rollback)');
      break;
    case 'SLOT_CONFIRMED':
      // More stable data
      console.log('Confirmed slot data (unlikely to rollback)');
      break;
    case 'SLOT_FINALIZED':
      // Permanent data
      console.log('Finalized slot data (permanent)');
      break;
  }
}

Understanding Slot vs Block

  • Slot: A fixed time period (~400ms) in which a leader validator can produce a block
  • Block: The actual data produced during a slot
Not all slots produce blocks (a slot can be skipped), but when they do, the block number equals the slot number.

Build docs developers (and LLMs) love