Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit 45aeaea

Browse files
committed
chore: We split existing services into binaries and crates
We split our services into binaries and crates to make it easy for sharing code.
1 parent 6144bb8 commit 45aeaea

14 files changed

Lines changed: 81 additions & 28 deletions

File tree

‎Cargo.lock‎

Lines changed: 21 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
[workspace]
22
resolver = "2"
3-
members = ["crates/mempool-rebroadcaster", "crates/sidecrush"]
3+
members = [
4+
"bin/*",
5+
"crates/*",
6+
]
47

58
[workspace.dependencies]
9+
cadence = "1.4"
610
clap = { version = "4.0", features = ["derive", "env"] }
11+
mempool-rebroadcaster = { path = "./crates/mempool-rebroadcaster" }
12+
sidecrush = { path = "./crates/sidecrush" }
13+
metrics = "0.24.1"
14+
metrics-derive = "0.1"
715
tracing = "0.1"
816
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt", "ansi", "json"] }
917
tokio = { version = "1.0", features = ["full"] }
1018
serde = { version = "1.0", features = ["derive"] }
1119
serde_json = "1.0"
12-
metrics = "0.24.1"
13-
metrics-derive = "0.1"
14-
cadence = "1.4"
1520

1621
# alloy
1722
alloy-primitives = { version = "1.5.2", default-features = false, features = [
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "mempool-rebroadcaster-bin"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[[bin]]
7+
name = "mempool-rebroadcaster"
8+
path = "src/main.rs"
9+
10+
[dependencies]
11+
clap = { workspace = true }
12+
dotenvy = "0.15.7"
13+
mempool-rebroadcaster = { workspace = true }
14+
tracing = { workspace = true }
15+
tracing-subscriber = { workspace = true }
16+
tokio = { workspace = true }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clap::Parser;
22
use dotenvy::dotenv;
3-
use mempool_rebroadcaster::rebroadcaster::Rebroadcaster;
3+
use mempool_rebroadcaster::Rebroadcaster;
44
use tracing::{Level, error, info};
55
use tracing_subscriber::EnvFilter;
66

‎bin/sidecrush/Cargo.toml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "sidecrush-bin"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[[bin]]
7+
name = "sidecrush"
8+
path = "src/main.rs"
9+
10+
[dependencies]
11+
clap = { workspace = true }
12+
sidecrush = { workspace = true }
13+
tracing = { workspace = true }
14+
tracing-subscriber = { workspace = true }
15+
tokio = { workspace = true }
16+
cadence = { workspace = true }
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ use std::net::UdpSocket;
33
use cadence::{StatsdClient, UdpMetricSink};
44
use clap::Parser;
55
use sidecrush::{
6-
blockbuilding_healthcheck::{
7-
BlockProductionHealthChecker, HealthcheckConfig, Node, alloy_client::AlloyEthClient,
8-
},
9-
metrics::HealthcheckMetrics,
6+
BlockProductionHealthChecker, HealthcheckConfig, HealthcheckMetrics, Node,
7+
alloy_client::AlloyEthClient,
108
};
119
use tracing::Level;
1210

‎crates/mempool-rebroadcaster/Cargo.toml‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ name = "mempool-rebroadcaster"
33
version = "0.1.0"
44
edition = "2021"
55

6-
[[bin]]
7-
name = "mempool-rebroadcaster"
8-
path = "src/main.rs"
6+
[lib]
7+
path = "src/lib.rs"
98

109
[dependencies]
11-
clap = { workspace = true }
1210
tracing = { workspace = true }
13-
tracing-subscriber = { workspace = true }
1411
tokio = { workspace = true }
1512
serde = { workspace = true }
1613
serde_json = { workspace = true }
17-
dotenvy = "0.15.7"
1814

1915
# alloy
2016
alloy-primitives.workspace = true
@@ -24,4 +20,3 @@ alloy-rpc-types-eth.workspace = true
2420
alloy-consensus.workspace = true
2521
alloy-trie.workspace = true
2622
alloy-provider = { workspace = true, features = ["txpool-api"] }
27-
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
pub mod rebroadcaster;
1+
mod rebroadcaster;
2+
3+
pub use rebroadcaster::{Rebroadcaster, RebroadcasterResult, TxpoolDiff};

‎crates/mempool-rebroadcaster/tests/e2e_tests.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::path::Path;
22

33
use alloy_rpc_types::txpool::TxpoolContent;
4-
use mempool_rebroadcaster::rebroadcaster::Rebroadcaster;
4+
use mempool_rebroadcaster::Rebroadcaster;
55

66
fn load_static_mempool_content<P: AsRef<Path>>(
77
filepath: P,

‎crates/sidecrush/Cargo.toml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@ name = "sidecrush"
33
version = "0.1.0"
44
edition = "2021"
55

6-
[[bin]]
7-
name = "sidecrush"
8-
path = "src/bin/sidecrush.rs"
6+
[lib]
7+
path = "src/lib.rs"
98

109
[dependencies]
1110
tracing = { workspace = true }
12-
tracing-subscriber = { workspace = true }
1311
tokio = { workspace = true }
1412
cadence = { workspace = true }
1513
async-trait = "0.1"
1614
anyhow = "1.0"
17-
clap = { workspace = true }
1815

1916
# Ethereum client deps (will be used for header fetching)
2017
alloy-provider = { workspace = true }

0 commit comments

Comments
 (0)