mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-10 07:48:19 -05:00
feat: parallelize recovery (#20169)
Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -25,6 +25,7 @@ use reth_op::{
|
||||
primitives::SignedTransaction,
|
||||
};
|
||||
use reth_rpc_api::eth::helpers::pending_block::BuildPendingEnv;
|
||||
use revm_primitives::Bytes;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -126,13 +127,15 @@ impl ConfigureEngineEvm<CustomExecutionData> for CustomEvmConfig {
|
||||
&self,
|
||||
payload: &CustomExecutionData,
|
||||
) -> Result<impl ExecutableTxIterator<Self>, Self::Error> {
|
||||
Ok(payload.inner.payload.transactions().clone().into_iter().map(|encoded| {
|
||||
let transactions = payload.inner.payload.transactions().clone().into_iter();
|
||||
let convert = |encoded: Bytes| {
|
||||
let tx = CustomTransaction::decode_2718_exact(encoded.as_ref())
|
||||
.map_err(Into::into)
|
||||
.map_err(PayloadError::Decode)?;
|
||||
let signer = tx.try_recover().map_err(NewPayloadError::other)?;
|
||||
Ok::<_, NewPayloadError>(WithEncoded::new(encoded, tx.with_signer(signer)))
|
||||
}))
|
||||
};
|
||||
Ok((transactions, convert))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user