mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Reject empty attestations
This commit is contained in:
@@ -74,6 +74,7 @@ pub enum BlockProcessingOutcome {
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum AttestationProcessingOutcome {
|
pub enum AttestationProcessingOutcome {
|
||||||
Processed,
|
Processed,
|
||||||
|
EmptyAggregationBitfield,
|
||||||
UnknownHeadBlock {
|
UnknownHeadBlock {
|
||||||
beacon_block_root: Hash256,
|
beacon_block_root: Hash256,
|
||||||
},
|
},
|
||||||
@@ -692,6 +693,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
metrics::inc_counter(&metrics::ATTESTATION_PROCESSING_REQUESTS);
|
metrics::inc_counter(&metrics::ATTESTATION_PROCESSING_REQUESTS);
|
||||||
let timer = metrics::start_timer(&metrics::ATTESTATION_PROCESSING_TIMES);
|
let timer = metrics::start_timer(&metrics::ATTESTATION_PROCESSING_TIMES);
|
||||||
|
|
||||||
|
if attestation.aggregation_bits.num_set_bits() == 0 {
|
||||||
|
return Ok(AttestationProcessingOutcome::EmptyAggregationBitfield);
|
||||||
|
}
|
||||||
|
|
||||||
// From the store, load the attestation's "head block".
|
// From the store, load the attestation's "head block".
|
||||||
//
|
//
|
||||||
// An honest validator would have set this block to be the head of the chain (i.e., the
|
// An honest validator would have set this block to be the head of the chain (i.e., the
|
||||||
|
|||||||
Reference in New Issue
Block a user