Skip to content

Errors transferring buffer to program on mainnet deployment action #399

@CryptoKiddies

Description

@CryptoKiddies

Issue: My program deploys fine on localnet fork and on devnet in interactive mode with web wallet. However on FIRST run, the same web wallet deployment on mainnet gives me an error when attempting to transfer data from buffer to program account. I had 0.9 more sol than the estimated requirement.

Versions:
anchor 0.31.1
solana libraries are v2 across the board

Steps to reproduce:

On first run, the initial error:

! error at runbooks/deployment/main.tx:10:1
!       error: unable to send and confirm transaction (RPC response error -32002: Transaction simulation failed: Error processing Instruction 1: invalid account data for instruction; 7 log messages:
!   Program 11111111111111111111111111111111 invoke [1]
!   Program 11111111111111111111111111111111 success
!   Program BPFLoaderUpgradeab1e11111111111111111111111 invoke [1]
!   Program 11111111111111111111111111111111 invoke [2]
!   Program 11111111111111111111111111111111 success
!   Relocation failed, invalid referenced virtual address 0x0
!   Program BPFLoaderUpgradeab1e11111111111111111111111 failed: invalid account data for instruction
! )
⠇ x Failed: Failed to broadcast transaction  

Then add buffer_account_pubkey and ephemeral_authority_secret_key in my runbook action config. Second deploy/continuation attempt failed.

Somehow on the third run, I get successful program creation, but no sol transfer back from ephemeral key:

[2025-11-04--19-54-05 INFO txtx::svm::deploy_program] Pending - Sending transaction 1/3
[2025-11-04--19-54-07 INFO txtx::svm::deploy_program] Program Created - Program 12345678XHe987654321xxxxxxxxxxxxxxxxxxx has been deployed
[2025-11-04--19-54-09 INFO actix_server::worker] shutting down idle worker
[2025-11-04--19-54-09 INFO actix_server::accept] accept thread stopped
[2025-11-04--19-54-09 INFO actix_server::worker] shutting down idle worker
[2025-11-04--19-54-09 INFO actix_server::worker] shutting down idle worker
[2025-11-04--19-54-09 INFO actix_server::worker] graceful worker shutdown; finishing 1 connections
[2025-11-04--19-54-09 INFO actix_server::worker] shutting down idle worker
[2025-11-04--19-54-09 ERROR txtx::svm::send_transaction] Failed - Failed to broadcast transaction
[2025-11-04--19-54-10 ERROR txtx::svm::send_transaction] Failed - error: unable to send and confirm transaction (RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1; 3 log messages:
  Program 11111111111111111111111111111111 invoke [1]
  Transfer: insufficient lamports 533147396, need 533152396
  Program 11111111111111111111111111111111 failed: custom program error: 0x1
)

I then use solana cli transfer ephemeral account remaining sol back into web wallet.

Do you recommend against using Surfpool for mainnet production usage? Is there a certain procedure that triggers this bug?

(Side issue: in interactive mode, I had to switch from the public solana api to a paid provider to submit on mainnet as public api blocks localhost header it seems.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions