getBlockProduction
Returns recent block production information from the current or previous epoch.
Common use cases
| Validator Performance Monitoring | Stake pool operators and validator dashboard applications query getBlockProduction filtered by validator identity to track how many blocks their validator successfully produced versus how many they were scheduled to lead. Skipped slots (leader_slots minus blocks_produced) indicate missed opportunities that affect validator rewards and network participation scores. |
| Network Health Analysis | Blockchain explorers and network monitoring tools call getBlockProduction without identity filtering to retrieve production statistics for all validators across an epoch. Aggregating skipped slot ratios across validators reveals network-wide health metrics, identifies underperforming validators, and helps detect systemic issues affecting block production. |
| Historical Performance Comparison | Validator operators use getBlockProduction with custom slot ranges to compare their validator's block production efficiency across multiple epochs. This enables trend analysis for evaluating hardware upgrades, network improvements, or identifying periods of degraded performance that may correlate with infrastructure changes. |
Parameters
config (object, optional)
Configuration object
Fields:
commitment(string): The commitment describes how finalized a block is at that point in time. See Configuring State Commitment.identity(string): Only return results for this validator identity (base-58 encoded).range(object): Slot range to return block production for. If parameter not provided, defaults to current epoch.firstSlot: <u64>- first slot to return block production information for (inclusive)- (optional)
lastSlot: <u64>- last slot to return block production information for (inclusive). If parameter not provided, defaults to the highest slot
Request
- cURL
- JavaScript
- Python
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": "getBlockProduction",
"params": [
{
"commitment": "finalized"
}
]
}'
// Using fetch
const response = await fetch('https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "getBlockProduction",
"params": [
{
"commitment": "finalized"
}
]
})
});
const data = await response.json();
console.log(data);
import requests
import json
url = 'https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY'
headers = {'Content-Type': 'application/json'}
data = {
"jsonrpc": "2.0",
"id": 1,
"method": "getBlockProduction",
"params": [
{
"commitment": "finalized"
}
]
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Replace mainnet with devnet in the URL to query devnet instead.
Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 9887
},
"value": {
"byIdentity": {
"85iYT5RuzRTDgjyRa3cP8SYhM2j21fj7NhfJ3peu1DPr": [9888, 9886]
},
"range": {
"firstSlot": 0,
"lastSlot": 9887
}
}
},
"id": 1
}
Response Fields
byIdentity (object)
A dictionary of validator identities, as base-58 encoded strings. Value is a two element array containing the number of leader slots and the number of blocks produced.
range (object)
Block production slot range
firstSlot: <u64>- first slot of the block production information (inclusive)lastSlot: <u64>- last slot of block production information (inclusive)
FAQ and Troubleshooting
What does it mean when blocks_produced is less than leader_slots?
The difference represents skipped slots—occasions when the validator was scheduled to produce a block but failed to do so. Skipped slots reduce validator rewards and can indicate network connectivity issues, hardware problems, or the validator being offline. A healthy validator should have blocks_produced very close to leader_slots.
How do I calculate my validator's block production rate?
Divide blocks_produced by leader_slots from the response. For example, if your validator has [9888, 9886], that's 9886 produced / 9888 scheduled = 99.98% production rate. Anything above 99% is generally considered healthy; rates below 95% warrant investigation.
Why does getBlockProduction return empty data for my validator?
Empty byIdentity data means your validator either wasn't active during the queried epoch/slot range, or you've provided an incorrect validator identity. Verify your validator identity matches exactly (case-sensitive base58 string), ensure your validator was registered and staked during the epoch, and confirm you're querying the correct network (mainnet vs devnet vs testnet).
Can I query future epochs with getBlockProduction?
No, getBlockProduction only returns data for completed or current epochs. Leader schedules are computed at epoch boundaries, but block production data accumulates as blocks are actually produced. Query getEpochInfo to determine the current epoch, and use getLeaderSchedule if you need to see scheduled future leaders without production data.
Related Methods
getLeaderSchedule
Returns the slot-by-slot leader schedule for an epoch. Use getLeaderSchedule to see which validators are scheduled to produce blocks at specific slots, then use getBlockProduction to verify whether they actually produced those blocks, enabling performance analysis and identifying skipped slots.
getEpochInfo
Provides current epoch number, slot index, and timing information. Always query getEpochInfo first to determine the current epoch before calling getBlockProduction, ensuring you're requesting data for valid epochs and understanding epoch boundaries for historical queries.
getBlocks
Returns a list of confirmed block slots in a range. Use getBlocks to retrieve actual produced blocks within a slot range, then compare with getBlockProduction data to identify specific slots where scheduled leaders failed to produce blocks, enabling detailed skip analysis.
getVoteAccounts
Returns validator vote account information including current stake and commission. Combine with getBlockProduction to correlate validator stake weight with block production performance, helping stake pool managers assess validator reliability relative to their stake allocation.
getClusterNodes
Provides validator node information including gossip addresses and version. Use after getBlockProduction to map underperforming validator identities to their node metadata, enabling infrastructure teams to investigate connectivity or version-related production issues.
External Resources
- Solana Official Documentation
- Running a Validator - Comprehensive Anza validator operations guide covering setup, monitoring, and performance optimization. Validator operators can use getBlockProduction data to verify their node is successfully producing blocks during assigned leader slots.