Skip to content
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: Add feature_taproot.py --previous_release #20354

Closed

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Nov 9, 2020

Disabling the new consensus code at runtime is fine, but potentially fragile and incomplete. Fix that by giving the option to run with a version that has been compiled without any taproot code.

@DrahtBot DrahtBot added the Tests label Nov 9, 2020
@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 9, 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:

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.

@luke-jr
Copy link
Member

luke-jr commented Nov 13, 2020

Concept ACK

1 similar comment
@theStack
Copy link
Contributor

Concept ACK

@michaelfolkson
Copy link
Contributor

The motivation for this is that someone might run the functional tests of a post Taproot release with the code of a pre Taproot release (without any Taproot code)? I'm not entirely sure on the motivation.

Also I'd like to review and test this but unsure how the feature_taproot.py --previous_release test should get triggered. Obviously I can run this test individually but I don't think there is much point to that.

I asked on IRC and @jonatack pointed me to -vbparams config option which requires a start and end time "for specified version bits deployment" Let me know if this is the best way to test this.

@maflcko
Copy link
Member Author

maflcko commented Dec 29, 2020

Taproot is a softfork that comes with some consensus and policy (transaction relay) changes. While there is a way to "remove" the taproot code at runtime with the vbparams option, there is currently no formal proof that none of the taproot code is executed at runtime. It was unknown if the new taproot code influences the test result of this test in any way.

The subtest checks that taproot is a softfork, i.e. nodes without the taproot code can still sync with the network at a small cost of missing some consensus checks. As said, vbparams can be used to disable the taproot code. A cleaner approach is to run the test against a previously released version of a full node that isn't aware of taproot.

You can run the test manually with the --previous_release or via the test_runner's built-in list.

If you want to test -vbparams outside of what the test does, you can pass it as an option to Bitcoin Core.

@maflcko
Copy link
Member Author

maflcko commented Dec 29, 2020

You'll also have to download the previous release first. See https://github.com/bitcoin/bitcoin/pull/19013/files#diff-5de36acd90308dc62abf7855a686ee7052ffb6e762c756fd735fb0c9fbd9595d for instructions.

@michaelfolkson
Copy link
Contributor

michaelfolkson commented Dec 30, 2020

ACK fa3c615

Ran ./test/get_previous_releases.py -b v0.19.1 v0.18.1 v0.17.2 v0.16.3 v0.15.2 though only needed one previous release. Didn't include v0.20.1 as that isn't added yet. (Added in #19013)

Then feature_taproot.py --previous_release test passes. Reviewed code as well. Test successfully skips when you haven't downloaded a previous release.

@instagibbs
Copy link
Member

If I wanted to intentionally break this, how do I mess with "older releases"? There documentation for this testing feature?

@maflcko
Copy link
Member Author

maflcko commented Jan 8, 2021

@maflcko
Copy link
Member Author

maflcko commented Feb 24, 2021

Rebased

Copy link
Member

@Sjors Sjors 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

test/functional/feature_taproot.py Outdated Show resolved Hide resolved
@maflcko maflcko force-pushed the 2010-testFeatureTaprootPreviousVersion branch from fa4b264 to fa80e10 Compare February 25, 2021 07:51
@maflcko
Copy link
Member Author

maflcko commented Feb 25, 2021

(force pushed to tidy up the first commit)

@Sjors
Copy link
Member

Sjors commented Feb 25, 2021

I was a bit worried that this PR would break #19013, but the subset of changes you're using is simple enough to rebase on (this PR just downloads the binary and doesn't touch the other backwards compatibility tests).

tACK fa80e10

@instagibbs replace releases/v0.20.1/bin/bitcoind with ransomware :-)

@MarcoFalke your excellent explanation would make a nice comment in the test.

@maflcko
Copy link
Member Author

maflcko commented Feb 25, 2021

Will do in a follow-up or if I have to force push.

@NelsonGaldeman
Copy link
Contributor

NelsonGaldeman commented Jul 13, 2021

I ran it and succesfully skipped the test when previous releases are missing. After downloading previous versions it ran and tests pass! Code looks fine.

tACK fa80e10

Am I right saying it will only be ran by the test runner for people who already had older versions compiled or purposely downloaded binaries?

Unrelated to the PR itself but my first try to download previous versions ended up in a Checksum did not match on the 0.21.0. Tried again and worked fine. Checked both files size showed on the console and they were slightly different.
Update on above: #22442

@maflcko
Copy link
Member Author

maflcko commented Jul 13, 2021

Am I right saying it will only be ran by the test runner for people who already had older versions compiled or purposely downloaded binaries?

Yes. This is the case for the ci config (one task is using downloaded binaries) and locally if you have compiled/downloaded the binaries.

Unrelated to the PR itself but my first try to download previous versions ended up in a Checksum did not match on the 0.21.0. Tried again and worked fine. Checked both files size showed on the console and they were slightly different.

This is a "known" issue. See bitcoin-core/bitcoincore.org#753

@TheBlueMatt
Copy link
Contributor

This is a "known" issue. See bitcoin-core/bitcoincore.org#753

This is absolutely not a known issue. Not at all. Not even remotely.

maflcko pushed a commit to bitcoin-core/gui that referenced this pull request Jul 14, 2021
…release

fa80e10 test: Add feature_taproot.py --previous_release (MarcoFalke)
85ccffa test: move releases download incantation to README (Sjors Provoost)
29d6b1d test: previous releases: add v0.20.1 (Sjors Provoost)

Pull request description:

  Disabling the new consensus code at runtime is fine, but potentially fragile and incomplete. Fix that by giving the option to run with a version that has been compiled without any taproot code.

ACKs for top commit:
  Sjors:
    tACK fa80e10
  NelsonGaldeman:
    tACK fa80e10

Tree-SHA512: 1a1feef823f08c05268759645a8974e1b2d39a024258f5e6acecbe25097aae3fa9302c27262978b40f1aa8e7b525b60c0047199010f2a5d6017dd6434b4066f0
@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@fanquake
Copy link
Member

Looks like this has been merged?

@fanquake fanquake closed this Jul 14, 2021
@maflcko maflcko deleted the 2010-testFeatureTaprootPreviousVersion branch July 14, 2021 11:14
@maflcko
Copy link
Member Author

maflcko commented Jul 14, 2021

Jup, it's the usual brokenness of GitHub.

@Sjors
Copy link
Member

Sjors commented Jul 14, 2021

Ah, this took a few commits from #19013. I'm rebasing that now...

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 14, 2021
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet