reth_provider/providers/
mod.rs

1//! Contains the main provider types and traits for interacting with the blockchain's storage.
2
3use reth_chainspec::EthereumHardforks;
4use reth_db_api::table::Value;
5use reth_node_types::{FullNodePrimitives, NodeTypes, NodeTypesWithDB};
6
7mod database;
8pub use database::*;
9
10mod static_file;
11pub use static_file::{
12    StaticFileAccess, StaticFileJarProvider, StaticFileProvider, StaticFileProviderRW,
13    StaticFileProviderRWRefMut, StaticFileWriter,
14};
15
16mod state;
17pub use state::{
18    historical::{HistoricalStateProvider, HistoricalStateProviderRef, LowestAvailableBlocks},
19    latest::{LatestStateProvider, LatestStateProviderRef},
20};
21
22mod consistent_view;
23pub use consistent_view::{ConsistentDbView, ConsistentViewError};
24
25mod blockchain_provider;
26pub use blockchain_provider::BlockchainProvider;
27
28mod consistent;
29pub use consistent::ConsistentProvider;
30
31/// Helper trait to bound [`NodeTypes`] so that combined with database they satisfy
32/// [`ProviderNodeTypes`].
33pub trait NodeTypesForProvider
34where
35    Self: NodeTypes<
36        ChainSpec: EthereumHardforks,
37        Storage: ChainStorage<Self::Primitives>,
38        Primitives: FullNodePrimitives<SignedTx: Value, Receipt: Value, BlockHeader: Value>,
39    >,
40{
41}
42
43impl<T> NodeTypesForProvider for T where
44    T: NodeTypes<
45        ChainSpec: EthereumHardforks,
46        Storage: ChainStorage<T::Primitives>,
47        Primitives: FullNodePrimitives<SignedTx: Value, Receipt: Value, BlockHeader: Value>,
48    >
49{
50}
51
52/// Helper trait keeping common requirements of providers for [`NodeTypesWithDB`].
53pub trait ProviderNodeTypes
54where
55    Self: NodeTypesForProvider + NodeTypesWithDB,
56{
57}
58impl<T> ProviderNodeTypes for T where T: NodeTypesForProvider + NodeTypesWithDB {}