0xMiden / 0xMiden/protocol

Consider adding Validator signatures threshold to Block Header

Aberta
#3,225 0 comentários 0 reações 0 responsáveis Ver no GitHub
kernels
Linguagem predominante
Rust
Estrelas
132
Forks
167
Merge médio
1d 23h
PRs com merge (30d)
110

Descrição

> 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_

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.