solana: Query: Deploying hello world to solana-test-validator on M1 fails

Problem

I’m running Solana master with the example Hello World program and on OSX x86 things run as expected. I can deploy the hello world program to the test validator. However, when doing the exact same on M1, it fails at the “Finalize transaction” step:

$ solana program deploy dist/program/helloworld.so
===================================================================
Recover the intermediate account's ephemeral keypair file with
`solana-keygen recover` and the following 12-word seed phrase:
===================================================================
spring kick mail one box meat august educate car ghost orient woman
===================================================================
To resume a deploy, pass the recovered keypair as
the [PROGRAM_ADDRESS_SIGNER] argument to `solana deploy` or
as the [BUFFER_SIGNER] to `solana program deploy` or `solana write-buffer'.
Or to recover the account's lamports, pass it as the
[BUFFER_ACCOUNT_ADDRESS] argument to `solana program close`.
===================================================================
Error: Deploying program failed: unable to confirm transaction. This can happen in situations such as transaction expiration and insufficient fee-payer funds

I was hoping if anybody would have a hint where I should look to try and resolve this.

This is what I did to get my environment started:

  1. Set up BPF SDK
$ git clone https://github.com/solana-labs/solana
$ export PROJECT_ROOT=`pwd`/solana
$ cd $PROJECT_ROOT/sdk/cargo-build-bpf
$ cargo install --path .
$ cd $PROJECT_ROOT
$ ln -s $PROJECT_ROOT/sdk ~/.cargo/bin/sdk
  1. Build the CLI and run configure
$ cd $PROJECT_ROOT/cli
$ cargo build
$ cd $PROJECT_ROOT/keygen
$ cargo build
$ $PROJECT_ROOT/target/debug/solana  config set --url localhost
$ $PROJECT_ROOT/target/debug/solana-keygen new
  1. Run the test validator
$ cd $PROJECT_ROOT/validator
$ ./solana-test-validator
  1. Build hello world Edit the example-helloworld/src/program-rust/Cargo.toml to match $PROJECT_ROOT deps, and then:
$ git clone https://github.com/solana-labs/example-helloworld
$ cd example-helloworld
$ npm install
$ npm run build:program-rust

Everything compiles ok and seems to run fine except for the “Finalize transaction” part which fails on M1. In the validator.log I see no errors, only a warning:

WARN  solana_core::window_service] Window does not seem to be receiving data. Ensure port configuration is correct...

I do not see this warning when running on OSX x86.

Any hints where I should look to try and fix this?

Proposed Solution

None - just a query.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 20
  • Comments: 37 (8 by maintainers)

Most upvoted comments

pretty sad the fastest blockchain doesn’t work on the fastest laptops 😦

From perusing the discord, I’ve figured out what was up (as alluded to in other threads):

  1. Adding --log to the test-validator command and watching the deploy, you’ll see the following
[2021-11-08T00:40:59.691095000Z INFO  solana_core::heaviest_subtree_fork_choice] marking fork starting at: (4505, DAmaeMFkDVRaeyuD9HDfvCsy4JDbJDui1YHvrzMsH5Ao) valid candidate
thread 'solana-banking-stage-tx' panicked at 'JIT is only supported on x86_64', /Users/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/solana_rbpf-0.2.11/src/jit.rs:738:13
stack backtrace:
  1. As you can see: the BPF JIT is not going to work on arm64. Fortunately you can run things without the JIT by adding --no-bpf-jit to the test-validator command and then you’ll be good to go.

Similar issue, I’m on a Mac with an M1 Chip. I’ve tried different demos and all of them have the same issue when I try to deploy my program. Basically it just gets stuck at [0/1] Finalizing transaction...

validator.logs has this being called repeatedly: solana_rpc::send_transaction_service] Retrying transaction: when I grep using my transaction id.

I’ve tried building + deploying with my terminal running Rosetta and run into the same problem regardless, so not sure if this is related.

This is a network issue and you’re probably facing this now because the Solana network is down. Check at status.solana.com and try again later. If it still happens, switch your network.

I build Solana tool suite from source and add --no-bpf-jit flag to solana-test-validator. Now at least I can deploy the example program to local validator.

Before that, I can’t even run solana-test-validator. Using the Solana CLI which is built from source, the CLI works but then it’s stuck when deploying the program.

$ solana program deploy dist/program/helloworld.so                                                                                                                                                          
                                                                                                      
===========================================================================                           
Recover the intermediate account's ephemeral keypair file with                                        
`solana-keygen recover` and the following 12-word seed phrase:                                        
===========================================================================                           
gas tiger plastic knife speak uncle monkey rebel boat suspect agree concert                           
===========================================================================                           
To resume a deploy, pass the recovered keypair as the                                                 
[BUFFER_SIGNER] to `solana program deploy` or `solana write-buffer'.                                  
Or to recover the account's lamports, pass it as the                                                  
[BUFFER_ACCOUNT_ADDRESS] argument to `solana program close`.                                          
===========================================================================                           
Error: Deploying program failed: unable to confirm transaction. This can happen in situations such as transaction expiration and insufficient fee-payer funds

