Skip to content
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

Bugfix: Apply eip7549 to slashing pool #14691

Merged

Conversation

coldpak
Copy link
Contributor

@coldpak coldpak commented Dec 5, 2024

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

The maximum number of attester slashings per block was incorrectly handled following the Electra version upgrade.
Prysm client cannot produce a block if there are more than 2 attester slashings in the slashing pool.

In BuildBlockParallel, the proposer gets slashings by calling getSlashings
image
(beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go)

Inside the logic, there is a code PendingAttesterSlashings
image

PendingAttesterSlashings return at most 2 slashings because the MaxAttesterSlashings is set to 2.
image

And then, created block with 2 attester slashings fails with at length check logic. (proto/prysm/v1alpha1/electra.ssz.go)
image

I've added this version checking code to avoid this situation
image

According to EIP-7549, the maximum allowable attester slashings has been reduced from 2 to 1 in Electra. This PR updates the implementation and test cases to follow the rule when producing a new block.

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@coldpak coldpak requested a review from a team as a code owner December 5, 2024 09:06
@CLAassistant
Copy link

CLAassistant commented Dec 5, 2024

CLA assistant check
All committers have signed the CLA.

@coldpak coldpak changed the title Apply eip7549 to slashing pool Bugfix: Apply eip7549 to slashing pool Dec 7, 2024
potuz
potuz previously approved these changes Dec 10, 2024
Copy link
Contributor

@potuz potuz left a comment

Choose a reason for hiding this comment

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

LGTM, thank you very much for the nice description in the PR

rkapka
rkapka previously approved these changes Dec 11, 2024
@rkapka rkapka dismissed stale reviews from potuz and themself via 202cbc4 December 11, 2024 17:08
@rkapka rkapka enabled auto-merge December 11, 2024 18:49
@rkapka rkapka added this pull request to the merge queue Dec 11, 2024
Merged via the queue into prysmaticlabs:develop with commit 6e6012b Dec 11, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants