Skip to content

Simulate apply configs now support parallel apply - #5255

Merged
marta-lokhova merged 1 commit into
stellar:masterfrom
marta-lokhova:simulateApplyMultiThread
May 7, 2026
Merged

marta-lokhova merged 1 commit into
stellar:masterfrom
marta-lokhova:simulateApplyMultiThread

Conversation

@marta-lokhova

@marta-lokhova marta-lokhova commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

This change is needed to properly simulate apply time in overlay-only mode with Soroban tx profiles. We haven't used these flags in a while, so they broke overtime. This change fixes them, and also performs some cleanup (such as removing obsolete MODE_STORES_HISTORY mode).

@marta-lokhova
marta-lokhova marked this pull request as ready for review May 6, 2026 21:55
Copilot AI review requested due to automatic review settings May 6, 2026 21:55

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 adjusts testing/simulation-only configuration and application-time sleep injection to work correctly with parallel ledger apply, and removes the now-obsolete MODE_STORES_HISTORY_MISC toggle.

Changes:

  • Move OP_APPLY_SLEEP_TIME_*_FOR_TESTING config fields/parsing/validation behind #ifdef BUILD_TESTS.
  • Update ledger-apply sleep simulation to use a local PRNG (instead of getGlobalRandomEngine()) to avoid main-thread-only RNG assumptions under parallel apply.
  • Remove MODE_STORES_HISTORY_MISC and make related history/SCP-history persistence unconditional (with existing internal gating such as publishEnabled() still applying where relevant).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/Config.h Gates OP-apply sleep testing config behind BUILD_TESTS; removes MODE_STORES_HISTORY_MISC; exposes processOpApplySleepTimeForTestingConfigs() under tests.
src/main/Config.cpp Gates OP-apply sleep parsing/initialization/processing behind BUILD_TESTS; removes MODE_STORES_HISTORY_MISC defaulting/handling.
src/main/CommandLine.cpp Removes special-case behavior that toggled MODE_STORES_HISTORY_MISC based on OP-apply sleep settings.
src/main/ApplicationImpl.cpp Removes config validation tied to MODE_STORES_HISTORY_MISC vs writable history archives.
src/ledger/LedgerManagerImpl.h Adds local PRNG member (tests only) for sleep simulation.
src/ledger/LedgerManagerImpl.cpp Switches sleep simulation RNG source; makes appendTransactionSet unconditional; calls sleep simulation under BUILD_TESTS.
src/herder/HerderImpl.cpp Makes SCP history persistence unconditional by removing the MODE_STORES_HISTORY_MISC guard.

Comment thread src/ledger/LedgerManagerImpl.cpp Resolved
@marta-lokhova
marta-lokhova force-pushed the simulateApplyMultiThread branch from 683f9ff to 49e1c0e Compare May 6, 2026 23:04
Comment thread src/ledger/LedgerManagerImpl.cpp Resolved
@marta-lokhova
marta-lokhova added this pull request to the merge queue May 7, 2026
Merged via the queue into stellar:master with commit 7420510 May 7, 2026
53 checks passed
@marta-lokhova
marta-lokhova deleted the simulateApplyMultiThread branch May 7, 2026 16:37
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