{"eip":8071,"title":"Prevent using consolidations as withdrawals","description":"Cancels consolidation if the max effective balance of the target validator will be exceeded, preventing the withdrawal of the unused balance","authors":["Mikhail Kalinin (@mkalinin)","Francesco D'Amato (@fradamt)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2025-10-29","discussionsTo":"https://ethereum-magicians.org/t/eip-8071-prevent-using-consolidations-as-withdrawals/26037","repo":"EIPs","label":"EIP-8071","officialUrl":"https://eips.ethereum.org/EIPS/eip-8071","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8071.md","url":"https://eips.huatuo.xyz/eip-8071/","tldr":{"en":"Cancels validator consolidation requests that would push the target over its maximum effective balance, closing a loophole that let stakers use the consolidation queue as a faster exit queue.","ja":"対象が最大実効残高を超えることになるバリデーター統合リクエストをキャンセルし、統合キューをより速い退出キューとして使えてしまう抜け穴を塞ぐ。","ko":"대상 검증자가 최대 유효 잔액을 넘게 되는 검증자 통합 요청을 취소하여, 스테이커가 통합 대기열을 더 빠른 퇴출 대기열로 쓰던 허점을 막는다.","zh":"取消会使目标验证者超过最大有效余额的验证者合并请求，堵上让质押者把合并队列当作更快退出队列的漏洞。"},"tags":["consensus","staking","consolidation","withdrawals","pectra"],"explainers":{"en":{"lang":"en","tldr":"Cancels validator consolidation requests that would push the target over its maximum effective balance, closing a loophole that let stakers use the consolidation queue as a faster exit queue.","tags":["consensus","staking","consolidation","withdrawals","pectra"],"related":[7251,7002],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8071/","markdown":"## What problem does it solve?\n\n[EIP-7251](/eip-7251/) (Pectra) raised the maximum effective balance to 2048 ETH and added **consolidation**: a validator can merge its stake into another validator with compounding credentials. The source validator exits through a consolidation queue, and its balance is moved to the target.\n\nThe flaw: if the target ends up above its maximum effective balance, the excess is simply withdrawn. So when the consolidation queue was moving faster than the regular exit queue, stakers could \"consolidate\" into a nearly full validator and get their ETH out sooner than by exiting normally. The spec states this was being heavily exploited at the time of writing, with public write-ups describing the method. It is framed as a UX and fairness issue rather than a security bug: the consolidation queue was never meant for withdrawals.\n\n## How it works\n\nThe consensus-layer `process_consolidation_request` gets one extra check. Before accepting a request it computes:\n\n```\ntarget balance after = pending consolidations already queued for the target\n                     + source effective balance\n                     + target's current balance\n```\n\nIf that exceeds the target's maximum effective balance, the request is silently ignored, like other invalid consolidation requests.\n\nA new helper, `get_pending_balance_to_consolidate`, sums the effective balances of all sources already queued for the same target. This catches the case where several requests are individually fine but together overflow the target.\n\n## Sample code\n\nThe new helper and the added check, from the spec:\n\n```python\ndef get_pending_balance_to_consolidate(state: BeaconState, target_index: ValidatorIndex) -\u003e Gwei:\n    total = Gwei(0)\n    for pc in state.pending_consolidations:\n        if pc.target_index == target_index:\n            total += state.validators[pc.source_index].effective_balance\n    return total\n\n# inside process_consolidation_request, after the existing checks:\ntarget_balance_after_consolidation = (\n    get_pending_balance_to_consolidate(state, target_index)\n    + source_validator.effective_balance\n    + state.balances[target_index]\n)\nif target_balance_after_consolidation \u003e get_max_effective_balance(target_validator):\n    return  # cancelled: excess would otherwise be withdrawn\n```\n\n## Things to know\n\n- **Status: Draft.** It is a consensus change that needs a scheduled network upgrade.\n- A cancelled request is dropped on the consensus layer, but the **execution-layer request fee and gas are not refunded**. Check the target's headroom before submitting.\n- The check uses the target's actual balance, not just its effective balance, so rewards accumulated on the target count against the limit.\n- Self-consolidation to switch to compounding credentials is unaffected.\n- To exit, use the normal exit queue or execution-layer triggered exits ([EIP-7002](/eip-7002/)).\n"},"ja":{"lang":"ja","tldr":"対象が最大実効残高を超えることになるバリデーター統合リクエストをキャンセルし、統合キューをより速い退出キューとして使えてしまう抜け穴を塞ぐ。","tags":["consensus","staking","consolidation","withdrawals","pectra"],"related":[7251,7002],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8071/","markdown":"## 何を解決するのか\n\n[EIP-7251](/eip-7251/)（Pectra）は最大実効残高を 2048 ETH に引き上げ、**統合（consolidation）**を追加しました。バリデーターは、compounding 資格情報を持つ別のバリデーターに自分のステークをまとめられます。統合元のバリデーターは統合キューを通って退出し、その残高は統合先に移されます。\n\n欠陥は次のとおりです。統合先が最大実効残高を超えてしまうと、超過分は単に引き出されます。そのため、統合キューが通常の退出キューより速く進んでいたとき、ステーカーはほぼ満額のバリデーターへ「統合」することで、通常の退出よりも早く ETH を引き出せました。仕様には、執筆時点でこれが盛んに悪用されており、その手法を説明した公開記事があると記されています。これはセキュリティのバグではなく、UX と公平性の問題と位置づけられています。統合キューは引き出しのために作られたものではないからです。\n\n## 仕組み\n\nコンセンサスレイヤーの `process_consolidation_request` に、チェックが 1 つ追加されます。リクエストを受け付ける前に、次を計算します。\n\n```\ntarget balance after = pending consolidations already queued for the target\n                     + source effective balance\n                     + target's current balance\n```\n\nこれが対象の最大実効残高を超える場合、リクエストは、他の無効な統合リクエストと同様に黙って無視されます。\n\n新しいヘルパー `get_pending_balance_to_consolidate` は、同じ対象に対してすでにキューにあるすべての統合元の実効残高を合計します。これにより、個々のリクエストは問題なくても、合計すると対象があふれるケースを捕捉できます。\n\n## サンプルコード\n\n仕様にある、新しいヘルパーと追加されたチェック:\n\n```python\ndef get_pending_balance_to_consolidate(state: BeaconState, target_index: ValidatorIndex) -\u003e Gwei:\n    total = Gwei(0)\n    for pc in state.pending_consolidations:\n        if pc.target_index == target_index:\n            total += state.validators[pc.source_index].effective_balance\n    return total\n\n# inside process_consolidation_request, after the existing checks:\ntarget_balance_after_consolidation = (\n    get_pending_balance_to_consolidate(state, target_index)\n    + source_validator.effective_balance\n    + state.balances[target_index]\n)\nif target_balance_after_consolidation \u003e get_max_effective_balance(target_validator):\n    return  # cancelled: excess would otherwise be withdrawn\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** コンセンサスの変更であり、予定されたネットワークアップグレードが必要です。\n- キャンセルされたリクエストはコンセンサスレイヤーで破棄されますが、**実行レイヤーのリクエスト手数料とガスは返金されません**。送信前に対象の空き容量を確認してください。\n- このチェックは対象の実効残高だけでなく実際の残高を使うため、対象に蓄積された報酬も上限に算入されます。\n- compounding 資格情報へ切り替えるための自己統合は影響を受けません。\n- 退出するには、通常の退出キューか、実行レイヤーからトリガーする退出（[EIP-7002](/eip-7002/)）を使ってください。\n"},"ko":{"lang":"ko","tldr":"대상 검증자가 최대 유효 잔액을 넘게 되는 검증자 통합 요청을 취소하여, 스테이커가 통합 대기열을 더 빠른 퇴출 대기열로 쓰던 허점을 막는다.","tags":["consensus","staking","consolidation","withdrawals","pectra"],"related":[7251,7002],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8071/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-7251](/eip-7251/)(Pectra)은 최대 유효 잔액을 2048 ETH로 올리고 **통합(consolidation)**을 추가했습니다. 검증자는 compounding 자격 증명을 가진 다른 검증자에게 자신의 스테이크를 합칠 수 있습니다. 원본 검증자는 통합 대기열을 통해 퇴출되고, 그 잔액은 대상으로 옮겨집니다.\n\n결함은 이렇습니다. 대상이 최대 유효 잔액을 넘게 되면 초과분은 그냥 인출됩니다. 그래서 통합 대기열이 일반 퇴출 대기열보다 빠르게 진행되던 때에는, 스테이커가 거의 가득 찬 검증자로 \"통합\"해서 정상 퇴출보다 빨리 ETH를 꺼낼 수 있었습니다. 스펙은 작성 시점에 이것이 활발히 악용되고 있었고 그 방법을 설명한 공개 글이 있다고 밝힙니다. 보안 버그가 아니라 UX와 공정성 문제로 규정됩니다. 통합 대기열은 원래 인출용이 아니기 때문입니다.\n\n## 어떻게 동작하나요?\n\n합의 레이어의 `process_consolidation_request`에 검사가 하나 추가됩니다. 요청을 받아들이기 전에 다음을 계산합니다.\n\n```\ntarget balance after = pending consolidations already queued for the target\n                     + source effective balance\n                     + target's current balance\n```\n\n이 값이 대상의 최대 유효 잔액을 넘으면, 다른 유효하지 않은 통합 요청과 마찬가지로 요청은 조용히 무시됩니다.\n\n새 헬퍼 `get_pending_balance_to_consolidate`는 같은 대상으로 이미 대기열에 들어 있는 모든 원본의 유효 잔액을 합산합니다. 이로써 요청이 하나씩은 문제없지만 합치면 대상이 넘치는 경우를 잡아냅니다.\n\n## 샘플 코드\n\n스펙에서 가져온, 새 헬퍼와 추가된 검사:\n\n```python\ndef get_pending_balance_to_consolidate(state: BeaconState, target_index: ValidatorIndex) -\u003e Gwei:\n    total = Gwei(0)\n    for pc in state.pending_consolidations:\n        if pc.target_index == target_index:\n            total += state.validators[pc.source_index].effective_balance\n    return total\n\n# inside process_consolidation_request, after the existing checks:\ntarget_balance_after_consolidation = (\n    get_pending_balance_to_consolidate(state, target_index)\n    + source_validator.effective_balance\n    + state.balances[target_index]\n)\nif target_balance_after_consolidation \u003e get_max_effective_balance(target_validator):\n    return  # cancelled: excess would otherwise be withdrawn\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 합의 변경이므로 예정된 네트워크 업그레이드가 필요합니다.\n- 취소된 요청은 합의 레이어에서 버려지지만, **실행 레이어의 요청 수수료와 가스는 환불되지 않습니다.** 제출하기 전에 대상의 여유를 확인하세요.\n- 이 검사는 대상의 유효 잔액뿐 아니라 실제 잔액을 사용하므로, 대상에 쌓인 보상도 한도에 포함됩니다.\n- compounding 자격 증명으로 전환하기 위한 자기 통합은 영향을 받지 않습니다.\n- 퇴출하려면 일반 퇴출 대기열이나 실행 레이어가 트리거하는 퇴출([EIP-7002](/eip-7002/))을 사용하세요.\n"},"zh":{"lang":"zh","tldr":"取消会使目标验证者超过最大有效余额的验证者合并请求，堵上让质押者把合并队列当作更快退出队列的漏洞。","tags":["consensus","staking","consolidation","withdrawals","pectra"],"related":[7251,7002],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8071/","markdown":"## 它解决什么问题？\n\n[EIP-7251](/eip-7251/)（Pectra）把最大有效余额提高到 2048 ETH，并加入了**合并（consolidation）**：一个验证者可以把自己的质押并入另一个具有 compounding 凭证的验证者。源验证者通过合并队列退出，其余额被转移到目标验证者。\n\n缺陷在于：如果目标验证者的余额超过最大有效余额，超出部分会被直接提取。所以当合并队列比常规退出队列走得更快时，质押者可以“合并”到一个几乎满额的验证者，比正常退出更快地取出 ETH。规范称，在撰写时这一做法正被大量利用，并且已有公开文章介绍该方法。它被定性为用户体验和公平性问题，而不是安全漏洞：合并队列本来就不是用来提款的。\n\n## 它如何运作\n\n共识层的 `process_consolidation_request` 增加了一项检查。在接受请求之前，它计算：\n\n```\ntarget balance after = pending consolidations already queued for the target\n                     + source effective balance\n                     + target's current balance\n```\n\n如果结果超过目标的最大有效余额，该请求会像其他无效的合并请求一样被静默忽略。\n\n新的辅助函数 `get_pending_balance_to_consolidate` 会把已经排队指向同一目标的所有源验证者的有效余额相加。这样就能捕捉到这种情况：多个请求单独看都没问题，但合在一起会使目标溢出。\n\n## 示例代码\n\n规范中新增的辅助函数和检查：\n\n```python\ndef get_pending_balance_to_consolidate(state: BeaconState, target_index: ValidatorIndex) -\u003e Gwei:\n    total = Gwei(0)\n    for pc in state.pending_consolidations:\n        if pc.target_index == target_index:\n            total += state.validators[pc.source_index].effective_balance\n    return total\n\n# inside process_consolidation_request, after the existing checks:\ntarget_balance_after_consolidation = (\n    get_pending_balance_to_consolidate(state, target_index)\n    + source_validator.effective_balance\n    + state.balances[target_index]\n)\nif target_balance_after_consolidation \u003e get_max_effective_balance(target_validator):\n    return  # cancelled: excess would otherwise be withdrawn\n```\n\n## 需要注意\n\n- **状态：Draft。** 这是共识层改动，需要一次计划中的网络升级。\n- 被取消的请求会在共识层被丢弃，但**执行层的请求费用和 gas 不会退还**。提交前请检查目标的剩余额度。\n- 该检查使用目标的实际余额，而不仅仅是有效余额，因此目标上累积的奖励也会计入上限。\n- 为切换到 compounding 凭证而进行的自我合并不受影响。\n- 要退出，请使用常规退出队列或执行层触发的退出（[EIP-7002](/eip-7002/)）。\n"}}}
