Skip to content

Commit 04b134a

Browse files
authored
Merge pull request #237 from semiotic-ai/gusinacio/speed-up-compile
2 parents eb8447e + 3774f92 commit 04b134a

File tree

6 files changed

+56
-38
lines changed

6 files changed

+56
-38
lines changed

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ version = "0.1.0"
77
edition = "2021"
88
license = "Apache-2.0"
99
repository = "https://github.com/semiotic-ai/timeline-aggregation-protocol"
10+
11+
[workspace.dependencies]
12+
alloy = { version = "0.2.1", features = ["full"] }
13+
serde = { version = "1.0.163", features = ["derive"] }
14+
rstest = "0.22.0"
15+
anyhow = { version = "1.0.70", default-features = false }
16+
tokio = { version = "1.27.0", features = ["macros", "signal"] }
17+
rand = "0.8.5"
18+
jsonrpsee = { version = "0.18.0", features = ["macros", "server"] }

tap_aggregator/Cargo.toml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,31 @@ name = "tap_aggregator"
1212
path = "src/main.rs"
1313

1414
[dependencies]
15-
anyhow = "1.0.70"
16-
tokio = { version = "1.27.0", features = ["macros", "signal"] }
17-
tap_core = { version = "1.0.0", path = "../tap_core" }
18-
jsonrpsee = { version = "0.18.0", features = ["server", "macros"] }
19-
clap = { version = "4.2.4", features = ["derive", "env"] }
20-
serde = { version = "1.0.163", features = ["derive"] }
21-
serde_json = { version = "1.0.96", features = ["raw_value"] }
22-
strum = { version = "0.24.1", features = ["strum_macros", "derive"] }
23-
tracing-subscriber = { version = "0.3.17" }
15+
tap_core = { path = "../tap_core", version = "*" }
16+
serde.workspace = true
17+
alloy.workspace = true
18+
anyhow.workspace = true
19+
tokio.workspace = true
20+
jsonrpsee = { workspace = true, features = ["server", "macros"] }
21+
clap = { version = "4.5.15", features = ["derive", "env"] }
22+
serde_json = { version = "1.0.124", features = ["raw_value"] }
23+
strum = { version = "0.26.3", features = ["derive"] }
24+
tracing-subscriber = "0.3.17"
2425
log = "0.4.19"
2526
prometheus = "0.13.3"
26-
axum = "0.6.18"
27+
axum = { version = "0.7.5", features = [
28+
"http1",
29+
"json",
30+
"matched-path",
31+
"original-uri",
32+
"query",
33+
"tokio",
34+
], default-features = false }
2735
futures-util = "0.3.28"
2836
lazy_static = "1.4.0"
29-
alloy = { version = "0.2.0", features = ["full"] }
3037
ruint = "1.10.1"
3138

3239
[dev-dependencies]
33-
jsonrpsee = { version = "0.18.0", features = ["http-client", "jsonrpsee-core"] }
34-
rand = "0.8.5"
35-
rstest = "0.17.0"
40+
jsonrpsee = { workspace = true, features = ["http-client", "jsonrpsee-core"] }
41+
rand.workspace = true
42+
rstest.workspace = true

tap_aggregator/src/api_versioning.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use strum::{self, IntoEnumIterator};
1818
PartialEq,
1919
strum::Display,
2020
strum::EnumString,
21-
strum::EnumVariantNames,
21+
strum::VariantNames,
2222
strum::EnumIter,
2323
)]
2424
pub enum TapRpcApiVersion {

tap_aggregator/src/metrics.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
use std::{net::SocketAddr, panic};
55

6-
use axum::{http::StatusCode, response::IntoResponse, routing::get, Router, Server};
6+
use axum::{http::StatusCode, response::IntoResponse, routing::get, serve, Router};
77
use futures_util::FutureExt;
88
use jsonrpsee::tracing::error;
99
use log::{debug, info};
1010
use prometheus::TextEncoder;
11+
use tokio::net::TcpListener;
1112

1213
async fn handler_metrics() -> (StatusCode, String) {
1314
let metric_families = prometheus::gather();
@@ -34,7 +35,11 @@ async fn _run_server(port: u16) {
3435
.route("/metrics", get(handler_metrics))
3536
.fallback(handler_404);
3637
let addr = SocketAddr::from(([0, 0, 0, 0], port));
37-
let server = Server::bind(&addr).serve(app.into_make_service());
38+
let listener = TcpListener::bind(addr)
39+
.await
40+
.expect("Failed to bind to indexer-service port");
41+
42+
let server = serve(listener, app.into_make_service());
3843

3944
info!("Metrics server listening on {}", addr);
4045

tap_core/Cargo.toml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,17 @@ readme = "README.md"
88
description = "Core Timeline Aggregation Protocol library: a fast, efficient and trustless unidirectional micro-payments system."
99

1010
[dependencies]
11-
rand_core = "0.6.4"
12-
serde = { version = "1.0", features = ["derive", "rc"] }
13-
rand = "0.8.5"
11+
alloy.workspace = true
12+
serde.workspace = true
13+
tokio.workspace = true
14+
anyhow.workspace = true
15+
rand.workspace = true
1416
thiserror = "1.0.38"
15-
rstest = "0.17.0"
16-
anyhow = "1"
17-
alloy = { version = "0.2.0", features = ["full"] }
18-
19-
strum = "0.24.1"
20-
strum_macros = "0.24.3"
2117
async-trait = "0.1.72"
22-
tokio = { version = "1.29.1", features = ["macros", "rt-multi-thread"] }
2318

2419
[dev-dependencies]
2520
criterion = { version = "0.5", features = ["async_std"] }
21+
rstest.workspace = true
2622

2723

2824
[features]

tap_integration_tests/Cargo.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ description = "Integration tests for the Timeline Aggregation Protocol."
99
publish = false
1010

1111
[dependencies]
12-
tap_aggregator = { version = "0.3.1", path = "../tap_aggregator" }
13-
tap_core = { version = "1.0.0", path = "../tap_core", features = ["in_memory"] }
14-
jsonrpsee = { version = "0.18.0", features = ["http-client", "server"] }
15-
clap = { version = "4.2.4", features = ["derive", "env"] }
16-
rstest = "0.17.0"
17-
rand = "0.8.5"
18-
futures = "0.3.28"
19-
anyhow = "1.0.71"
20-
tokio = "1.28.2"
21-
prometheus = "0.13.3"
22-
alloy = { version = "0.2.0", features = ["full", "signer-mnemonic"] }
12+
tap_aggregator = { path = "../tap_aggregator" }
13+
tap_core = { path = "../tap_core", version = "*" }
14+
rand.workspace = true
15+
anyhow.workspace = true
16+
tokio.workspace = true
17+
alloy.workspace = true
18+
jsonrpsee.workspace = true
19+
20+
21+
[dev-dependencies]
22+
rstest = "0.22.0"
23+
alloy = { workspace = true, features = ["signer-mnemonic"] }
2324

2425
[[test]]
2526
name = "integration_tests"

0 commit comments

Comments
 (0)