Skip to content

Commit

Permalink
queue_excess_active_balance
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Mar 22, 2024
1 parent 45f98d6 commit ebdb513
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions specs/_features/eip7251/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,19 @@ def upgrade_to_eip7251(pre: deneb.BeaconState) -> BeaconState:
pending_partial_withdrawals=[],
pending_consolidations=[],
)

# Ensure early adopters of compounding credentials go through the activation churn
queue_excess_active_balance(post)

return post
```

```python
def queue_excess_active_balance(state: BeaconState):
for index, validator in enumerate(state.validators):
balance = state.balances[index]
if has_compounding_withdrawal_credential(validator) and balance > MAX_EFFECTIVE_BALANCE:
excess_balance = balance - MAX_EFFECTIVE_BALANCE
state.balances[index] = balance - excess_balance
state.pending_balance_deposits.append(PendingBalanceDeposit(index, excess_balance))
```

0 comments on commit ebdb513

Please sign in to comment.