add documentation about duplicate pubkeys

This commit is contained in:
Alex Stokes 2021-05-04 12:16:39 -07:00
parent 7b33c1119a
commit 9c3d5982cf
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69
1 changed files with 8 additions and 0 deletions

View File

@ -302,6 +302,14 @@ def get_sync_committee_indices(state: BeaconState, epoch: Epoch) -> Sequence[Val
def get_sync_committee(state: BeaconState, epoch: Epoch) -> SyncCommittee: def get_sync_committee(state: BeaconState, epoch: Epoch) -> SyncCommittee:
""" """
Return the sync committee for a given ``state`` and ``epoch``. Return the sync committee for a given ``state`` and ``epoch``.
``SyncCommittee`` contains an aggregate pubkey that enables
resource-constrained clients to save some computation when verifying
the sync committee's signature.
``SyncCommittee`` can also contain duplicate pubkeys, when ``get_sync_committee_indices``
returns duplicate indices. Implementations must take care when handling
optimizations relating to aggregation and verification in the presence of duplicates.
""" """
indices = get_sync_committee_indices(state, epoch) indices = get_sync_committee_indices(state, epoch)
pubkeys = [state.validators[index].pubkey for index in indices] pubkeys = [state.validators[index].pubkey for index in indices]