48216 Commits

Author SHA1 Message Date
merge-script
cc14d7ad3e Merge bitcoin/bitcoin#35028: [31.x] Backports + rc3
c168baec80 doc: update manual pages for v31.0rc3 (fanquake)
275843f2a6 build: bump version to v31.0rc3 (fanquake)
afa8ba04e0 test: remove macOS REDUCE_EXPORTS exception workaround (Alfonso Roman Zubeldia)
1bc22a38a8 Squashed 'src/ipc/libmultiprocess/' changes from 70f632bda8..3edbe8f67c (fanquake)

Pull request description:

  Backports:
  * #35014

  Also contains a libmultiprocess subtree pull.
  Also bumps to `rc3` + regens manpages.

ACKs for top commit:
  Sjors:
    utACK c168baec80
  hebasto:
    ACK c168baec80.
  marcofleon:
    ACK c168baec80

Tree-SHA512: 88aaef85a6ce6018fe5233d5a4a46d75c57914af9ff41158b85533ddf5e42df45ed7f6cbfdbffe2c4d2db6853af1ff4473440ab5ecc62c9cadf070f5cdcab883
v31.0rc3
2026-04-08 20:04:06 +08:00
fanquake
c168baec80 doc: update manual pages for v31.0rc3 2026-04-08 11:31:14 +08:00
fanquake
275843f2a6 build: bump version to v31.0rc3 2026-04-08 11:29:27 +08:00
Alfonso Roman Zubeldia
afa8ba04e0 test: remove macOS REDUCE_EXPORTS exception workaround
The underlying issue was fixed in bitcoin-core/libmultiprocess#268.

Remove the workaround that accepted degraded error messages on Darwin.

Github-Pull: #35014
Rebased-From: b555a0b789
2026-04-08 11:18:40 +08:00
fanquake
0df3ce87d9 Update libmultiprocess subtree to latest master 2026-04-08 11:17:45 +08:00
fanquake
1bc22a38a8 Squashed 'src/ipc/libmultiprocess/' changes from 70f632bda8..3edbe8f67c
3edbe8f67c Merge bitcoin-core/libmultiprocess#268: Use throwRecoverableException instead of raw throw for stored exceptions
23be44b0d3 Use throwRecoverableException instead of raw throw for stored exceptions
75c2a2764c Merge bitcoin-core/libmultiprocess#266: test: increase spawn test child timeout to 30 seconds
8b5f805301 Merge bitcoin-core/libmultiprocess#267: doc: Bump version 9 > 10
cc0b23fc32 test: increase spawn test child timeout to 30 seconds
050f878db8 doc: Improve versions.md descriptions and formatting
c6a288a889 doc: Bump version 9 > 10

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 3edbe8f67c182dde91c0050065d79ae268722489
2026-04-08 11:17:45 +08:00
merge-script
e7d520dcc6 Merge bitcoin/bitcoin#34942: [31.x] Backports
ef10b2ec65 guix: Clean up module list in manifest (Hennadii Stepanov)
f0e1014c39 kernel: Remove NONNULL annotation from destroy method (Alexander Wiederin)
56cdeab8b5 depends, qt: Fix build on aarch64 macOS 26.4 (Hennadii Stepanov)
f3b64aa405 fuzz: Use CAmount for storing best_waste (Ava Chow)
98551a0efd fuzz: Remove unused g_setup pointers (MarcoFalke)

Pull request description:

  Backports:
  * #34918
  * #34939
  * #34944
  * #34956
  * #34982

ACKs for top commit:
  marcofleon:
    ACK ef10b2ec65
  w0xlt:
    ACK ef10b2ec65

Tree-SHA512: 2d763deff7fa154fd697630bdb61644d4908b02b4a583cb648aeb9493009417d6d02367300e6d16d1c3b7ef8296b2411e1e96f8e67ef54fcd2fca4a415b97170
2026-04-08 11:13:04 +08:00
Hennadii Stepanov
ef10b2ec65 guix: Clean up module list in manifest
These modules are no longer in use:
1. `cmake-build-system` since bitcoin/bitcoin#34550.
2. `gnu-build-system` since bitcoin/bitcoin#34627.
3. `download` since bitcoin/bitcoin#34550.
4. `cc-for-target` from `utils` since bitcoin/bitcoin#34627.

