orymsolana.xyz

Why does my Solana transaction expire before it confirms?

A Solana transaction expires because it includes a blockhash that becomes invalid once the block it references is more than 151 blocks old, which at typical network speed means about 60 seconds. If the transaction hasn't been included in a confirmed block by then, the network rejects it and you must submit a new one.

The blockhash clock

Every Solana transaction must carry a recent blockhash from the network. This blockhash ties the transaction to a specific point in the chain. When you fetch a blockhash from a validator or RPC provider, you get one from the most recent block. That blockhash is valid only for the next 151 blocks. After that, the network treats the transaction as expired and will not process it.

The 151-block window is fixed by the protocol. It is not configurable per transaction. If your transaction reaches a leader after that window closes, the leader discards it.

Why your transaction misses the window

Several common scenarios cause a transaction to arrive too late:

What you can do

1. Fetch a fresh blockhash close to submission

Minimize the gap between fetching the blockhash and sending the transaction. If your code or wallet allows, fetch the blockhash immediately before signing, not minutes earlier. Some wallets do this automatically; others cache blockhashes and reuse them, which increases expiry risk.

2. Increase the priority fee

A higher priority fee makes leaders more likely to include your transaction in the next block. Check the current priority fee recommendation from your RPC provider or a fee estimator site. The exact amount needed varies with network load. There is no fixed "good" number; look at the recent block data to decide.

3. Use a durable nonce

If your transaction genuinely needs to survive longer than one minute - for example, you are signing offline or waiting for user action - replace the blockhash with a durable nonce. A durable nonce is a stored value on chain that stays valid until you explicitly advance it. The procedure:

  1. Create a durable nonce account (costs about 0.001 SOL in rent).
  2. Include the nonce's value in your transaction instead of a recent blockhash.
  3. The transaction remains valid until someone uses the nonce in a successful transaction (which you control) or the nonce account is closed.

This is covered in more detail on the durable nonces page already on this site.

4. Check RPC performance

If you run your own RPC node or use a third-party provider, ensure you are getting blockhashes from a well-connected node. A node that is lagging behind the cluster will give you an outdated blockhash, which may expire even before you submit. Use the getRecentPerformanceSamples endpoint to see if your node's view of the cluster is current.

5. Retry with a new blockhash

When a transaction expires, the correct response is to fetch a new blockhash, re-sign with the same instructions, and submit again. Most modern wallets and dApps do this automatically. If yours does not, you may need to manually retry.

When expiry is not the real problem

Sometimes a transaction appears to expire but the underlying issue is something else. For example:

Expiry due to blockhash age is a straightforward protocol mechanic. If your transactions consistently expire, the most likely fixes are faster submission, higher fees, or a nonce.

Not financial advice. orymsolana.xyz publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.

Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.

Back to solana