Fix mistake with attestation skip slots (#1539)

## Issue Addressed

NA

## Proposed Changes

- Fixes a mistake I made in #1530 which resulted us in *not* rejecting attestations that we intended to reject.
- Adds skip-slot checks for blocks earlier in import process, so it rejects gossip and RPC blocks.

## Additional Info

NA
This commit is contained in:
Paul Hauner
2020-08-18 06:28:26 +00:00
parent e1e5002d3c
commit d4f763bbae
2 changed files with 33 additions and 9 deletions

View File

@@ -549,7 +549,7 @@ fn verify_head_block_is_known<T: BeaconChainTypes>(
{
// Reject any block that exceeds our limit on skipped slots.
if let Some(max_skip_slots) = max_skip_slots {
if block.slot > attestation.data.slot + max_skip_slots {
if attestation.data.slot > block.slot + max_skip_slots {
return Err(Error::TooManySkippedSlots {
head_block_slot: block.slot,
attestation_slot: attestation.data.slot,