diff --git a/eth2/state_processing/src/per_block_processing.rs b/eth2/state_processing/src/per_block_processing.rs index c446dcd85..d871914d9 100644 --- a/eth2/state_processing/src/per_block_processing.rs +++ b/eth2/state_processing/src/per_block_processing.rs @@ -442,8 +442,15 @@ pub fn process_transfers( transfers.len() as u64 <= spec.max_transfers, Invalid::MaxTransfersExceed ); + + transfers + .par_iter() + .enumerate() + .try_for_each(|(i, transfer)| { + verify_transfer(&state, transfer, spec).map_err(|e| e.into_with_index(i)) + })?; + for (i, transfer) in transfers.iter().enumerate() { - verify_transfer(&state, transfer, spec).map_err(|e| e.into_with_index(i))?; execute_transfer(state, transfer, spec).map_err(|e| e.into_with_index(i))?; } diff --git a/eth2/types/src/test_utils/testing_transfer_builder.rs b/eth2/types/src/test_utils/testing_transfer_builder.rs index a8a6d7a17..c343e8fd2 100644 --- a/eth2/types/src/test_utils/testing_transfer_builder.rs +++ b/eth2/types/src/test_utils/testing_transfer_builder.rs @@ -9,7 +9,7 @@ impl TestingTransferBuilder { pub fn new(from: u64, to: u64, amount: u64, slot: Slot) -> Self { let keypair = Keypair::random(); - let mut transfer = Transfer { + let transfer = Transfer { from, to, amount,