[0.21] Speedy trial activation for Taproot #21701

pull achow101 wants to merge 10 commits into bitcoin:0.21 from achow101:0.21-taproot-st changing 9 files +318 −165
  1. achow101 commented at 4:07 pm on April 15, 2021: member
    Backport of #21377 and #21686
  2. tests: pull ComputeBlockVersion test into its own function
    The intent here is to allow checking ComputeBlockVersion behaviour with
    each deployment, rather than only testdummy on mainnet. This commit does
    the trivial refactoring component of that change.
    
    Github-Pull: #21377
    Rebased-From: 63879f0a4760c0c0f784029849cb5d21ee088abb
    2e9e7f4329
  3. tests: test ComputeBlockVersion for all deployments
    This generalises the ComputeBlockVersion test so that it can apply to
    any activation parameters we might set, and checks all the parameters
    set for each deployment on each chain, to simultaneously ensure that the
    deployments we have configured work sensibly, and that the test code
    does not suffer bitrot in the event that all interesting deployments
    are buried.
    
    Github-Pull: #21377
    Rebased-From: 593274445004506c921d5d851361aefb3434d744
    1c0164544c
  4. tests: clean up versionbits test
    Simplify the versionbits unit test slightly to make the next set of
    changes a little easier to follow.
    
    Github-Pull: #21377
    Rebased-From: 9e6b65f6fa205eee5c3b99343988adcb8d320460
    f9517e6014
  5. versionbits: Add support for delayed activation
    Github-Pull: #21377
    Rebased-From: 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8
    4cab84cfdf
  6. achow101 renamed this:
    [0.2] Speedy trial activation for Taproot
    [0.21] Speedy trial activation for Taproot
    on Apr 15, 2021
  7. DrahtBot added the label Backport on Apr 15, 2021
  8. in src/test/versionbits_tests.cpp:274 in 37c255cdeb outdated
    266@@ -226,6 +267,13 @@ BOOST_AUTO_TEST_CASE(versionbits_test)
    267         // Make sure that no deployment tries to set an invalid bit.
    268         BOOST_CHECK_EQUAL(bitmask & ~(uint32_t)VERSIONBITS_TOP_MASK, bitmask);
    269 
    270+        // Check min_activation_height is on a retarget boundary
    271+        BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height % mainnetParams.nMinerConfirmationWindow, 0);
    272+        // Check min_activation_height is 0 for ALWAYS_ACTIVE and never active deployments
    273+        if (mainnetParams.vDeployments[i].nStartTime == Consensus::BIP9Deployment::ALWAYS_ACTIVE || mainnetParams.vDeployments[i].nStartTime == Consensus::BIP9Deployment::NEVER_ACTIVE) {
    274+            BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height, 0);
    


    MarcoFalke commented at 5:28 pm on April 15, 2021:
    0            BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height, 0U);
    

    Looks like you are hitting some stupid compiler error


    achow101 commented at 5:56 pm on April 15, 2021:
    Fixed.
  9. achow101 force-pushed on Apr 15, 2021
  10. Sjors commented at 6:14 pm on April 15, 2021: member

    ~tACK 724e4948004c8127f093db90f9d78e6ed9e46541~ on Ubuntu

    I verified as follows:

    0git checkout origin/0.21
    1git checkout -b speedy-trial-backport
    2git cherry-pick 63879f0a4760c0c0f784029849cb5d21ee088abb^..ffe33dfbd4c3b11e3475b022b6c1dd077613de79
    3git cherry-pick f979b3237f1cfc28f9c4ccb07beab558d5357a55
    4git diff 724e4948004c8127f093db90f9d78e6ed9e46541
    5src/test/test_bitcoin --run_test=versionbits_tests
    

    Git diff only shows a difference in the trailing U for this test (presumably related to #21701 (review)): BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height, 0U);

    I had manually resolve a conflict for dd07e6da48040dc7eae46bc7941db48d98a669fd.

    I also managed to spin up the node and see the softfork as “defined” in getblockchaininfo.


    I’m unable to reproduce the CI failure on macOS 11.2.3 with homebrew Boost 1.75.0. It doesn’t happen for me with depends either.

  11. achow101 commented at 10:45 pm on April 15, 2021: member
    I don’t know why CI is having a hard time building this. I am able to do a gitian build of this branch, so it should be working.
  12. fanquake added this to the milestone 0.21.1 on Apr 16, 2021
  13. in src/test/versionbits_tests.cpp:271 in 724e494800 outdated
    266@@ -226,6 +267,13 @@ BOOST_AUTO_TEST_CASE(versionbits_test)
    267         // Make sure that no deployment tries to set an invalid bit.
    268         BOOST_CHECK_EQUAL(bitmask & ~(uint32_t)VERSIONBITS_TOP_MASK, bitmask);
    269 
    270+        // Check min_activation_height is on a retarget boundary
    271+        BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height % mainnetParams.nMinerConfirmationWindow, 0);
    


    fanquake commented at 0:53 am on April 16, 2021:
    0        BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height % mainnetParams.nMinerConfirmationWindow, 0U);
    

    achow101 commented at 0:59 am on April 16, 2021:
    Done
  14. in src/test/versionbits_tests.cpp:274 in 724e494800 outdated
    266@@ -226,6 +267,13 @@ BOOST_AUTO_TEST_CASE(versionbits_test)
    267         // Make sure that no deployment tries to set an invalid bit.
    268         BOOST_CHECK_EQUAL(bitmask & ~(uint32_t)VERSIONBITS_TOP_MASK, bitmask);
    269 
    270+        // Check min_activation_height is on a retarget boundary
    271+        BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height % mainnetParams.nMinerConfirmationWindow, 0);
    272+        // Check min_activation_height is 0 for ALWAYS_ACTIVE and never active deployments
    273+        if (mainnetParams.vDeployments[i].nStartTime == Consensus::BIP9Deployment::ALWAYS_ACTIVE || mainnetParams.vDeployments[i].nStartTime == Consensus::BIP9Deployment::NEVER_ACTIVE) {
    274+            BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height, 0U);
    


    fanquake commented at 0:54 am on April 16, 2021:
    0            BOOST_CHECK_EQUAL(mainnetParams.vDeployments[i].min_activation_height, 0);
    

    achow101 commented at 0:59 am on April 16, 2021:
    Done
  15. in src/test/versionbits_tests.cpp:317 in 724e494800 outdated
    322+    BOOST_REQUIRE(nStartTime >= 0);
    323+    BOOST_REQUIRE(nTimeout <= std::numeric_limits<uint32_t>::max() || nTimeout == Consensus::BIP9Deployment::NO_TIMEOUT);
    324+    BOOST_REQUIRE(0 <= bit && bit < 32);
    325+    BOOST_REQUIRE(((1 << bit) & VERSIONBITS_TOP_MASK) == 0);
    326+    BOOST_REQUIRE(min_activation_height >= 0);
    327+    BOOST_REQUIRE_EQUAL(min_activation_height % params.nMinerConfirmationWindow, 0);
    


    fanquake commented at 0:54 am on April 16, 2021:
    0    BOOST_REQUIRE_EQUAL(min_activation_height % params.nMinerConfirmationWindow, 0U);
    

    achow101 commented at 0:59 am on April 16, 2021:
    Done
  16. fanquake commented at 0:55 am on April 16, 2021: member
    These 3 changes will fix the failing CIs.
  17. tests: test versionbits delayed activation
    Github-Pull: #21377
    Rebased-From: dd85d5411c1702c8ae259610fe55050ba212e21e
    71917e01eb
  18. fuzz: test versionbits delayed activation
    Github-Pull: #21377
    Rebased-From: dd07e6da48040dc7eae46bc7941db48d98a669fd
    b529222ad1
  19. versionbits: Add explicit NEVER_ACTIVE deployments
    Previously we used deployments that would timeout prior to Bitcoin's
    invention, which allowed the deployment to still be activated in unit
    tests. This switches those deployments to be truly never active.
    
    Github-Pull: #21377
    Rebased-From: 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf
    3acf0379e0
  20. versionbits: simplify state transitions
    This removes the DEFINED->FAILED transition and changes the
    STARTED->FAILED transition to only occur if signalling didn't pass the
    threshold. This ensures that it is always possible for activation to
    occur, no matter what settings are chosen, or the speed at which blocks
    are found.
    
    Github-Pull: #21377
    Rebased-From: f054f6bcd2c2ce5fea84cf8681013f85a444e7ea
    600357306e
  21. chainparams: drop versionbits threshold to 90% for mainnnet and signet
    Github-Pull: #21377
    Rebased-From: ffe33dfbd4c3b11e3475b022b6c1dd077613de79
    ec7824396b
  22. Add mainnet and testnet taproot activation params
    Github-Pull: #21686
    Rebased-From: f979b3237f1cfc28f9c4ccb07beab558d5357a55
    cbd64c3a28
  23. achow101 force-pushed on Apr 16, 2021
  24. jnewbery commented at 8:18 am on April 16, 2021: member

    ACK cbd64c3a28a7466f421477daadc6e6e6b69b898a

    Repeated the rebase/cherry-pick myself and the only differences were the unsigned/signed fixups here: #21701#pullrequestreview-637244766.

  25. Sjors commented at 8:39 am on April 16, 2021: member
    tACK cbd64c3
  26. MarcoFalke commented at 9:12 am on April 16, 2021: member

    cherry-pick-only ACK cbd64c3a28a7466f421477daadc6e6e6b69b898a 🌾

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3cherry-pick-only ACK cbd64c3a28a7466f421477daadc6e6e6b69b898a 🌾
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUiVXAwAm+m81VxCGAQs/vB2ZvE43rHYlW8QBpQbRB4ckkjnmXxSoNJipajP02Je
     83CwjtSrxS9A0Dam8u4D3BHHdYyyT/UJF02JJMNEzTlO9b2OW5v0SrGZqGGIxSluC
     9oltxBDg5ry3tHSs4Zkm2o71je9L00ZgOMQD4Yan5yOCVmCVWfIaBFR3oXhL/pdhr
    100UrlkPWPuF3h2Lt7dqEqhd3/rZzV7dtMK0tBqX7B7IE8sX/g5qvEIAAnstn6jJeN
    11rYbTwEkVMKDstIvonGa1EcMAr4TMay2V1h+q53JNvAmqkIj+8nZvH/5hbpnVNuTg
    12CivIvZKffc3C+4cigKsiJSHcT9vAeK6K/C5MW5G/9uio1kqdZq7McA3my7AmlDN5
    13e3jtTBDIUN/BMhOiizS1iYsqwHZjF4qPdfySxgDPw4Z49toee2ziN0BMv9NTrKc6
    14WI5hPKFG38l8O4YHO6tyCRJfVJuoP2ByhGiU7/pTJO0NvKnRh+Wma3kRa61sTbrl
    15cfriU22f
    16=gYxK
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 1d1c8419f375b140d9bb77c1f31aa2bb76a54e095fe73d7ba926604fb50abc88 -

  27. MarcoFalke merged this on Apr 16, 2021
  28. MarcoFalke closed this on Apr 16, 2021

  29. ajtowns commented at 10:06 am on April 16, 2021: member
    Post-merge ACK cbd64c3a28a7466f421477daadc6e6e6b69b898a – checked fuzzer compiles at each step, visually compared new patches with originals, checked original patches are in master
  30. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-28 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me