test: Activate all regtest softforks at height 1, unless overridden #22818

pull MarcoFalke wants to merge 5 commits into bitcoin:master from MarcoFalke:2108-regtestSoft changing 19 files +96 −90
  1. MarcoFalke commented at 1:39 pm on August 27, 2021: member

    All softforks that are active at the tip of mainnet, should also be active from genesis in regtest. Otherwise their rules might not be enforced in user testing, thus making their testing less useful.

    To still allow tests to check pre-softfork rules, a runtime argument can change the activation height.

  2. DrahtBot added the label Validation on Aug 27, 2021
  3. laanwj commented at 7:57 pm on August 27, 2021: member

    Concept ACK. But I would personally prefer to overload one argument for the different activation heights, instead of adding a new argument for every single thing, for now and in the future. Either e,g,:

    0-testactivationheights=<bip34height>,<dersigheight>,<cltvheight>,<csvheight>
    

    (this will work fine for the tests which “know” about everything anyway, even if new things get added) or, alternatively

    0-testactivationheight=bip34,<height>
    1-testactivationheight=dersig,<height>
    2
  4. DrahtBot commented at 7:28 am on August 28, 2021: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #22976 (scripted-diff: Rename overloaded int GetArg to GetIntArg by ryanofsky)
    • #22711 (test: check for specific block reject reasons in p2p_segwit.py by theStack)
    • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
    • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
    • #10102 ([experimental] Multiprocess bitcoin by ryanofsky)

    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.

  5. theStack commented at 6:11 pm on August 28, 2021: member
    Concept ACK
  6. kristapsk commented at 6:19 pm on August 28, 2021: contributor
    Concept ACK
  7. MarcoFalke force-pushed on Aug 30, 2021
  8. MarcoFalke force-pushed on Aug 30, 2021
  9. MarcoFalke force-pushed on Aug 30, 2021
  10. MarcoFalke force-pushed on Aug 30, 2021
  11. MarcoFalke commented at 2:52 pm on August 30, 2021: member

    -testactivationheight=bip34,

    Done

  12. MarcoFalke force-pushed on Sep 3, 2021
  13. practicalswift commented at 1:51 pm on September 4, 2021: contributor
    Strong Concept ACK
  14. in src/chainparams.cpp:398 in fae8d474f3 outdated
    397-        consensus.BIP66Height = 102; // BIP66 activated on regtest (Block at height 101 and earlier not enforced for testing purposes)
    398-        consensus.CSVHeight = 432; // CSV activated on regtest (Used in rpc activation tests)
    399+        consensus.BIP65Height = 1;  // Always active unless overridden
    400+        consensus.BIP66Height = 1;  // Always active unless overridden
    401+        consensus.CSVHeight = 1;    // Always active unless overridden
    402         consensus.SegwitHeight = 0; // SEGWIT is always activated on regtest unless overridden
    


    theStack commented at 10:23 am on September 5, 2021:
    nit: For consistency reasons, could also set SegwitHeight to 1? Otherwise this implies to the reader that there’s a subtle difference. (Maybe there is one that I’m not aware of, but at least the tests still seem to pass with a value of 1).

    MarcoFalke commented at 8:14 am on September 6, 2021:
    Thanks, done.
  15. in test/functional/feature_dersig.py:115 in cccc7ae722 outdated
    108@@ -110,7 +109,7 @@ def run_test(self):
    109             peer.sync_with_ping()
    110 
    111         self.log.info("Test that transactions with non-DER signatures cannot appear in a block")
    112-        block.nVersion = 3
    113+        block.nVersion = 4
    


    theStack commented at 10:29 am on September 5, 2021:
    After changing this, the log message “Test that a version 3 block with…” should also be updated.

    MarcoFalke commented at 8:14 am on September 6, 2021:
    Thanks, done.
  16. theStack commented at 10:30 am on September 5, 2021: member
    LGTM overall, left two small improvement suggestions.
  17. MarcoFalke force-pushed on Sep 6, 2021
  18. MarcoFalke force-pushed on Sep 6, 2021
  19. theStack approved
  20. theStack commented at 12:28 pm on September 6, 2021: member
    ACK fa32518ae3a670f2a964812806d4b07cc488c8a2 🍴
  21. DrahtBot added the label Needs rebase on Sep 9, 2021
  22. MarcoFalke force-pushed on Sep 9, 2021
  23. DrahtBot removed the label Needs rebase on Sep 9, 2021
  24. DrahtBot added the label Needs rebase on Sep 10, 2021
  25. theStack approved
  26. theStack commented at 10:09 am on September 10, 2021: member

    re-ACK fa5b518f165dd220dce2f46ad590b8ce8bdd26d8

    Checked via git range-diff fa32518a...fa5b518f that changes since my last ACK are only rebase-related.

  27. MarcoFalke force-pushed on Sep 10, 2021
  28. MarcoFalke commented at 10:21 am on September 10, 2021: member
    Force pushed (trivial, without rebase)
  29. DrahtBot removed the label Needs rebase on Sep 10, 2021
  30. theStack approved
  31. theStack commented at 12:22 pm on September 10, 2021: member

    D’oh, didn’t see the “Needs rebase” label when I did the previous review. At least the re-review is trivial now.

    ACK fae5b05486ae90f630cb26226f2e656507b391c9 1️⃣

  32. DrahtBot added the label Needs rebase on Sep 16, 2021
  33. test: Remove unused ~TestChain100Setup
    segwitheight is already 0 for regtest
    fa086ef539
  34. test: Remove version argument from build_next_block in p2p_segwit test
    The block version does not have any effect on the segwit consensus rules
    or block relay logic.
    
    Same for feature_dersig.
    faa46986aa
  35. test: Add extra_args argument to TestChain100Setup constructor
    This will be needed in a later commit.
    fadb2ef2fa
  36. Introduce -testactivationheight=name@height setting faad1e5ffd
  37. test: Activate all regtest softforks at height 1, unless overridden fa4db8671b
  38. MarcoFalke force-pushed on Sep 16, 2021
  39. DrahtBot removed the label Needs rebase on Sep 16, 2021
  40. in test/functional/rpc_blockchain.py:143 in fa4db8671b
    139@@ -142,11 +140,11 @@ def _test_getblockchaininfo(self):
    140         assert_greater_than(res['size_on_disk'], 0)
    141 
    142         assert_equal(res['softforks'], {
    143-            'bip34': {'type': 'buried', 'active': True, 'height': 2},
    144-            'bip66': {'type': 'buried', 'active': True, 'height': DERSIG_HEIGHT},
    145-            'bip65': {'type': 'buried', 'active': True, 'height': CLTV_HEIGHT},
    146-            'csv': {'type': 'buried', 'active': False, 'height': 432},
    147-            'segwit': {'type': 'buried', 'active': True, 'height': 0},
    148+            'bip34': {'type': 'buried', 'active': True, 'height': 1},
    


    laanwj commented at 9:06 pm on September 20, 2021:
    Wouldn’t having slightly different activation heights here (even it its 1,2,3,4,5) make for a better test?

    MarcoFalke commented at 7:14 am on September 21, 2021:
    Can do on the next force push or another pull request (whichever happens earlier)
  41. laanwj commented at 9:06 pm on September 20, 2021: member
    Code review ACK fa4db8671bb604e11b43a837f91de8866226f166
  42. theStack approved
  43. theStack commented at 11:32 pm on September 22, 2021: member
    re-ACK fa4db8671bb604e11b43a837f91de8866226f166
  44. MarcoFalke merged this on Sep 24, 2021
  45. MarcoFalke closed this on Sep 24, 2021

  46. MarcoFalke deleted the branch on Sep 24, 2021
  47. sidhujag referenced this in commit 2d58c2f315 on Sep 24, 2021
  48. sidhujag referenced this in commit da9da689f1 on Sep 24, 2021
  49. MarcoFalke referenced this in commit 16ccb3a1cd on Sep 25, 2021
  50. sidhujag referenced this in commit 51e8ce8571 on Sep 25, 2021
  51. mzumsande commented at 6:02 pm on March 10, 2022: member
    The change of consensus.SegwitHeight from 0 to 1 has the effect that if I create a regtest enviroment with a current master (or 23.0), and then try to load the chain with an older version (e.g. 22.0), I get an InitError Witness data for blocks after height 0 requires validation. Please restart with -reindex because BLOCK_OPT_WITNESS is no longer set for the Genesis block and NeedsRedownload() in validation returns true. That might be a bit annoying for some tests - @MarcoFalke @theStack what do you think?
  52. MarcoFalke commented at 6:51 pm on March 10, 2022: member
    No objection setting it back to 0. An alternative might be to just use -reindex with 22.x, which will make the datadir compatible for 22.x and 23.x at the same time.
  53. mzumsande referenced this in commit 5ce3057c8e on Mar 10, 2022
  54. mzumsande commented at 7:48 pm on March 10, 2022: member
    see #24527
  55. MarcoFalke referenced this in commit 2860a91df0 on Mar 13, 2022
  56. jonatack referenced this in commit b1646f1bb5 on Mar 13, 2022
  57. sidhujag referenced this in commit 9464ddbfe4 on Mar 13, 2022
  58. hebasto referenced this in commit af3ef5b386 on Mar 31, 2022
  59. delta1 referenced this in commit 9bdd001cdc on Apr 23, 2023
  60. delta1 referenced this in commit 13fb374543 on Apr 24, 2023
  61. delta1 referenced this in commit 7856df2733 on Apr 24, 2023
  62. DrahtBot locked this on Jun 24, 2023

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-12-19 00:12 UTC

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