mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: move prune event type (#12732)
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -8122,7 +8122,7 @@ dependencies = [
|
||||
"reth-engine-primitives",
|
||||
"reth-network-api",
|
||||
"reth-primitives-traits",
|
||||
"reth-prune",
|
||||
"reth-prune-types",
|
||||
"reth-stages",
|
||||
"reth-static-file-types",
|
||||
"reth-storage-api",
|
||||
|
||||
@ -16,7 +16,7 @@ reth-storage-api.workspace = true
|
||||
reth-beacon-consensus.workspace = true
|
||||
reth-network-api.workspace = true
|
||||
reth-stages.workspace = true
|
||||
reth-prune.workspace = true
|
||||
reth-prune-types.workspace = true
|
||||
reth-static-file-types.workspace = true
|
||||
reth-primitives-traits.workspace = true
|
||||
reth-engine-primitives.workspace = true
|
||||
|
||||
@ -9,7 +9,7 @@ use reth_beacon_consensus::{BeaconConsensusEngineEvent, ConsensusEngineLiveSyncP
|
||||
use reth_engine_primitives::ForkchoiceStatus;
|
||||
use reth_network_api::{NetworkEvent, PeersInfo};
|
||||
use reth_primitives_traits::{format_gas, format_gas_throughput};
|
||||
use reth_prune::PrunerEvent;
|
||||
use reth_prune_types::PrunerEvent;
|
||||
use reth_stages::{EntitiesCheckpoint, ExecOutput, PipelineEvent, StageCheckpoint, StageId};
|
||||
use reth_static_file_types::StaticFileProducerEvent;
|
||||
use std::{
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
use alloy_primitives::BlockNumber;
|
||||
use reth_prune_types::PrunedSegmentInfo;
|
||||
use std::time::Duration;
|
||||
|
||||
/// An event emitted by a [Pruner][crate::Pruner].
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
pub enum PrunerEvent {
|
||||
/// Emitted when pruner started running.
|
||||
Started { tip_block_number: BlockNumber },
|
||||
/// Emitted when pruner finished running.
|
||||
Finished { tip_block_number: BlockNumber, elapsed: Duration, stats: Vec<PrunedSegmentInfo> },
|
||||
}
|
||||
@ -12,7 +12,6 @@
|
||||
mod builder;
|
||||
mod db_ext;
|
||||
mod error;
|
||||
mod event;
|
||||
mod metrics;
|
||||
mod pruner;
|
||||
pub mod segments;
|
||||
@ -20,7 +19,6 @@ pub mod segments;
|
||||
use crate::metrics::Metrics;
|
||||
pub use builder::PrunerBuilder;
|
||||
pub use error::PrunerError;
|
||||
pub use event::PrunerEvent;
|
||||
pub use pruner::{Pruner, PrunerResult, PrunerWithFactory, PrunerWithResult};
|
||||
|
||||
// Re-export prune types
|
||||
|
||||
22
crates/prune/types/src/event.rs
Normal file
22
crates/prune/types/src/event.rs
Normal file
@ -0,0 +1,22 @@
|
||||
use crate::PrunedSegmentInfo;
|
||||
use alloy_primitives::BlockNumber;
|
||||
use std::time::Duration;
|
||||
|
||||
/// An event emitted by a pruner.
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
pub enum PrunerEvent {
|
||||
/// Emitted when pruner started running.
|
||||
Started {
|
||||
/// The tip block number before pruning.
|
||||
tip_block_number: BlockNumber,
|
||||
},
|
||||
/// Emitted when pruner finished running.
|
||||
Finished {
|
||||
/// The tip block number before pruning.
|
||||
tip_block_number: BlockNumber,
|
||||
/// The elapsed time for the pruning process.
|
||||
elapsed: Duration,
|
||||
/// Collected pruning stats.
|
||||
stats: Vec<PrunedSegmentInfo>,
|
||||
},
|
||||
}
|
||||
@ -9,6 +9,7 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
mod checkpoint;
|
||||
mod event;
|
||||
mod limiter;
|
||||
mod mode;
|
||||
mod pruner;
|
||||
@ -16,6 +17,7 @@ mod segment;
|
||||
mod target;
|
||||
|
||||
pub use checkpoint::PruneCheckpoint;
|
||||
pub use event::PrunerEvent;
|
||||
pub use limiter::PruneLimiter;
|
||||
pub use mode::PruneMode;
|
||||
pub use pruner::{
|
||||
|
||||
Reference in New Issue
Block a user