ethereum / beacon_chain

MIT License
209 stars 65 forks source link

enforce maximum committees per slot #125

Closed hwwhww closed 5 years ago

hwwhww commented 5 years ago

Issue

As https://github.com/ethereum/eth2.0-specs/pull/12, the maximum number of committees per slot should not exceed SHARD_COUNT // CYCLE_LENGTH

Proposed Implementation

Update get_new_shuffling function as the spec: committees_per_slot = len(avs) // cycle_length // (min_committee_size * 2) + 1 -> committees_per_slot = min(len(avs) // cycle_length // (min_committee_size * 2) + 1, shard_count // cycle_length)

djrtwo commented 5 years ago

Probably want a test here that shows even len(avs) gets really big that the total number of committees output by the shuffling is never greater than shard_count