diff --git a/beacon_chain/attestation_validation/src/justified_slot.rs b/beacon_chain/attestation_validation/src/justified_slot.rs index c27dfe8f2..ea71f2616 100644 --- a/beacon_chain/attestation_validation/src/justified_slot.rs +++ b/beacon_chain/attestation_validation/src/justified_slot.rs @@ -12,8 +12,9 @@ use super::{Error, Invalid, Outcome}; pub fn validate_attestation_justified_slot( data: &AttestationData, state: &BeaconState, + epoch_length: u64, ) -> Result { - let permissable_justified_slot = if data.slot >= state.latest_state_recalculation_slot { + let permissable_justified_slot = if data.slot >= state.slot - (state.slot % epoch_length) { state.justified_slot } else { state.previous_justified_slot diff --git a/beacon_chain/attestation_validation/src/shard_block.rs b/beacon_chain/attestation_validation/src/shard_block.rs index 7fb48ff62..e1d9487de 100644 --- a/beacon_chain/attestation_validation/src/shard_block.rs +++ b/beacon_chain/attestation_validation/src/shard_block.rs @@ -19,7 +19,7 @@ where match state.latest_crosslinks.get(data.shard as usize) { None => reject!(Invalid::UnknownShard), Some(crosslink) => { - let local_shard_block_hash = crosslink.shard_block_hash; + let local_shard_block_hash = crosslink.shard_block_root; let shard_block_hash_is_permissable = { (local_shard_block_hash == data.latest_crosslink_hash) || (local_shard_block_hash == data.shard_block_hash)