I resume the failed deployment but it still stuck and finally reach maximum retries.

$ solana program deploy --buffer ~/.config/solana/id.json ./dist/program/helloworld.so 
Blockhash expired. 5 retries remaining             
Blockhash expired. 4 retries remaining             
Blockhash expired. 3 retries remaining             
Blockhash expired. 2 retries remaining             
Blockhash expired. 1 retries remaining             
Error: Data writes to account failed: Custom error: Max retries exceeded  

https://github.com/solana-labs/solana/pull/21215 should help to run test validator without explicit --no-bpf-jit flag.

Similar issue even am facing while requesting airdrop

Error: unable to confirm transaction. This can happen in situations such as transaction expiration and insufficient fee-payer funds

thanks mate, I think you’re exactly right - plus looks like the devnet issue is resolved now, too

I have found my issue. I built Solana from sources (because otherwise, I faced another M1 related issue) and used ./run.sh as it is stated in https://github.com/solana-labs/solana/blob/master/README.md. However, what helped me is to run ./solana/target/debug/solana-test-validator instead.

(Also I tried to do solana airdrop 100 previously but it stuck on [0/1] Finalizing transaction... as described in some previous reply)

I found my issue: I had installed almost everything under Rosetta. Checking my rustup toolchain via rustup toolchain list I discovered I had somehow managed to install rust for arm64 instead of x86. After reinstalling everything, I’ve confirmed my default toolchain is now stable-x86_64-apple-darwin and everything is now building 😃😌

Have you tried to deploy from the rPi directly to rule out network configuration issues.

if I scp the binary to the rpi I can deploy it from there without issues. Networking is fine otherwise. It appears some issue with the tooling crossing the architectures (?) but I don’t know how to debug this further.

So, I think might be a network error. I switched to a different network and since the devnet wallet is currently drained, I tried using testnet and it totally worked. Btw, I tried using testnet earlier when was stuck at the deployment but it wouldn’t work. Changing the network connection is what got it working for me.

Hello, I tried following:

  • installed rust in rosetta terminal.
  • compiled Solana tools from source
  • Able to start Solana-test-validator
  • Confirmed endpoint is right.

But still I get this damn error:

error: unable to confirm transaction. This can happen in situations such as transaction expiration and insufficient fee-payer funds

I’m really stuck, any pointers are how to move forward?

did you manage to solve this problem? also facing the same even when trying to do a devnet airdrop

@gxxcastillo okay but that isn’t really fixing the issue it’s avoiding it. I’m getting the same issue on M1 - funny thing is, it was deploying perfectly earlier - but I can’t confirm if this was the x86 version.

I get the feeling this occurs when part of your toolchain is x86 and some is arm, but can’t confirm yet. I’ll keep digging.