Remove queue_entire_balance_and_reset_validator (#3951)
This commit is contained in:
parent
ecb4c2aa9c
commit
85e2452301
|
@ -60,7 +60,6 @@
|
|||
- [Modified `initiate_validator_exit`](#modified-initiate_validator_exit)
|
||||
- [New `switch_to_compounding_validator`](#new-switch_to_compounding_validator)
|
||||
- [New `queue_excess_active_balance`](#new-queue_excess_active_balance)
|
||||
- [New `queue_entire_balance_and_reset_validator`](#new-queue_entire_balance_and_reset_validator)
|
||||
- [New `compute_exit_epoch_and_update_churn`](#new-compute_exit_epoch_and_update_churn)
|
||||
- [New `compute_consolidation_epoch_and_update_churn`](#new-compute_consolidation_epoch_and_update_churn)
|
||||
- [Modified `slash_validator`](#modified-slash_validator)
|
||||
|
@ -646,20 +645,6 @@ def queue_excess_active_balance(state: BeaconState, index: ValidatorIndex) -> No
|
|||
)
|
||||
```
|
||||
|
||||
#### New `queue_entire_balance_and_reset_validator`
|
||||
|
||||
```python
|
||||
def queue_entire_balance_and_reset_validator(state: BeaconState, index: ValidatorIndex) -> None:
|
||||
balance = state.balances[index]
|
||||
state.balances[index] = 0
|
||||
validator = state.validators[index]
|
||||
validator.effective_balance = 0
|
||||
validator.activation_eligibility_epoch = FAR_FUTURE_EPOCH
|
||||
state.pending_balance_deposits.append(
|
||||
PendingBalanceDeposit(index=index, amount=balance)
|
||||
)
|
||||
```
|
||||
|
||||
#### New `compute_exit_epoch_and_update_churn`
|
||||
|
||||
```python
|
||||
|
|
|
@ -152,7 +152,14 @@ def upgrade_to_electra(pre: deneb.BeaconState) -> BeaconState:
|
|||
))
|
||||
|
||||
for index in pre_activation:
|
||||
queue_entire_balance_and_reset_validator(post, ValidatorIndex(index))
|
||||
balance = post.balances[index]
|
||||
post.balances[index] = 0
|
||||
validator = post.validators[index]
|
||||
validator.effective_balance = 0
|
||||
validator.activation_eligibility_epoch = FAR_FUTURE_EPOCH
|
||||
post.pending_balance_deposits.append(
|
||||
PendingBalanceDeposit(index=index, amount=balance)
|
||||
)
|
||||
|
||||
# Ensure early adopters of compounding credentials go through the activation churn
|
||||
for index, validator in enumerate(post.validators):
|
||||
|
|
Loading…
Reference in New Issue