Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 38 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[workspace]
resolver = "2"
members = [
"tap_core",
"tap_aggregator",
"tap_integration_tests",
"tap_graph",
"tap_core",
"tap_eip712_message",
"tap_graph",
"tap_integration_tests",
"tap_receipt",
]

Expand All @@ -16,13 +16,39 @@ license = "Apache-2.0"
repository = "https://github.com/semiotic-ai/timeline-aggregation-protocol"

[workspace.dependencies]
serde = { version = "1.0.217", features = ["derive"] }
rstest = "0.24.0"
anyhow = { version = "1.0.95" }
tokio = { version = "1.43.0", features = ["macros", "signal"] }
rand = "0.8.5"
jsonrpsee = { version = "0.24.7", features = ["macros", "server"] }
insta = { version = "1.42.0", features = ["json"] }
serde_json = { version = "1.0.137", features = ["raw_value"] }
anyhow = { version = "1.0.98" }
anymap3 = "1.0.1"
async-trait = "0.1.88"
axum = { version = "0.7.5", features = [
"http1",
"json",
"matched-path",
"original-uri",
"query",
"tokio",
], default-features = false }
clap = { version = "4.5.36", features = ["derive", "env"] }
criterion = { version = "0.5.1", features = ["async_std"] }
futures-util = "0.3.31"
hyper = { version = "1.6.0", features = ["full"] }
insta = { version = "1.42.2", features = ["json"] }
jsonrpsee = { version = "0.24.9", features = ["macros", "server"] }
jsonrpsee-core = "0.24.9"
lazy_static = "1.5.0"
log = "0.4.27"
prometheus = "0.14.0"
prost = "0.13.5"
rand = "0.9.1"
rayon = "1.10.0"
rdkafka = { version = "0.37.0", features = ["tokio", "sasl"] }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = { version = "1.0.140", features = ["raw_value"] }
strum = { version = "0.27.1", features = ["derive"] }
rstest = "0.25.0"
tap_graph = { version = "0.2.1", path = "../tap_graph", features = ["v2"] }
thegraph-core = "0.12.0"
thiserror = "2.0.11"
thiserror = "2.0.12"
tokio = { version = "1.44.2", features = ["macros", "signal"] }
tonic = { version = "0.12.3", features = ["transport", "zstd"] }
tower = { version = "0.5.2", features = ["util", "steer"] }
tracing-subscriber = "0.3.19"
40 changes: 16 additions & 24 deletions tap_aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,31 @@ path = "src/main.rs"

[dependencies]
anyhow.workspace = true
axum = { version = "0.7.5", features = [
"http1",
"json",
"matched-path",
"original-uri",
"query",
"tokio",
], default-features = false }
clap = { version = "4.5.15", features = ["derive", "env"] }
futures-util = "0.3.28"
hyper = { version = "1", features = ["full"] }
jsonrpsee = { workspace = true, features = ["server", "macros"] }
lazy_static = "1.4.0"
log = "0.4.19"
prometheus = "0.13.3"
prost = "0.13.3"
rayon = "1.10.0"
axum.workspace = true
clap.workspace = true
futures-util.workspace = true
hyper.workspace = true
jsonrpsee.workspace = true
lazy_static.workspace = true
log.workspace = true
prometheus.workspace = true
prost.workspace = true
rayon.workspace = true
rdkafka.workspace = true
serde.workspace = true
serde_json.workspace = true
strum = { version = "0.26.3", features = ["derive"] }
strum.workspace = true
tap_core = { path = "../tap_core", version = "4.0.0" }
tap_graph = { version = "0.2.1", path = "../tap_graph", features = ["v2"] }
thegraph-core = { workspace = true, features = ["alloy-eip712"] }
tokio.workspace = true
tonic = { version = "0.12.3", features = ["transport", "zstd"] }
tower = { version = "0.5.2", features = ["util", "steer"] }
tracing-subscriber = "0.3.17"
tap_graph = { version = "0.2.1", path = "../tap_graph", features = ["v2"] }
rdkafka = { version = "0.37.0", features = ["tokio", "sasl"] }
tonic.workspace = true
tower.workspace = true
tracing-subscriber.workspace = true

[build-dependencies]
tonic-build = "0.12.3"

