From 33552279bf218b109ad42f76408aa7c122544adf Mon Sep 17 00:00:00 2001 From: ericsson Date: Mon, 23 Aug 2021 20:09:01 +0300 Subject: [PATCH 1/2] Fix typos in `get_shard_proposer_index`: `beacon_state` vs `state` --- specs/sharding/beacon-chain.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/sharding/beacon-chain.md b/specs/sharding/beacon-chain.md index 031d8087f..0249590b8 100644 --- a/specs/sharding/beacon-chain.md +++ b/specs/sharding/beacon-chain.md @@ -503,14 +503,14 @@ def get_active_shard_count(state: BeaconState, epoch: Epoch) -> uint64: #### `get_shard_proposer_index` ```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``. """ 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) - return compute_proposer_index(beacon_state, indices, seed) + return compute_proposer_index(state, indices, seed) ``` #### `get_start_shard` From 34d42b640d8cc72d11df3af4c3935bc619eac71c Mon Sep 17 00:00:00 2001 From: ericsson Date: Mon, 23 Aug 2021 20:09:41 +0300 Subject: [PATCH 2/2] Fix typo in `get_start_shard` --- specs/sharding/beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/sharding/beacon-chain.md b/specs/sharding/beacon-chain.md index 0249590b8..f54394275 100644 --- a/specs/sharding/beacon-chain.md +++ b/specs/sharding/beacon-chain.md @@ -520,7 +520,7 @@ def get_start_shard(state: BeaconState, slot: Slot) -> Shard: """ 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) active_shard_count = get_active_shard_count(state, epoch) return committee_count * slot % active_shard_count