Skip to content

Commit

Permalink
Merge pull request #744 from ethereum/empty-attestation-bug
Browse files Browse the repository at this point in the history
minor execution bugs
  • Loading branch information
djrtwo authored Mar 10, 2019
2 parents 0f3e0ef + 30e64d7 commit 641bfc2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -1882,8 +1882,7 @@ def get_base_reward(state: BeaconState, index: ValidatorIndex) -> Gwei:
```

```python
def get_inactivity_penalty(state: BeaconState, index: ValidatorIndex) -> Gwei:
epochs_since_finality = get_current_epoch(state) + 1 - state.finalized_epoch
def get_inactivity_penalty(state: BeaconState, index: ValidatorIndex, epochs_since_finality: int) -> Gwei:
return (
get_base_reward(state, index) +
get_effective_balance(state, index) * epochs_since_finality // INACTIVITY_PENALTY_QUOTIENT // 2
Expand Down Expand Up @@ -1943,8 +1942,9 @@ def compute_normal_justification_and_finalization_deltas(state: BeaconState) ->
else:
deltas[1][index] += get_base_reward(state, index)
# Proposer bonus
proposer_index = get_beacon_proposer_index(state, inclusion_slot(state, index))
deltas[0][proposer_index] += get_base_reward(state, index) // ATTESTATION_INCLUSION_REWARD_QUOTIENT
if index in get_attesting_indices(state, state.previous_epoch_attestations):
proposer_index = get_beacon_proposer_index(state, inclusion_slot(state, index))
deltas[0][proposer_index] += get_base_reward(state, index) // ATTESTATION_INCLUSION_REWARD_QUOTIENT
return deltas
```

Expand Down

0 comments on commit 641bfc2

Please sign in to comment.