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    overlay::OverlayStateProvider,
21};
22
23mod consistent_view;
24pub use consistent_view::{ConsistentDbView, ConsistentViewError};
25
26mod blockchain_provider;
27pub use blockchain_provider::BlockchainProvider;
28
29mod consistent;
30pub use consistent::ConsistentProvider;
31
32/// Helper trait to bound [`NodeTypes`] so that combined with database they satisfy
33/// [`ProviderNodeTypes`].
34pub trait NodeTypesForProvider
35where
36    Self: NodeTypes<
37        ChainSpec: EthereumHardforks,
38        Storage: ChainStorage<Self::Primitives>,
39        Primitives: FullNodePrimitives<SignedTx: Value, Receipt: Value, BlockHeader: Value>,
40    >,
41{
42}
43
44impl<T> NodeTypesForProvider for T where
45    T: NodeTypes<
46        ChainSpec: EthereumHardforks,
47        Storage: ChainStorage<T::Primitives>,
48        Primitives: FullNodePrimitives<SignedTx: Value, Receipt: Value, BlockHeader: Value>,
49    >
50{
51}
52
53/// Helper trait keeping common requirements of providers for [`NodeTypesWithDB`].
54pub trait ProviderNodeTypes
55where
56    Self: NodeTypesForProvider + NodeTypesWithDB,
57{
58}
59impl<T> ProviderNodeTypes for T where T: NodeTypesForProvider + NodeTypesWithDB {}