Skip to main content

getEpochSchedule

Returns the epoch schedule information from this cluster

Common use cases
Calculate epoch boundary slots and timestampsCombine getEpochSchedule() with getBlockTime() to determine first and last slot timestamps for any epoch. Use epoch_schedule.get_first_slot_in_epoch(epoch) to find boundary slots, then fetch Unix timestamps with getBlockTime(). Essential for inflation rewards display and epoch-aligned data queries.
Determine warmup period completion with firstNormalSlotCheck firstNormalSlot field to identify when epoch lengths normalize after genesis warmup. When warmup=true (mainnet/devnet), epochs double in length until reaching firstNormalSlot. Critical for local cluster configuration and validator timing validation.
Query leader schedules with epoch-aligned slotsUse epoch_schedule.get_first_slot_in_epoch(epoch) as slot parameter for getLeaderSchedule() calls. Leader schedules are computed per epoch and must be queried with epoch-aligned slots. Essential for validator operations and schedule monitoring.
Convert slots to epochs for feature activation trackingUse epoch_schedule.get_epoch(activation_slot) to convert feature activation slot numbers to epoch numbers. Required for feature management tools and validator upgrade coordination when tracking feature rollout status.
Cache static epoch configuration for client-side calculationsFetch once per connection and cache indefinitely since getEpochSchedule returns immutable genesis configuration. Safe to cache for entire connection lifetime and reuse for epoch math operations like getEpoch(), getSlotsInEpoch(), and getFirstSlotInEpoch().

Parameters

No parameters required.

Request

curl https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getEpochSchedule"
}'
Network Selection

Replace mainnet with devnet in the URL to query devnet instead.

Response

{
"jsonrpc": "2.0",
"result": {
"firstNormalEpoch": 8,
"firstNormalSlot": 8160,
"leaderScheduleSlotOffset": 8192,
"slotsPerEpoch": 8192,
"warmup": true
},
"id": 1
}

Response Fields

firstNormalEpoch (u64)

First normal-length epoch, log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH)

firstNormalSlot (u64)

Minimum number of slots in an epoch, MINIMUM_SLOTS_PER_EPOCH * (2.pow(firstNormalEpoch) - 1)

leaderScheduleSlotOffset (u64)

The number of slots before beginning of an epoch to calculate a leader schedule for that epoch.

slotsPerEpoch (u64)

The maximum number of slots in each epoch.

warmup (bool)

Whether epochs start short and grow.

FAQ and Troubleshooting

Why doesn't getEpochSchedule accept a commitment parameter?

Returns genesis configuration which is static and identical across all commitment levels. The epoch schedule is set at cluster launch and never changes, making commitment levels irrelevant for this data.

How do I use getEpochSchedule to calculate remaining time in an epoch?

Combine with getEpochInfo() and getRecentPerformanceSamples(): Get current epoch and slot index from getEpochInfo, then use epoch_schedule.get_slots_in_epoch(epoch) - slotIndex to find remaining slots. Multiply by average slot time from performance samples (typically ~400ms on mainnet) to estimate remaining time.

What does the warmup field indicate?

When warmup=true, the cluster uses progressively longer epochs after genesis before reaching normal epoch length. During warmup, epoch length doubles each epoch until reaching slotsPerEpoch. The firstNormalEpoch and firstNormalSlot fields mark when this transition completes. Mainnet and devnet have warmup enabled; local clusters typically don't.

Can epoch schedule values change after cluster launch?

No - epoch schedule is part of immutable genesis configuration. Values remain constant for the cluster's lifetime. This allows safe caching and makes getEpochSchedule calls idempotent. If you need to support multiple clusters, cache per cluster genesis hash.

What's the difference between slotsPerEpoch and leaderScheduleSlotOffset?

slotsPerEpoch defines epoch length (typically 432,000 slots on mainnet). leaderScheduleSlotOffset determines how many slots before an epoch starts that the leader schedule is calculated (also 432,000 on mainnet). The offset ensures leader schedule is ready before the epoch begins. For most use cases, focus on slotsPerEpoch for epoch length calculations.

getEpochInfo
Returns current epoch state (which epoch/slot). Essential companion to getEpochSchedule - combine both to calculate epoch progress: (epochInfo.slotIndex / epochSchedule.slotsPerEpoch) * 100.

getLeaderSchedule
Returns leader schedule for an epoch. Requires epoch-aligned slot from getEpochSchedule as input: getLeaderSchedule(epochSchedule.getFirstSlotInEpoch(epoch)).

getInflationReward
Returns inflation rewards for specific epochs. Use getEpochSchedule to calculate epoch boundary timestamps for rewards display by finding first/last slots, then fetching timestamps with getBlockTime.

getBlockTime
Returns Unix timestamp for a slot. Converts epoch boundary slots from getEpochSchedule to timestamps: getBlockTime(epochSchedule.getFirstSlotInEpoch(epoch)).

getGenesisHash
Returns cluster genesis hash. Both provide immutable cluster configuration - use together for cluster identification before caching epoch schedule.

External Resources