From 5bfe61f86567511ddb8e07179b7cb390c1f99357 Mon Sep 17 00:00:00 2001 From: vbuterin Date: Wed, 25 Nov 2020 19:38:45 +0800 Subject: [PATCH] Embiggened sync committee size and added sub-aggregates --- specs/lightclient/beacon-chain.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/specs/lightclient/beacon-chain.md b/specs/lightclient/beacon-chain.md index 19ca9c85b..c218a09bd 100644 --- a/specs/lightclient/beacon-chain.md +++ b/specs/lightclient/beacon-chain.md @@ -47,7 +47,8 @@ This is a standalone beacon chain patch adding light client support via sync com | 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 @@ -90,7 +91,7 @@ class BeaconState(phase0.BeaconState): ```python class SyncCommittee(Container): pubkeys: Vector[BLSPubkey, SYNC_COMMITTEE_SIZE] - pubkeys_aggregate: BLSPubkey + pubkey_aggregates: Vector[BLSPubkey, SYNC_COMMITTEE_SIZE // SYNC_PUBKEY_AGGREGATION_INTERVAL] ``` ## Helper functions @@ -130,7 +131,11 @@ def get_sync_committee(state: BeaconState, epoch: Epoch) -> SyncCommittee: indices = get_sync_committee_indices(state, epoch) validators = [state.validators[index] for index in indices] 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