Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Custom: Invalid blockhash when solana program deploy

Trying to deploy a program to solana devnet.

I was using solana program deploy ./path/xxxx.so -u devnet

And I got multiple lines of

msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J
msg 21AbKBwMcsDR4DciR6Z69X6vrqVj7uHKg2Wf1ap8FB1J

It gave me this error in the end

Error: Custom: Invalid blockhash

Tried search online but didn't get any useful informations

like image 861
Sveargith Avatar asked Jul 26 '26 04:07

Sveargith


1 Answers

I was able to resolve this error by reverting to earlier versions of solana-cli and anchor-cli

solana-cli 1.8.0 (src:4a8ff62a; feat:1813598585)
anchor-cli 0.18.2
rustc 1.57.0 (f1edd0429 2021-11-29)

I also shared the above solution in this related github issue

One guess I have is that ExitStatus(unix_wait_status(256)) (which was in my error logs) could be a "time out error" from waiting too long due to slower deployment validation.

I did notice my deployments using later versions (solana-cli 1.9.1, anchor-cli 0.20.1) being significantly slower, especially for larger programs (my small program deployments were still working fine). These were the versions that showed similar "msg" logging as OP.

UPDATE:

Nowadays, my most fool proof solution is to run the snippet below before deployments

sh -c "$(curl -sSfL https://release.solana.com/v1.8.13/install)"
like image 60
Lorenzo Ampil Avatar answered Jul 29 '26 13:07

Lorenzo Ampil