From 4587f60c69eecefccd717fa7bd38ddc0f140e788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 30 Apr 2026 16:17:13 -0300 Subject: [PATCH 1/5] refactor!: rename to grap tally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- Cargo.toml | 22 ++++++------ .../aggregator}/CHANGELOG.md | 0 .../aggregator}/Cargo.toml | 12 +++---- .../aggregator}/README.md | 0 .../aggregator}/build.rs | 0 .../aggregator}/proto/uint128.proto | 0 .../aggregator}/proto/v2.proto | 0 .../aggregator}/src/aggregator.rs | 32 ++++++++--------- .../aggregator}/src/api_versioning.rs | 0 .../aggregator}/src/error_codes.rs | 0 .../aggregator}/src/grpc.rs | 34 +++++++++---------- .../aggregator}/src/jsonrpsee_helpers.rs | 0 .../aggregator}/src/lib.rs | 0 .../aggregator}/src/main.rs | 4 +-- .../aggregator}/src/metrics.rs | 0 .../aggregator}/src/server.rs | 12 +++---- .../aggregator}/tests/aggregate_test.rs | 12 +++---- {tap_core => crates/core}/CHANGELOG.md | 0 {tap_core => crates/core}/Cargo.toml | 14 ++++---- crates/core/README.md | 1 + {tap_core => crates/core}/src/error.rs | 6 ++-- {tap_core => crates/core}/src/lib.rs | 2 +- .../core}/src/manager/adapters/mod.rs | 0 .../core}/src/manager/adapters/rav.rs | 0 .../core}/src/manager/adapters/receipt.rs | 0 .../core}/src/manager/adapters/signature.rs | 0 .../core}/src/manager/context/memory.rs | 4 +-- .../core}/src/manager/context/mod.rs | 0 {tap_core => crates/core}/src/manager/mod.rs | 6 ++-- .../core}/src/manager/tap_manager.rs | 2 +- {tap_core => crates/core}/src/rav_request.rs | 4 +-- {tap_core => crates/core}/src/receipt.rs | 2 +- .../core}/src/signed_message.rs | 6 ++-- .../core}/tests/manager_test.rs | 10 +++--- {tap_core => crates/core}/tests/rav_test.rs | 6 ++-- .../core}/tests/receipt_test.rs | 8 ++--- .../core}/tests/received_receipt_test.rs | 6 ++-- ...v_test__check_for_rav_serialization-2.snap | 2 +- ...rav_test__check_for_rav_serialization.snap | 2 +- .../eip712_message}/CHANGELOG.md | 0 .../eip712_message}/Cargo.toml | 6 ++-- .../eip712_message}/src/lib.rs | 4 +-- {tap_graph => crates/graph}/CHANGELOG.md | 0 {tap_graph => crates/graph}/Cargo.toml | 11 +++--- {tap_graph => crates/graph}/src/lib.rs | 0 {tap_graph => crates/graph}/src/rav.rs | 6 ++-- {tap_graph => crates/graph}/src/receipt.rs | 4 +-- .../integration_tests}/Cargo.toml | 12 +++---- .../integration_tests}/clippy.toml | 0 .../integration_tests}/tests/indexer_mock.rs | 22 ++++++------ .../integration_tests}/tests/lib.rs | 0 .../integration_tests}/tests/showcase.rs | 28 +++++++-------- {tap_receipt => crates/receipt}/CHANGELOG.md | 0 {tap_receipt => crates/receipt}/Cargo.toml | 8 ++--- {tap_receipt => crates/receipt}/src/checks.rs | 6 ++-- {tap_receipt => crates/receipt}/src/error.rs | 0 {tap_receipt => crates/receipt}/src/lib.rs | 2 +- {tap_receipt => crates/receipt}/src/rav.rs | 2 +- .../receipt}/src/received_receipt.rs | 0 {tap_receipt => crates/receipt}/src/state.rs | 0 tap_core/README.md | 1 - 61 files changed, 160 insertions(+), 161 deletions(-) rename {tap_aggregator => crates/aggregator}/CHANGELOG.md (100%) rename {tap_aggregator => crates/aggregator}/Cargo.toml (78%) rename {tap_aggregator => crates/aggregator}/README.md (100%) rename {tap_aggregator => crates/aggregator}/build.rs (100%) rename {tap_aggregator => crates/aggregator}/proto/uint128.proto (100%) rename {tap_aggregator => crates/aggregator}/proto/v2.proto (100%) rename {tap_aggregator => crates/aggregator}/src/aggregator.rs (91%) rename {tap_aggregator => crates/aggregator}/src/api_versioning.rs (100%) rename {tap_aggregator => crates/aggregator}/src/error_codes.rs (100%) rename {tap_aggregator => crates/aggregator}/src/grpc.rs (77%) rename {tap_aggregator => crates/aggregator}/src/jsonrpsee_helpers.rs (100%) rename {tap_aggregator => crates/aggregator}/src/lib.rs (100%) rename {tap_aggregator => crates/aggregator}/src/main.rs (98%) rename {tap_aggregator => crates/aggregator}/src/metrics.rs (100%) rename {tap_aggregator => crates/aggregator}/src/server.rs (98%) rename {tap_aggregator => crates/aggregator}/tests/aggregate_test.rs (89%) rename {tap_core => crates/core}/CHANGELOG.md (100%) rename {tap_core => crates/core}/Cargo.toml (57%) create mode 120000 crates/core/README.md rename {tap_core => crates/core}/src/error.rs (95%) rename {tap_core => crates/core}/src/lib.rs (99%) rename {tap_core => crates/core}/src/manager/adapters/mod.rs (100%) rename {tap_core => crates/core}/src/manager/adapters/rav.rs (100%) rename {tap_core => crates/core}/src/manager/adapters/receipt.rs (100%) rename {tap_core => crates/core}/src/manager/adapters/signature.rs (100%) rename {tap_core => crates/core}/src/manager/context/memory.rs (98%) rename {tap_core => crates/core}/src/manager/context/mod.rs (100%) rename {tap_core => crates/core}/src/manager/mod.rs (95%) rename {tap_core => crates/core}/src/manager/tap_manager.rs (99%) rename {tap_core => crates/core}/src/rav_request.rs (84%) rename {tap_core => crates/core}/src/receipt.rs (96%) rename {tap_core => crates/core}/src/signed_message.rs (87%) rename {tap_core => crates/core}/tests/manager_test.rs (98%) rename {tap_core => crates/core}/tests/rav_test.rs (98%) rename {tap_core => crates/core}/tests/receipt_test.rs (97%) rename {tap_core => crates/core}/tests/received_receipt_test.rs (98%) rename {tap_core => crates/core}/tests/snapshots/rav_test__check_for_rav_serialization-2.snap (94%) rename {tap_core => crates/core}/tests/snapshots/rav_test__check_for_rav_serialization.snap (99%) rename {tap_eip712_message => crates/eip712_message}/CHANGELOG.md (100%) rename {tap_eip712_message => crates/eip712_message}/Cargo.toml (67%) rename {tap_eip712_message => crates/eip712_message}/src/lib.rs (96%) rename {tap_graph => crates/graph}/CHANGELOG.md (100%) rename {tap_graph => crates/graph}/Cargo.toml (59%) rename {tap_graph => crates/graph}/src/lib.rs (100%) rename {tap_graph => crates/graph}/src/rav.rs (98%) rename {tap_graph => crates/graph}/src/receipt.rs (97%) rename {tap_integration_tests => crates/integration_tests}/Cargo.toml (70%) rename {tap_integration_tests => crates/integration_tests}/clippy.toml (100%) rename {tap_integration_tests => crates/integration_tests}/tests/indexer_mock.rs (96%) rename {tap_integration_tests => crates/integration_tests}/tests/lib.rs (100%) rename {tap_integration_tests => crates/integration_tests}/tests/showcase.rs (97%) rename {tap_receipt => crates/receipt}/CHANGELOG.md (100%) rename {tap_receipt => crates/receipt}/Cargo.toml (69%) rename {tap_receipt => crates/receipt}/src/checks.rs (98%) rename {tap_receipt => crates/receipt}/src/error.rs (100%) rename {tap_receipt => crates/receipt}/src/lib.rs (95%) rename {tap_receipt => crates/receipt}/src/rav.rs (94%) rename {tap_receipt => crates/receipt}/src/received_receipt.rs (100%) rename {tap_receipt => crates/receipt}/src/state.rs (100%) delete mode 120000 tap_core/README.md diff --git a/Cargo.toml b/Cargo.toml index 2d616a3..fd74be5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [workspace] resolver = "2" members = [ - "tap_aggregator", - "tap_core", - "tap_eip712_message", - "tap_graph", - "tap_integration_tests", - "tap_receipt", + "crates/aggregator", + "crates/core", + "crates/eip712_message", + "crates/graph", + "crates/integration_tests", + "crates/receipt", ] [workspace.package] @@ -46,11 +46,11 @@ 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_aggregator = { version = "0.6.0", path = "tap_aggregator" } -tap_eip712_message = { version = "0.2.2", path = "tap_eip712_message" } -tap_core = { version = "6.0.0", path = "tap_core" } -tap_graph = { version = "0.3.4", path = "tap_graph" } -tap_receipt = { version = "1.1.3", path = "tap_receipt" } +graph_tally_aggregator = { version = "1.0.0", path = "crates/aggregator" } +graph_tally_eip712_message = { version = "1.0.0", path = "crates/eip712_message" } +graph_tally_core = { version = "7.0.0", path = "crates/core" } +graph_tally_graph = { version = "1.0.0", path = "crates/graph" } +graph_tally_receipt = { version = "2.0.0", path = "crates/receipt" } thegraph-core = "0.15.1" thiserror = "2.0.12" tokio = { version = "1.44.2", features = ["macros", "signal"] } diff --git a/tap_aggregator/CHANGELOG.md b/crates/aggregator/CHANGELOG.md similarity index 100% rename from tap_aggregator/CHANGELOG.md rename to crates/aggregator/CHANGELOG.md diff --git a/tap_aggregator/Cargo.toml b/crates/aggregator/Cargo.toml similarity index 78% rename from tap_aggregator/Cargo.toml rename to crates/aggregator/Cargo.toml index 7d5285b..40263fa 100644 --- a/tap_aggregator/Cargo.toml +++ b/crates/aggregator/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "tap_aggregator" -version = "0.6.4" +name = "graph_tally_aggregator" +version = "1.0.0" edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true readme = "README.md" -description = "A JSON-RPC service for the Timeline Aggregation Protocol that lets clients request an aggregate receipt from a list of individual receipts." +description = "A JSON-RPC service for Graph Tally that lets clients request an aggregate receipt from a list of individual receipts." [[bin]] -name = "tap_aggregator" +name = "graph_tally_aggregator" path = "src/main.rs" [dependencies] @@ -28,8 +28,8 @@ rdkafka.workspace = true serde.workspace = true serde_json.workspace = true strum.workspace = true -tap_core.workspace = true -tap_graph.workspace = true +graph_tally_core.workspace = true +graph_tally_graph.workspace = true thegraph-core = { workspace = true, features = ["alloy-eip712"] } tokio.workspace = true tonic.workspace = true diff --git a/tap_aggregator/README.md b/crates/aggregator/README.md similarity index 100% rename from tap_aggregator/README.md rename to crates/aggregator/README.md diff --git a/tap_aggregator/build.rs b/crates/aggregator/build.rs similarity index 100% rename from tap_aggregator/build.rs rename to crates/aggregator/build.rs diff --git a/tap_aggregator/proto/uint128.proto b/crates/aggregator/proto/uint128.proto similarity index 100% rename from tap_aggregator/proto/uint128.proto rename to crates/aggregator/proto/uint128.proto diff --git a/tap_aggregator/proto/v2.proto b/crates/aggregator/proto/v2.proto similarity index 100% rename from tap_aggregator/proto/v2.proto rename to crates/aggregator/proto/v2.proto diff --git a/tap_aggregator/src/aggregator.rs b/crates/aggregator/src/aggregator.rs similarity index 91% rename from tap_aggregator/src/aggregator.rs rename to crates/aggregator/src/aggregator.rs index 24617d8..da0ab4e 100644 --- a/tap_aggregator/src/aggregator.rs +++ b/crates/aggregator/src/aggregator.rs @@ -1,9 +1,9 @@ use std::collections::HashSet; use anyhow::{bail, Ok, Result}; +use graph_tally_core::{receipt::WithUniqueId, signed_message::Eip712SignedMessage}; +use graph_tally_graph::{Receipt, ReceiptAggregateVoucher}; use rayon::prelude::*; -use tap_core::{receipt::WithUniqueId, signed_message::Eip712SignedMessage}; -use tap_graph::{Receipt, ReceiptAggregateVoucher}; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, @@ -45,7 +45,7 @@ pub fn check_and_aggregate_receipts( receipt.message.data_service, receipt.message.service_provider, ), - None => return Err(tap_core::Error::NoValidReceiptsForRavRequest.into()), + None => return Err(graph_tally_core::Error::NoValidReceiptsForRavRequest.into()), }; // Check that the receipts all have the same collection id @@ -64,14 +64,14 @@ pub fn check_and_aggregate_receipts( let prev_data_service = previous_rav.message.dataService; let prev_service_provider = previous_rav.message.serviceProvider; if prev_id != collection_id { - return Err(tap_core::Error::RavCollectionIdMismatch { + return Err(graph_tally_core::Error::RavCollectionIdMismatch { prev_id: format!("{prev_id:#X}"), new_id: format!("{collection_id:#X}"), } .into()); } if prev_payer != payer { - return Err(tap_core::Error::RavCollectionIdMismatch { + return Err(graph_tally_core::Error::RavCollectionIdMismatch { prev_id: format!("{prev_id:#X}"), new_id: format!("{collection_id:#X}"), } @@ -79,14 +79,14 @@ pub fn check_and_aggregate_receipts( } if prev_data_service != data_service { - return Err(tap_core::Error::RavCollectionIdMismatch { + return Err(graph_tally_core::Error::RavCollectionIdMismatch { prev_id: format!("{prev_id:#X}"), new_id: format!("{collection_id:#X}"), } .into()); } if prev_service_provider != service_provider { - return Err(tap_core::Error::RavCollectionIdMismatch { + return Err(graph_tally_core::Error::RavCollectionIdMismatch { prev_id: format!("{prev_id:#X}"), new_id: format!("{collection_id:#X}"), } @@ -115,7 +115,7 @@ fn check_signature_is_from_one_of_addresses( ) -> Result<()> { let recovered_address = message.recover_signer(domain_separator)?; if !accepted_addresses.contains(&recovered_address) { - bail!(tap_core::Error::InvalidRecoveredSigner { + bail!(graph_tally_core::Error::InvalidRecoveredSigner { address: recovered_address, }); } @@ -132,16 +132,16 @@ fn check_collection_id( for receipt in receipts.iter() { let receipt = &receipt.message; if receipt.collection_id != collection_id { - return Err(tap_core::Error::RavCollectionIdNotUniform.into()); + return Err(graph_tally_core::Error::RavCollectionIdNotUniform.into()); } if receipt.payer != payer { - return Err(tap_core::Error::RavCollectionIdNotUniform.into()); + return Err(graph_tally_core::Error::RavCollectionIdNotUniform.into()); } if receipt.data_service != data_service { - return Err(tap_core::Error::RavCollectionIdNotUniform.into()); + return Err(graph_tally_core::Error::RavCollectionIdNotUniform.into()); } if receipt.service_provider != service_provider { - return Err(tap_core::Error::RavCollectionIdNotUniform.into()); + return Err(graph_tally_core::Error::RavCollectionIdNotUniform.into()); } } Ok(()) @@ -152,7 +152,7 @@ fn check_signatures_unique(receipts: &[Eip712SignedMessage]) -> Result< for receipt in receipts.iter() { let signature = receipt.unique_id(); if !receipt_signatures.insert(signature) { - return Err(tap_core::Error::DuplicateReceiptSignature(format!( + return Err(graph_tally_core::Error::DuplicateReceiptSignature(format!( "{:?}", receipt.unique_id() )) @@ -170,7 +170,7 @@ fn check_receipt_timestamps( for receipt in receipts.iter() { let receipt = &receipt.message; if previous_rav.message.timestampNs >= receipt.timestamp_ns { - return Err(tap_core::Error::ReceiptTimestampLowerThanRav { + return Err(graph_tally_core::Error::ReceiptTimestampLowerThanRav { rav_ts: previous_rav.message.timestampNs, receipt_ts: receipt.timestamp_ns, } @@ -184,9 +184,9 @@ fn check_receipt_timestamps( #[cfg(test)] mod tests { + use graph_tally_core::{signed_message::Eip712SignedMessage, tap_eip712_domain}; + use graph_tally_graph::{Receipt, ReceiptAggregateVoucher}; use rstest::*; - use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain}; - use tap_graph::{Receipt, ReceiptAggregateVoucher}; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::{address, fixed_bytes, Address, Bytes, FixedBytes}, diff --git a/tap_aggregator/src/api_versioning.rs b/crates/aggregator/src/api_versioning.rs similarity index 100% rename from tap_aggregator/src/api_versioning.rs rename to crates/aggregator/src/api_versioning.rs diff --git a/tap_aggregator/src/error_codes.rs b/crates/aggregator/src/error_codes.rs similarity index 100% rename from tap_aggregator/src/error_codes.rs rename to crates/aggregator/src/error_codes.rs diff --git a/tap_aggregator/src/grpc.rs b/crates/aggregator/src/grpc.rs similarity index 77% rename from tap_aggregator/src/grpc.rs rename to crates/aggregator/src/grpc.rs index f4760be..abc0637 100644 --- a/tap_aggregator/src/grpc.rs +++ b/crates/aggregator/src/grpc.rs @@ -18,12 +18,12 @@ pub mod uint128 { pub mod v2 { use anyhow::anyhow; - use tap_core::signed_message::Eip712SignedMessage; + use graph_tally_core::signed_message::Eip712SignedMessage; use thegraph_core::alloy::primitives::Bytes; tonic::include_proto!("tap_aggregator.v2"); - impl TryFrom for tap_graph::Receipt { + impl TryFrom for graph_tally_graph::Receipt { type Error = anyhow::Error; fn try_from(receipt: self::Receipt) -> Result { Ok(Self { @@ -38,7 +38,7 @@ pub mod v2 { } } - impl TryFrom for tap_graph::SignedReceipt { + impl TryFrom for graph_tally_graph::SignedReceipt { type Error = anyhow::Error; fn try_from(receipt: self::SignedReceipt) -> Result { Ok(Self { @@ -51,8 +51,8 @@ pub mod v2 { } } - impl From for self::Receipt { - fn from(value: tap_graph::Receipt) -> Self { + impl From for self::Receipt { + fn from(value: graph_tally_graph::Receipt) -> Self { Self { collection_id: value.collection_id.as_slice().to_vec(), timestamp_ns: value.timestamp_ns, @@ -65,8 +65,8 @@ pub mod v2 { } } - impl From for self::SignedReceipt { - fn from(value: tap_graph::SignedReceipt) -> Self { + impl From for self::SignedReceipt { + fn from(value: graph_tally_graph::SignedReceipt) -> Self { Self { message: Some(value.message.into()), signature: value.signature.as_bytes().to_vec(), @@ -74,7 +74,7 @@ pub mod v2 { } } - impl TryFrom for Eip712SignedMessage { + impl TryFrom for Eip712SignedMessage { type Error = anyhow::Error; fn try_from(voucher: self::SignedRav) -> Result { Ok(Self { @@ -87,8 +87,8 @@ pub mod v2 { } } - impl From> for self::SignedRav { - fn from(voucher: Eip712SignedMessage) -> Self { + impl From> for self::SignedRav { + fn from(voucher: Eip712SignedMessage) -> Self { Self { signature: voucher.signature.as_bytes().to_vec(), message: Some(voucher.message.into()), @@ -96,7 +96,7 @@ pub mod v2 { } } - impl TryFrom for tap_graph::ReceiptAggregateVoucher { + impl TryFrom for graph_tally_graph::ReceiptAggregateVoucher { type Error = anyhow::Error; fn try_from(voucher: self::ReceiptAggregateVoucher) -> Result { Ok(Self { @@ -114,8 +114,8 @@ pub mod v2 { } } - impl From for self::ReceiptAggregateVoucher { - fn from(voucher: tap_graph::ReceiptAggregateVoucher) -> Self { + impl From for self::ReceiptAggregateVoucher { + fn from(voucher: graph_tally_graph::ReceiptAggregateVoucher) -> Self { Self { collection_id: voucher.collectionId.to_vec(), timestamp_ns: voucher.timestampNs, @@ -130,8 +130,8 @@ pub mod v2 { impl self::RavRequest { pub fn new( - receipts: Vec, - previous_rav: Option, + receipts: Vec, + previous_rav: Option, ) -> Self { Self { receipts: receipts.into_iter().map(Into::into).collect(), @@ -141,8 +141,8 @@ pub mod v2 { } impl self::RavResponse { - pub fn signed_rav(mut self) -> anyhow::Result { - let signed_rav: tap_graph::SignedRav = self + pub fn signed_rav(mut self) -> anyhow::Result { + let signed_rav: graph_tally_graph::SignedRav = self .rav .take() .ok_or(anyhow!("Couldn't find rav"))? diff --git a/tap_aggregator/src/jsonrpsee_helpers.rs b/crates/aggregator/src/jsonrpsee_helpers.rs similarity index 100% rename from tap_aggregator/src/jsonrpsee_helpers.rs rename to crates/aggregator/src/jsonrpsee_helpers.rs diff --git a/tap_aggregator/src/lib.rs b/crates/aggregator/src/lib.rs similarity index 100% rename from tap_aggregator/src/lib.rs rename to crates/aggregator/src/lib.rs diff --git a/tap_aggregator/src/main.rs b/crates/aggregator/src/main.rs similarity index 98% rename from tap_aggregator/src/main.rs rename to crates/aggregator/src/main.rs index 61f2641..c791e9a 100644 --- a/tap_aggregator/src/main.rs +++ b/crates/aggregator/src/main.rs @@ -4,9 +4,9 @@ use std::{collections::HashSet, str::FromStr, time::Duration}; use anyhow::Result; use clap::Parser; +use graph_tally_aggregator::{metrics, server}; +use graph_tally_core::tap_eip712_domain; use log::{debug, info}; -use tap_aggregator::{metrics, server}; -use tap_core::tap_eip712_domain; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner, }; diff --git a/tap_aggregator/src/metrics.rs b/crates/aggregator/src/metrics.rs similarity index 100% rename from tap_aggregator/src/metrics.rs rename to crates/aggregator/src/metrics.rs diff --git a/tap_aggregator/src/server.rs b/crates/aggregator/src/server.rs similarity index 98% rename from tap_aggregator/src/server.rs rename to crates/aggregator/src/server.rs index f6392c2..ecfa94f 100644 --- a/tap_aggregator/src/server.rs +++ b/crates/aggregator/src/server.rs @@ -2,6 +2,8 @@ use std::{collections::HashSet, fmt::Debug, str::FromStr, time::Duration}; use anyhow::Result; use axum::{error_handling::HandleError, routing::post_service, BoxError, Router}; +use graph_tally_core::signed_message::Eip712SignedMessage; +use graph_tally_graph::{Receipt, ReceiptAggregateVoucher}; use hyper::StatusCode; use jsonrpsee::{ proc_macros::rpc, @@ -10,8 +12,6 @@ use jsonrpsee::{ use lazy_static::lazy_static; use log::{error, info}; use prometheus::{register_counter, register_int_counter, Counter, IntCounter}; -use tap_core::signed_message::Eip712SignedMessage; -use tap_graph::{Receipt, ReceiptAggregateVoucher}; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner, }; @@ -80,7 +80,7 @@ lazy_static! { /// /// Note that because of the way the `rpc` macro works, we cannot document the RpcServer trait here. /// (So even this very docstring will not appear in the generated documentation...) -/// As a result, we document the JSON-RPC API in the `tap_aggregator/README.md` file. +/// As a result, we document the JSON-RPC API in the `graph_tally_aggregator/README.md` file. /// Do not forget to update the documentation there if you make any changes to the JSON-RPC API. #[rpc(server)] pub trait Rpc { @@ -203,7 +203,7 @@ impl v2::tap_aggregator_server::TapAggregator for RpcImpl { request: Request, ) -> Result, Status> { let rav_request = request.into_inner(); - let receipts: Vec = rav_request + let receipts: Vec = rav_request .receipts .into_iter() .map(TryFrom::try_from) @@ -479,10 +479,10 @@ fn produce_kafka_records( mod tests { use std::{collections::HashSet, str::FromStr, time::Duration}; + use graph_tally_core::{signed_message::Eip712SignedMessage, tap_eip712_domain}; + use graph_tally_graph::{Receipt, ReceiptAggregateVoucher}; use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_params}; use rstest::*; - use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain}; - use tap_graph::{Receipt, ReceiptAggregateVoucher}; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, diff --git a/tap_aggregator/tests/aggregate_test.rs b/crates/aggregator/tests/aggregate_test.rs similarity index 89% rename from tap_aggregator/tests/aggregate_test.rs rename to crates/aggregator/tests/aggregate_test.rs index d4134c3..533f9ab 100644 --- a/tap_aggregator/tests/aggregate_test.rs +++ b/crates/aggregator/tests/aggregate_test.rs @@ -1,13 +1,13 @@ use std::{collections::HashSet, str::FromStr, time::Duration}; -use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_params}; -use tap_aggregator::{ +use graph_tally_aggregator::{ grpc::v2::{tap_aggregator_client::TapAggregatorClient, RavRequest}, jsonrpsee_helpers::JsonRpcResponse, server, }; -use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain}; -use tap_graph::{Receipt, ReceiptAggregateVoucher}; +use graph_tally_core::{signed_message::Eip712SignedMessage, tap_eip712_domain}; +use graph_tally_graph::{Receipt, ReceiptAggregateVoucher}; +use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_params}; use thegraph_core::alloy::{ primitives::{Address, FixedBytes}, signers::local::PrivateKeySigner, @@ -67,11 +67,11 @@ async fn aggregation_test() { let rav_request = RavRequest::new(receipts.clone(), None); let res = client.aggregate_receipts(rav_request).await.unwrap(); - let signed_rav: tap_graph::SignedRav = res.into_inner().signed_rav().unwrap(); + let signed_rav: graph_tally_graph::SignedRav = res.into_inner().signed_rav().unwrap(); let sender_aggregator = HttpClientBuilder::default().build(&endpoint).unwrap(); - let previous_rav: Option = None; + let previous_rav: Option = None; let response: JsonRpcResponse> = sender_aggregator .request( diff --git a/tap_core/CHANGELOG.md b/crates/core/CHANGELOG.md similarity index 100% rename from tap_core/CHANGELOG.md rename to crates/core/CHANGELOG.md diff --git a/tap_core/Cargo.toml b/crates/core/Cargo.toml similarity index 57% rename from tap_core/Cargo.toml rename to crates/core/Cargo.toml index b33eff4..ecf867d 100644 --- a/tap_core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -1,20 +1,20 @@ [package] -name = "tap_core" -version = "6.0.3" +name = "graph_tally_core" +version = "7.0.0" edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true readme = "README.md" -description = "Core Timeline Aggregation Protocol library: a fast, efficient and trustless unidirectional micro-payments system." +description = "Core Graph Tally library: a fast, efficient and trustless unidirectional micro-payments system." [dependencies] anyhow.workspace = true async-trait.workspace = true rand.workspace = true -tap_eip712_message.workspace = true -tap_graph = { workspace = true, optional = true } -tap_receipt.workspace = true +graph_tally_eip712_message.workspace = true +graph_tally_graph = { workspace = true, optional = true } +graph_tally_receipt.workspace = true thegraph-core.workspace = true thiserror.workspace = true tokio.workspace = true @@ -26,4 +26,4 @@ serde_json.workspace = true [features] default = ["in_memory"] -in_memory = ["dep:tap_graph"] +in_memory = ["dep:graph_tally_graph"] diff --git a/crates/core/README.md b/crates/core/README.md new file mode 120000 index 0000000..fe84005 --- /dev/null +++ b/crates/core/README.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file diff --git a/tap_core/src/error.rs b/crates/core/src/error.rs similarity index 95% rename from tap_core/src/error.rs rename to crates/core/src/error.rs index 2dd57c2..3bfe8c2 100644 --- a/tap_core/src/error.rs +++ b/crates/core/src/error.rs @@ -23,7 +23,7 @@ pub enum Error { /// `alloy` wallet error #[error(transparent)] - SignatureError(#[from] tap_eip712_message::Eip712Error), + SignatureError(#[from] graph_tally_eip712_message::Eip712Error), /// Error when signature verification fails #[error("Expected address {expected} but received {received}")] @@ -51,12 +51,12 @@ pub enum Error { /// Error when all receipts do not have the same collection id /// - /// Used in tap_aggregator + /// Used in graph_tally_aggregator #[error("All receipts should have the same collection id, but they don't")] RavCollectionIdNotUniform, /// Error when the receipt signature is duplicated. /// - /// Used in tap_aggregator + /// Used in graph_tally_aggregator #[error("Duplicate receipt signature: {0}")] DuplicateReceiptSignature(String), #[error( diff --git a/tap_core/src/lib.rs b/crates/core/src/lib.rs similarity index 99% rename from tap_core/src/lib.rs rename to crates/core/src/lib.rs index 278bba2..a90723c 100644 --- a/tap_core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -54,8 +54,8 @@ pub fn tap_eip712_domain(chain_id: u64, verifying_contract_address: Address) -> mod tap_tests { use std::str::FromStr; + use graph_tally_graph::{Receipt, ReceiptAggregateVoucher}; use rstest::*; - use tap_graph::{Receipt, ReceiptAggregateVoucher}; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, diff --git a/tap_core/src/manager/adapters/mod.rs b/crates/core/src/manager/adapters/mod.rs similarity index 100% rename from tap_core/src/manager/adapters/mod.rs rename to crates/core/src/manager/adapters/mod.rs diff --git a/tap_core/src/manager/adapters/rav.rs b/crates/core/src/manager/adapters/rav.rs similarity index 100% rename from tap_core/src/manager/adapters/rav.rs rename to crates/core/src/manager/adapters/rav.rs diff --git a/tap_core/src/manager/adapters/receipt.rs b/crates/core/src/manager/adapters/receipt.rs similarity index 100% rename from tap_core/src/manager/adapters/receipt.rs rename to crates/core/src/manager/adapters/receipt.rs diff --git a/tap_core/src/manager/adapters/signature.rs b/crates/core/src/manager/adapters/signature.rs similarity index 100% rename from tap_core/src/manager/adapters/signature.rs rename to crates/core/src/manager/adapters/signature.rs diff --git a/tap_core/src/manager/context/memory.rs b/crates/core/src/manager/context/memory.rs similarity index 98% rename from tap_core/src/manager/context/memory.rs rename to crates/core/src/manager/context/memory.rs index 68e319c..18a9f95 100644 --- a/tap_core/src/manager/context/memory.rs +++ b/crates/core/src/manager/context/memory.rs @@ -10,7 +10,7 @@ use std::{ }; use async_trait::async_trait; -use tap_graph::{ReceiptAggregateVoucher, SignedRav, SignedReceipt}; +use graph_tally_graph::{ReceiptAggregateVoucher, SignedRav, SignedReceipt}; use thegraph_core::alloy::primitives::Address; use crate::{ @@ -251,7 +251,7 @@ pub mod checks { sync::{Arc, RwLock}, }; - use tap_graph::SignedReceipt; + use graph_tally_graph::SignedReceipt; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, diff --git a/tap_core/src/manager/context/mod.rs b/crates/core/src/manager/context/mod.rs similarity index 100% rename from tap_core/src/manager/context/mod.rs rename to crates/core/src/manager/context/mod.rs diff --git a/tap_core/src/manager/mod.rs b/crates/core/src/manager/mod.rs similarity index 95% rename from tap_core/src/manager/mod.rs rename to crates/core/src/manager/mod.rs index 288f00c..eec9ff7 100644 --- a/tap_core/src/manager/mod.rs +++ b/crates/core/src/manager/mod.rs @@ -31,7 +31,7 @@ //! //! ```rust //! use async_trait::async_trait; -//! use tap_core::{ +//! use graph_tally_core::{ //! receipt::{ //! ReceiptWithState, //! state::Checking, @@ -59,8 +59,8 @@ //! # #[tokio::main(flavor = "current_thread")] //! # async fn main() { //! # use thegraph_core::alloy::{dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, signers::local::PrivateKeySigner}; -//! # use tap_graph::{Receipt, SignedReceipt}; -//! # use tap_core::signed_message::Eip712SignedMessage; +//! # use graph_tally_graph::{Receipt, SignedReceipt}; +//! # use graph_tally_core::signed_message::Eip712SignedMessage; //! # let domain_separator = Eip712Domain::default(); //! # let wallet = PrivateKeySigner::random(); //! # let collection_id = FixedBytes::from([0xab; 32]); diff --git a/tap_core/src/manager/tap_manager.rs b/crates/core/src/manager/tap_manager.rs similarity index 99% rename from tap_core/src/manager/tap_manager.rs rename to crates/core/src/manager/tap_manager.rs index fd0429d..9507090 100644 --- a/tap_core/src/manager/tap_manager.rs +++ b/crates/core/src/manager/tap_manager.rs @@ -1,4 +1,4 @@ -use tap_receipt::rav::Aggregate; +use graph_tally_receipt::rav::Aggregate; use thegraph_core::alloy::{dyn_abi::Eip712Domain, sol_types::SolStruct}; use super::adapters::{ diff --git a/tap_core/src/rav_request.rs b/crates/core/src/rav_request.rs similarity index 84% rename from tap_core/src/rav_request.rs rename to crates/core/src/rav_request.rs index d652391..c444878 100644 --- a/tap_core/src/rav_request.rs +++ b/crates/core/src/rav_request.rs @@ -1,6 +1,6 @@ //! Request to Tap Aggregator -use tap_receipt::rav::AggregationError; +use graph_tally_receipt::rav::AggregationError; use thegraph_core::alloy::sol_types::SolStruct; use crate::{ @@ -11,7 +11,7 @@ use crate::{ signed_message::Eip712SignedMessage, }; -/// Request to `tap_aggregator` to aggregate receipts into a Signed RAV. +/// Request to `graph_tally_aggregator` to aggregate receipts into a Signed RAV. #[derive(Debug)] pub struct RavRequest { /// List of checked and reserved receipts to aggregate diff --git a/tap_core/src/receipt.rs b/crates/core/src/receipt.rs similarity index 96% rename from tap_core/src/receipt.rs rename to crates/core/src/receipt.rs index 6febaf5..586e23e 100644 --- a/tap_core/src/receipt.rs +++ b/crates/core/src/receipt.rs @@ -17,4 +17,4 @@ //! //! -pub use ::tap_receipt::*; +pub use ::graph_tally_receipt::*; diff --git a/tap_core/src/signed_message.rs b/crates/core/src/signed_message.rs similarity index 87% rename from tap_core/src/signed_message.rs rename to crates/core/src/signed_message.rs index f2292a6..e2a978b 100644 --- a/tap_core/src/signed_message.rs +++ b/crates/core/src/signed_message.rs @@ -6,9 +6,9 @@ //! # Example //! ```rust //! # use thegraph_core::alloy::{dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, signers::local::PrivateKeySigner}; -//! # use tap_graph::{Receipt}; +//! # use graph_tally_graph::{Receipt}; //! # let domain_separator = Eip712Domain::default(); -//! use tap_core::signed_message::Eip712SignedMessage; +//! use graph_tally_core::signed_message::Eip712SignedMessage; //! # let wallet = PrivateKeySigner::random(); //! # let wallet_address = wallet.address(); //! # let collection_id = FixedBytes::from([0xab; 32]); @@ -24,4 +24,4 @@ //! ``` //! -pub use ::tap_eip712_message::*; +pub use ::graph_tally_eip712_message::*; diff --git a/tap_core/tests/manager_test.rs b/crates/core/tests/manager_test.rs similarity index 98% rename from tap_core/tests/manager_test.rs rename to crates/core/tests/manager_test.rs index f9e0e6a..cd15e16 100644 --- a/tap_core/tests/manager_test.rs +++ b/crates/core/tests/manager_test.rs @@ -17,7 +17,7 @@ fn get_current_timestamp_u64_ns() -> anyhow::Result { Ok(SystemTime::now().duration_since(UNIX_EPOCH)?.as_nanos() as u64) } -use tap_core::{ +use graph_tally_core::{ manager::{ adapters::ReceiptRead, context::memory::{ @@ -33,7 +33,7 @@ use tap_core::{ signed_message::Eip712SignedMessage, tap_eip712_domain, }; -use tap_graph::{Receipt, ReceiptAggregateVoucher, SignedReceipt}; +use graph_tally_graph::{Receipt, ReceiptAggregateVoucher, SignedReceipt}; #[fixture] fn signer() -> PrivateKeySigner { @@ -708,9 +708,9 @@ async fn test_retryable_checks( assert_eq!( rav_request.expect_err("Didn't fail").to_string(), - tap_core::Error::ReceiptError(tap_core::receipt::ReceiptError::RetryableCheck( - "Retryable error".to_string() - )) + graph_tally_core::Error::ReceiptError( + graph_tally_core::receipt::ReceiptError::RetryableCheck("Retryable error".to_string()) + ) .to_string() ); } diff --git a/tap_core/tests/rav_test.rs b/crates/core/tests/rav_test.rs similarity index 98% rename from tap_core/tests/rav_test.rs rename to crates/core/tests/rav_test.rs index 2c6f6b5..0189706 100644 --- a/tap_core/tests/rav_test.rs +++ b/crates/core/tests/rav_test.rs @@ -4,8 +4,7 @@ use std::{ sync::{Arc, RwLock}, }; -use rstest::*; -use tap_core::{ +use graph_tally_core::{ manager::{ adapters::{RavRead, RavStore}, context::memory::InMemoryContext, @@ -14,7 +13,8 @@ use tap_core::{ signed_message::Eip712SignedMessage, tap_eip712_domain, }; -use tap_graph::{Receipt, ReceiptAggregateVoucher}; +use graph_tally_graph::{Receipt, ReceiptAggregateVoucher}; +use rstest::*; #[allow(deprecated)] use thegraph_core::alloy::primitives::{Address, FixedBytes, Signature, B256}; use thegraph_core::alloy::{dyn_abi::Eip712Domain, signers::local::PrivateKeySigner}; diff --git a/tap_core/tests/receipt_test.rs b/crates/core/tests/receipt_test.rs similarity index 97% rename from tap_core/tests/receipt_test.rs rename to crates/core/tests/receipt_test.rs index b330088..f9a71e0 100644 --- a/tap_core/tests/receipt_test.rs +++ b/crates/core/tests/receipt_test.rs @@ -4,14 +4,14 @@ use std::{ sync::{Arc, RwLock}, }; -use rstest::*; -use tap_core::{ +use graph_tally_core::{ manager::{adapters::ReceiptStore, context::memory::InMemoryContext}, receipt::{checks::StatefulTimestampCheck, state::Checking, ReceiptWithState}, signed_message::Eip712SignedMessage, tap_eip712_domain, }; -use tap_graph::{Receipt, SignedReceipt}; +use graph_tally_graph::{Receipt, SignedReceipt}; +use rstest::*; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, @@ -225,7 +225,7 @@ fn safe_truncate_receipts_test( // shuffle the input receipts receipts_truncated.shuffle(&mut rng()); - tap_core::manager::adapters::safe_truncate_receipts(&mut receipts_truncated, limit); + graph_tally_core::manager::adapters::safe_truncate_receipts(&mut receipts_truncated, limit); assert_eq!(receipts_truncated.len(), expected.len()); diff --git a/tap_core/tests/received_receipt_test.rs b/crates/core/tests/received_receipt_test.rs similarity index 98% rename from tap_core/tests/received_receipt_test.rs rename to crates/core/tests/received_receipt_test.rs index 2cc50e8..e2d0a9f 100644 --- a/tap_core/tests/received_receipt_test.rs +++ b/crates/core/tests/received_receipt_test.rs @@ -4,8 +4,7 @@ use std::{ sync::{Arc, RwLock}, }; -use rstest::*; -use tap_core::{ +use graph_tally_core::{ manager::context::memory::{checks::get_full_list_of_checks, EscrowStorage, QueryAppraisals}, receipt::{ checks::{ReceiptCheck, StatefulTimestampCheck}, @@ -14,7 +13,8 @@ use tap_core::{ signed_message::Eip712SignedMessage, tap_eip712_domain, }; -use tap_graph::{Receipt, SignedReceipt}; +use graph_tally_graph::{Receipt, SignedReceipt}; +use rstest::*; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, diff --git a/tap_core/tests/snapshots/rav_test__check_for_rav_serialization-2.snap b/crates/core/tests/snapshots/rav_test__check_for_rav_serialization-2.snap similarity index 94% rename from tap_core/tests/snapshots/rav_test__check_for_rav_serialization-2.snap rename to crates/core/tests/snapshots/rav_test__check_for_rav_serialization-2.snap index 4c1073b..f67d060 100644 --- a/tap_core/tests/snapshots/rav_test__check_for_rav_serialization-2.snap +++ b/crates/core/tests/snapshots/rav_test__check_for_rav_serialization-2.snap @@ -1,5 +1,5 @@ --- -source: tap_core/tests/rav_test.rs +source: crates/core/tests/rav_test.rs expression: signed_rav --- { diff --git a/tap_core/tests/snapshots/rav_test__check_for_rav_serialization.snap b/crates/core/tests/snapshots/rav_test__check_for_rav_serialization.snap similarity index 99% rename from tap_core/tests/snapshots/rav_test__check_for_rav_serialization.snap rename to crates/core/tests/snapshots/rav_test__check_for_rav_serialization.snap index b2b16f1..dea8310 100644 --- a/tap_core/tests/snapshots/rav_test__check_for_rav_serialization.snap +++ b/crates/core/tests/snapshots/rav_test__check_for_rav_serialization.snap @@ -1,5 +1,5 @@ --- -source: tap_core/tests/rav_test.rs +source: crates/core/tests/rav_test.rs expression: receipts --- [ diff --git a/tap_eip712_message/CHANGELOG.md b/crates/eip712_message/CHANGELOG.md similarity index 100% rename from tap_eip712_message/CHANGELOG.md rename to crates/eip712_message/CHANGELOG.md diff --git a/tap_eip712_message/Cargo.toml b/crates/eip712_message/Cargo.toml similarity index 67% rename from tap_eip712_message/Cargo.toml rename to crates/eip712_message/Cargo.toml index 6ee2cca..f7c4bcf 100644 --- a/tap_eip712_message/Cargo.toml +++ b/crates/eip712_message/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "tap_eip712_message" -version = "0.2.3" +name = "graph_tally_eip712_message" +version = "1.0.0" edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true -description = "EIP712 singed messages used by TAP" +description = "EIP712 signed messages used by Graph Tally" [dependencies] serde.workspace = true diff --git a/tap_eip712_message/src/lib.rs b/crates/eip712_message/src/lib.rs similarity index 96% rename from tap_eip712_message/src/lib.rs rename to crates/eip712_message/src/lib.rs index f874d03..63faac2 100644 --- a/tap_eip712_message/src/lib.rs +++ b/crates/eip712_message/src/lib.rs @@ -7,10 +7,10 @@ //! ```rust,ignore //! # use thegraph_core::alloy::{dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner}; //! # let domain_separator = Eip712Domain::default(); -//! use tap_eip712_message::Eip712SignedMessage; +//! use graph_tally_eip712_message::Eip712SignedMessage; //! # let wallet = PrivateKeySigner::random(); //! # let wallet_address = wallet.address(); -//! # let receipt = tap_graph::Receipt::new(Address::from([0x11u8; 20]), 100).unwrap(); +//! # let receipt = graph_tally_graph::Receipt::new(Address::from([0x11u8; 20]), 100).unwrap(); //! //! let signed_message = Eip712SignedMessage::new(&domain_separator, receipt, &wallet).unwrap(); //! let signer = signed_message.recover_signer(&domain_separator).unwrap(); diff --git a/tap_graph/CHANGELOG.md b/crates/graph/CHANGELOG.md similarity index 100% rename from tap_graph/CHANGELOG.md rename to crates/graph/CHANGELOG.md diff --git a/tap_graph/Cargo.toml b/crates/graph/Cargo.toml similarity index 59% rename from tap_graph/Cargo.toml rename to crates/graph/Cargo.toml index 8efa45e..224cab5 100644 --- a/tap_graph/Cargo.toml +++ b/crates/graph/Cargo.toml @@ -1,19 +1,18 @@ [package] -name = "tap_graph" -version = "0.3.5" +name = "graph_tally_graph" +version = "1.0.0" edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true -description = "The Graph TAP receipt structs" +description = "The Graph Tally receipt structs" [dependencies] rand.workspace = true serde.workspace = true -tap_eip712_message.workspace = true -tap_receipt.workspace = true +graph_tally_eip712_message.workspace = true +graph_tally_receipt.workspace = true thegraph-core.workspace = true - [dev-dependencies] rstest.workspace = true diff --git a/tap_graph/src/lib.rs b/crates/graph/src/lib.rs similarity index 100% rename from tap_graph/src/lib.rs rename to crates/graph/src/lib.rs diff --git a/tap_graph/src/rav.rs b/crates/graph/src/rav.rs similarity index 98% rename from tap_graph/src/rav.rs rename to crates/graph/src/rav.rs index 8878700..035dc39 100644 --- a/tap_graph/src/rav.rs +++ b/crates/graph/src/rav.rs @@ -2,13 +2,13 @@ use std::cmp; -use serde::{Deserialize, Serialize}; -use tap_eip712_message::Eip712SignedMessage; -use tap_receipt::{ +use graph_tally_eip712_message::Eip712SignedMessage; +use graph_tally_receipt::{ rav::{Aggregate, AggregationError}, state::Checked, ReceiptWithState, WithValueAndTimestamp, }; +use serde::{Deserialize, Serialize}; use thegraph_core::alloy::{ primitives::{Address, Bytes, FixedBytes}, sol, diff --git a/tap_graph/src/receipt.rs b/crates/graph/src/receipt.rs similarity index 97% rename from tap_graph/src/receipt.rs rename to crates/graph/src/receipt.rs index 5619648..7f66d0b 100644 --- a/tap_graph/src/receipt.rs +++ b/crates/graph/src/receipt.rs @@ -2,10 +2,10 @@ use std::time::{SystemTime, SystemTimeError, UNIX_EPOCH}; +use graph_tally_eip712_message::Eip712SignedMessage; +use graph_tally_receipt::WithValueAndTimestamp; use rand::{rng, Rng}; use serde::{Deserialize, Serialize}; -use tap_eip712_message::Eip712SignedMessage; -use tap_receipt::WithValueAndTimestamp; use thegraph_core::alloy::{ primitives::{Address, FixedBytes}, sol, diff --git a/tap_integration_tests/Cargo.toml b/crates/integration_tests/Cargo.toml similarity index 70% rename from tap_integration_tests/Cargo.toml rename to crates/integration_tests/Cargo.toml index d6aa2f0..91e41c0 100644 --- a/tap_integration_tests/Cargo.toml +++ b/crates/integration_tests/Cargo.toml @@ -1,18 +1,18 @@ [package] -name = "tap_integration_tests" -version = "0.1.27" +name = "graph_tally_integration_tests" +version = "1.0.0" edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true autotests = false -description = "Integration tests for the Timeline Aggregation Protocol." +description = "Integration tests for Graph Tally." publish = false [dependencies] -tap_aggregator.workspace = true -tap_core.workspace = true -tap_graph.workspace = true +graph_tally_aggregator.workspace = true +graph_tally_core.workspace = true +graph_tally_graph.workspace = true anyhow.workspace = true jsonrpsee = { workspace = true, features = ["jsonrpsee-http-client"] } diff --git a/tap_integration_tests/clippy.toml b/crates/integration_tests/clippy.toml similarity index 100% rename from tap_integration_tests/clippy.toml rename to crates/integration_tests/clippy.toml diff --git a/tap_integration_tests/tests/indexer_mock.rs b/crates/integration_tests/tests/indexer_mock.rs similarity index 96% rename from tap_integration_tests/tests/indexer_mock.rs rename to crates/integration_tests/tests/indexer_mock.rs index 6d17e47..9cf87c2 100644 --- a/tap_integration_tests/tests/indexer_mock.rs +++ b/crates/integration_tests/tests/indexer_mock.rs @@ -4,6 +4,15 @@ use std::sync::{ }; use anyhow::{Error, Result}; +use graph_tally_aggregator::jsonrpsee_helpers; +use graph_tally_core::{ + manager::{ + adapters::{RavRead, RavStore, ReceiptRead, ReceiptStore, SignatureChecker}, + Manager, + }, + receipt::{checks::CheckList, Context}, +}; +use graph_tally_graph::{ReceiptAggregateVoucher, SignedRav, SignedReceipt}; use jsonrpsee::{ core::async_trait, http_client::{HttpClient, HttpClientBuilder}, @@ -12,15 +21,6 @@ use jsonrpsee::{ server::{ServerBuilder, ServerConfig, ServerHandle}, }; use jsonrpsee_core::client::ClientT; -use tap_aggregator::jsonrpsee_helpers; -use tap_core::{ - manager::{ - adapters::{RavRead, RavStore, ReceiptRead, ReceiptStore, SignatureChecker}, - Manager, - }, - receipt::{checks::CheckList, Context}, -}; -use tap_graph::{ReceiptAggregateVoucher, SignedRav, SignedReceipt}; use thegraph_core::alloy::dyn_abi::Eip712Domain; /// Rpc trait represents a JSON-RPC server that has a single async method `request`. /// This method is designed to handle incoming JSON-RPC requests. @@ -184,8 +184,8 @@ where // request_rav function creates a request for aggregate receipts (RAV), sends it to another server and verifies the result. async fn request_rav( manager: &Arc>, - time_stamp_buffer: u64, // Buffer for timestamping, see tap_core for details - aggregator_client: &(HttpClient, String), // HttpClient for making requests to the tap_aggregator server + time_stamp_buffer: u64, // Buffer for timestamping, see graph_tally_core for details + aggregator_client: &(HttpClient, String), // HttpClient for making requests to the graph_tally_aggregator server threshold: usize, ) -> Result<()> where diff --git a/tap_integration_tests/tests/lib.rs b/crates/integration_tests/tests/lib.rs similarity index 100% rename from tap_integration_tests/tests/lib.rs rename to crates/integration_tests/tests/lib.rs diff --git a/tap_integration_tests/tests/showcase.rs b/crates/integration_tests/tests/showcase.rs similarity index 97% rename from tap_integration_tests/tests/showcase.rs rename to crates/integration_tests/tests/showcase.rs index a857abe..418a717 100644 --- a/tap_integration_tests/tests/showcase.rs +++ b/crates/integration_tests/tests/showcase.rs @@ -1,5 +1,5 @@ // These tests simulate a Sender sending query requests and receipts to one or two Indexers. -// The tests use a mock Indexer server running a tap_manager instance and a tap_aggregator to handle RAV requests. +// The tests use a mock Indexer server running a tap_manager instance and a graph_tally_aggregator to handle RAV requests. // An Indexer checks and stores receipts. After receiving a specific number of receipts, the Indexer sends a RAV request to the aggregator. use std::{ collections::{HashMap, HashSet}, @@ -11,19 +11,19 @@ use std::{ }; use anyhow::{Error, Result}; -use jsonrpsee::{ - core::client::ClientT, http_client::HttpClientBuilder, rpc_params, server::ServerHandle, -}; -use rand::{rngs::StdRng, Rng, SeedableRng}; -use rstest::*; -use tap_aggregator::{jsonrpsee_helpers, server as agg_server}; -use tap_core::{ +use graph_tally_aggregator::{jsonrpsee_helpers, server as agg_server}; +use graph_tally_core::{ manager::context::memory::{checks::get_full_list_of_checks, *}, receipt::checks::{CheckList, StatefulTimestampCheck}, signed_message::{Eip712SignedMessage, MessageId}, tap_eip712_domain, }; -use tap_graph::{Receipt, SignedRav, SignedReceipt}; +use graph_tally_graph::{Receipt, SignedRav, SignedReceipt}; +use jsonrpsee::{ + core::client::ClientT, http_client::HttpClientBuilder, rpc_params, server::ServerHandle, +}; +use rand::{rngs::StdRng, Rng, SeedableRng}; +use rstest::*; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::{Address, FixedBytes}, @@ -681,7 +681,7 @@ async fn test_tap_manager_rav_timestamp_cuttoff( repeated_timestamp_incremented_by_one_request: Vec>, receipt_threshold_1: u64, ) -> Result<(), Box> { - // This test checks that tap_core is correctly filtering receipts by timestamp. + // This test checks that graph_tally_core is correctly filtering receipts by timestamp. let ( server_handle_1, socket_addr_1, @@ -731,7 +731,7 @@ async fn test_tap_manager_rav_timestamp_cuttoff( #[rstest] #[tokio::test] -async fn test_tap_aggregator_rav_timestamp_cuttoff( +async fn test_graph_tally_aggregator_rav_timestamp_cuttoff( keys_sender: PrivateKeySigner, domain_separator: Eip712Domain, http_request_size_limit: u32, @@ -741,7 +741,7 @@ async fn test_tap_aggregator_rav_timestamp_cuttoff( repeated_timestamp_incremented_by_one_request: Vec>, receipt_threshold_1: u64, ) -> Result<(), Box> { - // This test checks that tap_aggregator is correctly rejecting receipts with invalid timestamps + // This test checks that graph_tally_aggregator is correctly rejecting receipts with invalid timestamps let (sender_handle, sender_addr) = start_sender_aggregator( keys_sender, domain_separator, @@ -755,7 +755,7 @@ async fn test_tap_aggregator_rav_timestamp_cuttoff( // This is the first part of the test, two batches of receipts are sent to the aggregator. // The second batch has one receipt with the same timestamp as the latest receipt in the first batch. // The first RAV will have the same timestamp as one receipt in the second batch. - // tap_aggregator should reject the second RAV request due to the repeated timestamp. + // graph_tally_aggregator should reject the second RAV request due to the repeated timestamp. let requests = repeated_timestamp_request; let first_batch = &requests[0..receipt_threshold_1 as usize]; let second_batch = &requests[receipt_threshold_1 as usize..2 * receipt_threshold_1 as usize]; @@ -780,7 +780,7 @@ async fn test_tap_aggregator_rav_timestamp_cuttoff( // This is the second part of the test, two batches of receipts are sent to the aggregator. // The second batch has one receipt with the timestamp = timestamp+1 of the latest receipt in the first batch. - // tap_aggregator should accept the second RAV request. + // graph_tally_aggregator should accept the second RAV request. let requests = repeated_timestamp_incremented_by_one_request; let first_batch = &requests[0..receipt_threshold_1 as usize]; let second_batch = &requests[receipt_threshold_1 as usize..2 * receipt_threshold_1 as usize]; diff --git a/tap_receipt/CHANGELOG.md b/crates/receipt/CHANGELOG.md similarity index 100% rename from tap_receipt/CHANGELOG.md rename to crates/receipt/CHANGELOG.md diff --git a/tap_receipt/Cargo.toml b/crates/receipt/Cargo.toml similarity index 69% rename from tap_receipt/Cargo.toml rename to crates/receipt/Cargo.toml index b6c0b8b..6a90caf 100644 --- a/tap_receipt/Cargo.toml +++ b/crates/receipt/Cargo.toml @@ -1,18 +1,18 @@ [package] -name = "tap_receipt" -version = "1.1.4" +name = "graph_tally_receipt" +version = "2.0.0" edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true -description = "TAP Receipt states and checks" +description = "Graph Tally Receipt states and checks" [dependencies] anyhow.workspace = true anymap3.workspace = true async-trait.workspace = true serde.workspace = true -tap_eip712_message.workspace = true +graph_tally_eip712_message.workspace = true thegraph-core.workspace = true thiserror.workspace = true diff --git a/tap_receipt/src/checks.rs b/crates/receipt/src/checks.rs similarity index 98% rename from tap_receipt/src/checks.rs rename to crates/receipt/src/checks.rs index 5662888..8a49abf 100644 --- a/tap_receipt/src/checks.rs +++ b/crates/receipt/src/checks.rs @@ -7,7 +7,7 @@ //! //! ```rust //! # use std::sync::Arc; -//! use tap_receipt::{ +//! use graph_tally_receipt::{ //! checks::{Check, CheckResult, ReceiptCheck}, //! Context, ReceiptWithState, state::Checking //! }; @@ -33,7 +33,7 @@ use std::{ sync::{Arc, RwLock}, }; -use tap_eip712_message::Eip712Error; +use graph_tally_eip712_message::Eip712Error; use super::{ state::{Checking, Failed}, @@ -204,7 +204,7 @@ where mod tests { use std::time::{Duration, SystemTime}; - use tap_eip712_message::Eip712SignedMessage; + use graph_tally_eip712_message::Eip712SignedMessage; use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner, sol, sol_types::eip712_domain, diff --git a/tap_receipt/src/error.rs b/crates/receipt/src/error.rs similarity index 100% rename from tap_receipt/src/error.rs rename to crates/receipt/src/error.rs diff --git a/tap_receipt/src/lib.rs b/crates/receipt/src/lib.rs similarity index 95% rename from tap_receipt/src/lib.rs rename to crates/receipt/src/lib.rs index 62e7119..67456a3 100644 --- a/tap_receipt/src/lib.rs +++ b/crates/receipt/src/lib.rs @@ -23,8 +23,8 @@ mod received_receipt; pub mod state; pub use error::ReceiptError; +use graph_tally_eip712_message::{Eip712SignedMessage, SignatureBytes, SignatureBytesExt}; pub use received_receipt::ReceiptWithState; -use tap_eip712_message::{Eip712SignedMessage, SignatureBytes, SignatureBytesExt}; use thegraph_core::alloy::sol_types::SolStruct; /// Result type for receipt diff --git a/tap_receipt/src/rav.rs b/crates/receipt/src/rav.rs similarity index 94% rename from tap_receipt/src/rav.rs rename to crates/receipt/src/rav.rs index c87b94d..c5de720 100644 --- a/tap_receipt/src/rav.rs +++ b/crates/receipt/src/rav.rs @@ -1,6 +1,6 @@ //! Aggregation of Receipts -use tap_eip712_message::Eip712SignedMessage; +use graph_tally_eip712_message::Eip712SignedMessage; use thegraph_core::alloy::sol_types::SolStruct; use crate::{state::Checked, ReceiptWithState}; diff --git a/tap_receipt/src/received_receipt.rs b/crates/receipt/src/received_receipt.rs similarity index 100% rename from tap_receipt/src/received_receipt.rs rename to crates/receipt/src/received_receipt.rs diff --git a/tap_receipt/src/state.rs b/crates/receipt/src/state.rs similarity index 100% rename from tap_receipt/src/state.rs rename to crates/receipt/src/state.rs diff --git a/tap_core/README.md b/tap_core/README.md deleted file mode 120000 index 32d46ee..0000000 --- a/tap_core/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file From 7afcd9231f3a592418b93f0061411df0e474a725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 30 Apr 2026 16:22:19 -0300 Subject: [PATCH 2/5] fix: revert cargo version bumping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- Cargo.toml | 10 +++++----- crates/aggregator/Cargo.toml | 2 +- crates/core/Cargo.toml | 2 +- crates/eip712_message/Cargo.toml | 2 +- crates/graph/Cargo.toml | 2 +- crates/integration_tests/Cargo.toml | 2 +- crates/receipt/Cargo.toml | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fd74be5..78d5e4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,11 +46,11 @@ 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" -graph_tally_aggregator = { version = "1.0.0", path = "crates/aggregator" } -graph_tally_eip712_message = { version = "1.0.0", path = "crates/eip712_message" } -graph_tally_core = { version = "7.0.0", path = "crates/core" } -graph_tally_graph = { version = "1.0.0", path = "crates/graph" } -graph_tally_receipt = { version = "2.0.0", path = "crates/receipt" } +graph_tally_aggregator = { version = "0.6.4", path = "crates/aggregator" } +graph_tally_eip712_message = { version = "0.2.3", path = "crates/eip712_message" } +graph_tally_core = { version = "6.0.3", path = "crates/core" } +graph_tally_graph = { version = "0.3.5", path = "crates/graph" } +graph_tally_receipt = { version = "1.1.4", path = "crates/receipt" } thegraph-core = "0.15.1" thiserror = "2.0.12" tokio = { version = "1.44.2", features = ["macros", "signal"] } diff --git a/crates/aggregator/Cargo.toml b/crates/aggregator/Cargo.toml index 40263fa..e994401 100644 --- a/crates/aggregator/Cargo.toml +++ b/crates/aggregator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "graph_tally_aggregator" -version = "1.0.0" +version = "0.6.4" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index ecf867d..222084c 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "graph_tally_core" -version = "7.0.0" +version = "6.0.3" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/crates/eip712_message/Cargo.toml b/crates/eip712_message/Cargo.toml index f7c4bcf..0162b19 100644 --- a/crates/eip712_message/Cargo.toml +++ b/crates/eip712_message/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "graph_tally_eip712_message" -version = "1.0.0" +version = "0.2.3" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/crates/graph/Cargo.toml b/crates/graph/Cargo.toml index 224cab5..e457f35 100644 --- a/crates/graph/Cargo.toml +++ b/crates/graph/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "graph_tally_graph" -version = "1.0.0" +version = "0.3.5" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/crates/integration_tests/Cargo.toml b/crates/integration_tests/Cargo.toml index 91e41c0..9fe48b8 100644 --- a/crates/integration_tests/Cargo.toml +++ b/crates/integration_tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "graph_tally_integration_tests" -version = "1.0.0" +version = "0.1.27" edition.workspace = true rust-version.workspace = true license.workspace = true diff --git a/crates/receipt/Cargo.toml b/crates/receipt/Cargo.toml index 6a90caf..9f295fb 100644 --- a/crates/receipt/Cargo.toml +++ b/crates/receipt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "graph_tally_receipt" -version = "2.0.0" +version = "1.1.4" edition.workspace = true rust-version.workspace = true license.workspace = true From 7752359dd6a6de939d16cc3207b6ce0203794602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 30 Apr 2026 16:24:36 -0300 Subject: [PATCH 3/5] chore: remove core readme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- crates/core/README.md | 1 - 1 file changed, 1 deletion(-) delete mode 120000 crates/core/README.md diff --git a/crates/core/README.md b/crates/core/README.md deleted file mode 120000 index fe84005..0000000 --- a/crates/core/README.md +++ /dev/null @@ -1 +0,0 @@ -../../README.md \ No newline at end of file From b2b2140977db83f612b67704174ec08b43f875e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 30 Apr 2026 16:28:30 -0300 Subject: [PATCH 4/5] fix: remove README.md inclusion in core crate documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- crates/core/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index a90723c..c05de16 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -1,4 +1,8 @@ -#![doc = include_str!("../README.md")] +//! # Graph Tally Core +//! +//! Core library for the Graph Tally protocol: a fast, efficient and trustless +//! unidirectional micro-payments system. +//! //! ## Getting started //! //! To get started with the TAP protocol, take a look on the [`manager`] module From d004a7262750fb75ee1165b6392119e5ba81d3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 30 Apr 2026 16:30:11 -0300 Subject: [PATCH 5/5] fix: Cargo.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- crates/core/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 222084c..6242a05 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -5,7 +5,6 @@ edition.workspace = true rust-version.workspace = true license.workspace = true repository.workspace = true -readme = "README.md" description = "Core Graph Tally library: a fast, efficient and trustless unidirectional micro-payments system." [dependencies]