Learn getBlockCommitment use cases, code examples, request parameters, response structure, and tips.
getBlockCommitment
RPC method provides information about the commitment status of a specific block in the Solana ledger. This is useful for understanding how finalized a block is, based on the stake that has voted on it.
totalStake
provides insight into the total active stake in the cluster at the time the block was processed.confirmed
, finalized
).slot
(number, required): The slot number (u64) of the block for which to query commitment information.result
field of the JSON-RPC response will be an object containing:
commitment
(array of u64 integers | null):
MAX_LOCKOUT_HISTORY
, which is 31).i
of the array shows the stake that has voted for the block, considering votes on the block itself and its descendants up to i
levels deep.null
.totalStake
(number):
commitment
Array:
commitment
array shows the stake (in lamports) that has voted for the block at different confirmation depths. Higher values at deeper indices signify stronger finality.null
commitment
array often means the node doesn’t have data for the slot, possibly because it’s too old or was skipped.i
if commitment[i] / totalStake >= 2/3
(supermajority).getBlockCommitment
is for nuanced finality analysis. For most common scenarios, relying on standard commitment levels (processed
, confirmed
, or finalized
) with other RPC methods (like getTransaction
or getBlock
) is simpler and sufficient.getBlockCommitment
, a solid understanding of Solana’s commitment levels is essential. See Solana Commitment Levels for detailed information.null
results for older slots.250000000
) is a placeholder. You should replace it with a recent, confirmed slot that you know exists on your target network (e.g., Devnet or Mainnet) when you run the example. You can find recent slot numbers using a Solana block explorer.
Note: Replace YOUR_API_KEY
with your actual Helius API key in the examples below.