scp_kernel/lib.rs
1//! The Stellar Consensus Protocol (SCP) kernel: federated voting, nomination
2//! and the ballot protocol, following stellar-core's implementation, over
3//! Thruput's protocol types from [`thruput_scp`].
4//!
5//! The application supplies two things. A [`Consensus`] validates and
6//! combines its values and receives progress notifications through
7//! [`ConsensusNotify`]. A [`Driver`] supplies quorum sets by hash, hashes and
8//! signs for the node, emits envelopes to peers and runs the timers.
9//! [`StellarKernel::new`] takes both, with the node ID, the validator flag
10//! and the local quorum set. [`StellarKernel::proto`] returns the
11//! [`StellarProto`] through which envelopes from peers arrive
12//! ([`DriverCb::received_envelope`]), values are nominated
13//! ([`StellarProto::nominate`]) and expired timers are delivered
14//! ([`DriverCb::driver_calling_back`]).
15//!
16//! The kernel does not verify envelope signatures. Envelopes must be
17//! authenticated before they reach it; see [`DriverCb`].
18//!
19//! [`verifier`] checks, outside a running kernel, that a set of
20//! `EXTERNALIZE` envelopes proves a slot externalized under a quorum set.
21//!
22//! Everything in [`scp_util`] is re-exported.
23
24pub use scp_util::*;
25
26mod consensus;
27pub use consensus::*;
28
29mod driver;
30pub use driver::*;
31
32pub mod stellar;
33pub use stellar::*;
34
35pub mod kernel;
36pub use kernel::*;
37
38pub mod info;
39pub use info::*;
40
41pub mod local;
42pub use local::*;
43
44pub mod federated;
45pub use federated::*;
46
47pub mod verifier;
48pub use verifier::*;
49
50pub mod slot;
51pub use slot::*;
52
53pub mod qset;
54pub use qset::*;
55
56pub mod ballotutil;
57pub use ballotutil::*;
58
59pub mod phase;
60pub use phase::*;
61
62pub mod envelope;
63pub use envelope::*;
64
65pub mod nomination;
66pub use nomination::*;
67
68pub mod ballot;
69pub use ballot::*;
70
71pub mod heuristic;
72pub use heuristic::*;
73
74pub mod util;
75pub use util::*;
76
77// The test harness, for this crate's tests only.
78#[cfg(test)]
79pub mod unitkernel;
80#[cfg(test)]
81pub use unitkernel::*;
82
83#[cfg(test)]
84pub mod testkernel;
85#[cfg(test)]
86pub use testkernel::*;
87
88#[cfg(test)]
89pub mod testutil;
90#[cfg(test)]
91pub use testutil::*;
92
93#[cfg(test)]
94mod qset_test;
95
96#[cfg(test)]
97mod unit_test;
98
99#[cfg(test)]
100mod stellar_test;
101
102#[cfg(test)]
103mod span_test;