-
Notifications
You must be signed in to change notification settings - Fork 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: queue_entire_balance_and_reset_validator, queue_excess_active_balance, and switch_to_compounding_validator #13982
Conversation
return err | ||
} | ||
if len(v.WithdrawalCredentials) == 0 { | ||
return errors.New("validator has no withdrawal credentials") |
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.
Are you sure this should be an error and not just return nil
? I think it is valid for a consolidation to come from a validator where has_compounding_withdrawal_credential
is true and has_eth1_withdrawal_credential
is false. I think this would be the case where you decide to consolidate 2 validators that were created with compounding withdrawal credentials? But this function would treat the presence of such a pending consolidation as an 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.
Strike that, I see this is protecting against an out of bound index panic. It should be impossible for a validator without a credential to even get in the consolidations queue. Makes sense to be defensive here even though something is deeply messed up if we hit this case.
c699de1
to
48321c5
Compare
48321c5
to
59ab138
Compare
…ve_balance, and switch_to_compounding_validator with tests
59ab138
to
7dded5b
Compare
…ve_balance, and switch_to_compounding_validator with tests (prysmaticlabs#13982)
…ve_balance, and switch_to_compounding_validator with tests (#13982)
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Extracted from #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#new-queue_entire_balance_and_reset_validator
https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#new-queue_excess_active_balance
https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#new-switch_to_compounding_validator