Merge pull request #744 from ethereum/empty-attestation-bug
minor execution bugs
This commit is contained in:
commit
641bfc2f2c
|
@ -1882,8 +1882,7 @@ def get_base_reward(state: BeaconState, index: ValidatorIndex) -> Gwei:
|
||||||
```
|
```
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def get_inactivity_penalty(state: BeaconState, index: ValidatorIndex) -> Gwei:
|
def get_inactivity_penalty(state: BeaconState, index: ValidatorIndex, epochs_since_finality: int) -> Gwei:
|
||||||
epochs_since_finality = get_current_epoch(state) + 1 - state.finalized_epoch
|
|
||||||
return (
|
return (
|
||||||
get_base_reward(state, index) +
|
get_base_reward(state, index) +
|
||||||
get_effective_balance(state, index) * epochs_since_finality // INACTIVITY_PENALTY_QUOTIENT // 2
|
get_effective_balance(state, index) * epochs_since_finality // INACTIVITY_PENALTY_QUOTIENT // 2
|
||||||
|
@ -1943,6 +1942,7 @@ def compute_normal_justification_and_finalization_deltas(state: BeaconState) ->
|
||||||
else:
|
else:
|
||||||
deltas[1][index] += get_base_reward(state, index)
|
deltas[1][index] += get_base_reward(state, index)
|
||||||
# Proposer bonus
|
# Proposer bonus
|
||||||
|
if index in get_attesting_indices(state, state.previous_epoch_attestations):
|
||||||
proposer_index = get_beacon_proposer_index(state, inclusion_slot(state, index))
|
proposer_index = get_beacon_proposer_index(state, inclusion_slot(state, index))
|
||||||
deltas[0][proposer_index] += get_base_reward(state, index) // ATTESTATION_INCLUSION_REWARD_QUOTIENT
|
deltas[0][proposer_index] += get_base_reward(state, index) // ATTESTATION_INCLUSION_REWARD_QUOTIENT
|
||||||
return deltas
|
return deltas
|
||||||
|
|
Loading…
Reference in New Issue