chore: remove reth primitives [tokio] and [tokio-stream] dependencies (#5111)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Emmanuel Ekpenyong
2023-10-21 06:58:43 +01:00
committed by GitHub
parent 9dd270e4e8
commit 33df4e5766
16 changed files with 57 additions and 19 deletions

View File

@@ -21,6 +21,7 @@ reth-payload-builder.workspace = true
reth-prune = { path = "../../prune" }
reth-snapshot = { path = "../../snapshot" }
reth-rpc-types-compat.workspace = true
reth-tokio-util.workspace = true
# async
tokio = { workspace = true, features = ["sync"] }
tokio-stream.workspace = true

View File

@@ -22,8 +22,8 @@ use reth_interfaces::{
};
use reth_payload_builder::{PayloadBuilderAttributes, PayloadBuilderHandle};
use reth_primitives::{
constants::EPOCH_SLOTS, listener::EventListeners, stage::StageId, BlockNumHash, BlockNumber,
ChainSpec, Head, Header, SealedBlock, SealedHeader, B256, U256,
constants::EPOCH_SLOTS, stage::StageId, BlockNumHash, BlockNumber, ChainSpec, Head, Header,
SealedBlock, SealedHeader, B256, U256,
};
use reth_provider::{
BlockIdReader, BlockReader, BlockSource, CanonChainTracker, ChainSpecProvider, ProviderError,
@@ -36,6 +36,7 @@ use reth_rpc_types::engine::{
use reth_rpc_types_compat::engine::payload::{try_into_block, validate_block_hash};
use reth_stages::{ControlFlow, Pipeline, PipelineError};
use reth_tasks::TaskSpawner;
use reth_tokio_util::EventListeners;
use std::{
pin::Pin,
sync::Arc,

View File

@@ -30,6 +30,7 @@ reth-tasks.workspace = true
reth-transaction-pool.workspace = true
reth-provider.workspace = true
reth-rpc-types.workspace = true
reth-tokio-util.workspace = true
alloy-rlp.workspace = true

View File

@@ -41,9 +41,10 @@ use reth_eth_wire::{
use reth_metrics::common::mpsc::UnboundedMeteredSender;
use reth_net_common::bandwidth_meter::BandwidthMeter;
use reth_network_api::ReputationChangeKind;
use reth_primitives::{listener::EventListeners, ForkId, NodeRecord, PeerId, B256};
use reth_primitives::{ForkId, NodeRecord, PeerId, B256};
use reth_provider::{BlockNumReader, BlockReader};
use reth_rpc_types::{EthProtocolInfo, NetworkStatus};
use reth_tokio_util::EventListeners;
use std::{
net::SocketAddr,
pin::Pin,

View File

@@ -31,10 +31,6 @@ crc = "3"
# tracing
tracing.workspace = true
# tokio
tokio = { workspace = true, default-features = false, features = ["sync"] }
tokio-stream.workspace = true
# misc
bytes.workspace = true
byteorder = "1"

View File

@@ -30,7 +30,6 @@ mod genesis;
mod hardfork;
mod header;
mod integer_list;
pub mod listener;
mod log;
mod net;
mod peer;

View File

@@ -1,4 +0,0 @@
//! Event listeners.
mod event_listeners;
pub use event_listeners::EventListeners;

View File

@@ -17,6 +17,7 @@ reth-db.workspace = true
reth-provider.workspace = true
reth-interfaces.workspace = true
reth-snapshot = { path = "../snapshot" }
reth-tokio-util.workspace = true
# async
tokio = { workspace = true, features = ["sync"] }

View File

@@ -6,11 +6,10 @@ use crate::{
Metrics, PrunerError, PrunerEvent,
};
use reth_db::database::Database;
use reth_primitives::{
listener::EventListeners, BlockNumber, ChainSpec, PruneMode, PruneProgress, PruneSegment,
};
use reth_primitives::{BlockNumber, ChainSpec, PruneMode, PruneProgress, PruneSegment};
use reth_provider::{ProviderFactory, PruneCheckpointReader};
use reth_snapshot::HighestSnapshotsTracker;
use reth_tokio_util::EventListeners;
use std::{collections::BTreeMap, sync::Arc, time::Instant};
use tokio_stream::wrappers::UnboundedReceiverStream;
use tracing::{debug, trace};

View File

@@ -22,6 +22,7 @@ reth-db.workspace = true
reth-codecs = { path = "../storage/codecs" }
reth-provider.workspace = true
reth-trie = { path = "../trie" }
reth-tokio-util.workspace = true
# revm
revm.workspace = true

View File

@@ -6,10 +6,10 @@ use futures_util::Future;
use reth_db::database::Database;
use reth_interfaces::executor::BlockExecutionError;
use reth_primitives::{
constants::BEACON_CONSENSUS_REORG_UNWIND_DEPTH, listener::EventListeners, stage::StageId,
BlockNumber, ChainSpec, B256,
constants::BEACON_CONSENSUS_REORG_UNWIND_DEPTH, stage::StageId, BlockNumber, ChainSpec, B256,
};
use reth_provider::{ProviderFactory, StageCheckpointReader, StageCheckpointWriter};
use reth_tokio_util::EventListeners;
use std::{pin::Pin, sync::Arc};
use tokio::sync::watch;
use tokio_stream::wrappers::UnboundedReceiverStream;

View File

@@ -0,0 +1,17 @@
[package]
name = "reth-tokio-util"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = """
Additional utilities for working with Tokio in reth.
"""
[dependencies]
# async
tokio = { workspace = true, features = ["sync"] }
tokio-stream = { workspace = true, features = ["sync"] }

View File

@@ -0,0 +1,13 @@
//! Event listeners
#![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/"
)]
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
mod event_listeners;
pub use event_listeners::EventListeners;