Refactor: CPI Instruction Recording (#22111)

* Unifies all InstructionRecorders of a transaction into one.

* Stops explicitly compiling CPI instructions for recording,
uses the indices gathered from instruction_accounts instead.
This commit is contained in:
Alexander Meißner
2021-12-25 13:35:43 +01:00
committed by GitHub
parent 60ddd93d09
commit cc947cad03
6 changed files with 64 additions and 51 deletions

View File

@@ -58,7 +58,7 @@ impl MessageProcessor {
rent: Rent,
log_collector: Option<Rc<RefCell<LogCollector>>>,
executors: Rc<RefCell<Executors>>,
instruction_recorders: Option<&[InstructionRecorder]>,
instruction_recorder: Option<Rc<RefCell<InstructionRecorder>>>,
feature_set: Arc<FeatureSet>,
compute_budget: ComputeBudget,
timings: &mut ExecuteDetailsTimings,
@@ -74,6 +74,7 @@ impl MessageProcessor {
log_collector,
compute_budget,
executors,
instruction_recorder,
feature_set,
blockhash,
lamports_per_signature,
@@ -109,10 +110,6 @@ impl MessageProcessor {
}
}
if let Some(instruction_recorders) = instruction_recorders {
invoke_context.instruction_recorder =
Some(&instruction_recorders[instruction_index]);
}
let instruction_accounts = instruction
.accounts
.iter()