Thanks for the pointer - looks like all but question 2 are answered! (“How much ETH can I withdraw from a validator before it’s exited?”)
TLDR: you can’t exit your validator using Partial Withdrawals, it is safe to use!
Long answer:
There are two types of withdrawal requests, Full and Partial.
A full withdrawal is when the amount = 0, to indicate that the validator will be fully withdrawn and exit its duties as a validator.
A partial withdrawal is any withdrawal where amount > 0. This allows you to withdrawal any excess of 32 ETH balance that you have (e.g. if you validator has 35 ETH balance, you can withdrawal up to 3 ETH.) But even if you create the request with amount > 3, the protocol prevents you from dropping your balance lower than 32 ETH.
Reference (from process_withdrawal_request
):
to_withdraw = min(
state.balances[index] - MIN_ACTIVATION_BALANCE - pending_balance_to_withdraw,
amount
)
For a validator to exit due to low balance, you would need to reduce your balance to be lower than EJECTION_BALANCE (currently 16 ETH).
Due to the constraints in process_withdrawal_request, you won’t be able to exit your validator by mistake using Partial Withdrawals. The only way to exit using withdrawals is using a Full Withdrawal.
Hopefully, this answers your question!
Hi. Staking since genesis and 0x01 withdrawal address got compromised recently.
Please give us the ability to generate a new withdrawal address, currently if this EIP will pass my only option is to race against a hacker to try fetch the funds after a voluntary exit.
Not sure if this is the right place to ask, but is there a reason that the EIP-7002 (and other) system contracts are written in assembly, and not Solidity or Vyper?
We don’t want to enshrine the ABI defined by Solidity into system contracts and we want the contracts to be efficient.
Thanks for the reply and context! It raises a bunch more questions in my mind but I’ll hold those for now while I do some more reading and research.
Following on this - is there any reason we don’t simply ignore partial withdrawals where the to_withdraw
amount ends up being zero?
I don’t see a clear reason why we still add the withdrawal to the pending withdrawals and go through the whole withdrawal flow but I might be missing something