mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat: wire SystemCaller (#11321)
This commit is contained in:
@ -6,10 +6,7 @@ use eyre::OptionExt;
|
||||
use pretty_assertions::Comparison;
|
||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||
use reth_engine_primitives::InvalidBlockHook;
|
||||
use reth_evm::{
|
||||
system_calls::{apply_beacon_root_contract_call, apply_blockhashes_contract_call},
|
||||
ConfigureEvm,
|
||||
};
|
||||
use reth_evm::{system_calls::SystemCaller, ConfigureEvm};
|
||||
use reth_primitives::{Header, Receipt, SealedBlockWithSenders, SealedHeader};
|
||||
use reth_provider::{BlockExecutionOutput, ChainSpecProvider, StateProviderFactory};
|
||||
use reth_revm::{
|
||||
@ -87,23 +84,10 @@ where
|
||||
EnvWithHandlerCfg::new_with_cfg_env(cfg, block_env, Default::default()),
|
||||
);
|
||||
|
||||
let mut system_caller = SystemCaller::new(&self.evm_config, self.provider.chain_spec());
|
||||
|
||||
// Apply pre-block system contract calls.
|
||||
apply_beacon_root_contract_call(
|
||||
&self.evm_config,
|
||||
self.provider.chain_spec().as_ref(),
|
||||
block.timestamp,
|
||||
block.number,
|
||||
block.parent_beacon_block_root,
|
||||
&mut evm,
|
||||
)?;
|
||||
apply_blockhashes_contract_call(
|
||||
&self.evm_config,
|
||||
&self.provider.chain_spec(),
|
||||
block.timestamp,
|
||||
block.number,
|
||||
block.parent_hash,
|
||||
&mut evm,
|
||||
)?;
|
||||
system_caller.apply_pre_execution_changes(&block.clone().unseal(), &mut evm)?;
|
||||
|
||||
// Re-execute all of the transactions in the block to load all touched accounts into
|
||||
// the cache DB.
|
||||
|
||||
Reference in New Issue
Block a user