get_randao_mix slot boundary fix

This commit is contained in:
vbuterin 2019-01-10 22:34:13 -06:00 committed by GitHub
parent 70c0cc43c5
commit 459734cb9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -966,8 +966,8 @@ def get_randao_mix(state: BeaconState,
"""
Returns the randao mix at a recent ``slot``.
"""
assert state.slot <= slot + LATEST_RANDAO_MIXES_LENGTH
assert slot < state.slot
assert state.slot < slot + LATEST_RANDAO_MIXES_LENGTH
assert slot <= state.slot
return state.latest_block_roots[slot % LATEST_RANDAO_MIXES_LENGTH]
```