Move some tests and documentation from testnet3 to testnet4 #32096

pull Sjors wants to merge 6 commits into bitcoin:master from Sjors:2025/03/testnet3-4 changing 6 files +58 −62
  1. Sjors commented at 9:14 am on March 19, 2025: member

    In preparation for dropping testnet3 entirely in #31974 this PR migrates a few things to testnet4:

    • the ZMQ examples
    • developer docs
    • various unit tests
    • the snapshot magic byte check in feature_assumeutxo.py

    It drops testnet3 from MAGIC_BYTES in the test framework, since no test uses it.

  2. DrahtBot commented at 9:14 am on March 19, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32096.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK fjahr, maflcko, hodlinator

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32117 (qa: make feature_assumeutxo.py test more robust by darosior)
    • #31974 (Drop testnet3 by Sjors)

    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.

  3. Sjors commented at 9:14 am on March 19, 2025: member

    I’m unsure if I got the argsman_tests changes right.

    An alternative approach could be to move (some of) these tests to signet, which is less likely to go away than testnet4.

  4. in contrib/zmq/zmq_sub.py:10 in a0c134c452 outdated
    11-                -zmqpubrawtx=tcp://127.0.0.1:28332 \
    12-                -zmqpubrawblock=tcp://127.0.0.1:28332 \
    13-                -zmqpubhashtx=tcp://127.0.0.1:28332 \
    14-                -zmqpubhashblock=tcp://127.0.0.1:28332 \
    15-                -zmqpubsequence=tcp://127.0.0.1:28332
    16+        bitcoind -testnet4 -daemon \
    


    Sjors commented at 9:17 am on March 19, 2025:
    a0c134c4525e6ab6ca937b744ced6d963c389c96: I don’t see any harm in just using mainnet for ZMQ, so maybe that’s better?

    fjahr commented at 4:13 pm on March 24, 2025:
    Seems fine either way. I don’t see why this has to be testnet in the example here.

    Sjors commented at 8:29 am on March 25, 2025:

    I found myself wondering what ports to use on mainnet, so I’ll probably just leave it as testnet4.

    Someone should come up with a recommended set of ZMQ port numbers though, but not here.

  5. fjahr commented at 4:13 pm on March 24, 2025: contributor

    utACK 2906b183169bc78b37449a818717249c2d1cb7a1

    Reviewed the code and changes look good to me.

  6. in src/test/argsman_tests.cpp:664 in 2906b18316 outdated
    668     BOOST_CHECK_EQUAL(test_args.GetChainTypeString(), "main");
    669 
    670-    BOOST_CHECK(test_args.ParseParameters(2, argv_testnet, error));
    671-    BOOST_CHECK_EQUAL(test_args.GetChainTypeString(), "test");
    672+    BOOST_CHECK(test_args.ParseParameters(2, argv_testnet4, error));
    673+    BOOST_CHECK_EQUAL(test_args.GetChainTypeString(), "testnet4");
    


    hodlinator commented at 10:50 pm on March 24, 2025:
    Should be removed as these tests currently duplicate the L669-670. Don’t think those checks mean to be dependent on surrounding lines. Probably good to keep L685+L687 though.
  7. in doc/developer-notes.md:415 in 2906b18316 outdated
    409@@ -410,7 +410,7 @@ to see it.
    410 ### Signet, testnet, and regtest modes
    411 
    412 If you are testing multi-machine code that needs to operate across the internet,
    413-you can run with either the `-signet` or the `-testnet` config option to test
    414+you can run with either the `-signet` or the `-testnet4` config option to test
    415 with "play bitcoins" on a test network.
    416 
    


    hodlinator commented at 11:05 pm on March 24, 2025:

    (Inline thread in random position)

    informational: https://developer.bitcoin.org/examples/intro.html / https://github.com/bitcoin-dot-org/developer.bitcoin.org/blob/master/examples/intro.rst still references the Testnet3 RPC port 18332. But the repo hasn’t been updated for 4 years.


    Sjors commented at 8:31 am on March 25, 2025:
    The bitcoin.org project is independent from Bitcoin Core, but you could open a PR there to recommend that they recommend testnet4.

  8. hodlinator approved
  9. hodlinator commented at 11:16 pm on March 24, 2025: contributor

    ACK 2906b183169bc78b37449a818717249c2d1cb7a1

    Ran functional tests with --extended with on a non-multiprocess devmode build (in part to verify network MAGIC_BYTES change).

  10. Sjors force-pushed on Mar 25, 2025
  11. Sjors commented at 9:01 am on March 25, 2025: member
    Rebased (just in case), added testnet4 magic bytes coverage to feature_assumeutxo.py (new commit), removed the duplication in argsman_tests.cpp.
  12. Sjors commented at 12:49 pm on March 25, 2025: member

    Not sure what to make of the Win64 fuzz failure:

    0Assertion failed: DecodeBase64PSBT(psbt, random_string, error) == error.empty(), file
    

    https://github.com/bitcoin/bitcoin/actions/runs/14055561051/job/39354164966?pr=32096#step:14:373

    cc @maflcko


    Update, appears unrelated, see #32135.

  13. hodlinator commented at 12:51 pm on March 25, 2025: contributor

    Not sure what to make of the Win64 fuzz failure:

    #30746 (review)

  14. fjahr commented at 1:25 pm on March 25, 2025: contributor
    re-ACK 2ee474d33f3340084a458e7348f5358fcaea8911
  15. DrahtBot requested review from hodlinator on Mar 25, 2025
  16. hodlinator approved
  17. hodlinator commented at 1:58 pm on March 25, 2025: contributor

    re-ACK 2ee474d33f3340084a458e7348f5358fcaea8911

    • Inserted assumeutxo functional test change from 31974.
    • Dropped duplicated argsman_test.cpp lines.
  18. in contrib/zmq/zmq_sub.py:15 in e1862a0b5d outdated
    16+        bitcoind -testnet4 -daemon \
    17+                -zmqpubrawtx=tcp://127.0.0.1:48332 \
    18+                -zmqpubrawblock=tcp://127.0.0.1:48332 \
    19+                -zmqpubhashtx=tcp://127.0.0.1:48332 \
    20+                -zmqpubhashblock=tcp://127.0.0.1:48332 \
    21+                -zmqpubsequence=tcp://127.0.0.1:48332
    


    maflcko commented at 9:51 am on March 26, 2025:

    e1862a0b5d3ff46d507ff8cd3426292ff587328d: Why are you changing this? Have you tested this?

    My understanding is that this is already the rpc port, so re-using it should fail.


    Sjors commented at 11:25 am on March 26, 2025:
    Because testnet4 uses 4xxxx ports. But I guess that doesn’t really matter here, because testnet3 uses 1xxxx ports and not 2xxxx. I’ll just revert the port numbers and only change -testnet to -testnet4.

    Sjors commented at 11:31 am on March 26, 2025:
    Fixed in 4281e3603a2eadefc8535b863128a05cf3a5a75f
  19. in doc/zmq.md:85 in e1862a0b5d outdated
    80@@ -81,8 +81,8 @@ The high water mark value must be an integer greater than or equal to 0.
    81 
    82 For instance:
    83 
    84-    $ bitcoind -zmqpubhashtx=tcp://127.0.0.1:28332 \
    85-               -zmqpubhashtx=tcp://192.168.1.2:28332 \
    86+    $ bitcoind -zmqpubhashtx=tcp://127.0.0.1:48332 \
    87+               -zmqpubhashtx=tcp://192.168.1.2:48332 \
    


    maflcko commented at 9:52 am on March 26, 2025:
    same. doc/zmq does not even mention any test network, so the changes here seem wrong and unrelated at best.
  20. maflcko changes_requested
  21. zmq: use testnet4 in zmq_sub.py example 4281e3603a
  22. test: cover testnet4 magic in assumeutxo.py
    Replace testnet3 and use MAGIC_BYTES constants.
    8cfc09fafe
  23. test: drop unused testnet3 magic bytes d424bd5941
  24. test: use testnet4 in key_io_valid.json 7c200ece80
  25. test: use testnet4 in argsman test 6c217d22fd
  26. doc: use testnet4 in developer docs aa7a898c23
  27. Sjors force-pushed on Mar 26, 2025
  28. Sjors commented at 11:30 am on March 26, 2025: member
    e1862a0b5d3ff46d507ff8cd3426292ff587328d -> 4281e3603a2eadefc8535b863128a05cf3a5a75f: reduced the scope of ZMQ changes, no longer touching the ports, see #32096 (review)
  29. fjahr commented at 12:25 pm on March 26, 2025: contributor

    re-ACK aa7a898c236eb519aaf546afee2b9c2b6dfdea1f

    Just removed the change of zmq ports.

  30. DrahtBot requested review from hodlinator on Mar 26, 2025
  31. maflcko commented at 1:25 pm on March 26, 2025: member

    lgtm ACK aa7a898c236eb519aaf546afee2b9c2b6dfdea1f 🔊

    Signature:

    0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    2trusted comment: lgtm ACK aa7a898c236eb519aaf546afee2b9c2b6dfdea1f 🔊
    3LZn2toUp80K0lEVpMDDXYzRUmbBeK6deAYV8ud1Go6oIr7dmDGyx2EK5QuBm0m4vVmxjMrUHDo+OnctMeTx2Aw==
    
  32. hodlinator commented at 1:55 pm on March 26, 2025: contributor
    re-ACK aa7a898c236eb519aaf546afee2b9c2b6dfdea1f

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: 2025-03-28 15:12 UTC

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