0xMiden / 0xMiden/protocol

Consider adding Validator signatures threshold to Block Header

未关闭
#3,225 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
kernels
主要语言
Rust
星标
132
派生
167
平均合并
1 天 23 小时
30 天内合并 PR
110

描述

> Is this not sufficient as a commitment to the number of validators

yes this commits to the total number of validators authorized to sign the block.

But it says nothing about the threshold which is currently implicit in `verify_against`: it requires `self.signatures.len()` equals `validator_keys.len()`, i.e. implicitly setting the threshold to `n-of-n`. See also @bobbinth's comment:
> I guess we could encode the threshold in the header and for now always set it to n. This way, we could avoid header format change if/when we decide to go to m-of-n setup.

Regarding timing:

> But I also think that we could do this later as we'll probably change the header format a few times after mainnet.

My preference would be to already encode the threshold **explicitly** in the `ValidatorKeys` struct (even if an explicit `n-of-n`), and thereby adapt `verify_against` to check only the required number of signatures. Unless I'm missing something, it's a simple change.
But sure, we _could_ also start with an **implicit** `n-of-n` for now, merge this PR and open an issue to track support for `m-of-n`. The current state of this PR works and I don't want to consider it a blocker

_Originally posted by @mmagician in https://github.com/0xMiden/protocol/pull/3174#discussion_r3527758884_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。