Clean up unnecessary function arguments

Some of the inputs to some functions in the Altair validator guide
were required in earlier iterations of the aggregation scheme but are
no longer required in the current version. This commit cleans up these
functions.
This commit is contained in:
Alex Stokes 2021-04-05 16:56:13 -07:00
parent 0b069fbfca
commit 746d6453bc
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69
1 changed files with 3 additions and 4 deletions

View File

@ -220,8 +220,7 @@ Given a collection of the best seen `contributions` (with no repeating `subcommi
the proposer processes them as follows: the proposer processes them as follows:
```python ```python
def process_sync_committee_contributions(state: BeaconState, def process_sync_committee_contributions(block: BeaconBlock,
block: BeaconBlock,
contributions: Set[SyncCommitteeContribution]) -> None: contributions: Set[SyncCommitteeContribution]) -> None:
sync_aggregate = SyncAggregate() sync_aggregate = SyncAggregate()
signatures = [] signatures = []
@ -310,7 +309,7 @@ Each slot some sync committee members in each subcommittee are selected to aggre
##### Aggregation selection ##### Aggregation selection
A validator is selected to aggregate based on the computation in `is_sync_committee_aggregator` where `state` is a `BeaconState` as supplied to `get_sync_committee_selection_proof` and `signature` is the BLS signature returned by `get_sync_committee_selection_proof`. A validator is selected to aggregate based on the computation in `is_sync_committee_aggregator` where `signature` is the BLS signature returned by `get_sync_committee_selection_proof`.
The signature function takes a `BeaconState` with the relevant sync committees for the queried `slot` (i.e. `state.slot` is within the span covered by the current or next sync committee period), the `subcommittee_index` equal to the `subnet_id`, and the `privkey` is the BLS private key associated with the validator. The signature function takes a `BeaconState` with the relevant sync committees for the queried `slot` (i.e. `state.slot` is within the span covered by the current or next sync committee period), the `subcommittee_index` equal to the `subnet_id`, and the `privkey` is the BLS private key associated with the validator.
```python ```python
@ -326,7 +325,7 @@ def get_sync_committee_selection_proof(state: BeaconState, slot: Slot,
``` ```
```python ```python
def is_sync_committee_aggregator(state: BeaconState, signature: BLSSignature) -> bool: def is_sync_committee_aggregator(signature: BLSSignature) -> bool:
modulo = max(1, SYNC_COMMITTEE_SIZE // SYNC_COMMITTEE_SUBNET_COUNT // TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE) modulo = max(1, SYNC_COMMITTEE_SIZE // SYNC_COMMITTEE_SUBNET_COUNT // TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE)
return bytes_to_uint64(hash(signature)[0:8]) % modulo == 0 return bytes_to_uint64(hash(signature)[0:8]) % modulo == 0
``` ```