getEpochSchedule — Solana RPC Method
getEpochSchedule returns the epoch schedule configuration for the cluster. This includes the number of slots per epoch, the offset for the leader schedule, and whether the warmup period is active. These values are set at genesis and do not change.
Parameters
This method takes no parameters.
Request
curl -X POST https://api.mainnet-beta.solana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getEpochSchedule",
"params": []
}'
TypeScript (@solana/kit)
import { createSolanaRpc } from "@solana/kit";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const schedule = await rpc.getEpochSchedule().send();
console.log(`Slots per epoch: ${schedule.slotsPerEpoch}`);
console.log(`Warmup: ${schedule.warmup}`);
Response
{
"jsonrpc": "2.0",
"result": {
"slotsPerEpoch": 432000,
"leaderScheduleSlotOffset": 432000,
"warmup": false,
"firstNormalEpoch": 0,
"firstNormalSlot": 0
},
"id": 1
}
| Field | Type | Description |
|---|---|---|
slotsPerEpoch | u64 | The number of slots in each epoch. 432,000 on mainnet. |
leaderScheduleSlotOffset | u64 | How many slots before the end of an epoch the leader schedule for the next epoch is computed. |
warmup | bool | Whether the network is still in the warmup period where epochs grow in size. false on mainnet. |
firstNormalEpoch | u64 | The first epoch with slotsPerEpoch slots. On mainnet, this is 0. |
firstNormalSlot | u64 | The first slot of the first normal-length epoch. On mainnet, this is 0. |
Common errors
This method has no parameters and rarely fails. Errors are limited to connectivity issues or an unreachable node.
Performance
The response is a small, static object. These values are set at genesis and never change, so you can safely cache the result for the lifetime of your application. There is no reason to poll this method.
FAQ
Do the epoch schedule values ever change? No. The epoch schedule is set at genesis and remains constant for the life of the cluster. Mainnet has always used 432,000 slots per epoch.
What is the warmup period?
During network startup, the first few epochs can be shorter than normal. The warmup field indicates whether this period is still active. On mainnet, warmup ended long ago, so warmup is always false.
What does leaderScheduleSlotOffset mean? It defines how far in advance the validator leader schedule is computed. A value of 432,000 means the leader schedule for the next epoch is computed at the start of the current epoch (one full epoch ahead).
Is the schedule the same on devnet and testnet?
Devnet and testnet may use different epoch lengths for testing purposes. Always call getEpochSchedule on the specific cluster you are working with.
Updated: