Indexes

PRPriorityReviewabilityReviewsAgreementSize
(+)#24230 ryanofsky indexes: Stop using node internal types and locking cs_main, improve sync logicP1 · cleanupReady0Mild951 + 201 tests
  • Avoid lock contention between secondary indexes and block validation
  • Prevent startup race conditions and stale index query results during chain reorganizations
  • Enable secondary indexes to eventually run out-of-process
  • P1 after comparing with the other PRs here (assessed alone as P2): Raised to P1: fixes a -reindex-chainstate startup race and stale-data-during-reorg window (category's top concern, correctness under reorgs) while being the stated prerequisite for out-of-process indexes (#10102) and shared chain sync (#15719); it cannot sit in the same band as the ordinary speedups it enables.
  • P2 because removing validation locks during index sync reduces lock contention with block validation
  • Resolves startup race conditions under reindex and stops queries from returning stale data during reorgs
  • Unblocks running secondary indexes out-of-process
  • Ready for review
  • Broad concept and approach support across multiple iterations (sedited, mzumsande, fjahr, josibake)
  • Answered objection on ignoring reverse-block return values remains unconfirmed (furszy)
  • Multiple earlier startup race conditions and crash reports were tested and resolved (mzumsande, furszy)
  • 951 lines added or modified outside tests
  • 201 lines added or modified in tests
  • 583 lines removed in total
  • 42 files, 18 commits
(+)#36002 andrewtoth txindex: allow running in pruned modeP2 · user requestReady1Strong211 + 166 tests
  • Allow node operators to run txindex on pruned nodes without storing the full blockchain history
  • Enable looking up historical transactions and serving RPC requests on resource-constrained nodes
  • P2 because it resolves four long-standing feature requests dating back to 2017
  • Pruned node operators can index all transactions without storing full block history on disk
  • Ready to review
  • Strong support for enabling txindex on pruned nodes
  • Full approval after checking edge cases and error handling (optout21)
  • Concept approval because it greatly improves pruned node capabilities (optout21, arejula27)
  • Concept approval noting disk usage tradeoffs (ajtowns)
  • Concept approval without stated reasons (l0rinc)
  • 211 lines added or modified outside tests
  • 166 lines added or modified in tests
  • 97 lines removed in total
  • 21 files, 7 commits
(+)#34132 l0rinc coins, dbwrapper: remove error catcher, make point-read failures fatalP2 · bug fixReady0 (+2)Blocked139 + 153 tests
  • Prevent nodes from continuing to run with damaged state when database reads encounter corruption
  • Stop treating corrupted records as merely missing keys during coin and index lookups
  • P2 because corrupted index records previously caused isolated RPC failures while nodes ran damaged
  • Failing fast on index corruption prevents nodes from continuing with silently damaged index state
  • Ready for review
  • Unaddressed objection: aborting in DB reads breaks startup recovery and kills kernel hosts (furszy)
  • Unaddressed objection: aborting on optional index corruption halts nodes for non-critical errors (ajtowns)
  • Unaddressed objection: thread safety of the GUI message box callback before abort is unclear (ajtowns)
  • Support for removing indirection in the coin view stack (andrewtoth)
  • Verified with code review and local unit tests (optout21)
  • 139 lines added or modified outside tests
  • 153 lines added or modified in tests
  • 381 lines removed in total
  • 33 files, 9 commits
(+)#34489 furszy index: batch db writes during initial syncP2 · speedupWaiting on author0 (+1)Blocked119 + 181 tests
  • Speed up initial index synchronization and cut disk writes, especially on spinning disks
  • Reduce main lock contention to keep the node responsive during initial block download
  • P2 because batching index writes cuts disk I/O operations during initial sync, especially on spinning disks
  • Reduces main lock contention to improve node responsiveness while syncing indexes
  • Lays groundwork for parallel index synchronization
  • Ranking pass: Placed ahead of #26966 because it extracts the batching foundation that the parallel-sync PR builds on.
  • Needs rebase and author fixes for open correctness and safety objections before review is worthwhile
  • Unaddressed objection: state desync on interrupt can cause index corruption on restart (l0rinc)
  • Unaddressed objections: possible infinite backward loop and eager flat file writes during batching (l0rinc)
  • Code approval after review and fixes, without benchmarking performance (optout21)
  • Concept approval for improving sync speed and enabling parallel index sync (arejula27, l0rinc, polespinasa)
  • 119 lines added or modified outside tests
  • 181 lines added or modified in tests
  • 74 lines removed in total
  • 11 files, 10 commits
(+)#26966 furszy index: initial sync speedup, parallelize processP2 · speedupAuthor silent 272d0 (+1) -1Disputed569 + 462 tests
  • Speed up initial index synchronization for block filter and transaction indexes
  • Allow node runners to process block batches across multiple worker threads during initial sync
  • P2 because parallel block digestion dramatically cuts initial sync time for block filter indexes
  • Node runners building block filter indexes see multi-hour builds drop to under an hour on SSDs
  • Transaction index write contention on SSDs partially offsets gains but filter speedups are substantial
  • Needs rebase
  • Author is splitting out the thread pool into #33689 before updating this PR
  • Verified significant block filter index speedups on SSD (Sjors, pinheadmz, mzumsande)
  • Unaddressed objection: txindex is slower on SSD and parallel sync adds too much complexity (l0rinc)
  • Unaddressed objection: LevelDB write contention slows txindex sync on SSD by ~7% (andrewtoth)
  • Concept and approach approval for the parallel processing design (ryanofsky, sedited, w0xlt)
  • Unanswered question on how parallel indexing interacts with AssumeUTXO (maflcko)
  • 569 lines added or modified outside tests
  • 462 lines added or modified in tests
  • 153 lines removed in total
  • 14 files, 11 commits
(+)#36629 andrewtoth Add output script index and corresponding script history RPCP2 · new featureReady1Strong1,174 + 1,060 tests
  • Allow querying historical transactions by script or address without wallet imports
  • Avoid requiring external indexing stacks or Electrum servers to sync separate databases
  • P2 because it adds a long-sought script index functioning on full and pruned nodes
  • Resolves an architectural gap attempted since 2013 to serve external indexers without wallet imports
  • Ranking pass: New index with a stated consumer ranks below integrity fixes and sync-time work per the category ordering, hence 4 places below its own score position.
  • Ready to review
  • Strong support across reviewers, with one Tested ACK verifying fixes on the updated push (kravens)
  • Concept approval from multiple contributors (sedited, l0rinc, w0xlt, romanz, ViniciusCestarii, xyzconstant)
  • Earlier objections around disk read budgets and library boundaries are resolved (kravens)
  • Nonblocking suggestions remain open regarding mempool error handling and help text (ViniciusCestarii, kravens)
  • 1,174 lines added or modified outside tests
  • 1,060 lines added or modified in tests
  • 31 lines removed in total
  • 30 files, 5 commits
(+)#36480 arejula27 txospenderindex: hash keys and pack positions to reduce disk usageP2 · speedupCI failing0Strong402 + 387 tests
  • Shrink the transaction output spender index disk footprint by roughly a third
  • Reduce index sync time and help prepare spender indexing for pruned nodes
  • P2 because it cuts spender index disk usage by 33%, saving over 20GB on a full node
  • Significantly lowers initial indexing time and helps enable pruned node support
  • CI is failing; check whether the failure is caused by this PR before doing a deep review
  • Strong support from tests showing spender index drops from ~84GB to ~62GB with faster sync (andrewtoth)
  • Concept approval favoring future pruning support and merging #36002 first (l0rinc)
  • Concept approval without stated reasons (w0xlt, sedited)
  • 402 lines added or modified outside tests
  • 387 lines added or modified in tests
  • 264 lines removed in total
  • 15 files, 6 commits
(+)#35728 maflcko rpc: Properly throw on internal I/O errors in GetTransactionP2 · bug fixReady1 (+5)Strong80 + 86 tests
  • Report disk read and index corruption errors explicitly instead of claiming transactions are missing
  • Alerts users and RPC callers to storage or index corruption instead of masking it as nonexistent data
  • P2 because disk read errors and corruption in transaction indexing were treated as missing entries
  • Surfaces index and database corruption immediately rather than masking it as nonexistent data
  • Ready to review
  • Strong support for distinguishing read failures from missing transactions (yuvicc, ryanofsky)
  • Verified by testing (musaHaruna)
  • Open question on design overlap with PR 34132 and release note wording (l0rinc)
  • 80 lines added or modified outside tests
  • 86 lines added or modified in tests
  • 44 lines removed in total
  • 7 files, 6 commits
(+)#35474 w0xlt node: move index ownership to NodeContextP3 · cleanupNeeds rebase0Positive233 + 24 tests
  • Move secondary index ownership from process-global static variables into individual node contexts
  • Improve node encapsulation and make running multiple nodes in tests or multiprocess setups easier
  • P3 because it is an internal architectural cleanup rather than a fix for data integrity or performance
  • Eliminating process-wide global index state unblocks cleaner testing with multiple node instances
  • Ready for review
  • Concept approval without stated reasons (sedited, fjahr)
  • Question about interaction with chain sync changes answered by author (Sjors)
  • Suggestion to use standard unique pointers answered by explaining circular header dependencies (fjahr)
  • 233 lines added or modified outside tests
  • 24 lines added or modified in tests
  • 175 lines removed in total
  • 27 files, 6 commits
(+)#36292 fjahr index: Delete old coinstats index directory on startupP3 · cleanupReady1Positive14 + 2 tests
  • Automatically delete the obsolete coinstats index directory on startup
  • Reclaims disk space on nodes upgraded from older releases
  • P3 because it reclaims wasted disk space from obsolete data on upgraded nodes
  • Provides routine housekeeping without affecting index correctness or performance
  • Ready to review
  • Nothing known that would invalidate a review
  • Concept approval without stated reasons (mzumsande)
  • Approval without stated reasons (sedited)
  • 14 lines added or modified outside tests
  • 2 lines added or modified in tests
  • 6 lines removed in total
  • 3 files, 2 commits
(+)#36580 maflcko refactor: Use util::log::FormatString in BaseIndex::FatalErrorf and LogConnectFailureP4 · cleanupReady1Positive6
  • Prevent trailing newlines in logging helpers from producing escaped newline characters in log output
  • Catch invalid format strings at compile time rather than letting malformed logs slip into runtime
  • P4 because compile-time checks on index fatal error formatting are a minor internal cleanup
  • Has no impact on index correctness or performance
  • Ready to review
  • Approval without stated reasons (stickies-v)
  • No open objections or unresolved concerns
  • 6 lines added or modified outside tests
  • 0 lines added or modified in tests
  • 7 lines removed in total
  • 3 files, 1 commits
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.
Ranking pass (2026-11-01): all PRs here were compared with each other; 8 notes on review order, overlaps, and band changes.

Covers

The optional indexes under src/index/: txindex, blockfilterindex (BIP 157/158 filters), coinstatsindex, and the base index framework they share (BaseIndex, index synchronization and its performance, index locking and threading). Plus the RPCs and tests that exist only for these indexes.

Not indexes: the mandatory structures the node cannot run without. The UTXO database and coins cache (src/txdb, src/coins), the block index and block tree database, block and undo file storage (src/node/blockstorage), pruning, and the database wrapper (src/dbwrapper, LevelDB) are all validation, whatever their names suggest. The maintainers' "UTXO Db and Indexes" label covers both groups, so it is not evidence of membership here on its own; the "Block storage" label is validation.

What matters here

Data integrity first: an optional index that silently returns wrong answers or corrupts on crash is worse than no index, and BIP 157 filters are served to light clients. Then correctness under reorgs and during initial sync. Then sync time and resource use, which users of these indexes feel directly (initial txindex and filter builds take hours). Then decoupling the index framework from node internals so indexes can be maintained and tested independently. Then new index types with a stated consumer.

Refactors count when they remove a shared-lock dependency or a correctness hazard; moving code around does not.

generated 2026-11-02 01:17 UTC