Moved two calculations back to the FFG reward section

This commit is contained in:
vbuterin 2018-11-26 18:44:29 -05:00 committed by GitHub
parent 3b7164c2d6
commit f2af5fd9df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -1038,11 +1038,6 @@ def adjust_for_inclusion_distance(magnitude: int, dist: int) -> int:
For any validator `v`, `base_reward(v) = balance_at_stake(v) // reward_quotient`
Miscellaneous:
* Let `quadratic_penalty_quotient = SQRT_E_DROP_TIME**2`. (The portion lost by offline validators after `D` cycles is about `D*D/2/quadratic_penalty_quotient`.)
* Let `time_since_finality = block.slot - state.last_finalized_slot`.
#### Adjust justified slots and crosslink status
* Set `state.justified_slot_bitfield = (state.justified_slot_bitfield * 2) % 2**64`.
@ -1061,6 +1056,9 @@ For every `ShardAndCommittee` object `obj`:
Note: When applying penalties in the following balance recalculations implementers should make sure the `uint64` does not underflow.
* Let `quadratic_penalty_quotient = SQRT_E_DROP_TIME**2`. (The portion lost by offline validators after `D` cycles is about `D*D/2/quadratic_penalty_quotient`.)
* Let `time_since_finality = block.slot - state.last_finalized_slot`.
Case 1: `time_since_finality <= 4 * CYCLE_LENGTH`:
* Any validator `v` in `prev_cycle_boundary_attesters` gains `adjust_for_inclusion_distance(base_reward(v) * prev_cycle_boundary_attesting_balance // total_balance, inclusion_distance(v))`.