Warn about potential overflows in compute_time_at_slot

This commit is contained in:
Mikhail Kalinin 2021-04-14 12:53:30 +06:00
parent dbbc63b7a3
commit 7d8570d488

View File

@ -168,6 +168,8 @@ def is_transition_block(state: BeaconState, block_body: BeaconBlockBody) -> bool
#### `compute_time_at_slot`
*Note*: This function is unsafe with respect to overflows and underflows.
```python
def compute_time_at_slot(state: BeaconState, slot: Slot) -> uint64:
slots_since_genesis = slot - GENESIS_SLOT