Skip to content

Refactored ParallelTxReturnVal - #5108

Merged
SirTyson merged 1 commit into
masterfrom
refactor-parallel-apply-return
Feb 26, 2026
Merged

SirTyson merged 1 commit into
masterfrom
refactor-parallel-apply-return

Conversation

@SirTyson

Copy link
Copy Markdown
Contributor

Description

Resolves #5084

Simplifies ParallelTxReturnVal on failed TXs by returning a std::nullopt instead of a weird, half baked version of the return val.

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 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

Refactors the parallel-apply return type to avoid “sentinel” failure values by returning std::optional and only constructing a success payload on successful parallel apply, addressing #5084.

Changes:

  • Replaces ParallelTxReturnVal with ParallelTxSuccessVal and returns it via std::optional from parallel-apply APIs.
  • Updates transaction/operation parallel-apply call sites to use if (res) / *res instead of getSuccess().
  • Simplifies TxParallelApplyLedgerState result handling by returning std::nullopt on failure.

Reviewed changes

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

Show a summary per file
File Description
src/transactions/test/TransactionTestFrame.h Updates test wrapper parallel-apply signature to return optional success value.
src/transactions/test/TransactionTestFrame.cpp Updates implementation to forward optional success value.
src/transactions/TransactionMeta.h Updates meta builder API to accept success-only parallel apply value.
src/transactions/TransactionMeta.cpp Updates implementation to match new success-only type.
src/transactions/TransactionFrameBase.h Renames return payload type and switches parallelApply to std::optional<ParallelTxSuccessVal>.
src/transactions/TransactionFrame.h Updates TransactionFrame parallelApply override to optional success value.
src/transactions/TransactionFrame.cpp Returns std::nullopt on failures and updates success checks/dereferences.
src/transactions/RestoreFootprintOpFrame.h Updates parallel apply signature to return optional success value.
src/transactions/RestoreFootprintOpFrame.cpp Simplifies helper result handling to return optional directly.
src/transactions/ParallelApplyUtils.h Updates thread-state APIs and tx-state result API to use success-only value + optional.
src/transactions/ParallelApplyUtils.cpp Removes getSuccess() assertions and returns std::nullopt on failure in takeResult.
src/transactions/OperationFrame.h Updates operation parallel-apply APIs to return optional success value.
src/transactions/OperationFrame.cpp Updates definitions to match optional success value return type.
src/transactions/InvokeHostFunctionOpFrame.h Updates parallel apply signature to return optional success value.
src/transactions/InvokeHostFunctionOpFrame.cpp Simplifies helper result handling to return optional directly.
src/transactions/FeeBumpTransactionFrame.h Updates fee-bump parallelApply override to return optional success value.
src/transactions/FeeBumpTransactionFrame.cpp Updates delegation to return optional directly.
src/transactions/ExtendFootprintTTLOpFrame.h Updates parallel apply signature to return optional success value.
src/transactions/ExtendFootprintTTLOpFrame.cpp Simplifies helper result handling to return optional directly.
src/ledger/LedgerManagerImpl.cpp Updates parallel apply thread logic to handle optional success result.

Comment thread src/transactions/TransactionMeta.h Resolved
@SirTyson
SirTyson requested review from dmkozh and sisuresh February 23, 2026 22:51
@SirTyson
SirTyson enabled auto-merge February 26, 2026 22:01
@SirTyson
SirTyson added this pull request to the merge queue Feb 26, 2026
Merged via the queue into master with commit 5890444 Feb 26, 2026
67 checks passed
@SirTyson
SirTyson deleted the refactor-parallel-apply-return branch February 26, 2026 22:38
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.

Make parallelApply return optional

3 participants