subsystem-summary-of-herder
Installation
SKILL.md
Herder Subsystem Technical Summary
Overview
The Herder subsystem drives the Stellar Consensus Protocol (SCP) for stellar-core. It is responsible for collecting transactions from the network, proposing transaction sets for consensus, validating SCP messages, managing protocol upgrades, and delivering externalized ledger values to the LedgerManager for application. All core Herder logic runs on the main thread.
Key Classes and Data Structures
Herder (Abstract Interface)
- File:
Herder.h - Pure virtual interface defining the public API for the subsystem.
- Defines constants:
TARGET_LEDGER_CLOSE_TIME_BEFORE_PROTOCOL_VERSION_23_MS(5s),MAX_SCP_TIMEOUT_SECONDS(240s),CONSENSUS_STUCK_TIMEOUT_SECONDS(35s),OUT_OF_SYNC_RECOVERY_TIMER(10s),LEDGER_VALIDITY_BRACKET(100 slots),MAX_TIME_SLIP_SECONDS(60s),TX_SET_GC_DELAY(1 min). - Defines state machine:
HERDER_BOOTING_STATE→HERDER_SYNCING_STATE→HERDER_TRACKING_NETWORK_STATE. - Defines
EnvelopeStatus:DISCARDED,SKIPPED_SELF,PROCESSED,FETCHING,READY.