mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add EthExecutionStrategy (#11584)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -7382,6 +7382,7 @@ dependencies = [
|
||||
"alloy-primitives",
|
||||
"alloy-sol-types",
|
||||
"reth-chainspec",
|
||||
"reth-consensus",
|
||||
"reth-ethereum-consensus",
|
||||
"reth-ethereum-forks",
|
||||
"reth-evm",
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
1179
crates/ethereum/evm/src/strategy.rs
Normal file
1179
crates/ethereum/evm/src/strategy.rs
Normal file
File diff suppressed because it is too large
Load Diff
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user