subsystem-summary-of-herder
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.
HerderImpl (Core Implementation)
- File:
HerderImpl.h,HerderImpl.cpp(~2679 lines)
More from stellar/stellar-core
running-tests
running tests at various levels from smoke tests to full suite to randomized tests
1subsystem-summary-of-test
read this skill for a token-efficient summary of the test subsystem
1subsystem-summary-of-scp
read this skill for a token-efficient summary of the scp subsystem
1running-make-to-build
how to run make correctly to get a good build, and otherwise understand the build system
1subsystem-summary-of-history
read this skill for a token-efficient summary of the history subsystem
1subsystem-summary-of-invariant
read this skill for a token-efficient summary of the invariant subsystem
1