1#![doc(
8 html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
9 html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
10 issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
11)]
12#![cfg_attr(not(test), warn(unused_crate_dependencies))]
13#![cfg_attr(docsrs, feature(doc_cfg))]
14
15pub mod init;
17
18mod traits;
20pub use traits::*;
21
22pub mod providers;
24pub use providers::{
25 DatabaseProvider, DatabaseProviderRO, DatabaseProviderRW, LatestStateProvider,
26 LatestStateProviderRef, ProviderFactory, PruneShardOutcome, PrunedIndices, SaveBlocksInput,
27 StaticFileAccess, StaticFileProviderBuilder, StaticFileWriteCtx, StaticFileWriter,
28};
29
30pub mod changeset_walker;
31pub mod changesets_utils;
32
33#[cfg(any(test, feature = "test-utils"))]
34pub mod test_utils;
36
37pub mod either_writer;
38pub use either_writer::*;
39
40mod bal;
41pub use bal::{BalConfig, InMemoryBalStore, RocksDBBalStore};
42
43pub use reth_chain_state::{
44 CanonStateNotification, CanonStateNotificationSender, CanonStateNotificationStream,
45 CanonStateNotifications, CanonStateSubscriptions,
46};
47pub use reth_execution_types::*;
48pub use revm::database::states::OriginalValuesKnown;
50pub use reth_static_file_types as static_file;
52pub use reth_storage_api::{
53 BalNotification, BalNotificationStream, BalProvider, BalStore, BalStoreHandle,
54 GetBlockAccessListLimit, HistoryWriter, MetadataProvider, MetadataWriter, NoopBalStore, RawBal,
55 StateWriteConfig, StatsReader, StorageSettings, StorageSettingsCache,
56};
57pub use reth_storage_errors::provider::{ProviderError, ProviderResult};
59pub use static_file::StaticFileSegment;
60
61pub fn to_range<R: std::ops::RangeBounds<u64>>(bounds: R) -> std::ops::Range<u64> {
63 let start = match bounds.start_bound() {
64 std::ops::Bound::Included(&v) => v,
65 std::ops::Bound::Excluded(&v) => v + 1,
66 std::ops::Bound::Unbounded => 0,
67 };
68
69 let end = match bounds.end_bound() {
70 std::ops::Bound::Included(&v) => v + 1,
71 std::ops::Bound::Excluded(&v) => v,
72 std::ops::Bound::Unbounded => u64::MAX,
73 };
74
75 start..end
76}