47627 Commits

Author SHA1 Message Date
Fabian Jahr
e53934422a
doc: Expand documentation on asmap feature and tooling 2026-02-03 18:05:32 +01:00
Fabian Jahr
6244212a55
init, net: Implement usage of binary-embedded asmap data 2026-02-03 18:05:30 +01:00
Fabian Jahr
6202b50fb9
build: Generate ip_asn.dat.h during build process
This can be disabled with -DWITH_EMBEDDED_ASMAP=OFF.
2026-02-03 18:03:37 +01:00
Fabian Jahr
634cd60dc8
build: Add embedded asmap data
The data embedded is from the latest ASMap file from the asmap-data
repository: https://github.com/asmap/asmap-data/blob/main/1755187200_asmap.dat
2026-02-03 18:03:36 +01:00
merge-script
b58eebf152
Merge bitcoin/bitcoin#34470: Bump leveldb subtree and remove UB workaround in CI
fad7d86d8d17d89238ed9a2b2305cb3ed6a32cf4 ci: Remove unused workaround after leveldb subtree bump (MarcoFalke)
2f2952c5f2e367ccac34025a159c9fbaffd7f172 Squashed 'src/leveldb/' changes from cad64b151d..ab6c84e6f3 (MarcoFalke)

Pull request description:

  Bump leveldb subtree and remove UB workaround in CI. This also fixes a GCC-16 warning.

ACKs for top commit:
  l0rinc:
    code review ACK fad7d86d8d17d89238ed9a2b2305cb3ed6a32cf4
  fanquake:
    ACK fad7d86d8d17d89238ed9a2b2305cb3ed6a32cf4

Tree-SHA512: dccd53ca638f1acbd72187032d858453e1cc58b156a52e24356c075ac85be0db47d7b73965131b5fbc7b188cbc34cbfd72a8286e860c3b28258daaf5437546f2
2026-02-03 11:26:40 +00:00
merge-script
8bb277c123
Merge bitcoin/bitcoin#34481: Update secp256k1 subtree to latest master
d405713197f857d3a630ab52117e08ee7ae00789 ci: use Alpine 3.23 (fanquake)
1cee0e4cd3afd7043b517227828d44a4316f2872 ci: detect apk usage generally (fanquake)
9d4c9b00356e02de223033adb7680b47b743caab Squashed 'src/secp256k1/' changes from 14e56970cb..57315a6985 (fanquake)

Pull request description:

  Updates the secp256k1 subtree to latest master (57315a6985), which includes https://github.com/bitcoin-core/secp256k1/pull/1813.

ACKs for top commit:
  maflcko:
    lgtm ACK d405713197f857d3a630ab52117e08ee7ae00789
  hebasto:
    ACK d405713197f857d3a630ab52117e08ee7ae00789.

Tree-SHA512: 6f01f85c309d7b823f41f215a9c856871dcd3d4113ac38cf2cf8e2f2c8a4c9d5f3c9f0e12b95cd9140045c66523eeb49aa536c0e91f9d17d5bf81fc95a2ad689
2026-02-03 11:11:18 +00:00
merge-script
a4941132d3
Merge bitcoin/bitcoin#34461: ci: Print verbose build error message in test-each-commit
bbbb78a4f28fd2378342398ccae60995ae0e08d2 ci: Print verbose build error message in test-each-commit (MarcoFalke)
2222dadabbbd03be9b4b917583fd51b34857f40c ci: [refactor] Allow overwriting check option in run helper (MarcoFalke)

Pull request description:

  Currently, the build error in the test-each-commit task is not too nice. E.g. https://github.com/bitcoin/bitcoin/actions/runs/21509735101/job/61973587699#step:8:10464:

  ```
  ...
  [ 75%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/txvalidation_tests.cpp.o
  [ 75%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/txvalidationcache_tests.cpp.o
  [ 75%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/validation_block_tests.cpp.o
  [ 75%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/validation_chainstate_tests.cpp.o
  [ 75%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/validation_chainstatemanager_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/validation_flush_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/validation_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/wallet_test_fixture.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/db_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/coinselector_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/coinselection_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/feebumper_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/group_outputs_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/ismine_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/psbt_wallet_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/scriptpubkeyman_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/spend_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/wallet_rpc_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/wallet_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/wallet_transaction_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/walletdb_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/walletload_tests.cpp.o
  [ 76%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/ipc/test/ipc_tests.cpp.o
  [ 77%] Linking CXX executable ../../bin/test_bitcoin
  [ 87%] Built target test_bitcoin
  gmake: *** [Makefile:146: all] Error 2
  Command '['cmake', '--build', 'ci_build', '-j', '4']' returned non-zero exit status 2.
  error: cannot rebase: Your index contains uncommitted changes.
  warning: execution failed: git merge --no-commit origin/master && python3 ./.github/ci-test-each-commit-exec.py && git reset --hard
  and made changes to the index and/or the working tree.
  You can fix the problem, and then run

    git rebase --continue

  Error: Process completed with exit code 1.
  ```

  Fix it by just using the same approach that the other CI tasks are using:

  01651324f4/ci/test/03_test_script.sh (L143-L146)

ACKs for top commit:
  willcl-ark:
    ACK bbbb78a4f28fd2378342398ccae60995ae0e08d2

Tree-SHA512: ae54ee62f53e060ed42f76ca59daf7a017bd12495e171efed03d1f5dda969db4f7e2e2c9ed7a178ff5fa9a5baa55ab6a7b30b3ab6b81d5279fe937006ac8228f
2026-02-03 10:49:26 +00:00
MarcoFalke
fad7d86d8d
ci: Remove unused workaround after leveldb subtree bump 2026-02-03 11:19:34 +01:00
MarcoFalke
fabced56f6
Bump leveldb subtree
Command that was run:

