in-solana by Supanode

getSlotLeaders — Solana RPC Method

getSlotLeaders returns an array of validator identity public keys for a sequence of slots, starting at the given slot. Each entry in the array is the leader for that slot.

Parameters

NameTypeRequiredDescription
start_slotu64YesStart slot, inclusive.
limitu64YesNumber of leaders to return. Maximum 5,000.

Request

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

TypeScript (@solana/kit)

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

const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const leaders = await rpc.getSlotLeaders(341200000n, 10n).send();

leaders.forEach((leader, i) => {
  console.log(`Slot ${341200000 + i}: ${leader}`);
});

Response

{
  "jsonrpc": "2.0",
  "result": [
    "ENvAW7JScgYq6o4zKZwewtkzzJgDzQ1GFNj4GTZLjQpU",
    "ENvAW7JScgYq6o4zKZwewtkzzJgDzQ1GFNj4GTZLjQpU",
    "ENvAW7JScgYq6o4zKZwewtkzzJgDzQ1GFNj4GTZLjQpU",
    "ENvAW7JScgYq6o4zKZwewtkzzJgDzQ1GFNj4GTZLjQpU",
    "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
    "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
    "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
    "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB",
    "85iYT5RuzRTDgjyRa3cP8SYhM2j21fj7NhfJ3peu1DPr",
    "85iYT5RuzRTDgjyRa3cP8SYhM2j21fj7NhfJ3peu1DPr"
  ],
  "id": 1
}
FieldTypeDescription
resultstring[]Array of base-58 encoded validator identity public keys, one per slot starting from start_slot.

Notice that leaders appear in groups of 4 consecutive slots — this is the standard leader rotation pattern.

Common errors

  • Limit too large — exceeding 5,000 returns an error.
  • Schedule not available — requesting slots far in the future (beyond the next epoch) may fail if the leader schedule is not yet computed.

Performance

The response contains up to 5,000 public key strings. Even at maximum limit, the response is a few hundred KB. The data comes from the precomputed leader schedule, so the call is fast.

FAQ

Why do leaders repeat for 4 consecutive slots? Solana assigns each validator a contiguous block of 4 slots. This allows the leader to produce a sequence of blocks efficiently without handoff overhead between every slot.

How far ahead can I query? You can query the current epoch and the next epoch (if its schedule is computed). Requesting slots beyond the next epoch’s schedule returns an error.

What is the difference between getSlotLeaders and getLeaderSchedule? getSlotLeaders returns leaders for a contiguous range of absolute slots. getLeaderSchedule returns each validator’s assigned slot indices within an epoch. Use getSlotLeaders for a sequential view, getLeaderSchedule for a per-validator view.

Can I use this for transaction routing? Yes. Knowing the upcoming leaders lets you send transactions directly to the next leader’s TPU endpoint, potentially reducing latency.

Parameters

ParameterTypeRequiredDescriptionDefault
start_slotu64YesStart slot (inclusive).—
limitu64YesNumber of slots to return leaders for (1-5000).—

Updated: