Title: [Bug] Solana OFT Deployment Fails with "invalid account data for instruction" (sbpf_version not enabled)
Description
I am trying to deploy the Solana-EVM OFT example following the official LayerZero documentation. However, the deployment consistently fails during the BPF Upgradeable Loader phase.
When deploying normally, the CLI throws a generic Error: Error processing Instruction 1: invalid account data for instruction error. Upon debugging with the --verbose flag, the logs reveal a compatibility issue: Detected sbpf_version required by the executable which are not enabled.
I am currently completely blocked by this and am out of ideas on how to resolve it. I would greatly appreciate any guidance!
Environment
I strictly followed the prerequisite versions specified in the create-lz-oapp Readme:
- Rust: 1.84.1
- Anchor: 0.31.1
- Solana CLI: 2.2.20
- Node.js: >=20.19.5
- Network: Solana Devnet
Steps to Reproduce
- Scaffold the project using
pnpm dlx create-lz-oapp@latest and select OFT (Solana).
- Ensure all dependencies match the exact versions listed in the Readme.
- Generate a new keypair and fund the devnet wallet via the Solana faucet.
- Sync keys and build the program:
anchor keys sync -p oft
anchor build -v -e OFT_ID=<MY_PROGRAM_ID>
- Attempt to deploy to devnet:
solana program deploy --program-id target/deploy/oft-keypair.json target/verifiable/oft.so -u devnet
Expected Behavior
The OFT program should deploy successfully to the Solana Devnet.
Actual Behavior / Error Logs
The deployment fails. When removing --with-compute-unit-price and running with --verbose, the instruction logs show the following output:
log messages:
Program 11111111111111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 success
Program BPFLoaderUpgradeab1e11111111111111111111111 invoke [1]
Program 11111111111111111111111111111111 invoke [2]
Program 11111111111111111111111111111111 success
Detected sbpf_version required by the executable which are not enabled
Program BPFLoaderUpgradeab1e11111111111111111111111 failed: invalid account data for instruction
Error: Error processing Instruction 1: invalid account data for instruction
Troubleshooting Steps Taken
In an attempt to bypass this versioning conflict, I have exhaustively tried the following workarounds, all of which resulted in the same failure:
- Downgrading: Built and deployed using older versions of Solana CLI and Anchor.
- Version Mixing (Hack): Built the
.so executable using an older version of the toolchain, but attempted to deploy it using the latest Solana CLI.
- Readme + Latest CLI: Built using the exact versions specified in the LayerZero Readme, but used the absolute latest Solana CLI for the
deploy command.
- Forcing SBFv2: Attempted to build using the
--arch sbfv2 flag. While the build was successful and the flag was recognized, the deployment step still failed with the same exact error.
- Hardcoding Program ID: Tried hardcoding the
programId directly in the Rust source code using declare_id!() instead of relying on the environment variable injection (-e OFT_ID=...) during the build, but this did not resolve the issue.
Question for Maintainers
I've exhausted all standard workarounds and honestly don't know what else to try at this point. Could you please advise on what might be causing this sbpf_version mismatch between the provided codebase/build process and the Devnet cluster? Is there a specific Solana CLI or Agave version required that isn't mentioned in the docs?
Thank you in advance for your help!
Title: [Bug] Solana OFT Deployment Fails with "invalid account data for instruction" (sbpf_version not enabled)
Description
I am trying to deploy the Solana-EVM OFT example following the official LayerZero documentation. However, the deployment consistently fails during the BPF Upgradeable Loader phase.
When deploying normally, the CLI throws a generic
Error: Error processing Instruction 1: invalid account data for instructionerror. Upon debugging with the--verboseflag, the logs reveal a compatibility issue:Detected sbpf_version required by the executable which are not enabled.I am currently completely blocked by this and am out of ideas on how to resolve it. I would greatly appreciate any guidance!
Environment
I strictly followed the prerequisite versions specified in the
create-lz-oappReadme:Steps to Reproduce
pnpm dlx create-lz-oapp@latestand selectOFT (Solana).Expected Behavior
The OFT program should deploy successfully to the Solana Devnet.
Actual Behavior / Error Logs
The deployment fails. When removing
--with-compute-unit-priceand running with--verbose, the instruction logs show the following output:Troubleshooting Steps Taken
In an attempt to bypass this versioning conflict, I have exhaustively tried the following workarounds, all of which resulted in the same failure:
.soexecutable using an older version of the toolchain, but attempted to deploy it using the latest Solana CLI.deploycommand.--arch sbfv2flag. While the build was successful and the flag was recognized, the deployment step still failed with the same exact error.programIddirectly in the Rust source code usingdeclare_id!()instead of relying on the environment variable injection (-e OFT_ID=...) during the build, but this did not resolve the issue.Question for Maintainers
I've exhausted all standard workarounds and honestly don't know what else to try at this point. Could you please advise on what might be causing this
sbpf_versionmismatch between the provided codebase/build process and the Devnet cluster? Is there a specific Solana CLI or Agave version required that isn't mentioned in the docs?Thank you in advance for your help!