Github-Pull: #34944
Rebased-From: 325f743eed
2026-04-03 10:45:50 +08:00
Alexander Wiederin
f0e1014c39 kernel: Remove NONNULL annotation from destroy method
No other *_destroy function in the Kernel API carries this annotation.
Following the convention set by free(), destroy functions should accept
null pointers.

Github-Pull: #34982
Rebased-From: 75608547b4
2026-04-03 10:40:26 +08:00
Hennadii Stepanov
56cdeab8b5 depends, qt: Fix build on aarch64 macOS 26.4
Github-Pull: #34956
Rebased-From: 3aeccb7d73
2026-04-01 09:27:00 +08:00
Ava Chow
f3b64aa405 fuzz: Use CAmount for storing best_waste
Waste is a CAmount, which is an int64_t. This will overflow an int, so
`best_waste` should also be a `CAmount`.

Github-Pull: #34939
Rebased-From: 890a09b1e4
2026-04-01 09:27:00 +08:00
MarcoFalke
98551a0efd fuzz: Remove unused g_setup pointers
These are unused and removing them avoids clang warnings like:

src/test/fuzz/deserialize.cpp:42:26: error: variable g_setup set but not used [-Werror,-Wunused-but-set-variable]

Github-Pull: #34918
Rebased-From: fabbfec3b0
2026-04-01 09:27:00 +08:00
merge-script
7375940eb2 Merge bitcoin/bitcoin#34952: Update libmultiprocess subtree in 31.x branch to fix race conditions on disconnects
2478a15ef9 Squashed 'src/ipc/libmultiprocess/' changes from 1868a84451f..70f632bda8f (Ryan Ofsky)

