Skip to main content
7 votes
Accepted

Blockhash expired. 5 retries remaining

This is fixed by installing Solana SDK v1.13.3 from Github. I confirmed that v1.10.40 has the problem above. solana-install update does NOT update to a functioning version, you must download the ...
Tristyn's user avatar
  • 86
6 votes
Accepted

Why can't I use a future blockhash for on-chain randomness?

A malicious leader can front-run your transaction by grinding the blockhash, including whatever ordered set of transactions required. It doesn't matter how in the future your blockhash is, a malicious ...
Jacob Creech's user avatar
  • 4,019
5 votes
Accepted

When does a transaction expire?

Let me preface this with: I'm also not 100% sure on this but here is my guess: the answer is a) A transaction expires when the recent blockhash included in the transaction cannot be found within the ...
Solandy's user avatar
  • 511
5 votes
Accepted

Does how recent your blockhash matter in regards to how quickly a transaction is confirmed?

No. The validator does not do any ordering based on how recent a blockhash a transaction has, only checks if it is valid.
Jacob Creech's user avatar
  • 4,019
4 votes

Getting Error: failed to send transaction: Transaction simulation failed: Attempt to load a program that does not exist

I found that my error was because I did not change the program id to the one shown after i ran anchor deploy, I had to change it under [programs.localnet] in anchor.toml and the declare.id! field in ...
Aengus's user avatar
  • 177
3 votes
Accepted

Can I send the same transaction twice in the same block?

The Problem You've identified the crux of it -- you need two different recent blockhashes if the rest of your transaction data is the same, otherwise the second one will be rejected. Currently, that's ...
HelmetFace's user avatar
  • 1,807
3 votes
Accepted

Minimum context slot has not been reached when trying to send a transaction

What's likely happening is that you're using a load-balanced RPC endpoint, like the public ones, and you're hitting different backends on different requests, which haven't all reached the same slot. ...
Jon C's user avatar
  • 19.6k
3 votes

Can I somehow subscribe to the latest block hash?

Blockhashes are valid for 150 slots which is roughly 60 seconds. You don't need to continually poll it to send transactions. You can fetch it roughly every minute and use it until it expires.
acheron's user avatar
  • 2,909
3 votes
Accepted

Find the last valid block height for a given blockhash

In the current state, there's no way to figure out the last valid block height for a given blockhash. Most dapps manage this by tracking the blockhash's context in the app, but this does not help in ...
Jacob Creech's user avatar
  • 4,019
2 votes
Accepted

signTransaction() wallet adapter

When creating a Transaction object without sending it, it is required to set recentBlockhash and feePayer fields like so: const latestBlockhash = await connection.getLatestBlockhash(); transaction....
Sergei Patrikeev's user avatar
2 votes

Getting Error: failed to send transaction: Transaction simulation failed: Attempt to load a program that does not exist

If you are running NodeJS version 17, try downgrading to version 16 and see if that helps. Apparently, node v17 resolves localhost to IPv6 instead of IPv4 (127.0.0.1), which as been causing issues ...
cloudberry's user avatar
2 votes

Can I somehow subscribe to the latest block hash?

I ended up polling the latestBockhash every half a second and using the cached one for my transactions since the block hashes are valid for longer and apparently it does not need to be the latest even ...
Jonas H.'s user avatar
  • 7,219
2 votes

How to generate a random number based on clock and recent blockhash?

Unless this is for a hobby project, do not generate randomness like this. It's insecure, as the clock time and slot number is predictable. Recent blockhashes won't help you either as they're visible ...
McBain's user avatar
  • 5,384
1 vote
Accepted

How do I get the recent blockhashses during program execution?

The slot_hashes sysvar is unfortunately too large to deserialize in an on-chain program. You can partially deserialize it, however, to get a small number of the hashes. Here's an example, lifted from ...
Jon C's user avatar
  • 19.6k
1 vote

failed to get recent blockhash: Method not found at Connection.getRecentBlockhash on vanilla javascript mini app

const { blockhash } = await connection.getRecentBlockhash(); use getLatestBlockhash() here read more about chnages https://www.helius.dev/blog/agave-2-0-transition
Cadalt's user avatar
  • 11
1 vote

failed to get recent blockhash: Method not found at Connection.getRecentBlockhash on vanilla javascript mini app

That function is deprecated, see web3js docs and Solana RPC docs. It is removed in v2.0 and some RPCs are now running this version, so these deprecated methods are now often unavailable. You should ...
Callum M's user avatar
  • 3,775
1 vote

How to deal with same transaction hash of multiple transaction?

I'll typically tack on a self transfer for different lamport amounts if I want to spam transactions. You can also poll for new blockhashes every ~400ms as they're produced by the cluster. Note that ...
Jon C's user avatar
  • 19.6k
1 vote
Accepted

How to deal with same transaction hash of multiple transaction?

You could e.g., add the ComputeBudget instruction with some slightly different tip (like add 1 micro lamport) to the same transaction you want to "double send" (https://solana-labs.github.io/...
chalda's user avatar
  • 1,657
1 vote
Accepted

Is it possible to use the latest blockhash to get transaction data for the block its for?

The getBlock RPC method takes in a slot number, so you can't use the blockhash as an input. You'll need to get the current confirmed slot using getSlot https://solana.com/docs/rpc/http/getslot, ie: $ ...
Jon C's user avatar
  • 19.6k
1 vote

What is the workaround for the "TransactionExpiredBlockheightExceededError" error when transferring "spl-tokens"?

Add higher priority fee, probably same of higher than avg priority fee of last block, 10micolamports too low now a days on solana due to high traffic on chain
ashish0411's user avatar
1 vote

How to test my solana program code by rust on beta.solpg.io?

You'd need to write tests yourself first in the anchor.test.ts file under tests folder: Then, you can either run test command in CLI or click on the " Test" button. In case you don't see ...
Syed Aabis Akhtar's user avatar
1 vote

How to confirm a transaction given only the transaction signature and slot number?

But how can I get the last valid block height? const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash() await connection.confirmTransaction({ blockhash, ...
Callum M's user avatar
  • 3,775
1 vote

spl-token 2.2.0 at solana 1.13.5 getting multisig error: Client(PresignerError(VerificationFailure))

downgrading to the last stable version of the cli works - v1.13.7 seems to work
jtan-sl's user avatar
  • 11

Only top scored, non community-wiki answers of a minimum length are eligible