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, HistoricalStateProvider,
26 HistoricalStateProviderRef, LatestStateProvider, LatestStateProviderRef, ProviderFactory,
27 PruneShardOutcome, PrunedIndices, SaveBlocksMode, StaticFileAccess, StaticFileProviderBuilder,
28 StaticFileWriteCtx, StaticFileWriter,
29};
30
31pub mod changeset_walker;
32pub mod changesets_utils;
33
34#[cfg(any(test, feature = "test-utils"))]
35pub mod test_utils;
37
38pub mod either_writer;
39pub use either_writer::*;
40
41mod bal;
42pub use bal::{BalConfig, InMemoryBalStore};
43
44pub use reth_chain_state::{
45 CanonStateNotification, CanonStateNotificationSender, CanonStateNotificationStream,
46 CanonStateNotifications, CanonStateSubscriptions,
47};
48pub use reth_execution_types::*;
49pub use revm_database::states::OriginalValuesKnown;
51pub use reth_static_file_types as static_file;
53pub use reth_storage_api::{
54 BalNotification, BalNotificationStream, BalProvider, BalStore, BalStoreHandle,
55 GetBlockAccessListLimit, HistoryWriter, MetadataProvider, MetadataWriter, NoopBalStore,
56 SealedBal, StateWriteConfig, StatsReader, StorageSettings, StorageSettingsCache,
57};
58pub use reth_storage_errors::provider::{ProviderError, ProviderResult};
60pub use static_file::StaticFileSegment;
61
62pub fn to_range<R: std::ops::RangeBounds<u64>>(bounds: R) -> std::ops::Range<u64> {
64 let start = match bounds.start_bound() {
65 std::ops::Bound::Included(&v) => v,
66 std::ops::Bound::Excluded(&v) => v + 1,
67 std::ops::Bound::Unbounded => 0,
68 };
69
70 let end = match bounds.end_bound() {
71 std::ops::Bound::Included(&v) => v + 1,
72 std::ops::Bound::Excluded(&v) => v,
73 std::ops::Bound::Unbounded => u64::MAX,
74 };
75
76 start..end
77}