* move `ExecuteTimings` from `runtime::bank` to `program_runtime::timings`
(cherry picked from commit 7d32909e1762c63b0066198a080ae310e2c89619)
# Conflicts:
# core/Cargo.toml
# ledger/Cargo.toml
# programs/bpf/Cargo.lock
* Add execute metrics
(cherry picked from commit b25e4a200b87949dc30be63e413fdbba90c55449)
* Add metrics for executor creation
(cherry picked from commit 848b6dfbddd8aca73d3d7f790b9427f48cc586aa)
* Add helper macro for `AddAssign`ing with saturating arithmetic
(cherry picked from commit deb9344e49ad1c5e6cdbdf602d6cd1a93771990d)
* Use saturating_add_assign macro
(cherry picked from commit 72fc6096a0e184095825b35ffd1716975d3e3461)
* Consolidate process instruction execution timings to own struct
(cherry picked from commit 390ef0fbcd000f5b1cd190913d4b5e3e19dabd56)
Co-authored-by: Trent Nelson <trent@solana.com>
Co-authored-by: Carl Lin <carl@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 ba8e15848e5b7d52cce133e541e92c5aec361a6a)
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
- Lets InvokeContext::process_cross_program_instruction() handle the first invocation depth too.
- Marks InvokeContext::verify(), InvokeContext::verify_and_update() and InvokeContext::process_executable_chain() private.
- Renames InvokeContext::process_cross_program_instruction() to InvokeContext::process_instruction().
- Removes InvokeContext::new_mock_with_sysvars().
(cherry picked from commit 1df88837c8d11c40bcdf2800ecc4606493bbfd67)
Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
* Moves create_message(), native_invoke() and process_cross_program_instruction()
from the InstructionProcessor to the InvokeContext so that they can have a useful "self" parameter.
* Moves InstructionProcessor into InvokeContext and Bank.
* Moves ExecuteDetailsTimings into its own file.
* Moves Executor into invoke_context.rs
* Moves PreAccount into its own file.
* impl AbiExample for BuiltinPrograms
* 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>
* 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().
* Replaces program_id field in InvokeContextStackFrame by index.
* Swaps order of program account and programdata account.
* Removes program_id parameter from InvokeContext::push().
* Adds first_instruction_account parameter to process_instruction().
* Removes InvokeContext::remove_first_keyed_account() from all BPF loaders.
* Removes InvokeContext::remove_first_keyed_account() from all builtin programs.
* Removes InvokeContext::remove_first_keyed_account() from all mock ups.
* Deprecates InvokeContext::remove_first_keyed_account().
* Documents index base of keyed_account_at_index().
* Adds dynamic offset to call sites of "keyed_account_at_index()".