Bugfix: Apply eip7549 to slashing pool #14691
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.
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
(beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go)
Inside the logic, there is a code PendingAttesterSlashings
PendingAttesterSlashings return at most 2 slashings because the
MaxAttesterSlashings
is set to 2.And then, created block with 2 attester slashings fails with at length check logic. (proto/prysm/v1alpha1/electra.ssz.go)
I've added this version checking code to avoid this situation
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