From 541f33094fd02294e27930730eb6f71db2061c55 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Wed, 12 Dec 2018 09:14:44 -0600 Subject: [PATCH] move rewards helpers to rewrds and penalties section --- specs/core/0_beacon-chain.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 9bf68e341..f9edb7d02 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1470,9 +1470,6 @@ All [validators](#dfn-validator): * Let `active_validators = [state.validator_registry[i] for i in get_active_validator_indices(state.validator_registry)]`. * Let `total_balance = sum([get_effective_balance(v) for v in active_validators])`. -* Let `base_reward_quotient = BASE_REWARD_QUOTIENT * integer_squareroot(total_balance // GWEI_PER_ETH)`. -* Let `base_reward(v) = get_effective_balance(v) // base_reward_quotient // 4` for any validator `v`. -* Let `base_inactivity_penalty(v, slots_since_finality) = base_reward(v) + get_effective_balance(v) * slots_since_finality // INACTIVITY_PENALTY_QUOTIENT` for any validator `v`. [Validators](#dfn-Validator) validators attesting during the current epoch: @@ -1557,6 +1554,12 @@ For every `shard_committee` in `state.shard_committees_at_slots`: ### Rewards and penalties +First, we define some additional helpers: + +* Let `base_reward_quotient = BASE_REWARD_QUOTIENT * integer_squareroot(total_balance // GWEI_PER_ETH)`. +* Let `base_reward(v) = get_effective_balance(v) // base_reward_quotient // 4` for any validator `v`. +* Let `base_inactivity_penalty(v, slots_since_finality) = base_reward(v) + get_effective_balance(v) * slots_since_finality // INACTIVITY_PENALTY_QUOTIENT` for any validator `v`. + #### Justification and finalization Note: When applying penalties in the following balance recalculations implementers should make sure the `uint64` does not underflow.