diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index 543782b71c..e39c4f79f9 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -957,8 +957,8 @@ def process_pending_consolidations(state: BeaconState) -> None: break # Calculate the consolidated balance - max_effective_balance = get_max_effective_balance(source_validator) - source_effective_balance = min(state.balances[pending_consolidation.source_index], max_effective_balance) + source_effective_balance = min( + state.balances[pending_consolidation.source_index], source_validator.effective_balance) # Move active balance to target. Excess balance is withdrawable. decrease_balance(state, pending_consolidation.source_index, source_effective_balance) diff --git a/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py b/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py index b061efee7b..61b3e248aa 100644 --- a/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py +++ b/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py @@ -239,12 +239,12 @@ def test_pending_consolidation_compounding_creds(spec, state): # Pending consolidation was successfully processed expected_target_balance = ( - state_before_consolidation.balances[source_index] + state_before_consolidation.balances[target_index] + spec.MIN_ACTIVATION_BALANCE + state_before_consolidation.balances[target_index] ) assert state.balances[target_index] == expected_target_balance # All source balance is active and moved to the target, # because the source validator has compounding credentials - assert state.balances[source_index] == 0 + assert state.balances[source_index] == state_before_consolidation.balances[source_index] - spec.MIN_ACTIVATION_BALANCE assert state.pending_consolidations == [] # Pending balance deposit to the target is not created, @@ -297,10 +297,10 @@ def test_pending_consolidation_with_pending_deposit(spec, state): # Pending consolidation was successfully processed expected_target_balance = ( - state_before_consolidation.balances[source_index] + state_before_consolidation.balances[target_index] + spec.MIN_ACTIVATION_BALANCE + state_before_consolidation.balances[target_index] ) assert state.balances[target_index] == expected_target_balance - assert state.balances[source_index] == 0 + assert state.balances[source_index] == state_before_consolidation.balances[source_index] - spec.MIN_ACTIVATION_BALANCE assert state.pending_consolidations == [] # Pending deposit to the source was not processed.