---
eip: 8045
label: EIP-8045
title: Exclude slashed validators from proposing
status: Last Call
type: Standards Track
category: Core
created: 2025-10-16
requires: 7917
official: https://eips.ethereum.org/EIPS/eip-8045
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8045.md
canonical: https://eips.huatuo.xyz/zh/eip-8045/
lang: zh
tldr: 阻止被罚没（slashed）的验证者被选为区块提议者，使大规模罚没事件不再导致长时间连续错过 slot。
tags: [consensus, validators, slashing, proposers, resilience]
---

# EIP-8045: Exclude slashed validators from proposing

> Modify proposer selection to exclude slashed validators, improving network resilience and performance after mass slashings

**TL;DR:** 阻止被罚没（slashed）的验证者被选为区块提议者，使大规模罚没事件不再导致长时间连续错过 slot。

## 它解决什么问题？

被罚没的验证者在强制退出完成之前仍留在活跃集合中，在此期间它仍可能被选中提议区块。但信标链的状态转换本来就会拒绝被罚没提议者的任何区块。因此每次选中这样的验证者，该 slot 就会被直接错过。

偶尔发生的罚没只是小麻烦。但在**大规模罚没**之后（例如某个流行客户端或质押方案出现 bug），许多验证者可能同时被罚没，链可能长时间性能下降，出现大量空 slot，而且很可能发生在网络本已陷入困境、正试图恢复的时候。

## 它如何运作

改动在共识规范中只有一行：`get_beacon_proposer_indices` 在洗牌**之前**从候选列表中过滤掉被罚没的验证者。其余活跃且未被罚没的验证者之间的选择保持不变，仍按有效余额加权。

过去之所以没有这样做，是因为排除被罚没的验证者会在每次处理罚没时打乱未来的提议者，破坏前瞻的稳定。[EIP-7917](/eip-7917/) 通过把提议者前瞻存入信标状态解决了这一问题。日程提前固定后，之后处理的罚没不再改变它，过滤就变得安全了。

作者考虑过另一种方案（先对所有人洗牌，再跳过被罚没的选中者）。它的具体选择结果略有不同，但目标相同；他们为了简单选择了预先过滤。

## 示例代码

规范中修改后的函数：

```python
def get_beacon_proposer_indices(
    state: BeaconState, epoch: Epoch
) -> Vector[ValidatorIndex, SLOTS_PER_EPOCH]:
    """Return the proposer indices for the given ``epoch``."""
    # Modified to exclude slashed validators
    indices = [
        i for i in get_active_validator_indices(state, epoch)
        if not state.validators[i].slashed
    ]
    seed = get_seed(state, epoch, DOMAIN_BEACON_PROPOSER)
    return compute_proposer_indices(state, epoch, seed, indices)
```

## 需要注意

- **状态：Last Call**（规范中的截止日期为 2026-11-01）。它已接近最终，但仍可能改变。
- 这是共识规则的改动，必须随计划中的网络升级发布；它依赖 [EIP-7917](/eip-7917/)。
- 已经在存储的前瞻中的提议者 slot 不受新罚没影响；过滤在计算未来 epoch 时生效。
- 诚实验证者之间的公平性不变；他们只是获得了原本会被被罚没验证者浪费的 slot。
- 本 EIP 不改变罚没惩罚和退出时间。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8045
