-
Notifications
You must be signed in to change notification settings - Fork 38.7k
test: assumeutxo: check that UTXO-querying RPCs operate on snapshot chainstate #30636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: assumeutxo: check that UTXO-querying RPCs operate on snapshot chainstate #30636
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
test 2024-08-12T12:48:42.142000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
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
self.run_test()
File "/home/runner/work/_temp/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_assumeutxo.py", line 354, in run_test
utxo_info = n1.gettxoutsetinfo()
^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/_temp/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/coverage.py", line 50, in __call__
return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/_temp/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/authproxy.py", line 146, in __call__
raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: Unable to get data because coinstatsindex is still syncing. Current height: 0 (-32603)
node1 2024-08-12T12:48:42.142251Z (mocktime: 2011-02-02T23:17:17Z) [scheduler] [validationinterface.cpp:246] [operator()] [validation] ChainStateFlushed: block hash=3bb7ce5eba0be48939b7a521ac1ba9316afee2c7bada3a0cca24188e6d7d96c0
test 2024-08-12T12:48:42.149000Z TestFramework (DEBUG): Closing down network thread |
|
Concept ACK |
deda54e to
2e9072c
Compare
fjahr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could have moved this up and used it in the gettxoutsetinfo as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought: maybe just pull all three of these loaded keys out in the beginning since you use each of them at least twice and they are used again further below... or you could deduplicate the assert_equal triplet but it's not a big deal either way...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced snapshot_hash and snapshot_num_coins in the beginning and used the already existing SNAPSHOT_BASE_HEIGHT for the height.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
| assert_equal(scan_result['bestblock'], loaded['tip_hash']) | |
| assert_equal(scan_result['bestblock'], snapshot_hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would be a bit more readable IMO if you would break it into two lines
tdb3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
Great test additions.
Light code review and manual test. I concur with the nits from @fjahr.
BrandonOdiwuor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
2e9072c to
917e70a
Compare
|
Thanks for the reviews! Took the suggestions and refined the UTXO check against the |
|
utACK 917e70a Only changes since last review were addressing my minor review comments. |
tdb3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 917e70a
These tests are great additions.
Changes incorporate comments nicely.
Ran functionals locally (passed).
|
ACK 917e70a |
Inspired by some manual testing I did for #28553, this PR checks that RPCs which explicitly query the UTXO set database (i.e.
gettxoutsetinfo,scantxoutsetandgettxout) operate on the snapshot chainstate as expected.