Skip to content

Parallelize in-memory state update with bucket list operations.#5284

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

Parallelize in-memory state update with bucket list operations.#5284
dmkozh wants to merge 1 commit into
stellar:masterfrom
dmkozh:ledger_upd_par

Conversation

@dmkozh
Copy link
Copy Markdown
Contributor

@dmkozh dmkozh commented May 21, 2026

Description

Parallelize in-memory state update with bucket list operations.

During ledger close, run addHotArchiveBatch, addLiveBatch and updateInMemorySorobanState concurrently. They modify independent data structures and so there is no need for synchronization.

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 21, 2026 21:33
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 aims to reduce ledger-close latency by overlapping (1) bucket list updates and (2) in-memory Soroban state updates during LedgerManagerImpl::finalizeLedgerTxnChanges, based on the assumption that these updates touch independent data structures.

Changes:

  • Run BucketManager::addHotArchiveBatch asynchronously (when applicable) instead of inline.
  • Run ApplyState::updateInMemorySorobanState asynchronously, overlapping it with addLiveBatch and module-cache updates.
  • Add <future> include to support the new std::async usage.

Comment thread src/ledger/LedgerManagerImpl.cpp
Comment thread src/ledger/LedgerManagerImpl.cpp
@dmkozh dmkozh force-pushed the ledger_upd_par branch 2 times, most recently from 9a36a34 to 87251b5 Compare May 21, 2026 23:03
During ledger close, run addHotArchiveBatch, addLiveBatch and updateInMemorySorobanState concurrently. They modify independent data structures and so need no synchronization.
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