mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-31 12:55:24 +00:00
add note about total balance overflowing
This commit is contained in:
parent
882b9ee035
commit
1579072e15
@ -954,6 +954,7 @@ def get_beacon_proposer_index(state: BeaconState) -> ValidatorIndex:
|
||||
def get_total_balance(state: BeaconState, indices: Set[ValidatorIndex]) -> Gwei:
|
||||
"""
|
||||
Return the combined effective balance of the ``indices``. (1 Gwei minimum to avoid divisions by zero.)
|
||||
Math safe up to ~10B ETH, afterwhich this overflows uint64.
|
||||
"""
|
||||
return Gwei(max(1, sum([state.validators[index].effective_balance for index in indices])))
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user