From 7108d057fb8bf0d84326619098755305c41e1572 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 28 Feb 2019 23:09:21 +1100 Subject: [PATCH] Set `BeaconState` to process deposits in parallel Provides a large speed improvement. --- eth2/types/src/beacon_state.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth2/types/src/beacon_state.rs b/eth2/types/src/beacon_state.rs index 3d94a8e3d..61f270e15 100644 --- a/eth2/types/src/beacon_state.rs +++ b/eth2/types/src/beacon_state.rs @@ -9,6 +9,7 @@ use bls::verify_proof_of_possession; use honey_badger_split::SplitExt; use log::{debug, error, trace}; use rand::RngCore; +use rayon::prelude::*; use serde_derive::Serialize; use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; use std::collections::HashMap; @@ -202,7 +203,7 @@ impl BeaconState { trace!("Processing genesis deposits..."); let deposit_data = initial_validator_deposits - .iter() + .par_iter() .map(|deposit| &deposit.deposit_data) .collect();