-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial withdrawals #2862
Partial withdrawals #2862
Conversation
f5c967f
to
2dbafa2
Compare
2dbafa2
to
d84000e
Compare
Thinking about On the current value of If we did this, then we could reduce |
So this is a "non-voluntary" partial withdrawal right? This can do a partial withdrawal for 1 Gwei if the validator balance is 32_000_000_001, should there be a minimum above EDIT: From @mcdee comment I see that's the idea. Agree then that |
Regarding the number per epoch and the number per slot to be dequeued, there's a few considerations I'm taking
I'm totally fine re-configuring some of these values, but given the low cost of 16 as Another thing to note is that less access to profits for solo/small stakers can be a centralizing pressure. So if we can provide a higher partial withdrawal rate at very low cost, it is by default a good thing unless shown unnecessarily costly on some other front. |
dc15780
to
4d10a79
Compare
On the technical front, to grab some quick numbers there are around 210 balance changes per block (quick sample of the last 10,000 blocks at time of writing), so adding another 8 would be a ~4% increase. Not sure if this is considered significant, but thought I'd put it out there. One of my initial concerns (and apologies for not putting this in there to begin with, but I didn't run the numbers) would be the % of withdrawal that may be used as gas. If we take 50Gewi as the effective gas price (48Gwei average bass fee over the last 10,000 blocks and 2Gwei tip) and pick a relatively normal transaction such as converting to USDC, then the cost of doing so is ~10% of the median withdrawal amount. This feels high. I'm fully aware that rather than halve the number of withdrawals per epoch stakers could just wait for two cycles to transfer their funds and there would be no difference in reality, but given the (even minor) additional cost to the network to calculate, store and process the partial withdrawals it feels like we could halve it without any major downsides, and in doing so save a few cycles and possibly avoid some complaints about the relative cost of moving withdrawals in the future. But given the main point of my argument is around how this may feel to stakers, which isn't the hardest of positions, perhaps take this more as an observation for consideration than a strong reason to halve |
The balance update count is great! thank you @mcdee. I do wonder though -- do balance updates matter as the comparison here or more so all of the writes
yeah, I see that. "is there value in having this granularity of amounts available" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go
5595953
to
333d25b
Compare
333d25b
to
3f37d1b
Compare
tests/core/pyspec/eth2spec/test/capella/epoch_processing/test_process_partial_withdrawals.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go
assert len(dequeued_withdrawals) == len(payload.withdrawals) | ||
for dequeued_withdrawal, withdrawal in zip(dequeued_withdrawals, payload.withdrawals): | ||
assert dequeued_withdrawal == withdrawal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these three lines be simplified to assert dequeue_withdrawals == payload.withdrawals
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
tests/core/pyspec/eth2spec/test/capella/epoch_processing/test_process_partial_withdrawals.py
Show resolved
Hide resolved
tests/core/pyspec/eth2spec/test/capella/epoch_processing/test_process_full_withdrawals.py
Outdated
Show resolved
Hide resolved
tests/core/pyspec/eth2spec/test/capella/epoch_processing/test_process_partial_withdrawals.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work! spec additions look good, I'll make another pass on the testing
assert len(dequeued_withdrawals) == len(payload.withdrawals) | ||
for dequeued_withdrawal, withdrawal in zip(dequeued_withdrawals, payload.withdrawals): | ||
assert dequeued_withdrawal == withdrawal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/core/pyspec/eth2spec/test/capella/epoch_processing/test_process_partial_withdrawals.py
Outdated
Show resolved
Hide resolved
tests/core/pyspec/eth2spec/test/capella/epoch_processing/test_process_partial_withdrawals.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Alex Stokes <[email protected]> Co-authored-by: Hsiao-Wei Wang <[email protected]>
Partial withdrawals for 0x01 validators. Utilizes a method that just sweeps a maximum number of partially withdrawable validators on a per-epoch basis
next_partial_withdrawal_validator_index
)is_partially_withdrawable_validator
), withdraw the excess balanceAdditionally, cleaned up some naming
See discussion below for rationale on config values. Take tuning these values to an issue if desired
discussion around if this should be all validators or just "active and not slashed" here -- #2905