subsystem-summary-of-simulation
Simulation Subsystem — Technical Summary
Overview
The simulation subsystem provides infrastructure for creating multi-node network simulations and generating synthetic transaction load for testing and benchmarking stellar-core. It has four major components: (1) Simulation — orchestrates multiple Application instances as virtual or TCP-connected nodes, (2) Topologies — factory functions producing pre-configured network shapes, (3) LoadGenerator — drives sustained transaction submission at configurable rates, and (4) ApplyLoad — a closed-loop benchmarking harness that bypasses the overlay to measure raw ledger-close performance. A shared TxGenerator class constructs all transaction types (classic payments, Soroban uploads, invocations, SAC transfers, upgrades).
Key Files
- Simulation.h / Simulation.cpp —
Simulationclass; manages nodes, clocks, loopback/TCP connections, and event-loop cranking. - Topologies.h / Topologies.cpp — Static factory methods producing
Simulationinstances with specific network topologies. - LoadGenerator.h / LoadGenerator.cpp —
LoadGeneratorclass; timer-driven load submission loop, account management, metrics, completion tracking. - TxGenerator.h / TxGenerator.cpp —
TxGeneratorclass; creates all transaction types (payments, Soroban upload/invoke/upgrade, SAC, batch transfer). - ApplyLoad.h / ApplyLoad.cpp —
ApplyLoadclass; offline benchmarking: sets up contracts, populates bucket list, runs ledger-close iterations, binary-searches for maximum throughput.
Key Classes and Data Structures
Simulation
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