From 9a83ad7b9bdda1058433035d24559136a7a9e466 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Thu, 3 Jan 2019 14:28:36 -0600 Subject: [PATCH] Fix a type error with units of wei when determining ejection balance. `EJECTION_BALANCE` is in units of ETH. `state.validator_balances[index]` is in units of Gwei. For the ejection computation to work as desired, we need to convert the `EJECTION_BALANCE` constant from ETH to Gwei. --- specs/core/0_beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 7e2bbe83f..5c26069ff 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1690,7 +1690,7 @@ def process_ejections(state: BeaconState) -> None: and eject active validators with balance below ``EJECTION_BALANCE``. """ for index in active_validator_indices(state.validator_registry): - if state.validator_balances[index] < EJECTION_BALANCE: + if state.validator_balances[index] < EJECTION_BALANCE * GWEI_PER_ETH: update_validator_status(state, index, new_status=EXITED_WITHOUT_PENALTY) ```