Skip to content

Commit

Permalink
Merge pull request #2255 from ralexstokes/update-subcommittee-name
Browse files Browse the repository at this point in the history
Use different name for constant for sync committee aggregates
  • Loading branch information
djrtwo authored Mar 22, 2021
2 parents 3a5f0e9 + 484fae3 commit d49cddc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configs/mainnet/altair.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR: 2
# 2**10 (= 1,024)
SYNC_COMMITTEE_SIZE: 1024
# 2**6 (= 64)
SYNC_SUBCOMMITTEE_SIZE: 64
SYNC_PUBKEYS_PER_AGGREGATE: 64
# 2**2 (= 4)
INACTIVITY_SCORE_BIAS: 4

Expand Down
2 changes: 1 addition & 1 deletion configs/minimal/altair.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR: 2
# [customized]
SYNC_COMMITTEE_SIZE: 32
# [customized]
SYNC_SUBCOMMITTEE_SIZE: 16
SYNC_PUBKEYS_PER_AGGREGATE: 16
# 2**2 (= 4)
INACTIVITY_SCORE_BIAS: 4

Expand Down
8 changes: 4 additions & 4 deletions specs/altair/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ This patch updates a few configuration values to move penalty parameters toward
| Name | Value |
| - | - |
| `SYNC_COMMITTEE_SIZE` | `uint64(2**10)` (= 1,024) |
| `SYNC_SUBCOMMITTEE_SIZE` | `uint64(2**6)` (= 64) |
| `SYNC_PUBKEYS_PER_AGGREGATE` | `uint64(2**6)` (= 64) |
| `INACTIVITY_SCORE_BIAS` | `uint64(4)` |

### Time parameters
Expand Down Expand Up @@ -210,7 +210,7 @@ class SyncAggregate(Container):
```python
class SyncCommittee(Container):
pubkeys: Vector[BLSPubkey, SYNC_COMMITTEE_SIZE]
pubkey_aggregates: Vector[BLSPubkey, SYNC_COMMITTEE_SIZE // SYNC_SUBCOMMITTEE_SIZE]
pubkey_aggregates: Vector[BLSPubkey, SYNC_COMMITTEE_SIZE // SYNC_PUBKEYS_PER_AGGREGATE]
```

## Helper functions
Expand Down Expand Up @@ -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_SUBCOMMITTEE_SIZE] for i in range(0, len(pubkeys), SYNC_SUBCOMMITTEE_SIZE)]
pubkey_aggregates = [bls.AggregatePKs(subcommitee) for subcommitee in subcommitees]
partition = [pubkeys[i:i + SYNC_PUBKEYS_PER_AGGREGATE] for i in range(0, len(pubkeys), SYNC_PUBKEYS_PER_AGGREGATE)]
pubkey_aggregates = [bls.AggregatePKs(preaggregate) for preaggregate in partition]
return SyncCommittee(pubkeys=pubkeys, pubkey_aggregates=pubkey_aggregates)
```

Expand Down

0 comments on commit d49cddc

Please sign in to comment.