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
| Name | Type | Required | Description |
|---|---|---|---|
commitment | string | No | processed, confirmed, or finalized. Default: finalized. |
minContextSlot | number | No | Minimum 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
}
| Field | Type | Description |
|---|---|---|
result | string | Base-58 encoded identity public key of the current slot leader. |
Common errors
- Node behind — if
minContextSlotis 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
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
commitment | string | No | Commitment level: processed, confirmed, or finalized. | finalized |
minContextSlot | number | No | Minimum slot at which the request can be evaluated. | — |
Updated: