From 1579072e15e564904e41252f7db4ed5d1a04c057 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Tue, 10 Mar 2020 13:12:17 -0600 Subject: [PATCH] add note about total balance overflowing --- specs/phase0/beacon-chain.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/phase0/beacon-chain.md b/specs/phase0/beacon-chain.md index a90a8aa1a..b2b96de9d 100644 --- a/specs/phase0/beacon-chain.md +++ b/specs/phase0/beacon-chain.md @@ -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]))) ```