Merge pull request #2565 from ericsson49/ericsson49/fix_typos_in_sharding_2

Fix typos in `sharding/beacon-chain.md`
This commit is contained in:
Danny Ryan 2021-08-23 12:14:12 -06:00 committed by GitHub
commit dfef7fc442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -503,14 +503,14 @@ def get_active_shard_count(state: BeaconState, epoch: Epoch) -> uint64:
#### `get_shard_proposer_index` #### `get_shard_proposer_index`
```python ```python
def get_shard_proposer_index(beacon_state: BeaconState, slot: Slot, shard: Shard) -> ValidatorIndex: def get_shard_proposer_index(state: BeaconState, slot: Slot, shard: Shard) -> ValidatorIndex:
""" """
Return the proposer's index of shard block at ``slot``. Return the proposer's index of shard block at ``slot``.
""" """
epoch = compute_epoch_at_slot(slot) epoch = compute_epoch_at_slot(slot)
seed = hash(get_seed(beacon_state, epoch, DOMAIN_SHARD_BLOB) + uint_to_bytes(slot) + uint_to_bytes(shard)) seed = hash(get_seed(state, epoch, DOMAIN_SHARD_BLOB) + uint_to_bytes(slot) + uint_to_bytes(shard))
indices = get_active_validator_indices(state, epoch) indices = get_active_validator_indices(state, epoch)
return compute_proposer_index(beacon_state, indices, seed) return compute_proposer_index(state, indices, seed)
``` ```
#### `get_start_shard` #### `get_start_shard`
@ -520,7 +520,7 @@ def get_start_shard(state: BeaconState, slot: Slot) -> Shard:
""" """
Return the start shard at ``slot``. Return the start shard at ``slot``.
""" """
epoch = compute_epoch_at_slot(Slot(_slot)) epoch = compute_epoch_at_slot(Slot(slot))
committee_count = get_committee_count_per_slot(state, epoch) committee_count = get_committee_count_per_slot(state, epoch)
active_shard_count = get_active_shard_count(state, epoch) active_shard_count = get_active_shard_count(state, epoch)
return committee_count * slot % active_shard_count return committee_count * slot % active_shard_count