Files
merge-script 9c73fc8088 Merge bitcoin/bitcoin#35474: node: move index ownership to NodeContext
bb357fcd2f node: move block filter index ownership to NodeContext (woltx)
66892cdd56 net_processing: get block filter index via PeerManager::Options (woltx)
e5b76bbdbb rpc: get index info from NodeContext indexes (woltx)
fafedc683a node: move coinstatsindex ownership to NodeContext (woltx)
2d1dc8f18a node: move txospenderindex ownership to NodeContext (woltx)
530cf35c17 node: move txindex ownership to NodeContext (woltx)

Pull request description:

  This removes the remaining process-global index ownership and stores node-owned indexes in `NodeContext` instead.

  Indexes moved:

  - `g_txindex`
  - `g_txospenderindex`
  - `g_coin_stats_index`
  - `g_filter_indexes`

  `NodeContext` now owns these index instances, while `node.indexes` remains a non-owning list used for common index startup, shutdown, and `getindexinfo` handling.

  Behavior should be unchanged, apart from the key order in `getindexinfo` output. Indexes are still created from the same startup options, started in the same init step, stopped before destruction, and destroyed while `validation_signals` is still alive so they can unregister safely.

  The block filter index registry is moved to `node/indexes.{h,cpp}` so `index/` code does not depend on `NodeContext`. `PeerManager` receives a small lookup callback instead of reaching into global state.

  Review notes:
  - The first four commits are small and mostly mechanical: move `txindex`, `txospenderindex`, and `coinstatsindex` ownership to `NodeContext`, then make `getindexinfo` use `node.indexes`. The first commit also adds custom deleters in `node/indexes.cpp`, so `node/context.cpp` does not include index headers, which would create circular dependencies.
  - The fifth commit adds a block filter index lookup callback to `PeerManager::Options`, still backed by the global registry.
  - The last commit is the main one to review carefully. It moves block filter index ownership to `NodeContext`, moves the block filter registry to `node/indexes.{h,cpp}`, and points the `PeerManager` lookup at `NodeContext` instead of global state.

ACKs for top commit:
  fjahr:
    ACK bb357fcd2f
  maflcko:
    review ACK bb357fcd2f 💬
  andrewtoth:
    ACK bb357fcd2f

Tree-SHA512: 00bf7743241e844bc60c9e9d4d5e1f467d8c99a9f38583f701bdd6b36d57efa929e40697f5575488c78b8421edf689e93981f6d3d92766c24b956c8dc35f1a20
2026-11-23 10:17:07 +00:00
..