0xMiden / 0xMiden/protocol

Consider adding Validator signatures threshold to Block Header

Abierto
#3,225 0 comentarios 0 reacciones 0 asignados Ver en GitHub
kernels
Lenguaje dominante
Rust
Estrellas
132
Forks
167
Merge medio
1 d 23 h
PR fusionados (30 d)
110

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.