文章探讨了在FOCIL(一种新型的区块包含机制)中选择包含列表委员会成员的几种方法,比较了Beacon委员会方法、同步委员会方法和聚合器方法,各有优缺点,例如在可验证性、保密性和实现复杂性方面存在差异。文章最后指出,FOCIL目前使用了最简单的Beacon委员会方法。
我们可能不太关心基于以下属性优化选择:
以类似于信标委员会的方式选择包含列表委员会。 使用信标状态、epoch 和种子,我们获得洗牌后的索引并将它们划分到Slot中。 这些Slot索引的子集构成包含列表委员会。
def get_inclusion_list_committee(state: BeaconState, slot: Slot) -> Vector[ValidatorIndex, IL_COMMITTEE_SIZE]:
epoch = compute_epoch_at_slot(slot)
seed = get_seed(state, epoch, DOMAIN_IL_COMMITTEE)
indices = get_active_validator_indices(state, epoch)
start = (slot % SLOTS_PER_EPOCH) * IL_COMMITTEE_SIZE
end = start + IL_COMMITTEE_SIZE
return [indices[compute_shuffled_index(uint64(i), uint64(len(indices)), seed)] for i in range(start, end)]
备注:
这是一个改进的版本,更具可读性和清晰度:
以类似于 proposer 和同步委员会的采样方式选择包含列表委员会。 洗牌后的索引逐个处理,有效余额会影响选择结果。
def get_inclusion_list_committee(state: BeaconState) -> Sequence[ValidatorIndex]:
epoch = Epoch(get_current_epoch(state) + 1)
MAX_RANDOM_BYTE = 2**8 - 1
active_validator_indices = get_active_validator_indices(state, epoch)
active_validator_count = uint64(len(active_validator_indices))
seed = get_seed(state, epoch, DOMAIN_IL_COMMITTEE)
i = 0
inclusion_list_committee_indices: List[ValidatorIndex] = []
while len(inclusion_list_committee_indices) < IL_COMMITTEE_SIZE:
shuffled_index = compute_shuffled_index(uint64(i % active_validator_count), active_validator_count, seed)
>- 原文链接: [hackmd.io/@ttsao/il-comm...](https://hackmd.io/@ttsao/il-committee-selection)
>- 登链社区 AI 助手,为大家转译优秀英文文章,如有翻译不通的地方,还请包涵~
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!