mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(exex): move notification to types crate (#9586)
This commit is contained in:
@ -37,7 +37,6 @@ tokio-util.workspace = true
|
||||
## misc
|
||||
eyre.workspace = true
|
||||
metrics.workspace = true
|
||||
serde = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
reth-chainspec.workspace = true
|
||||
@ -53,4 +52,4 @@ secp256k1.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
serde = ["dep:serde", "reth-provider/serde"]
|
||||
serde = ["reth-provider/serde", "reth-exex-types/serde"]
|
||||
|
||||
@ -46,9 +46,6 @@ pub use event::*;
|
||||
mod manager;
|
||||
pub use manager::*;
|
||||
|
||||
mod notification;
|
||||
pub use notification::*;
|
||||
|
||||
// Re-export exex types
|
||||
#[doc(inline)]
|
||||
pub use reth_exex_types::*;
|
||||
|
||||
@ -12,4 +12,15 @@ description = "Commonly used types for exex usage in reth."
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
# reth
|
||||
reth-provider.workspace = true
|
||||
|
||||
# reth
|
||||
alloy-primitives.workspace = true
|
||||
|
||||
# misc
|
||||
serde = { workspace = true, optional = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
serde = ["dep:serde", "reth-provider/serde"]
|
||||
|
||||
25
crates/exex/types/src/finished_height.rs
Normal file
25
crates/exex/types/src/finished_height.rs
Normal file
@ -0,0 +1,25 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
@ -8,28 +8,8 @@
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use alloy_primitives::BlockNumber;
|
||||
mod finished_height;
|
||||
mod notification;
|
||||
|
||||
/// 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)
|
||||
}
|
||||
}
|
||||
pub use finished_height::FinishedExExHeight;
|
||||
pub use notification::ExExNotification;
|
||||
|
||||
Reference in New Issue
Block a user