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: Fixes and updates to wallet_backwards_compatibility.py for 25.0 and descriptor wallets #28027
test: Fixes and updates to wallet_backwards_compatibility.py for 25.0 and descriptor wallets #28027
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
325d6e7
to
8c887c3
Compare
07a8cf4
to
604440c
Compare
Thanks for improving these tests. Added to review list. |
Concept ACK |
604440c
to
e408968
Compare
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.
Running this test failed on my device not sure if it's from this PR though.
Steps to recreate
git checkout pr/28027
make clean
./autogen.sh
./configure
make
test/functional/test_runner.py wallet_backwards_compatibility.py
2023-07-11T00:04:00.468000Z TestFramework (INFO): PRNG seed is: 1124432296273551722
2023-07-11T00:04:00.468000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_banbrcm1
2023-07-11T00:04:00.472000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 550, in start_nodes
node.start(extra_args[i], *args, **kwargs)
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_node.py", line 221, in start
self.process = subprocess.Popen(self.args + extra_args, env=subp_env, stdout=stdout, stderr=stderr, cwd=cwd, **kwargs)
File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/abubakarsadiq/Desktop/bitcoin/releases/v25.0/bin/bitcoind'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 130, in main
self.setup()
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 295, in setup
self.setup_network()
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 389, in setup_network
self.setup_nodes()
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/wallet_backwards_compatibility.py", line 74, in setup_nodes
self.start_nodes()
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 555, in start_nodes
self.stop_nodes()
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 570, in stop_nodes
node.stop_node(wait=wait, wait_until_stopped=False)
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_node.py", line 346, in stop_node
self.stop(wait=wait)
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_node.py", line 192, in __getattr__
assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
AssertionError: [node 0] Error: no RPC connection
2023-07-11T00:04:00.523000Z TestFramework (INFO): Stopping nodes
Traceback (most recent call last):
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/wallet_backwards_compatibility.py", line 368, in <module>
BackwardsCompatibilityTest().main()
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 154, in main
exit_code = self.shutdown()
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 311, in shutdown
self.stop_nodes()
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_framework.py", line 570, in stop_nodes
node.stop_node(wait=wait, wait_until_stopped=False)
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_node.py", line 346, in stop_node
self.stop(wait=wait)
File "/home/abubakarsadiq/Desktop/bitcoin/test/functional/test_framework/test_node.py", line 192, in __getattr__
assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
AssertionError: [node 0] Error: no RPC connection
[node 1] Cleaning up leftover process
[node 0] Cleaning up leftover process
Left some comments and question
assert info['private_keys_enabled'] | ||
assert info['keypoolsize'] > 0 | ||
# Use addmultisigaddress (see #18075) | ||
address_18075 = wallet.rpc.addmultisigaddress(1, ["0296b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52", "037211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073"], "", "legacy")["address"] |
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.
The v19 test pubkeys 0296b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52
and 037211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073
are they relevant to the test? I see they are the same as the one reported in #18075
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.
I don't think the specific keys are relevant.
@@ -127,13 +126,6 @@ def run_test(self): | |||
assert wallet.getaddressinfo(address_18075)["solvable"] | |||
node_v19.unloadwallet("w1_v19") | |||
|
|||
# w1_v18: regular wallet, created with v0.18 |
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.
Why are we no longer using the wallet?
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.
I would guess that it was used in the up-downgrade test but was accidentally removed at some point. It isn't necessary anymore either as that test is now automated to go over all of the previous versions so the hardcoded specific wallet versions are no longer necessary.
Approach ACK |
It looks like you're missing the 25.0 binaries. The test is expecting to find 25.0's bitcoind at |
0ffa0f1 (and later) breaks at line line 96 when you run
Otherwise it works, just some stylistic notes inline (e408968).
Is there an assert you can add in c31e0db that would catch this directly? Right now a regression would be "caught" simply because it doesn't fail to load. Ideally we'd check this for every version before we dropped the "just create a new one if it doesn't exist" behavior was dropped. |
@@ -76,7 +76,6 @@ def run_test(self): | |||
node_miner = self.nodes[0] | |||
node_master = self.nodes[1] | |||
node_v19 = self.nodes[self.num_nodes - 4] |
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.
6a5d245: if a node is node is not used, we should reduce the number of nodes and node_v19
should be self.num_nodes - 3
.
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.
0.18 is still tested, just not explicitly with its own special casing and variables.
e408968
to
505e91f
Compare
Fixed
With the versions that have |
505e91f
to
10740c2
Compare
10740c2
to
91f47e6
Compare
91f47e6
to
add9d14
Compare
The test for 0.16 wallet downgrading was using the wrong wallet path and thus incorrectly finding that 0.16 could open wallets created in master.
This wallet is no longer used in the test
This specific test is distinct from the rest of the backwards compatibility tests as it is checking a specific failure.
Test that old nodes don't mess up new wallets by loading a downgraded wallet in master again.
add9d14
to
afd9a67
Compare
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 afd9a67
re-ACK afd9a67 |
It was somewhat surprising to me that wallet_backwards_compatibility.py did not catch #27915 since the purpose of the test is to find downgrade issues such as that. It turns out the test was deficient in several places when it came to testing descriptor wallets, as well as deficient in addition to failing to correctly test some releases.
This PR fixes these test cases, adds more informative logging, slightly refactors the entire test in order to better test future versions, and adds a 25.0 node to the test.
Notable changes: