feat: update SystemCaller (#11718)

This commit is contained in:
Federico Gimenez
2024-10-14 17:52:34 +02:00
committed by GitHub
parent f684dd4c4c
commit 600a394571
11 changed files with 36 additions and 34 deletions

View File

@ -121,10 +121,12 @@ where
) -> Result<(Vec<Receipt>, u64), BlockExecutionError>
where
DB: Database<Error: Into<ProviderError> + Display>,
F: OnStateHook,
F: OnStateHook + 'static,
{
let mut system_caller =
SystemCaller::new(&self.evm_config, &self.chain_spec).with_state_hook(state_hook);
let mut system_caller = SystemCaller::new(self.evm_config.clone(), &self.chain_spec);
if let Some(hook) = state_hook {
system_caller.with_state_hook(Some(Box::new(hook) as Box<dyn OnStateHook>));
}
// apply pre execution changes
system_caller.apply_beacon_root_contract_call(
@ -306,7 +308,7 @@ where
state_hook: Option<F>,
) -> Result<(Vec<Receipt>, u64), BlockExecutionError>
where
F: OnStateHook,
F: OnStateHook + 'static,
{
// 1. prepare state on new block
self.on_new_block(&block.header);
@ -410,7 +412,7 @@ where
state_hook: F,
) -> Result<Self::Output, Self::Error>
where
F: OnStateHook,
F: OnStateHook + 'static,
{
let BlockExecutionInput { block, total_difficulty } = input;
let (receipts, gas_used) = self.execute_without_verification_with_state_hook(