[31.x] Backports #34800

pull fanquake wants to merge 39 commits into bitcoin:31.x from fanquake:31_x_backports changing 46 files +252 −180
  1. fanquake added this to the milestone 31.0 on Mar 11, 2026
  2. DrahtBot commented at 12:06 pm on March 11, 2026: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Sjors, achow101
    Stale ACK willcl-ark, hebasto

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • template.submitSolution(ctx, 0, 0, 0, b"") in test/functional/interface_ipc_mining.py

    2026-03-25 00:59:20

  3. Sjors commented at 2:54 pm on March 11, 2026: member
    Did you mean to make this a PR against 31.x?
  4. fanquake changed the base branch on Mar 11, 2026
  5. DrahtBot added the label Backport on Mar 11, 2026
  6. depends: disable Qt sbom generation
    Github-Pull: #34755
    Rebased-From: 168997e9b5720e3c58e2fc1a073d0be3cd39d971
    9852bbd218
  7. depends: delete Boost extra files
    Github-Pull: #34755
    Rebased-From: 0ebc6891e2168c3ff1c9ad2250e765446610e75e
    a3ffff0201
  8. ci: Bump GHA actions versions
    Github-Pull: #34802
    Rebased-From: fadaa7db335d1b1bd2674c51d89d6c0820ddb887
    f7f7e682b5
  9. lint: Temporarily revert to vulture==2.14
    To work around https://github.com/bitcoin/bitcoin/issues/34810
    
    Github-Pull: #34814
    Rebased-From: faae981d354e13de96442159d604a831b6c3a71e
    a74dfe3ae2
  10. fanquake force-pushed on Mar 12, 2026
  11. ci: bump cirruslabs actions versions
    Github-Pull: #34815
    Rebased-From: 9a968ad35efe04bfd86299c5dfbc48ada41bc46e
    207087b1c4
  12. test: fix addr relay test silent pass and wrong peerinfo index
    the test silently passes on master because SetupAddressRelay
    isn't called by default for inbound connections.
    
    Github-Pull: #34750
    Rebased-From: ecb5ce6e76ef9391d636e7e4f6be7e3f7ed05550
    a3c1eda8f2
  13. test: protect outbound connection from eviction in getaddr_test
    since we're bumping mocktime more than CHAIN_SYNC_TIMEOUT = 20 * 60,
    it's possible for disconnections like this to happen in the test:
    
    $ test/functional/p2p_addr_relay.py --randomseed=7758649581790797022
    ...
    TestFramework (INFO): Check that we answer getaddr messages only once per connection
    TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:58829 due to [Errno 54] Connection reset by peer
    ...
    
    Github-Pull: #34750
    Rebased-From: 7ee8c0abc629f0658b6c36f36b5da11c51cbb39d
    5642a2b0fe
  14. test: use static methods and clarify comment in addr_relay
    we don't need to send GETADDR for initial self announcement
    anymore + can construct addr_receivers using
    AddrReceiver(send_getaddr=False).
    
    however we would need to send an empty ADDR message to each
    of the addr_receivers to initialise addr relay for inbound
    connections. so current code is simpler and we can just
    clarify the comment.
    
    Github-Pull: #34750
    Rebased-From: 57bfa864fe69ea5610399f9db60cf2299930703a
    a28d78c44a
  15. DrahtBot added the label CI failed on Mar 12, 2026
  16. guix: Make guix-clean less destructive
    * Show preview and ask for confirmation before git clean unless used with "--force"
    * Error out when trying to pass args such as "guix-clean --help"
    
    Github-Pull: #34776
    Rebased-From: be6d24ec22cc2ef8086098d6322b024e07c5758c
    2724c39208
  17. build: Set AUTHOR_WARNING on warnings
    Github-Pull: #33144
    Rebased-From: fa6497ba71e9573d341c1c051af09b3ec2fc8d74
    d20ba02caa
  18. macdeploy: subprocess out to zip rather than shutil.make_archive
    Calling shutil.make_archive(), does not preserve symlinks when using the
    zip format, see https://github.com/python/cpython/issues/139679.
    
    Call `zip` using subprocess instead. This code is only run when using a
    macos machine, and I think it's safe to assume that zip is available, same
    as codesign, and all other tools we call in this script.
    
    Github-Pull: #34787
    Rebased-From: ab137cbfe2763f2306e52c7c5f1860d87defc636
    bb9fcffd4c
  19. macdeploy: use plugins dir to find plugins
    Rather than looking for /translations, which might not exist (it doesn't
    in a recent brew installed qt on macOS). i.e:
    ```bash
    ls /opt/homebrew/opt/qtbase/share/qt
    doc
    libexec
    metatypes
    mkspecs
    modules
    plugins
    sbom
    ```
    
    Github-Pull: #34787
    Rebased-From: 66d80d57b48982d8301e21321a9d82780586908d
    ab37d3d7cd
  20. ci: check macos bundle structure and codesigning
    Github-Pull: #34787
    Rebased-From: d03e3be246f64065002268e74ee9a834089de37a
    e3383ac932
  21. DrahtBot removed the label CI failed on Mar 13, 2026
  22. ci: Use arch-appropriate binaries in lint install
    Replace the hardcoded x86_64 binary name with $(uname --machine) so the
    correct binary is downloaded when building the lint container, where at
    all possible.
    
    Github-Pull: #34832
    Rebased-From: 551875360cdb3b9997dded22b929039eac635fd0
    a69f8c329e
  23. DrahtBot added the label CI failed on Mar 17, 2026
  24. test: Use asyncio.SelectorEventLoop() over deprecated asyncio.WindowsSelectorEventLoopPolicy()
    Github-Pull: #34820
    Rebased-From: fa9168ffcd6354db6daf759ace123a88fb60cbb2
    c7127f21df
  25. test: Move event loop creation to network thread
    This should fix https://github.com/bitcoin/bitcoin/issues/34367
    
    I am not familiar with Windows sockets thread-safety, but creating the
    event loop on the main thread, and running it in the network thread
    could lead to a fast abort in Python on Windows (without any stderr):
    
    ```
    77/276 - wallet_txn_clone.py failed, Duration: 1 s
    
    stdout:
    2025-12-10T08:04:27.500134Z TestFramework (INFO): PRNG seed is: 4018092284830106117
    
    stderr:
    
    Combine the logs and print the last 99999999 lines ...
    ============
    Combined log for D:\a\_temp/test_runner_₿_🏃_20251210_075632/wallet_txn_clone_196:
    ============
     test  2025-12-10T08:04:27.500134Z TestFramework (INFO): PRNG seed is: 4018092284830106117
     test  2025-12-10T08:04:27.500433Z TestFramework (DEBUG): Setting up network thread
    ```
    
    Also, I couldn't find any docs that require the loop must be created on
    the thread that runs them:
    
    * https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.new_event_loop
    * https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_forever
    
    However, the patch seems trivial to review, harmless, and easy to
    revert, so it may be a good try to fix the intermittent Windows Python
    crash.
    
    Github-Pull: #34820
    Rebased-From: fa050da9805d5388ec74e2e0f92e59e861f11918
    72d6c88165
  26. test: Fix intermittent issue in feature_assumeutxo.py
    Github-Pull: #34852
    Rebased-From: 99996f6c06dff19cd99131d0469b84c01c216cbb
    8379f005da
  27. test: [refactor] Use verbosity=0 named arg
    This is less confusing than the verbose=0 alias.
    
    Github-Pull: #34852
    Rebased-From: faf71d6cb49b8a668c417d80bc56277f30cbf2e1
    068951211c
  28. cmake: Migrate away from deprecated SQLite3 target
    CMake version 4.3 deprecated the imported target `Sqlite::Sqlite3`.
    Use the preferred name `Sqlite3::Sqlite3` instead and provide an
    alias for older versions of CMake. Also define the same alias when
    using vcpkg.
    
    Github-Pull: #34848
    Rebased-From: 498b6eb6b5e8aceb372d3097df2715d9c7fc416b
    ca781e49e5
  29. rpc: fix race condition in gettxoutsetinfo
    Fix an assertion failure in gettxoutsetinfo (issue #34263) caused by
    capturing the best block before releasing cs_main, then checking it
    against a potentially newer best block in GetUTXOStats().
    
    Remove the early pindex capture since ComputeUTXOStats() independently
    fetches the current best block under lock. Use stats.hashBlock and
    stats.nHeight (the actual computed values) instead of the potentially
    stale pindex when building the response.
    
    Github-Pull: #34451
    Rebased-From: 5e77072fa60110a00d2bff31798d58b6c10bd3da
    e930c6d60f
  30. kernel: acquire coinstats cursor and block info atomically
    Acquire the cursor and block index under the same cs_main lock to
    eliminate a potential race where a new block could be connected
    between capturing the block info and acquiring the cursor, causing
    the reported stats to reference a different block than the one
    being iterated.
    
    Github-Pull: #34451
    Rebased-From: f3bf63ec4f028cf9ee0820226f44fcbe26d358c9
    335a098afa
  31. DrahtBot removed the label CI failed on Mar 19, 2026
  32. ci: Avoid intermittent Windows generate download failures
    Github-Pull: #34859
    Rebased-From: fa71c6e84c16418ffc5568c06aed863027cb238f
    d9a57912c6
  33. tests: applied PYTHON_GIL to the env for every test
    Github-Pull: #34869
    Rebased-From: b14f2c76a1f6b41835c134584c82c45704c4cce0
    7118559f8c
  34. DrahtBot added the label CI failed on Mar 20, 2026
  35. hebasto commented at 7:56 pm on March 22, 2026: member
  36. gui: Fix TransactionsView on setCurrentWallet
    Making sure that if the privacy mode is activaded during
    the wallet selection, the transaction view is not shown.
    
    Github-Pull: #gui815
    Rebased-From: 0dc337f73d013e342b880746292f1c3247b287cf
    e53c20d750
  37. depends: Fix cross-compiling on macOS for Windows
    1. Use `build_os` instead of `host_os` for native packages.
    2. `XCODE_VERSION` is available only for `darwin` hosts. Therefore,
       simply disable the Xcode version check for `native_qt`.
    
    Github-Pull: #34878
    Rebased-From: 7a9304f8872eb4183a7a74279a7aefcdac25b468
    3b79852984
  38. DrahtBot removed the label CI failed on Mar 23, 2026
  39. fanquake requested review from willcl-ark on Mar 23, 2026
  40. fanquake marked this as ready for review on Mar 23, 2026
  41. depends: Remove no longer necessary `dsymutil`
    Github-Pull: #34850
    Rebased-From: 578525d31d47bad878f8609a04258920b1deab42
    051afe9e1a
  42. test: Scale feature_dbcrash.py timeout with factor
    This allows to run the test under valgrind:
    
    ./bld-cmake/test/functional/feature_dbcrash.py --timeout-factor=10 --valgrind
    
    For testing, the same test can be run multiple times in parallel:
    
    ./bld-cmake/test/functional/test_runner.py -j 10 $( printf 'feature_dbcrash.py %.0s' {1..10} )  --timeout-factor=10 --valgrind
    
    (Running the test under valgrind may take several hours!)
    
    I found that before this commit, 9 out of the 10 runs failed via:
    
    ```
    ...
    TestFramework (INFO): Iteration 36, generating 2500 transactions [11, 5, 6]
    TestFramework (ERROR): Unexpected exception
    Traceback (most recent call last):
      File "/b-c/test/functional/test_framework/test_framework.py", line 142, in main
        self.run_test()
        ~~~~~~~~~~~~~^^
      File "/b-c/bld-cmake/test/functional/feature_dbcrash.py", line 262, in run_test
        self.sync_node3blocks(block_hashes)
        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
      File "/b-c/bld-cmake/test/functional/feature_dbcrash.py", line 151, in sync_node3blocks
        nodei_utxo_hash = self.restart_node(i, block_hash)
      File "/b-c/bld-cmake/test/functional/feature_dbcrash.py", line 102, in restart_node
        raise AssertionError(f"Unable to successfully restart node {node_index} in allotted time")
    AssertionError: Unable to successfully restart node 0 in allotted time
    ```
    
    With this commit, all 10 runs passed.
    
    Github-Pull: #34589
    Rebased-From: fadb77169bed77e0df8d42d55599615b916ee6e8
    6993aa1915
  43. ci: Clarify why valgrind task has gui disabled
    A build with system libs (or with a normal depends build) will fail
    with:
    
    ```sh
    $ valgrind --exit-on-first-error=yes --error-exitcode=1 --quiet ./bld-cmake/bin/test_bitcoin-qt
    Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
    Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
    If this causes problems, reconfigure your locale. See the locale(1) manual
    for more information.
    ********* Start testing of AppTests *********
    Config: Using QtTest library 6.10.2, Qt 6.10.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 15.2.0), ubuntu 26.04
    PASS   : AppTests::initTestCase()
    QINFO  : AppTests::appTests() Backing up GUI settings to "/tmp/test_common bitcoin/60d474ffae390f81657d/regtest/guisettings.ini.bak"
    ==18007== Conditional jump or move depends on uninitialised value(s)
    ==18007==    at 0x12655E26: ???
    ==18007==    by 0xCB28E7F: ???
    ==18007==
    ==18007==
    ==18007== Exit program on first error (--exit-on-first-error=yes)
    ```
    
    A DEBUG=1 depends build would work, but that seems tedious for
    questionable benefit.
    
    Github-Pull: #34589
    Rebased-From: faf3ef4ee79ba4dc77340f47bf8eb303ef6ac825
    198bc4da87
  44. ci: Temporarily use clang in valgrind tasks
    valgrind currently does not work on GCC -O2 compiled executables, which
    contain std::optional use, due to an upstream bug. See
    https://bugs.kde.org/show_bug.cgi?id=472329
    
    One workaround could be to use -O1. However, that seems brittle, as
    variantions of the bug were seen with -O1 as well.
    
    So temporarily use clang in the valgrind CI tasks, because this also
    allows to drop a false-positive suppression for:
    -DCMAKE_CXX_FLAGS='-Wno-error=array-bounds'
    
    Also, update the comment in contrib/valgrind.supp to mention the
    background:
    
    * GCC -O2 wasn't tested with the suppressions file, due to the mentioned
      bug.
    * Clang-17 (or later) on aarch64 wasn't tested due to bug
      https://github.com/bitcoin/bitcoin/issues/29635 and the minimum
      supported clang version is clang-17 right now.
    * GUI isn't tested, because it requires a debug build, see the prior
      commit.
    
    This means the only tested config right now is the one mentioned in the
    suppression file.
    
    Github-Pull: #34589
    Rebased-From: fa70b9ebaa46b5fedcc02200626499d25762d44a
    d171afa9e8
  45. DrahtBot added the label CI failed on Mar 23, 2026
  46. DrahtBot removed the label CI failed on Mar 23, 2026
  47. wallet: fix amount computed as boolean in coin selection
    The comparison is evaluated before the assignment, so total_amount
    ends up holding a boolean instead of the actual amount:
    total_amount = (a - b < c)
    which is not what we want here. This has been working by accident.
    
    Github-Pull: #34888
    Rebased-From: 0026b330c4abbbbdb96e4f0c4d380d70d8e592ab
    11b69922b3
  48. wallet: feebumper, fix crash when combined bump fee is unavailable
    When a large cluster of unconfirmed transactions exceeds the limit,
    calculateCombinedBumpFee() returns std::nullopt.
    
    Previously, we continued executing and the optional value was
    accessed unconditionally, leading to a std::bad_optional_access
    exception.
    
    Fix this by returning early when the returned bumped fee is null.
    
    Note:
    This is a crash for the GUI, and an uncaught exception for the RPC
    bumpfee and psbtbumpfee.
    
    Github-Pull: #34870
    Rebased-From: 6072a2a6a1fdde8444e3515f0d201de3fb3923a1
    87d1691f3e
  49. DrahtBot added the label CI failed on Mar 24, 2026
  50. DrahtBot removed the label CI failed on Mar 24, 2026
  51. test: Remove confusing assert_debug_log in wallet_reindex.py
    Github-Pull: #34857
    Rebased-From: fa30951af5b174a1ee5e1c23d84b115c542a9570
    e3d571691a
  52. DrahtBot added the label CI failed on Mar 24, 2026
  53. willcl-ark approved
  54. willcl-ark commented at 1:31 pm on March 24, 2026: member

    ACK e3d571691ae4a5d799d64fbb945774b57a2e17f7

    All backports nice and (fresh and) clean. No release notes, I assume because these are targeted for rc2?

  55. hebasto approved
  56. hebasto commented at 4:10 pm on March 24, 2026: member
    ACK e3d571691ae4a5d799d64fbb945774b57a2e17f7, I’ve applied all backports locally with no conflicts and got zero diff with this PR.
  57. Sjors commented at 5:44 pm on March 24, 2026: member
    ACK e3d571691ae4a5d799d64fbb945774b57a2e17f7
  58. achow101 commented at 7:41 pm on March 24, 2026: member
    Do you want to do the rc2 version bump as well so we can do rc2 when this is merged?
  59. test: verify createNewBlock wakes promptly when tip advances
    This adds a complementary test to interface_ipc_mining.py to ensure
    that createNewBlock() wakes up immediately once submitblock advances
    the tip, rather than needlessly waiting for the cooldown timer to
    expire on its own.
    
    Github-Pull: #34727
    Rebased-From: 4ada575d6c6880f7d302c1f37581a82f394c0b5e
    acd7e3d061
  60. test: move make_mining_ctx to ipc_util.py
    The async routines in both interface_ipc.py and interface_ipc_mining.py
    contain redundant code to initialize the mining proxy object.
    
    Move the make_mining_ctx helper into test_framework/ipc_util.py and
    update both test files to use it. This removes the boilerplate and
    prevents code duplication across the IPC test suite.
    
    Github-Pull: #34727
    Rebased-From: 63684d6922e5c034ff620d23c35ba175edae49c4
    660947352c
  61. test: verify IPC error handling for invalid coinbase
    Add a test case to interface_ipc_mining.py to verify that the IPC
    server correctly handles and reports serialization errors rather than
    crashing the node.
    
    This covers the scenario where submitSolution is called with data
    that cannot be deserialized, as discussed in #33341
    
    Also introduces the assert_capnp_failed helper in ipc_util.py to
    cleanly handle macOS-specific Cap'n Proto exception strings, and
    refactors an existing block weight test to use it.
    
    Github-Pull: #34727
    Rebased-From: e7a918b69a5e6aaf3f02ca84ca6cde14401928ed
    39c87621d5
  62. test: scale IPC mining wait timeouts by timeout_factor
    The IPC mining tests (interface_ipc_mining.py) currently use
    hardcoded timeouts (e.g., 1000ms, 60000ms) for operations like
    waitTipChanged and waiting for block templates. In heavily
    loaded CI environments, such as those running sanitizers with
    high parallelism, these hardcoded timeouts can be too short,
    leading to spurious test failures and brittleness.
    
    This commit multiplies these timeout variables by the test
    suite's global `self.options.timeout_factor`. This ensures that
    the IPC wait conditions scale appropriately when the test suite
    is run with a higher timeout factor, making the tests robust
    against slow execution environments.
    
    Addresses CI brittleness observed in bitcoin-core/libmultiprocess#253.
    
    Github-Pull: #34727
    Rebased-From: ad75b147b5c3ab5eac268a1c1ced23894a8a79ba
    ac13aca72b
  63. build: bump version to v31.0rc2 a30e50538b
  64. doc: update manual pages for v31.0rc2 718c31cfb7
  65. doc: update example bitcoin conf for 31.0rc2 b241f3c82d
  66. fanquake commented at 0:59 am on March 25, 2026: member
    Added #34727 along with everything needed for rc2.
  67. Sjors commented at 7:50 am on March 25, 2026: member
    ACK b241f3c82d5a11eafc493b8faaa8cb5461a5199a
  68. DrahtBot requested review from willcl-ark on Mar 25, 2026
  69. DrahtBot requested review from hebasto on Mar 25, 2026
  70. DrahtBot removed the label CI failed on Mar 25, 2026
  71. achow101 commented at 9:27 pm on March 25, 2026: member
    ACK b241f3c82d5a11eafc493b8faaa8cb5461a5199a
  72. achow101 merged this on Mar 25, 2026
  73. achow101 closed this on Mar 25, 2026

  74. fanquake deleted the branch on Mar 25, 2026

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: 2026-04-05 15:13 UTC

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