In late October I was testing the send flow of one of my Solana tools with a hardware wallet. I built a small transfer, simulated it, and the simulation passed. Then the device asked me to approve, and I did what I always do: I read every field on that tiny screen. It took me about half a minute.
The send came back with "Transaction simulation failed". Under it: "Blockhash not found".
That habit had been fine for years, because everything I had learned said a blockhash lives for a minute or more. That number is out of date. Since 9 October 2026, a Solana blockhash lives for about 30 seconds on mainnet. Below is why it changed, a script to measure it yourself, and three fixes in @solana/kit 8.6 that I tested on devnet.
The bug
What confused me first was that nothing in the transaction was wrong. Between the passing simulation and the failing send, the only thing that changed was time.
With Kit you will meet an expired blockhash in one of two shapes, depending on preflight:
- Preflight on (the default). The RPC simulates before it accepts the send. The top-level error is
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE("Transaction simulation failed"), and itscauseisSOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND("Blockhash not found", code 7050008 in Kit's error codes). -
skipPreflight: true. The RPC accepts the bytes, and confirmation fails later withSOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED: "The network has progressed past the last block for which this transaction could have been committed."
The first shape is a trap. If you check the top-level error for blockhash-not-found, the check does not match, because the real error sits one level down, in cause.
"Blockhash not found" also has a cause that has nothing to do with time: a blockhash fetched at processed commitment from a fork that the cluster later drops. Fix 1 covers that one too.
The math the docs still teach
A validator keeps the last 300 blockhashes, one per non-skipped slot, and accepts a transaction whose blockhash is at most 150 blocks old. In the solana-clock crate these are MAX_RECENT_BLOCKHASHES = 300 and MAX_PROCESSING_AGE = MAX_RECENT_BLOCKHASHES / 2. Age is counted from 0, so 151 blockhashes are valid at any moment. The lastValidBlockHeight you get from getLatestBlockhash is the current block height plus 150.
With 400 ms slots, 150 blocks is 60 seconds, plus some slack for skipped slots. That is where "60 to 90 seconds" comes from, and as of 21 November 2026 it is still what the Solana confirmation docs say. Solana's retry guide puts it at about 1 minute 19 seconds. I had "60 to 90 seconds" in my head from years of building on Solana and never questioned it.
Then SIMD-0525 shipped. It cut the slot time through four feature gates: from 400 ms to 350, then 300, then 250, then 200 ms. The last gate went live on mainnet at epoch 1053 on 9 October 2026 (Solana's upgrade page). The proposal kept the blockhash queue size the same, so the same 150 blocks now pass in about half the time.
SIMD-0525 itself tells developers to stop treating 400ms * slots as a stable conversion. The SDK has moved too: DEFAULT_MS_PER_SLOT in solana-clock is now 200 ms.
Alpenglow, the other big October upgrade (live on mainnet on 21 October 2026), changed consensus and finality. It is not the reason your blockhash dies sooner.
Blocks, not slots
Some posts on this topic say a blockhash lasts "150 slots". The rule counts blocks. lastValidBlockHeight is a block height, and a skipped slot does not raise block height. So when slots are skipped, the real window is a little longer than 150 times the slot time.
My devnet numbers show it: one 90 second run covered 375 slots but only 371 blocks. Four slots were skipped, and none of them counted against the window.
Kit handles this in its own expiry check. Its block height strategy estimates block height from slot notifications, then re-checks with the RPC and recalibrates when "some blocks have been skipped since we started". It throws only when the current block height is greater than lastValidBlockHeight. Equal is still valid.
So the script in the next section measures block height. If you build a countdown, count blocks.
Measure it yourself
Don't take my number on trust. This script reads slot and block height from one getEpochInfo call (on a public RPC, two separate calls can land on two different nodes), waits 90 seconds, reads again, and does that three times. It only reads, so it is safe to point at mainnet.
// How long is one block right now, and so how long is the 150-block blockhash window? // Read-only. Run: npx tsx src/measure-block-time.ts --network mainnet --seconds 90 --runs 3 import { arg, networkArg, readRpc, rpcType, sleep } from './rpc.ts'; const network = networkArg(); const seconds = Number(arg('seconds', '90')); const runs = Number(arg('runs', '3')); const rpc = readRpc(network); // getEpochInfo returns slot and block height in one response, from the same node. async function sample() { const info = await rpc.getEpochInfo({ commitment: 'confirmed' }).send(); return { at: Date.now(), slot: info.absoluteSlot, height: info.blockHeight }; } const median = (xs: number[]) => [...xs].sort((a, b) => a - b)[Math.floor(xs.length / 2)]; const utc = (ms: number) => new Date(ms).toISOString(); console.log(`network: ${network}, RPC: ${rpcType(network)}, ${runs} runs of ${seconds} s`); const msPerBlockRuns: number[] = []; for (let run = 1; run <= runs; run++) { const a = await sample(); await sleep(seconds * 1000); const b = await sample(); const elapsed = b.at - a.at; const blocks = Number(b.height - a.height); // bigint in @solana/kit const slots = Number(b.slot - a.slot); const msPerBlock = elapsed / blocks; msPerBlockRuns.push(msPerBlock); console.log(`run ${run}: ${utc(a.at)} -> ${utc(b.at)}`); console.log(` block height ${a.height} -> ${b.height} (${blocks} blocks)`); console.log(` slot ${a.slot} -> ${b.slot} (${slots} slots, ${slots - blocks} skipped)`); console.log(` elapsed ${elapsed} ms, ${msPerBlock.toFixed(1)} ms per block, ${(elapsed / slots).toFixed(1)} ms per slot`); console.log(` 150-block window: about ${((150 * msPerBlock) / 1000).toFixed(1)} s`); } const m = median(msPerBlockRuns); console.log(`median: ${m.toFixed(1)} ms per block, 150-block window about ${((150 * m) / 1000).toFixed(1)} s`); // How far behind is finalized? A blockhash fetched at finalized starts this many blocks old. const gaps: number[] = []; for (let i = 0; i < 5; i++) { const [confirmed, finalized] = await Promise.all([ rpc.getEpochInfo({ commitment: 'confirmed' }).send(), rpc.getEpochInfo({ commitment: 'finalized' }).send(), ]); gaps.push(Number(confirmed.blockHeight - finalized.blockHeight)); await sleep(2_000); } console.log(`finalized behind confirmed, 5 checks 2 s apart: ${gaps.join(', ')} blocks (median ${median(gaps)})`); This is what it printed on mainnet, through the public RPC, on 21 November 2026 between 05:32 and 05:37 UTC:
network: mainnet, RPC: public, 3 runs of 90 s run 1: 2026-11-21T05:32:58.036Z -> 2026-11-21T05:34:28.245Z block height 450036957 -> 450037376 (419 blocks) slot 472022991 -> 472023410 (419 slots, 0 skipped) elapsed 90209 ms, 215.3 ms per block, 215.3 ms per slot 150-block window: about 32.3 s run 2: 2026-11-21T05:34:28.315Z -> 2026-11-21T05:35:58.498Z block height 450037376 -> 450037794 (418 blocks) slot 472023410 -> 472023828 (418 slots, 0 skipped) elapsed 90183 ms, 215.7 ms per block, 215.7 ms per slot 150-block window: about 32.4 s run 3: 2026-11-21T05:35:58.567Z -> 2026-11-21T05:37:28.772Z block height 450037793 -> 450038212 (419 blocks) slot 472023827 -> 472024246 (419 slots, 0 skipped) elapsed 90205 ms, 215.3 ms per block, 215.3 ms per slot 150-block window: about 32.3 s median: 215.3 ms per block, 150-block window about 32.3 s finalized behind confirmed, 5 checks 2 s apart: -1, 0, 0, -1, 0 blocks (median 0) So: 215.3 ms per block (median of three runs), no skipped slots, and a 150-block window of about 32 seconds. It lines up with the public figure. Epoch 1053, the first full epoch at the 200 ms target, averaged 218.3 ms per slot (Solana Compass), which also gives about 33 seconds. Devnet, measured at the same time, was slower: 241.1 ms per block, a window of about 36 seconds.
The last line answers a question I had: does fetching at finalized cost you blocks? On the public RPC on 21 November 2026, finalized and confirmed block heights were the same to within a block. (The -1 values are two parallel calls landing on different nodes, the same reason run 3 starts one block below where run 2 ended; finalized cannot really be ahead.) I would not build on that, though. One morning on a public endpoint is not a rule, and slot times can change again, so re-run this before you size a timeout.
Fix 1: fetch the blockhash as late as you can
The mistake I see most is fetching the blockhash too early: at page load, or when a component mounts, before the user has filled in the form. Every second of typing comes off the window before the wallet even opens.
Fetch it last, after the user's inputs and right before the wallet prompt. Kit's default commitment is confirmed, which is the right choice. Don't drop to processed to win a few hundred milliseconds; that is the dropped-fork case from above.
Then size your UI from block height, not from a constant.
// Fix 1: fetch the blockhash as late as you can, and count down in blocks, not seconds. // Devnet, sends one tiny self-transfer. Run: npx tsx src/late-blockhash.ts [--ms-per-block 215] import { appendTransactionMessageInstruction, assertIsTransactionWithBlockhashLifetime, createTransactionMessage, getSignatureFromTransaction, lamports, pipe, sendAndConfirmTransactionFactory, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, signTransactionMessageWithSigners, } from '@solana/kit'; import { getTransferSolInstruction } from '@solana-program/system'; import { arg, devnetRpc, devnetRpcSubscriptions, loadDevnetSigner, sleep } from './rpc.ts'; const rpc = devnetRpc(); const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions: devnetRpcSubscriptions() }); // Block time is measured live (or passed in), never a constant like 400 ms. async function measureMsPerBlock(sampleMs = 10_000) { const a = await rpc.getEpochInfo().send(); const t = Date.now(); await sleep(sampleMs); const b = await rpc.getEpochInfo().send(); return (Date.now() - t) / Number(b.blockHeight - a.blockHeight); } // What a countdown in the UI should show: blocks left, and seconds only as an estimate. async function timeLeft(lastValidBlockHeight: bigint, msPerBlock: number) { const height = await rpc.getBlockHeight().send(); const blocks = lastValidBlockHeight - height; // still valid while height <= lastValidBlockHeight return { blocks, seconds: (Number(blocks) * msPerBlock) / 1000 }; } const msArg = arg('ms-per-block', ''); const msPerBlock = msArg ? Number(msArg) : await measureMsPerBlock(); console.log(`ms per block: ${msPerBlock.toFixed(1)} (${msArg ? 'from --ms-per-block' : 'measured over 10 s'})`); const payer = await loadDevnetSigner(); const transfer = getTransferSolInstruction({ source: payer, destination: payer.address, amount: lamports(1_000n) }); // ...the user fills in the form here. Only now, right before the wallet prompt, fetch the blockhash. const { value: latest } = await rpc.getLatestBlockhash().send(); // Kit default commitment: confirmed const message = pipe( createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(payer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(latest, m), (m) => appendTransactionMessageInstruction(transfer, m), ); const atFetch = await timeLeft(latest.lastValidBlockHeight, msPerBlock); console.log(`blockhash ${latest.blockhash}`); console.log(`lastValidBlockHeight ${latest.lastValidBlockHeight}`); console.log(`at fetch: ${atFetch.blocks} blocks left, about ${atFetch.seconds.toFixed(1)} s`); const signed = await signTransactionMessageWithSigners(message); // the wallet prompt assertIsTransactionWithBlockhashLifetime(signed); const atSend = await timeLeft(latest.lastValidBlockHeight, msPerBlock); console.log(`at send: ${atSend.blocks} blocks left, about ${atSend.seconds.toFixed(1)} s`); await sendAndConfirm(signed, { commitment: 'confirmed' }); console.log(`confirmed: ${getSignatureFromTransaction(signed)}`); process.exit(0); // close the websocket subscription On devnet it printed:
ms per block: 242.4 (measured over 10 s) blockhash EmbCbDALDgsXobAYArDDpppYJrquTJWKZoaQcnSRspJN lastValidBlockHeight 511713071 at fetch: 150 blocks left, about 36.4 s at send: 150 blocks left, about 36.4 s confirmed: 5ku1ES6GozfUvPjE5XhK11mzCMqKLAjukQD24p174ov46PtL71aZERWmhtpSR4F6J1kRpYLDmQ4CdNTsYLEDfWgM Fetched at confirmed, the countdown starts at exactly 150 blocks. Here the signer is a local keypair, so nothing is lost between fetch and send. In a real app, that gap is your user reading the wallet screen. To watch the count fall, add a pause before signTransactionMessageWithSigners; the Fix 2 demo below lets it run all the way out.
A typing tip: signTransactionMessageWithSigners returns a transaction with a generic lifetime type, so tsc will not let you pass it to the sendAndConfirm function until you call assertIsTransactionWithBlockhashLifetime(signed). tsx runs without it, so you only notice when you typecheck.
Fix 2: detect expiry, then rebuild and re-sign
Fetching late helps, but a user can still leave the wallet prompt open and go make tea. The send has to notice expiry and start again.
My first try was to resend the same signed transaction. That cannot work. The signature covers the blockhash, so those bytes are dead for good. You need a new message with a fresh blockhash, and a new signature.
The second rule is less obvious: do not re-sign while the old transaction can still land. If you do, both can land, and you have sent twice (Solana's retry guide says to make sure the first blockhash has expired). A lagging RPC node can also say "Blockhash not found", so the code below waits until block height is past the old lastValidBlockHeight before it builds attempt 2, whatever error it caught.
// Fix 2: detect an expired blockhash by its typed error, then rebuild and re-sign. // Devnet, sends. The first attempt waits like a slow wallet approval until its blockhash expires. // Run: npx tsx src/expire-and-rebuild.ts [--skip-preflight] import { appendTransactionMessageInstruction, assertIsTransactionWithBlockhashLifetime, createTransactionMessage, getSignatureFromTransaction, isSolanaError, lamports, pipe, sendAndConfirmTransactionFactory, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, signTransactionMessageWithSigners, SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE, SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND, type Instruction, type TransactionSigner, } from '@solana/kit'; import { getTransferSolInstruction } from '@solana-program/system'; import { devnetRpc, devnetRpcSubscriptions, loadDevnetSigner, sleep } from './rpc.ts'; const rpc = devnetRpc(); const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions: devnetRpcSubscriptions() }); const skipPreflight = process.argv.includes('--skip-preflight'); async function buildAndSign(payer: TransactionSigner, instruction: Instruction) { const { value: latest } = await rpc.getLatestBlockhash().send(); // fetched last, right before signing const message = pipe( createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(payer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(latest, m), (m) => appendTransactionMessageInstruction(instruction, m), ); const signed = await signTransactionMessageWithSigners(message); // in a dApp: the wallet prompt assertIsTransactionWithBlockhashLifetime(signed); return signed; } // The two shapes an old blockhash takes in Kit. Preflight wraps the real error in `cause`. function expiryCode(e: unknown): string | null { if (isSolanaError(e, SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED)) return 'BLOCK_HEIGHT_EXCEEDED'; if ( isSolanaError(e, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE) && isSolanaError(e.cause, SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND) ) { return 'PREFLIGHT_FAILURE caused by BLOCKHASH_NOT_FOUND'; } return null; } // Re-sign only once the old transaction can no longer land. A lagging RPC node can // also say "blockhash not found", so check the block height whatever the error was. async function waitUntilExpired(lastValidBlockHeight: bigint) { while ((await rpc.getBlockHeight().send()) <= lastValidBlockHeight) await sleep(1_000); } async function sendWithRebuild(build: (attempt: number) => ReturnType<typeof buildAndSign>, maxAttempts = 3) { for (let attempt = 1; attempt <= maxAttempts; attempt++) { const signed = await build(attempt); const { lastValidBlockHeight } = signed.lifetimeConstraint; try { await sendAndConfirm(signed, { commitment: 'confirmed', skipPreflight }); return getSignatureFromTransaction(signed); } catch (e) { const code = expiryCode(e); if (!code) throw e; console.log(`attempt ${attempt}: expired (${code}): ${(e as Error).message}`); if (isSolanaError(e) && isSolanaError(e.cause)Source:https://dev.to/sankettt/your-solana-blockhash-now-expires-in-about-30-seconds-and-how-i-found-out-p44Related posts
Ask HN: How do engineers approach startups that aren't actively hiring?
What frustrates you most about using a CRM?
Show HN: Genesis Map – Visualize your agent's changes. See where they can break
Show HN: Rchive – Every drive I've owned since the 90s, searchable in one window
Show HN: Envcheck – a small Python .env file checker

