0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-09 15:37:00 -04:00
bitcoin-core/src/wallet
fanquake b1a46b212f
Merge bitcoin/bitcoin#26008: wallet: cache IsMine scriptPubKeys to improve performance of descriptor wallets
e041ed9b75 wallet: Retrieve ID from loaded DescSPKM directly (Ava Chow)
39640dd34e wallet: Use scriptPubKeyCache in GetSolvingProvider (Ava Chow)
b410f68791 wallet: Use scriptPubKey cache in GetScriptPubKeyMans (Ava Chow)
edf4e73a16 wallet: Use scriptPubKey cache in IsMine (Ava Chow)
37232332bd wallet: Cache scriptPubKeys for all DescriptorSPKMs (Ava Chow)
99a0cddbc0 wallet: Introduce a callback called after TopUp completes (Ava Chow)
b276825932 bench: Add a benchmark for ismine (Ava Chow)

Pull request description:

  Wallets that have a ton of non-ranged descriptors (such as a migrated non-HD wallet) perform fairly poorly due to looping through all of the wallet's `ScriptPubKeyMan`s. This is done in various places, such as `IsMine`, and helper functions for fetching a `ScriptPubKeyMan` and a `SolvingProvider`. This also has a bit of a performance impact on standard descriptor wallets, although less noticeable due to the small number of SPKMs.

  As these functions are based on doing `IsMine` for each `ScriptPubKeyMan`, we can improve this performance by caching `IsMine` scriptPubKeys for all descriptors and use that to determine which `ScriptPubKeyMan` to actually use for those things. This cache is used exclusively and we no longer iterate the SPKMs.

  Also added a benchmark for `IsMine`.

ACKs for top commit:
  ryanofsky:
    Code review ACK e041ed9b75. Just suggested changes since last review
  josibake:
    ACK e041ed9b75
  furszy:
    Code review ACK e041ed9b

Tree-SHA512: 8e7081991a025e682e9dea838b4543b0d179832d1c47397fb9fe7a97fa01eb699c15a5d5a785634926844fc83a46e6ac07ef753119f39d84423220ef8a548894
2024-02-20 10:17:46 +00:00
..
rpc Merge bitcoin/bitcoin#28037: rpc: Drop migratewallet experimental warning 2024-02-16 12:28:05 +00:00
test wallet: bdb batch 'ErasePrefix', do not create txn internally 2024-02-12 16:05:15 -03:00
bdb.cpp wallet: bdb batch 'ErasePrefix', do not create txn internally 2024-02-12 16:05:15 -03:00
bdb.h wallet: bdb: include bdb header from our implementation files only 2023-07-07 14:14:20 +00:00
coincontrol.cpp wallet: Explicitly preserve scriptSig and scriptWitness in CreateTransaction 2023-12-08 17:12:19 -05:00
coincontrol.h wallet: Explicitly preserve scriptSig and scriptWitness in CreateTransaction 2023-12-08 17:12:19 -05:00
coinselection.cpp opt: Skip over barren combinations of tiny UTXOs 2024-02-09 11:03:18 +01:00
coinselection.h coinselection: Track whether CG completed 2024-02-09 10:50:10 +01:00
context.cpp
context.h interfaces: Add schedulerMockForward method so mockscheduler RPC can work across processes 2023-10-20 10:30:16 -04:00
crypter.cpp refactor: Remove unused C-style casts 2023-07-24 15:32:00 +02:00
crypter.h
db.cpp refactor: Fix bugprone-string-constructor warning 2023-10-30 14:59:17 +01:00
db.h wallet: remove unused 'accept_no_keys' arg from decryption process 2024-02-03 12:56:43 -03:00
dump.cpp wallettool: Don't create CWallet when dumping DB 2023-12-19 16:54:06 -05:00
dump.h wallettool: Don't create CWallet when dumping DB 2023-12-19 16:54:06 -05:00
external_signer_scriptpubkeyman.cpp wallet: batch external signer descriptor import 2023-11-21 23:07:00 -03:00
external_signer_scriptpubkeyman.h wallet: batch external signer descriptor import 2023-11-21 23:07:00 -03:00
feebumper.cpp test: wallet, fix change position out of range error 2023-12-12 15:20:38 -03:00
feebumper.h rpc: bumpfee, improve doc for 'reduce_output' arg 2023-09-26 20:17:02 -03:00
fees.cpp
fees.h
init.cpp init: completely remove -zapwallettxes (remaining hidden option) 2023-11-03 20:00:44 +01:00
interfaces.cpp wallet: use optional for change position as an optional in CreateTransaction 2023-12-08 17:12:19 -05:00
load.cpp interfaces: Add schedulerMockForward method so mockscheduler RPC can work across processes 2023-10-20 10:30:16 -04:00
load.h interfaces: Add schedulerMockForward method so mockscheduler RPC can work across processes 2023-10-20 10:30:16 -04:00
receive.cpp Use Txid in COutpoint 2023-11-21 13:15:44 +00:00
receive.h
salvage.cpp tidy: modernize-use-emplace 2023-10-12 11:27:19 +02:00
salvage.h
scriptpubkeyman.cpp Merge bitcoin/bitcoin#26008: wallet: cache IsMine scriptPubKeys to improve performance of descriptor wallets 2024-02-20 10:17:46 +00:00
scriptpubkeyman.h Merge bitcoin/bitcoin#26008: wallet: cache IsMine scriptPubKeys to improve performance of descriptor wallets 2024-02-20 10:17:46 +00:00
spend.cpp Merge bitcoin/bitcoin#27877: wallet: Add CoinGrinder coin selection algorithm 2024-02-09 16:38:13 -05:00
spend.h refactor: pass CRecipient to FundTransaction 2024-01-19 15:04:56 +01:00
sqlite.cpp sqlite: Ensure that only one SQLiteBatch is writing to db at a time 2024-02-06 12:24:36 -05:00
sqlite.h sqlite: Ensure that only one SQLiteBatch is writing to db at a time 2024-02-06 12:24:36 -05:00
transaction.cpp wallet, refactor: Add CWalletTx::updateState function 2023-10-23 17:35:36 -04:00
transaction.h Use ParamsWrapper for witness serialization 2023-11-14 08:45:30 +10:00
types.h
wallet.cpp Merge bitcoin/bitcoin#26008: wallet: cache IsMine scriptPubKeys to improve performance of descriptor wallets 2024-02-20 10:17:46 +00:00
wallet.h Merge bitcoin/bitcoin#26008: wallet: cache IsMine scriptPubKeys to improve performance of descriptor wallets 2024-02-20 10:17:46 +00:00
walletdb.cpp Merge bitcoin/bitcoin#26008: wallet: cache IsMine scriptPubKeys to improve performance of descriptor wallets 2024-02-20 10:17:46 +00:00
walletdb.h wallet: db, introduce 'RunWithinTxn()' helper function 2024-02-12 16:05:14 -03:00
wallettool.cpp wallettool: Don't create CWallet when dumping DB 2023-12-19 16:54:06 -05:00
wallettool.h
walletutil.cpp
walletutil.h wallet: cache descriptor ID to avoid repeated descriptor string creation 2023-11-05 23:50:58 +01:00