0xMiden / 0xMiden/protocol

Consider adding Validator signatures threshold to Block Header

Aperta
#3,225 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
kernels
Lingua principale
Rust
Stelle
132
Fork
167
Merge medio
1g 23h
PR unite (30g)
110

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.