Fixed some variable names

This commit is contained in:
vbuterin 2019-03-17 06:25:56 -05:00 committed by GitHub
parent b566722b52
commit 1967a8939d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -69,14 +69,14 @@ A light client will keep track of:
* A random `shard_id` in `[0...SHARD_COUNT-1]` (selected once and retained forever) * A random `shard_id` in `[0...SHARD_COUNT-1]` (selected once and retained forever)
* A block header that they consider to be finalized (`finalized_header`) and do not expect to revert. * A block header that they consider to be finalized (`finalized_header`) and do not expect to revert.
* `later_period_data = get_maximal_later_committee(finalized_header, shard_id)` * `later_period_data = get_later_period_data(finalized_header, shard_id)`
* `earlier_period_data = get_maximal_earlier_committee(finalized_header, shard_id)` * `earlier_period_data = get_earlier_period_data(finalized_header, shard_id)`
We use the struct `validator_memory` to keep track of these variables. We use the struct `validator_memory` to keep track of these variables.
### Updating the shuffled committee ### Updating the shuffled committee
If a client's `validator_memory.finalized_header` changes so that `header.slot // PERSISTENT_COMMITTEE_PERIOD` increases, then the client can ask the network for a `new_committee_proof = MerklePartial(get_maximal_later_committee, validator_memory.finalized_header, shard_id)`. It can then compute: If a client's `validator_memory.finalized_header` changes so that `header.slot // PERSISTENT_COMMITTEE_PERIOD` increases, then the client can ask the network for a `new_committee_proof = MerklePartial(get_later_period_data, validator_memory.finalized_header, shard_id)`. It can then compute:
```python ```python
earlier_period_data = later_period_data earlier_period_data = later_period_data
@ -95,13 +95,13 @@ def compute_committee(header: BeaconBlockHeader,
earlier_validator_count = validator_memory.earlier_period_data.validator_count earlier_validator_count = validator_memory.earlier_period_data.validator_count
later_validator_count = validator_memory.later_period_data.validator_count later_validator_count = validator_memory.later_period_data.validator_count
earlier_committee = validator_memory.earlier_period_data.committee maximal_earlier_committee = validator_memory.earlier_period_data.committee
later_committee = validator_memory.later_period_data.committee maximal_later_committee = validator_memory.later_period_data.committee
earlier_start_epoch = get_earlier_start_epoch(header.slot) earlier_start_epoch = get_earlier_start_epoch(header.slot)
later_start_epoch = get_later_start_epoch(header.slot) later_start_epoch = get_later_start_epoch(header.slot)
epoch = slot_to_epoch(header.slot) epoch = slot_to_epoch(header.slot)
actual_committee_count = max( committee_count = max(
earlier_validator_count // (SHARD_COUNT * TARGET_COMMITTEE_SIZE), earlier_validator_count // (SHARD_COUNT * TARGET_COMMITTEE_SIZE),
later_validator_count // (SHARD_COUNT * TARGET_COMMITTEE_SIZE), later_validator_count // (SHARD_COUNT * TARGET_COMMITTEE_SIZE),
) + 1 ) + 1