Skip to content

Cleanup how restoredKeys are tracked in LedgerTxn - #5134

Merged
sisuresh merged 6 commits into
stellar:masterfrom
sisuresh:ltx-restored-keys
Feb 26, 2026
Merged

sisuresh merged 6 commits into
stellar:masterfrom
sisuresh:ltx-restored-keys

Conversation

@sisuresh

Copy link
Copy Markdown
Contributor

Description

Cleanup how restoredKeys are tracked in LedgerTxn

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

@sisuresh
sisuresh marked this pull request as ready for review February 13, 2026 19:53
Comment thread src/transactions/ParallelApplyUtils.cpp Resolved

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

This PR refactors how LedgerTxn tracks restored keys so that restored-entry bookkeeping is cleaner and better aligned with both non-parallel and parallel apply flows.

Changes:

  • Stop inheriting/restoring “restored keys” state into child LedgerTxns; children now track only their own restores and merge into parents on commit.
  • Add markRestoredFromLiveBucketList to let the parallel-apply path explicitly record live BucketList restores in LedgerTxn.
  • Adjust transaction meta building and the ArchivedStateConsistency invariant to use the updated restored-key semantics (notably around TTL entries).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/transactions/TransactionMeta.cpp Simplifies pre-v23 restored-live-BucketList tracking by relying on op-local restored maps and asserting only restore ops have them.
src/transactions/ParallelApplyUtils.cpp Records both hot-archive and live-BucketList restores into LedgerTxn during global commit so invariants can validate them.
src/ledger/test/InMemoryLedgerTxn.h Adds override for the new markRestoredFromLiveBucketList API in the in-memory test LedgerTxn.
src/ledger/test/InMemoryLedgerTxn.cpp Implements the new override as a stub that throws (consistent with other unsupported ops in this class).
src/ledger/LedgerTxnImpl.h Documents exception-safety behavior for markRestoredFromLiveBucketList.
src/ledger/LedgerTxn.h Updates interfaces: removes duplicate-allowing merge in RestoredEntries::addRestoresFrom and adds the new live-BucketList restore marker API.
src/ledger/LedgerTxn.cpp Implements markRestoredFromLiveBucketList, removes parent restored-map copying in child ctor, and enforces no-duplicates when merging restores.
src/invariant/ArchivedStateConsistency.cpp Updates restore invariant checks to treat TTL entries specially (updated TTL vs preloaded TTL comparisons).

Comment thread src/ledger/LedgerTxn.cpp Resolved
Comment thread src/ledger/LedgerTxn.cpp Resolved
Comment thread src/ledger/LedgerTxn.cpp Resolved
Comment thread src/transactions/ParallelApplyUtils.cpp Resolved
Comment thread src/transactions/TransactionMeta.cpp Resolved
Comment thread src/transactions/ParallelApplyUtils.cpp Resolved
Comment thread src/transactions/TransactionMeta.cpp Resolved
SirTyson
SirTyson previously approved these changes Feb 25, 2026

@SirTyson SirTyson 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.

LGTM

@sisuresh
sisuresh added this pull request to the merge queue Feb 25, 2026
Merged via the queue into stellar:master with commit c69069e Feb 26, 2026
52 checks passed
@sisuresh
sisuresh deleted the ltx-restored-keys branch February 26, 2026 00:24
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.

4 participants