You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
solana-test-validator doesn't verify program ELFs when creating its genesis configuration.
For example, if an ELf contains a restricted functionality, e.g. mutable static data (as mentioned in coral-xyz/anchor#3403), the validator starts without any indication of an error.
Instead of getting an error during the start of the test-validator, loading an invalid program ELF results in a seemingly unrelated error during runtime when trying to invoke the program:
Program invaLidELF111111111111111111111111111111111 invoke [1]
Program is not deployed
Program invaLidELF111111111111111111111111111111111 failed: Unsupported program id
This behavior differs from solana program deploy, which verifies the ELFs before deploying them. Trying to deploy an invalid ELF fails with EbpfError::ElfError and outputs something similar to the following:
Error: ELF error: ELF error: Failed to parse ELF file: Section or symbol name `.bss._ZN6native7` is longer than `16` bytes
Solution
Verify program ELFs before adding them to the genesis configuration.
The text was updated successfully, but these errors were encountered:
Problem
solana-test-validator
doesn't verify program ELFs when creating its genesis configuration.For example, if an ELf contains a restricted functionality, e.g. mutable
static
data (as mentioned in coral-xyz/anchor#3403), the validator starts without any indication of an error.Reproduction
Program
lib.rs
:Run:
Details
Instead of getting an error during the start of the test-validator, loading an invalid program ELF results in a seemingly unrelated error during runtime when trying to invoke the program:
agave/programs/bpf_loader/src/lib.rs
Lines 478 to 487 in 3deac72
Example transaction logs:
This behavior differs from
solana program deploy
, which verifies the ELFs before deploying them. Trying to deploy an invalid ELF fails withEbpfError::ElfError
and outputs something similar to the following:Solution
Verify program ELFs before adding them to the genesis configuration.
The text was updated successfully, but these errors were encountered: