Skip to content

Commit

Permalink
Merge pull request #237 from semiotic-ai/gusinacio/speed-up-compile
Browse files Browse the repository at this point in the history
  • Loading branch information
gusinacio authored Aug 12, 2024
2 parents eb8447e + 3774f92 commit 04b134a
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 38 deletions.
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/semiotic-ai/timeline-aggregation-protocol"

[workspace.dependencies]
alloy = { version = "0.2.1", features = ["full"] }
serde = { version = "1.0.163", features = ["derive"] }
rstest = "0.22.0"
anyhow = { version = "1.0.70", default-features = false }
tokio = { version = "1.27.0", features = ["macros", "signal"] }
rand = "0.8.5"
jsonrpsee = { version = "0.18.0", features = ["macros", "server"] }
35 changes: 21 additions & 14 deletions tap_aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,31 @@ name = "tap_aggregator"
path = "src/main.rs"

[dependencies]
anyhow = "1.0.70"
tokio = { version = "1.27.0", features = ["macros", "signal"] }
tap_core = { version = "1.0.0", path = "../tap_core" }
jsonrpsee = { version = "0.18.0", features = ["server", "macros"] }
clap = { version = "4.2.4", features = ["derive", "env"] }
serde = { version = "1.0.163", features = ["derive"] }
serde_json = { version = "1.0.96", features = ["raw_value"] }
strum = { version = "0.24.1", features = ["strum_macros", "derive"] }
tracing-subscriber = { version = "0.3.17" }
tap_core = { path = "../tap_core", version = "*" }
serde.workspace = true
alloy.workspace = true
anyhow.workspace = true
tokio.workspace = true
jsonrpsee = { workspace = true, features = ["server", "macros"] }
clap = { version = "4.5.15", features = ["derive", "env"] }
serde_json = { version = "1.0.124", features = ["raw_value"] }
strum = { version = "0.26.3", features = ["derive"] }
tracing-subscriber = "0.3.17"
log = "0.4.19"
prometheus = "0.13.3"
axum = "0.6.18"
axum = { version = "0.7.5", features = [
"http1",
"json",
"matched-path",
"original-uri",
"query",
"tokio",
], default-features = false }
futures-util = "0.3.28"
lazy_static = "1.4.0"
alloy = { version = "0.2.0", features = ["full"] }
ruint = "1.10.1"

[dev-dependencies]
jsonrpsee = { version = "0.18.0", features = ["http-client", "jsonrpsee-core"] }
rand = "0.8.5"
rstest = "0.17.0"
jsonrpsee = { workspace = true, features = ["http-client", "jsonrpsee-core"] }
rand.workspace = true
rstest.workspace = true
2 changes: 1 addition & 1 deletion tap_aggregator/src/api_versioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use strum::{self, IntoEnumIterator};
PartialEq,
strum::Display,
strum::EnumString,
strum::EnumVariantNames,
strum::VariantNames,
strum::EnumIter,
)]
pub enum TapRpcApiVersion {
Expand Down
9 changes: 7 additions & 2 deletions tap_aggregator/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

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

use axum::{http::StatusCode, response::IntoResponse, routing::get, Router, Server};
use axum::{http::StatusCode, response::IntoResponse, routing::get, serve, Router};
use futures_util::FutureExt;
use jsonrpsee::tracing::error;
use log::{debug, info};
use prometheus::TextEncoder;
use tokio::net::TcpListener;

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

let server = serve(listener, app.into_make_service());

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

Expand Down
16 changes: 6 additions & 10 deletions tap_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ readme = "README.md"
description = "Core Timeline Aggregation Protocol library: a fast, efficient and trustless unidirectional micro-payments system."

[dependencies]
rand_core = "0.6.4"
serde = { version = "1.0", features = ["derive", "rc"] }
rand = "0.8.5"
alloy.workspace = true
serde.workspace = true
tokio.workspace = true
anyhow.workspace = true
rand.workspace = true
thiserror = "1.0.38"
rstest = "0.17.0"
anyhow = "1"
alloy = { version = "0.2.0", features = ["full"] }

strum = "0.24.1"
strum_macros = "0.24.3"
async-trait = "0.1.72"
tokio = { version = "1.29.1", features = ["macros", "rt-multi-thread"] }

[dev-dependencies]
criterion = { version = "0.5", features = ["async_std"] }
rstest.workspace = true


[features]
Expand Down
23 changes: 12 additions & 11 deletions tap_integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ description = "Integration tests for the Timeline Aggregation Protocol."
publish = false

[dependencies]
tap_aggregator = { version = "0.3.1", path = "../tap_aggregator" }
tap_core = { version = "1.0.0", path = "../tap_core", features = ["in_memory"] }
jsonrpsee = { version = "0.18.0", features = ["http-client", "server"] }
clap = { version = "4.2.4", features = ["derive", "env"] }
rstest = "0.17.0"
rand = "0.8.5"
futures = "0.3.28"
anyhow = "1.0.71"
tokio = "1.28.2"
prometheus = "0.13.3"
alloy = { version = "0.2.0", features = ["full", "signer-mnemonic"] }
tap_aggregator = { path = "../tap_aggregator" }
tap_core = { path = "../tap_core", version = "*" }
rand.workspace = true
anyhow.workspace = true
tokio.workspace = true
alloy.workspace = true
jsonrpsee.workspace = true


[dev-dependencies]
rstest = "0.22.0"
alloy = { workspace = true, features = ["signer-mnemonic"] }

[[test]]
name = "integration_tests"
Expand Down

0 comments on commit 04b134a

Please sign in to comment.