48134 Commits

Author SHA1 Message Date
merge-script
8dcd79949f
Merge bitcoin/bitcoin#34718: Release: 31.0 translations update
d21afb297cdd8ef5b7b02316badc4b913a8caab4 qt: 31.0 translations update (Hennadii Stepanov)

Pull request description:

  This PR follows our [Release Process](24699fec84/doc/release-process.md) and concludes the translation-specific efforts for this release cycle. It follows two previous translation-related PRs, https://github.com/bitcoin/bitcoin/pull/34525 and https://github.com/bitcoin-core/gui/pull/931.

  It is one of the steps required _before_ branch-off, as scheduled in https://github.com/bitcoin/bitcoin/issues/33607.

  A previous similar PR: https://github.com/bitcoin/bitcoin/pull/33275.

  **A Note for reviewers:**
  The actual translations on Transifex is a moving target. As a result, your diff after running [`bitcoin-maintainer-tools/update-translations.py`](https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/update-translations.py) may differ.

ACKs for top commit:
  fanquake:
    ACK d21afb297cdd8ef5b7b02316badc4b913a8caab4

Tree-SHA512: 1b95fb53b7285cbe2031c18b773519fe8db05417f5eeed70a5d9d97ffe3b8f0c1e8d21e469b9a6a723a3ade5241354fa150f4431895c806183a0492e55905ea5
2026-03-10 10:59:09 +00:00
merge-script
5f9068bdcd
Merge bitcoin/bitcoin#34781: test: Remove fixed TODO in address_to_scriptpubkey
fa0587a306430b35d2852ee32f7eee2adb8c1e64 test: Remove fixed TODO in address_to_scriptpubkey (MarcoFalke)

Pull request description:

  After commit d178082996dc3000f42816f89afcf3fa4d31e159 added the bech32 format, the TODO about adding other formats can be removed.

ACKs for top commit:
  sedited:
    ACK fa0587a306430b35d2852ee32f7eee2adb8c1e64
  rkrux:
    crACK fa0587a306
  musaHaruna:
    ACK [fa0587a](fa0587a306)

Tree-SHA512: 49a8a514bed11e945bd8f9b13b84ae14b4dbc8a7ebb7224b1746776d9dbf68abc3b53d67f1b7fff83bc4360b15324fb96611550f4aca808b16beb03bcbfd0a55
2026-03-10 10:38:38 +00:00
Hennadii Stepanov
d21afb297c
qt: 31.0 translations update 2026-03-10 08:39:17 +00:00
MarcoFalke
fa0587a306
test: Remove fixed TODO in address_to_scriptpubkey 2026-03-10 08:42:58 +01:00
merge-script
d3056bc149
Merge bitcoin/bitcoin#34606: doc: clarify swapping impact on IBD performance
a61907e5d9c1988eb1e018cae5831d6b94f4da7f doc: explain swapping in `reduce-memory.md` (Lőrinc)

