Update beacon-chain.md

This commit is contained in:
Justin 2021-03-19 10:04:46 +00:00 committed by GitHub
parent 208a658305
commit 053661ad20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -294,8 +294,8 @@ def get_sync_committee(state: BeaconState, epoch: Epoch) -> SyncCommittee:
"""
indices = get_sync_committee_indices(state, epoch)
pubkeys = [state.validators[index].pubkey for index in indices]
subcommitees = [pubkeys[i:i + SYNC_PUBKEY_AGGREGATE_SIZE] for i in range(0, len(pubkeys), SYNC_PUBKEY_AGGREGATE_SIZE)]
pubkey_aggregates = [bls.AggregatePKs(subcommitee) for subcommitee in subcommitees]
partition = [pubkeys[i:i + SYNC_PUBKEY_AGGREGATE_SIZE] for i in range(0, len(pubkeys), SYNC_PUBKEY_AGGREGATE_SIZE)]
pubkey_aggregates = [bls.AggregatePKs(preaggregate) for preaggregate in partition]
return SyncCommittee(pubkeys=pubkeys, pubkey_aggregates=pubkey_aggregates)
```