diff --git a/doc/release-notes-7101.md b/doc/release-notes-7101.md new file mode 100644 index 000000000000..4daa80a0f8e7 --- /dev/null +++ b/doc/release-notes-7101.md @@ -0,0 +1,12 @@ +## Indexes + +### Async Index Migration (#7101) + +`TimestampIndex`, `SpentIndex`, and `AddressIndex` have been migrated from synchronous to asynchronous operation, following the same pattern as `TxIndex` and other indexes using `BaseIndex` framework. + +When enabling an index for the first time, the node will build the index in the background while remaining fully operational. Progress can be monitored via the `getindexinfo` RPC. + +Existing nodes with indexes enabled will automatically migrate data from the old location (block index database) to new separate databases on first startup. This migration may take 20-40 minutes or longer depending on hardware specifications and index sizes. The node will log progress during migration. + +Breaking changes: +- `SpentIndex` and `AddressIndex` are incompatible with pruned nodes as they require access to undo data now diff --git a/src/Makefile.am b/src/Makefile.am index 47f3c6bd55fc..183dd83b1cb8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -157,8 +157,6 @@ BITCOIN_CORE_H = \ active/masternode.h \ active/quorums.h \ addrdb.h \ - addressindex.h \ - spentindex.h \ addrman.h \ addrman_impl.h \ attributes.h \ @@ -247,10 +245,17 @@ BITCOIN_CORE_H = \ httprpc.h \ httpserver.h \ i2p.h \ + index/addressindex.h \ + index/addressindex_types.h \ + index/addressindex_util.h \ index/base.h \ index/blockfilterindex.h \ index/coinstatsindex.h \ index/disktxpos.h \ + index/spentindex.h \ + index/spentindex_types.h \ + index/timestampindex.h \ + index/timestampindex_types.h \ index/txindex.h \ indirectmap.h \ init.h \ @@ -344,7 +349,6 @@ BITCOIN_CORE_H = \ rpc/blockchain.h \ rpc/client.h \ rpc/evo_util.h \ - rpc/index_util.h \ rpc/mempool.h \ rpc/mining.h \ rpc/protocol.h \ @@ -379,7 +383,6 @@ BITCOIN_CORE_H = \ support/events.h \ support/lockedpool.h \ sync.h \ - timestampindex.h \ threadsafety.h \ timedata.h \ torcontrol.h \ @@ -489,7 +492,6 @@ libbitcoin_node_a_SOURCES = \ active/masternode.cpp \ active/quorums.cpp \ addrdb.cpp \ - addressindex.cpp \ addrman.cpp \ banman.cpp \ batchedlogger.cpp \ @@ -536,9 +538,13 @@ libbitcoin_node_a_SOURCES = \ httprpc.cpp \ httpserver.cpp \ i2p.cpp \ + index/addressindex.cpp \ + index/addressindex_util.cpp \ index/base.cpp \ index/blockfilterindex.cpp \ index/coinstatsindex.cpp \ + index/spentindex.cpp \ + index/timestampindex.cpp \ index/txindex.cpp \ init.cpp \ instantsend/db.cpp \ @@ -601,7 +607,6 @@ libbitcoin_node_a_SOURCES = \ rpc/coinjoin.cpp \ rpc/evo.cpp \ rpc/fees.cpp \ - rpc/index_util.cpp \ rpc/masternode.cpp \ rpc/mempool.cpp \ rpc/governance.cpp \ diff --git a/src/addressindex.cpp b/src/addressindex.cpp deleted file mode 100644 index 4cefedaf752f..000000000000 --- a/src/addressindex.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2016 BitPay Inc. -// Copyright (c) 2023-2024 The Dash Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include - -#include -#include -#include