Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove reth-primitives dependency from reth-static-file #8903

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion crates/static-file/static-file/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ workspace = true

[dependencies]
# reth
reth-primitives.workspace = true
reth-db.workspace = true
reth-db-api.workspace = true
reth-provider.workspace = true
reth-storage-errors.workspace = true
reth-nippy-jar.workspace = true
reth-tokio-util.workspace = true
reth-prune-types.workspace = true
reth-static-file-types.workspace = true

alloy-primitives.workspace = true

# misc
tracing.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/static-file/static-file/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ pub use static_file_producer::{
StaticFileProducer, StaticFileProducerInner, StaticFileProducerResult,
StaticFileProducerWithResult, StaticFileTargets,
};

// Re-export for convenience.
pub use reth_static_file_types::*;
3 changes: 2 additions & 1 deletion crates/static-file/static-file/src/segments/headers.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use crate::segments::{dataset_for_compression, prepare_jar, Segment, SegmentHeader};
use alloy_primitives::BlockNumber;
use reth_db::{static_file::create_static_file_T1_T2_T3, tables, RawKey, RawTable};
use reth_db_api::{cursor::DbCursorRO, database::Database, transaction::DbTx};
use reth_primitives::{static_file::SegmentConfig, BlockNumber, StaticFileSegment};
use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
DatabaseProviderRO,
};
use reth_static_file_types::{SegmentConfig, StaticFileSegment};
use reth_storage_errors::provider::ProviderResult;
use std::{ops::RangeInclusive, path::Path};

Expand Down
12 changes: 5 additions & 7 deletions crates/static-file/static-file/src/segments/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ pub use headers::Headers;
mod receipts;
pub use receipts::Receipts;

use alloy_primitives::BlockNumber;
use reth_db::{RawKey, RawTable};
use reth_db_api::{cursor::DbCursorRO, database::Database, table::Table, transaction::DbTx};
use reth_nippy_jar::NippyJar;
use reth_primitives::{
static_file::{
find_fixed_range, Compression, Filters, InclusionFilter, PerfectHashingFunction,
SegmentConfig, SegmentHeader,
},
BlockNumber, StaticFileSegment,
};
use reth_provider::{
providers::StaticFileProvider, DatabaseProviderRO, ProviderError, TransactionsProviderExt,
};
use reth_static_file_types::{
find_fixed_range, Compression, Filters, InclusionFilter, PerfectHashingFunction, SegmentConfig,
SegmentHeader, StaticFileSegment,
};
use reth_storage_errors::provider::ProviderResult;
use std::{ops::RangeInclusive, path::Path};

Expand Down
6 changes: 2 additions & 4 deletions crates/static-file/static-file/src/segments/receipts.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use crate::segments::{dataset_for_compression, prepare_jar, Segment};
use alloy_primitives::{BlockNumber, TxNumber};
use reth_db::{static_file::create_static_file_T1, tables};
use reth_db_api::{cursor::DbCursorRO, database::Database, transaction::DbTx};
use reth_primitives::{
static_file::{SegmentConfig, SegmentHeader},
BlockNumber, StaticFileSegment, TxNumber,
};
use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
BlockReader, DatabaseProviderRO, TransactionsProviderExt,
};
use reth_static_file_types::{SegmentConfig, SegmentHeader, StaticFileSegment};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use std::{ops::RangeInclusive, path::Path};

Expand Down
6 changes: 2 additions & 4 deletions crates/static-file/static-file/src/segments/transactions.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use crate::segments::{dataset_for_compression, prepare_jar, Segment};
use alloy_primitives::{BlockNumber, TxNumber};
use reth_db::{static_file::create_static_file_T1, tables};
use reth_db_api::{cursor::DbCursorRO, database::Database, transaction::DbTx};
use reth_primitives::{
static_file::{SegmentConfig, SegmentHeader},
BlockNumber, StaticFileSegment, TxNumber,
};
use reth_provider::{
providers::{StaticFileProvider, StaticFileWriter},
BlockReader, DatabaseProviderRO, TransactionsProviderExt,
};
use reth_static_file_types::{SegmentConfig, SegmentHeader, StaticFileSegment};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use std::{ops::RangeInclusive, path::Path};

Expand Down
6 changes: 4 additions & 2 deletions crates/static-file/static-file/src/static_file_producer.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//! Support for producing static files.
use crate::{segments, segments::Segment, StaticFileProducerEvent};
use alloy_primitives::BlockNumber;
use parking_lot::Mutex;
use rayon::prelude::*;
use reth_db_api::database::Database;
use reth_primitives::{static_file::HighestStaticFiles, BlockNumber};
use reth_provider::{providers::StaticFileWriter, ProviderFactory, StaticFileProviderFactory};
use reth_prune_types::PruneModes;
use reth_static_file_types::HighestStaticFiles;
use reth_storage_errors::provider::ProviderResult;
use reth_tokio_util::{EventSender, EventStream};
use std::{
Expand Down Expand Up @@ -228,15 +229,16 @@ mod tests {
use crate::static_file_producer::{
StaticFileProducer, StaticFileProducerInner, StaticFileTargets,
};
use alloy_primitives::{B256, U256};
use assert_matches::assert_matches;
use reth_db::{test_utils::TempDatabase, DatabaseEnv};
use reth_db_api::{database::Database, transaction::DbTx};
use reth_primitives::{static_file::HighestStaticFiles, StaticFileSegment, B256, U256};
use reth_provider::{
providers::StaticFileWriter, ProviderError, ProviderFactory, StaticFileProviderFactory,
};
use reth_prune_types::PruneModes;
use reth_stages::test_utils::{StorageKind, TestStageDB};
use reth_static_file_types::{HighestStaticFiles, StaticFileSegment};
use reth_testing_utils::{
generators,
generators::{random_block_range, random_receipt},
Expand Down
Loading