-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add inactivity
penalties to Altair attestation rewards endpoint response
#4512
Comments
@jimmygchen I am seeing inactivity field in the API response for Altair using version 4.5.0 node. Is the inactivity field correctly calculated in Altair and later versions? |
@jimmygchen Also, I am not seeing inclusion_delay field for anything besides phase0. Not sure if this is expected behavior or needs to be implemented for Altair and later versions? |
@zack-scott The |
@jimmygchen okay, I was just wanting to ensure that the inactivity calculation is missing just on Altair only. Just to clarify, Phase0, Bellatrix, and Capella versions do have the correct inactivity calculation in place? This match statement seems to point Altair, Bellatrix, and Capella toward the compute_attestation_rewards_altair function |
@jimmygchen if the above comments sound correct to you, I would like to try and implement this if that is okay? I may need some guidance though as I am a newcomer to this project, but I believe something like this may work for the this issue:
I am using the inactivity penalty formula found in the Eth2 Book The code snippet above is within the compute_attestation_rewards_altair function, which means the BeaconState::Base(_) shouldn't ever be executed here, but the match statement required for me to insert that arm. |
Hi @zack-scott That would be great! I haven't really look into the Altair calculation in depth, but happy to look into it and try to answer any questions.
Yes that's right, the inactivity penalty calculation is missing on all post-Altair versions. We already have a way to calculate the inactivity penalty in a generic way, so you probably won't need to worry about adding this match arm, instead you could use lighthouse/consensus/state_processing/src/per_epoch_processing/altair/rewards_and_penalties.rs Lines 119 to 128 in f2223fe
If there's a way you could re-use the some of the functionalities in It would be nice to verify the calculation results your calculation with a similar test like this one (but for post-altair):
Let me know if you have any questions! |
@jimmygchen thank you, I will work on getting the generic calculation and tests added. |
## Issue Addressed #4512 Which issue # does this PR address? ## Proposed Changes Add inactivity calculation for Altair Please list or describe the changes introduced by this PR. Add inactivity calculation for Altair ## Additional Info Please provide any additional information. For example, future considerations or information useful for reviewers. Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
## Issue Addressed #4512 Which issue # does this PR address? ## Proposed Changes Add inactivity calculation for Altair Please list or describe the changes introduced by this PR. Add inactivity calculation for Altair ## Additional Info Please provide any additional information. For example, future considerations or information useful for reviewers. Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
## Issue Addressed #4512 Which issue # does this PR address? ## Proposed Changes Add inactivity calculation for Altair Please list or describe the changes introduced by this PR. Add inactivity calculation for Altair ## Additional Info Please provide any additional information. For example, future considerations or information useful for reviewers. Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
Completed in #4807 🎉 Thank you @zack-scott |
Description
A new
inactivity
field has been introduced to the attestation rewards endpoint response in #4474 for Phase 0, to include the inactivity penalty which is not part of thehead
/target
/souce
rewards. This hasn't been added to Altair and the implementation needs to be updated.Example response
The text was updated successfully, but these errors were encountered: