add comment for helper -- has_enouh_for_reward

This commit is contained in:
Danny Ryan 2020-05-05 09:43:25 -06:00
parent 3f250f7dd3
commit f35106d9ee
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A

View File

@ -10,6 +10,12 @@ class Deltas(Container):
def has_enough_for_reward(spec, state, index):
"""
Check if base_reward will be non-zero.
At very low balances, it is possible for a validator have a positive effective_balance
but a zero base reward.
"""
return (
state.validators[index].effective_balance * spec.BASE_REWARD_FACTOR
> spec.integer_squareroot(spec.get_total_active_balance(state)) // spec.BASE_REWARDS_PER_EPOCH