mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-27 10:54:47 +00:00
add comment for helper -- has_enouh_for_reward
This commit is contained in:
parent
3f250f7dd3
commit
f35106d9ee
@ -10,6 +10,12 @@ class Deltas(Container):
|
|||||||
|
|
||||||
|
|
||||||
def has_enough_for_reward(spec, state, index):
|
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 (
|
return (
|
||||||
state.validators[index].effective_balance * spec.BASE_REWARD_FACTOR
|
state.validators[index].effective_balance * spec.BASE_REWARD_FACTOR
|
||||||
> spec.integer_squareroot(spec.get_total_active_balance(state)) // spec.BASE_REWARDS_PER_EPOCH
|
> spec.integer_squareroot(spec.get_total_active_balance(state)) // spec.BASE_REWARDS_PER_EPOCH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user