Refactor: Cleanup InstructionProcessor (#21404)

* 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
This commit is contained in:
Alexander Meißner
2021-12-01 08:54:42 +01:00
committed by GitHub
parent e922c2da9d
commit b78f5b6032
17 changed files with 548 additions and 623 deletions

View File

@@ -16,8 +16,7 @@ use log::{log_enabled, trace, Level::Trace};
use solana_measure::measure::Measure;
use solana_program_runtime::{
ic_logger_msg, ic_msg,
instruction_processor::{Executor, InstructionProcessor},
invoke_context::{ComputeMeter, InvokeContext},
invoke_context::{ComputeMeter, Executor, InvokeContext},
log_collector::LogCollector,
stable_log,
};
@@ -486,7 +485,7 @@ fn process_loader_upgradeable_instruction(
.iter()
.map(|seeds| Pubkey::create_program_address(*seeds, caller_program_id))
.collect::<Result<Vec<Pubkey>, solana_sdk::pubkey::PubkeyError>>()?;
InstructionProcessor::native_invoke(invoke_context, instruction, signers.as_slice())?;
invoke_context.native_invoke(instruction, signers.as_slice())?;
// Load and verify the program bits
let executor = create_executor(