Skip to content

WIP Core opt#5283

Draft
dmkozh wants to merge 7 commits into
stellar:masterfrom
dmkozh:core_opt
Draft

WIP Core opt#5283
dmkozh wants to merge 7 commits into
stellar:masterfrom
dmkozh:core_opt

Conversation

@dmkozh
Copy link
Copy Markdown
Contributor

@dmkozh dmkozh commented May 21, 2026

Description

Resolves #X

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 added 7 commits May 21, 2026 15:31
BUILD_TESTS builds unconditionally populate mLastLedgerTxMeta and force-enable tx meta so tests can inspect it, but since the apply-load benchmarks are built with BUILD_TESTS as well we need a way to unconditionally disable meta.
During ledger close, run addHotArchiveBatch, addLiveBatch and updateInMemorySorobanState concurrently. They modify independent data structures and so need no synchronization.
Replace the single global mutex + RandomEvictionCache with 16 sharded caches (each with its own mutex) so concurrent signature verification threads no longer block on a shared lock.

Also use the single-lookup maybeGet() in place of the exists()/get() double-lookup.
Build the LiveBucketIndex on an async worker thread while the put loop in mergeInMemory runs on the main thread. Both only read mergedEntries as const, so they need no synchronization.
The delta is only consumed by checkOnOperationApply, which is a no-op when no invariants are registered.
This relaxes the TTL invariant check a bit, instead of checking that created TTL keys belong to the specific entries, we just ensure that the expected entry counts match. This should be a pretty reasonable tradeoff - it seems like it would be pretty hard to create a mismatched TTL entry (vs missing it entirely).
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.

1 participant