freecoding.school100% FREE · NO SIGNUP
The EVM CoreISSUE #6 of 48

withdrawals · partial · full · the queue

SoliaVSThe Reentrancy Reaper
Solia saysValidators take two kinds of withdrawals: automatic partial skims of rewards above 32 ETH, and full exits — both rate-limited by the same churn formula.

After Shapella, withdrawals run on two tracks. Partial withdrawals auto-skim any rewards above 32 ETH on active validators; the beacon chain sweeps 16 validators per slot and credits the execution-layer withdrawal address. Full withdrawals require an explicit exit; the exit queue uses the same churn formula as activation, so a wave of exits drains slowly.

EIP-7002 closed the last keyless gap: it lets the execution layer trigger exits through withdrawal credentials, so you can exit a validator without holding the BLS signing key — vital for restaking and liquid staking. The demo computes the partial-sweep period and a full-exit queue drain time.

Power-ups you unlock

The Reentrancy Reaper attacks — common mistakes

Boss battleCompute days to clear a 50,000-validator exit queue and the full-validator sweep period for partial withdrawals.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>
const activeValidators = 1000000;
const exitChurn = Math.max(4, Math.floor(activeValidators / 65536));
const slotsPerEpoch = 32, slotSec = 12;
const exitsWanted = 50000;
const epochsToExit = Math.ceil(exitsWanted / exitChurn);
const daysToExit = (epochsToExit * slotsPerEpoch * slotSec) / 86400;
const partialPerSlot = 16;
const partialPerDay = partialPerSlot * (86400 / slotSec);
const fullSweepDays = activeValidators / partialPerDay;
document.getElementById('o').textContent = [
  'PARTIAL withdrawals (auto skim ETH > 32):',
  '  ' + partialPerSlot + ' validators swept per slot',
  '  full sweep takes ~' + fullSweepDays.toFixed(1) + ' days at ' + activeValidators.toLocaleString() + ' validators',
  '',
  'FULL withdrawals (exit queue):',
  '  exit churn: ' + exitChurn + ' validators / epoch',
  '  ' + exitsWanted.toLocaleString() + ' waiting → ' + daysToExit.toFixed(1) + ' days to drain',
  '',
  'EIP-7002 → execution layer can trigger exits via withdrawal credentials'
].join('\n');
</script></body></html>
▶ Open the interactive comic issue
‹ The Deposit Contract · Becoming A ValidatorEip-1559 · Base Fee · The Fee Market ›