in-solana by Supanode

getLeaderSchedule — Solana RPC Method

getLeaderSchedule returns the leader schedule for an epoch, mapping validator identities to their assigned slot indices within the epoch. This tells you which validator is responsible for producing a block in each slot.

Parameters

NameTypeRequiredDescription
slotu64NoAny slot within the epoch to query. If omitted, defaults to the current epoch.
commitmentstringNoprocessed, confirmed, or finalized. Default: finalized.
identitystringNoFilter results to a single validator identity (base-58 public key).

Request

curl -X POST https://api.mainnet-beta.solana.com \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getLeaderSchedule",
    "params": []
  }'

TypeScript (@solana/kit)

import { createSolanaRpc, address } from "@solana/kit";

const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const schedule = await rpc
  .getLeaderSchedule({
    identity: address("dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB"),
  })
  .send();

if (schedule) {
  for (const [identity, slots] of Object.entries(schedule)) {
    console.log(`${identity}: ${slots.length} leader slots`);
  }
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB": [0, 1, 2, 3, 100, 101, 102, 103],
    "85iYT5RuzRTDgjyRa3cP8SYhM2j21fj7NhfJ3peu1DPr": [4, 5, 6, 7, 104, 105, 106, 107]
  },
  "id": 1
}
FieldTypeDescription
resultobject or nullMap of validator identity → array of slot indices (0-based within the epoch). null if the leader schedule is not yet available.

The slot indices are relative to the start of the epoch, not absolute slot numbers. To convert to absolute slots: absoluteSlot = epochStartSlot + slotIndex.

Common errors

  • Schedule not available — the leader schedule for a future epoch may not be computed yet. Returns null.
  • Invalid identity — a malformed public key returns a parse error.

Performance

Without the identity filter, the response includes every validator’s assigned slots. On mainnet with 1,500+ validators and 432,000 slots per epoch, this response can be several megabytes. Use the identity filter when you only need one validator’s schedule.

FAQ

How are leader slots assigned? Slots are assigned proportionally to stake. A validator with 1% of the total stake gets approximately 1% of the leader slots (about 4,320 slots per epoch on mainnet).

How far in advance is the schedule computed? The leader schedule is computed at the start of the epoch for the next epoch (one epoch ahead). You can query the current epoch’s schedule and the next epoch’s schedule.

What are slot indices? The numbers in the result are 0-based indices within the epoch. Slot index 0 is the first slot of the epoch. Add the epoch’s start slot to get the absolute slot number.

Why do validators get consecutive slots? Validators are typically assigned 4 consecutive slots at a time. This allows them to produce a sequence of blocks without handoff overhead.

Can the leader schedule change within an epoch? No. Once computed, the leader schedule is fixed for the entire epoch. The schedule only changes at epoch boundaries based on the updated stake distribution.

Parameters

ParameterTypeRequiredDescriptionDefault
slotu64NoA slot in the epoch to query. Defaults to the current epoch.—
commitmentstringNoCommitment level: processed, confirmed, or finalized.finalized
identitystringNoOnly return slots assigned to this validator identity (base-58 public key).—

Updated: