From 3a0dd2b253003d313b92a109bb63d680c922d59e Mon Sep 17 00:00:00 2001 From: lsankar4033 Date: Tue, 28 Jul 2020 17:51:32 -0700 Subject: [PATCH 1/2] Add self-consistency check to attestation gossip validation --- specs/phase0/p2p-interface.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specs/phase0/p2p-interface.md b/specs/phase0/p2p-interface.md index aa8d4aace..2d9afbdef 100644 --- a/specs/phase0/p2p-interface.md +++ b/specs/phase0/p2p-interface.md @@ -403,6 +403,8 @@ The following validations MUST pass before forwarding the `attestation` on the s - _[REJECT]_ The current `finalized_checkpoint` is an ancestor of the `block` defined by `attestation.data.beacon_block_root` -- i.e. `get_ancestor(store, attestation.data.beacon_block_root, compute_start_slot_at_epoch(store.finalized_checkpoint.epoch)) == store.finalized_checkpoint.root` +- _[REJECT]_ The attestation's epoch matches its target -- i.e. `attestation.data.target.epoch == + compute_epoch_at_slot(attestation.data.slot)` From bf6d5ce3b63560057ad2c79df1d092b2d2b97f15 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Mon, 3 Aug 2020 09:42:52 -0600 Subject: [PATCH 2/2] port #2005 and rearrange conditions --- specs/phase0/p2p-interface.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/specs/phase0/p2p-interface.md b/specs/phase0/p2p-interface.md index 2d9afbdef..76ff91eab 100644 --- a/specs/phase0/p2p-interface.md +++ b/specs/phase0/p2p-interface.md @@ -391,6 +391,8 @@ The following validations MUST pass before forwarding the `attestation` on the s (within a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) -- i.e. `attestation.data.slot + ATTESTATION_PROPAGATION_SLOT_RANGE >= current_slot >= attestation.data.slot` (a client MAY queue future attestations for processing at the appropriate slot). +- _[REJECT]_ The attestation's epoch matches its target -- i.e. `attestation.data.target.epoch == + compute_epoch_at_slot(attestation.data.slot)` - _[REJECT]_ The attestation is unaggregated -- that is, it has exactly one participating validator (`len([bit in bit attestation.aggregation_bits if bit]) == 1`, i.e. exactly 1 bit is set). - _[IGNORE]_ There has been no other valid attestation seen on an attestation subnet @@ -400,11 +402,12 @@ The following validations MUST pass before forwarding the `attestation` on the s (via both gossip and non-gossip sources) (a client MAY queue aggregates for processing once block is retrieved). - _[REJECT]_ The block being voted for (`attestation.data.beacon_block_root`) passes validation. +- _[REJECT]_ The attestation's target block is an ancestor of the block named in the LMD vote -- i.e. + `get_ancestor(store, attestation.data.beacon_block_root, compute_start_slot_at_epoch(attestation.data.target.epoch)) == attestation.data.target.root` - _[REJECT]_ The current `finalized_checkpoint` is an ancestor of the `block` defined by `attestation.data.beacon_block_root` -- i.e. `get_ancestor(store, attestation.data.beacon_block_root, compute_start_slot_at_epoch(store.finalized_checkpoint.epoch)) == store.finalized_checkpoint.root` -- _[REJECT]_ The attestation's epoch matches its target -- i.e. `attestation.data.target.epoch == - compute_epoch_at_slot(attestation.data.slot)` +