isBlockhashValid RPC Method

Returns whether a blockhash is still valid or not.

Version Restriction

This method is only available in solana-core v1.9 or newer. Please use getFeeCalculatorForBlockhash for solana-core v1.8 and below.

Parameters

string required
Blockhash of the block to evaluate

  • Base-58 encoded string

object optional
Configuration object containing the following fields:

commitment string optional
The level of commitment desired when querying state

minContextSlot number optional
The minimum slot that the request can be evaluated at

Code Sample

curl https://rpc.testnet.soo.network/rpc \
-X POST \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "isBlockhashValid",
  "params": [
    "5ThJTCxpdn54bk3gBAWKZS4K9ogHEX56WooYbXQDnm3Q",
    {
      "commitment": "finalized",
      "minContextSlot": 0
    }
  ]
}'

Response

{
  "jsonrpc": "2.0",
  "result": true,
  "id": 1
}

Result Details

  • <bool> - Blockhash Validity
    • true indicates the blockhash is still valid
    • false indicates the blockhash is no longer usable
    • Helps determine if a transaction can still be processed using this blockhash