In cases where this is used as an a amnesiac executor, the self mut on the tx processing functions unnecessarily prevent parallelisation due to a single shared line.
This PR splits the necessary code into a read-only branch that gets used by the simulate function, and allows the removal of mut for self.
It does introduce a bit of duplication between execute_sanitized_transaction_readonly and execute_sanitized_transaction and the naming might be suboptimal. If you have proposal to make it cleaner on those points lmk.
In cases where this is used as an a amnesiac executor, the
self mut
on the tx processing functions unnecessarily prevent parallelisation due to a single shared line.This PR splits the necessary code into a read-only branch that gets used by the
simulate
function, and allows the removal ofmut
for self.It does introduce a bit of duplication between
execute_sanitized_transaction_readonly
andexecute_sanitized_transaction
and the naming might be suboptimal. If you have proposal to make it cleaner on those points lmk.