-
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
Convert Phase0 slashing to Electra slashings at the fork #14844
Conversation
@@ -270,6 +270,32 @@ func (p *Pool) MarkIncludedProposerSlashing(ps *ethpb.ProposerSlashing) { | |||
numProposerSlashingsIncluded.Inc() | |||
} | |||
|
|||
// ConvertToElectra converts all Phase0 attester slashings to Electra attester slashings. | |||
// This functionality is needed at the time of the Electra fork. | |||
func (p *Pool) ConvertToElectra() { |
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.
This is tested in beacon-chain/operations/slashings/service_new_test.go
) | ||
|
||
// WithElectraTimer includes functional options for the blockchain service related to CLI flags. | ||
func WithElectraTimer(cw startup.ClockWaiter, currentSlotFn func() primitives.Slot) Option { |
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.
The reason why the parameter is a func, and not a struct or interface, is because we would need to pass in the chain service, which creates a cyclic dependency that is very hard to fix.
SlashingPoolService
What type of PR is this?
Feature
What does this PR do? Why is it needed?
The PR adds a
SlashingPoolService
, whose function is to convert Phase0 slashing in the slashing pool into Electra slashings. Phase0 slashings will become invalid at the fork, so without this they would get lost.Acknowledgements