diff --git a/.github/assets/check_wasm.sh b/.github/assets/check_wasm.sh index 2eced75399..b47655f2dd 100755 --- a/.github/assets/check_wasm.sh +++ b/.github/assets/check_wasm.sh @@ -72,7 +72,7 @@ exclude_crates=( reth-testing-utils reth-optimism-txpool # reth-transaction-pool reth-era-downloader # tokio - reth-era-import # tokio + reth-era-utils # tokio ) # Array to hold the results diff --git a/Cargo.lock b/Cargo.lock index bbf799ac74..f73213a6b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7113,7 +7113,7 @@ dependencies = [ "reth-downloaders", "reth-ecies", "reth-era-downloader", - "reth-era-import", + "reth-era-utils", "reth-eth-wire", "reth-ethereum-cli", "reth-ethereum-primitives", @@ -7796,7 +7796,7 @@ dependencies = [ ] [[package]] -name = "reth-era-import" +name = "reth-era-utils" version = "1.3.12" dependencies = [ "alloy-primitives", diff --git a/Cargo.toml b/Cargo.toml index bd9d9fec23..a461be7847 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ members = [ "crates/engine/util/", "crates/era", "crates/era-downloader", - "crates/era-import", + "crates/era-utils", "crates/errors/", "crates/ethereum-forks/", "crates/ethereum/cli/", @@ -346,7 +346,7 @@ reth-engine-service = { path = "crates/engine/service" } reth-engine-util = { path = "crates/engine/util" } reth-era = { path = "crates/era" } reth-era-downloader = { path = "crates/era-downloader" } -reth-era-import = { path = "crates/era-import" } +reth-era-utils = { path = "crates/era-utils" } reth-errors = { path = "crates/errors" } reth-eth-wire = { path = "crates/net/eth-wire" } reth-eth-wire-types = { path = "crates/net/eth-wire-types" } diff --git a/crates/cli/commands/Cargo.toml b/crates/cli/commands/Cargo.toml index 0fad0420fa..8c0f55d258 100644 --- a/crates/cli/commands/Cargo.toml +++ b/crates/cli/commands/Cargo.toml @@ -25,7 +25,7 @@ reth-downloaders.workspace = true reth-ecies.workspace = true reth-eth-wire.workspace = true reth-era-downloader.workspace = true -reth-era-import.workspace = true +reth-era-utils.workspace = true reth-etl.workspace = true reth-evm.workspace = true reth-exex.workspace = true diff --git a/crates/cli/commands/src/import_era.rs b/crates/cli/commands/src/import_era.rs index 25c00161d8..e3c3cfa1bf 100644 --- a/crates/cli/commands/src/import_era.rs +++ b/crates/cli/commands/src/import_era.rs @@ -35,11 +35,7 @@ impl> ImportEraC let hash_collector = Collector::new(config.stages.etl.file_size, config.stages.etl.dir); let stream = read_dir(self.path)?; - reth_era_import::import( - stream, - &provider_factory.provider_rw().unwrap().0, - hash_collector, - )?; + reth_era_utils::import(stream, &provider_factory.provider_rw().unwrap().0, hash_collector)?; Ok(()) } diff --git a/crates/era-import/Cargo.toml b/crates/era-utils/Cargo.toml similarity index 90% rename from crates/era-import/Cargo.toml rename to crates/era-utils/Cargo.toml index ac284c031c..a0634a47ec 100644 --- a/crates/era-import/Cargo.toml +++ b/crates/era-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "reth-era-import" -description = "Imports history from ERA files" +name = "reth-era-utils" +description = "Utilities to store and fetch history data with storage-api" version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/era-import/src/history.rs b/crates/era-utils/src/history.rs similarity index 100% rename from crates/era-import/src/history.rs rename to crates/era-utils/src/history.rs diff --git a/crates/era-import/src/lib.rs b/crates/era-utils/src/lib.rs similarity index 54% rename from crates/era-import/src/lib.rs rename to crates/era-utils/src/lib.rs index ee6d01be85..b72f0eb0c0 100644 --- a/crates/era-import/src/lib.rs +++ b/crates/era-utils/src/lib.rs @@ -1,7 +1,8 @@ -//! Imports history from ERA files. +//! Utilities to store history from downloaded ERA files with storage-api //! //! The import is downloaded using [`reth_era_downloader`] and parsed using [`reth_era`]. mod history; +/// Imports history from ERA files. pub use history::import; diff --git a/crates/era-import/tests/it/history.rs b/crates/era-utils/tests/it/history.rs similarity index 93% rename from crates/era-import/tests/it/history.rs rename to crates/era-utils/tests/it/history.rs index 4e7b24b678..e457043701 100644 --- a/crates/era-import/tests/it/history.rs +++ b/crates/era-utils/tests/it/history.rs @@ -35,7 +35,7 @@ async fn test_history_imports_from_fresh_state_successfully() { let expected_block_number = 8191; let actual_block_number = - reth_era_import::import(stream, &pf.provider_rw().unwrap().0, hash_collector).unwrap(); + reth_era_utils::import(stream, &pf.provider_rw().unwrap().0, hash_collector).unwrap(); assert_eq!(actual_block_number, expected_block_number); } diff --git a/crates/era-import/tests/it/main.rs b/crates/era-utils/tests/it/main.rs similarity index 100% rename from crates/era-import/tests/it/main.rs rename to crates/era-utils/tests/it/main.rs