(
&mut self,
state_provider: S,
env: ExecutionEnv<Evm>,
input: &BlockOrPayload<T>,
handle: &mut PayloadHandle<impl ExecutableTxFor<Evm>, Err, BaseReceipt>,
| 713 | #[instrument(level = "debug", target = "engine::tree::payload_validator", skip_all)] |
| 714 | #[expect(clippy::type_complexity)] |
| 715 | fn execute_block<S, Err, T>( |
| 716 | &mut self, |
| 717 | state_provider: S, |
| 718 | env: ExecutionEnv<Evm>, |
| 719 | input: &BlockOrPayload<T>, |
| 720 | handle: &mut PayloadHandle<impl ExecutableTxFor<Evm>, Err, BaseReceipt>, |
| 721 | ) -> Result< |
| 722 | ( |
| 723 | BlockExecutionOutput<BaseReceipt>, |
| 724 | Vec<Address>, |
| 725 | tokio::sync::oneshot::Receiver<(B256, alloy_primitives::Bloom)>, |
| 726 | ), |
| 727 | InsertBlockErrorKind, |
| 728 | > |
| 729 | where |
| 730 | S: StateProvider + Send, |
| 731 | Err: core::error::Error + Send + Sync + 'static, |
| 732 | V: PayloadValidator<T, Block = BaseBlock>, |
| 733 | T: PayloadTypes< |
| 734 | BuiltPayload: BuiltPayload<Primitives = BasePrimitives>, |
| 735 | ExecutionData = ExecutionData, |
| 736 | >, |
| 737 | Evm: ConfigureEngineEvm<T::ExecutionData, Primitives = BasePrimitives>, |
| 738 | { |
| 739 | debug!(target: "engine::tree::payload_validator", "Executing block"); |
| 740 | |
| 741 | let mut db = debug_span!(target: "engine::tree", "build_state_db").in_scope(|| { |
| 742 | State::builder() |
| 743 | .with_database(StateProviderDatabase::new(state_provider)) |
| 744 | .with_bundle_update() |
| 745 | .build() |
| 746 | }); |
| 747 | |
| 748 | let (spec_id, mut executor) = { |
| 749 | let _span = debug_span!(target: "engine::tree", "create_evm").entered(); |
| 750 | let spec_id = *env.evm_env.spec_id(); |
| 751 | let evm: BaseEvm< |
| 752 | &mut State<StateProviderDatabase<S>>, |
| 753 | revm::inspector::NoOpInspector, |
| 754 | reth_evm::precompiles::PrecompilesMap, |
| 755 | > = self.evm_config.evm_with_env(&mut db, env.evm_env); |
| 756 | let ctx = |
| 757 | self.execution_ctx_for(input).map_err(|e: <Evm as ConfigureEvm>::Error| { |
| 758 | InsertBlockErrorKind::Other(Box::new(e)) |
| 759 | })?; |
| 760 | |
| 761 | let executor = BaseBlockExecutor::new( |
| 762 | evm, |
| 763 | ctx, |
| 764 | self.provider.chain_spec(), |
| 765 | *self.evm_config.block_executor_factory().receipt_builder(), |
| 766 | ); |
| 767 | (spec_id, executor) |
| 768 | }; |
| 769 | |
| 770 | if !self.config.precompile_cache_disabled() { |
| 771 | let _span = debug_span!(target: "engine::tree", "setup_precompile_cache").entered(); |
| 772 | executor.evm_mut().precompiles_mut().map_cacheable_precompiles( |
no test coverage detected