chore: remove reth-interfaces from static file (#8428)

This commit is contained in:
Matthias Seitz
2024-05-28 15:43:37 +02:00
committed by GitHub
parent c16fb4e49a
commit f6e1c7f76e
8 changed files with 13 additions and 12 deletions

View File

@ -16,7 +16,7 @@ workspace = true
reth-primitives.workspace = true
reth-db.workspace = true
reth-provider.workspace = true
reth-interfaces.workspace = true
reth-storage-errors.workspace = true
reth-nippy-jar.workspace = true
reth-tokio-util.workspace = true
@ -30,6 +30,7 @@ rayon.workspace = true
parking_lot = { workspace = true, features = ["send_guard", "arc_lock"] }
[dev-dependencies]
reth-interfaces.workspace = true
reth-db = { workspace = true, features = ["test-utils"] }
reth-stages = { workspace = true, features = ["test-utils"] }

View File

@ -3,12 +3,12 @@ use reth_db::{
cursor::DbCursorRO, database::Database, static_file::create_static_file_T1_T2_T3, tables,
transaction::DbTx, RawKey, RawTable,
};
use reth_interfaces::provider::ProviderResult;
use reth_primitives::{static_file::SegmentConfig, BlockNumber, StaticFileSegment};
use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
DatabaseProviderRO,
};
use reth_storage_errors::provider::ProviderResult;
use std::{ops::RangeInclusive, path::Path};
/// Static File segment responsible for [StaticFileSegment::Headers] part of data.

View File

@ -12,7 +12,6 @@ pub use receipts::Receipts;
use reth_db::{
cursor::DbCursorRO, database::Database, table::Table, transaction::DbTx, RawKey, RawTable,
};
use reth_interfaces::provider::ProviderResult;
use reth_nippy_jar::NippyJar;
use reth_primitives::{
static_file::{
@ -24,6 +23,7 @@ use reth_primitives::{
use reth_provider::{
providers::StaticFileProvider, DatabaseProviderRO, ProviderError, TransactionsProviderExt,
};
use reth_storage_errors::provider::ProviderResult;
use std::{ops::RangeInclusive, path::Path};
pub(crate) type Rows<const COLUMNS: usize> = [Vec<Vec<u8>>; COLUMNS];

View File

@ -3,7 +3,6 @@ use reth_db::{
cursor::DbCursorRO, database::Database, static_file::create_static_file_T1, tables,
transaction::DbTx,
};
use reth_interfaces::provider::{ProviderError, ProviderResult};
use reth_primitives::{
static_file::{SegmentConfig, SegmentHeader},
BlockNumber, StaticFileSegment, TxNumber,
@ -12,6 +11,7 @@ use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
BlockReader, DatabaseProviderRO, TransactionsProviderExt,
};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use std::{ops::RangeInclusive, path::Path};
/// Static File segment responsible for [StaticFileSegment::Receipts] part of data.

View File

@ -3,7 +3,6 @@ use reth_db::{
cursor::DbCursorRO, database::Database, static_file::create_static_file_T1, tables,
transaction::DbTx,
};
use reth_interfaces::provider::{ProviderError, ProviderResult};
use reth_primitives::{
static_file::{SegmentConfig, SegmentHeader},
BlockNumber, StaticFileSegment, TxNumber,
@ -12,6 +11,7 @@ use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
BlockReader, DatabaseProviderRO, TransactionsProviderExt,
};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use std::{ops::RangeInclusive, path::Path};
/// Static File segment responsible for [StaticFileSegment::Transactions] part of data.

View File

@ -4,12 +4,12 @@ use crate::{segments, segments::Segment, StaticFileProducerEvent};
use parking_lot::Mutex;
use rayon::prelude::*;
use reth_db::database::Database;
use reth_interfaces::RethResult;
use reth_primitives::{static_file::HighestStaticFiles, BlockNumber, PruneModes};
use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
ProviderFactory,
};
use reth_storage_errors::provider::ProviderResult;
use reth_tokio_util::{EventSender, EventStream};
use std::{
ops::{Deref, RangeInclusive},
@ -19,7 +19,7 @@ use std::{
use tracing::{debug, trace};
/// Result of [StaticFileProducerInner::run] execution.
pub type StaticFileProducerResult = RethResult<StaticFileTargets>;
pub type StaticFileProducerResult = ProviderResult<StaticFileTargets>;
/// The [StaticFileProducer] instance itself with the result of [StaticFileProducerInner::run]
pub type StaticFileProducerWithResult<DB> = (StaticFileProducer<DB>, StaticFileProducerResult);
@ -154,7 +154,7 @@ impl<DB: Database> StaticFileProducerInner<DB> {
segments.push((Box::new(segments::Receipts), block_range));
}
segments.par_iter().try_for_each(|(segment, block_range)| -> RethResult<()> {
segments.par_iter().try_for_each(|(segment, block_range)| -> ProviderResult<()> {
debug!(target: "static_file", segment = %segment.segment(), ?block_range, "StaticFileProducer segment");
let start = Instant::now();
@ -189,7 +189,7 @@ impl<DB: Database> StaticFileProducerInner<DB> {
pub fn get_static_file_targets(
&self,
finalized_block_numbers: HighestStaticFiles,
) -> RethResult<StaticFileTargets> {
) -> ProviderResult<StaticFileTargets> {
let highest_static_files = self.static_file_provider.get_highest_static_files();
let targets = StaticFileTargets {
@ -252,7 +252,6 @@ mod tests {
generators,
generators::{random_block_range, random_receipt},
},
RethError,
};
use reth_primitives::{
static_file::HighestStaticFiles, PruneModes, StaticFileSegment, B256, U256,
@ -373,7 +372,7 @@ mod tests {
);
assert_matches!(
static_file_producer.run(targets),
Err(RethError::Provider(ProviderError::BlockBodyIndicesNotFound(4)))
Err(ProviderError::BlockBodyIndicesNotFound(4))
);
assert_eq!(
static_file_provider.get_highest_static_files(),