Skip to content

Parallelize transaction validation for transaction sets. - #5449

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

dmkozh wants to merge 1 commit into
stellar:masterfrom
dmkozh:txset_par_checkvalid

Conversation

@dmkozh

@dmkozh dmkozh commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

This affects both nominating a new transaction set, and validating the incoming transaction set. Thanks to the fact that most of the time we're either applying the ledger, or validating a transaction set, we can use the efficient CPU-pinned batch executor for this.

This speeds up the invalid transaction trimming step by ~20ms on large benchmarks, and in general should increase the transaction validation step proportionally to the number of cores.

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

@dmkozh
dmkozh force-pushed the txset_par_checkvalid branch from 12192a2 to 443a838 Compare September 9, 2026 21:42
Comment thread src/ledger/ImmutableLedgerView.h
Comment thread src/ledger/ImmutableLedgerView.h
Comment thread src/transactions/TransactionFrame.cpp
Comment thread src/ledger/ImmutableLedgerView.h
@SirTyson SirTyson mentioned this pull request Sep 14, 2026
5 of 6 tasks
@dmkozh
dmkozh force-pushed the txset_par_checkvalid branch from 443a838 to ffe5411 Compare September 17, 2026 22:44
@dmkozh
dmkozh force-pushed the txset_par_checkvalid branch from ffe5411 to 0ba1f7a Compare October 14, 2026 23:53
@dmkozh
dmkozh marked this pull request as ready for review October 14, 2026 23:56
Copilot AI balanced review requested due to automatic review settings October 14, 2026 23:56

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.

🟡 Changes recommended

Shared transaction frames can be validated concurrently, causing a data race on mutable state.

1 open finding
What changed in this PR

Parallelizes transaction-set validation during nomination and incoming-set checks using the batch executor.

Changes:

  • Adds parallel validation with sequential fallbacks.
  • Combines fee accounting and invalid-transaction collection.
  • Adds parallel-validation tests and updates fee-source expectations.
File Description
src/​herder/​TxSetUtils.cpp Batches validation and updates fee checks.
src/​herder/​test/​TxSetTests.cpp Tests validation across task counts.
src/​herder/​test/​HerderTests.cpp Updates shared-fee-source coverage.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/herder/TxSetUtils.cpp
@dmkozh
dmkozh force-pushed the txset_par_checkvalid branch from 0ba1f7a to f455d51 Compare October 15, 2026 15:53
Copilot AI balanced review requested due to automatic review settings October 15, 2026 15:53

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.

🔵 Needs a closer look

Consensus-critical threading and fee-trimming changes warrant human review and runtime validation.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread src/herder/TxSetUtils.h Outdated
This affects both nominating a new transaction set, and validating the incoming transaction set. Thanks to the fact that most of the time we're either applying the ledger, or validating a transaction set, we can use the efficient CPU-pinned batch executor for this.

This speeds up the invalid transaction trimming step by ~20ms on large benchmarks, and in general should increase the transaction validation step proportionally to the number of cores.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 16:15
@dmkozh
dmkozh force-pushed the txset_par_checkvalid branch from f455d51 to 5b99e0e Compare October 15, 2026 16:15

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.

🔵 Needs a closer look

Consensus-critical concurrency and fee-trimming changes warrant human review supported by runtime and thread-safety testing.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

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