mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: move primitives/exex to reth-exex-types (#8677)
This commit is contained in:
@ -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
|
||||
|
||||
@ -45,3 +45,7 @@ pub use manager::*;
|
||||
|
||||
mod notification;
|
||||
pub use notification::*;
|
||||
|
||||
// Re-export exex types
|
||||
#[doc(inline)]
|
||||
pub use reth_exex_types::*;
|
||||
|
||||
@ -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,
|
||||
|
||||
15
crates/exex/types/Cargo.toml
Normal file
15
crates/exex/types/Cargo.toml
Normal 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
|
||||
35
crates/exex/types/src/lib.rs
Normal file
35
crates/exex/types/src/lib.rs
Normal file
@ -0,0 +1,35 @@
|
||||
//! 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)]
|
||||
pub enum FinishedExExHeight {
|
||||
/// No `ExEx`'s are installed, so there is no finished height.
|
||||
NoExExs,
|
||||
/// Not all `ExExs` have emitted a `FinishedHeight` event yet.
|
||||
NotReady,
|
||||
/// The finished height of all `ExEx`'s.
|
||||
///
|
||||
/// This is the lowest common denominator between all `ExEx`'s.
|
||||
///
|
||||
/// This block is used to (amongst other things) determine what blocks are safe to prune.
|
||||
///
|
||||
/// The number is inclusive, i.e. all blocks `<= finished_height` are safe to prune.
|
||||
Height(BlockNumber),
|
||||
}
|
||||
|
||||
impl FinishedExExHeight {
|
||||
/// Returns `true` if not all `ExExs` have emitted a `FinishedHeight` event yet.
|
||||
pub const fn is_not_ready(&self) -> bool {
|
||||
matches!(self, Self::NotReady)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user