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

@@ -1014,6 +1014,7 @@ async fn multiple_attestations_per_block() {
.await;
let head = harness.chain.head_snapshot();
let committees_per_slot = head
.beacon_state
.get_committee_count_at_slot(head.beacon_state.slot())
@@ -1022,15 +1023,29 @@ async fn multiple_attestations_per_block() {
for snapshot in harness.chain.chain_dump().unwrap() {
let slot = snapshot.beacon_block.slot();
assert_eq!(
snapshot
.beacon_block
.as_ref()
.message()
.body()
.attestations_len() as u64,
if slot <= 1 { 0 } else { committees_per_slot }
);
let fork_name = harness.chain.spec.fork_name_at_slot::<E>(slot);
if fork_name >= ForkName::Electra {
assert_eq!(
snapshot
.beacon_block
.as_ref()
.message()
.body()
.attestations_len() as u64,
if slot <= 1 { 0 } else { 1 }
);
} else {
assert_eq!(
snapshot
.beacon_block
.as_ref()
.message()
.body()
.attestations_len() as u64,
if slot <= 1 { 0 } else { committees_per_slot }
);
}
}
}