diff --git a/Cargo.lock b/Cargo.lock
index b483fd6641db9..cd182872822ce 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8083,8 +8083,8 @@ dependencies = [
"reth-chainspec",
"reth-db-api",
"reth-engine-primitives",
- "reth-primitives",
"reth-primitives-traits",
+ "reth-storage-api",
]
[[package]]
@@ -9057,6 +9057,7 @@ dependencies = [
"reth-db-models",
"reth-execution-types",
"reth-primitives",
+ "reth-primitives-traits",
"reth-prune-types",
"reth-stages-types",
"reth-storage-errors",
diff --git a/crates/ethereum/node/Cargo.toml b/crates/ethereum/node/Cargo.toml
index 98224b99e26b2..a41265b72319a 100644
--- a/crates/ethereum/node/Cargo.toml
+++ b/crates/ethereum/node/Cargo.toml
@@ -31,11 +31,12 @@ reth-node-api.workspace = true
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-revm = { workspace = true, features = ["std"] }
-
+reth-db.workspace = true
# revm with required ethereum features
revm = { workspace = true, features = ["secp256k1", "blst", "c-kzg"] }
# misc
+alloy-eips.workspace = true
eyre.workspace = true
[dev-dependencies]
diff --git a/crates/ethereum/node/src/node.rs b/crates/ethereum/node/src/node.rs
index dbd6ce0a134a4..0863ae6a3df3d 100644
--- a/crates/ethereum/node/src/node.rs
+++ b/crates/ethereum/node/src/node.rs
@@ -2,10 +2,12 @@
use std::sync::Arc;
+use alloy_eips::BlockHashOrNumber;
use reth_auto_seal_consensus::AutoSealConsensus;
use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGeneratorConfig};
use reth_beacon_consensus::EthBeaconConsensus;
use reth_chainspec::ChainSpec;
+use reth_db::transaction::{DbTx, DbTxMut};
use reth_ethereum_engine_primitives::{
EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes, EthereumEngineValidator,
};
@@ -26,8 +28,11 @@ use reth_node_builder::{
BuilderContext, Node, NodeAdapter, NodeComponentsBuilder, PayloadBuilderConfig, PayloadTypes,
};
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
-use reth_primitives::{Block, Header};
-use reth_provider::CanonStateSubscriptions;
+use reth_primitives::{Block, BlockBody, Header};
+use reth_provider::{
+ BlockNumReader, BlockReader, CanonStateSubscriptions, ChainStorageReader, DBProvider,
+ HeaderProvider, ProviderResult, TransactionsProvider, WithdrawalsProvider,
+};
use reth_rpc::EthApi;
use reth_tracing::tracing::{debug, info};
use reth_transaction_pool::{
@@ -81,6 +86,7 @@ impl EthereumNode {
impl NodeTypes for EthereumNode {
type Primitives = EthPrimitives;
type ChainSpec = ChainSpec;
+ type Storage = EthStorage;
}
impl NodeTypesWithEngine for EthereumNode {
@@ -126,6 +132,61 @@ where
}
}
+/// Ethereum storage that implements [`ChainStorageReader`].
+#[derive(Debug, Default)]
+pub struct EthStorage;
+
+impl ChainStorageReader for EthStorage {
+ type Primitives = EthPrimitives;
+
+ fn read_block
(
+ &self,
+ provider: &P,
+ id: BlockHashOrNumber,
+ ) -> ProviderResult