Fix failing attestation tests and misc electra attestation cleanup (#5810)

* - get attestation related beacon chain tests to pass
- observed attestations are now keyed off of data + committee index
- rename op pool attestationref to compactattestationref
- remove unwraps in agg pool and use options instead
- cherry pick some changes from ef-tests-electra

* cargo fmt

* fix failing test

* Revert dockerfile changes

* make committee_index return option

* function args shouldnt be a ref to attestation ref

* fmt

* fix dup imports

---------

Co-authored-by: realbigsean <seananderson33@GMAIL.com>
This commit is contained in:
Eitan Seri-Levi
2024-05-30 17:51:34 +02:00
committed by GitHub
parent 75432e1135
commit e340998241
28 changed files with 765 additions and 292 deletions

View File

@@ -2049,6 +2049,27 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
"attn_val_index_too_high",
);
}
AttnError::CommitteeIndexNonZero(index) => {
/*
* The validator index is not set to zero after Electra.
*
* The peer has published an invalid consensus message.
*/
debug!(
self.log,
"Committee index non zero";
"peer_id" => %peer_id,
"block" => ?beacon_block_root,
"type" => ?attestation_type,
"committee_index" => index,
);
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Reject);
self.gossip_penalize_peer(
peer_id,
PeerAction::LowToleranceError,
"attn_comm_index_non_zero",
);
}
AttnError::UnknownHeadBlock { beacon_block_root } => {
trace!(
self.log,
@@ -2204,6 +2225,19 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
"attn_too_many_agg_bits",
);
}
AttnError::NotExactlyOneCommitteeBitSet(_) => {
/*
* The attestation doesn't have only one committee bit set.
*
* The peer has published an invalid consensus message.
*/
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Reject);
self.gossip_penalize_peer(
peer_id,
PeerAction::LowToleranceError,
"attn_too_many_comm_bits",
);
}
AttnError::AttestsToFutureBlock { .. } => {
/*
* The beacon_block_root is from a higher slot than the attestation.