1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
use Arc;
use crateQuorumTree;
use crateVecProgress;
use crateverify_intersection;
/// Common interface for every quorum rule supported by this crate.
///
/// A quorum is a collection of nodes that a read or write operation in a distributed system has to
/// contact. See: <http://web.mit.edu/6.033/2005/wwwdocs/quorum_note.html>
///
/// Every implementation must follow three rules:
///
/// - Upward-closed: adding IDs to an accepted quorum keeps it accepted. [`VecProgress`] and
/// [`verify_intersection`] rely on this rule.
/// - Closed over [`ids()`](Self::ids): an ID that `ids()` does not yield never changes the result
/// of [`is_quorum()`](Self::is_quorum). [`verify_intersection`] enumerates only the IDs that
/// `ids()` yields, so it relies on this rule.
/// - Duplicate-safe: an ID that appears more than once in the `is_quorum()` input counts once, so
/// callers may pass an iterator with repeats.
///
/// The crate provides implementations for flat majority sets, joint quorum sets, and hierarchical
/// [`QuorumTree`] rules.