@@ -60,9 +60,9 @@ use std::borrow::Cow;
60
60
use strum:: AsRefStr ;
61
61
use tree_hash:: TreeHash ;
62
62
use types:: {
63
- Attestation , AttestationRef , BeaconCommittee , BeaconStateError :: NoCommitteeFound , ChainSpec ,
64
- CommitteeIndex , Epoch , EthSpec , Hash256 , IndexedAttestation , SelectionProof ,
65
- SignedAggregateAndProof , SingleAttestation , Slot , SubnetId ,
63
+ Attestation , AttestationData , AttestationRef , BeaconCommittee ,
64
+ BeaconStateError :: NoCommitteeFound , ChainSpec , CommitteeIndex , Epoch , EthSpec , Hash256 ,
65
+ IndexedAttestation , SelectionProof , SignedAggregateAndProof , SingleAttestation , Slot , SubnetId ,
66
66
} ;
67
67
68
68
pub use batch:: { batch_verify_aggregated_attestations, batch_verify_unaggregated_attestations} ;
@@ -115,6 +115,17 @@ pub enum Error {
115
115
///
116
116
/// The peer has sent an invalid message.
117
117
AggregatorNotInCommittee { aggregator_index : u64 } ,
118
+ /// The `attester_index` for a `SingleAttestation` is not a member of the committee defined
119
+ /// by its `beacon_block_root`, `committee_index` and `slot`.
120
+ ///
121
+ /// ## Peer scoring
122
+ ///
123
+ /// The peer has sent an invalid message.
124
+ AttesterNotInCommittee {
125
+ attester_index : u64 ,
126
+ committee_index : u64 ,
127
+ slot : Slot ,
128
+ } ,
118
129
/// The aggregator index refers to a validator index that we have not seen.
119
130
///
120
131
/// ## Peer scoring
@@ -485,7 +496,11 @@ impl<'a, T: BeaconChainTypes> IndexedAggregatedAttestation<'a, T> {
485
496
// MAXIMUM_GOSSIP_CLOCK_DISPARITY allowance).
486
497
//
487
498
// We do not queue future attestations for later processing.
488
- verify_propagation_slot_range ( & chain. slot_clock , attestation, & chain. spec ) ?;
499
+ verify_propagation_slot_range :: < _ , T :: EthSpec > (
500
+ & chain. slot_clock ,
501
+ attestation. data ( ) ,
502
+ & chain. spec ,
503
+ ) ?;
489
504
490
505
// Check the attestation's epoch matches its target.
491
506
if attestation. data ( ) . slot . epoch ( T :: EthSpec :: slots_per_epoch ( ) )
@@ -817,7 +832,11 @@ impl<'a, T: BeaconChainTypes> IndexedUnaggregatedAttestation<'a, T> {
817
832
// MAXIMUM_GOSSIP_CLOCK_DISPARITY allowance).
818
833
//
819
834
// We do not queue future attestations for later processing.
820
- verify_propagation_slot_range ( & chain. slot_clock , attestation, & chain. spec ) ?;
835
+ verify_propagation_slot_range :: < _ , T :: EthSpec > (
836
+ & chain. slot_clock ,
837
+ attestation. data ( ) ,
838
+ & chain. spec ,
839
+ ) ?;
821
840
822
841
// Check to ensure that the attestation is "unaggregated". I.e., it has exactly one
823
842
// aggregation bit set.
@@ -1133,10 +1152,10 @@ fn verify_head_block_is_known<T: BeaconChainTypes>(
1133
1152
/// Accounts for `MAXIMUM_GOSSIP_CLOCK_DISPARITY`.
1134
1153
pub fn verify_propagation_slot_range < S : SlotClock , E : EthSpec > (
1135
1154
slot_clock : & S ,
1136
- attestation : AttestationRef < E > ,
1155
+ attestation : & AttestationData ,
1137
1156
spec : & ChainSpec ,
1138
1157
) -> Result < ( ) , Error > {
1139
- let attestation_slot = attestation. data ( ) . slot ;
1158
+ let attestation_slot = attestation. slot ;
1140
1159
let latest_permissible_slot = slot_clock
1141
1160
. now_with_future_tolerance ( spec. maximum_gossip_clock_disparity ( ) )
1142
1161
. ok_or ( BeaconChainError :: UnableToReadSlot ) ?;
0 commit comments