git subtree pull --prefix src/leveldb https://github.com/bitcoin-core/leveldb-subtree bitcoin-fork --squash
2026-02-03 11:19:01 +01:00
merge-script
be35408c5a
Merge bitcoin/bitcoin#34474: ci: update ccache to improve hitrate
7528d18796a22c695aac8090f3ecd2ccc859aa68 ci: show more verbose ccache stats (will)
580e9eefe39f2f94695e1a22437c6ac47a1664e6 ci: bump CCACHE_MAXSIZE to 2G (will)

Pull request description:

  Currently some CI jobs don't have great ccache hitrates which we should try to improve: https://willcl-ark.github.io/bitcoin-core-ci-stats/graph/ccache/

  - bump ccache maxsize to 2GB in all jobs. We have 150GB shared cache to use, so this should be OK at maximum of 36GB total (current jobset).
  - print more verbose ccache stats in the CI logs

  The idea is that increasing the cache size to > 2x needed size should eliminate any cache thrashing which might be taking place on master builds when we save the cache. Additionally, larger caches result in more hits in general.

ACKs for top commit:
  maflcko:
    lgtm ACK 7528d18796a22c695aac8090f3ecd2ccc859aa68

Tree-SHA512: ae00a05159e3f38d24aebc50a2576c5f11241b1196058a4ca2f5f78909795b891bef20cdc4412f512a2ba09cc9ec65afa5132ac0509b54845dd84f933528500c
2026-02-03 10:16:43 +00:00
MarcoFalke
2f2952c5f2 Squashed 'src/leveldb/' changes from cad64b151d..ab6c84e6f3
ab6c84e6f3 Merge bitcoin-core/leveldb-subtree#58: Initialize file_size to 0 to avoid UB
ad9b1c9893 Initialize file_size to 0 to avoid UB

git-subtree-dir: src/leveldb
git-subtree-split: ab6c84e6f38fae0279e30305a182f9b4674e2ecd
2026-02-03 11:15:21 +01:00
will
7528d18796
ci: show more verbose ccache stats
...and inline function used only once
2026-02-03 09:49:52 +00:00
Ava Chow
47c9297172
Merge bitcoin/bitcoin#32420: mining, ipc: omit dummy extraNonce from coinbase
d511adb664edcfb97be44bc0738f49b679240504 [miner] omit dummy extraNonce via IPC (Sjors Provoost)
bf3b5d6d069a0bbb39af0c487fd597257f862f31 test: clarify getCoinbaseRawTx() comparison (Sjors Provoost)
78df9003d63414e4a17b686af7647aeefd706ec5 [doc] Update comments on dummy extraNonces in tests (Anthony Towns)

Pull request description:

  This PR changes the Mining IPC interface to stop including a dummy `extraNonce` in the coinbase `scriptSig` by default, exposing only the consensus-required BIP34 height. This simplifies downstream mining software (including Stratum v2), avoids forcing clients to strip or ignore data we generate, and reduces the risk of incompatibilities if future soft forks add required commitments to the `scriptSig`.

  Existing behavior is preserved for RPCs, tests, regtest, and internal mining by explicitly opting in to the dummy `extraNonce` where needed (e.g. to satisfy `bad-cb-length` at low heights), so consensus rules and test coverage are unchanged. The remainder of the PR consists of small comment fixes, naming clarifications, and test cleanups to make the intent and behavior clearer.

ACKs for top commit:
  achow101:
    ACK d511adb664edcfb97be44bc0738f49b679240504
  ryanofsky:
    Code review ACK d511adb664edcfb97be44bc0738f49b679240504. Just rebased since last review and make suggested tweaks. I'd really like to see this PR merged for the cleanups and sanity it brings to this code. Needs another reviewer though.
  sedited:
    ACK d511adb664edcfb97be44bc0738f49b679240504

Tree-SHA512: d41fa813eb6b5626f4f475d8abc506b29090f4a2d218f2d6824db58b5ebe2ed7c584a903b44de18ccec142bb79c257b0aba6d6da073f56175aec88df96aaaaba
2026-02-02 15:21:16 -08:00
merge-script
8799eb7440
Merge bitcoin/bitcoin#33878: refactor, docs: Embedded ASMap [2/3]: Refactor asmap internals and add documentation
4fec726c4d352daf2fb4a7e5ed463e44c8815ddb refactor: Simplify Interpret asmap function (Fabian Jahr)
79e97d45c16f043d23ba318a661cc39ec53cf760 doc: Add more extensive docs to asmap implementation (Fabian Jahr)
cf4943fdcdd167a56c278ba094cecb0fa241a8f8 refactor: Use span instead of vector for data in util/asmap (Fabian Jahr)
385c34a05261846dac2b42d47f69b317f534dd40 refactor: Unify asmap version calculation and naming (Fabian Jahr)
fa41fc6a1a7d492b894e206f83e0c9786b44a2f0 refactor: Operate on bytes instead of bits in Asmap code (Fabian Jahr)

Pull request description:

  This is a second slice carved out of #28792. It contains the following changes that are crucial for the embedding of asmap data which is added the following PR in the series (probably this will remain in #28792).

  The changes are:
  - Modernizes and simplifies the asmap code by operating on `std::byte` instead of bits
  - Unifies asmap version calculation and naming (previously it was called version and checksum interchangeably)
  - Operate on a `span` rather than a vector in the asmap internal to prevent holding the asmap data in memory twice
  - Add more extensive documentation to the asmap implementation
  - Unify asmap casing in implemetation function names

  The first three commits were already part of #28792, the others are new.

  The documentation commit came out of feedback gathered at the latest CoreDev. The primary input for the documentation was the documentation that already existed in the Python implementation (`contrib/asmap/asmap.py`) but there are several other comments as well. Please note: I have also asked several LLMs to provide suggestions on how to explain pieces of the implementation and better demonstrate how the parts work together. I have copied bits and pieces that I liked but everything has been edited further by me and obviously all mistakes here are my own.

ACKs for top commit:
  hodlinator:
    re-ACK 4fec726c4d352daf2fb4a7e5ed463e44c8815ddb
  sipa:
    ACK 4fec726c4d352daf2fb4a7e5ed463e44c8815ddb
  sedited:
    Re-ACK 4fec726c4d352daf2fb4a7e5ed463e44c8815ddb

Tree-SHA512: 950a591c3fcc9ddb28fcfdc3164ad3fbd325fa5004533c4a8b670fbf8b956060a0daeedd1fc2fced1f761ac49cd992b79cabe12ef46bc60b2559a7a613d0e166
2026-02-02 18:22:31 +01:00
fanquake
d405713197
ci: use Alpine 3.23 2026-02-02 15:22:01 +00:00
fanquake
1cee0e4cd3
ci: detect apk usage generally
Rather than listing image names, which makes it less easy to
run custom CI jobs.
2026-02-02 15:21:53 +00:00
fanquake
1ed3de5a6d
Update secp256k1 subtree to latest master 2026-02-02 15:21:14 +00:00
fanquake
9d4c9b0035 Squashed 'src/secp256k1/' changes from 14e56970cb..57315a6985
57315a6985 Merge bitcoin-core/secp256k1#1813: Remove trailing spaces and introduce `-Wtrailing-whitespace=any` compiler flag
86cae58d2f build: Add `-Wleading-whitespace=spaces` compiler flag
fb229e7602 build: Add `-Wtrailing-whitespace=any` compiler flag
13e3bee504 refactor: Remove trailing whitespace
453949ab2a Merge bitcoin-core/secp256k1#1816: ci: Rotate Docker cache keys
cd49c57e44 Merge bitcoin-core/secp256k1#1814: release process: mention the `[Unreleased]` link clearly
2ccff6eb73 ci: Add weekly schedule
2f18567d24 ci: Rotate Docker cache keys every 4 weeks
0ffb1749a5 ci, docker: Fix LLVM repository signature failure
0267b65512 release process: mention the `[Unreleased]` link clearly
1605b02f75 Merge bitcoin-core/secp256k1#1775: Add CMake build directory patterns to `.gitignore`
748c0fdd67 Add CMake build directory patterns to `.gitignore`
7eb86bdb01 autotools: Rename `build-aux` to `autotools-aux`

git-subtree-dir: src/secp256k1
git-subtree-split: 57315a69853c9bd4765fccf20b541d47f1b45ca9
2026-02-02 15:21:14 +00:00
merge-script
9f8764c814
Merge bitcoin/bitcoin#34475: ci: Treat SHA1 LLVM signing key as warning
3c8f5e48f710313de78bcbfafd09fed71890d754 ci: Treat SHA1 LLVM signing key as warning (will)

Pull request description:

  The current SHA1 LLVM signing key is considered not secure since
  2026-02-01T00:00:00Z which makes this run fail when downloading
  packages.

  See: https://github.com/llvm/llvm-project/issues/153385

  Apply the fix from the issue to temporarily to treat this error as a
  warning, until the upstream key can be updated.

  This PR should be reverted once the upstream key is updated.

ACKs for top commit:
  hebasto:
    ACK 3c8f5e48f710313de78bcbfafd09fed71890d754, tested by running the "iwyu" CI job locally on Ubuntu 25.10 after burning all podman's caches.

Tree-SHA512: fbccf98bfd73cb338670f1ceea994d277d746acbc88b9b90a403d9a59d82abda0f3ba34c4d484b70926340c2d0c873259f930c36ccd4f9d18bb1d22d49ee70c4
2026-02-02 12:32:27 +00:00
will
3c8f5e48f7
ci: Treat SHA1 LLVM signing key as warning
The current SHA1 LLVM signing key is considered not secure since
2026-02-01T00:00:00Z which makes this run fail when downloading
packages.

See: https://github.com/llvm/llvm-project/issues/153385

Apply the fix from the issue to temporarily to treat this error as a
warning, until the upstream key can be updated.

This PR should be reverted once the upstream key is updated.
2026-02-02 11:55:01 +00:00
merge-script
5cb4cf9b42
Merge bitcoin/bitcoin#34036: contrib: update macOS SDK to Xcode-26.1.1-17B100
a89e1618dd8c2ae655093c947fc3f51a34aad1a0 contrib: update macOS SDK to Xcode-26.1.1-17B100 (fanquake)
57a778ed25264686e2da821b3d5caa249f079657 depends: use -Xclang -fno-cxx-modules in macOS cross build (fanquake)

Pull request description:

  Updates the macOS SDK used for Guix builds to `Xcode-26.1.1-17B100`.
  Closes #34034.

ACKs for top commit:
  hebasto:
    ACK a89e1618dd8c2ae655093c947fc3f51a34aad1a0.
  sedited:
    ACK a89e1618dd8c2ae655093c947fc3f51a34aad1a0
  janb84:
    concept ACK a89e1618dd8c2ae655093c947fc3f51a34aad1a0

Tree-SHA512: 4f8f9afee6fca594a0d30fbb3c150f5ed120b40f707954678ff69951bc806acc154aed4b5986d8642160f7b37523933c87c5734f296ff881555093188e29549e
2026-02-02 10:45:06 +00:00
merge-script
41034a032f
Merge bitcoin/bitcoin#34396: fuzz: pull the latest FuzzedDataProvider.h from upstream
dfb93646093f8d71be455fc95e2e06ff73fb9211 fuzz: pull latest FuzzedDataProvider.h from upstream (b-l-u-e)

Pull request description:

  Pulls down the latest version of https://github.com/llvm/llvm-project/blob/main/compiler-rt/include/fuzzer/FuzzedDataProvider.h, after https://github.com/llvm/llvm-project/pull/177794 was merged upstream.

ACKs for top commit:
  fanquake:
    ACK dfb93646093f8d71be455fc95e2e06ff73fb9211 - updated the PR description.

Tree-SHA512: 36d003a1d92158537811d044bf4b79d63f0ec79e5b0da9e26a73a869c81578f9597ababcb79bb1949689db506c25341255c59979214ee28343fa08f85e2c3466
2026-02-02 09:55:46 +00:00
will
580e9eefe3
ci: bump CCACHE_MAXSIZE to 2G
With 15 runners we get 150GB of cache space to use, and we currently
have 18 jobs using ccache.

Although each run only generates ~ 200-300 MB of cache data on each run,
the small the small size may be contributing to poor hitrate.

Bump ccache to 2GB per job ~ --> 36GB of the total 150GB cache space to
try and reduce any thrashaing and generally increase hitrate.
2026-02-02 09:50:19 +00:00
merge-script
ff09583928
Merge bitcoin/bitcoin#34432: test: Turn ElapseSteady into SteadyClockContext
facb2aab26dffbc1e46809ac776ed43b9eaa9ad4 test: Turn ElapseSteady into SteadyClockContext (MarcoFalke)

Pull request description:

  `ElapseSteady` was introduced a while back, but is only used in one place. It makes more sense if this were a context manager, so that mocktime does not leak from one test into the next.

  So turn it into a context manager, rename it and allow easy time advancement via e.g. `steady_ctx += 1h`.

ACKs for top commit:
  l0rinc:
    ACK facb2aab26dffbc1e46809ac776ed43b9eaa9ad4
  ismaelsadeeq:
    utACK facb2aab26dffbc1e46809ac776ed43b9eaa9ad4
  sedited:
    ACK facb2aab26dffbc1e46809ac776ed43b9eaa9ad4

Tree-SHA512: 1df9cc9685d9be4d3ab8deafd99ac1a5ff752064ae54b83bacd6f44ba2c198b091558a306d49d8b1e2200ac669e95915cc792d589fb3a63b2bef7891d325a1e0
2026-02-02 10:44:55 +01:00
merge-script
81e67d9aa1
Merge bitcoin/bitcoin#34179: refactor: Enable transparent lookup for setBlockIndexCandidates to remove const_cast
3bd98b45084d3029465110a99e2486d48944ded8 refactor: use transparent comparator for setBlockIndexCandidates lookups (joaonevess)

Pull request description:

  ### Rationale

  This PR improves code safety by removing a `const_cast` in `src/validation.cpp`.

  Currently, `setBlockIndexCandidates` stores mutable `CBlockIndex*`. However, validation logic (like `CVerifyDB`) often holds `const CBlockIndex*`. Previously, checking for existence in the set required casting away constness. While currently benign, this bypasses compiler safety checks and could mask accidental modifications in future refactors.

  ### Description

  1.  **Enable Heterogeneous Lookup:** Added `using is_transparent = void;` to `CBlockIndexWorkComparator` in `src/node/blockstorage.h`. This allows the `std::set` to natively accept `const CBlockIndex*` for lookup (utilizing C++14 heterogeneous lookup).
  2.  **Remove Cast:** Removed the now unnecessary `const_cast<CBlockIndex*>` in `src/validation.cpp`, allowing the compiler to strictly enforce const-correctness.

  ### Notes

  - **Refactoring only:** No behavioral change.
  - **Verification:** `validation_tests` and `blockmanager_tests` pass.

ACKs for top commit:
  maflcko:
    review ACK 3bd98b45084d3029465110a99e2486d48944ded8 🚪
  frankomosh:
    ACK 3bd98b45084d3029465110a99e2486d48944ded8. Good use of transparent comparator to eliminate `const_cast` in this specific code path.
  sedited:
    ACK 3bd98b45084d3029465110a99e2486d48944ded8

Tree-SHA512: 0f76bdce2a54b759dfec99633afce1e95586e62f4057ecf1e82eed1a073eb8ecb2d659ccbf28a7a139f0aa09a30f058ac6966cafdfbf1f2ee878fa2d86b2c487
2026-02-02 08:49:02 +01:00
merge-script
ec70bead5e
Merge bitcoin/bitcoin#34433: script: remove unused SCRIPT_ERR_LAST
51abf7d15b1da5b74d58a381ced662dc0f70b4b0 script: remove unused SCRIPT_ERR_LAST (Antoine Poinsot)

Pull request description:

  It was introduced in ab9edbd6b6eb3efbca11f16fa467c3c0ef905708 and never used since. It seems it might have been intended to be exposed as part of a public library interface, which has since been superseded.

  The only call site uses SCRIPT_ERR_ERROR_COUNT directly.

ACKs for top commit:
  billymcbip:
    tACK 51abf7d15b1da5b74d58a381ced662dc0f70b4b0
  sedited:
    ACK 51abf7d15b1da5b74d58a381ced662dc0f70b4b0
  theStack:
    ACK 51abf7d15b1da5b74d58a381ced662dc0f70b4b0

Tree-SHA512: 983b0523b2b5eba57732223af22746c9f29e4759d23366147825d1101f94a9b10c385f305d1425c439a4e29ab28f5a9245691ba6dc31a13f260d3d03b0bf1885
2026-02-02 08:16:43 +01:00
merge-script
08547ee1b0
Merge bitcoin/bitcoin#34443: validation: follow-up nits for lock-free IsInitialBlockDownload()
eeb4d2814803c09af602ca5c9810438dd5e987fb validation: follow-up nits for lock-free `IsInitialBlockDownload()` (Lőrinc)

Pull request description:

  Innocent follow-up to #34253:
  * Add `AssertLockHeld(cs_main)` to `ChainstateManager::UpdateIBDStatus()` given it's already annotated with `EXCLUSIVE_LOCKS_REQUIRED(cs_main)`.
  * Fix outdated comment about constness of `ChainstateManager::IsInitialBlockDownload()` (compilation and build passes without it).
  * And since we're touching it, we might as well mark `ChainstateManager::IsInitialBlockDownload()` as `noexcept` now.

ACKs for top commit:
  davidgumberg:
    crACK eeb4d28148
  sedited:
    ACK eeb4d2814803c09af602ca5c9810438dd5e987fb
  mzumsande:
    utACK eeb4d2814803c09af602ca5c9810438dd5e987fb

Tree-SHA512: 110cf5b03dc4f4cf6e61563ef69da6368e43009cf0fe1b10870cb4f55203c347444c8623aae7357d0ee5ba3f4b10da535b440a5871c9c5a4f7f8f88c2accd1f1
2026-02-02 07:57:34 +01:00
merge-script
8bb77f348e
Merge bitcoin/bitcoin#34455: ci, iwyu: Fix warnings in src/univalue and treat them as errors
1bf384222323885ffafb669042d97a4fc5327586 ci, iwyu: Fix warnings in `src/univalue` and treat them as errors (Hennadii Stepanov)

Pull request description:

  This PR continues the ongoing effort to enforce IWYU warnings.

  See [Developer Notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#using-iwyu).

ACKs for top commit:
  maflcko:
    review ACK 1bf384222323885ffafb669042d97a4fc5327586 🦇
  sedited:
    ACK 1bf384222323885ffafb669042d97a4fc5327586

Tree-SHA512: e2b7ad7b318c6c78de9a6b416a2bcb6da3ec9f4f060590db2b4f5f3a9a167891ac60c68efccea889df806f53b803c98303eed1fc24682257a9c37844ee2ee55d
2026-01-31 15:05:44 +01:00
Hennadii Stepanov
1bf3842223
ci, iwyu: Fix warnings in src/univalue and treat them as errors 2026-01-31 10:41:50 +00:00
merge-script
3d180d3c7f
Merge bitcoin/bitcoin#34462: util: Drop *BSD headers in batchpriority.cpp
07af50f7896a36a82efc19b5030779ab36302fa4 util: Drop *BSD headers in `batchpriority.cpp` (Hennadii Stepanov)

Pull request description:

  Currently, there are issues with headers in `batchpriority.cpp`:
  1. `SCHED_BATCH` is not defined on all supported *BSD platforms.
  2. `pthread.h` is necessary on other platforms.

  This PR addresses both issues and fixes other includes.

ACKs for top commit:
  maflcko:
    review ACK 07af50f7896a36a82efc19b5030779ab36302fa4 🤺
  w0xlt:
    crACK 07af50f789

Tree-SHA512: 388f627e9d9c8b80834ba562034cd6aa44ba37d9156e13cdd6cbcfa93b19fcbf3222228d671784ca363e06fda3c978778f62f4530c3eb4ae3ff96adf91c2d789
2026-01-31 11:32:34 +01:00
merge-script
1eed88a3ec
Merge bitcoin/bitcoin#34460: iwyu: Update mappings
9c839aa9e3db30e2fa7d45b087a13bdd86b2a085 iwyu: Document mappings for libc symbols (Hennadii Stepanov)
91824646c58afade176d6c0003c892ceca855ba9 iwyu: Add temporary mapping to work around upstream bug (Hennadii Stepanov)
37de7d19107c350e5ff0b8fc0cb5551830bdb6cb iwyu: Drop backported mapping (Hennadii Stepanov)

Pull request description:

  This PR:
  1. Removes mappings that have been [backported](https://github.com/include-what-you-use/include-what-you-use/pull/1706) upstream.
  2. Adds a new temporary mapping to work around upstream [issue](https://github.com/include-what-you-use/include-what-you-use/issues/1616).
  3. Document the existing mappings for libc symbols.

ACKs for top commit:
  maflcko:
    lgtm ACK 9c839aa9e3db30e2fa7d45b087a13bdd86b2a085
  sedited:
    ACK 9c839aa9e3db30e2fa7d45b087a13bdd86b2a085

Tree-SHA512: 691fd9fc6798951ca1a621ee607a617ebef2ed2f43196465c78c6cd7a5ea7f0f0e876e68cd54653edf9b6762ae5fdb704469a1524a5f6f1ab8b0eedbff65cc28
2026-01-31 09:57:38 +01:00
merge-script
101daa4163
Merge bitcoin/bitcoin#34338: ci, iwyu: Fix warnings in src/zmq and treat them as errors
efcbf794484ecc02cae05e520120df9d1aa8c93a ci, iwyu: Fix warnings in `src/zmq` and treat them as errors (Hennadii Stepanov)

Pull request description:

  This PR [continues](https://github.com/bitcoin/bitcoin/pull/33725#issuecomment-3466897433) the ongoing effort to enforce IWYU warnings.

  See [Developer Notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#using-iwyu).

  Additionally, this adds a new include category to `src/.clang-format`.

ACKs for top commit:
  maflcko:
    review ACK efcbf794484ecc02cae05e520120df9d1aa8c93a 🐼
  janb84:
    re ACK efcbf794484ecc02cae05e520120df9d1aa8c93a
  sedited:
    ACK efcbf794484ecc02cae05e520120df9d1aa8c93a

Tree-SHA512: 5396719d4a9f7fff7b57be7284af5b25ff055edbaba417187e29106c9e310f19f361fbeea74e2448ef1e883a8658028762a38664858a863e5019fcb0cbb346a2
2026-01-31 09:37:03 +01:00
b-l-u-e
dfb9364609
fuzz: pull latest FuzzedDataProvider.h from upstream 2026-01-31 08:45:10 +03:00
Ava Chow
705705e5b1
Merge bitcoin/bitcoin#33701: test: add case where TOTAL_TRIES is exceeded yet solution remains
b189a345574460f10165862eca9cc40ff3337dca test: add case where `TOTAL_TRIES` is exceeded yet solution remains (yancy)

Pull request description:

  Show that `CoinGrider` halts searching when the number of attempts exceeds `TOTAL_TRIES`.  To do so, show that a solution is found, then add one more entry to the same set of inputs.  Since the search orders by `effective_value`, the solution is constructed such that only values with the lowest `effective_value` have the least weight.  Only the lowest weight values will not exceed the `max_selection_weight`. Therefore, `CoinGrinder` will not evaluate all lowest weight solutions together before exceeding `TOTAL_TRIES` since they are last found.

  This test case was inspired by a similar test for `BnB` currently named `bnb_test`.

ACKs for top commit:
  frankomosh:
    Code review ACK b189a34
  achow101:
    ACK b189a345574460f10165862eca9cc40ff3337dca
  murchandamus:
    ACK b189a345574460f10165862eca9cc40ff3337dca

Tree-SHA512: 1df0b6e29ae219edbeed14cfa97f0ad4688d6bf97ed946719ba3c3b69e004f3dee82991578eb5aceb554914b70c5b68feff9e321283c1fc8bc0fedf08df2cb4c
2026-01-30 18:26:07 -08:00
Ava Chow
88f8029835
Merge bitcoin/bitcoin#34100: doc: Use multipath descriptors in descriptors.md and linked test
552bc82b17961b86ae1964e817ba89ee7bfd985f doc: Use multipath descriptors in descriptors.md and linked test (Anurag chavan)

Pull request description:

  Updates documentation and `wallet_miniscript_decaying_multisig_descriptor_psbt.py` to use single multipath descriptors with `<0;1>` syntax instead of separate external/internal descriptors.

  ## Changes
  - **doc/descriptors.md**: Update examples (lines 70-71) to use `/<0;1>/*` multipath syntax
  - **doc/descriptors.md**: Update Basic Multisig Example instructions (line 179) to use single multipath descriptor
  - **test/functional/wallet_miniscript_decaying_multisig_descriptor_psbt.py**: Refactor to use single multipath descriptor pattern matching `wallet_multisig_descriptor_psbt.py`

  ## Implementation
  - `_get_xpub()` now extracts external descriptor and converts to multipath format
  - `create_multisig()` imports single descriptor that expands to receive and change addresses
  - Removed fake checksums from documentation examples
  - Added clear comments documenting multipath convention

  Fixes #34086

ACKs for top commit:
  yashbhutwala:
    ACK 552bc82b17961b86ae1964e817ba89ee7bfd985f
  achow101:
    ACK 552bc82b17961b86ae1964e817ba89ee7bfd985f
  rkrux:
    lgtm tACK 552bc82

Tree-SHA512: cc99271a3955daa475242d9f4ef8f09f4c94c64e48ec4647ecfd95dceb38bb0cdd91b78ec2d5f033b449d175eaecbdda49d6c766c8a1e1a01fed93be4eb0cfc0
2026-01-30 17:29:47 -08:00
Ava Chow
5ad94cf6b7
Merge bitcoin/bitcoin#34381: script: return proper error for CScriptNum errors
6f7b4323cb46687ba9df7073a9cde427985d2dfc test: remove UNKNOWN_ERROR from script_tests (Bruno Garcia)
bd31a92d671610e1173a4e6f0c761d94724441ae script: use SCRIPT_ERR_SCRIPTNUM for CScriptNum errors (Bruno Garcia)
0ca4dcd78665bc5258a2b9cfcef0dcdf971a88c3 script: add SCRIPT_ERR_SCRIPTNUM error (Bruno Garcia)

Pull request description:

  When evaluating a script, the current code is bad for analyzing some errors because it returns `SCRIPT_ERR_UNKNOWN_ERROR` for errors that are clearly known.

  `CScriptNum` has two well defined errors: number overflow and non-minimally encoded number. However, for both errors we return as unknown. This PR changes it by adding a new ScriptError that is used for any `CScriptNum` error.

ACKs for top commit:
  achow101:
    ACK 6f7b4323cb46687ba9df7073a9cde427985d2dfc
  w0xlt:
    ACK 6f7b4323cb
  darosior:
    ACK 6f7b4323cb46687ba9df7073a9cde427985d2dfc

Tree-SHA512: e656d9992251fbc95d33966fa18ce64bf714179d51ba6a7f429e5a55bc58e7fc08827e4ab71ace0dd385dac7e1feaea621b49503387793a30eae7a7e44aa6b0f
2026-01-30 16:22:43 -08:00
Ava Chow
4f85b05131
Merge bitcoin/bitcoin#31713: miniscript refactor: Remove unique_ptr-indirection
964c44cdcd6be5f39aed1aeda9c305803eb3b25f test(miniscript): Prove avoidance of stack overflow (Hodlinator)
198bbaee4959119a63b4038cd0dbb519f4daf6f0 refactor(miniscript): Destroy nodes one full subs-vector at a time (Hodlinator)
50cab8570e8f7553a94e750f66ad9228a728e72e refactor(miniscript): Remove NodeRef & MakeNodeRef() (Hodlinator)
15fb34de41cb069e2bad93a64722bdb32ff00690 refactor(miniscript): Remove superfluous unique_ptr-indirection (Hodlinator)
e55b23c170eb1a80a71e2de8b48cf8a0aebda843 refactor(miniscript): Remove Node::subs mutability (Hodlinator)
c6f798b22247bc092e72eed9e9f69a0cbaca5134 refactor(miniscript): Make fields non-const & private (Hodlinator)
22e4115312b929502574ba3681ee2c3b3fd14d96 doc(miniscript): Remove mention of shared pointers (Hodlinator)

Pull request description:

  Removes one level of unnecessary indirection, which was a change that originally [aided in finding one issue](https://github.com/bitcoin/bitcoin/pull/30866#pullrequestreview-2434704657) in #30866. Simplifies the code one step further than 09a1875ad8cddeb17c19af34b8282d37fed0937e belonging to aforementioned PR.

  Also adds test which verifies resistance to stack overflow when it comes to `~Node()` and `Node::Clone()`.

  No observed difference when running benchmarks: ExpandDescriptor/WalletIsMineDescriptors/WalletIsMineMigratedDescriptors/WalletLoadingDescriptors.

  Followup to #30866.

ACKs for top commit:
  achow101:
    ACK 964c44cdcd6be5f39aed1aeda9c305803eb3b25f
  darosior:
    Code review ACK 964c44cdcd6be5f39aed1aeda9c305803eb3b25f
  l0rinc:
    ACK 964c44cdcd6be5f39aed1aeda9c305803eb3b25f

Tree-SHA512: 32927e8f0f916fb70372ffd110f7ec7207d9e7a099c21c0a7482a12e96593b673c339719f4ab166ad7c086dc43767315fc1742c5b236a3facc45c4cfeb5872e9
2026-01-30 15:17:59 -08:00
Ava Chow
5d2707307e
Merge bitcoin/bitcoin#34454: wallet: Rename RecordType::DELETE to RecordType::DELETE_FLAG
516be10bb56db80aa95b3afbf9773ecd7f167284 wallet: Rename `RecordType::DELETE` to `RecordType::DELETE_FLAG` (Hennadii Stepanov)

Pull request description:

  On Windows, the `winnt.h` header defines `DELETE` as a macro for a "Standard Access Right" bitmask (0x00010000L).

  This introduces a fragile dependency on header inclusion order: if Windows headers happen to be included before the `RecordType` enum definition, the preprocessor expands `DELETE` into a numeric literal, causing syntax errors.

  Rename the enumerator to `DELETE_FLAG` to remove this fragility and avoid the collision entirely.

  Split from https://github.com/bitcoin/bitcoin/pull/34448.

ACKs for top commit:
  maflcko:
    re-lgtm ACK 516be10bb56db80aa95b3afbf9773ecd7f167284
  achow101:
    ACK 516be10bb56db80aa95b3afbf9773ecd7f167284

Tree-SHA512: eba054b395e18c07efb2901b28f542b042b62d85e1a798eeff35f8431530cb667fa791c47c4125cecdb689213b458ba396715495415e9b83bb322509a9376222
2026-01-30 13:21:58 -08:00
Hennadii Stepanov
07af50f789
util: Drop *BSD headers in batchpriority.cpp
Currently, there are issues with headers in `batchpriority.cpp`:
1. `SCHED_BATCH` is not defined on all supported *BSD platforms.
2. `pthread.h` is necessary on other platforms.

This addresses both issues and fixes other includes.
2026-01-30 15:18:05 +00:00
Hennadii Stepanov
516be10bb5
wallet: Rename RecordType::DELETE to RecordType::DELETE_FLAG
On Windows, the `winnt.h` header defines `DELETE` as a macro for a
"Standard Access Right" bitmask (0x00010000L).

This introduces a fragile dependency on header inclusion order: if
Windows headers happen to be included before this enum definition,
the preprocessor expands `DELETE` into a numeric literal, causing
syntax errors.

Rename the enumerator to `DELETE_FLAG` to remove this fragility and
avoid the collision entirely.
2026-01-30 14:21:17 +00:00
MarcoFalke
bbbb78a4f2
ci: Print verbose build error message in test-each-commit 2026-01-30 13:07:54 +01:00
MarcoFalke
2222dadabb
ci: [refactor] Allow overwriting check option in run helper
Also, use str(e) consistently in all run helpers.

This refactor does not change any behavior.

This can be reviewed by checking that all instances are exactly
identical code now:
$ git grep --function-context 'def run(cmd'
2026-01-30 12:57:58 +01:00
Hennadii Stepanov
9c839aa9e3
iwyu: Document mappings for libc symbols 2026-01-30 11:52:49 +00:00
Hennadii Stepanov
91824646c5
iwyu: Add temporary mapping to work around upstream bug 2026-01-30 11:50:17 +00:00
Hennadii Stepanov
37de7d1910
iwyu: Drop backported mapping
See https://github.com/include-what-you-use/include-what-you-use/pull/1706.
2026-01-30 11:39:20 +00:00
merge-script
01651324f4
Merge bitcoin/bitcoin#34434: miniscript: correct and_v() properties
4fab35cf88c048d2784fe6d71d3f83cc4e420879 miniscript: correct and_v() properties (Antoine Poinsot)

Pull request description:

  `and_v()` must never be 'd'. This is not a bug fix since this was unreachable in valid Miniscripts: the first sub of an `and_v()` must be of type V, which conflicts with (i.e. never has) property 'd'.

ACKs for top commit:
  sipa:
    ACK 4fab35cf88c048d2784fe6d71d3f83cc4e420879. Fuzzed for 2 months worth of CPU time.
  achow101:
    ACK 4fab35cf88c048d2784fe6d71d3f83cc4e420879

Tree-SHA512: 8932ad2c9188747299cb9147ff097dca8d078ce7bdd0caefa71ee2724ff81d9bef836664211c2081519a45afd50c539974d67c2a3a1a42a65a3b10b1daef8cbe
2026-01-30 09:45:19 +00:00
merge-script
c7cf2b8f3a
Merge bitcoin/bitcoin#34445: fuzz: Use __AFL_SHM_ID for naming test directories
d3e681bc06758fe0686cd96fcfd4a1c4c5af62b4 fuzz: Use `__AFL_SHM_ID` for naming test directories (marcofleon)

Pull request description:

  During long multicore fuzzing campaigns with AFL++, stale datadirs can eventually accumulate from time outs, resulting in disk running out of space (see https://github.com/bitcoin/bitcoin/issues/28811). The easiest way to reproduce this is by running our `utxo_total_supply` target using multiple cores with AFL++ and observing the crashes that occur because of all the directories in `/tmp/test_common\ bitcoin/utxo_total_supply/`.

  Fix this by using the AFL++ shared memory ID to name the test dirs and cleaning it up before each setup. This ID is unique per AFL++ instance, so multiple cores can run in parallel without conflicts.

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

ACKs for top commit:
  maflcko:
    lgtm ACK d3e681bc06758fe0686cd96fcfd4a1c4c5af62b4
  dergoegge:
    utACK d3e681bc06758fe0686cd96fcfd4a1c4c5af62b4

Tree-SHA512: 420373e5f8a63c84797303ba2ef6657dfe9dacf9c2f3d818524421c24681a0e984c212ecb706217d93f67c2ec16b146a2d37fddcbd6918b2e5e9f634f5e13c10
2026-01-30 09:27:28 +00:00
merge-script
0d1d393877
Merge bitcoin/bitcoin#34429: test: Check that redundant verack message is ignored
fafdae46ff0b02d93d5fcff35f1185627d11d76a test: Check that redundant verack message is ignored (MarcoFalke)

Pull request description:

  The code exists and is uncovered (ref https://maflcko.github.io/b-c-cov/total.coverage/src/net_processing.cpp.gcov.html#L3795), so add a trivial test to cover it.

ACKs for top commit:
  brunoerg:
    ACK fafdae46ff0b02d93d5fcff35f1185627d11d76a
  sedited:
    ACK fafdae46ff0b02d93d5fcff35f1185627d11d76a

Tree-SHA512: 157f434c2faa16243890b2344c4ee36bc359e56c80ba8a04f0bba71e9760cf9106c38ed755ff57eff8d1957f35516d20b3d010e0ecb8633b845f5314cc0d050a
2026-01-30 09:40:57 +01:00
merge-script
23a2e3354e
Merge bitcoin/bitcoin#34453: ci: Always print low ccache hit rate notice
fad2876ec330dbb833905d3b2ee5753abc3bc3af ci: Always print low ccache hit rate notice (MarcoFalke)

Pull request description:

  Looks like the hit rate is low, even on test changes such as https://github.com/bitcoin/bitcoin/actions/runs/21476546461/job/61867393974#step:10:3349

  to make it easier to debug, unconditionally print the low hit rate notice

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

Tree-SHA512: 0cd85e3572e8465ec424766b1fdb6181d7e607cae991889b46cc66e5f08354772b6040a9f14c0864d36e1f38894628819a3a7458d3ec9ea32e063257177740a0
2026-01-30 09:23:10 +01:00
Ava Chow
5401e673d5
Merge bitcoin/bitcoin#33604: p2p: Allow block downloads from peers without snapshot block after assumeutxo validation
7d9e1a810239a65a153c35f0f94490560441db49 test: Verify peer usage after assumeutxo validation completes (stringintech)
0067abe153298ce9f14262a15533033e6e907f2b p2p: Allow block downloads from peers without snapshot block after assumeutxo validation (stringintech)

Pull request description:

  Currently, after assumeutxo background validation finishes, the node continues to skip peers that don't have the snapshot block in their best chain until restart. This unnecessarily excludes peers from block downloads even though the background sync has completed and undo data is available.

  The restriction persists because `m_chainman.CurrentChainstate().SnapshotBase()` continues to return the snapshot base block until restart, even after validation completes. Added `m_chainman.CurrentChainstate().m_assumeutxo == Assumeutxo::UNVALIDATED` check to only apply the peer restriction while background validation is ongoing.

  Also added test coverage in `feature_assumeutxo.py` that verifies peers without the snapshot block can be used for block downloads after background validation completes. The test fails without this fix.

ACKs for top commit:
  fjahr:
    Re-ACK 7d9e1a810239a65a153c35f0f94490560441db49
  achow101:
    ACK 7d9e1a810239a65a153c35f0f94490560441db49
  sedited:
    Re-ACK 7d9e1a810239a65a153c35f0f94490560441db49

Tree-SHA512: 5515971da7bf7efc55eecdf03686f44c20c9e52dd168e7cfa119032d6a8ebccee69df7143075e4e9d0a01426cd9ae7202dce5c00919a82478ebf49a15dc0fe19
2026-01-29 15:11:04 -08:00