Embiggened sync committee size and added sub-aggregates

This commit is contained in:
vbuterin 2020-11-25 19:38:45 +08:00 committed by GitHub
parent 09ec58131d
commit 5bfe61f865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -47,7 +47,8 @@ This is a standalone beacon chain patch adding light client support via sync com
| Name | Value | | Name | Value |
| - | - | | - | - |
| `SYNC_COMMITTEE_SIZE` | `uint64(2**8)` (= 256) | | `SYNC_COMMITTEE_SIZE` | `uint64(2**10)` (= 1024) |
| `SYNC_PUBKEY_AGGREGATION_INTERVAL` | `uint64(2**6)` (= 64) |
### Time parameters ### Time parameters
@ -90,7 +91,7 @@ class BeaconState(phase0.BeaconState):
```python ```python
class SyncCommittee(Container): class SyncCommittee(Container):
pubkeys: Vector[BLSPubkey, SYNC_COMMITTEE_SIZE] pubkeys: Vector[BLSPubkey, SYNC_COMMITTEE_SIZE]
pubkeys_aggregate: BLSPubkey pubkey_aggregates: Vector[BLSPubkey, SYNC_COMMITTEE_SIZE // SYNC_PUBKEY_AGGREGATION_INTERVAL]
``` ```
## Helper functions ## Helper functions
@ -130,7 +131,11 @@ def get_sync_committee(state: BeaconState, epoch: Epoch) -> SyncCommittee:
indices = get_sync_committee_indices(state, epoch) indices = get_sync_committee_indices(state, epoch)
validators = [state.validators[index] for index in indices] validators = [state.validators[index] for index in indices]
pubkeys = [validator.pubkey for validator in validators] pubkeys = [validator.pubkey for validator in validators]
return SyncCommittee(pubkeys, bls.AggregatePKs(pubkeys)) aggregates = [
bls.AggregatePKs(pubkeys[i:i+SYNC_PUBKEY_AGGREGATION_INTERVAL])
for i in range(0, len(pubkeys), SYNC_PUBKEY_AGGREGATION_INTERVAL)
]
return SyncCommittee(pubkeys, aggregates)
``` ```
### Block processing ### Block processing