-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: add v0.20.1, v0.21.0 and v22.0 to backwards compatibility test #19013
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
01e66bf
to
b998f69
Compare
b998f69
to
3181f0a
Compare
3181f0a
to
5a9152f
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.
Concept ACK
5a9152f
to
568b6c8
Compare
568b6c8
to
3619923
Compare
Rebased and dropped the release candidate commit. |
3619923
to
7628ed0
Compare
This fails on travis. Presumably because gpg is missing, etc |
ce3ffe5
to
77e3c9e
Compare
I wonder if 9e03b89 is enough self explanatory It wouldn't hurt me adding a thorough detailed text to it. |
@katesalazar that commit ensures that we we add a new version to the list, everything keeps working. It also adds some missing node_master.unloadwallet statements. I wrote it more than a year ago, so that's all I remember :-) I guess the test failure in |
77e3c9e
to
98a65b8
Compare
The test framework sets I'll rebase after #23514 is fixed. |
98a65b8
to
62b22de
Compare
Rebased after #23515 and merge conflict. |
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 62b22de. This all looks very good, and the deduping is nice. Left suggestions below but they aren't important and are just questions and requests to explain some things better.
@@ -72,7 +72,7 @@ def run_test(self): | |||
res = self.nodes[self.num_nodes - 1].getblockchaininfo() | |||
assert_equal(res['blocks'], COINBASE_MATURITY + 1) | |||
|
|||
node_master = self.nodes[self.num_nodes - 5] | |||
node_master = self.nodes[1] |
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.
In commit "test: backwards compatibility: misc fixes" (f35faef)
All of the changes in this commit seem innocuous, but also arbitrary, and I don't know what they are doing. It would be great if the commit description had some summary to help reviewers like me, or to help debug in case any of these changes cause problems in the future.
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.
What I was trying to tell, clearly expressed.
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 added a bit more clarification. In particular I point out that coverage may have changed, which I think is worth it for the increased readability.
@@ -51,7 +51,6 @@ | |||
"60c93e3462c303eb080be7cf623f1a7684b37fd47a018ad3848bc23e13c84e1c": "bitcoin-0.20.1-aarch64-linux-gnu.tar.gz", | |||
"55b577e0fb306fb429d4be6c9316607753e8543e5946b542d75d876a2f08654c": "bitcoin-0.20.1-arm-linux-gnueabihf.tar.gz", | |||
"b9024dde373ea7dad707363e07ec7e265383204127539ae0c234bff3a61da0d1": "bitcoin-0.20.1-osx64.tar.gz", | |||
"c378d4e21109f09e8829f3591e015c66632dff2925a60b64d259be05a334c30b": "bitcoin-0.20.1-osx.dmg", |
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.
In commit "test: v0.20.1 backwards compatibility" (94d3989)
Does this change belong in this commit? Could it be split off or have a rationale mentioned in a commit description?
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.
Yes, the DMG was added in an earlier PR, but shouldn't have. I'll add a note.
os.path.join(node_master_wallets_dir, wallet), | ||
os.path.join(node_v19_wallets_dir, wallet) | ||
) | ||
for node in self.nodes[2:]: |
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.
In commit "test: v0.20.1 backwards compatibility" (94d3989)
The deduplication here is great but the nodes[2:]
references are more obscure and maybe fragile. Could this use for node in legacy_nodes
? And
legacy_nodes = [node_v19, node_v18, node_v17]
or
legacy_nodes = nodes[2:]
or
legacy_nodes = [node for node in nodes if node.version <= 190000]
?
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've now restricted self.nodes[...]
to the top of the test, using more human readable names in the rest of the test.
# and loadwallet is introduced in v0.17.0 | ||
if node.version >= 170000 and node.version < 210000: | ||
for wallet_name in ["w1", "w2", "w3"]: | ||
assert_raises_rpc_error(-4, "Wallet file verification failed: wallet.dat corrupt, salvage failed", node.loadwallet, wallet_name) |
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.
In commit "test: v0.20.1 backwards compatibility" (94d3989)
Looking at all the test changes here it seems like no test coverage is lost, but it would be nice if commit message could say whether this is the case.
IMO, it would also be nicer if this commit were split into a refactoring commit that did not change coverage and just deduped code, and a smaller followup commit adding the new v0.20 version. But just mentioning however this commit affects coverage would be good if you don't want to change the commit contents.
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 moved the refactoring stuff into the misc changes commit. Adding a note that perhaps coverage changed in the process of this cleanup.
if version > 219999: | ||
version *= 100 |
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.
In commit "test: previous releases: add v22.0" (62b22de)
This seems a little strange. Could you add a code comment here explaining this? It seems like this code could not have a special 219999 case and just multiply by 100 for all versions and strip .0.0 for all versions.
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'll add a note. When we changed the numbering in version v22.0, the client version wasn't bumped to 22000000, but to 220000. Without this change it would expect the binary to live in v0.22.0. Conversely if we multiplied all versions by 100 then it would look for v21.0 for the 0.21.0 release.
62b22de
to
7124899
Compare
Rebased, moved refactoring stuff out of the v0.20 commit into 408e9b4. I improved that commit further by using variables in more places instead of indexes. |
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 7124899. This PR looks great and now is simpler to review with code changes consolidated in one commit, and new releases added in other commits. Other than that, only other changes since last review are replacing hardcoded node indexes with variables, and adding a code and commit comments
assert info['keypoolsize'] == 0 | ||
|
||
# w3_v18: blank wallet, created with v0.18 | ||
node_v18.rpc.createwallet(wallet_name="w3_v18", blank=True) |
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.
In commit "test: backwards compatibility: misc fixes" (408e9b4)
Note: Dropping these node_v18.rpc.createwallet
and node_v19.rpc.createwallet
calls seems to lose test coverage creating these wallets. But the wallets are never used later, and this would only be testing create code in frozen releases, so losing these is probably good.
Thanks @ryanofsky. I fixed the indentation and added the requested comment. |
7124899
to
ef08ba1
Compare
It is not possible to run the compatibility tests on i686 because the releases v20+ are missing for that arch. It would be possible to self-compile those releases, but then one can also self-compile 0.15-0.19.
This cleanup may slightly impact test coverage. Reduce code repition by looping over the list of nodes. Reduce brittleness by refering to nodes by name rather than index. Add helper method nodes_wallet_dir.
The file checksums were added in an earlier commit. Since the DMG file is never downloaded, we drop that checksum.
The -sandbox argument is not present in the v22.0 release. Changing the minimum version to 229900 ensures it's used when testing the master branch. If the argument is backported, the minimum version can be adjusted to e.g. 220100.
ef08ba1
to
24cec4b
Compare
Rebased and included #19332. |
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 24cec4b. Only change since last review is rebasing and adding comment and whitelist args.
I'm surprised this PR is still open. It seems useful and not a particularly risky change to merge.
🎉 |
This also simplifies the tests a bit.