From 9790968378d8ae36bf4c883c8622ee1682dd609d Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 22 May 2019 12:19:13 +1000 Subject: [PATCH] Remove old `inclusion_distance` file --- .../src/per_epoch_processing.rs | 1 - .../inclusion_distance.rs | 64 ------------------- 2 files changed, 65 deletions(-) delete mode 100644 eth2/state_processing/src/per_epoch_processing/inclusion_distance.rs diff --git a/eth2/state_processing/src/per_epoch_processing.rs b/eth2/state_processing/src/per_epoch_processing.rs index 5e37877e41..d261b8b47c 100644 --- a/eth2/state_processing/src/per_epoch_processing.rs +++ b/eth2/state_processing/src/per_epoch_processing.rs @@ -10,7 +10,6 @@ use winning_root::{winning_root, WinningRoot}; pub mod apply_rewards; pub mod errors; -pub mod inclusion_distance; pub mod process_slashings; pub mod registry_updates; pub mod tests; diff --git a/eth2/state_processing/src/per_epoch_processing/inclusion_distance.rs b/eth2/state_processing/src/per_epoch_processing/inclusion_distance.rs deleted file mode 100644 index a9e0b7950b..0000000000 --- a/eth2/state_processing/src/per_epoch_processing/inclusion_distance.rs +++ /dev/null @@ -1,64 +0,0 @@ -use super::errors::InclusionError; -use types::*; - -/// Returns the distance between the first included attestation for some validator and this -/// slot. -/// -/// Spec v0.5.1 -pub fn inclusion_distance( - state: &BeaconState, - attestations: &[&PendingAttestation], - validator_index: usize, - spec: &ChainSpec, -) -> Result { - let attestation = earliest_included_attestation(state, attestations, validator_index, spec)?; - // Ok((attestation.inclusion_slot - attestation.data.slot).as_u64()) - // FIXME(sproul) - unimplemented!() -} - -/// Returns the slot of the earliest included attestation for some validator. -/// -/// Spec v0.5.1 -pub fn inclusion_slot( - state: &BeaconState, - attestations: &[&PendingAttestation], - validator_index: usize, - spec: &ChainSpec, -) -> Result { - /* - let attestation = earliest_included_attestation(state, attestations, validator_index, spec)?; - Ok(attestation.inclusion_slot) - */ - unimplemented!("FIXME(sproul) inclusion slot") -} - -/// Finds the earliest included attestation for some validator. -/// -/// Spec v0.5.1 -fn earliest_included_attestation( - state: &BeaconState, - attestations: &[&PendingAttestation], - validator_index: usize, - spec: &ChainSpec, -) -> Result { - // FIXME(sproul) - unimplemented!() - /* - let mut included_attestations = vec![]; - - for (i, a) in attestations.iter().enumerate() { - let participants = - get_attestation_participants(state, &a.data, &a.aggregation_bitfield, spec)?; - if participants.iter().any(|i| *i == validator_index) { - included_attestations.push(i); - } - } - - let earliest_attestation_index = included_attestations - .iter() - .min_by_key(|i| attestations[**i].inclusion_slot) - .ok_or_else(|| InclusionError::NoAttestationsForValidator)?; - Ok(attestations[*earliest_attestation_index].clone()) - */ -}