fix: missed rewards for attestations #281
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current calculation algorithm of missed rewards for attestations is working incorrectly for validators with a max effective balance greater than 32. As a result of this calculation, the value of the missed attestation reward for such validators might be negative. The attempt to store a negative value of missed attestation reward to the DB causes failures that lead to a complete inability to update the "validators_summary" table and loss of data about all validators in the epoch where this calculation error happened.
The calculation of missed attestation rewards for 0x02 validators is temporarily disabled until we understand better how to calculate missed attestation rewards for all types of validators.