diff --git a/Cargo.lock b/Cargo.lock index 319c15be..7be30ebc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4718,7 +4718,7 @@ dependencies = [ ] [[package]] -name = "tower-batch" +name = "tower-batch-control" version = "0.2.40" dependencies = [ "color-eyre", @@ -5728,7 +5728,7 @@ dependencies = [ "tinyvec", "tokio", "tower", - "tower-batch", + "tower-batch-control", "tower-fallback", "tracing", "tracing-error", diff --git a/Cargo.toml b/Cargo.toml index d77eb87b..e6ffaefb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ "zebra-node-services", "zebra-test", "zebra-utils", - "tower-batch", + "tower-batch-control", "tower-fallback", ] diff --git a/book/src/dev/overview.md b/book/src/dev/overview.md index b6508acf..f5e5f82a 100644 --- a/book/src/dev/overview.md +++ b/book/src/dev/overview.md @@ -123,7 +123,7 @@ into several components: of blocks and transactions: all consensus rules that can be checked independently of the chain state, such as verification of signatures, proofs, and scripts. Internally, the library - uses [`tower-batch`](https://doc.zebra.zfnd.org/tower_batch/index.html) to + uses [`tower-batch-control`](https://doc.zebra.zfnd.org/tower_batch_control/index.html) to perform automatic, transparent batch processing of contemporaneous verification requests. diff --git a/book/src/dev/rfcs/0011-async-rust-in-zebra.md b/book/src/dev/rfcs/0011-async-rust-in-zebra.md index b3c12120..000bb2cb 100644 --- a/book/src/dev/rfcs/0011-async-rust-in-zebra.md +++ b/book/src/dev/rfcs/0011-async-rust-in-zebra.md @@ -14,7 +14,7 @@ with the [tokio](https://docs.rs/tokio/) executor. At a higher level, Zebra also uses [`tower::Service`s](https://docs.rs/tower/0.4.1/tower/trait.Service.html), [`tower::Buffer`s](https://docs.rs/tower/0.4.1/tower/buffer/struct.Buffer.html), -and our own [`tower-batch`](https://github.com/ZcashFoundation/zebra/tree/main/tower-batch) +and our own [`tower-batch-control`](https://github.com/ZcashFoundation/zebra/tree/main/tower-batch-control) implementation. # Motivation @@ -737,7 +737,7 @@ particularly important for code that modifies Zebra's highly concurrent crates: - `zebra-network` - `zebra-state` - `zebra-consensus` -- `tower-batch` +- `tower-batch-control` - `tower-fallback` ## Monitoring Async Code diff --git a/tower-batch/Cargo.toml b/tower-batch-control/Cargo.toml similarity index 97% rename from tower-batch/Cargo.toml rename to tower-batch-control/Cargo.toml index 611b30e8..8d1b66c1 100644 --- a/tower-batch/Cargo.toml +++ b/tower-batch-control/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "tower-batch" +name = "tower-batch-control" version = "0.2.40" authors = ["Zcash Foundation "] license = "MIT" diff --git a/tower-batch/src/error.rs b/tower-batch-control/src/error.rs similarity index 100% rename from tower-batch/src/error.rs rename to tower-batch-control/src/error.rs diff --git a/tower-batch/src/future.rs b/tower-batch-control/src/future.rs similarity index 100% rename from tower-batch/src/future.rs rename to tower-batch-control/src/future.rs diff --git a/tower-batch/src/layer.rs b/tower-batch-control/src/layer.rs similarity index 100% rename from tower-batch/src/layer.rs rename to tower-batch-control/src/layer.rs diff --git a/tower-batch/src/lib.rs b/tower-batch-control/src/lib.rs similarity index 100% rename from tower-batch/src/lib.rs rename to tower-batch-control/src/lib.rs diff --git a/tower-batch/src/message.rs b/tower-batch-control/src/message.rs similarity index 100% rename from tower-batch/src/message.rs rename to tower-batch-control/src/message.rs diff --git a/tower-batch/src/service.rs b/tower-batch-control/src/service.rs similarity index 100% rename from tower-batch/src/service.rs rename to tower-batch-control/src/service.rs diff --git a/tower-batch/src/worker.rs b/tower-batch-control/src/worker.rs similarity index 100% rename from tower-batch/src/worker.rs rename to tower-batch-control/src/worker.rs diff --git a/tower-batch/tests/ed25519.rs b/tower-batch-control/tests/ed25519.rs similarity index 99% rename from tower-batch/tests/ed25519.rs rename to tower-batch-control/tests/ed25519.rs index c45e196d..773b1e3e 100644 --- a/tower-batch/tests/ed25519.rs +++ b/tower-batch-control/tests/ed25519.rs @@ -7,7 +7,7 @@ use ed25519_zebra::*; use futures::stream::{FuturesOrdered, StreamExt}; use rand::thread_rng; use tower::{Service, ServiceExt}; -use tower_batch::Batch; +use tower_batch_control::Batch; use tower_fallback::Fallback; // ============ service impl ============ diff --git a/tower-batch/tests/worker.rs b/tower-batch-control/tests/worker.rs similarity index 98% rename from tower-batch/tests/worker.rs rename to tower-batch-control/tests/worker.rs index 640af1fa..1e7a18b7 100644 --- a/tower-batch/tests/worker.rs +++ b/tower-batch-control/tests/worker.rs @@ -4,7 +4,7 @@ use std::time::Duration; use tokio_test::{assert_pending, assert_ready, assert_ready_err, task}; use tower::{Service, ServiceExt}; -use tower_batch::{error, Batch}; +use tower_batch_control::{error, Batch}; use tower_test::mock; #[tokio::test] diff --git a/zebra-consensus/Cargo.toml b/zebra-consensus/Cargo.toml index f80c5602..70b279a2 100644 --- a/zebra-consensus/Cargo.toml +++ b/zebra-consensus/Cargo.toml @@ -54,7 +54,7 @@ orchard = "0.4.0" zcash_proofs = { version = "0.11.0", features = ["local-prover", "multicore", "download-params"] } tower-fallback = { path = "../tower-fallback/" } -tower-batch = { path = "../tower-batch/" } +tower-batch-control = { path = "../tower-batch-control/" } zebra-script = { path = "../zebra-script" } zebra-state = { path = "../zebra-state" } diff --git a/zebra-consensus/src/primitives/ed25519.rs b/zebra-consensus/src/primitives/ed25519.rs index 22b7f766..49bb6c4a 100644 --- a/zebra-consensus/src/primitives/ed25519.rs +++ b/zebra-consensus/src/primitives/ed25519.rs @@ -14,7 +14,7 @@ use rand::thread_rng; use rayon::prelude::*; use tokio::sync::watch; use tower::{util::ServiceFn, Service}; -use tower_batch::{Batch, BatchControl}; +use tower_batch_control::{Batch, BatchControl}; use tower_fallback::Fallback; use zebra_chain::primitives::ed25519::{batch, *}; diff --git a/zebra-consensus/src/primitives/ed25519/tests.rs b/zebra-consensus/src/primitives/ed25519/tests.rs index 4c13a5d6..0847ed08 100644 --- a/zebra-consensus/src/primitives/ed25519/tests.rs +++ b/zebra-consensus/src/primitives/ed25519/tests.rs @@ -5,7 +5,7 @@ use std::time::Duration; use color_eyre::eyre::{eyre, Result}; use futures::stream::{FuturesUnordered, StreamExt}; use tower::ServiceExt; -use tower_batch::Batch; +use tower_batch_control::Batch; use crate::primitives::ed25519::*; diff --git a/zebra-consensus/src/primitives/groth16.rs b/zebra-consensus/src/primitives/groth16.rs index 29e325fa..0013c048 100644 --- a/zebra-consensus/src/primitives/groth16.rs +++ b/zebra-consensus/src/primitives/groth16.rs @@ -22,7 +22,7 @@ use rayon::prelude::*; use tokio::sync::watch; use tower::{util::ServiceFn, Service}; -use tower_batch::{Batch, BatchControl}; +use tower_batch_control::{Batch, BatchControl}; use tower_fallback::{BoxedError, Fallback}; use zebra_chain::{ diff --git a/zebra-consensus/src/primitives/halo2.rs b/zebra-consensus/src/primitives/halo2.rs index a4c0d47c..b747b4b0 100644 --- a/zebra-consensus/src/primitives/halo2.rs +++ b/zebra-consensus/src/primitives/halo2.rs @@ -17,7 +17,7 @@ use rayon::prelude::*; use thiserror::Error; use tokio::sync::watch; use tower::{util::ServiceFn, Service}; -use tower_batch::{Batch, BatchControl}; +use tower_batch_control::{Batch, BatchControl}; use tower_fallback::Fallback; #[cfg(test)] diff --git a/zebra-consensus/src/primitives/redjubjub.rs b/zebra-consensus/src/primitives/redjubjub.rs index 1f11e662..b7f65a2c 100644 --- a/zebra-consensus/src/primitives/redjubjub.rs +++ b/zebra-consensus/src/primitives/redjubjub.rs @@ -14,7 +14,7 @@ use rand::thread_rng; use rayon::prelude::*; use tokio::sync::watch; use tower::{util::ServiceFn, Service}; -use tower_batch::{Batch, BatchControl}; +use tower_batch_control::{Batch, BatchControl}; use tower_fallback::Fallback; use zebra_chain::primitives::redjubjub::{batch, *}; diff --git a/zebra-consensus/src/primitives/redjubjub/tests.rs b/zebra-consensus/src/primitives/redjubjub/tests.rs index 8c29e318..eb32a1db 100644 --- a/zebra-consensus/src/primitives/redjubjub/tests.rs +++ b/zebra-consensus/src/primitives/redjubjub/tests.rs @@ -7,7 +7,7 @@ use std::time::Duration; use color_eyre::eyre::{eyre, Result}; use futures::stream::{FuturesUnordered, StreamExt}; use tower::ServiceExt; -use tower_batch::Batch; +use tower_batch_control::Batch; async fn sign_and_verify(mut verifier: V, n: usize) -> Result<(), V::Error> where diff --git a/zebra-consensus/src/primitives/redpallas.rs b/zebra-consensus/src/primitives/redpallas.rs index 26f40b61..77b6b08b 100644 --- a/zebra-consensus/src/primitives/redpallas.rs +++ b/zebra-consensus/src/primitives/redpallas.rs @@ -14,7 +14,7 @@ use rand::thread_rng; use rayon::prelude::*; use tokio::sync::watch; use tower::{util::ServiceFn, Service}; -use tower_batch::{Batch, BatchControl}; +use tower_batch_control::{Batch, BatchControl}; use tower_fallback::Fallback; use zebra_chain::primitives::reddsa::{batch, orchard, Error}; diff --git a/zebra-consensus/src/primitives/redpallas/tests.rs b/zebra-consensus/src/primitives/redpallas/tests.rs index 2a49b9a1..6ae0717d 100644 --- a/zebra-consensus/src/primitives/redpallas/tests.rs +++ b/zebra-consensus/src/primitives/redpallas/tests.rs @@ -7,7 +7,7 @@ use std::time::Duration; use color_eyre::eyre::{eyre, Result}; use futures::stream::{FuturesUnordered, StreamExt}; use tower::ServiceExt; -use tower_batch::Batch; +use tower_batch_control::Batch; use zebra_chain::primitives::reddsa::{ orchard::{Binding, SpendAuth},