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
2 changes: 1 addition & 1 deletion tap_aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ tower = { version = "0.4", features = ["util", "steer"] }
tonic = { version = "0.12.3", features = ["transport", "zstd"] }
prost = "0.13.3"
hyper = { version = "1", features = ["full"] }
rayon = "1.10.0"

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


[dev-dependencies]
jsonrpsee = { workspace = true, features = ["http-client", "jsonrpsee-core"] }
rand.workspace = true
Expand Down
14 changes: 5 additions & 9 deletions tap_aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use alloy::{
sol_types::SolStruct,
};
use anyhow::{bail, Ok, Result};

use rayon::prelude::*;
use tap_core::{
rav::ReceiptAggregateVoucher,
receipt::Receipt,
Expand All @@ -25,18 +25,14 @@ pub fn check_and_aggregate_receipts(
check_signatures_unique(receipts)?;

// Check that the receipts are signed by an accepted signer address
receipts.iter().try_for_each(|receipt| {
check_signature_is_from_one_of_addresses(
receipt.clone(),
domain_separator,
accepted_addresses,
)
receipts.par_iter().try_for_each(|receipt| {
check_signature_is_from_one_of_addresses(receipt, domain_separator, accepted_addresses)
})?;

// Check that the previous rav is signed by an accepted signer address
if let Some(previous_rav) = &previous_rav {
check_signature_is_from_one_of_addresses(
previous_rav.clone(),
previous_rav,
domain_separator,
accepted_addresses,
)?;
Expand Down Expand Up @@ -74,7 +70,7 @@ pub fn check_and_aggregate_receipts(
}

fn check_signature_is_from_one_of_addresses<M: SolStruct>(
message: EIP712SignedMessage<M>,
message: &EIP712SignedMessage<M>,
domain_separator: &Eip712Domain,
accepted_addresses: &HashSet<Address>,
) -> Result<()> {
Expand Down
Loading