Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename new list of bits field to aggregation_bits_list #3630

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions specs/_features/eip7549/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This is the beacon chain specification to move the attestation committee index o

```python
class Attestation(Container):
aggregation_bits: List[Bitlist[MAX_VALIDATORS_PER_COMMITTEE], MAX_COMMITTEES_PER_SLOT] # [Modified in EIP7549]
aggregation_bits_list: List[Bitlist[MAX_VALIDATORS_PER_COMMITTEE], MAX_COMMITTEES_PER_SLOT] # [Modified in EIP7549]
data: AttestationData
committee_bits: Bitvector[MAX_COMMITTEES_PER_SLOT] # [New in EIP7549]
signature: BLSSignature
Expand Down Expand Up @@ -78,13 +78,13 @@ def get_committee_indices(commitee_bits: Bitvector) -> List[CommitteeIndex]:
```python
def get_attesting_indices(state: BeaconState, attestation: Attestation) -> Set[ValidatorIndex]:
"""
Return the set of attesting indices corresponding to ``aggregation_bits`` and ``committee_bits``.
Return the set of attesting indices corresponding to ``aggregation_bits_list`` and ``committee_bits``.
"""

output = set()
committee_indices = get_committee_indices(attestation.committee_bits)
for index in committee_indices:
attesting_bits = attestation.aggregation_bits[index]
attesting_bits = attestation.aggregation_bits_list[index]
committee = get_beacon_committee(state, attestation.data.slot, index)
committee_attesters = set(index for i, index in enumerate(committee) if attesting_bits[i])
output = output.union(committee_attesters)
Expand All @@ -106,11 +106,11 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None:
# [Modified in EIP7549]
assert data.index == 0
committee_indices = get_committee_indices(attestation.committee_bits)
assert len(committee_indices) == len(attestation.aggregation_bits)
assert len(committee_indices) == len(attestation.aggregation_bits_list)
for index in committee_indices:
assert index < get_committee_count_per_slot(state, data.target.epoch)
committee = get_beacon_committee(state, data.slot, index)
assert len(attestation.aggregation_bits[index]) == len(committee)
assert len(attestation.aggregation_bits_list[index]) == len(committee)

# Participation flag indices
participation_flag_indices = get_attestation_participation_flag_indices(state, data, state.slot - data.slot)
Expand Down
10 changes: 5 additions & 5 deletions specs/_features/eip7549/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ The `beacon_aggregate_and_proof` and `beacon_attestation_{subnet_id}` topics are

The following convenience variables are re-defined
- `index = get_committee_indices(aggregate.committee_bits)[0]`
- `aggregation_bits = aggregate.aggregation_bits[0]`
- `aggregation_bits = aggregate.aggregation_bits_list[0]`

The following validations are added:
* [REJECT] `len(committee_indices) == len(aggregate.attestation_bits) == 1`, where `committee_indices = get_committee_indices(aggregate)`.
* [REJECT] `aggregate.data.index == 0`
* [REJECT] Bits list contains a single committee -- i.e. `len(committee_indices) == len(aggregate.attestation_bits_list) == 1`, where `committee_indices = get_committee_indices(aggregate)`.
* [REJECT] Legacy index is zero -- i.e. `aggregate.data.index == 0`

###### `beacon_attestation_{subnet_id}`

Expand All @@ -49,6 +49,6 @@ The following convenience variables are re-defined
- `aggregation_bits = attestation.aggregation_bits[0]`

The following validations are added:
* [REJECT] `len(committee_indices) == len(attestation.attestation_bits) == 1`, where `committee_indices = get_committee_indices(attestation)`.
* [REJECT] `attestation.data.index == 0`
* [REJECT] Bits list contains a single committee -- i.e. `len(committee_indices) == len(attestation.attestation_bits_list) == 1`, where `committee_indices = get_committee_indices(attestation)`.
* [REJECT] Legacy index is zero -- i.e. `attestation.data.index == 0`

4 changes: 2 additions & 2 deletions specs/_features/eip7549/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Attestations received from aggregators with disjoint `committee_bits` sets and e

- Set `attestation_data.index = 0`.
- Let `aggregation_bits` be a `Bitlist[MAX_VALIDATORS_PER_COMMITTEE]` of length `len(committee)`, where the bit of the index of the validator in the `committee` is set to `0b1`.
- Set `attestation.aggregation_bits = [aggregation_bits]`, a list of length 1
- Set `attestation.aggregation_bits_list = [aggregation_bits]`, a list of length 1
- Let `committee_bits` be a `Bitvector[MAX_COMMITTEES_PER_SLOT]`, where the bit at the index associated with the validator's committee is set to `0b1`
- Set `attestation.committee_bits = committee_bits`

Expand All @@ -46,6 +46,6 @@ Attestations received from aggregators with disjoint `committee_bits` sets and e

- Set `attestation_data.index = 0`.
- Let `aggregation_bits` be a `Bitlist[MAX_VALIDATORS_PER_COMMITTEE]` of length `len(committee)`, where each bit set from each individual attestation is set to `0b1`.
- Set `attestation.aggregation_bits = [aggregation_bits]`, a list of length 1
- Set `attestation.aggregation_bits_list = [aggregation_bits]`, a list of length 1
- Set `attestation.committee_bits = committee_bits`, where `committee_bits` has the same value as in each individual attestation

Loading