Documentation index

Slot Subscriptions

Stream slot progression events as the validator processes, confirms, and finalizes slots. Each slot emits multiple updates as it moves through the commitment pipeline: Processed, Confirmed, Finalized, and optionally Rooted. Dead slots (skipped by the leader) also emit an update with an error message.

Slot subscriptions provide the foundation for timing-sensitive applications. Use them to measure validator latency, track confirmation times, detect leader schedule gaps, and coordinate operations that depend on specific commitment levels.

Filter Parameters

ParameterTypeRequiredDescription
filter_by_commitmentboolNoIf true, only emit updates at the subscription's commitment level. If false, emit all status transitions (Processed, Confirmed, Finalized).
interleaveboolNoIf true, interleave slot updates with other subscription types in order.

Update Payload

FieldTypeDescription
slotuint64The slot number
parentuint64The parent slot number
statusCommitmentLevelThe new status: Processed (0), Confirmed (1), Finalized (2), or Rooted (3)
dead_errorstring (nullable)If the slot was dead (skipped), contains the error reason

Code Examples

Track All Slot Status Transitions (Node.js)

JavaScript
stream.write({
  accounts: {},
  slots: {
    allSlots: {
      filter_by_commitment: false  // Get all status transitions
    }
  },
  transactions: {},
  transactionsStatus: {},
  blocks: {},
  blocksMeta: {},
  commitment: 0,  // Processed -- see all updates
  entry: {},
  accountsDataSlice: [],
  ping: null
});

stream.on('data', (update) => {
  if (update.slot) {
    const slot = update.slot;
    const statusNames = ['Processed', 'Confirmed', 'Finalized', 'Rooted'];
    console.log('Slot ' + slot.slot + ' -- ' + statusNames[slot.status] + ' (parent: ' + slot.parent + ')');
    if (slot.dead_error) {
      console.log('  Dead slot:', slot.dead_error);
    }
  }
});

Monitor Slot Progression with Status (Rust)

Rust
use yellowstone_grpc_client::GeyserGrpcClient;
use yellowstone_grpc_proto::prelude::*;
use std::collections::HashMap;
use futures::StreamExt;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let mut client = GeyserGrpcClient::build_from_uri("http://88.216.36.108:10001")
        .connect()
        .await?;

    let mut slots = HashMap::new();
    slots.insert("allSlots".to_string(), SubscribeRequestFilterSlots {
        filter_by_commitment: Some(false),
        interleave: None,
    });

    let request = SubscribeRequest {
        accounts: HashMap::new(),
        slots,
        transactions: HashMap::new(),
        transactions_status: HashMap::new(),
        blocks: HashMap::new(),
        blocks_meta: HashMap::new(),
        commitment: Some(CommitmentLevel::Processed as i32),
        entry: HashMap::new(),
        accounts_data_slice: vec![],
        ping: None,
        from_slot: None,
    };

    let (_, mut stream) = client.subscribe_with_request(Some(request)).await?;

    while let Some(msg) = stream.next().await {
        match msg?.update_oneof {
            Some(UpdateOneof::Slot(slot)) => {
                let status = match slot.status {
                    0 => "Processed",
                    1 => "Confirmed",
                    2 => "Finalized",
                    3 => "Rooted",
                    _ => "Unknown",
                };
                println!("Slot {} -- {} (parent: {})", slot.slot, status, slot.parent.unwrap_or_default());
                if let Some(err) = &slot.dead_error {
                    println!("  Dead slot: {}", err);
                }
            }
            _ => {}
        }
    }

    Ok(())
}

Common Use Cases

Use CaseFilter Configuration
Track all slot transitionsfilter_by_commitment: false with commitment Processed
Only finalized slotsfilter_by_commitment: true with commitment Finalized
Measure confirmation latencyTrack time between Processed and Confirmed for one slot
Detect dead/skipped slotsCheck dead_error field for non-null values
Validator health monitorTrack slot production rate and gap between processed and finalized
Leader schedule trackerCorrelate slot numbers with expected leader schedule