diff --git a/specs/_features/eip7251/fork.md b/specs/_features/eip7251/fork.md index 666c7c368..2e501fc6b 100644 --- a/specs/_features/eip7251/fork.md +++ b/specs/_features/eip7251/fork.md @@ -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)) +```