Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
chore: move primitives/exex to reth-exex-types (paradigmxyz#8677)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo authored Jun 7, 2024
1 parent d0e3504 commit a7152ed
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 9 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down Expand Up @@ -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" }
Expand Down
1 change: 1 addition & 0 deletions crates/consensus/beacon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion crates/consensus/beacon/src/engine/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions crates/exex/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions crates/exex/exex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ pub use manager::*;

mod notification;
pub use notification::*;

// Re-export exex types
#[doc(inline)]
pub use reth_exex_types::*;
4 changes: 2 additions & 2 deletions crates/exex/exex/src/manager.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
15 changes: 15 additions & 0 deletions crates/exex/types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 0 additions & 2 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ mod compression;
pub mod constants;
pub mod eip4844;
mod error;
mod exex;
pub mod genesis;
mod header;
mod integer_list;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions crates/prune/prune/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion crates/prune/prune/src/builder.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 4 additions & 2 deletions crates/prune/prune/src/pruner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit a7152ed

Please sign in to comment.