Skip to content

Misc apply load improvements - #5196

Merged
dmkozh merged 2 commits into
stellar:masterfrom
dmkozh:apply_load_upd
Apr 1, 2026
Merged

dmkozh merged 2 commits into
stellar:masterfrom
dmkozh:apply_load_upd

Conversation

@dmkozh

@dmkozh dmkozh commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Description

  • Added a new mode for simply benchmarking closing ledgers with N model transactions (currently only SAC transfer supported). This is faster and less noisy than max TPS test and should serve better for quick feedback for perf experiments.
  • Use genesis accounts to dramatically speed up the setup (especially for high TPS)
  • Validate SAC transactions to also prime signature cache
  • Block benchmark on resolving hot archive BL futures (might be relevant when hot archive is involved)
  • Moved all the command line params to config to simplify the runs
  • Add more logging, including logging the build and config info for the proper comparison between builds/runs
  • Update and streamline the sample configs.

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

Copilot AI review requested due to automatic review settings March 25, 2026 18:05

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

This PR improves the apply-load benchmarking harness to be faster to set up, add a fixed-size “benchmark” mode for model transactions, and make runs more reproducible by moving mode selection into config and logging build/config snapshots.

Changes:

  • Added BENCHMARK_MODEL_TX mode and shifted apply-load mode/model selection into Config (APPLY_LOAD_MODE, APPLY_LOAD_MODEL_TX).
  • Switched apply-load setup to use genesis accounts (avoids account-creation transactions) and added extra validation/logging around benchmarking runs.
  • Updated CLI/docs/sample configs accordingly; improved Visual Studio Rust build script caching and project file completeness.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/test/TxTests.cpp Adjusted genesis-account helper assertion behavior.
src/simulation/test/LoadGeneratorTests.cpp Updated apply-load acceptance tests for config-driven mode selection; added benchmark test.
src/simulation/ApplyLoad.h Constructor now reads mode from config; added benchmark-mode API surface.
src/simulation/ApplyLoad.cpp Genesis-account setup, benchmark-model-tx implementation, added environment/config logging, extra validations.
src/main/Config.h Introduced test-only enums + apply-load config fields; added loaded-TOML snapshot storage.
src/main/Config.cpp Added parsing for new apply-load config keys; persisted loaded TOML text.
src/main/CommandLine.h Exposed writeVersionInfo(std::ostream&) for reuse.
src/main/CommandLine.cpp Removed --mode flag; apply-load now driven by config; refactored version printing.
docs/software/commands.md Documented config-based apply-load mode selection and new benchmark mode.
docs/apply-load-max-sac-tps.cfg Updated sample to config-driven mode + refreshed parameters/boilerplate.
docs/apply-load-limits-for-model-tx.cfg Updated sample to config-driven mode + refreshed parameters/boilerplate.
docs/apply-load-ledger-limits.cfg Updated sample to config-driven mode + refreshed parameters/boilerplate.
docs/apply-load-for-meta.cfg Updated sample to config-driven mode + refreshed parameters/boilerplate.
docs/apply-load-benchmark.cfg New sample config for fixed-size benchmark mode.
Builds/VisualStudio/stellar-core.vcxproj.filters Added missing main/BannedAccountsPersistor files to VS filters.
Builds/VisualStudio/stellar-core.vcxproj Added missing main/BannedAccountsPersistor files to VS project.
Builds/VisualStudio/build_rust.bat Extended protocol range and added incremental rebuild logic for protocol libs.

Comment thread src/simulation/ApplyLoad.cpp Resolved
Comment thread src/simulation/ApplyLoad.cpp Resolved
Comment thread Builds/VisualStudio/build_rust.bat Resolved
Comment thread src/main/CommandLine.cpp Resolved
Comment thread src/test/TxTests.cpp Resolved
Comment thread src/simulation/ApplyLoad.cpp Resolved
dmkozh added 2 commits March 30, 2026 13:24
- Fix the project
- Improve the Rust build: avoid stale builds and skip unnecessary builds.
- Added a new mode for simply benchmarking closing ledgers with N model transactions (currently only SAC transfer supported). This is faster and less noisy than max TPS test and should serve better for quick feedback for perf experiments.
- Use genesis accounts to dramatically speed up the setup (especially for high TPS)
- Validate SAC transactions to also prime signature cache
- Block benchmark on resolving hot archive BL futures (might be relevant when hot archive is involved)
- Moved all the command line params to config to simplify the runs
- Add more logging, including logging the build and config info for the proper comparison between builds/runs
- Update and streamline the sample configs.
@dmkozh
dmkozh added this pull request to the merge queue Apr 1, 2026
Merged via the queue into stellar:master with commit 965c4d0 Apr 1, 2026
60 checks passed
@dmkozh
dmkozh deleted the apply_load_upd branch April 1, 2026 20:39
tamirms added a commit to tamirms/stellar-core that referenced this pull request Jun 5, 2026
runApplyLoad() force-set config.NETWORK_PASSPHRASE = "Apply Load", silently
overriding whatever passphrase the operator configured. This was introduced in
stellar#5196 (as part of "moved all the command line params to config") and breaks
consumers of the emitted metadata: every transaction in METADATA_OUTPUT_STREAM
is hashed under the "Apply Load" network ID instead of the configured one, so
the standard ingestion reader -- which pairs transaction envelopes to their
results by transaction hash -- rejects the meta with "unknown tx hash in
LedgerCloseMeta".

NETWORK_PASSPHRASE is an ordinary config field and nothing in apply-load needs
it pinned (contract IDs and tx hashes derive from the network ID, which derives
from whatever passphrase is set, so the run is self-consistent under any value).
Remove the override so apply-load uses the configured passphrase, as it did
before stellar#5196, and restore NETWORK_PASSPHRASE in the sample cfgs.

Extract runApplyLoad()'s config setup into configureApplyLoad() and add a
regression test that asserts the configured NETWORK_PASSPHRASE survives.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
pull Bot pushed a commit to DIGIIX-Ltd/stellar-core that referenced this pull request Jun 5, 2026
)

`apply-load` overrides `NETWORK_PASSPHRASE` with a hardcoded `"Apply
Load"`, ignoring whatever the operator configured (added in stellar#5196). This
breaks the emitted meta: transactions end up hashed for the wrong
network, so consumers that ingest it under the configured passphrase
fail with `unknown tx hash in LedgerCloseMeta`.

The passphrase doesn't need to be pinned in code — contract IDs and tx
hashes derive from the network ID, so the run is self-consistent under
whatever is configured. This drops the override and sets
`NETWORK_PASSPHRASE="Apply Load"` in the sample and AWS apply-load
templates, so their behavior is identical while operators can now
override it from their own config.
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