Created
January 11, 2021 08:18
-
-
Save alonmuroch/c2dc5eaa32943273de26f8b2c016cfcd to your computer and use it in GitHub Desktop.
get_base_reward
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_base_reward(state: BeaconState, index: ValidatorIndex) -> Gwei: | |
total_balance = get_total_active_balance(state) | |
effective_balance = state.validators[index].effective_balance | |
return Gwei(effective_balance * BASE_REWARD_FACTOR // integer_squareroot(total_balance) // BASE_REWARDS_PER_EPOCH) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment