Skip to content

Skip building invariant delta when no invariants are enabled.#5289

Open
dmkozh wants to merge 1 commit into
stellar:masterfrom
dmkozh:invariant_skip
Open

Skip building invariant delta when no invariants are enabled.#5289
dmkozh wants to merge 1 commit into
stellar:masterfrom
dmkozh:invariant_skip

Conversation

@dmkozh
Copy link
Copy Markdown
Contributor

@dmkozh dmkozh commented May 22, 2026

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

  • 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 May 22, 2026 17:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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::parallelApply behind a new Config::invariantsEnabled() helper.
  • Rename TxEffects/parallel-apply delta APIs to clarify they exist specifically for invariants.
  • Skip checkAllTxBundleInvariants entirely 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.

Comment thread src/transactions/ParallelApplyUtils.cpp Outdated
Comment thread src/ledger/LedgerManagerImpl.cpp
The delta is only used for invariants, so also updated the naming to reflect that.
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.

2 participants