mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 13:42:10 +02:00
Merge bitcoin/bitcoin#35394: test: remove unnecessary rpc calls from feature_dbcrash
c17cc76a18test: speed up feature_dbcrash (will) Pull request description: On my machine dbcrash takes 17 minutes to run (wihtout `--usecli`), and is making on the order of 200,000 RPC calls. The bulk of these come from miniwallet's `send_self_transfer_multi` which calls miniwallets `sendrawtransaction`, which does: ```python def sendrawtransaction(self, *, from_node, tx_hex, maxfeerate=0, **kwargs): txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs) self.scan_tx(from_node.decoderawtransaction(tx_hex)) return txid ``` The second `decoderawtransaction` here doubles the number of RPC calls per send, and feature_dbcrash doesn't use the miniwallet utxo list outside of setup and rescans, it already tracks it's own `utxo_list`, so this is wasted work. By creating the transaction and sending using a direct node RPC to send, we can halve the number of rpc calls in this section. This change reduces the runtime to 9 minutes for me. ACKs for top commit: maflcko: review ACKc17cc76a18📐 Tree-SHA512: fa9cf574f280b776446ac994baa7bfd94200d4a3dd8f52e138b0005dcbeb87b357172ce8c470cd743bb5021328aaf24ef4c0ac81a6dc15dd36ca30a3618dc400
This commit is contained in:
@@ -196,12 +196,12 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
|
||||
# Sanity check -- if we chose inputs that are too small, skip
|
||||
continue
|
||||
|
||||
self.wallet.send_self_transfer_multi(
|
||||
from_node=node,
|
||||
tx = self.wallet.create_self_transfer_multi(
|
||||
utxos_to_spend=utxos_to_spend,
|
||||
num_outputs=3,
|
||||
fee_per_output=FEE // 3,
|
||||
)
|
||||
node.sendrawtransaction(hexstring=tx["hex"], maxfeerate=0)
|
||||
num_transactions += 1
|
||||
|
||||
def run_test(self):
|
||||
|
||||
Reference in New Issue
Block a user