feat: add EthExecutionStrategy (#11584)

This commit is contained in:
Federico Gimenez
2024-10-16 11:40:33 +02:00
committed by GitHub
parent 323d8edfb9
commit 0f903b1e20
5 changed files with 1184 additions and 9 deletions

1
Cargo.lock generated
View File

@ -7382,6 +7382,7 @@ dependencies = [
"alloy-primitives",
"alloy-sol-types",
"reth-chainspec",
"reth-consensus",
"reth-ethereum-consensus",
"reth-ethereum-forks",
"reth-evm",

View File

@ -20,6 +20,7 @@ reth-revm.workspace = true
reth-ethereum-consensus.workspace = true
reth-prune-types.workspace = true
reth-execution-types.workspace = true
reth-consensus.workspace = true
# Ethereum
revm-primitives.workspace = true
@ -31,6 +32,7 @@ alloy-sol-types.workspace = true
[dev-dependencies]
reth-testing-utils.workspace = true
reth-evm = { workspace = true, features = ["test-utils"] }
reth-revm = { workspace = true, features = ["test-utils"] }
reth-primitives = { workspace = true, features = ["secp256k1"] }
secp256k1.workspace = true

View File

@ -33,6 +33,7 @@ use reth_ethereum_forks::EthereumHardfork;
use reth_primitives::constants::EIP1559_INITIAL_BASE_FEE;
pub mod execute;
pub mod strategy;
/// Ethereum DAO hardfork state change data.
pub mod dao_fork;

File diff suppressed because it is too large Load Diff

View File

@ -8,10 +8,9 @@ pub use reth_execution_types::{BlockExecutionInput, BlockExecutionOutput, Execut
pub use reth_storage_errors::provider::ProviderError;
use crate::system_calls::OnStateHook;
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloc::{boxed::Box, vec::Vec};
use alloy_primitives::BlockNumber;
use core::{fmt::Display, marker::PhantomData};
use reth_chainspec::ChainSpec;
use reth_consensus::ConsensusError;
use reth_primitives::{BlockWithSenders, Receipt, Request};
use reth_prune_types::PruneModes;
@ -205,9 +204,6 @@ pub trait BlockExecutionStrategy<DB> {
/// Returns the final bundle state.
fn finish(&mut self) -> BundleState;
/// Returns the strategy chain spec.
fn chain_spec(&self) -> Arc<ChainSpec>;
/// Validate a block with regard to execution results.
fn validate_block_post_execution(
&self,
@ -629,10 +625,6 @@ mod tests {
self.finish_result.clone()
}
fn chain_spec(&self) -> Arc<ChainSpec> {
MAINNET.clone()
}
fn validate_block_post_execution(
&self,
_block: &BlockWithSenders,