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

Shouldn't max_effective_balance differ per each validator? (Electra)

Open arkh-consensys opened this issue 1 year ago • 8 comments

Looking into the electra specs get_max_effective_balance for all consolidated validators returns MAX_EFFECTIVE_BALANCE_ELECTRA

If this is the case, the consolidated validators gets locked until their balance reaches MAX_EFFECTIVE_BALANCE_ELECTRA On the is_partially_withdrawable_validator function they are never considered partially withdrawalable unless their balance reaches to MAX_EFFECTIVE_BALANCE_ELECTRA = 2048 ETH

def is_partially_withdrawable_validator(validator: Validator, balance: Gwei) -> bool:
    """
    Check if ``validator`` is partially withdrawable.
    """
    max_effective_balance = get_max_effective_balance(validator) // this will be 2048 according to the current written spec
    has_max_effective_balance = validator.effective_balance == max_effective_balance  // this will be false untill effective balance is  increased till 2048
    has_excess_balance = balance > max_effective_balance  # [Modified in Electra:EIP7251]
    return (
        has_execution_withdrawal_credential(validator)  # [Modified in Electra:EIP7251]
        and has_max_effective_balance
        and has_excess_balance
    )

arkh-consensys avatar Oct 03 '24 12:10 arkh-consensys

There are withdrawal requests mechanism allowing to do partial withdrawals on demand for validators which effective balance satisfies: 32 ETH < EB <= 2048 ETH, you can take a look at process_withdrawal_request for more details

mkalinin avatar Oct 03 '24 14:10 mkalinin

Following up with an additional question @mkalinin, is there a plan to introduce support for a lower top limit value below 2048 per validator, to replicate the existing mechanism of automatic partial withdrawals when the effective balance exceeds 32 ETH? For example, this would enable validators to set a ceiling balance below 2048ETH and receive any excess automatically.

I assume get_max_effective_balance function would need to consider that.

ricardolyn avatar Oct 04 '24 08:10 ricardolyn

There is no plan to include custom EB feature in Electra. It can happen in one of the next hard forks if there is enough desire for having it and someone champions it.

mkalinin avatar Oct 05 '24 04:10 mkalinin

Following up with an additional question @mkalinin, is there a plan to introduce support for a lower top limit value below 2048 per validator, to replicate the existing mechanism of automatic partial withdrawals when the effective balance exceeds 32 ETH?

@ricardolyn Why do you want to do that? I feel like there is no reason to do that.

to replicate the existing mechanism of automatic partial withdrawals when the effective balance exceeds 32 ETH?

In fact, you can still do that by keeping the eth1 withdrawal credential instead of switching to the compound one, right?

ppopth avatar Oct 16 '24 07:10 ppopth

@ricardolyn Why do you want to do that? I feel like there is no reason to do that.

exactly per my comment above to replicate the existing mechanism of automatic partial withdrawals when the effective balance exceeds X ETH, but just replacing the 32 with X where 32 <= X <= 2048.

ricardolyn avatar Oct 16 '24 09:10 ricardolyn

exactly per my comment above to replicate the existing mechanism of automatic partial withdrawals when the effective balance exceeds X ETH, but just replacing the 32 with X where 32 <= X <= 2048.

This is the custom ceiling @mkalinin was talking about. What was accepted for electra was to add a max of 2048, but not the ability to set a custom value as a maximum.

The solution would be to manually initiate a partial withdrawal periodically, which admittedly does differ from the sweep in that you're paying gas, but the custom ceiling was a fairly complicated change. Potentially this could be implemented in the future, but not in electra.

It should also be noted, because you can issue your own withdrawal at any point for any balance above 32 ETH, it's not actually "locked" as the initial description indicates, it's just not automatically withdrawn.

rolfyone avatar Oct 17 '24 07:10 rolfyone

We are ending another year and still I am waiting for payout to all my wallet It looks like only you guys will be having a great Christmas and a Big Bonus will I'll be having dry bread and water thanks a lot

Goonte avatar Oct 24 '24 00:10 Goonte

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