Understanding the Exit Queue on Ethereum’s Shanghai Upgrade

How It Works And What To Expect For Staking Withdrawals

Juan Pellicer


The Ethereum network is scheduled to go through the Shanghai upgrade in late March, bringing several new features, including the highly anticipated capability of withdrawals for Beacon Chain validators. However, the dynamic exit queue system for withdrawing staked ETH may cause confusion for some. Monitoring this process will be key, since currently over 16 million ETH (valued at $27 billion) have been deposited in the staking contract, as can be seen below, with a 10.83% increase over the past 3 months and over 89,000 addresses participating. The approximate amount of ETH that will be withdrawn is uncertain, but it is important to consider the potential impact that could have a large withdrawal amount and its consequent sell-off for Ethereum’s security.

Total ETH Staked according to IntoTheBlock Ethereum’s Staking Analytics

Two Types of Withdrawals

Enabling withdrawals is the process of stopping a validator’s participation in the Ethereum Beacon Chain. This frees the 32 ETH locked as collateral and any earned rewards. There are two types of withdrawals, partial withdrawals and full withdrawals. Partial withdrawals refer to the ability to withdraw any ETH over the required 32 ETH balance, often resulting from staking rewards. Partial withdrawals provide a flexible means of accessing staking rewards while preserving the overall security of the Ethereum network, since those withdrawing partiallywill still remain being validators.

On the other hand, full withdrawals allow for the exit of the validator from the beacon chain and the unlocking of both the 32 ETH principle and the earned rewards. Both partial withdrawals and full withdrawals do not happen automatically and can only be initiated manually by the validator.

Two Stages With Its Own Limitations

The withdrawal lifecycle in Ethereum is composed of two stages both for partial and full withdrawals: the exit queue and the withdrawal queue. The distinction is made because the number of full withdrawals that can occur each day has to be limited to preserve the stability of the network.

The exit queue applies only to full withdrawals, partial withdrawals can bypass the exit queue and proceed directly to the withdrawal queue without having to wait. The withdrawal rate seeks to preserve the network’s security by determining a churn limit, which is the number of validators that can exit in each epoch (32 blocks , ~6.4 minutes). At 513,800 current active validators, the number of validators per epoch that can complete withdrawals is 7, as can be seen calculated below. This limit increases by 1 each time that the number of active validators increases by 65,536:

Once a validator successfully goes through the exit queue, they must then wait a withdrawal period. This period is predefined based on whether the validator was slashed. If the validator was not slashed, the withdrawal period is 256 epochs (approximately 27 hours). If the validator was slashed, the withdrawal period is 8,192 epochs (approximately 36 days). This large difference in withdrawal period is meant to disincentivize malicious behavior.

The withdrawal queue processes both partial and full withdrawals. During each block, 16 partial withdrawals will be processed. To calculate the actual withdrawal period, it is important to note that the churn limit rounds down with respect to the total number of validators, resulting in a minimum and maximum value based on the percentage of validators exiting. For example, if one-third of the entire validator set tries to exit in one day, it would take at least 97 days to complete.

Some Projections

Accounting for the current growth rate in active validators, and with a tentative date between march, it becomes clear that extrapolating the current values we can get an estimate that between 525,000 and 540,000 validators will be active, as can be seen below:

This would result in a churn limit of 8 validators per epoch for the exit queue. With the active validator count projection in mind, the withdrawal queue at 16 validators per block would give around 4 days and a half if all the validators would like to do partial withdrawals, and one day and a half if only one third would choose to do so.

However, it’s worth considering that not all validators may choose to partially withdraw, and some may opt for full withdrawals instead. Based on current projections, a moderate estimation is that over 20% of validators may fully exit following the upcoming Shanghai upgrade. So the exit queue would be around 60 days for these validators. Plus that they would wait another 27 hours more for the withdrawal queue to complete.

Additionally, after Shanghai, the maximum amount of ETH a validator can have is limited to 32 ETH, which means that partial withdrawals of rewards will be automatically executed. This means that post-Shanghai, the number of partial withdrawals can be assumed to equal the number of validators. Ethereum validators should be aware of the limitations and wait times associated with partial withdrawals, as well as the factors that may influence these wait times. In a second article we will cover the possible impacts that the Shanghai fork might have on liquid staking derivatives and the impact that it could have over DeFi.