Repository navigation
refactor(archiver): run log store reads in readOnlyTransaction - #442
Draft
spalladino wants to merge 3 commits into
Draft
spalladino wants to merge 3 commits into
spalladino wants to merge 3 commits into
Conversation
`createStore` hardcoded 16 LMDB readers. It now reads `dataStoreMaxReaders` (`DATA_STORE_MAX_READERS`) from the data store config, defaulting to the same 16. Every concurrent cursor holds a reader slot, so this bounds how many reads a store can have in flight at once.
The log store's read paths (`getPrivateLogsByTags`, `getPublicLogsByTags`, `getPrivateLogsForBlock`, `getPublicLogsForBlock`) now run in `db.readOnlyTransaction` instead of `db.transactionAsync`, keeping the same one-consistent-view guarantee. `addLogs` and `deleteLogs` are unchanged. `readOnlyTransaction` is still backed by `transactionAsync` on every backend, so behavior is unchanged for now: on lmdb-v2 tag queries still wait for queued writes. Once the lmdb-v2 implementation is backed by a native read-only LMDB transaction, these queries stop queueing behind block ingestion without further changes here.
The store keeps one reader back for point reads and hands the rest to cursors, so `maxReaders` of 1 left no cursor slot and every iteration waited forever. `AztecLMDBStoreV2` now rejects a `maxReaders` that is not an integer of at least 2 before opening the native store, which covers `DATA_STORE_MAX_READERS` and programmatic configs alike, and the local signer config schema enforces the same bound.
This was referenced Oct 9, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack
Bottom to top, each PR targets the branch below it:
Context
Part of A-1817. Redoes AztecProtocol/aztec-packages#25315 (closed after the repo split), adapted to the stubbed
readOnlyTransaction.Approach
LogStoreread paths (getPrivateLogsByTags,getPublicLogsByTags,getPrivateLogsForBlock,getPublicLogsForBlock) usedb.readOnlyTransactioninstead ofdb.transactionAsync. Behavior is unchanged today; once A-2377 wires the native snapshot these reads stop queuing behind checkpoint ingestion with no further call-site changes.DATA_STORE_MAX_READERS(dataStoreMaxReaders, default 16, as before). Values below 2 are rejected: the store reserves one reader slot, so 1 left cursors with zero permits and hung every scan.The original PR's assertion that a tag query does not wait for queued writes is deferred to A-2377, since it can't hold until reads run on native snapshots.