consensus-specs icon indicating copy to clipboard operation
consensus-specs copied to clipboard

Ambiguity around partial withdrawal

Open ensi321 opened this issue 1 year ago • 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.

ensi321 avatar Sep 02 '24 22:09 ensi321

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.

potuz avatar Sep 03 '24 13:09 potuz

+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

ralexstokes avatar Sep 03 '24 16:09 ralexstokes

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

mkalinin avatar Sep 04 '24 09:09 mkalinin

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.

mkalinin avatar Oct 16 '24 11:10 mkalinin

I am closing this issue because it seems stale. Please, do not hesitate to reopen it if this is a mistake

leolara avatar Jun 10 '25 09:06 leolara