in-solana by Supanode

getSlotLeader — Solana RPC Method

getSlotLeader returns the identity public key of the validator that is the leader for the current slot. The leader is responsible for producing the block in that slot.

Parameters

NameTypeRequiredDescription
commitmentstringNoprocessed, confirmed, or finalized. Default: finalized.
minContextSlotnumberNoMinimum slot at which the request can be evaluated.

Request

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

TypeScript (@solana/kit)

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

const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const leader = await rpc.getSlotLeader().send();

console.log(`Current slot leader: ${leader}`);

Response

{
  "jsonrpc": "2.0",
  "result": "ENvAW7JScgYq6o4zKZwewtkzzJgDzQ1GFNj4GTZLjQpU",
  "id": 1
}
FieldTypeDescription
resultstringBase-58 encoded identity public key of the current slot leader.

Common errors

  • Node behind — if minContextSlot is higher than the node’s current slot, the request fails.

Performance

Returns a single public key from the leader schedule. Extremely lightweight.

FAQ

What is a slot leader? Each slot in Solana is assigned to a specific validator (the leader). The leader is responsible for collecting transactions, producing a block, and distributing it to the cluster.

How often does the leader change? The leader typically holds 4 consecutive slots before the next leader takes over. At 400ms per slot, each leader period is approximately 1.6 seconds.

Can I find future slot leaders? Yes. Use getSlotLeaders to get a sequence of upcoming leaders, or getLeaderSchedule for the full epoch schedule.

Is this useful for sending transactions? Knowing the current leader can help optimize transaction sending. Transactions sent directly to the current or upcoming leader’s TPU address may land faster than going through a standard RPC relay.

Parameters

ParameterTypeRequiredDescriptionDefault
commitmentstringNoCommitment level: processed, confirmed, or finalized.finalized
minContextSlotnumberNoMinimum slot at which the request can be evaluated.—

Updated: