Commit graph

44552 commits

Author SHA1 Message Date
Ryan Ofsky
24d5033a62
Merge bitcoin/bitcoin#32114: test: Add encodable PUSHDATA1 examples to feature_taproot
f974359e21 test: Add encodable PUSHDATA1 examples to feature_taproot (Greg Sanders)

Pull request description:

  Inspired by discussion in https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743492906 I made an example adding coverage I think is missing, with some extra commentary that might help future contributors (including myself when I forget how it works again).

  Open for suggestions how we can make it more welcoming beyond this.

  cc darosior EthanHeilman sipa

ACKs for top commit:
  janb84:
    Re-ACK [f974359](f974359e21)
  rkrux:
    ACK f974359e21

Tree-SHA512: 7544d41c39c13d245a8a33522e53f22b4dd7593c069631978303e5a349cd12cf9d45bed648c391618c4732831232c4b82b8de2bf6cba5bf5e1232501db926122
2025-04-08 15:08:52 -04:00
merge-script
cfe025ff0e
Merge bitcoin/bitcoin#30535: feefrac: add support for evaluating at given size
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
58914ab459 fuzz: assert min diff between FeeFrac and CFeeRate (Pieter Wuille)
0c6bcfd8f7 feefrac: support both rounding up and down for Evaluate (Pieter Wuille)
ecf956ec9d feefrac: add support for evaluating at given size (Pieter Wuille)
7963aecead feefrac: add helper functions for 96-bit division (Pieter Wuille)
800c0dea9a feefrac: rework comments around Mul/MulFallback (Pieter Wuille)
fcfe008db2 feefrac fuzz: use arith_uint256 instead of ad-hoc multiply (Pieter Wuille)
46ff4220bf arith_uint256: modernize comparison operators (Pieter Wuille)

Pull request description:

  The `FeeFrac` type represents a fraction, intended to be used for sats/vbyte or sats/WU. This PR adds functionality to evaluate that feerate for a given size, in order to obtain the fee it corresponds with (rounding down, or rounding up).

  The motivation here is being able to do accurate feerate evaluations in cluster mempool block building heuristics (where rounding down is needed), but in principle this makes it possible to use `FeeFrac` as a more accurate replacement for `CFeeRate` (where for feerate estimation rounding up is desirable). Because of this, both rounding modes are implemented.

  Unit tests are included for known-correct values, plus a fuzz test that verifies the result using `arith_uint256`.

ACKs for top commit:
  l0rinc:
    ACK 58914ab459
  ismaelsadeeq:
    reACK  58914ab459
  glozow:
    light code review ACK 58914ab459

Tree-SHA512: 362b88454bf355cae1f12d6430b1bb9ab66824140e12b27db7c48385f1e8db936da7d0694fb5aad2a00eb9e5fe3083a3a2c0cc40b2a68e2d37e07b3481d4eeae
2025-04-07 17:59:42 -04:00
Pieter Wuille
58914ab459 fuzz: assert min diff between FeeFrac and CFeeRate
Co-Authored-By: Greg Sanders <gsanders87@gmail.com>
2025-04-07 10:51:41 -04:00
Pieter Wuille
0c6bcfd8f7 feefrac: support both rounding up and down for Evaluate
Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
2025-04-07 10:51:41 -04:00
Pieter Wuille
ecf956ec9d feefrac: add support for evaluating at given size 2025-04-07 10:51:41 -04:00
Pieter Wuille
7963aecead feefrac: add helper functions for 96-bit division
These functions are needed to implement FeeFrac evaluation later: given a
FeeFrac{fee, size}, its fee at at_size is (fee * at_size / size).
2025-04-07 10:50:56 -04:00
Pieter Wuille
800c0dea9a feefrac: rework comments around Mul/MulFallback 2025-04-07 10:45:13 -04:00
Pieter Wuille
fcfe008db2 feefrac fuzz: use arith_uint256 instead of ad-hoc multiply
Rather than use an ad-hoc reimplementation of wide multiplication inside the
fuzz test, reuse arith_uint256, which already has this. It's larger than what we
need here, but performance isn't a concern in this test, and it does what we need.
2025-04-07 10:45:13 -04:00
Pieter Wuille
46ff4220bf arith_uint256: modernize comparison operators
Since C++20, operator!= is implicitly defaulted using operator==, and
operator<, operator<=, operator>, and operator>= are defaulted using
operator<=>, so it suffices to just provide these two.
2025-04-07 10:45:13 -04:00
Lőrinc
e419b0e17f refactor: Remove manual CDBBatch size estimation
Remove the manual batch size estimation logic (`SizeEstimate()` method and `size_estimate` member) from `CDBBatch`.
Size is now determined solely by the `ApproximateSize()` method introduced in the previous commit, which delegates to the native LevelDB function.

The manual calculation is no longer necessary as LevelDB now provides this functionality directly, and the previous commit verified that the native function's results matched the manual estimation.

Assertions comparing the two methods are removed from `txdb.cpp`.

Co-authored-by: Wladimir J. van der Laan <laanwj@protonmail.com>
2025-04-07 15:59:41 +02:00
Lőrinc
8b5e19d8b5 refactor: Delegate to LevelDB for CDBBatch size estimation
Serialized batch size can be queried via the underlying LevelDB implementation calling the native `leveldb::WriteBatch::ApproximateSize()`.

The previous manual calculation was added in e66dbde6d1 as part of https://github.com/bitcoin/bitcoin/pull/10195. At that time (April 2017), the version of LevelDB used by Bitcoin Core (and even the latest source) lacked a native function for this. LevelDB added this capability in 69e2bd224b, merged later that year.

The old manual estimation method (`SizeEstimate()`) is kept temporarily in this commit, and assertions are added in `txdb.cpp` to verify its results against `ApproximateSize()` during batch writes. This ensures the native function behaves as expected before removing the manual calculation in the subsequent commit.
2025-04-07 13:36:55 +02:00
Lőrinc
751077c6e2 Coins: Add kHeader to CDBBatch::size_estimate
The initialization of the manual `size_estimate` in `CDBBatch::Clear()` is corrected from `0` to `kHeader` (LevelDB's fixed batch header size).
This aligns the manual estimate with LevelDB's actual size immediately after clearing, fixing discrepancies that would otherwise be caught by tests in the next commit (e.g., `coins_tests`, `validation_chainstatemanager_tests`).
2025-04-07 13:36:55 +02:00
Hennadii Stepanov
0dc74c92c0
Merge bitcoin/bitcoin#32212: test: Remove confusing and failing system time test
Some checks are pending
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
fadf8f078e test: Remove confusing and failing system time test (MarcoFalke)

Pull request description:

  This was just added as a sanity check in fa013664ae by myself.

  However, the test uses system time, so it may obviously (albeit rarely) fail.

  Fix it by removing it.

  Can be tested by running two bash loops at the same time:

  `while ( ./bld-cmake/bin/test_bitcoin -t util_tests/util_time_GetTime ) ; do true ; done`

  `while ( date -s "$(date -d 'now + 0.015 seconds' '+%Y-%m-%d %H:%M:%S.%3N')" && date -s "$(date -d 'now - 0.015 seconds' '+%Y-%m-%d %H:%M:%S.%3N')" ) ; do true ; done`

  Eventually, it will fail:

  ```
  test/util_tests.cpp(595): error: in "util_tests/util_time_GetTime": check ms_0 < GetTime<std::chrono::milliseconds>() has failed
  test/util_tests.cpp(596): error: in "util_tests/util_time_GetTime": check us_0 < GetTime<std::chrono::microseconds>() has failed

  *** 2 failures are detected in the test module "Bitcoin Core Test Suite"

ACKs for top commit:
  janb84:
    ACK [fadf8f0](fadf8f078e)
  mabu44:
    Tested ACK fadf8f078e
  hebasto:
    ACK fadf8f078e, tested on Ubuntu 24.10.

Tree-SHA512: fc468546f46a12804802df4f0e64d2898aca3db4df69602e5919ac31646c2fcb1e75b614fc2d1a3959c3db10fb0e315da5886d348b41589dba7cb43e618444a1
2025-04-07 11:47:15 +01:00
Prabhat Verma
7677fde4c7 Add fuzz test coverage report generation
Signed-off-by: Prabhat Verma <prabhatverma329@gmail.com>
2025-04-07 15:18:39 +05:30
Lőrinc
c77e3107b8 refactor: rename leftover WriteBlockBench
The benchmark was referencing the old name of the method
2025-04-06 12:42:00 +02:00
merge-script
d42e82d650
Merge bitcoin/bitcoin#32218: ci: Merge master in test-each-commit task (take 2)
Some checks are pending
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
fa10a1ded5 ci: Use GITHUB_BASE_REF over hard-coded master (MarcoFalke)
fa0d0be05c ci: Merge master in test-each-commit task (take 2) (MarcoFalke)

Pull request description:

  Calling the script `.github/ci-test-each-commit-exec.sh`, which merges `master`, obviously doesn't work, if the script itself is missing.

  Fix it by a move-only to first merge `master` and then call the script.

ACKs for top commit:
  l0rinc:
    Code review ACK fa10a1ded5
  sipa:
    ACK fa10a1ded5, this fixed the CI issue in #31444.

Tree-SHA512: bcab2b03cb46d456e29f8d4237312a4525b9acd819578b26b4d5670ca14e075cf473b77b235b3063e06422325b627587f12dec7b4fbba134086d162c67dc81b3
2025-04-06 17:25:24 +08:00
pablomartin4btc
0f602c5693 wallet, migration: Fix crash on empty wallet
Same as with a blank wallet, wallets with no legacy
records (i.e. empty, non-blank, watch-only wallet)
do not require to be migrated.
2025-04-04 17:38:41 -03:00
MarcoFalke
fa10a1ded5
ci: Use GITHUB_BASE_REF over hard-coded master 2025-04-04 15:32:49 +02:00
MarcoFalke
fa0d0be05c
ci: Merge master in test-each-commit task (take 2)
* Run git config earlier and only once
* Run git merge in the yaml, before calling the bash script
* Run git reset in the yaml as well, for symmetry
* Replace "git merge --abort" with "git reset --hard", because it does
  not fail when already up to date and no merge was started.
2025-04-04 15:32:42 +02:00
merge-script
65dcbec756
Merge bitcoin/bitcoin#32209: test: Preserve llvm profile path
Some checks failed
CI / test each commit (push) Has been cancelled
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Has been cancelled
CI / macOS 14 native, arm64, fuzz (push) Has been cancelled
CI / Windows native, VS 2022 (push) Has been cancelled
CI / Windows native, fuzz, VS 2022 (push) Has been cancelled
CI / Linux->Windows cross, no tests (push) Has been cancelled
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Has been cancelled
CI / Windows, test cross-built (push) Has been cancelled
c5a7ffd1e8 preserve llvm profile env (Prabhat Verma)

Pull request description:

  While generating `profraw` for fuzz tests using steps in [PR 32206](https://github.com/bitcoin/bitcoin/pull/32206) , the profraw was not being built at the desired location and only one `default.profraw` was being created which was being overwritten for multiple fuzz targets. This PR fixes that.

ACKs for top commit:
  maflcko:
    lgtm ACK c5a7ffd1e8
  mabu44:
    ACK c5a7ffd1e8

Tree-SHA512: 11f74caa8cba6f841aa899a5e294f658aed1b6a3d4cf68992609ea99fadb4a092b2350ffacea5c2d5eb377eb10082de018f27a1d6486a72460cb3905aaa15664
2025-04-04 15:42:52 +08:00
Hennadii Stepanov
b34d49a27e
Merge bitcoin/bitcoin#32203: ci: Merge master in test-each-commit task
faa807bdf8 ci: Merge master in test-each-commit task (MarcoFalke)

Pull request description:

  The `test-each-commit` task will often fail, when the CI config yaml is updated along with code changes.

  This is because, GitHub seems to be merging the CI config on a fresh pull with the current target branch (`master`). However, the code changes are not.

  A tedious workaround would be for every developer to rebase on every intermittent (https://github.com/bitcoin/bitcoin/issues/31946#issuecomment-2740911853) and non-intermittent CI issue.

  However, fix this instead by merging with `master`.

ACKs for top commit:
  laanwj:
    ACK faa807bdf8
  hebasto:
    ACK faa807bdf8.

Tree-SHA512: 4849bd558dc6cdc7d86b95164ccee32ab7c08c9b7d31cf8ec5c8e9a2251fc819630f8fa9b929ed39e8e033c67bb006f0beb33e0de216e1224680be88c5fa0161
2025-04-04 07:19:35 +01:00
monlovesmango
924f25f6fc bench: Match ConnectBlock tx output counts
There turned out to be a mismatch in the tx output counts which caused
'ConnectBlockMixedEcdsaSchnorr' benchmark to run slower than
'ConnectBlockAllEcdsa' and 'ConnectBlockAllSchnorr'. This commit makes
the tx output counts uniform across all benchmarks.

This commit also renames the 'taproot_tx' variable to 'tx' to reflect
that this variable represents a general tx and not just a taproot tx.
2025-04-03 21:38:15 +00:00
Prabhat Verma
c5a7ffd1e8 preserve llvm profile env
Signed-off-by: Prabhat Verma <prabhatverma329@gmail.com>
2025-04-03 21:02:21 +05:30
MarcoFalke
fac978fb21
test: Remove fragile and ancient release 0.17 wallet test 2025-04-03 14:34:06 +02:00
pablomartin4btc
42c13141b5 wallet, refactor: Decouple into HasLegacyRecords()
The new helper will be used to fix a crash in the
wallet migration process (watch-only, non-blank,
private keys disabled, empty wallet - no scripts
or addresses imported).

Co-authored-by: Matias Furszyfer <mfurszy@protonmail.com>
2025-04-03 07:55:51 -03:00
Hennadii Stepanov
c66f7dab33
Merge bitcoin/bitcoin#32211: doc: Amend Qt 6 dependency packages for Ubuntu
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
2e751f559a doc: Amend Qt 6 dependency packages for Ubuntu (Hennadii Stepanov)

Pull request description:

  On older systems, such as Ubuntu 22.04, `qt6-tools-dev-tools` and `libgl-dev` are not treated as dependencies of `qt6-tools-dev` and `qt6-base-dev`, respectively. This PR explicitly lists them in the installation documentation.

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

ACKs for top commit:
  maflcko:
    lgtm ACK 2e751f559a
  laanwj:
    Code review ACK 2e751f559a

Tree-SHA512: a6997c74c83789cb5fe5b97a719b8ff6e2180d5f6ae5502ccccfce3a22394d25eef05204ecda0a6deb368de77975e2a1da89b5749eff01a979f2f60843efebff
2025-04-03 11:54:09 +01:00
laanwj
ec81a72b36 net: Add randomized prefix to Tor stream isolation credentials
Add a class TorsStreamIsolationCredentialsGenerator that generates
unique credentials based on a randomly generated session prefix
and an atomic counter.

This makes sure that different launches of the application won't share
the same credentials, and thus circuits, even in edge cases.

Example with `-debug=proxy`:
```
2025-03-31T16:30:27Z [proxy] SOCKS5 sending proxy authentication 0afb2da441f5c105-0:0afb2da441f5c105-0
2025-03-31T16:30:31Z [proxy] SOCKS5 sending proxy authentication 0afb2da441f5c105-1:0afb2da441f5c105-1
```

Thanks to hodlinator for the idea.
2025-04-03 12:05:59 +02:00
Hennadii Stepanov
d85895e5a7
build, msvc: Build only required qtbase features
This change makes vcpkg skip unused features such as `dnslookup`,
`openssl`, etc.
2025-04-03 10:26:58 +01:00
Hennadii Stepanov
fe5a6dcc53
build, msvc: Update vcpkg manifest baseline
This change updates the vcpkg manifest baseline from the "2024.09.30
Release" to the "2025.03.19 Release", with the following package
changes:
 - boost: 1.85.0#1,2 --> 1.87.0
 - qtbase: 6.7.2#3 -> 6.8.2#1
 - qttools: 6.7.2#1 -> 6.8.2
 - sqlite3: 3.46.1 --> 3.49.1
2025-04-03 10:26:50 +01:00
MarcoFalke
fadf8f078e
test: Remove confusing and failing system time test 2025-04-03 11:12:00 +02:00
Hennadii Stepanov
2e751f559a
doc: Amend Qt 6 dependency packages for Ubuntu
On older systems, such as Ubuntu 22.04, `qt6-tools-dev-tools` and
`libgl-dev` are not treated as dependencies of `qt6-tools-dev` and
`qt6-base-dev`, respectively. This change explicitly lists them in the
installation documentation.
2025-04-03 10:11:26 +01:00
Hennadii Stepanov
df82a24508
Merge bitcoin-core/gui#863: refactor: Post Qt 6 cleanup
3aa58bea8e qt, refactor: Inline `GUIUtil::SplitSkipEmptyParts` function (Hennadii Stepanov)
d1ec6db249 qt, refactor: Inline `GUIUtil::GetImage` function (Hennadii Stepanov)
4b36ab3a6a qt, refactor: Remove outdated Qt version-specific code (Hennadii Stepanov)

Pull request description:

  This PR:
  - Removes outdated Qt version-specific code.
  - Inlines two functions from `GUIUtil`.

ACKs for top commit:
  davidgumberg:
    crACK 3aa58bea8e

Tree-SHA512: f56f6e3a219a5378d986bcb5fbfc50dcd752c080a92055da1f859433214c999905b456a12f6ac3d5b4871656dbf43a732adf04536c3479b1aa93110beafb2478
2025-04-03 08:45:37 +01:00
merge-script
77dff373a6
Merge bitcoin/bitcoin#32182: ci: Switch to dynamic library linkage in native Windows job
7967fe5bfd ci: Switch to dynamic library linkage in native Windows job (Hennadii Stepanov)

Pull request description:

  This PR significantly reduces the vcpkg binary cache size, improving CI caching performance:

  | Branch | Cache Size |
  |---|--:|
  | master | 2.6 GB |
  | this PR |  430 MB |

  Also see https://github.com/bitcoin/bitcoin/pull/31176#issuecomment-2766164288.

ACKs for top commit:
  maflcko:
    lgtm ACK 7967fe5bfd

Tree-SHA512: d52fcf9cdc95bcbbe35def4634cd94d3c934be939a486ac4740da7e5706ef813950984987a7dfef45edeca8a539438dc8fc8f3f92adb7f188af2f0088b88e4db
2025-04-03 14:03:11 +08:00
merge-script
99b9022844
Merge bitcoin/bitcoin#32177: TxGraph: Increase fuzz coverage
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
a40bd374aa Get*Union: disallow nulltpr Refs (Greg Sanders)
57433502e6 CountDistinctClusters: nullptrs disallowed (Greg Sanders)
8bca0d325a TxGraphImpl::Compact: m_main_clusterset.m_removed is always empty (Greg Sanders)
2c5cf987e9 TxGraphImpl::PullIn: only allowed when staging exists (Greg Sanders)

Pull request description:

  Was looking at my local coverage report, and noticed a few spots that will not or cannot be hit.

  CountDistinctClusters, GetAncestorsUnion, and GetDescendantsUnion accept nullptrs, but the test harness never employs them. Disallow them.

  We never call PullIn whenever there isn't staging, so just enforce that invariant via assertion.

  Remaining places that are not covered:

  1) Relinearize: Currently we seem to always start with a cold (not known to be optimal) cluster, and after one attempt at linearization result into something optimal. This means we never shortcircuit, nor run PostLinearization, nor store the quality as ACCEPTABLE. Reducing iterations causes these lines to be hit. sipa says he will take this on as varying the amount of iterations was meant to be done eventually anyways.
  2) We never do a move assignment operator when the lvalue already has a `m_graph` (so we never call UnlinkRef) 3358b1d105/src/txgraph.cpp (L2097)
  3) We never use the move constructor: 3358b1d105/src/txgraph.cpp (L2108)

ACKs for top commit:
  sipa:
    utACK a40bd374aa
  glozow:
    utACK a40bd374aa

Tree-SHA512: ca88297222e80e0d590889698899f892b9335cfa587a76a6c6ca62c8d846f208b6b0b9a9b1829bafabdb929a1a0c3a75f23edf7dd2b4f5e2dad0235e5bc68ba3
2025-04-03 09:51:28 +08:00
Hennadii Stepanov
3aa58bea8e
qt, refactor: Inline GUIUtil::SplitSkipEmptyParts function 2025-04-02 20:49:18 +01:00
Hennadii Stepanov
d1ec6db249
qt, refactor: Inline GUIUtil::GetImage function 2025-04-02 20:48:36 +01:00
Hennadii Stepanov
4b36ab3a6a
qt, refactor: Remove outdated Qt version-specific code
Since bitcoin/bitcoin#30997, the minimum supported Qt version is 6.2.
2025-04-02 20:48:11 +01:00
MarcoFalke
faa807bdf8
ci: Merge master in test-each-commit task 2025-04-02 20:46:43 +02:00
Hennadii Stepanov
7967fe5bfd
ci: Switch to dynamic library linkage in native Windows job
This change significantly reduces the vcpkg binary cache size, improving
CI caching performance.
2025-04-02 17:47:10 +01:00
merge-script
639279e86a
Merge bitcoin/bitcoin#30997: build: Switch to Qt 6
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
f00345727b doc: Update `dependencies.md` for Qt 6 (Hennadii Stepanov)
80b917991e build, msvc: Update `vcpkg.json` for Qt 6 (Hennadii Stepanov)
30dd1f1644 ci: Update for Qt 6 (Hennadii Stepanov)
629d292f4d test: Update sanitizer suppressions for Qt 6 (Hennadii Stepanov)
551e13abf8 guix: Adjust for Qt 6 (Hennadii Stepanov)
c3e9bd086c qt: Fix compiling for Windows (Hennadii Stepanov)
ab399c4db2 depends: Add `native_qt` package (Hennadii Stepanov)
248613eb3e depends: Factor out Qt modules' details (Hennadii Stepanov)
0268f52a4c depends: Introduce customizable `$(package)_patches_path` variables (Hennadii Stepanov)
5e794e6202 depends: Bump `qt` package up to 6.7.3 (Hennadii Stepanov)
6d4214925f cmake: Require Qt 6 to build GUI (Hennadii Stepanov)

Pull request description:

  The currently used Qt 5.15 is approaching [EOL](https://www.qt.io/blog/qt-5.15-extended-support-for-subscription-license-holders) and will reach it before the Bitcoin Core v30 release. The recent migration of the build system to CMake makes it possible to switch to Qt 6.

  This PR updates the OS runtime compatibility requirements for the Bitcoin Core GUI as follows:

  ### 1. Linux

  Starting with Qt 6.5.0, the `libxcb-cursor0` package is required to be installed at runtime.

  ### 2. Windows

  Cross-compiling does not support LTO. We have to re-add it in a follow-up.

  A new style plugin causes minor visual glitches, such as
  ![image](https://github.com/user-attachments/assets/e06f8685-aa79-49e7-9e61-4d54563f6d04)
  which will be fixed in follow-ups.

  ### 3. macOS

  `bitcoin-qt` now uses the [Metal](https://developer.apple.com/metal/) backend.

  ---

  **IMPORTANT.** Don't forget to install [Ninja](https://ninja-build.org/).

  ---

  For historical context, please refer to:
  - https://github.com/bitcoin/bitcoin/issues/20627
  - https://github.com/bitcoin/bitcoin/pull/24798

  ---

  UPD 2024-10-09. Qt 6.8 has been [released](https://www.qt.io/blog/qt-6.8-released), but it has some [drawbacks](https://github.com/bitcoin/bitcoin/pull/30997#issuecomment-2402990346) for us. As a result, this PR will stick to Qt 6.7.

  UPD 2025-03-18: [Standard support for Qt 5.15 will end after 26th of May 2025](https://www.qt.io/blog/extended-security-maintenance-for-qt-5.15-begins-may-2025)

ACKs for top commit:
  laanwj:
    re-ACK f00345727b
  hodlinator:
    re-ACK f00345727b

Tree-SHA512: 367f722e6c3ea4700b5395871c40b6df8c8062fdc822107090449ea4ae4ad2db75cc53a982a678f4c48ce8f9b2d43ed10e6d23b06165ab78713f161db712d895
2025-04-02 21:41:16 +08:00
Cory Fields
babb9f5db6 depends: remove non-native libmultiprocess build
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2025-04-02 13:41:16 +00:00
Ryan Ofsky
5d105fb8c3 depends: Switch libmultiprocess packages to use local git subtree
With newly introduced libmultiprocess subtree, there's no need for depends
system to download and track changes to the upstream repository.

Note that adding the libmultiprocess subtree does not allow dropping
libmultiprocess packages from the depends build, because libmultiprocess
includes a code generation tool called mpgen, and in cross-compiled builds,
bitcoin core's cmake build system doesn't have access to a native toolchain and
can't build mpgen itself, so the depends system (or the native environment if
not using depends) needs to supply it.
2025-04-02 08:41:16 -05:00
Ryan Ofsky
9b35518d2f depends, moveonly: split up int_get_build_id function
Move parts of the int_get_build_id into a new int_get_build_properties
function. There is no change in behavior. This just organizes assignments
better so some build properties can be used to help compute build ids in the
next commit.
2025-04-02 08:41:16 -05:00
Ryan Ofsky
2d373e2707 lint: Add exclusions for libmultiprocess subtree
Without this change linter produces errors about:

- Use of std::filesystem the libmultiprocess example program.
- Use of locale-dependent functions in example program, in the build time code
  generator, and in the runtime library for debug logging.
- Include guards not beginning with BITCOIN_
2025-04-02 08:41:16 -05:00
Ryan Ofsky
e88ab394c1 doc: Update documentation to explain libmultiprocess subtree
Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
2025-04-02 08:41:16 -05:00
Ryan Ofsky
d4bc563982 cmake: Fix clang-tidy "no input files" errors
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR #30975 which enables multiprocess build
option in more CI jobs. In that PR, clang-tidy job fails due to missing
generated example files as reported
https://github.com/bitcoin/bitcoin/pull/30975#issuecomment-2627116832

Different fixes were suggested
https://github.com/bitcoin/bitcoin/pull/30975#issuecomment-2627152623 and
https://github.com/bitcoin/bitcoin/pull/30975#issuecomment-2627403382

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2025-04-02 08:41:16 -05:00
Ryan Ofsky
abdf3cb645 cmake: Fix warnings from boost headers
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR #30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
https://github.com/bitcoin/bitcoin/pull/30975#issuecomment-2623801480 and
https://github.com/chaincodelabs/libmultiprocess/issues/138
2025-04-02 08:41:16 -05:00
Ryan Ofsky
8532fcb1c3 cmake: Fix ctest mptest "Unable to find executable" errors
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR #30975 which enables multiprocess build
option in more CI jobs. In that PR, several jobs fail due to the mptest
executable not being built by default, as reported
https://github.com/bitcoin/bitcoin/pull/30975#issuecomment-2623801480

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2025-04-02 08:41:16 -05:00
Ryan Ofsky
d597ab1dee cmake: Support building with libmultiprocess subtree
When ENABLE_IPC option is on, build with libmultiprocess subtree and
`add_subdirectory(src/ipc/libmultiprocess)` instead of external package
and `find_package(Libmultiprocess)` by default.

Behavior can be toggled with `WITH_EXTERNAL_LIBMULTIPROCESS` option. Using a
subtree should be more convenient for most bitcoin developers, but using an
external package is more convenient for developing in the libmultiprocess
repository.

The `WITH_EXTERNAL_LIBMULTIPROCESS` option is also used to avoid needing to
changing the depends build here. But in later commits, the depends build is
switched to use the add_subdirectory build as well.

Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2025-04-02 08:41:16 -05:00
Ryan Ofsky
69f0d4adb7 scripted-diff: s/WITH_MULTIPROCESS/ENABLE_IPC/ in cmake
Rename WITH_MULTIPROCESS to ENABLE_IPC, because ENABLE_IPC is a more accurate
name for the feature. It controls whether the src/ipc/ directory is built and
whether IPC features like -ipcbind, -ipcconnect, and -ipcfd are available. It
does NOT currently enable multiprocess features which are implemented in #10102
building on top of the IPC features. It will also no longer (as of the next
commit), control whether a find_package call is made so the "WITH_" prefix is
also inappropriate.

-BEGIN VERIFY SCRIPT-
git grep -l WITH_MULTIPROCESS | xargs sed -i s/WITH_MULTIPROCESS/ENABLE_IPC/g
-END VERIFY SCRIPT-
2025-04-02 08:41:16 -05:00