Update 0_beacon-chain.md
This commit is contained in:
parent
4442dfffb9
commit
23d15f51a7
|
@ -1014,14 +1014,14 @@ def get_beacon_proposer_index(state: BeaconState,
|
||||||
|
|
||||||
assert previous_epoch <= epoch <= next_epoch
|
assert previous_epoch <= epoch <= next_epoch
|
||||||
|
|
||||||
first_committee, _ = get_crosslink_committees_at_slot(state, slot, registry_change)[0] i = 0
|
first_committee, _ = get_crosslink_committees_at_slot(state, slot, registry_change)[0]
|
||||||
while i < len(first_committee):
|
i = 0
|
||||||
|
while True:
|
||||||
rand_byte = hash(generate_seed(get_current_epoch(state)) + int_to_bytes8(i // 32))[i % 32]
|
rand_byte = hash(generate_seed(get_current_epoch(state)) + int_to_bytes8(i // 32))[i % 32]
|
||||||
candidate = first_committee[(epoch % i) % len(first_committee)]
|
candidate = first_committee[(epoch % i) % len(first_committee)]
|
||||||
if get_effective_balance(state, candidate) * 256 > MAX_DEPOSIT_AMOUNT * rand_byte:
|
if get_effective_balance(state, candidate) * 256 > MAX_DEPOSIT_AMOUNT * rand_byte:
|
||||||
return candidate
|
return candidate
|
||||||
i += 1
|
i += 1
|
||||||
return first_committee[epoch % len(first_committee)]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### `verify_merkle_branch`
|
### `verify_merkle_branch`
|
||||||
|
|
Loading…
Reference in New Issue