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

@@ -14,11 +14,11 @@ use std::ops::Deref;
use std::sync::Arc;
use tokio::time::{sleep, sleep_until, Duration, Instant};
use tree_hash::TreeHash;
use types::ForkName;
use types::{
attestation::AttestationBase, AggregateSignature, Attestation, AttestationData, BitList,
ChainSpec, CommitteeIndex, EthSpec, Slot,
attestation::AttestationBase, AggregateSignature, Attestation, AttestationData,
AttestationElectra, BitList, BitVector, ChainSpec, CommitteeIndex, EthSpec, Slot,
};
use types::{AttestationElectra, BitVector, ForkName};
/// Builds an `AttestationService`.
pub struct AttestationServiceBuilder<T: SlotClock + 'static, E: EthSpec> {
@@ -643,7 +643,7 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
"aggregator" => signed_aggregate_and_proof.message().aggregator_index(),
"signatures" => attestation.num_set_aggregation_bits(),
"head_block" => format!("{:?}", attestation.data().beacon_block_root),
"committee_index" => attestation.data().index,
"committee_index" => attestation.committee_index(),
"slot" => attestation.data().slot.as_u64(),
"type" => "aggregated",
);
@@ -657,7 +657,7 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
"Failed to publish attestation";
"error" => %e,
"aggregator" => signed_aggregate_and_proof.message().aggregator_index(),
"committee_index" => attestation.data().index,
"committee_index" => attestation.committee_index(),
"slot" => attestation.data().slot.as_u64(),
"type" => "aggregated",
);