Pull request description:

  ### Problem
  Sustained [heavy swapping](https://en.wikipedia.org/wiki/Thrashing_(computer_science)) can grind execution to a halt, but today users get no direct warning from the node when this happens, and this caveat is not documented.

  ### Fix
  We can’t easily detect heavy swap pressure in a reliable, cross-platform way, but we can document what swapping is and why it can severely degrade IBD performance.

  ---

  Note: An earlier version of this PR attempted to detect and warn on heavy swapping (Linux-only), but it was changed to documentation based on review feedback.

ACKs for top commit:
  ajtowns:
    utACK a61907e5d9c1988eb1e018cae5831d6b94f4da7f
  sedited:
    ACK a61907e5d9c1988eb1e018cae5831d6b94f4da7f

Tree-SHA512: b21c40d07d78d890c19d3a17faad4ab4127688884dc433a1bdb63d18de07628c048227eba2f1258c6b542a71a986d4250f8abf8f8ffe0cda433ce0c8673978d4
2026-03-09 14:21:36 +00:00
merge-script
f201ccc800
Merge bitcoin/bitcoin#34673: contrib: Update fixed seeds pre-31.0
fec58229fa671cb870ebf795b54b73b7e22a1eb6 contrib: Update fixed feeds (Ava Chow)
27fbdb009f2f007239c4845cad528487b30598bd makeseeds: Choose node info with most recent success when deduplicating (Ava Chow)
982883a1bc4d03efb78d296849a3b8fa04ded26d makeseeds: Update known user agents (Ava Chow)

Pull request description:

ACKs for top commit:
  fjahr:
    ACK fec58229fa671cb870ebf795b54b73b7e22a1eb6

Tree-SHA512: 2852a9a6a7c299ce04ee4dc438af9547d56a860858201ad2ccdea14640b17876e7e9841ce3a30030e2482cd04e9b386f7ede5c4e51582ebd09b9ce0a2a0bc43b
2026-03-09 12:30:57 +00:00
merge-script
42f97c542d
Merge bitcoin/bitcoin#34705: kernel: Use fs:: namespace and unicode path in kernel tests
89386e700ebc232e2beab3a3f3ea0d1ae78ac203 kernel: Use fs:: namespace and unicode path in kernel tests (sedited)

Pull request description:

  Add support for unicode characters in paths to the kernel tests by using our fs:: wrappers for std::filesystem calls and adding the windows application manifest to the binary. This exercises their handling through the kernel API.

ACKs for top commit:
  hebasto:
    ACK 89386e700ebc232e2beab3a3f3ea0d1ae78ac203.
  w0xlt:
    ACK 89386e700ebc232e2beab3a3f3ea0d1ae78ac203

Tree-SHA512: 7b541f482d84a66c89eec63aea0e7f7626bbbd62082ad7a7fb2c7a517296c291a6ff301c628e5e9e1d7b850ead89005141481a2bfd06d8a9081622e32f7340cc
2026-03-09 12:24:54 +00:00
merge-script
7691e8a005
Merge bitcoin/bitcoin#34471: refactor: Use aliasing shared_ptr in Sock::Wait
faa016af542763492a63de8cc972f8f4b52a58cd refactor: Use aliasing shared_ptr in Sock::Wait (MarcoFalke)

Pull request description:

  Currently, a no-op lambda is used as the deleter for the temporary shared pointer helper in `Sock::Wait`. This is perfectly fine, but has a few style issues:

  * The lambda needs to be allocated on the heap
  * It triggers a false-positive upstream GCC-16-trunk bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123912

  Fix all issues by just using an aliasing shared pointer, which points to `this`, but is otherwise empty (sits on the stack without any heap allocations).

ACKs for top commit:
  hodlinator:
    ACK faa016af542763492a63de8cc972f8f4b52a58cd
  sedited:
    ACK faa016af542763492a63de8cc972f8f4b52a58cd
  vasild:
    ACK faa016af542763492a63de8cc972f8f4b52a58cd

Tree-SHA512: b7330862204e79fb61f30694accb16f9a24e5722bd0ceb098ca27c877cff921afa00c0cfd953d4cbb355e6433706961a25b628efefdbe0b48bdec2941eaaee7a
2026-03-09 10:54:47 +00:00
merge-script
49bd12bd89
Merge bitcoin/bitcoin#34693: doc: Use relative markdown links
fa9d0623a3153a2ea33540611c26378f05e0d7d4 doc: Use relative markdown links (MarcoFalke)

Pull request description:

  Using fully resolved links (to the `master` branch) in markdown files is problematic, because:

  * When the target file is (re)moved, such a link will be a 404
  * When reading docs for a previous commit/release, one is redirected to the master branch on such a link
  * When the target file has been updated, it may no longer apply to the commit/release one came from (changed options, etc)

  Fix all issues by using relative markdown links. Note that this only works in markdown. Also, release notes are left as-is, because they will be shared stand-alone externally, so can't use relative links.

ACKs for top commit:
  kevkevinpal:
    tACK [fa9d062](fa9d0623a3)
  l0rinc:
    code review ACK fa9d0623a3153a2ea33540611c26378f05e0d7d4
  rkrux:
    tACK fa9d0623a3153a2ea33540611c26378f05e0d7d4
  sedited:
    ACK fa9d0623a3153a2ea33540611c26378f05e0d7d4

Tree-SHA512: 74cd661f20f93dc1af602ab4c6ff79673ff48fc956aca1cdd0039b127914a83fb61cff61ea92c8978c85fa500d1a1423bf9739bce261860fe037c8dfefb8acad
2026-03-09 10:24:06 +00:00
merge-script
aefa8e6d14
Merge bitcoin/bitcoin#34361: test: clean up tx resurrection (re-org) test in feature_block.py
5b2c3960b929bd015911783fb59e3660b0810f03 test: clean up tx resurrection (re-org) test in feature_block.py (Sebastian Falbesoner)

Pull request description:

  The following comment about ECDSA signatures created with the test framework not passing mempool policy has been obsolete for a long time (at least since 2019, see PR #15826):

  8c07800b19/test/functional/feature_block.py (L1167-L1172)

  so remove it. While at it, change the resurrected txs to be indeed standard valid, so the `acceptnonstdtxn=1` parameter can also be removed from the functional test.

  Kudos to stratospher, who (IIRC) mentioned this outdated comment a while ago.

ACKs for top commit:
  sedited:
    ACK 5b2c3960b929bd015911783fb59e3660b0810f03
  Bortlesboat:
    Tested ACK 5b2c3960b929. Ran feature_block.py locally, passes. Nice cleanup — removing `-acceptnonstdtxn=1` by making the resurrection txs standard (P2PK) is the right approach. The old unsigned OP_TRUE workaround comment explains why this was needed, glad to see it gone.
  stratospher:
    ACK 5b2c3960. nice!

Tree-SHA512: 94517e432647a8e8db51fad90a26493c57ce9dfd924b17ce909ea40d50bc6279d974c6d2046b34f5f92b481ca5e0abdedaf412ce41b4cb904605c140a8dba583
2026-03-09 10:21:10 +00:00
merge-script
3a222507fd
Merge bitcoin/bitcoin#34037: wallet, doc: clarify the coin selection filters that enforce cluster count
a067ca34106817565e02daca52b3175266714c25 [doc] coin selection filters by max cluster count, not descendant (glozow)
f7be5fb8fc7d2a5831810a0b91666fc774b64b8f [refactor] rename variable to clarify it is unused and cluster count (glozow)

Pull request description:

  Followup to #33629.

  Fix misleading docs and variable names. Namely, `getTransactionAncestry` returns the cluster count, not max descendant count of ancestor set (not worth reimplementing as it is merely a heuristic). No behavior changes - I don’t think much needs to be changed for the first release containing cluster mempool.

  Current `CoinEligibilityFilter`s enforce a maximum ancestor count (summed across all outputs, potentially overestimating) and max descendant count across ancestors of the output.

  Since #33629, these filters have started using cluster count instead of max desc count across ancestors. The change isn’t dangerous, as the cluster count bounds descendant count as well. Currently, the wallet is essentially enforcing a mixture of both limits - this is good while we are transitioning. Note that the cluster count enforced is 25, not 64, since it's grabbing the node's descendant count limit. While it is not an apples-to-apples comparison, a cluster count limit of 25 helps us avoid busting legacy descendant limits (which will be common on the network for a while).

  Potential things for the future, out of scope for this PR:
  - When we get rid of the ancestor/descendant config options, `getPackageLimits` can probably be replaced with hard-coded values.
  - Change the `OutputGroup`s to track the actual cluster count that results from spending these outputs and merging their clusters.
  - Loosen from 25 after that policy is no longer common.
  - Clean up `getPackageLimits`.

ACKs for top commit:
  achow101:
    ACK a067ca34106817565e02daca52b3175266714c25
  ismaelsadeeq:
    reACK a067ca34106817565e02daca52b3175266714c25
  rkrux:
    crACK a067ca34106817565e02daca52b3175266714c25

Tree-SHA512: d7cacd5bf668d42e26e8b83e42a42c280929c3bfd554c3db1de605e5939f8b36c14ecfd2839abeb4eec352363df1891b3420a693c250916391ab10a5ce26396b
2026-03-09 10:11:08 +00:00
merge-script
d198635fa2
Merge bitcoin/bitcoin#34677: kernel: Chainparams and headerssync updates pre-31.0
44538f8ada868cb73ffa7a4bfb5267046d3f6b85 kernel: Add recent assumeutxo snapshot info (Ava Chow)
58c2e23fca05d201dfcea092ab032c943c9d5665 kernel: Update headerssync params (Ava Chow)
cf261b071f68b1967077a6d3baac10ea024e653a kernel: update chainTxData (Ava Chow)
8eaf1d26d446ecdc5c69b61334ee51a6f41050d3 kernel: update defaultAssumeValid and minimumChainWork (Ava Chow)
5ca0c55517d4c8e41a1dd9904545d82ee09adedf kernel: update assumed blockchain and chainstate sizes (Ava Chow)

Pull request description:

  Update chainparams and headerssync params per the release process.

  Also added new assumeutxo snapshots for each network. I've uploaded snapshots to https://achow101.com/files/utxo-snapshots/

ACKs for top commit:
  Sjors:
    ACK 44538f8ada868cb73ffa7a4bfb5267046d3f6b85
  fjahr:
    ACK 44538f8ada868cb73ffa7a4bfb5267046d3f6b85
  janb84:
    ACK 44538f8ada868cb73ffa7a4bfb5267046d3f6b85
  sipa:
    ACK 44538f8ada868cb73ffa7a4bfb5267046d3f6b85. I re-did all the mainnet parameters, but did not look closely at the other networks.
  jaonoctus:
    ACK 44538f8ada868cb73ffa7a4bfb5267046d3f6b85

Tree-SHA512: f9b6ccc967c5ef58f734245df459c3136491e9b6a0f6e36f4272bc0787e7b59eabe47a8c8b19a90267eca4a0b5851dfbf45153f96eac599c417f148b3cf264cf
2026-03-08 14:41:07 +00:00
merge-script
9833ef5f86
Merge bitcoin/bitcoin#34702: doc: Fix fee field in getblock RPC result
f580cc7e9f26331f7f03a8bbc5722521eb159bb2 doc: Fix `fee` field in `getblock` RPC result (nervana21)

Pull request description:

  The `fee` field in the `getblock` RPC result (verbosity 2 and 3) may be omitted when block undo data is not available. Marking it optional in the `RPCResult` aligns the documented schema with the runtime behavior.

ACKs for top commit:
  mercie-ux:
    ACK  f580cc7e9f
  satsfy:
    ACK f580cc7e9f
  instagibbs:
    ACK f580cc7e9f26331f7f03a8bbc5722521eb159bb2
  w0xlt:
    ACK f580cc7e9f26331f7f03a8bbc5722521eb159bb2
  luke-jr:
    ACK f580cc7e9f26331f7f03a8bbc5722521eb159bb2

Tree-SHA512: e3b44a48e17e21b906967aef124688a34aea2c6af3b6df3c47693fd3002d33e824f764c0060a7ab07751b98567c29eb16f3b3c07bf2999db080ff7adfd087dfd
2026-03-08 14:34:37 +00:00
merge-script
f2f0a0ca4c
Merge bitcoin/bitcoin#34700: script: Fix undefined behavior in Clone() -- std::transform writes past end of empty vector
44feab23a7c6060a3b432c04e3f952c5a7104325 script: Fix undefined behavior in Clone() -- std::transform writes past end of empty vector (Weixie Cui)

Pull request description:

  # Motivation
  This patch fixes undefined behavior in Clone() in src/script/descriptor.cpp.
  When std::transform is used with providers.begin() or subdescs.begin() as the output iterator, the vectors have been reserve()d but have size 0. Writing through begin() in that case writes past the logical end of the vector, which is undefined behavior.

ACKs for top commit:
  maflcko:
    lgtm ACK 44feab23a7c6060a3b432c04e3f952c5a7104325
  rkrux:
    ACK 44feab23a7c6060a3b432c04e3f952c5a7104325 because it gets rid of the possible undefined behaviour.
  frankomosh:
    Code Review ACK 44feab23a7c6060a3b432c04e3f952c5a7104325. Fix seems minimal and correct.

Tree-SHA512: 8af3b6d97c139b32bd47d4c452b6b16befdaa7028a7bc1b6de0ab1f0a8cb35eb068710316a2c07fa60856e17e25307931aa3125b4f41d0fe7726b435483a52db
2026-03-08 14:23:49 +00:00
Ava Chow
c7a3ea2483
Merge bitcoin/bitcoin#34692: Bump dbcache to 1 GiB
4ae9a10ada95ab8c1ab01472948d348d9538f3bb doc: add release notes for dbcache bump (Andrew Toth)
c510d126efb6ce9623e0e005829c13a110f65b0e doc: update dbcache default in reduce-memory.md (Andrew Toth)
027cac852796f643e2b6036fd3652dd3ca7785a5 qt: show GetDefaultDBCache() in settings (Andrew Toth)
5b34f251847a3c66b444959800b70e9863b10bbe dbcache: bump default from 450MB -> 1024MB if enough memory (Andrew Toth)

Pull request description:

  Alternative to #34641

  This increases the default `dbcache` value from `450MiB` to `1024MiB` if:
  - `dbcache` is unset
  - The system is 64 bit
  - At least 4GiB of RAM is detected

  Otherwise fallback to previous `450MiB` default.

  This should be simple enough to get into v31. The bump to 1GiB shows significant performance increases in #34641. It also alleviates concerns of too high default for steady state, and of lowering the current dbcache for systems with less RAM.

  This change only changes bitcoind behavior, while kernel still defaults to 450 MiB.

ACKs for top commit:
  ajtowns:
    ACK 4ae9a10ada95ab8c1ab01472948d348d9538f3bb
  kevkevinpal:
    reACK [4ae9a10](4ae9a10ada)
  svanstaa:
    ACK [4ae9a10](4ae9a10ada)
  achow101:
    ACK 4ae9a10ada95ab8c1ab01472948d348d9538f3bb
  sipa:
    ACK 4ae9a10ada95ab8c1ab01472948d348d9538f3bb

Tree-SHA512: ee3acf1fb08523ac80e37ec8f0caca226ffde6667f3a75ae6f4f4f54bc905a883ebcf1bf0e8a8a15c7cfabff96c23225825b3fff4506b9ab9936bf2c0a2c2513
2026-03-06 12:07:41 -08:00
Ava Chow
8b70ed6996
Merge bitcoin/bitcoin#34521: validation: fix UB in LoadChainTip
20ae9b98eab20117344cf31f7cde39cadd70ca22 Extend functional test for setBlockIndexCandidates UB (marcofleon)
854a6d5a9a0e40329a2852efb2a8dfec4b54886e validation: fix UB in LoadChainTip (marcofleon)
9249e6089ec4e2eb63f0896961f04d9dbe14651a validation: remove LoadChainTip call from ActivateSnapshot (marcofleon)

Pull request description:

  Addresses https://github.com/bitcoin/bitcoin/issues/34503. See this issue for more details as well.

  Fixes a bug where, under certain conditions, `setBlockIndexCandidates` had blocks in it that were worse than the tip. The block index candidate set uses `nSequenceId` as a sort key, so modifying this field while blocks are in the set results in undefined behavior. This PR populates `setBlockIndexCandidates` after the `nSequenceId` modifications, avoiding the UB.

ACKs for top commit:
  achow101:
    ACK 20ae9b98eab20117344cf31f7cde39cadd70ca22
  sedited:
    Re-ACK 20ae9b98eab20117344cf31f7cde39cadd70ca22
  sipa:
    Code review ACK 20ae9b98eab20117344cf31f7cde39cadd70ca22

Tree-SHA512: 121c170bb70fb6365089d578db63c811e7926e129d7206e569947f7a1f6c5ddc8d5f4937b80f1ba1b7d7daa42789b143ca5b56f154b7ab968a1cd55f925f378d
2026-03-06 08:22:42 -08:00
merge-script
f6d3201e14
Merge bitcoin/bitcoin#33929: test: Remove system_tests/run_command runtime dependencies
97e7e79435c69e90cb7f056c704c275421bf0892 test: Enable `system_tests/run_command` "stdin" test on Windows (Hennadii Stepanov)
a4324ce09546d80ab847dbfce715f015139ed593 test: Remove `system_tests/run_command` runtime dependencies (Hennadii Stepanov)

Pull request description:

  `system_tests` currently rely on `cat`, `echo`, `false` and `sh` being available in `PATH` at runtime.

  This PR:
  1. Removes these dependencies.
  2. Reduces the number of platform-specific code paths.

  The change is primarily motivated by my work on maintaining the [`bitcoin-core`](https://packages.guix.gnu.org/packages/bitcoin-core) package in Guix. It enables the removal of the existing `bash` and `coreutils` native inputs, which in turn makes it possible to drop the implicit dependency on `qtbase@5` (see https://codeberg.org/guix/guix/pulls/4386#issuecomment-8613333).

ACKs for top commit:
  maflcko:
    re-ACK 97e7e79435c69e90cb7f056c704c275421bf0892 👓
  janb84:
    ACK 97e7e79435c69e90cb7f056c704c275421bf0892
  sedited:
    ACK 97e7e79435c69e90cb7f056c704c275421bf0892

Tree-SHA512: 1375c676f85c75d571df1ddfc3a4405767dbf0ed7bfea2927c93ec01b29f9f7ae3383e546d2658f595e8ffafa9ab20bba6fcc628a9f5ebdb288bbef03b645fb6
2026-03-06 12:40:11 +00:00
merge-script
b5737b755d
Merge bitcoin/bitcoin#34650: depends: Update Qt to version 6.8.3
0a6724aaae973659b6c44eb5a062aaaaf57be870 doc: Update Windows build notes (Hennadii Stepanov)
473e5f8efcdabc584b99f72c364cf15afad1ca97 qt: Add patch to fix SFINAE warnings in QAnyStringView with gcc16 (Hennadii Stepanov)
3cb4d6066b83348411c43587605b624f067dbbf3 qt: add patches to fix SFINAE errors/warnings with gcc16 (Cory Fields)
d7e972a90d59bbf705bd06f5d2606cccd1dcdcf9 qt: add patch to fix build with gcc16 (Cory Fields)
19693a8c914174692e01d65434b386b522cebde7 depends: Update Qt to 6.8.3 (Hennadii Stepanov)
c55584575a99ff565131207916eccb3223e508a3 cmake: Fix `FindQt` module (Hennadii Stepanov)

Pull request description:

  This PR updates the `qt` package in depends to the latest open-source [6.8.3](https://www.qt.io/blog/qt-6.8.3-released) LTS release.

  The update includes numerous bugfixes, which allows us to drop `qtbase_plugins_windows11style.patch`.

  Additionally, it includes [patches](https://github.com/bitcoin/bitcoin/issues/34569#issuecomment-3892793262) for compatibility with GCC 16 (along with one extra patch), and incorporates a [commit](8f1b55d1d5) from https://github.com/bitcoin/bitcoin/pull/32709.

  Closes https://github.com/bitcoin/bitcoin/issues/34569.

ACKs for top commit:
  achow101:
    ACK 0a6724aaae973659b6c44eb5a062aaaaf57be870
  sedited:
    ACK 0a6724aaae973659b6c44eb5a062aaaaf57be870

Tree-SHA512: b66fe6f75bae00fb5c525c5fad56d39273f53f6bfd58206da8a55c6e41d14533137c72fb03e9537ba3a3d0b3463b6dcbef6a88ac2f4559fa6e9abf045fe1beaa
2026-03-06 11:55:46 +00:00
merge-script
c0802e20be
Merge bitcoin/bitcoin#34734: test: Fix shutdown vptr race in BlockFilterIndexSync bench
fa79098ce2aca120d9039d583a5c5ea23b364b1b test: Fix shutdown vptr race in BlockFilterIndexSync bench (MarcoFalke)

Pull request description:

  Currently, the `BlockFilterIndexSync` may fail tsan.

  Diff to reproduce:

  ```diff
  diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp
  index c7be6ab..4cb8435 100644
  --- a/src/validationinterface.cpp
  +++ b/src/validationinterface.cpp
  @@ -14,2 +14,3 @@
   #include <primitives/transaction.h>
  +#include <random.h>
   #include <util/check.h>
  @@ -156,2 +157,4 @@ void ValidationSignals::SyncWithValidationInterfaceQueue()

  +static FastRandomContext g_rnd{};
  +
   // Use a macro instead of a function for conditional logging to prevent
  @@ -166,2 +169,3 @@ void ValidationSignals::SyncWithValidationInterfaceQueue()
               LOG_EVENT(fmt, local_name, __VA_ARGS__);           \
  +            UninterruptibleSleep(1ms * g_rnd.randrange(95));   \
               event();                                           \
  ```

  and then running the tsan CI pod: `MAKEJOBS="-j$(nproc)" FILE_ENV="./ci/test/00_setup_env_native_tsan.sh" ./ci/test_run_all.sh`

  After about 3 runs, it will fail. It is also possible to run in a loop inside the pod: `while TSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/tsan:halt_on_error=1:second_deadlock_stack=1" /ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/bin/bench_bitcoin -filter=BlockFilterIndexSync -sanity-check ; do true ; done`

  The output will be:

  ```
  Running with -sanity-check option, output is being suppressed as benchmark results will be useless.
  Running with -sanity-check option, output is being suppressed as benchmark results will be useless.
  ==================
  WARNING: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) (pid=100168)
    Write of size 8 at 0x7fffbe828aa8 by main thread:
      #0 BaseIndex::~BaseIndex() /ci_container_base/src/index/base.cpp:99:1 (bench_bitcoin+0x33c201) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #1 BlockFilterIndex::~BlockFilterIndex() /ci_container_base/src/index/blockfilterindex.h:40:7 (bench_bitcoin+0x266000) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #2 BlockFilterIndexSync(ankerl::nanobench::Bench&)::$_0::operator()() const /ci_container_base/src/bench/index_blockfilter.cpp:56:5 (bench_bitcoin+0x2659a1) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #3 ankerl::nanobench::Bench& ankerl::nanobench::Bench::run<BlockFilterIndexSync(ankerl::nanobench::Bench&)::$_0>(BlockFilterIndexSync(ankerl::nanobench::Bench&)::$_0&&) /ci_container_base/src/bench/nanobench.h:1221:13 (bench_bitcoin+0x2659a1)
      #4 BlockFilterIndexSync(ankerl::nanobench::Bench&) /ci_container_base/src/bench/index_blockfilter.cpp:46:33 (bench_bitcoin+0x26565a) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #5 std::__1::__invoke_result_impl<void, void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&>::type std::__1::__invoke[abi:dee230000]<void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&>(void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&) /cxx_build/include/c++/v1/__type_traits/invoke.h:90:27 (bench_bitcoin+0x21b394) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #6 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:dee230000]<void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&>(void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&) /cxx_build/include/c++/v1/__type_traits/invoke.h:350:5 (bench_bitcoin+0x21b394)
      #7 void std::__1::__invoke_r[abi:dee230000]<void, void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&>(void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&) /cxx_build/include/c++/v1/__type_traits/invoke.h:356:10 (bench_bitcoin+0x21b394)
      #8 std::__1::__function::__func<void (*)(ankerl::nanobench::Bench&), void (ankerl::nanobench::Bench&)>::operator()(ankerl::nanobench::Bench&) /cxx_build/include/c++/v1/__functional/function.h:172:12 (bench_bitcoin+0x21b394)
      #9 std::__1::__function::__value_func<void (ankerl::nanobench::Bench&)>::operator()[abi:dee230000](ankerl::nanobench::Bench&) const /cxx_build/include/c++/v1/__functional/function.h:273:12 (bench_bitcoin+0x1cc77d) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #10 std::__1::function<void (ankerl::nanobench::Bench&)>::operator()(ankerl::nanobench::Bench&) const /cxx_build/include/c++/v1/__functional/function.h:754:10 (bench_bitcoin+0x1cc77d)
      #11 benchmark::BenchRunner::RunAll(benchmark::Args const&) /ci_container_base/src/bench/bench.cpp:121:13 (bench_bitcoin+0x1cc77d)
      #12 main /ci_container_base/src/bench/bench_bitcoin.cpp:135:9 (bench_bitcoin+0x1c5a76) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)

    Previous read of size 8 at 0x7fffbe828aa8 by thread T1:
      #0 ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_1::operator()() const::'lambda'(CValidationInterface&)::operator()(CValidationInterface&) const /ci_container_base/src/validationinterface.cpp:231:79 (bench_bitcoin+0x885feb) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #1 void ValidationSignalsImpl::Iterate<ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_1::operator()() const::'lambda'(CValidationInterface&)>(ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_1::operator()() const::'lambda'(CValidationInterface&)&&) /ci_container_base/src/validationinterface.cpp:91:17 (bench_bitcoin+0x885feb)
      #2 ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_1::operator()() const /ci_container_base/src/validationinterface.cpp:231:22 (bench_bitcoin+0x885feb)
      #3 ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0::operator()() const /ci_container_base/src/validationinterface.cpp:233:27 (bench_bitcoin+0x885feb)
      #4 std::__1::__invoke_result_impl<void, ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0&>::type std::__1::__invoke[abi:dee230000]<ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0&>(ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0&) /cxx_build/include/c++/v1/__type_traits/invoke.h:90:27 (bench_bitcoin+0x885feb)
      #5 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:dee230000]<ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0&>(ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0&) /cxx_build/include/c++/v1/__type_traits/invoke.h:350:5 (bench_bitcoin+0x885feb)
      #6 void std::__1::__invoke_r[abi:dee230000]<void, ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0&>(ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0&) /cxx_build/include/c++/v1/__type_traits/invoke.h:356:10 (bench_bitcoin+0x885feb)
      #7 std::__1::__function::__func<ValidationSignals::MempoolTransactionsRemovedForBlock(std::__1::vector<RemovedMempoolTransactionInfo, std::__1::allocator<RemovedMempoolTransactionInfo>> const&, unsigned int)::$_0, void ()>::operator()() /cxx_build/include/c++/v1/__functional/function.h:172:12 (bench_bitcoin+0x885feb)
      #8 std::__1::__function::__value_func<void ()>::operator()[abi:dee230000]() const /cxx_build/include/c++/v1/__functional/function.h:273:12 (bench_bitcoin+0xddec83) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #9 std::__1::function<void ()>::operator()() const /cxx_build/include/c++/v1/__functional/function.h:754:10 (bench_bitcoin+0xddec83)
      #10 SerialTaskRunner::ProcessQueue() /ci_container_base/src/scheduler.cpp:173:5 (bench_bitcoin+0xddec83)
      #11 SerialTaskRunner::MaybeScheduleProcessQueue()::$_0::operator()() const /ci_container_base/src/scheduler.cpp:142:41 (bench_bitcoin+0xde08e5) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #12 std::__1::__invoke_result_impl<void, SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&>::type std::__1::__invoke[abi:dee230000]<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&>(SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&) /cxx_build/include/c++/v1/__type_traits/invoke.h:90:27 (bench_bitcoin+0xde08e5)
      #13 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:dee230000]<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&>(SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&) /cxx_build/include/c++/v1/__type_traits/invoke.h:350:5 (bench_bitcoin+0xde08e5)
      #14 void std::__1::__invoke_r[abi:dee230000]<void, SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&>(SerialTaskRunner::MaybeScheduleProcessQueue()::$_0&) /cxx_build/include/c++/v1/__type_traits/invoke.h:356:10 (bench_bitcoin+0xde08e5)
      #15 std::__1::__function::__func<SerialTaskRunner::MaybeScheduleProcessQueue()::$_0, void ()>::operator()() /cxx_build/include/c++/v1/__functional/function.h:172:12 (bench_bitcoin+0xde08e5)
      #16 std::__1::__function::__value_func<void ()>::operator()[abi:dee230000]() const /cxx_build/include/c++/v1/__functional/function.h:273:12 (bench_bitcoin+0xddda36) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #17 std::__1::function<void ()>::operator()() const /cxx_build/include/c++/v1/__functional/function.h:754:10 (bench_bitcoin+0xddda36)
      #18 CScheduler::serviceQueue() /ci_container_base/src/scheduler.cpp:60:17 (bench_bitcoin+0xddda36)
      #19 ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2::operator()() const /ci_container_base/src/test/util/setup_common.cpp:250:114 (bench_bitcoin+0x2dcaa8) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #20 std::__1::__invoke_result_impl<void, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&>::type std::__1::__invoke[abi:dee230000]<ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&>(ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&) /cxx_build/include/c++/v1/__type_traits/invoke.h:90:27 (bench_bitcoin+0x2dcaa8)
      #21 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:dee230000]<ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&>(ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&) /cxx_build/include/c++/v1/__type_traits/invoke.h:350:5 (bench_bitcoin+0x2dcaa8)
      #22 void std::__1::__invoke_r[abi:dee230000]<void, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&>(ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&) /cxx_build/include/c++/v1/__type_traits/invoke.h:356:10 (bench_bitcoin+0x2dcaa8)
      #23 std::__1::__function::__func<ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2, void ()>::operator()() /cxx_build/include/c++/v1/__functional/function.h:172:12 (bench_bitcoin+0x2dcaa8)
      #24 std::__1::__function::__value_func<void ()>::operator()[abi:dee230000]() const /cxx_build/include/c++/v1/__functional/function.h:273:12 (bench_bitcoin+0xef2b0b) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #25 std::__1::function<void ()>::operator()() const /cxx_build/include/c++/v1/__functional/function.h:754:10 (bench_bitcoin+0xef2b0b)
      #26 util::TraceThread(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>) /ci_container_base/src/util/thread.cpp:21:9 (bench_bitcoin+0xef2b0b)
      #27 std::__1::__invoke_result_impl<void, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2>::type std::__1::__invoke[abi:dee230000]<void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2>(void (*&&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*&&, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&&) /cxx_build/include/c++/v1/__type_traits/invoke.h:90:27 (bench_bitcoin+0x2dc652) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #28 void std::__1::__thread_execute[abi:dee230000]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2, 0ul, 1ul, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2>&, std::__1::__integer_sequence<unsigned long, 0ul, 1ul, 2ul>) /cxx_build/include/c++/v1/__thread/thread.h:161:3 (bench_bitcoin+0x2dc652)
      #29 void* std::__1::__thread_proxy[abi:dee230000]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const*, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2>>(void*) /cxx_build/include/c++/v1/__thread/thread.h:169:3 (bench_bitcoin+0x2dc652)

    Location is stack of main thread.

    Thread T1 'b-scheduler' (tid=100170, running) created by main thread at:
      #0 pthread_create <null> (bench_bitcoin+0x13dc4e) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #1 std::__1::__libcpp_thread_create[abi:dee230000](unsigned long*, void* (*)(void*), void*) /cxx_build/include/c++/v1/__thread/support/pthread.h:182:10 (bench_bitcoin+0x2d3531) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #2 std::__1:🧵:thread[abi:dee230000]<void (&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const (&) [10], ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2, 0>(void (&)(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::function<void ()>), char const (&) [10], ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_2&&) /cxx_build/include/c++/v1/__thread/thread.h:218:16 (bench_bitcoin+0x2d3531)
      #3 ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts) /ci_container_base/src/test/util/setup_common.cpp:250:46 (bench_bitcoin+0x2d3531)
      #4 TestingSetup::TestingSetup(ChainType, TestOpts) /ci_container_base/src/test/util/setup_common.cpp:344:7 (bench_bitcoin+0x2d4c1f) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #5 TestChain100Setup::TestChain100Setup(ChainType, TestOpts) /ci_container_base/src/test/util/setup_common.cpp:380:7 (bench_bitcoin+0x2d560a) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #6 std::__1::unique_ptr<TestChain100Setup, std::__1::default_delete<TestChain100Setup>> std::__1::make_unique[abi:dee230000]<TestChain100Setup, ChainType const&, TestOpts&, 0>(ChainType const&, TestOpts&) /cxx_build/include/c++/v1/__memory/unique_ptr.h:756:30 (bench_bitcoin+0x224eed) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #7 std::__1::unique_ptr<TestChain100Setup, std::__1::default_delete<TestChain100Setup>> MakeNoLogFileContext<TestChain100Setup>(ChainType, TestOpts) /ci_container_base/src/test/util/setup_common.h:259:12 (bench_bitcoin+0x224ce2) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #8 BlockFilterIndexSync(ankerl::nanobench::Bench&) /ci_container_base/src/bench/index_blockfilter.cpp:33:29 (bench_bitcoin+0x26530f) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #9 std::__1::__invoke_result_impl<void, void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&>::type std::__1::__invoke[abi:dee230000]<void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&>(void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&) /cxx_build/include/c++/v1/__type_traits/invoke.h:90:27 (bench_bitcoin+0x21b394) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #10 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:dee230000]<void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&>(void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&) /cxx_build/include/c++/v1/__type_traits/invoke.h:350:5 (bench_bitcoin+0x21b394)
      #11 void std::__1::__invoke_r[abi:dee230000]<void, void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&>(void (*&)(ankerl::nanobench::Bench&), ankerl::nanobench::Bench&) /cxx_build/include/c++/v1/__type_traits/invoke.h:356:10 (bench_bitcoin+0x21b394)
      #12 std::__1::__function::__func<void (*)(ankerl::nanobench::Bench&), void (ankerl::nanobench::Bench&)>::operator()(ankerl::nanobench::Bench&) /cxx_build/include/c++/v1/__functional/function.h:172:12 (bench_bitcoin+0x21b394)
      #13 std::__1::__function::__value_func<void (ankerl::nanobench::Bench&)>::operator()[abi:dee230000](ankerl::nanobench::Bench&) const /cxx_build/include/c++/v1/__functional/function.h:273:12 (bench_bitcoin+0x1cc77d) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)
      #14 std::__1::function<void (ankerl::nanobench::Bench&)>::operator()(ankerl::nanobench::Bench&) const /cxx_build/include/c++/v1/__functional/function.h:754:10 (bench_bitcoin+0x1cc77d)
      #15 benchmark::BenchRunner::RunAll(benchmark::Args const&) /ci_container_base/src/bench/bench.cpp:121:13 (bench_bitcoin+0x1cc77d)
      #16 main /ci_container_base/src/bench/bench_bitcoin.cpp:135:9 (bench_bitcoin+0x1c5a76) (BuildId: d6021b6fabe0b72ef5741922cc8e7f71ce6eac0c)

  SUMMARY: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) /ci_container_base/src/index/base.cpp:99:1 in BaseIndex::~BaseIndex()
  ==================
  ```

  Fix this by following the shutdown sequence of first stopping the index and then desctructing it, instead of doing both at the same time (stopping inside the desctructor).

  Also, apply the comment `// Shutdown sequence (c.f. Shutdown() in init.cpp)` consistently, while touching this topic of the codebase.

  Also, remove the unused `SyncWithValidationInterfaceQueue`, which is redundant to the prior `BlockUntilSyncedToCurrentChain`. See also the last comment in the pull request that introduced this: https://github.com/bitcoin/bitcoin/pull/26188#issuecomment-1274258156

  > I think anything is fine here. Either keep both or delete both.

  Given that devs did not apply the redundant sync in two new cases, it seems fine to remove it.

ACKs for top commit:
  achow101:
    ACK fa79098ce2aca120d9039d583a5c5ea23b364b1b
  sedited:
    ACK fa79098ce2aca120d9039d583a5c5ea23b364b1b

Tree-SHA512: 3f46df283fa5f639e942b74459760104b79f11930b4249f73405f052131f69d01e91a8a4df496ca4f380fd2e0cb8d8c34f70f3e2b84730f3b8f445a98e468d1d
2026-03-06 10:54:06 +00:00
merge-script
2ac4f6e019
Merge bitcoin/bitcoin#34612: leveldb: remove unused files
3feabb203a6e1af9fe03e997782ecb1a5020872d leveldb: remove unused files (fanquake)

Pull request description:

  Remove `db/c.cc`, `dumpfile.cc` & `histogram.cc`.

ACKs for top commit:
  willcl-ark:
    ACK 3feabb203a6e1af9fe03e997782ecb1a5020872d
  sedited:
    ACK 3feabb203a6e1af9fe03e997782ecb1a5020872d

Tree-SHA512: d00f9d86adaea049f7e4fdf1a79814d6dd2ef1052586394608d87c0baf4cfba39aec0b889faf7a375a805be567d6b459270f753ac7e85da08879cb6f75086624
2026-03-06 10:37:21 +00:00
merge-script
d97df29d5d
Merge bitcoin/bitcoin#34747: test: Sync mempools and wait for txospender index to be synced in rpc_gettxspendingprevout
cbdb891de23d98dae3cfb3c4d993d6111df0aaa4 test: Wait for txospender index to be synced in rpc_gettxspendingprevout (Ava Chow)
2db5c049bb3cf9a323c100ce9d4957a937c01624 test: Sync mempools after tx creation in rpc_gettxspendingprevout (Ava Chow)

Pull request description:

  On slower runs, the txospender index may not be synced yet when the tests of its behavior begin, causing intermittent failures. Wait for them to be synced before starting the tests.

  The tests also query mempool txs from other nodes, make sure mempools are synced before doing so.

  The first commit with the following diff reproduces #34735:

  ```
  diff --git a/src/index/txospenderindex.cpp b/src/index/txospenderindex.cpp
  index d451bb1e0a4..e786f05a98c 100644
  --- a/src/index/txospenderindex.cpp
  +++ b/src/index/txospenderindex.cpp
  @@ -129,6 +129,7 @@ static std::vector<std::pair<COutPoint, CDiskTxPos>> BuildSpenderPositions(const

   bool TxoSpenderIndex::CustomAppend(const interfaces::BlockInfo& block)
   {
  +    UninterruptibleSleep(100ms);
       WriteSpenderInfos(BuildSpenderPositions(block));
       return true;
   }
  ```

  Fixes #34735

ACKs for top commit:
  furszy:
    ACK cbdb891de23d98dae3cfb3c4d993d6111df0aaa4
  andrewtoth:
    ACK cbdb891de23d98dae3cfb3c4d993d6111df0aaa4
  sedited:
    ACK cbdb891de23d98dae3cfb3c4d993d6111df0aaa4
  rkrux:
    crACK cbdb891de23d98dae3cfb3c4d993d6111df0aaa4

Tree-SHA512: ba1ab6216ac3b647a5f9e20f4899e51e643bf20829e698aa63c127c88ed4e33afa222bebeae1210fc869c46288e99c0b344330197913e244ffe1a6aca943568d
2026-03-06 10:30:45 +00:00
merge-script
c12be53f85
Merge bitcoin/bitcoin#34635: rpc, index: txospenderindex improve formatting, docs and test coverage
15c4889497b96037e41019a8f43090af841b36ec index: document TxoSpenderIndex::FindSpender (furszy)
f8b9595aaa966c373b02e6227dc799fed6d038ba test: Add missing txospenderindex coverage in feature_init (Fabian Jahr)
a1074d852a7a46b746fb4ed90d94cb4cc346f9b3 index, rpc, test: Misc formatting fixes (Fabian Jahr)

Pull request description:

  This addresses my own comments in the last review of #24539: https://github.com/bitcoin/bitcoin/pull/24539#pullrequestreview-3829110465

  The first commit fixes three small formatting errors.

  The second commit adds some missing coverage in `feature_init` and refactors the code a bit as well so these misses don't happen so easily in the future.

  The third commit is by furzy:

  > TxoSpenderIndex::FindSpender returns an Expected<optional<TxoSpender>> but
  the two levels of the return type were undocumented, making it unclear what a returned
  nullopt means. So added doc clarifying each return case.

ACKs for top commit:
  furszy:
    ACK 15c4889497b96037e41019a8f43090af841b36ec
  sedited:
    ACK 15c4889497b96037e41019a8f43090af841b36ec
  rkrux:
    crACK 15c4889497b96037e41019a8f43090af841b36ec

Tree-SHA512: 2e0f060a54b558d2967ebae0835cf81bd86c2d8d983d670a48d1bee7d347f186623e75db7ae311ca1566807f715c1b3fa67cf734c9467d35e13b84d082f28253
2026-03-06 10:08:50 +00:00
furszy
15c4889497
index: document TxoSpenderIndex::FindSpender
Hard to know what a returned std::Expected(std::nullopt) mean
if it is not documented anywhere.
2026-03-06 01:05:52 +01:00
Fabian Jahr
f8b9595aaa
test: Add missing txospenderindex coverage in feature_init
Also refactors the list of all index args into a constant that can be reused across tests.

Co-authored-by: sedited <seb.kung@gmail.com>
2026-03-06 00:48:34 +01:00
Ava Chow
cbdb891de2 test: Wait for txospender index to be synced in rpc_gettxspendingprevout
Each node's txospender index needs to catch up with the existing chain
before the tests will work.
2026-03-05 11:19:58 -08:00
Ava Chow
2db5c049bb test: Sync mempools after tx creation in rpc_gettxspendingprevout
The test will query information from the other nodes about mempool txs,
ensure that the txs are in their mempools beforehand.
2026-03-05 11:19:13 -08:00
merge-script
ca45461ddb
Merge bitcoin/bitcoin#33986: doc: improvements to doc/descriptors.md
37d49f5de6221aab90f99671413836479e6a71d1 doc: mention Miniscript expressions inside reference (Pieter Wuille)
771f7642bc03c829a7649016c69b0ebde688a4f1 doc: fix typo in descriptors.md (Pieter Wuille)
708b84999b5cc1ba760c7dcc4aa5252b8d136c06 doc: reference descriptor BIPs in descriptors.md (Pieter Wuille)
8f2a869a19ac6c642443a0e31348f2b34e26cbfa doc: do not list descriptor RPCs or history (Pieter Wuille)
65a8b6c2ef52244f21638004ffdacf6a2ed2c097 doc: mention musig() in descriptors.md (Pieter Wuille)

Pull request description:

  This brings doc/descriptors.md up to date:
  * Stop trying to exhaustively list all RPCs that involve descriptors. They're used everywhere.
  * Stop trying to give the history of descriptor support, we have release notes for that.
  * Mention that wallets are now built around descriptors (especially with legacy wallets gone).
  * Mention `musig()` KEY expressions in the specification part.
  * Mention the miniscript expressions in the specification part.
  * Reference the relevant output descriptor BIPs in the text.

ACKs for top commit:
  achow101:
    ACK 37d49f5de6221aab90f99671413836479e6a71d1
  darosior:
    utACK 37d49f5de6221aab90f99671413836479e6a71d1

Tree-SHA512: 2581be9b5d1a7099806d6f830b3a452505f8493d0e493a80b8a50e383f93f3e2c8a2d72a64fdae0adfe63d3c2eeb54a61a059108cd861e58c3d85f2bc576364b
2026-03-05 16:50:26 +00:00
merge-script
fc39a4f568
Merge bitcoin/bitcoin#34713: depends: Allow building Qt packages after interruption
2a7a4f608a42acef5cdf7370f0d191119fdb94c9 depends: Allow building Qt packages after interruption (Hennadii Stepanov)

Pull request description:

  If a build is interrupted, a standard `mkdir` command may fail if the directory already exists. Switching to `mkdir -p` ensures the build can resume gracefully.

  Fix #34712.

ACKs for top commit:
  sedited:
    ACK 2a7a4f608a42acef5cdf7370f0d191119fdb94c9

Tree-SHA512: fad2dce89a7cb68a8a539924d98698fe650802d19c84f216fa65e3c23c1a33ab6acf9f4c98c27381194c2958efa92e9dd8fb5e6bd40098efbcc60f156fd45370
2026-03-05 14:52:18 +00:00
Fabian Jahr
a1074d852a
index, rpc, test: Misc formatting fixes 2026-03-05 13:15:09 +01:00
Hennadii Stepanov
7e91060ec7
Merge bitcoin/bitcoin#34733: subprocess: replace __USING_WINDOWS__ with WIN32
bff8a7a80d2a198e84443a696438925d4c303c7b subprocess: replace __USING_WINDOWS__ with WIN32 (kevkevinpal)

Pull request description:

  ## Summary
  Motivated by https://github.com/bitcoin/bitcoin/pull/34385#pullrequestreview-3826616188

  In `subprocess.h` we are now renaming `__USING_WINDOWS__` with `WIN32`

  In the rest of the codebase, we are using `WIN32`, so it makes sense to update `subprocess.h` to match that.

  ---

  Use the following `grep` to assert there is no `__USING_WINDOWS__` in the codebase
  ```
  grep -nri --exclude-dir=build "WIN32" ./ -I
  rep -nri --exclude-dir=build "__USING_WINDOWS__" ./ -I
  ```

ACKs for top commit:
  sedited:
    ACK bff8a7a80d2a198e84443a696438925d4c303c7b
  hebasto:
    ACK bff8a7a80d2a198e84443a696438925d4c303c7b, I have reviewed the code and it looks OK.

Tree-SHA512: 18c3c8b87cf880053bbf69f837a0a135c5da51cfb15ab1d9fd554d8f931b2ea8202cf0f4d5e6f317d6234480128c2f41a7a1a9d9bd0504697a3c4c6a21797762
2026-03-05 11:42:05 +00:00
merge-script
69b2c813f0
Merge bitcoin/bitcoin#34591: cmake: Improve install_name_tool workaround
38a7a6712663b52a40210374334c7427bc776cf4 cmake: Provide `install_name_tool` stub instead of disabling it (Hennadii Stepanov)
80dc4359b8a1580341c22a91d4fc42daa6ce10eb cmake: Apply workaround for `install_name_tool` conditionally (Hennadii Stepanov)

Pull request description:

  We stopped using `install_name_tool` in 3bee51427a05075150721f0a05ead8f92e1ba019 (https://github.com/bitcoin/bitcoin/pull/29890), which [required](https://github.com/hebasto/bitcoin/pull/180) a CMake-specific hack:b65ff0e5a1/CMakeLists.txt (L72-L76)

  Due to recent changes in CMake, this hack has become problematic for the following reasons:
  1. It is no longer needed when using CMake 4.2 or newer. See upstream [Issue #27069](https://gitlab.kitware.com/cmake/cmake/-/issues/27069) and [MR #10955](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10955).

  2. It causes an [issue](https://github.com/bitcoin/bitcoin/issues/34513) when using CMake 4.0.5 or newer. See upstream [Issue #26814](https://gitlab.kitware.com/cmake/cmake/-/issues/26814) and [MR #10721](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10721).

  This PR addresses both of these issues. Please see the individual commits for more details.

  Fixes https://github.com/bitcoin/bitcoin/issues/34513.

ACKs for top commit:
  fanquake:
    ACK 38a7a6712663b52a40210374334c7427bc776cf4

Tree-SHA512: 7a11aa5b7f72034c798f20043ae89aa6c125bf5adf9c808a469aa30c2a56ad0a7aaf69919cb40a9eec08e029915890685968a9b7d5998e1337810f9cd2f6caf2
2026-03-05 11:29:54 +00:00
merge-script
f2f5619360
Merge bitcoin/bitcoin#34709: wallet, test: improve wallet functional tests
5c005363a880c136cc44ff2456a402e398fcbf44 test: improve `wallet_backup` test (rkrux)
04d95157485e31b6a8a0f2eb2d7a65023b4199ac test: improve `wallet_assumeutxo` func test (rkrux)

Pull request description:

  Relates to #34354

  While the actual fix of the issue is in another PR, this one improves the
  affected tests by trying to reduce the chain notifications that
  need to be processed while simulating erroneous wallet restoration
  scenarios.

ACKs for top commit:
  maflcko:
    lgtm ACK 5c005363a880c136cc44ff2456a402e398fcbf44
  furszy:
    ACK 5c005363a880c136cc44ff2456a402e398fcbf44
  w0xlt:
    ACK 5c005363a880c136cc44ff2456a402e398fcbf44
  brunoerg:
    code review ACK 5c005363a880c136cc44ff2456a402e398fcbf44

Tree-SHA512: 176e3ea8275c7aa082af695f5b76d82c079ff9a7178855b4ce95504edb8ce89b59a772e2d38dd43e997a5bea3d64be700b74cfec7bbc6992538f837877ab7222
2026-03-05 11:19:00 +00:00
Ava Chow
083242aac8
Merge bitcoin/bitcoin#34725: fuzz: assert we accept any PSBT serialization we create
d76ec4de148724e6b384efb0a4180722ed30db10 fuzz: make sure PSBT serialization roundtrips (Antoine Poinsot)

Pull request description:

  ~~Invalid public keys were accepted in Musig2 partial signatures. Because we serialize invalid keys as the empty byte string, this would lead us to creating an invalid PSBT serializations.~~

  ~~This can be checked by reverting the first commit with the fix and simply running the target against the existing qa-assets corpus for the `psbt` harness.~~

  This patch found the issue fixed in #34219 with a single run against the existing qa-assets corpus. It is useful to make sure there are no similar bugs, and we don't introduce roundtrip regressions outside of the specifc instance of accepting invalid public keys in Musig2 fields.

  *(Edited on March 4 to only contain the fuzz harness patch)*

ACKs for top commit:
  davidgumberg:
    crACK d76ec4de14
  achow101:
    ACK d76ec4de148724e6b384efb0a4180722ed30db10
  dergoegge:
    utACK d76ec4de148724e6b384efb0a4180722ed30db10
  brunoerg:
    code review ACK d76ec4de148724e6b384efb0a4180722ed30db10

Tree-SHA512: ab5f8d4e6a1781ecdef825e1a0e2793a6b553f36c923a4a35cb1af4070eead9d9780f6cc9a76235aa03462e52a129d15e61f631490b43651dc4395f3f1c005f3
2026-03-04 13:41:10 -08:00
marcofleon
20ae9b98ea Extend functional test for setBlockIndexCandidates UB
Fix the from-disk subtest to use a separate node so it builds on a
clean genesis block, rather than the leftover chain from the
in-memory subtest.

Change from a two-way to a three-way block race. The UB in the old
LoadChainTip (mutating nSequenceId, a sort key, while the block is
in setBlockIndexCandidates) corrupts the internal tree structure,
resulting in a failed erase that leaves stale blocks in the set
alongside the tip. With only two competing blocks, this is caught
by libstdc++ but not by libc++. A three-way split triggers the bug
on both implementations.

To trigger CheckBlockIndex (where the crashing assertion is), replace
the restart loop with sending a new block after a single restart.
2026-03-04 20:13:53 +00:00
Ava Chow
4c40a923f0
Merge bitcoin/bitcoin#34728: test: Fix intermittent issue in wallet_assumeutxo.py
faa68ed4bdce6540f99d23c9b200ca575794a1b2 test: Fix intermittent issue in wallet_assumeutxo.py (MarcoFalke)

Pull request description:

  The test has many issues:

  * It fails intermittently, due to the use of `-stopatheight` (https://github.com/bitcoin/bitcoin/issues/34710)
  * Using `-stopatheight` is expensive, because it requires two restarts, making the test slow
  * The overwritten `def setup_network` does not store the extra args via the `add_nodes` call, so if code is added in the future to restart a node, it may not pick up its global extra args.

  Fix all issues by:

  * Adding and using a fast `dumb_sync_blocks` util helper to achieve what `-stopatheight` doesn't achieve
  * Calling `self.add_nodes(self.num_nodes, self.extra_args)` in the overridden `setup_network`

  Can be tested via this diff:

  ```diff
  diff --git a/src/node/kernel_notifications.cpp b/src/node/kernel_notifications.cpp
  index ab0e5ccb69..49384c10b8 100644
  --- a/src/node/kernel_notifications.cpp
  +++ b/src/node/kernel_notifications.cpp
  @@ -61,2 +61,3 @@ kernel::InterruptResult KernelNotifications::blockTip(SynchronizationState state
       if (m_stop_at_height && index.nHeight >= m_stop_at_height) {
  +        LogInfo("Send shutdown signal after reaching stop height");
           if (!m_shutdown_request()) {
  diff --git a/src/util/tokenpipe.cpp b/src/util/tokenpipe.cpp
  index c982fa6fc4..a5565ebd36 100644
  --- a/src/util/tokenpipe.cpp
  +++ b/src/util/tokenpipe.cpp
  @@ -4,2 +4,3 @@
   #include <util/tokenpipe.h>
  +#include <util/time.h>

  @@ -60,2 +61,3 @@ int TokenPipeEnd::TokenRead()
           ssize_t result = read(m_fd, &token, 1);
  +        UninterruptibleSleep(500ms);
           if (result < 0) {
  ```

  On master: The test fails
  On this pull: The test passes

  Fixes https://github.com/bitcoin/bitcoin/issues/34710

ACKs for top commit:
  kevkevinpal:
    ACK [faa68ed](faa68ed4bd)
  achow101:
    ACK faa68ed4bdce6540f99d23c9b200ca575794a1b2
  w0xlt:
    ACK faa68ed4bdce6540f99d23c9b200ca575794a1b2

Tree-SHA512: 6fcd52b6f6a5fa5a5e41e7b3cf5c733af62af9c60271e7d22c266aca90f2af67f91ffe80a3ed8b8d1a91d001700870f493207998bac988c4e3671a3a0dba7ba7
2026-03-04 11:47:38 -08:00
marcofleon
854a6d5a9a validation: fix UB in LoadChainTip
The removal of the chain tip from setBlockIndexCandidates was
happening after nSequenceId was modified. Since the set uses
nSequenceId as a sort key, modifying it while the element is in the
set is undefined behavior, which can cause the erase to fail.

With assumeutxo, a second form of UB exists: two chainstates each
have their own candidate set, but share the same CBlockIndex
objects. Calling LoadChainTip on one chainstate mutates nSequenceIds
that are also in the other chainstate's set.

Fix by populating setBlockIndexCandidates after all changes to
nSequenceId.
2026-03-04 19:39:20 +00:00
MarcoFalke
fa79098ce2
test: Fix shutdown vptr race in BlockFilterIndexSync bench 2026-03-04 20:39:06 +01:00
marcofleon
9249e6089e validation: remove LoadChainTip call from ActivateSnapshot
This call is a no-op. PopulateAndValidateSnapshot already sets both
the chain tip and the coins cache best block to the snapshot block,
so LoadChainTip always hits the early return when it finds that the
two match (tip->GetBlockHash() == coins_cache.GetBestBlock()).
2026-03-04 19:15:34 +00:00
Antoine Poinsot
d76ec4de14 fuzz: make sure PSBT serialization roundtrips
This will prevent us from creating a serialization we do not accept
going forward.
2026-03-04 11:56:02 -05:00
MarcoFalke
faa68ed4bd
test: Fix intermittent issue in wallet_assumeutxo.py 2026-03-04 17:43:15 +01:00
kevkevinpal
bff8a7a80d
subprocess: replace __USING_WINDOWS__ with WIN32 2026-03-04 11:07:54 -05:00
merge-script
e09b81638b
Merge bitcoin/bitcoin#34219: psbt: validate pubkeys in MuSig2 pubnonce/partial sig deserialization
f51665bee72c26d3f3cc6813b6c02adad5f0af6a psbt: validate pubkeys in MuSig2 pubnonce/partial sig deserialization (tboy1337)

Pull request description:

  The previous fix for invalid MuSig2 pubkeys (bitcoin/bitcoin#34010) only
  addressed the PSBT_IN_MUSIG2_PARTICIPANT_PUBKEYS field. However, the
  PSBT_IN_MUSIG2_PUB_NONCE and PSBT_IN_MUSIG2_PARTIAL_SIG fields also
  deserialize pubkeys without validation, which could lead to crashes when
  invalid pubkeys are processed.

  This commit adds validation to the DeserializeMuSig2ParticipantDataIdentifier
  function to ensure all pubkeys in MuSig2 pubnonce and partial signature
  fields are fully valid elliptic curve points.

  The fix:
  - Validates both aggregate and participant pubkeys in MuSig2 pubnonce and
    partial signature deserialization
  - Throws std::ios_base::failure with descriptive error messages for invalid
    pubkeys
  - Prevents potential crashes from invalid elliptic curve points
  - Maintains backward compatibility for valid PSBTs

  This completes the fix for issues [#33999](https://github.com/bitcoin/bitcoin/issues/33999) and [#34201](https://github.com/bitcoin/bitcoin/issues/34201).

ACKs for top commit:
  rkrux:
    lgtm ACK f51665bee72c26d3f3cc6813b6c02adad5f0af6a
  w0xlt:
    ACK f51665bee7
  darosior:
    utACK f51665bee72c26d3f3cc6813b6c02adad5f0af6a

Tree-SHA512: 8454d77a05aa003a3121b0a5975e8a000125ee0d62343bfa625a75db113358ba7a210ae0376ca1666957b7de7005e06e5a54c95170430ee5e9e1416719b8af53
2026-03-04 15:17:02 +00:00
sedited
89386e700e
kernel: Use fs:: namespace and unicode path in kernel tests
Add support for unicode characters in paths to the kernel tests by using
our fs:: wrappers for std::filesystem calls and adding the windows
application manifest to the binary. This exercises their handling
through the kernel API.
2026-03-04 16:03:39 +01:00
merge-script
01dcb2fcc5
Merge bitcoin/bitcoin#34715: test: avoid interface_ipc.py race and null pointer dereference
1c1de334e9c0e3b4c72c3f3fe45b1f4df5ce4502 test: avoid interface_ipc.py race and null pointer dereference (Ryan Ofsky)

Pull request description:

  Avoid race condition in `run_deprecated_mining_test` caused by creating and immediately destroying an unused worker thread. This is leading to test failures reported by maflcko in #34711

ACKs for top commit:
  optout21:
    utACK 1c1de334e9c0e3b4c72c3f3fe45b1f4df5ce4502
  l0rinc:
    Tested ACK 1c1de334e9c0e3b4c72c3f3fe45b1f4df5ce4502
  w0xlt:
    ACK 1c1de334e9c0e3b4c72c3f3fe45b1f4df5ce4502
  enirox001:
    ACK 1c1de33

Tree-SHA512: d0af9676a46e991a3f4fda3795c02d1998d30de24991436b8ada425585c6699ff32a7057ca7a0ef2925f782fd3bf73e0381f5d4325e4f1c09f487fce1de49e45
2026-03-04 13:47:03 +00:00
merge-script
dc109e1b34
Merge bitcoin/bitcoin#34706: doc: Improve dependencies.md IPC documentation
b87a1c27c99821cea995112114eb40afa93417f2 doc: Improve dependencies.md IPC documentation (Ryan Ofsky)

Pull request description:

  Improve dependencies.md to document IPC dependencies better ([preview](https://github.com/ryanofsky/bitcoin/blob/pr/ipc-depdoc/doc/dependencies.md#build-1)). Specific changes are listed in the commit message.

  This PR is based on #33623 by willcl-ark which made similar changes in the 29.x branch. This PR could also be backported to 30.x (it merges cleanly, and master and 30.x both have the same version requirements).

ACKs for top commit:
  l0rinc:
    ACK b87a1c27c99821cea995112114eb40afa93417f2
  sedited:
    ACK b87a1c27c99821cea995112114eb40afa93417f2

Tree-SHA512: 566b5372d189f0ad04f978ddefbd8c200dcc19b25af02c73275c5faf7529943680ec59703bda11640cf7920466b4cdd46305cac4d3770e2303de37694ae78909
2026-03-04 13:31:14 +00:00
Hennadii Stepanov
0a6724aaae
doc: Update Windows build notes
Cross-compiling Qt 6.8 for Windows requires GCC 13.1 or newer, which
exceeds the currently documented minimum.
See https://doc.qt.io/qt-6.8/windows.html.
2026-03-04 11:31:39 +00:00
Hennadii Stepanov
473e5f8efc
qt: Add patch to fix SFINAE warnings in QAnyStringView with gcc16 2026-03-04 11:31:30 +00:00
Cory Fields
3cb4d6066b
qt: add patches to fix SFINAE errors/warnings with gcc16
Meta-Issue: https://qt-project.atlassian.net/browse/QTBUG-143470
Backports:

679e8bda1e
3312e89b47
05f201a3d5

An additional includes fix is needed after the others:
d68fc6ecc8
2026-03-04 11:31:23 +00:00
Cory Fields
d7e972a90d
qt: add patch to fix build with gcc16
Backported from:
7fccc79dd5
2026-03-04 11:31:23 +00:00
Hennadii Stepanov
19693a8c91
depends: Update Qt to 6.8.3 2026-03-04 11:31:22 +00:00