LiteSVM / litesvm

Apache License 2.0
132 stars 24 forks source link

InvalidProgramForExecution when adding builtin program #104

Closed lukacan closed 3 weeks ago

lukacan commented 1 month ago

During testing, I discovered that it is not possible to execute an instruction from a program added using the add_builtin function. After the program is added, the get_account function returns the following for the account corresponding to the program.

Program: Some( Account { lamports: 0, data.len: 1, owner: BPFLoader2111111111111111111111111111111111, executable: false, rent_epoch: 0, data: 00, }, ).

The error message: FailedTransactionMetadata { err: InvalidProgramForExecution, meta: TransactionMetadata { signature: 1111111111111111111111111111111111111111111111111111111111111111, logs: [], inner_instructions: [], compute_units_consumed: 0, return_data: TransactionReturnData { program_id: 11111111111111111111111111111111, data: [] } } }

I suggest that the AccountSharedData on this line will create instance of Account where the executable flag is by default set to false.