EIP-8080 · Draft(草案) · Core(核心) · 2025-11-13
EIP-8080: Let exits use the consolidation queue
共识层变更草案:只要整合队列比退出队列短,就把验证者退出路由到整合队列,让每位质押者都能使用目前只有 2048 ETH 验证者才能用的捷径,在不削弱安全性的前提下提高最大退出吞吐量。
它解决什么问题?
离开信标链的验证者要在退出队列中等待,退出“流失量”(churn)对其限速,以免验证者集合变化过快(这样可以保护弱主观性周期)。自 Pectra 起,还有一个单独的整合队列用于合并验证者,由 EIP-7251 引入。
根据规范,退出队列长期超过四十天,而整合队列通常较短。持有至少 2048 ETH 的验证者可以利用整合逻辑中的漏洞,经由整合队列退出,从而插队。较小的验证者,包括无法发行流动性质押代币的个人质押者,则做不到。EIP-8080 把这条捷径向所有人开放,消除了这种不公平。
它如何运作
在共识规范函数 compute_exit_epoch_and_update_churn 的开头增加一个检查:
- 如果最早可用的退出 epoch 晚于最早可用的整合 epoch,则该退出改为通过整合队列来安排。
- 它消耗的整合 churn 等于退出余额的 2/3,因为从弱主观性的角度看,一个单位的退出 churn 相当于 2/3 个单位的整合 churn。这使得无论整合 churn 被用于整合还是退出,对安全性的影响都完全相同。
- 否则,退出的处理方式与之前完全一样。
以规范自己的例子(约 3,570 万 ETH 被质押)来看,最大退出吞吐量会从每个 epoch 256 ETH 提高到 256 + (544 − 256) × 3/2 = 每个 epoch 688 ETH,约为目前上限的 2.5 倍。总 churn,也就是弱主观性周期,并不改变;闲置的整合容量只是不再被浪费。
示例代码
规范中修改后的函数(Python,共识规范风格):
def compute_exit_epoch_and_update_churn(state: BeaconState, exit_balance: Gwei) -> Epoch:
activation_exit_epoch = compute_activation_exit_epoch(get_current_epoch(state))
earliest_exit_epoch = max(state.earliest_exit_epoch, activation_exit_epoch)
# NEW: use the consolidation queue if it is shorter
earliest_consolidation_epoch = max(state.earliest_consolidation_epoch, activation_exit_epoch)
if earliest_exit_epoch > earliest_consolidation_epoch:
return compute_consolidation_epoch_and_update_churn(state, 2 * exit_balance // 3)
# Unchanged exit-queue logic below
per_epoch_churn = get_exit_churn_limit(state)
if state.earliest_exit_epoch < earliest_exit_epoch:
exit_balance_to_consume = per_epoch_churn
else:
exit_balance_to_consume = state.exit_balance_to_consume
if exit_balance > exit_balance_to_consume:
balance_to_process = exit_balance - exit_balance_to_consume
additional_epochs = (balance_to_process - 1) // per_epoch_churn + 1
earliest_exit_epoch += additional_epochs
exit_balance_to_consume += additional_epochs * per_epoch_churn
state.exit_balance_to_consume = exit_balance_to_consume - exit_balance
state.earliest_exit_epoch = earliest_exit_epoch
return state.earliest_exit_epoch