Skip to content

Update proposer_slashings and attester_slashings amounts for electra. #7316

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

Merged

Conversation

jybp
Copy link
Contributor

@jybp jybp commented Apr 11, 2025

Issue Addressed

Did not find a specific issue beside #6821

Proposed Changes

Leverage whistleblower_reward_quotient_for_state to have accurate post-electra proposer_slashings and attester_slashings fields returned by /eth/v1/beacon/rewards/blocks/<id>.

Additional Info

While testing on Hoodi RPCs I noticed the amounts returned were wrong.

Example https://dora.hoodi.ethpandaops.io/slot/151980
/eth/v1/beacon/rewards/blocks/151980 returns "proposer_slashings":"4000000000" (4ETH) instead of 0,5ETH.

@CLAassistant
Copy link

CLAassistant commented Apr 11, 2025

CLA assistant check
All committers have signed the CLA.

@michaelsproul
Copy link
Member

Good catch, thanks!

The final merge window for v7.0.0 has passed (unless it's a serious bug), so this would most likely be included in v7.1.0. Does that work for you?

v7.0.0 is here for reference:

Planning to release early next week.

@michaelsproul michaelsproul added HTTP-API rewards-api Implementation of the rewards API labels Apr 11, 2025
@jybp
Copy link
Contributor Author

jybp commented Apr 11, 2025

Does that work for you?

Yes that is great, thanks a lot for the responsiveness.

Planning to release early next week.

I would like to also open a PR to get the /eth/v1/beacon/states/{state_id}/pending_consolidations endpoint in as well ASAP: ethereum/beacon-APIs#512
Which is missing from https://github.com/sigp/lighthouse/blob/unstable/beacon_node/http_api/src/lib.rs/#L1115

@jybp
Copy link
Contributor Author

jybp commented Apr 11, 2025

test-suite / check-code (pull_request)

error: 1 vulnerability found!
warning: 8 allowed warnings found
make: *** [Makefile:253: audit-CI] Error 1

@jybp
Copy link
Contributor Author

jybp commented Apr 11, 2025

The final merge window for v7.0.0 has passed (unless it's a serious bug), so this would most likely be included in v7.1.0. Does that work for you?

What is the timeline for v7.1.0?
As long as it's sooner than the mainnet fork (2025-05-07 AFAIK) then it should be fine.

@michaelsproul
Copy link
Member

I would like to also open a PR to get the /eth/v1/beacon/states/{state_id}/pending_consolidations endpoint in as well ASAP

This has been already merged to v7.0.0 in:

What is the timeline for v7.1.0?
As long as it's sooner that the mainnet fork (2025-05-07 AFAIK) then it should be fine.

There's no concrete timeline. It probably won't be before the mainnet fork.

If you retarget your branch at release-v7.0.0 I can include it in v7.0.0 seeing as it is low-risk. The rewards API is intentionally kept separate from our actual consensus code (which is also why it wasn't updated, which is unfortunate, but we can add some more tests to ensure it stays up to date).

@michaelsproul michaelsproul added v7.0.0 New release c. Q1 2025 waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Apr 11, 2025
@jybp
Copy link
Contributor Author

jybp commented Apr 11, 2025

This has been already merged to v7.0.0 in: #7290

Ah great missed it 👍

I can include it in v7.0.0 seeing as it is low-risk

Yes then it would be great. I rely on rewards endpoints (attestations / sync_committee / block) for reporting purposes.

This is my first contribution to the codebase so would love for a maintainer to confirm that's correct and there's no unintended side-effects:

The two call sites:

https://github.com/sigp/lighthouse/blob/39eb8145f89e11e3fd3a6c9c3d1031e8772ac491/beacon_node/http_api/src/block_rewards.rs/#L63-L73
https://github.com/sigp/lighthouse/blob/39eb8145f89e11e3fd3a6c9c3d1031e8772ac491/beacon_node/beacon_chain/src/block_verification.rs/#L1593-L1605

The rewards API is intentionally kept separate from our actual consensus code (which is also why it wasn't updated, which is unfortunate, but we can add some more tests to ensure it stays up to date).

That's reassuring as far as side effects goes 👍

@michaelsproul
Copy link
Member

Btw the CI failure on unstable was just fixed by:

And was already fixed on release-v7.0.0 by:

@jybp jybp changed the base branch from unstable to release-v7.0.0 April 11, 2025 12:45
@jybp jybp requested a review from jxs as a code owner April 11, 2025 12:46
Copy link

mergify bot commented Apr 11, 2025

This pull request has merge conflicts. Could you please resolve them @jybp? 🙏

@jybp jybp force-pushed the update-bloc-rewards-rpc-slashing-fields branch from c19d3d9 to 8e8417c Compare April 11, 2025 12:47
@jybp
Copy link
Contributor Author

jybp commented Apr 11, 2025

If you retarget your branch at release-v7.0.0 I can include it in v7.0.0 seeing as it is low-risk. The rewards API is intentionally kept separate from our actual consensus code (which is also why it wasn't updated, which is unfortunate, but we can add some more tests to ensure it stays up to date).

Added on top of release-v7.0.0.

@michaelsproul
Copy link
Member

I'll give this a proper review on Monday. It's 11pm friday in my tz so I'm logging off

@michaelsproul michaelsproul added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Apr 11, 2025
@michaelsproul
Copy link
Member

Hi @jyp, not sure if you have time to write a test for this issue? If not, let me know and I'll assign someone. Code change looks good, I just want to see it validated.

@jybp
Copy link
Contributor Author

jybp commented Apr 15, 2025

@michaelsproul Sorry I don't have the bandwidth and am not familiar enough with the codebase to be able to write proper tests. Would appreciate if someone else could pick it up for integration in v7.0.0 🙏

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Ready for merge once the other v7.0.0 changes are pushed.

@michaelsproul michaelsproul added under-review A reviewer has only partially completed a review. and removed ready-for-review The code is ready for review do-not-merge labels Apr 16, 2025
@michaelsproul michaelsproul added the ready-for-merge This PR is ready to merge. label Apr 17, 2025
mergify bot added a commit that referenced this pull request Apr 17, 2025
@mergify mergify bot merged commit 5352d5f into sigp:release-v7.0.0 Apr 17, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTTP-API ready-for-merge This PR is ready to merge. rewards-api Implementation of the rewards API under-review A reviewer has only partially completed a review. v7.0.0 New release c. Q1 2025
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants