You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attestation rewards calculator has a bug where it doesn't update justification and finalization (process_justification_and_finalization) prior to calculating attestation rewards.
This causes faulty output for epoch N - 1 when finality is restored at the end of epoch N. In this case, the is_in_inactivity_leak predicate should be false (because finality has just been restored), but our code will set it to true because it hasn't computed justification & finalization.
On mainnet this occurs at epoch 200759 (i.e. finality restored at the end of 200760).
Relevant code (see earlier in this function for the lack of justification/finalization processing):
We should probably just run process_justification_and_finalization at the start of attestation rewards calculation. I don't think this should interfere with the block v3 API, as it only needs to calculate the proposer's block reward, which is independent of is_in_inactivity_leak, and shouldn't share code with the attestation rewards calculations.
The text was updated successfully, but these errors were encountered:
michaelsproul
changed the title
Attestation rewards API doesn't update justification and finalization
Attestation rewards API doesn't account for justification and finalization
Oct 19, 2023
Description
The attestation rewards calculator has a bug where it doesn't update justification and finalization (
process_justification_and_finalization
) prior to calculating attestation rewards.This causes faulty output for epoch
N - 1
when finality is restored at the end of epochN
. In this case, theis_in_inactivity_leak
predicate should befalse
(because finality has just been restored), but our code will set it totrue
because it hasn't computed justification & finalization.On mainnet this occurs at epoch
200759
(i.e. finality restored at the end of200760
).Relevant code (see earlier in this function for the lack of justification/finalization processing):
lighthouse/beacon_node/beacon_chain/src/attestation_rewards.rs
Lines 169 to 174 in 441fc16
Version
Lighthouse v4.5.0
Steps to resolve
We should probably just run
process_justification_and_finalization
at the start of attestation rewards calculation. I don't think this should interfere with the block v3 API, as it only needs to calculate the proposer's block reward, which is independent ofis_in_inactivity_leak
, and shouldn't share code with the attestation rewards calculations.The text was updated successfully, but these errors were encountered: