Skip to content

Add new mode to apply load for tx set validation - #5404

Merged
SirTyson merged 2 commits into
stellar:masterfrom
SirTyson:tx-set-validation-apply-load
Aug 14, 2026
Merged

Add new mode to apply load for tx set validation#5404
SirTyson merged 2 commits into
stellar:masterfrom
SirTyson:tx-set-validation-apply-load

Conversation

@SirTyson

@SirTyson SirTyson commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

This adds a new mode to apply load, allowing us for more "end to end" simulations. In the new mode, we time and simulate ballot phase through the end of apply, but in a single node network such that SCP state transitions occur instantly. This is useful, as it allows us to benchmark the processing overhead associated with consensus, as well as measure cache performance and dedup similar work done during tx set validation and the later application of this transaction set.

The motivation for this test was from my recent block latency experiments. I noticed how optimizations in network calls, reducing bandwidth, etc were not moving the needle on actual block latency. It turned out that consensus latency was greatly affected by CPU based bottlenecks, not just network calls. On supercluster, it's challenging to benchmark CPU costs of concensus, as you can't easily run tracy or profilers and have limited visibility to single node performance. This test allows us to much more easily measure and improve the processing heavy aspects of concensus. In overlay-v2-shared for a block with 6K SAC transfers, we saw about 300 ms of non-network "ingestion" time when receiving a tx set and 500 ms of apply. Imo this was a significant blind spot in our single node apply load tests previously.

Note that the actual number produced by this test is meaningless, as consensus without a network tells us very little about overall performance. However, the reported phase timings are very useful in identifying bottlenecks and comparing solutions. This simulates the processing done by a non-leader node. In the future, it may also be helpful to add a mode for block construction as well.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

@SirTyson
SirTyson requested review from dmkozh and marta-lokhova and a balanced review from Copilot August 4, 2026 20:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional apply-load benchmark path covering tx-set decoding, validation, local consensus, and ledger application.

Changes:

  • Adds configurable validation-and-apply timing.
  • Records phase timings and signature-cache metrics.
  • Documents the mode and new validation metric.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/simulation/ApplyLoad.h Declares timing paths and phase statistics.
src/simulation/ApplyLoad.cpp Implements consensus-backed benchmarking.
src/main/Config.h Defines timing configuration.
src/main/Config.cpp Parses timing configuration.
src/herder/HerderSCPDriver.h Declares validation timer.
src/herder/HerderSCPDriver.cpp Instruments tx-set validation.
docs/software/commands.md Documents apply-load timing paths.
docs/metrics.md Documents the validation metric.
docs/apply-load-benchmark-sac.cfg Adds example timing configuration.

Comment thread src/simulation/ApplyLoad.cpp Outdated
Comment thread src/herder/HerderSCPDriver.cpp Outdated
Comment thread docs/software/commands.md Outdated
Comment thread docs/apply-load-benchmark-sac.cfg Outdated
Comment thread docs/software/commands.md Outdated
Comment thread src/herder/HerderSCPDriver.cpp Outdated
Comment thread src/simulation/ApplyLoad.h Outdated
Comment thread docs/apply-load-benchmark-sac.cfg
Comment thread src/simulation/ApplyLoad.cpp Outdated
Comment thread src/simulation/ApplyLoad.cpp Outdated
Comment thread src/simulation/ApplyLoad.cpp Outdated
Comment thread src/simulation/ApplyLoad.cpp Outdated
@SirTyson
SirTyson requested a review from dmkozh August 13, 2026 18:19
@SirTyson

Copy link
Copy Markdown
Contributor Author

Should have addressed all the comments, sorry for the delay, I've been in bug finding mode...

@dmkozh dmkozh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'm not sure if master is open yet.

@SirTyson
SirTyson added this pull request to the merge queue Aug 14, 2026
Merged via the queue into stellar:master with commit 100cc38 Aug 14, 2026
70 checks passed
@SirTyson
SirTyson deleted the tx-set-validation-apply-load branch August 14, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants