diff --git a/eth2/state_processing/src/per_block_processing/validate_attestation.rs b/eth2/state_processing/src/per_block_processing/validate_attestation.rs index 9d1321407..68a51b2df 100644 --- a/eth2/state_processing/src/per_block_processing/validate_attestation.rs +++ b/eth2/state_processing/src/per_block_processing/validate_attestation.rs @@ -142,12 +142,10 @@ fn validate_attestation_signature_optional( ); // Get the committee for the specific shard that this attestation is for. + let relative_epoch = RelativeEpoch::from_slot(state.slot, attestation.data.slot, spec) + .map_err(|_| BeaconStateError::EpochOutOfBounds)?; // Should not fail due to previous checks. let crosslink_committee = state - .get_crosslink_committees_at_slot( - attestation.data.slot, - RelativeEpoch::NextWithoutRegistryChange, - spec, - )? + .get_crosslink_committees_at_slot(attestation.data.slot, relative_epoch, spec)? .iter() .find(|c| c.shard == attestation.data.shard) .ok_or_else(|| {