Skip to content

Conversation

Sjors
Copy link
Member

@Sjors Sjors commented May 19, 2020

This also simplifies the tests a bit.

@DrahtBot
Copy link
Contributor

DrahtBot commented May 19, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #24236 (Remove utxo db upgrade code by MarcoFalke)
  • #23127 (tests: Use test framework utils where possible by vincenzopalazzo)
  • #19332 (test: Fix intermittent test failure in feature_backwards_compatibility by MarcoFalke)

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.

@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from 01e66bf to b998f69 Compare May 22, 2020 11:49
@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from b998f69 to 3181f0a Compare June 3, 2020 10:20
@Sjors Sjors marked this pull request as ready for review June 3, 2020 10:21
@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from 3181f0a to 5a9152f Compare June 16, 2020 11:35
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

@Sjors
Copy link
Member Author

Sjors commented Jul 21, 2020

Rebased and dropped the release candidate commit.

@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from 3619923 to 7628ed0 Compare July 21, 2020 12:41
@maflcko
Copy link
Member

maflcko commented Jul 21, 2020

This fails on travis. Presumably because gpg is missing, etc

@katesalazar
Copy link
Contributor

I wonder if 9e03b89 is enough self explanatory
about the bugs it fixes.

It wouldn't hurt me adding a thorough detailed text to it.

@Sjors
Copy link
Member Author

Sjors commented Nov 15, 2021

@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 feature_backwards_compatibility.py --legacy-wallet is not spurious, because it happened before the rebase too. But I can't reproduce it on macOS. Update: reproduced on Ubuntu...

@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from 77e3c9e to 98a65b8 Compare November 15, 2021 10:42
@Sjors
Copy link
Member Author

Sjors commented Nov 15, 2021

The test framework sets -sandbox=log-and-abort for version 22.0 and up, but that's not part of the release binary. I added a commit to fix that.

I'll rebase after #23514 is fixed.

@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from 98a65b8 to 62b22de Compare November 15, 2021 16:24
@Sjors
Copy link
Member Author

Sjors commented Nov 15, 2021

Rebased after #23515 and merge conflict.

Copy link
Contributor

@ryanofsky ryanofsky left a 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]
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member Author

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",
Copy link
Contributor

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?

Copy link
Member Author

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:]:
Copy link
Contributor

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]

?

Copy link
Member Author

@Sjors Sjors Nov 18, 2021

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)
Copy link
Contributor

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.

Copy link
Member Author

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.

Comment on lines 450 to 453
if version > 219999:
version *= 100
Copy link
Contributor

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.

Copy link
Member Author

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.

@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from 62b22de to 7124899 Compare November 18, 2021 14:39
@Sjors
Copy link
Member Author

Sjors commented Nov 18, 2021

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.

Copy link
Contributor

@ryanofsky ryanofsky left a 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)
Copy link
Contributor

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.

@Sjors
Copy link
Member Author

Sjors commented Dec 1, 2021

Thanks @ryanofsky. I fixed the indentation and added the requested comment.

@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from 7124899 to ef08ba1 Compare December 1, 2021 05:23
MarcoFalke and others added 7 commits December 16, 2021 12:41
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.
@Sjors Sjors force-pushed the 2020/05/previous_release_0.20 branch from ef08ba1 to 24cec4b Compare December 16, 2021 05:51
@Sjors
Copy link
Member Author

Sjors commented Dec 16, 2021

Rebased and included #19332.

Copy link
Contributor

@ryanofsky ryanofsky left a 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.

@maflcko maflcko merged commit f1ce67f into bitcoin:master Feb 24, 2022
@Sjors
Copy link
Member Author

Sjors commented Feb 24, 2022

🎉

@Sjors Sjors deleted the 2020/05/previous_release_0.20 branch February 24, 2022 19:24
@bitcoin bitcoin locked and limited conversation to collaborators Feb 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants