Transaction simulation failed: Blockhash not found (-32002)
Last updated:
At a glance
| Property | Value |
|---|---|
| Code | -32002 |
| Message | Transaction simulation failed: Blockhash not found |
| Category | transaction |
Cause
The recent blockhash attached to the transaction has expired or was never seen by the node. Blockhashes are only valid for ~150 slots (~60–90s); a transaction built too early, retried too late, or signed against a stale blockhash hits this.
Solution
- Fetch a fresh blockhash with `getLatestBlockhash` immediately before signing.
- Submit within the validity window; do not pre-sign far in advance.
- On failure, refetch the blockhash and rebuild rather than resubmitting the same transaction.
- Use `getLatestBlockhash` with a `processed`/`confirmed` commitment matching your send path.
Example
{
"id": 1,
"error": {
"code": -32002,
"message": "Transaction simulation failed: Blockhash not found"
},
"jsonrpc": "2.0"
}FAQ
- Why does "Transaction simulation failed: Blockhash not found" happen?
- The recent blockhash attached to the transaction has expired or was never seen by the node. Blockhashes are only valid for ~150 slots (~60–90s); a transaction built too early, retried too late, or signed against a stale blockhash hits this.
- How do I fix "Transaction simulation failed: Blockhash not found"?
- Fetch a fresh blockhash with `getLatestBlockhash` immediately before signing. Submit within the validity window; do not pre-sign far in advance. On failure, refetch the blockhash and rebuild rather than resubmitting the same transaction. Use `getLatestBlockhash` with a `processed`/`confirmed` commitment matching your send path.
- What is RPC error -32002?
- -32002 means: Transaction simulation failed: Blockhash not found. The recent blockhash attached to the transaction has expired or was never seen by the node. Blockhashes are only valid for ~150 slots (~60–90s); a transaction built too early, retried too late, or signed against a stale blockhash hits this.