CPI Account Reuse (#19762)

* 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.
This commit is contained in:
Alexander Meißner
2021-09-18 08:09:47 +02:00
committed by GitHub
parent efd024510a
commit 36f46e1c31
7 changed files with 352 additions and 550 deletions

View File

@ -170,7 +170,8 @@ native machine code before execting it in the virtual machine.",
}
let lid = bpf_loader::id();
let pid = Pubkey::new(&[0u8; 32]);
let mut bytes = serialize_parameters(&lid, &pid, &accounts, &input.insndata).unwrap();
let (mut bytes, _account_lenghts) =
serialize_parameters(&lid, &pid, &accounts, &input.insndata).unwrap();
Vec::from(bytes.as_slice_mut())
}
};