diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index c366b9c3f9..f567e79689 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -58,6 +58,7 @@ - [New `get_activation_exit_churn_limit`](#new-get_activation_exit_churn_limit) - [New `get_consolidation_churn_limit`](#new-get_consolidation_churn_limit) - [New `get_pending_balance_to_withdraw`](#new-get_pending_balance_to_withdraw) + - [New `get_pending_deposits_for_validator`](#new-get_pending_deposits_for_validator) - [Modified `get_attesting_indices`](#modified-get_attesting_indices) - [Modified `get_next_sync_committee_indices`](#modified-get_next_sync_committee_indices) - [Beacon state mutators](#beacon-state-mutators) @@ -593,6 +594,17 @@ def get_pending_balance_to_withdraw(state: BeaconState, validator_index: Validat ) ``` +#### New `new-get_pending_deposits_for_validator` + +```python +def get_pending_deposits_for_validator(state: BeaconState, pubkey: BLSPubkey) -> Gwei: + return sum( + deposit.amount for deposit in state.pending_deposits + if deposit.pubkey == pubkey + ) +``` + + #### Modified `get_attesting_indices` *Note*: The function `get_attesting_indices` is modified to support EIP7549. @@ -1498,6 +1510,7 @@ def process_voluntary_exit(state: BeaconState, signed_voluntary_exit: SignedVolu assert get_current_epoch(state) >= validator.activation_epoch + SHARD_COMMITTEE_PERIOD # Only exit validator if it has no pending withdrawals in the queue assert get_pending_balance_to_withdraw(state, voluntary_exit.validator_index) == 0 # [New in Electra:EIP7251] + assert get_pending_deposits_for_validator(state, voluntary_exit.pubkey) == 0 # [New in Electra:EIP7251] # Verify signature domain = compute_domain(DOMAIN_VOLUNTARY_EXIT, CAPELLA_FORK_VERSION, state.genesis_validators_root) signing_root = compute_signing_root(voluntary_exit, domain)