Pull request description:

  This PR is a backport of #34804 to the 31.x branch. (Both PR's point to the same source branch, they just have different target branches.) Some previous discussion about whether these changes should be merged into 31.x happened in https://github.com/bitcoin-core/libmultiprocess/pull/249#issuecomment-4118596442. The changes fix some IPC crashes that can happen with broken clients and unlucky thread timing that have only been seen in tests and antithesis runs, but the fixes are fairly simple and seem unlikely to cause new problems. The other changes in the PR are mostly CI/documentation/test changes and should also be safe.

  Includes:

  - https://github.com/bitcoin-core/libmultiprocess/pull/246
  - https://github.com/bitcoin-core/libmultiprocess/pull/242
  - https://github.com/bitcoin-core/libmultiprocess/pull/247
  - https://github.com/bitcoin-core/libmultiprocess/pull/251
  - https://github.com/bitcoin-core/libmultiprocess/pull/255
  - https://github.com/bitcoin-core/libmultiprocess/pull/258
  - https://github.com/bitcoin-core/libmultiprocess/pull/262
  - https://github.com/bitcoin-core/libmultiprocess/pull/253
  - https://github.com/bitcoin-core/libmultiprocess/pull/263
  - https://github.com/bitcoin-core/libmultiprocess/pull/256
  - https://github.com/bitcoin-core/libmultiprocess/pull/264
  - https://github.com/bitcoin-core/libmultiprocess/pull/249
  - https://github.com/bitcoin-core/libmultiprocess/pull/265

  The main change is https://github.com/bitcoin-core/libmultiprocess/pull/249 which fixes 3 intermittent race conditions detected in bitcoin core CI and antithesis: #34711/#34756, #34777, and #34782.

  The changes can be verified by running `test/lint/git-subtree-check.sh src/ipc/libmultiprocess` as described in [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#subtrees) and [lint instructions](https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh)

ACKs for top commit:
  Sjors:
    ACK 613a548648

Tree-SHA512: 54358428dc5a9cea84c3e816136ab828e702fc04b5af03cfd81c60522f1de491bf4867aed2e6c6791da2725dff2004b398ebbf42dd882cc22a5912bc5945cb6e
2026-04-01 09:26:14 +08:00
Ryan Ofsky
2478a15ef9 Squashed 'src/ipc/libmultiprocess/' changes from 1868a84451f..70f632bda8f
70f632bda8f Merge bitcoin-core/libmultiprocess#265: ci: set LC_ALL in shell scripts
8e8e564259a Merge bitcoin-core/libmultiprocess#249: fixes for race conditions on disconnects
05d34cc2ec3 ci: set LC_ALL in shell scripts
e606fd84a8c Merge bitcoin-core/libmultiprocess#264: ci: reduce nproc multipliers
ff0eed1bf18 refactor: Use loop variable in type-context.h
ff1d8ba172a refactor: Move type-context.h getParams() call closer to use
1dbc59a4aa3 race fix: m_on_cancel called after request finishes
1643d05ba07 test: m_on_cancel called after request finishes
f5509a31fcc race fix: getParams() called after request cancel
4a60c39f24a test: getParams() called after request cancel
f11ec29ed20 race fix: worker thread destroyed before it is initialized
a1d643348f4 test: worker thread destroyed before it is initialized
336023382c4 ci: reduce nproc multipliers
b090beb9651 Merge bitcoin-core/libmultiprocess#256: ci: cache gnu32 nix store
be8622816da ci: cache gnu32 nix store
975270b619c Merge bitcoin-core/libmultiprocess#263: ci: bump timeout factor to 40
09f10e5a598 ci: bump timeout factor to 40
db8f76ad290 Merge bitcoin-core/libmultiprocess#253: ci: run some Bitcoin Core CI jobs
55a9b557b19 ci: set Bitcoin Core CI test repetition
fb0fc84d556 ci: add TSan job with instrumented libc++
0f29c38725b ci: add Bitcoin Core IPC tests (ASan + macOS)
3f64320315d Merge bitcoin-core/libmultiprocess#262: ci: enable clang-tidy in macOS job, use nullptr
cd9f8bdc9f0 Merge bitcoin-core/libmultiprocess#258: log: add socket connected info message and demote destroy logs to debug
b5d6258a42f Merge bitcoin-core/libmultiprocess#255: fix: use unsigned char cast and sizeof in LogEscape escape sequence
d94688e2c32 Merge bitcoin-core/libmultiprocess#251: Improved CustomBuildField for std::optional in IPC/libmultiprocess
a9499fad755 mp: use nullptr with pthread_threadid_np
f499e37850f ci: enable clang-tidy in macOS job
98f1352159d log: add socket connected info message and demote destroy logs to debug
554a481ea73 fix: use unsigned char cast and sizeof in LogEscape escape sequence
1977b9f3f65 Use std::forward in CustomBuildField for std::optional to allow move semantics, resolves FIXME
22bec918c97 Merge bitcoin-core/libmultiprocess#247: type-map: Work around LLVM 22 "out of bounds index" error
8a5e3ae6ed2 Merge bitcoin-core/libmultiprocess#242: proxy-types: add CustomHasField hook to map Cap'n Proto values to null C++ values
e8d35246918 Merge bitcoin-core/libmultiprocess#246: doc: Bump version 8 > 9
97d877053b6 proxy-types: add CustomHasField hook for nullable decode paths
8c2f10252c9 refactor: add missing includes to mp/type-data.h
b1638aceb40 doc: Bump version 8 > 9
f61af487217 type-map: Work around LLVM 22 "out of bounds index" error

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 70f632bda8f80449b6240f98da768206a535a04e
2026-03-27 05:50:19 -04:00
Ryan Ofsky
613a548648 Merge commit '2478a15ef966cc93d47dd0f461a44be39bc51534' into pr/subtree-9 2026-03-27 05:50:19 -04:00
Ava Chow
f0e2cbc5e5 Merge bitcoin/bitcoin#34800: [31.x] Backports
b241f3c82d doc: update example bitcoin conf for 31.0rc2 (fanquake)
718c31cfb7 doc: update manual pages for v31.0rc2 (fanquake)
a30e50538b build: bump version to v31.0rc2 (fanquake)
ac13aca72b test: scale IPC mining wait timeouts by timeout_factor (Enoch Azariah)
39c87621d5 test: verify IPC error handling for invalid coinbase (Enoch Azariah)
660947352c test: move make_mining_ctx to ipc_util.py (Enoch Azariah)
acd7e3d061 test: verify createNewBlock wakes promptly when tip advances (Enoch Azariah)
e3d571691a test: Remove confusing assert_debug_log in wallet_reindex.py (MarcoFalke)
87d1691f3e wallet: feebumper, fix crash when combined bump fee is unavailable (furszy)
11b69922b3 wallet: fix amount computed as boolean in coin selection (furszy)
d171afa9e8 ci: Temporarily use clang in valgrind tasks (MarcoFalke)
198bc4da87 ci: Clarify why valgrind task has gui disabled (MarcoFalke)
6993aa1915 test: Scale feature_dbcrash.py timeout with factor (MarcoFalke)
051afe9e1a depends: Remove no longer necessary `dsymutil` (Hennadii Stepanov)
3b79852984 depends: Fix cross-compiling on macOS for Windows (Hennadii Stepanov)
e53c20d750 gui: Fix TransactionsView on setCurrentWallet (pablomartin4btc)
7118559f8c tests: applied PYTHON_GIL to the env for every test (kevkevinpal)
d9a57912c6 ci: Avoid intermittent Windows generate download failures (MarcoFalke)
335a098afa kernel: acquire coinstats cursor and block info atomically (w0xlt)
e930c6d60f rpc: fix race condition in gettxoutsetinfo (w0xlt)
ca781e49e5 cmake: Migrate away from deprecated SQLite3 target (Daniel Pfeifer)
068951211c test: [refactor] Use verbosity=0 named arg (MarcoFalke)
8379f005da test: Fix intermittent issue in feature_assumeutxo.py (MarcoFalke)
72d6c88165 test: Move event loop creation to network thread (MarcoFalke)
c7127f21df test: Use asyncio.SelectorEventLoop() over deprecated asyncio.WindowsSelectorEventLoopPolicy() (MarcoFalke)
a69f8c329e ci: Use arch-appropriate binaries in lint install (will)
e3383ac932 ci: check macos bundle structure and codesigning (fanquake)
ab37d3d7cd macdeploy: use plugins dir to find plugins (fanquake)
bb9fcffd4c macdeploy: subprocess out to zip rather than shutil.make_archive (fanquake)
d20ba02caa build: Set AUTHOR_WARNING on warnings (MarcoFalke)
2724c39208 guix: Make guix-clean less destructive (Hodlinator)
a28d78c44a test: use static methods and clarify comment in addr_relay (stratospher)
5642a2b0fe test: protect outbound connection from eviction in getaddr_test (stratospher)
a3c1eda8f2 test: fix addr relay test silent pass and wrong peerinfo index (stratospher)
207087b1c4 ci: bump cirruslabs actions versions (will)
a74dfe3ae2 lint: Temporarily revert to vulture==2.14 (MarcoFalke)
f7f7e682b5 ci: Bump GHA actions versions (MarcoFalke)
a3ffff0201 depends: delete Boost extra files (fanquake)
9852bbd218 depends: disable Qt sbom generation (fanquake)

Pull request description:

  Backports:
  * #33144
  * #34451
  * #34589
  * #34727
  * #34750
  * #34755
  * #34776
  * #34787
  * #34802
  * #34814
  * #34815
  * #34820
  * #34852
  * #34832
  * #34848
  * #34850
  * #34857
  * #34859
  * #34869
  * #34870
  * #34878
  * #34888

  Gui:
  * https://github.com/bitcoin-core/gui/pull/815

ACKs for top commit:
  Sjors:
    ACK b241f3c82d
  achow101:
    ACK b241f3c82d

Tree-SHA512: bb68f5b6e569781805c741d63a6ad6f955c1964d9186defa892936160e8444900f1e4175a1ef4fff268b655d664ddf0b914795ef554ea60cb23a054b080b4805
v31.0rc2
2026-03-25 14:43:31 -07:00
fanquake
b241f3c82d doc: update example bitcoin conf for 31.0rc2 2026-03-25 08:58:45 +08:00
fanquake
718c31cfb7 doc: update manual pages for v31.0rc2 2026-03-25 08:57:03 +08:00
fanquake
a30e50538b build: bump version to v31.0rc2 2026-03-25 08:52:02 +08:00
Enoch Azariah
ac13aca72b 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: ad75b147b5
2026-03-25 08:48:41 +08:00
Enoch Azariah
39c87621d5 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: e7a918b69a
2026-03-25 08:48:19 +08:00
Enoch Azariah
660947352c 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: 63684d6922
2026-03-25 08:47:58 +08:00
Enoch Azariah
acd7e3d061 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: 4ada575d6c
2026-03-25 08:47:28 +08:00
MarcoFalke
e3d571691a test: Remove confusing assert_debug_log in wallet_reindex.py
Github-Pull: #34857
Rebased-From: fa30951af5
2026-03-24 12:07:42 +08:00
furszy
87d1691f3e 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: 6072a2a6a1
2026-03-24 10:26:04 +08:00
furszy
11b69922b3 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: 0026b330c4
2026-03-24 10:20:01 +08:00
MarcoFalke
d171afa9e8 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: fa70b9ebaa
2026-03-23 12:39:30 +08:00
MarcoFalke
198bc4da87 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: faf3ef4ee7
2026-03-23 12:39:07 +08:00
MarcoFalke
6993aa1915 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: fadb77169b
2026-03-23 12:38:38 +08:00
Hennadii Stepanov
051afe9e1a depends: Remove no longer necessary dsymutil
Github-Pull: #34850
Rebased-From: 578525d31d
2026-03-23 12:12:00 +08:00
Hennadii Stepanov
3b79852984 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: 7a9304f887
2026-03-23 07:46:19 +08:00
pablomartin4btc
e53c20d750 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: 0dc337f73d
2026-03-23 07:32:14 +08:00
kevkevinpal
7118559f8c tests: applied PYTHON_GIL to the env for every test
Github-Pull: #34869
Rebased-From: b14f2c76a1
2026-03-20 11:20:09 +08:00
MarcoFalke
d9a57912c6 ci: Avoid intermittent Windows generate download failures
Github-Pull: #34859
Rebased-From: fa71c6e84c
2026-03-20 09:20:31 +08:00
w0xlt
335a098afa 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: f3bf63ec4f
2026-03-19 16:49:49 +08:00
w0xlt
e930c6d60f 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: 5e77072fa6
2026-03-19 16:49:29 +08:00
Daniel Pfeifer
ca781e49e5 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: 498b6eb6b5
2026-03-19 14:33:45 +08:00
MarcoFalke
068951211c test: [refactor] Use verbosity=0 named arg
This is less confusing than the verbose=0 alias.

Github-Pull: #34852
Rebased-From: faf71d6cb4
2026-03-19 14:08:20 +08:00
MarcoFalke
8379f005da test: Fix intermittent issue in feature_assumeutxo.py
Github-Pull: #34852
Rebased-From: 99996f6c06
2026-03-19 14:07:50 +08:00
MarcoFalke
72d6c88165 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: fa050da980
2026-03-19 13:35:46 +08:00
MarcoFalke
c7127f21df test: Use asyncio.SelectorEventLoop() over deprecated asyncio.WindowsSelectorEventLoopPolicy()
Github-Pull: #34820
Rebased-From: fa9168ffcd
2026-03-19 13:35:17 +08:00
will
a69f8c329e 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: 551875360c
2026-03-17 21:38:10 +08:00
fanquake
e3383ac932 ci: check macos bundle structure and codesigning
Github-Pull: #34787
Rebased-From: d03e3be246
2026-03-13 10:48:36 +00:00
fanquake
ab37d3d7cd 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: 66d80d57b4
2026-03-13 10:48:14 +00:00
fanquake
bb9fcffd4c 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: ab137cbfe2
2026-03-13 10:47:14 +00:00
MarcoFalke
d20ba02caa build: Set AUTHOR_WARNING on warnings
Github-Pull: #33144
Rebased-From: fa6497ba71
2026-03-12 15:17:27 +00:00
Hodlinator
2724c39208 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: be6d24ec22
2026-03-12 15:10:07 +00:00
stratospher
a28d78c44a 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: 57bfa864fe
2026-03-12 15:08:14 +00:00
stratospher
5642a2b0fe 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: 7ee8c0abc6
2026-03-12 15:07:48 +00:00
stratospher
a3c1eda8f2 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: ecb5ce6e76
2026-03-12 15:07:27 +00:00