[dev-dependencies]
jsonrpsee = { workspace = true, features = ["http-client", "jsonrpsee-core"] }
rand.workspace = true
rstest.workspace = true
5 changes: 4 additions & 1 deletion tap_aggregator/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ mod tests {
use std::{collections::HashSet, str::FromStr};

use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_params};
use rand::{prelude::*, seq::SliceRandom};
use rstest::*;
use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain};
use tap_graph::{Receipt, ReceiptAggregateVoucher};
Expand Down Expand Up @@ -600,6 +599,8 @@ mod tests {
#[values(0, 1, 2)] random_seed: u64,
) {
// The keys that will be used to sign the new RAVs

use rand::{rngs::StdRng, seq::IndexedRandom, SeedableRng};
let keys_main = keys();
// Extra keys to test the server's ability to accept multiple signers as input
let keys_0 = keys();
Expand Down Expand Up @@ -681,6 +682,8 @@ mod tests {
#[values(0, 1, 2, 3, 4)] random_seed: u64,
) {
// The keys that will be used to sign the new RAVs

use rand::{rngs::StdRng, seq::IndexedRandom, SeedableRng};
let keys_main = keys();
// Extra keys to test the server's ability to accept multiple signers as input
let keys_0 = keys();
Expand Down
4 changes: 2 additions & 2 deletions tap_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Core Timeline Aggregation Protocol library: a fast, efficient and

[dependencies]
anyhow.workspace = true
async-trait = "0.1.85"
async-trait.workspace = true
rand.workspace = true
tap_eip712_message = { version = "0.1.0", path = "../tap_eip712_message" }
tap_graph = { version = "0.2.1", path = "../tap_graph", optional = true }
Expand All @@ -19,7 +19,7 @@ thiserror.workspace = true
tokio.workspace = true

[dev-dependencies]
criterion = { version = "0.5.1", features = ["async_std"] }
criterion.workspace = true
insta.workspace = true
rstest.workspace = true
serde_json.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions tap_core/tests/receipt_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
sync::{Arc, RwLock},
};

use rand::{seq::SliceRandom, thread_rng};
use rand::{rng, seq::SliceRandom};
use rstest::*;
use tap_core::{
manager::{adapters::ReceiptStore, context::memory::InMemoryContext},
Expand Down Expand Up @@ -184,7 +184,7 @@ fn safe_truncate_receipts_test(
let mut receipts_truncated = receipts_orig;

// shuffle the input receipts
receipts_truncated.shuffle(&mut thread_rng());
receipts_truncated.shuffle(&mut rng());

tap_core::manager::adapters::safe_truncate_receipts(&mut receipts_truncated, limit);

Expand Down
4 changes: 2 additions & 2 deletions tap_graph/src/v1/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use std::time::{SystemTime, SystemTimeError, UNIX_EPOCH};

use rand::{thread_rng, Rng};
use rand::{rng, Rng};
use serde::{Deserialize, Serialize};
use tap_eip712_message::Eip712SignedMessage;
use tap_receipt::WithValueAndTimestamp;
Expand Down Expand Up @@ -42,7 +42,7 @@ impl Receipt {
/// Returns a receipt with provided values
pub fn new(allocation_id: Address, value: u128) -> Result<Self, SystemTimeError> {
let timestamp_ns = get_current_timestamp_u64_ns()?;
let nonce = thread_rng().gen::<u64>();
let nonce = rng().random::<u64>();
Ok(Self {
allocation_id,
timestamp_ns,
Expand Down
4 changes: 2 additions & 2 deletions tap_graph/src/v2/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use std::time::{SystemTime, SystemTimeError, UNIX_EPOCH};

use rand::{thread_rng, Rng};
use rand::{rng, Rng};
use serde::{Deserialize, Serialize};
use tap_eip712_message::Eip712SignedMessage;
use tap_receipt::WithValueAndTimestamp;
Expand Down Expand Up @@ -50,7 +50,7 @@ impl Receipt {
value: u128,
) -> Result<Self, SystemTimeError> {
let timestamp_ns = get_current_timestamp_u64_ns()?;
let nonce = thread_rng().gen::<u64>();
let nonce = rng().random::<u64>();
Ok(Self {
allocation_id,
payer,
Expand Down
9 changes: 5 additions & 4 deletions tap_integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ publish = false
[dependencies]
tap_aggregator = { path = "../tap_aggregator" }
tap_core = { path = "../tap_core", version = "4.0.0" }
rand.workspace = true
tap_graph = { path = "../tap_graph" }

anyhow.workspace = true
jsonrpsee = { workspace = true, features = ["jsonrpsee-http-client"] }
jsonrpsee-core.workspace = true
rand.workspace = true
thegraph-core.workspace = true
tokio.workspace = true
jsonrpsee = { workspace = true, features = ["jsonrpsee-http-client"] }
jsonrpsee-core = "0.24.7"
tap_graph = { path = "../tap_graph" }

[dev-dependencies]
rstest.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion tap_integration_tests/tests/showcase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ fn query_price() -> &'static [u128] {
let mut v = Vec::new();

for _ in 0..num_queries() {
v.push(rng.gen::<u128>() % 100);
v.push(rng.random::<u128>() % 100);
}
Box::leak(v.into_boxed_slice())
}
Expand Down
4 changes: 2 additions & 2 deletions tap_receipt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ description = "TAP Receipt states and checks"

[dependencies]
anyhow.workspace = true
anymap3 = "1.0.1"
async-trait = "0.1.85"
anymap3.workspace = true
async-trait.workspace = true
serde.workspace = true
tap_eip712_message = { version = "0.1.0", path = "../tap_eip712_message" }
thegraph-core.workspace = true
Expand Down