-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
eip-7251: Updated slash_validator #13976
Conversation
return nil, errors.Wrap(err, "could not get slashing parameters per version") | ||
} | ||
|
||
slashingPenalty := validator.EffectiveBalance / slashingQuotient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safe math here? just to be careful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 64dcaa8 for all divisions in this method
Tests for updated slash_validator
9ee3a78
to
64dcaa8
Compare
) | ||
|
||
// SlashingParamsPerVersion returns the slashing parameters for the given state version. | ||
func SlashingParamsPerVersion(v int) (slashingQuotient, proposerRewardQuotient, whistleblowerRewardQuotient uint64, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be dangerous if someone messes up the order of the return variables. However, there are more dangerous things out there...
Tests for updated slash_validator
Tests for updated slash_validator
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This PR comes with some minor refactoring.
Part of #13903
Which issues(s) does this PR fix?
Tracking @ #13849
Other notes for review
https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#updated-slash_validator