From 825aca0ef3e020695b688116c3ea4ad74fd17887 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 25 Jun 2020 16:49:53 +1000 Subject: [PATCH] Use hash instead of tree hash for is_aggregator (#1296) --- consensus/types/src/selection_proof.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/consensus/types/src/selection_proof.rs b/consensus/types/src/selection_proof.rs index 8167dad557..ea773d7066 100644 --- a/consensus/types/src/selection_proof.rs +++ b/consensus/types/src/selection_proof.rs @@ -1,10 +1,11 @@ use crate::{ ChainSpec, Domain, EthSpec, Fork, Hash256, PublicKey, SecretKey, Signature, SignedRoot, Slot, }; +use eth2_hashing::hash; use safe_arith::{ArithError, SafeArith}; +use ssz::Encode; use std::cmp; use std::convert::TryInto; -use tree_hash::TreeHash; #[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))] #[derive(PartialEq, Debug, Clone)] @@ -46,7 +47,7 @@ impl SelectionProof { } pub fn is_aggregator_from_modulo(&self, modulo: u64) -> Result { - let signature_hash = self.0.tree_hash_root(); + let signature_hash = hash(&self.0.as_ssz_bytes()); let signature_hash_int = u64::from_le_bytes( signature_hash[0..8] .as_ref()