* Bumps solana_rbpf to v0.2.22
* Adjusts vm::Config and feature gates.
(cherry picked from commit 96c88d1a5e)
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
* move `ExecuteTimings` from `runtime::bank` to `program_runtime::timings`
(cherry picked from commit 7d32909e17)
# Conflicts:
# core/Cargo.toml
# ledger/Cargo.toml
# programs/bpf/Cargo.lock
* Add execute metrics
(cherry picked from commit b25e4a200b)
* Add metrics for executor creation
(cherry picked from commit 848b6dfbdd)
* Add helper macro for `AddAssign`ing with saturating arithmetic
(cherry picked from commit deb9344e49)
* Use saturating_add_assign macro
(cherry picked from commit 72fc6096a0)
* Consolidate process instruction execution timings to own struct
(cherry picked from commit 390ef0fbcd)
Co-authored-by: Trent Nelson <trent@solana.com>
Co-authored-by: Carl Lin <carl@solana.com>
* Update tests to demonstrate that program id account info for CPI is optional
* Clean up comments that say that program id account info is required
(cherry picked from commit ec7536faf6)
Co-authored-by: Justin Starry <justin@solana.com>
* Partial revert "Updates documentation around what needs to be passed in CPI. (#21633)"
* Enforces the program_id being passed explicitly by removing it from get_instruction_keyed_accounts().
* instruction_accounts => instructions_account
(cherry picked from commit ba8e15848e)
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
- Adds feature reject_section_virtual_address_file_offset_mismatch.
- Adds feature start_verify_shift32_imm.
- Enables enable_symbol_and_section_labels only in the rbpf-cli.
- Fix C standard library to include only reentrant versions of functions
- Use a version of solana_rbpf with fixed relocations handling
- Add a test of using C standard library functions in on-chain program
* Moves the Executor dyn Trait to instruction_processor.rs
* Moves the Logger dyn Trait as well as the ic_msg and ic_logger_msg macros to log_collector.rs,
and moves the stable_log to stable_log.rs
* Moves the ComputeMeter dyn Trait to invoke_context.rs
* Moves the InvokeContext dyn Trait and the ProcessInstructionWithContext type to invoke_context.rs
* Updates cargo files.
* Re-export InvokeContext in program-test
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
On-chain programs frequently require floating point operations. In
addition standard library functions are expected to be available.
This change adds a simple sanity check that such functions are
available and work correctly when compiled to BPF.
* Move blockhash and fee_calculator in ThisInvokeContext instead of using a reference.
* Moves tx_wide_compute_cap into InvokeContext::push().
* Adds ThisInvokeContext::new_mock() constructor.
* Adds missing loader account in uses of MockInvokeContext.
* Use keyed_account_at_index() when accessing keyed_accounts.
* Makes sysvar interface consistent between ThisInvokeContext and MockInvokeContext,
in order to add InvokeContext::get_sysvars().
* Adds InvokeContext::set_blockhash() and InvokeContext ::set_fee_calculator().
* Adds new_mock_with_features.
* Makes ancestors optional in ThisInvokeContext.
* Adds prepare_mock_invoke_context() and mock_process_instruction().
* Make helper associated fn
* Add feature definition
* Add handling to preserve program-id write lock when upgradeable loader is present; restore bpf upgrade-self test
* Use single feature
The program_id is not needed on "Program return data: " because it
always preceeded by the program invoke message, so no need to repeat
the program id. Also rename this to "Program return: " since "data"
is redundant.
* Removes two account copy steps from InstructionProcessor::native_invoke().
* Moves gathering of keyed_accounts, caller_write_privileges and program_indices into InstructionProcessor::create_message().
* Explicitly routes the serialized account lengths to enable sharing of existing account structures.
* Recycles existing account structs in CPI syscall.
* Return error if Transaction locks an executable as writable
* Return error if a ProgramData account is writable but the upgradable loader isn't present
* Remove unreachable clause
* Fixup bpf tests
* Review comments
* Add new TransactionError
* Disallow writes to any upgradeable-loader account when loader not present; remove is_upgradeable_loader_present exception for all other executables