Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request ethereum#3628 from mehdi-aouadi/eip-7549-onchain-a…
Browse files Browse the repository at this point in the history
…ggregation

EIP-7549 Clarify network vs on chain aggregation
  • Loading branch information
mkalinin authored Mar 22, 2024
2 parents 5d80b19 + 2014edb commit 68dceb7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion specs/_features/eip7549/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,24 @@

##### Attestations

Attestations received from aggregators with disjoint `committee_bits` sets and equal `AttestationData` SHOULD be consolidated into a single `Attestation` object.
The network attestation aggregates contain only the assigned committee attestations.
Attestation aggregates received by the block proposer from the committee aggregators with disjoint `committee_bits` sets and equal `AttestationData` SHOULD be consolidated into a single `Attestation` object.
The proposer should run the following function to construct an on chain final aggregate form a list of network aggregates with equal `AttestationData`:

```python
def compute_on_chain_aggregate(network_aggregates: List[Attestation]) -> Attestation:
aggregates = sorted(network_aggregates, key=lambda a: get_committee_indices(a.committee_bits)[0])

data = aggregates[0].data
aggregation_bits = [a.aggregation_bits[0] for a in aggregates]
signature = bls.Aggregate([a.signature for a in aggregates])

committee_indices = [get_committee_indices(a.committee_bits)[0] for a in aggregates]
committee_flags = [(index in committee_indices) for index in range(0, MAX_COMMITTEES_PER_SLOT)]
committee_bits = Bitvector[MAX_COMMITTEES_PER_SLOT](committee_flags)

return Attestation(aggregation_bits, data, committee_bits, signature)
```

### Attesting

Expand Down

0 comments on commit 68dceb7

Please sign in to comment.