Attestation superstruct changes for EIP 7549 (#5644)

* update

* experiment

* superstruct changes

* revert

* superstruct changes

* fix tests

* indexed attestation

* indexed attestation superstruct

* updated TODOs
This commit is contained in:
Eitan Seri-Levi
2024-04-30 19:49:08 +03:00
committed by GitHub
parent 4a48d7b546
commit 3b7132bc0d
56 changed files with 943 additions and 429 deletions

View File

@@ -47,7 +47,8 @@ impl<E: EthSpec> AttestationBatch<E> {
self.attestations.push(Arc::downgrade(&indexed_record));
let attestation_data_hash = indexed_record.record.attestation_data_hash;
for &validator_index in &indexed_record.indexed.attesting_indices {
for &validator_index in indexed_record.indexed.attesting_indices_iter() {
self.attesters
.entry((validator_index, attestation_data_hash))
.and_modify(|existing_entry| {
@@ -56,8 +57,8 @@ impl<E: EthSpec> AttestationBatch<E> {
// smaller indexed attestation. Single-bit attestations will usually be removed
// completely by this process, and aggregates will only be retained if they
// are not redundant with respect to a larger aggregate seen in the same batch.
if existing_entry.indexed.attesting_indices.len()
< indexed_record.indexed.attesting_indices.len()
if existing_entry.indexed.attesting_indices_len()
< indexed_record.indexed.attesting_indices_len()
{
*existing_entry = indexed_record.clone();
}