Ambiguity around partial withdrawal
Opened this issue · 4 comments
Description
The term partial withdrawal
is ambiguous in Electra.
In Capella and Deneb, partial withdrawal
refers to withdrawals on the portion of the validator balance with exceeds 32 ETH created during withdrawal sweep.
Although Capella spec does not directly use the term partial withdrawal
, but its spec tests use it extensively. Wordings include:
- Spec
- is_partially_withdrawable_validator
- Spec test
- partial_withdrawals_indices
- num_partial_withdrawals
- run_random_partial_withdrawals_test
- test_partial_withdrawal_in_epoch_transition
- _run_activate_and_partial_withdrawal
In Electra, EIP-7002 and EIP-7251 adds partial withdrawals from execution payload. Wordings include:
- Spec
- PENDING_PARTIAL_WITHDRAWALS_LIMIT
- state.pending_partial_withdrawals
- partial_withdrawals_count
- Spec test
- partial_withdrawal
- test_partial_withdrawal_request_with_low_amount
- expected_partial_withdrawal
Therefore partial withdrawals can be interpreted as partial withdrawal from withdrawal sweep, or EL-triggered partial withdrawal in Electra.
Suggestion
Number of ways we can mitigate this. But any suggestion is welcome:
- Avoid using "partial withdrawal" in Capella spec test. Try to use "partially withdrawables" instead.
- Be explicit with the source of partial withdrawals. For example, partial withdrawal from withdrawal sweep -> partial_withdrawal_from_sweep, EL triggered partial withdrawal -> execution_partial_withdrawal.
Thanks @twoeths for bringing this up.
I think the term "partial withdrawal" is self-explanatory: it is a withdrawal of a part of the total balance. As opposed to "total withdrawal" which the spec refers to as "full withdrawal" or just "withdrawal" meaning to withdraw all of the balance in the validator. I do not oppose adding wording to clarify this, but also seems to me that it's clear enough.
+1 to potuz
partial withdrawal just means withdrawal of stake above some security-relevant amount (e.g. MAX_EFFECTIVE_BALANCE pre-7251)
we are accumulating multiple ways to "generate" partial withdrawals which does complicate the validator life cycle graph but this seems unavoidable given the features we want to support
also support better/more explicit wording but we should keep in mind where we want complexity of various kinds (operational, semantic) to live
I see the contradiction with is_partially_withdrawable_validator
because this function would return False
for compounding validator when MIN_ACTIVATION_BALANCE <= validator.effective_balance < MAX_EFFECTIVE_BALANCE_ELECTRA
, while such validator is partially withdrawable via EL withdrawal requests. Ideally, the name of this function could be more specific
We could probably rename pending_partial_withdrawals
to pending_withdrawal_requests
seems to be more precise name and can also get rid of the ambiguity with partial withdrawals induced by the sweep.