Repository navigation
Skip building invariant delta when no invariants are enabled. - #5289
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes parallel Soroban transaction application by skipping construction of the ledger-entry delta used for invariant checking when no invariants are configured/enabled, and renames related APIs to make the delta’s purpose explicit.
Changes:
- Guard delta construction in
TransactionFrame::parallelApplybehind a newConfig::invariantsEnabled()helper. - Rename
TxEffects/parallel-apply delta APIs to clarify they exist specifically for invariants. - Skip
checkAllTxBundleInvariantsentirely when invariants are disabled, and relocate refundable-fee meta setting accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/transactions/TransactionFrame.cpp | Avoids building invariant-only deltas when invariants are disabled. |
| src/transactions/ParallelApplyUtils.h | Renames thread-state helper to reflect invariant-specific delta. |
| src/transactions/ParallelApplyUtils.cpp | Updates delta construction to write into invariant-specific delta storage. |
| src/transactions/ParallelApplyStage.h | Renames TxEffects delta storage/accessors to invariant-specific names. |
| src/main/Config.h | Adds Config::invariantsEnabled() API. |
| src/main/Config.cpp | Implements Config::invariantsEnabled() based on INVARIANT_CHECKS. |
| src/ledger/LedgerManagerImpl.cpp | Skips invariant checks when disabled; updates delta accessor usage; adjusts refundable-fee meta placement. |
The delta is only used for invariants, so also updated the naming to reflect that.
graydon
reviewed
May 29, 2026
graydon
left a comment
Contributor
There was a problem hiding this comment.
I'm not clear on one of the changes here, otherwise looks ok?
graydon
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Skip building invariant delta when no invariants are enabled.
The delta is only used for invariants, so also updated the naming to reflect that.
Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)