feat: make RPC cache generic over primitives (#13146)

This commit is contained in:
Arsenii Kulikov
2024-12-05 17:14:51 +04:00
committed by GitHub
parent 804dc99ef4
commit b4124dd1b0
31 changed files with 354 additions and 274 deletions

View File

@ -16,6 +16,7 @@ reth-chainspec.workspace = true
reth-ethereum-forks.workspace = true
reth-evm.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-revm.workspace = true
reth-execution-errors.workspace = true
reth-execution-types.workspace = true
@ -63,6 +64,7 @@ std = [
"alloy-genesis/std",
"alloy-primitives/std",
"revm-primitives/std",
"reth-primitives-traits/std",
"revm/std",
"reth-optimism-primitives/std",
"reth-ethereum-forks/std",

View File

@ -8,7 +8,7 @@ use reth_chainspec::ChainSpec;
use reth_execution_errors::BlockExecutionError;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_forks::OpHardfork;
use reth_primitives::BlockBody;
use reth_primitives_traits::BlockBody;
use revm::{
primitives::{Bytecode, HashMap, SpecId},
DatabaseCommit, L1BlockInfo,
@ -32,9 +32,9 @@ const L1_BLOCK_ECOTONE_SELECTOR: [u8; 4] = hex!("440a5e20");
/// transaction in the L2 block.
///
/// Returns an error if the L1 info transaction is not found, if the block is empty.
pub fn extract_l1_info(body: &BlockBody) -> Result<L1BlockInfo, OpBlockExecutionError> {
pub fn extract_l1_info<B: BlockBody>(body: &B) -> Result<L1BlockInfo, OpBlockExecutionError> {
let l1_info_tx_data = body
.transactions
.transactions()
.first()
.ok_or_else(|| OpBlockExecutionError::L1BlockInfoError {
message: "could not find l1 block info tx in the L2 block".to_string(),