gettxoutsetinfo
, scantxoutset
and gettxout
) operate on the snapshot chainstate as expected.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | fjahr, tdb3, achow101 |
Concept ACK | BrandonOdiwuor |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
https://github.com/bitcoin/bitcoin/actions/runs/10351325972/job/28649600800?pr=30636#step:7:23340:
0 test 2024-08-12T12:48:42.142000Z TestFramework (ERROR): JSONRPC error
1 Traceback (most recent call last):
2 File "/home/runner/work/_temp/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 132, in main
3 self.run_test()
4 File "/home/runner/work/_temp/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_assumeutxo.py", line 354, in run_test
5 utxo_info = n1.gettxoutsetinfo()
6 ^^^^^^^^^^^^^^^^^^^^
7 File "/home/runner/work/_temp/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/coverage.py", line 50, in __call__
8 return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
9 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 File "/home/runner/work/_temp/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/authproxy.py", line 146, in __call__
11 raise JSONRPCException(response['error'], status)
12 test_framework.authproxy.JSONRPCException: Unable to get data because coinstatsindex is still syncing. Current height: 0 (-32603)
13 node1 2024-08-12T12:48:42.142251Z (mocktime: 2011-02-02T23:17:17Z) [scheduler] [validationinterface.cpp:246] [operator()] [validation] ChainStateFlushed: block hash=3bb7ce5eba0be48939b7a521ac1ba9316afee2c7bada3a0cca24188e6d7d96c0
14 test 2024-08-12T12:48:42.149000Z TestFramework (DEBUG): Closing down network thread
357+ assert_equal(utxo_info['height'], loaded['base_height'])
358+ assert_equal(utxo_info['bestblock'], loaded['tip_hash'])
359+
360+ # find coinbase output at snapshot height on node0 and scan for it on node1,
361+ # where the block is not available, but the snapshot was loaded successfully
362+ snapshot_hash = loaded['tip_hash']
gettxoutsetinfo
as well
assert_equal
triplet but it’s not a big deal either way…
snapshot_hash
and snapshot_num_coins
in the beginning and used the already existing SNAPSHOT_BASE_HEIGHT
for the height.
365+ coinbase_output_descriptor = coinbase_tx['vout'][0]['scriptPubKey']['desc']
366+ scan_result = n1.scantxoutset('start', [coinbase_output_descriptor])
367+ assert_equal(scan_result['success'], True)
368+ assert_equal(scan_result['txouts'], loaded['coins_loaded'])
369+ assert_equal(scan_result['height'], loaded['base_height'])
370+ assert_equal(scan_result['bestblock'], loaded['tip_hash'])
nit
0 assert_equal(scan_result['bestblock'], snapshot_hash)
366+ scan_result = n1.scantxoutset('start', [coinbase_output_descriptor])
367+ assert_equal(scan_result['success'], True)
368+ assert_equal(scan_result['txouts'], loaded['coins_loaded'])
369+ assert_equal(scan_result['height'], loaded['base_height'])
370+ assert_equal(scan_result['bestblock'], loaded['tip_hash'])
371+ assert coinbase_tx['txid'] in [coin['txid'] for coin in scan_result['unspents']]
Code review ACK 2e9072c137e81c75c58d0c0788295c10fdafdc9b
This is a good regression test to have. I left a bunch of minor nits but this is fine to merge as-is so feel free to leave them unless you have to re-touch.
scantxoutset
result to also include the vout index (=0), rather than only verifying the txid.
utACK 917e70a6206c62c4c492fa922425fc8e00d3f328
Only changes since last review were addressing my minor review comments.
ACK 917e70a6206c62c4c492fa922425fc8e00d3f328
These tests are great additions. Changes incorporate comments nicely. Ran functionals locally (passed).
theStack
DrahtBot
fanquake
fjahr
tdb3
BrandonOdiwuor
achow101
Theghost256
Labels
Tests
Milestone
28.0