@@ -4,7 +4,6 @@ use crate::{
44 ExecutionWitness ,
55} ;
66use alloc:: {
7- boxed:: Box ,
87 collections:: BTreeMap ,
98 fmt:: Debug ,
109 string:: { String , ToString } ,
@@ -19,9 +18,7 @@ use reth_errors::ConsensusError;
1918use reth_ethereum_consensus:: { validate_block_post_execution, EthBeaconConsensus } ;
2019use reth_ethereum_primitives:: { Block , EthPrimitives } ;
2120use reth_evm:: { execute:: Executor , ConfigureEvm } ;
22- use reth_primitives_traits:: {
23- block:: error:: BlockRecoveryError , Block as _, RecoveredBlock , SealedHeader ,
24- } ;
21+ use reth_primitives_traits:: { RecoveredBlock , SealedHeader } ;
2522use reth_trie_common:: { HashedPostState , KeccakKeyHasher } ;
2623
2724/// Errors that can occur during stateless validation.
@@ -89,9 +86,9 @@ pub enum StatelessValidationError {
8986 expected : B256 ,
9087 } ,
9188
92- /// Error when recovering signers
93- #[ error( "error recovering the signers in the block " ) ]
94- SignerRecovery ( # [ from ] Box < BlockRecoveryError < Block > > ) ,
89+ /// Custom error.
90+ #[ error( "{0} " ) ]
91+ Custom ( & ' static str ) ,
9592}
9693
9794/// Performs stateless validation of a block using the provided witness data.
@@ -130,7 +127,7 @@ pub enum StatelessValidationError {
130127/// If all steps succeed the function returns `Some` containing the hash of the validated
131128/// `current_block`.
132129pub fn stateless_validation < ChainSpec , E > (
133- current_block : Block ,
130+ current_block : RecoveredBlock < Block > ,
134131 witness : ExecutionWitness ,
135132 chain_spec : Arc < ChainSpec > ,
136133 evm_config : E ,
@@ -154,7 +151,7 @@ where
154151///
155152/// See `stateless_validation` for detailed documentation of the validation process.
156153pub fn stateless_validation_with_trie < T , ChainSpec , E > (
157- current_block : Block ,
154+ current_block : RecoveredBlock < Block > ,
158155 witness : ExecutionWitness ,
159156 chain_spec : Arc < ChainSpec > ,
160157 evm_config : E ,
@@ -164,10 +161,6 @@ where
164161 ChainSpec : Send + Sync + EthChainSpec < Header = Header > + EthereumHardforks + Debug ,
165162 E : ConfigureEvm < Primitives = EthPrimitives > + Clone + ' static ,
166163{
167- let current_block = current_block
168- . try_into_recovered ( )
169- . map_err ( |err| StatelessValidationError :: SignerRecovery ( Box :: new ( err) ) ) ?;
170-
171164 let mut ancestor_headers: Vec < _ > = witness
172165 . headers
173166 . iter ( )
0 commit comments