{"eip":6988,"title":"Elected block proposer has not been slashed","description":"Prevents a slashed validator from being elected as a block proposer","authors":["Mikhail Kalinin (@mkalinin)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2023-05-04","discussionsTo":"https://ethereum-magicians.org/t/eip-6988-elected-block-proposer-has-not-been-slashed/14349","repo":"EIPs","label":"EIP-6988","officialUrl":"https://eips.ethereum.org/EIPS/eip-6988","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6988.md","url":"https://eips.huatuo.xyz/eip-6988/","tldr":{"en":"A stagnant consensus-layer fix that stops slashed validators from being picked as block proposers, so their slots are not guaranteed to be missed.","ja":"停滞状態のコンセンサスレイヤー修正。スラッシュされたバリデーターがブロックプロポーザーに選ばれないようにし、そのスロットが確実に欠落する事態を避ける。","ko":"정체 상태의 컨센서스 레이어 수정안. 슬래싱된 검증자가 블록 제안자로 뽑히지 않게 하여, 해당 슬롯이 반드시 놓치게 되는 일을 막는다.","zh":"一项处于停滞状态的共识层修复：阻止被罚没的验证者被选为区块提议者，使其 slot 不再必然错过。"},"tags":["consensus","proposer","slashing","beacon-chain","stagnant"],"explainers":{"en":{"lang":"en","tldr":"A stagnant consensus-layer fix that stops slashed validators from being picked as block proposers, so their slots are not guaranteed to be missed.","tags":["consensus","proposer","slashing","beacon-chain","stagnant"],"related":[3675,7251],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6988/","markdown":"## What problem does it solve?\n\nOn the beacon chain, each slot's block proposer is chosen pseudo-randomly from the active validator set, weighted by effective balance. The phase0 consensus spec has an inconsistency:\n\n- `compute_proposer_index` can select a validator that has been **slashed** (slashed validators stay \"active\" until their exit epoch).\n- `process_block_header` **rejects** any block whose proposer is slashed.\n\nSo when a slashed validator is elected, the slot is certain to be empty. One slashing makes that a negligible loss, but correlated slashings change the picture: the EIP's example is that if a tenth of validators were slashed together, roughly a tenth of proposals could be missed for a number of epochs afterwards, exactly when the network is already under stress.\n\n## How it works\n\nThe change lives in the consensus specs (feature `eip6988`) rather than in the EIP text. It has two parts:\n\n1. **Skip slashed candidates in proposer selection.** The sampling loop in `compute_proposer_index` only accepts a candidate that is not slashed, so selection simply moves on to the next candidate.\n2. **Adjust `get_beacon_proposer_index`.** If the latest block header's slot equals `state.slot`, the function returns the proposer index stored in that header instead of recomputing it. Without this, a proposer slashed *during* processing of its own block (for example by an included slashing message) would no longer be computed as the proposer, breaking reward accounting for that block.\n\nBecause proposer election is part of consensus, this is backwards-incompatible and needs a hard fork.\n\n## Sample code\n\nIllustrative pseudocode of the selection loop with the added check (simplified from the phase0 function; see the consensus-specs feature for the exact text):\n\n```python\ndef compute_proposer_index(state, indices, seed):\n    MAX_RANDOM_BYTE = 2**8 - 1\n    i = 0\n    total = len(indices)\n    while True:\n        candidate = indices[compute_shuffled_index(i % total, total, seed)]\n        random_byte = hash(seed + uint_to_bytes(uint64(i // 32)))[i % 32]\n        validator = state.validators[candidate]\n        if (not validator.slashed                       # new in EIP-6988\n                and validator.effective_balance * MAX_RANDOM_BYTE\n                    \u003e= MAX_EFFECTIVE_BALANCE * random_byte):\n            return candidate\n        i += 1\n\n\ndef get_beacon_proposer_index(state):\n    if state.latest_block_header.slot == state.slot:   # block already being processed\n        return state.latest_block_header.proposer_index\n    epoch = get_current_epoch(state)\n    seed = hash(get_seed(state, epoch, DOMAIN_BEACON_PROPOSER) + uint_to_bytes(state.slot))\n    indices = get_active_validator_indices(state, epoch)\n    return compute_proposer_index(state, indices, seed)\n```\n\n## Things to know\n\n- Status is **Stagnant**: it has not been scheduled for a network upgrade, and the authoritative specification is the linked consensus-specs feature, not the EIP document.\n- It affects only the consensus layer; nothing changes for transactions, contracts or the execution layer.\n- Test cases in consensus-specs cover both the old behaviour (a slashed validator can be elected) and the new one (it cannot), plus reward handling when a proposer is slashed within its own block.\n- Later consensus changes such as [EIP-7251](/eip-7251/) also modify proposer selection, so any revival would need to be rebased on the current spec.\n"},"ja":{"lang":"ja","tldr":"停滞状態のコンセンサスレイヤー修正。スラッシュされたバリデーターがブロックプロポーザーに選ばれないようにし、そのスロットが確実に欠落する事態を避ける。","tags":["consensus","proposer","slashing","beacon-chain","stagnant"],"related":[3675,7251],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6988/","markdown":"## 何を解決するのか\n\nビーコンチェーンでは、各スロットのブロックプロポーザーは、アクティブなバリデーターセットから実効残高で重み付けして擬似ランダムに選ばれます。phase0 のコンセンサス仕様には不整合があります。\n\n- `compute_proposer_index` は、**スラッシュ**されたバリデーターを選ぶことがあります（スラッシュされたバリデーターは、退出エポックまで「アクティブ」のままです）。\n- `process_block_header` は、プロポーザーがスラッシュされているブロックを**拒否**します。\n\nそのため、スラッシュされたバリデーターが選ばれると、そのスロットは確実に空になります。スラッシュが 1 件だけなら損失は無視できる程度ですが、相関したスラッシュが起きると状況が変わります。EIP の例では、バリデーターの 10 分の 1 が同時にスラッシュされた場合、その後しばらくのエポックにわたって提案のおよそ 10 分の 1 が欠落しうるとされており、それはネットワークがすでに負荷を受けているまさにそのときです。\n\n## 仕組み\n\nこの変更は EIP 本文ではなく、コンセンサス仕様（機能 `eip6988`）の中にあります。2 つの部分からなります。\n\n1. **プロポーザー選出でスラッシュ済みの候補をスキップする。** `compute_proposer_index` のサンプリングループは、スラッシュされていない候補だけを受け入れるため、選出は単に次の候補へ進みます。\n2. **`get_beacon_proposer_index` を調整する。** 最新のブロックヘッダーのスロットが `state.slot` と等しい場合、この関数は再計算せず、そのヘッダーに保存されたプロポーザーのインデックスを返します。これがないと、自分のブロックの処理*中*にスラッシュされたプロポーザー（たとえば含まれたスラッシュメッセージによって）は、もはやプロポーザーとして計算されなくなり、そのブロックの報酬計算が壊れます。\n\nプロポーザーの選出はコンセンサスの一部であるため、これは後方互換性がなく、ハードフォークが必要です。\n\n## サンプルコード\n\n追加のチェックを入れた選出ループの説明用の疑似コード（phase0 の関数を簡略化したもの。正確な内容はコンセンサス仕様の該当機能を参照）:\n\n```python\ndef compute_proposer_index(state, indices, seed):\n    MAX_RANDOM_BYTE = 2**8 - 1\n    i = 0\n    total = len(indices)\n    while True:\n        candidate = indices[compute_shuffled_index(i % total, total, seed)]\n        random_byte = hash(seed + uint_to_bytes(uint64(i // 32)))[i % 32]\n        validator = state.validators[candidate]\n        if (not validator.slashed                       # new in EIP-6988\n                and validator.effective_balance * MAX_RANDOM_BYTE\n                    \u003e= MAX_EFFECTIVE_BALANCE * random_byte):\n            return candidate\n        i += 1\n\n\ndef get_beacon_proposer_index(state):\n    if state.latest_block_header.slot == state.slot:   # block already being processed\n        return state.latest_block_header.proposer_index\n    epoch = get_current_epoch(state)\n    seed = hash(get_seed(state, epoch, DOMAIN_BEACON_PROPOSER) + uint_to_bytes(state.slot))\n    indices = get_active_validator_indices(state, epoch)\n    return compute_proposer_index(state, indices, seed)\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。ネットワークアップグレードには予定されておらず、正式な仕様は EIP 文書ではなく、リンク先の consensus-specs の機能です。\n- 影響を受けるのはコンセンサスレイヤーのみで、トランザクション、コントラクト、実行レイヤーには何も変更はありません。\n- consensus-specs のテストケースは、旧来の動作（スラッシュされたバリデーターが選ばれうる）と新しい動作（選ばれない）の両方に加え、プロポーザーが自分のブロック内でスラッシュされた場合の報酬の扱いもカバーしています。\n- [EIP-7251](/eip-7251/) のような後続のコンセンサス変更もプロポーザー選出を変更するため、復活させる場合は現行の仕様に合わせてリベースする必要があります。\n"},"ko":{"lang":"ko","tldr":"정체 상태의 컨센서스 레이어 수정안. 슬래싱된 검증자가 블록 제안자로 뽑히지 않게 하여, 해당 슬롯이 반드시 놓치게 되는 일을 막는다.","tags":["consensus","proposer","slashing","beacon-chain","stagnant"],"related":[3675,7251],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6988/","markdown":"## 어떤 문제를 해결하나요?\n\n비콘 체인에서는 슬롯마다 블록 제안자가 활성 검증자 집합에서 유효 잔액으로 가중해 의사 난수로 선택됩니다. phase0 컨센서스 명세에는 불일치가 있습니다.\n\n- `compute_proposer_index`는 **슬래싱(slashing)**된 검증자를 선택할 수 있습니다(슬래싱된 검증자는 퇴출 에포크까지 \"활성\" 상태로 남습니다).\n- `process_block_header`는 제안자가 슬래싱된 블록을 **거부**합니다.\n\n따라서 슬래싱된 검증자가 뽑히면 그 슬롯은 반드시 비게 됩니다. 슬래싱이 한 건이라면 손실은 무시할 만하지만, 상관된 슬래싱은 상황을 바꿉니다. EIP의 예시로는, 검증자의 10분의 1이 함께 슬래싱되면 이후 여러 에포크 동안 제안의 약 10분의 1을 놓칠 수 있으며, 이는 네트워크가 이미 압박을 받고 있는 바로 그때입니다.\n\n## 어떻게 동작하나요?\n\n이 변경은 EIP 본문이 아니라 컨센서스 명세(기능 `eip6988`)에 있습니다. 두 부분으로 이루어져 있습니다.\n\n1. **제안자 선택에서 슬래싱된 후보를 건너뜁니다.** `compute_proposer_index`의 샘플링 루프는 슬래싱되지 않은 후보만 받아들이므로, 선택은 그냥 다음 후보로 넘어갑니다.\n2. **`get_beacon_proposer_index`를 조정합니다.** 최신 블록 헤더의 슬롯이 `state.slot`과 같으면, 이 함수는 다시 계산하지 않고 그 헤더에 저장된 제안자 인덱스를 반환합니다. 이것이 없으면 자신의 블록을 처리하는 *도중*에 슬래싱된 제안자(예: 포함된 슬래싱 메시지에 의해)는 더 이상 제안자로 계산되지 않아, 그 블록의 보상 계산이 깨집니다.\n\n제안자 선출은 컨센서스의 일부이므로 이는 하위 호환이 되지 않으며 하드포크가 필요합니다.\n\n## 샘플 코드\n\n추가된 검사를 넣은 선택 루프의 설명용 의사 코드(phase0 함수를 단순화한 것이며, 정확한 내용은 consensus-specs의 해당 기능을 참고):\n\n```python\ndef compute_proposer_index(state, indices, seed):\n    MAX_RANDOM_BYTE = 2**8 - 1\n    i = 0\n    total = len(indices)\n    while True:\n        candidate = indices[compute_shuffled_index(i % total, total, seed)]\n        random_byte = hash(seed + uint_to_bytes(uint64(i // 32)))[i % 32]\n        validator = state.validators[candidate]\n        if (not validator.slashed                       # new in EIP-6988\n                and validator.effective_balance * MAX_RANDOM_BYTE\n                    \u003e= MAX_EFFECTIVE_BALANCE * random_byte):\n            return candidate\n        i += 1\n\n\ndef get_beacon_proposer_index(state):\n    if state.latest_block_header.slot == state.slot:   # block already being processed\n        return state.latest_block_header.proposer_index\n    epoch = get_current_epoch(state)\n    seed = hash(get_seed(state, epoch, DOMAIN_BEACON_PROPOSER) + uint_to_bytes(state.slot))\n    indices = get_active_validator_indices(state, epoch)\n    return compute_proposer_index(state, indices, seed)\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 네트워크 업그레이드에 예정되어 있지 않으며, 공식 명세는 EIP 문서가 아니라 링크된 consensus-specs 기능입니다.\n- 컨센서스 레이어에만 영향을 줍니다. 트랜잭션, 컨트랙트, 실행 레이어에는 아무 변화가 없습니다.\n- consensus-specs의 테스트 케이스는 이전 동작(슬래싱된 검증자가 뽑힐 수 있음)과 새 동작(뽑히지 않음)을 모두 다루며, 제안자가 자신의 블록 안에서 슬래싱될 때의 보상 처리도 다룹니다.\n- [EIP-7251](/eip-7251/) 같은 이후의 컨센서스 변경도 제안자 선택을 수정하므로, 되살리려면 현재 명세에 맞춰 리베이스해야 합니다.\n"},"zh":{"lang":"zh","tldr":"一项处于停滞状态的共识层修复：阻止被罚没的验证者被选为区块提议者，使其 slot 不再必然错过。","tags":["consensus","proposer","slashing","beacon-chain","stagnant"],"related":[3675,7251],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6988/","markdown":"## 它解决什么问题？\n\n在信标链上，每个 slot 的区块提议者从活跃验证者集合中按有效余额加权伪随机选出。phase0 共识规范中存在一处不一致：\n\n- `compute_proposer_index` 可能选中已被**罚没（slashed）**的验证者（被罚没的验证者在退出 epoch 之前仍然是\"活跃\"的）。\n- `process_block_header` 会**拒绝**提议者已被罚没的任何区块。\n\n因此，当被罚没的验证者当选时，该 slot 必然为空。单个罚没造成的损失可以忽略，但关联罚没会改变局面：EIP 中的例子是，如果十分之一的验证者同时被罚没，此后若干个 epoch 内大约十分之一的提议可能会被错过，而这恰恰是网络已经承受压力的时候。\n\n## 它如何运作\n\n这项改动位于共识规范（特性 `eip6988`）中，而不在 EIP 文本里。它分为两部分：\n\n1. **在提议者选择中跳过被罚没的候选者。** `compute_proposer_index` 中的采样循环只接受未被罚没的候选者，因此选择会直接转向下一个候选者。\n2. **调整 `get_beacon_proposer_index`。** 如果最新区块头的 slot 等于 `state.slot`，该函数返回存储在该区块头中的提议者索引，而不是重新计算。若没有这一点，在处理自己区块*期间*被罚没的提议者（例如被区块中包含的罚没消息罚没）将不再被计算为提议者，从而破坏该区块的奖励核算。\n\n由于提议者选举属于共识的一部分，这项改动不向后兼容，需要硬分叉。\n\n## 示例代码\n\n加入新增检查后的选择循环的示意伪代码（由 phase0 函数简化而来；确切文本请参阅 consensus-specs 中的该特性）：\n\n```python\ndef compute_proposer_index(state, indices, seed):\n    MAX_RANDOM_BYTE = 2**8 - 1\n    i = 0\n    total = len(indices)\n    while True:\n        candidate = indices[compute_shuffled_index(i % total, total, seed)]\n        random_byte = hash(seed + uint_to_bytes(uint64(i // 32)))[i % 32]\n        validator = state.validators[candidate]\n        if (not validator.slashed                       # new in EIP-6988\n                and validator.effective_balance * MAX_RANDOM_BYTE\n                    \u003e= MAX_EFFECTIVE_BALANCE * random_byte):\n            return candidate\n        i += 1\n\n\ndef get_beacon_proposer_index(state):\n    if state.latest_block_header.slot == state.slot:   # block already being processed\n        return state.latest_block_header.proposer_index\n    epoch = get_current_epoch(state)\n    seed = hash(get_seed(state, epoch, DOMAIN_BEACON_PROPOSER) + uint_to_bytes(state.slot))\n    indices = get_active_validator_indices(state, epoch)\n    return compute_proposer_index(state, indices, seed)\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**：它尚未被安排进任何网络升级，权威规范是所链接的 consensus-specs 特性，而不是 EIP 文档。\n- 它只影响共识层；交易、合约和执行层都不会有任何变化。\n- consensus-specs 中的测试用例既覆盖旧行为（被罚没的验证者可以当选）和新行为（不能当选），也覆盖提议者在自己区块内被罚没时的奖励处理。\n- 后续的共识层变更（如 [EIP-7251](/eip-7251/)）也会修改提议者选择，因此任何复活该提案的尝试都需要基于当前规范重新变基。\n"}}}
