@@ -28,47 +28,22 @@ use tower_fallback::Fallback;
28
28
29
29
use super :: spawn_fifo;
30
30
31
- // #[cfg(test)]
32
- // mod tests;
33
-
34
31
/// Adjusted batch size for halo2 batches.
35
32
///
36
33
/// Unlike other batch verifiers, halo2 has aggregate proofs.
37
34
/// This means that there can be hundreds of actions verified by some proofs,
38
35
/// but just one action in others.
39
36
///
40
- /// To compensate for larger proofs, we decrease the batch size.
41
- ///
42
- /// We also decrease the batch size for these reasons:
43
- /// - the default number of actions in `zcashd` is 2,
44
- /// - halo2 proofs take longer to verify than Sapling proofs, and
45
- /// - transactions with many actions generate very large proofs.
46
- ///
47
- /// # TODO
48
- ///
49
- /// Count each halo2 action as a batch item.
50
- /// We could increase the batch item count by the action count each time a batch request
51
- /// is received, which would reduce batch size, but keep the batch queue size larger.
52
- const HALO2_MAX_BATCH_SIZE : usize = 2 ;
53
-
54
- /* TODO: implement batch verification
55
-
56
- /// The type of the batch verifier.
57
- type BatchVerifier = plonk::BatchVerifier<vesta::Affine>;
58
- */
37
+ /// To compensate for larger proofs, we process the batch once there are over
38
+ /// [`HALO2_MAX_BATCH_SIZE`] total actions among pending items in the queue.
39
+ const HALO2_MAX_BATCH_SIZE : usize = super :: MAX_BATCH_SIZE ;
59
40
60
41
/// The type of verification results.
61
42
type VerifyResult = bool ;
62
43
63
44
/// The type of the batch sender channel.
64
45
type Sender = watch:: Sender < Option < VerifyResult > > ;
65
46
66
- /* TODO: implement batch verification
67
-
68
- /// The type of a raw verifying key.
69
- /// This is the key used to verify batches.
70
- pub type BatchVerifyingKey = VerifyingKey<vesta::Affine>;
71
- */
72
47
/// Temporary substitute type for fake batch verification.
73
48
///
74
49
/// TODO: implement batch verification
@@ -83,13 +58,6 @@ lazy_static::lazy_static! {
83
58
pub static ref VERIFYING_KEY : ItemVerifyingKey = ItemVerifyingKey :: build( ) ;
84
59
}
85
60
86
- // === TEMPORARY BATCH HALO2 SUBSTITUTE ===
87
- //
88
- // These types are meant to be API compatible with the batch verification APIs
89
- // in bellman::groth16::batch, reddsa::batch, redjubjub::batch, and
90
- // ed25519-zebra::batch. Once Halo2 batch proof verification math and
91
- // implementation is available, this code can be replaced with that.
92
-
93
61
/// A Halo2 verification item, used as the request type of the service.
94
62
#[ derive( Clone , Debug ) ]
95
63
pub struct Item {
0 commit comments