LayerZeroFault
Solana & Bitcoin CODE: BLOCK-EXPIRE Reviewed & Verified:

Solana Transaction Expired: Blockheight Exceeded & Priority Fees

Verified by Victor Vance • Lead Technical Analyst & Systems Researcher
Quick Diagnostic Answer (Executive Summary) GSC Snippet Verified

The Solana "Transaction Expired: Blockheight Exceeded" error occurs when a signed transaction is not processed by validators before its recentBlockhash expires (approximately 150 slots or 60–90 seconds). On Solana, blockhashes serve as transaction nonces. If network congestion causes validator leaders to drop your transaction, current cluster blockheight surpasses lastValidBlockHeight, rendering the transaction dead. Attach dynamic ComputeBudget priority fees and implement a fresh blockhash retry loop.

# Root Cause & Technical Architecture

Solana eliminates EVM-style transaction nonces by binding each transaction to a recent blockhash (`recentBlockhash`). A blockhash remains valid for exactly 150 slots (~60-90 seconds). When a transaction is submitted, the RPC node tracks `lastValidBlockHeight`. During periods of heavy mempool congestion, validator leaders discard low-fee transactions. Once cluster height exceeds `lastValidBlockHeight`, the transaction can never be included, triggering `TransactionExpiredBlockheightExceededError`.

# 4-Step Actionable Diagnostic Protocol

Step-by-Step Resolution
01

Implement Dynamic Priority Fee Instructions

Add ComputeBudgetProgram.setComputeUnitPrice({ microLamports: ... }) based on the 75th percentile of recent fees via getRecentPrioritizationFees.

02

Fetch Blockhashes with "confirmed" Commitment

Query connection.getLatestBlockhash("confirmed") immediately before signing to maximize the ~150 slot validity window.

03

Use sendAndConfirmTransaction with Fresh Retries

Do not re-sign expired transactions with the same stale blockhash. Fetch a brand new blockhash and re-sign before resubmitting.

04

Utilize Multiple Parallel RPC Nodes for Broadcasting

Submit transaction wire bytes concurrently to multiple independent RPC endpoints (e.g. Helius, Triton, QuickNode) to maximize leader reception.

# Diagnostic Verification Code / Command

typescript
resilient-solana-send.ts
// Resilient Solana Transaction Submission with Fresh Blockhash
import { Connection, Transaction, ComputeBudgetProgram } from '@solana/web3.js';

async function sendWithPriority(connection: Connection, tx: Transaction, signers: any[]) {
  // 1. Add Compute Unit Price (Priority Fee)
  tx.add(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 100_000 }));

  // 2. Fetch fresh blockhash with latest validity window
  const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');
  tx.recentBlockhash = blockhash;
  tx.sign(...signers);

  // 3. Send raw transaction
  const signature = await connection.sendRawTransaction(tx.serialize(), {
    skipPreflight: false,
    maxRetries: 3
  });

  // 4. Confirm before blockheight exceeds threshold
  await connection.confirmTransaction({ signature, blockhash, lastValidBlockHeight }, 'confirmed');
  return signature;
}
Zero-Secrets Client Sandbox

Launch Derivation Path Inspector

Execute client-side cryptographic simulation and parameter checks safely in your browser via native WebCrypto without sending private keys or mnemonics over the wire.

Open Sandbox →
Comprehensive In-Depth Guide

Read Full Investigation & Recovery Workflow

Explore complete architectural diagrams, edge-case failure trees, and detailed post-mortem analysis in our verified deep guide.

Read Guide →

# Related Diagnostic Codes in Solana & Bitcoin

Related Hex Statuses

# Frequently Asked Questions

FAQ Schema

How long is a Solana blockhash valid?

A Solana blockhash is valid for exactly 150 slots. At average slot times of 400ms to 600ms, this equates to roughly 60 to 90 seconds.

Does an expired transaction cost any fees on Solana?

No. If a transaction expires because its blockheight was exceeded without landing in a block, zero transaction fees are deducted.

Why did my transaction expire even though I set high priority fees?

If the RPC node you submitted to was experiencing WebSocket delays or network partitions, it may have failed to propagate packets to active leader validators.