linera-protocol
linera-protocol copied to clipboard
Simplify and optimize quorum calculation.
Motivation
The current Committee implementation is a bit complicated, and sometimes sets the quorum threshold higher than necessary.
Proposal
The assumption is that $$N \geq 3 f + 1$$, where $$f$$ is the fault tolerance, i.e. the maximum total votes of the faulty validators. The validity threshold is $$f + 1$$. Given $$N$$, the highest possible value for $$f$$ is therefore $$\lceil N / 3 \rceil - 1$$.
The quorum threshold $$q$$ is minimal such that any two quorum intersect in at least a validity threshold (i.e. have at least one honest validator in common), i.e. $$2 q - N \geq f + 1$$. Thus $$q = \lceil (N + f + 1) / 2 \rceil$$.
In particular, if e.g. $$N = 3$$, then $$f = 0$$ and $$q = 2$$.
This change revealed an issue with the certificate handling logic in the worker: committees_for returns ViewErrors instead of BlobsNotFound/EventsNotFound, so the client fails to send the validators the admin chain if needed.
This was fixed; I also kept minor cleanups I made while debugging this.
Test Plan
CI
Release Plan
- Nothing to do / These changes follow the usual release cycle.