chore: move primitives/exex to reth-exex-types (#8677)

This commit is contained in:
joshieDo
2024-06-07 18:31:24 +02:00
committed by GitHub
parent d0e3504ecc
commit a7152eda37
13 changed files with 55 additions and 9 deletions

10
Cargo.lock generated
View File

@ -6304,6 +6304,7 @@ dependencies = [
"reth-ethereum-engine-primitives",
"reth-evm",
"reth-evm-ethereum",
"reth-exex-types",
"reth-metrics",
"reth-network-p2p",
"reth-payload-builder",
@ -6918,6 +6919,7 @@ dependencies = [
"eyre",
"metrics",
"reth-config",
"reth-exex-types",
"reth-metrics",
"reth-network",
"reth-node-api",
@ -6958,6 +6960,13 @@ dependencies = [
"tokio",
]
[[package]]
name = "reth-exex-types"
version = "0.2.0-beta.9"
dependencies = [
"alloy-primitives",
]
[[package]]
name = "reth-fs-util"
version = "0.2.0-beta.9"
@ -7584,6 +7593,7 @@ dependencies = [
"reth-db",
"reth-db-api",
"reth-errors",
"reth-exex-types",
"reth-metrics",
"reth-primitives",
"reth-provider",

View File

@ -24,6 +24,7 @@ members = [
"crates/evm/execution-types",
"crates/exex/exex/",
"crates/exex/test-utils/",
"crates/exex/types/",
"crates/metrics/",
"crates/metrics/metrics-derive/",
"crates/net/common/",
@ -269,6 +270,7 @@ reth-execution-errors = { path = "crates/evm/execution-errors" }
reth-execution-types = { path = "crates/evm/execution-types" }
reth-exex = { path = "crates/exex/exex" }
reth-exex-test-utils = { path = "crates/exex/test-utils" }
reth-exex-types = { path = "crates/exex/types" }
reth-fs-util = { path = "crates/fs-util" }
reth-ipc = { path = "crates/rpc/ipc" }
reth-libmdbx = { path = "crates/storage/libmdbx-rs" }

View File

@ -66,6 +66,7 @@ reth-evm-ethereum.workspace = true
reth-ethereum-engine-primitives.workspace = true
reth-config.workspace = true
reth-testing-utils.workspace = true
reth-exex-types.workspace = true
reth-prune-types.workspace = true
assert_matches.workspace = true

View File

@ -16,12 +16,13 @@ use reth_downloaders::{
use reth_ethereum_engine_primitives::EthEngineTypes;
use reth_evm::{either::Either, test_utils::MockExecutorProvider};
use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_exex_types::FinishedExExHeight;
use reth_network_p2p::{
bodies::client::BodiesClient, headers::client::HeadersClient, sync::NoopSyncStateUpdater,
test_utils::NoopFullBlockClient,
};
use reth_payload_builder::test_utils::spawn_test_payload_service;
use reth_primitives::{BlockNumber, ChainSpec, FinishedExExHeight, B256};
use reth_primitives::{BlockNumber, ChainSpec, B256};
use reth_provider::{
providers::BlockchainProvider, test_utils::create_test_provider_factory_with_chain_spec,
BundleStateWithReceipts, HeaderSyncMode,

View File

@ -14,6 +14,7 @@ workspace = true
[dependencies]
## reth
reth-config.workspace = true
reth-exex-types.workspace = true
reth-metrics.workspace = true
reth-node-api.workspace = true
reth-node-core.workspace = true

View File

@ -45,3 +45,7 @@ pub use manager::*;
mod notification;
pub use notification::*;
// Re-export exex types
#[doc(inline)]
pub use reth_exex_types::*;

View File

@ -1,7 +1,7 @@
use crate::{ExExEvent, ExExNotification};
use crate::{ExExEvent, ExExNotification, FinishedExExHeight};
use metrics::Gauge;
use reth_metrics::{metrics::Counter, Metrics};
use reth_primitives::{BlockNumber, FinishedExExHeight};
use reth_primitives::BlockNumber;
use reth_tracing::tracing::debug;
use std::{
collections::VecDeque,

View File

@ -0,0 +1,15 @@
[package]
name = "reth-exex-types"
version.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "Commonly used types for exex usage in reth."
[lints]
workspace = true
[dependencies]
alloy-primitives.workspace = true

View File

@ -1,4 +1,14 @@
use crate::BlockNumber;
//! Commonly used types for exex usage.
#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use alloy_primitives::BlockNumber;
/// The finished height of all `ExEx`'s.
#[derive(Debug, Clone, Copy)]

View File

@ -29,7 +29,6 @@ mod compression;
pub mod constants;
pub mod eip4844;
mod error;
mod exex;
pub mod genesis;
mod header;
mod integer_list;
@ -65,7 +64,6 @@ pub use constants::{
KECCAK_EMPTY, MAINNET_DEPOSIT_CONTRACT, MAINNET_GENESIS_HASH, SEPOLIA_GENESIS_HASH,
};
pub use error::{GotExpected, GotExpectedBoxed};
pub use exex::FinishedExExHeight;
pub use genesis::{ChainConfig, Genesis, GenesisAccount};
pub use header::{Header, HeaderValidationError, HeadersDirection, SealedHeader};
pub use integer_list::IntegerList;

View File

@ -13,6 +13,7 @@ workspace = true
[dependencies]
# reth
reth-exex-types.workspace = true
reth-primitives.workspace = true
reth-db.workspace = true
reth-db-api.workspace = true

View File

@ -1,7 +1,8 @@
use crate::{segments::SegmentSet, Pruner};
use reth_config::PruneConfig;
use reth_db_api::database::Database;
use reth_primitives::{FinishedExExHeight, MAINNET};
use reth_exex_types::FinishedExExHeight;
use reth_primitives::MAINNET;
use reth_provider::ProviderFactory;
use reth_prune_types::PruneModes;
use std::time::Duration;

View File

@ -6,7 +6,8 @@ use crate::{
Metrics, PrunerError, PrunerEvent,
};
use reth_db_api::database::Database;
use reth_primitives::{BlockNumber, FinishedExExHeight, StaticFileSegment};
use reth_exex_types::FinishedExExHeight;
use reth_primitives::{BlockNumber, StaticFileSegment};
use reth_provider::{
DatabaseProviderRW, ProviderFactory, PruneCheckpointReader, StaticFileProviderFactory,
};
@ -332,7 +333,8 @@ mod tests {
use crate::Pruner;
use reth_db::test_utils::{create_test_rw_db, create_test_static_files_dir};
use reth_primitives::{FinishedExExHeight, MAINNET};
use reth_exex_types::FinishedExExHeight;
use reth_primitives::MAINNET;
use reth_provider::{providers::StaticFileProvider, ProviderFactory};
#[test]