subsystem-summary-of-scp
Installation
SKILL.md
SCP Subsystem — Technical Summary
Overview
The SCP (Stellar Consensus Protocol) subsystem implements the federated Byzantine agreement protocol used by stellar-core to reach consensus on ledger values. It is a self-contained library with a clean driver interface (SCPDriver) that decouples protocol logic from networking, persistence, and application-specific validation. The protocol operates in two main stages: nomination (proposing and filtering candidate values) and balloting (converging on a single value through prepare/confirm/externalize phases).
Key Files
- SCP.h / SCP.cpp — Top-level
SCPclass; entry point for receiving envelopes, nominating values, managing slots. - SCPDriver.h / SCPDriver.cpp — Abstract driver interface that the application implements; handles signing, validation, timers, quorum set retrieval, hashing, and event callbacks.
- Slot.h / Slot.cpp — Per-slot state container; owns
NominationProtocolandBallotProtocolinstances. - NominationProtocol.h / NominationProtocol.cpp — Nomination phase logic: voting for values, federated acceptance, candidate promotion.
- BallotProtocol.h / BallotProtocol.cpp — Ballot phase logic: prepare/confirm/externalize state machine, ballot bumping, timer management.
- LocalNode.h / LocalNode.cpp — Represents the local node; owns quorum set, provides quorum slice / v-blocking set checks.
- QuorumSetUtils.h / QuorumSetUtils.cpp — Quorum set sanity checking and normalization utilities.