iwyu: Fix warnings in `src/bench` and treat them as error #35414

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:260529-iwyu-bench changing 58 files +216 −103
  1. hebasto commented at 2:53 PM on May 29, 2026: member

    This PR addresses this comment:

    I had the impression I already fixed bench in #30716 two years ago, but I guess it isn't yet enforced.

    Could do that as a next step?

    The first two commits act as prerequisites. See the commit messages for details.

    The third commit additionally ensures that our drop-in header replacements are used instead of system headers:

  2. DrahtBot commented at 2:53 PM on May 29, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35414.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, BrandonOdiwuor

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34909 (wallet, refactor: modularise wallet by extracting out legacy wallet migration by rkrux)
    • #34625 (cluster_linearize: add tests and benchmarks for chain and tree-shaped clusters by HowHsu)
    • #34360 (bench: add WalletBalanceManySpent for high-history wallet scenario by w0xlt)
    • #33663 (net: Filter addrman during address selection via AddrPolicy to avoid underfill by waketraindev)
    • #32554 (bench: replace embedded raw block with configurable block generator by l0rinc)
    • #32317 (kernel: Separate UTXO set access from validation functions by sedited)
    • #24230 (indexes: Stop using node internal types and locking cs_main, improve sync logic by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  3. in src/bench/bench.cpp:70 in c74b9660f9 outdated
      66 | @@ -68,9 +67,9 @@ BenchRunner::BenchmarkMap& BenchRunner::benchmarks()
      67 |      return benchmarks_map;
      68 |  }
      69 |  
      70 | -BenchRunner::BenchRunner(std::string name, BenchFunction func)
      71 | +BenchRunner::BenchRunner(std::string_view name, BenchFunction func)
    


    fanquake commented at 3:19 PM on May 29, 2026:

    In 02ac6a68db2bc62faa74a3629caf6210e5df1026:

    eliminating the need to include <string> everywhere the BENCHMARK() macro is used.

    Why is that a problem (that we need to refactor the source to address)?


    hebasto commented at 3:31 PM on May 29, 2026:

    On the master branch, the BENCHMARK() macro hides the actual usage of std::string, which leads to confusing code like this:

    #include <bench/bench.h>
    #include <string>  // Appears unused, but required by BENCHMARK().
    #include <util/time.h>
    
    static void BenchTimeDeprecated(benchmark::Bench& bench)
    {
        bench.run([&] { (void)GetTime(); });
    }
    
    BENCHMARK(BenchTimeDeprecated);
    

    maflcko commented at 8:31 AM on June 10, 2026:

    Interesting. This just turns an implicit string conversion into an implicit string view conversion. So why does this not result in a required string_view include everywhere?


    hebasto commented at 11:52 AM on June 10, 2026:

    maflcko commented at 5:09 PM on June 12, 2026:

    Ah ok, so it not working for std::string is a bug, and using string_view for now seems fine


    fanquake commented at 8:20 AM on June 13, 2026:

    I think the commit message should be changed, to indicate that this refactor "works" because of an upstream bug, otherwise the current text is misleading:

    eliminating the need to include <string> everywhere the BENCHMARK() macro is used.

    Although, I think rather than performing a refactoring, to avoid adding the correct includes, which only happens to work because of an upstream bug (meaning we'll need to make a similar change anyways when the bug is fixed), it'd be better to just make the change now, and document the bug.


    maflcko commented at 8:46 AM on June 15, 2026:

    I think the commit message should be changed, to indicate that this refactor "works" because of an upstream bug, otherwise the current text is misleading:

    eliminating the need to include <string> everywhere the BENCHMARK() macro is used.

    Although, I think rather than performing a refactoring, to avoid adding the correct includes, which only happens to work because of an upstream bug (meaning we'll need to make a similar change anyways when the bug is fixed), it'd be better to just make the change now, and document the bug.

    I think it is the other way round: The refactor works, because it is intentional iwyu policy. The upstream bug is about std::string not working, and if the upstream bug is fixed, no further includes need to be added.

    A third alternative could be to just use const char* (from C) for the C-string literals, which would even allow to drop the string_view include, because all names are compile-time literals anyway. :sweat_smile:

    But no strong opinion, anything is fine here.


    maflcko commented at 5:38 AM on June 17, 2026:

    Tried libc++ for fun and it looks like it asks for string_view includes here (among a few other seemingly false positives):

    diff --git a/ci/test/00_setup_env_native_iwyu.sh b/ci/test/00_setup_env_native_iwyu.sh
    index 3a26be5..27e154d 100755
    --- a/ci/test/00_setup_env_native_iwyu.sh
    +++ b/ci/test/00_setup_env_native_iwyu.sh
    @@ -24 +24 @@ export BITCOIN_CONFIG="\
    - -DCMAKE_CXX_COMPILER=clang++-${IWYU_LLVM_V} \
    + -DCMAKE_CXX_COMPILER='clang++-${IWYU_LLVM_V};-stdlib=libc++' \
    diff --git a/src/bench/addrman.cpp b/src/bench/addrman.cpp
    index 5ce7893..d3ed4c3 100644
    --- a/src/bench/addrman.cpp
    +++ b/src/bench/addrman.cpp
    @@ -5,0 +6 @@
    +
    @@ -19,0 +21 @@
    +#include <string_view>
    diff --git a/src/bench/base58.cpp b/src/bench/base58.cpp
    index ed36dc3..4ccb6bd 100644
    --- a/src/bench/base58.cpp
    +++ b/src/bench/base58.cpp
    @@ -5,0 +6 @@
    +
    @@ -9,0 +11 @@
    +#include <string_view>
    diff --git a/src/bench/bech32.cpp b/src/bench/bech32.cpp
    index 1147bd6..1c64cae 100644
    --- a/src/bench/bech32.cpp
    +++ b/src/bench/bech32.cpp
    @@ -5,0 +6 @@
    +
    @@ -9,0 +11 @@
    +#include <string_view>
    diff --git a/src/bench/bip324_ecdh.cpp b/src/bench/bip324_ecdh.cpp
    index c8d3a35..206a767 100644
    --- a/src/bench/bip324_ecdh.cpp
    +++ b/src/bench/bip324_ecdh.cpp
    @@ -14,0 +15 @@
    +#include <string_view>
    diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp
    index 45052ec..6d80df5 100644
    --- a/src/bench/block_assemble.cpp
    +++ b/src/bench/block_assemble.cpp
    @@ -20,0 +21 @@
    +#include <string_view>
    diff --git a/src/bench/blockencodings.cpp b/src/bench/blockencodings.cpp
    index 274474d..74b324e 100644
    --- a/src/bench/blockencodings.cpp
    +++ b/src/bench/blockencodings.cpp
    @@ -5 +4,0 @@
    -#include <bench/bench.h>
    @@ -6,0 +6,2 @@
    +
    +#include <bench/bench.h>
    @@ -25,0 +27 @@
    +#include <string_view>
    diff --git a/src/bench/ccoins_caching.cpp b/src/bench/ccoins_caching.cpp
    index ec44e66..a989f58 100644
    --- a/src/bench/ccoins_caching.cpp
    +++ b/src/bench/ccoins_caching.cpp
    @@ -17,0 +18 @@
    +#include <string_view>
    diff --git a/src/bench/chacha20.cpp b/src/bench/chacha20.cpp
    index cc2b57e..12a8157 100644
    --- a/src/bench/chacha20.cpp
    +++ b/src/bench/chacha20.cpp
    @@ -14,0 +15 @@
    +#include <string_view>
    diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp
    index a35f5e9..4afb084 100644
    --- a/src/bench/checkblock.cpp
    +++ b/src/bench/checkblock.cpp
    @@ -17,0 +18 @@
    +#include <string_view>
    diff --git a/src/bench/checkblockindex.cpp b/src/bench/checkblockindex.cpp
    index 78e70a8..1aa7203 100644
    --- a/src/bench/checkblockindex.cpp
    +++ b/src/bench/checkblockindex.cpp
    @@ -9,0 +10 @@
    +#include <string_view>
    diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp
    index 20f3094..16f95bf 100644
    --- a/src/bench/checkqueue.cpp
    +++ b/src/bench/checkqueue.cpp
    @@ -5 +4,0 @@
    -#include <bench/bench.h>
    @@ -6,0 +6,2 @@
    +
    +#include <bench/bench.h>
    @@ -15,0 +17 @@
    +#include <string_view>
    diff --git a/src/bench/cluster_linearize.cpp b/src/bench/cluster_linearize.cpp
    index 6d4c838..da1c912 100644
    --- a/src/bench/cluster_linearize.cpp
    +++ b/src/bench/cluster_linearize.cpp
    @@ -5 +4,0 @@
    -#include <bench/bench.h>
    @@ -6,0 +6,2 @@
    +
    +#include <bench/bench.h>
    @@ -17,0 +19 @@
    +#include <string_view>
    diff --git a/src/bench/coin_selection.cpp b/src/bench/coin_selection.cpp
    index 4f203fe..cd4fb48 100644
    --- a/src/bench/coin_selection.cpp
    +++ b/src/bench/coin_selection.cpp
    @@ -28,0 +29 @@
    +#include <string_view>
    diff --git a/src/bench/connectblock.cpp b/src/bench/connectblock.cpp
    index 5d530a5..aec4762 100644
    --- a/src/bench/connectblock.cpp
    +++ b/src/bench/connectblock.cpp
    @@ -25,0 +26 @@
    +#include <string_view>
    diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp
    index 4d0660d..c6d3216 100644
    --- a/src/bench/crypto_hash.cpp
    +++ b/src/bench/crypto_hash.cpp
    @@ -19,0 +20 @@
    +#include <string_view>
    diff --git a/src/bench/disconnected_transactions.cpp b/src/bench/disconnected_transactions.cpp
    index 1ab2ec6..a169392 100644
    --- a/src/bench/disconnected_transactions.cpp
    +++ b/src/bench/disconnected_transactions.cpp
    @@ -5 +4,0 @@
    -#include <bench/bench.h>
    @@ -6,0 +6,2 @@
    +
    +#include <bench/bench.h>
    @@ -16,0 +18 @@
    +#include <string_view>
    diff --git a/src/bench/duplicate_inputs.cpp b/src/bench/duplicate_inputs.cpp
    index a528066..06d6f3b 100644
    --- a/src/bench/duplicate_inputs.cpp
    +++ b/src/bench/duplicate_inputs.cpp
    @@ -24,0 +25 @@
    +#include <string_view>
    diff --git a/src/bench/ellswift.cpp b/src/bench/ellswift.cpp
    index 2951ca9..6b5b8d5 100644
    --- a/src/bench/ellswift.cpp
    +++ b/src/bench/ellswift.cpp
    @@ -14,0 +15 @@
    +#include <string_view>
    diff --git a/src/bench/examples.cpp b/src/bench/examples.cpp
    index 07c0eab..fac6b76 100644
    --- a/src/bench/examples.cpp
    +++ b/src/bench/examples.cpp
    @@ -6 +5,0 @@
    -
    @@ -8,0 +8 @@
    +#include <string_view>
    diff --git a/src/bench/gcs_filter.cpp b/src/bench/gcs_filter.cpp
    index ea48592..b136cd2 100644
    --- a/src/bench/gcs_filter.cpp
    +++ b/src/bench/gcs_filter.cpp
    @@ -9,0 +10 @@
    +#include <string_view>
    diff --git a/src/bench/hashpadding.cpp b/src/bench/hashpadding.cpp
    index 4825c5f..5e3006e 100644
    --- a/src/bench/hashpadding.cpp
    +++ b/src/bench/hashpadding.cpp
    @@ -9,0 +10,2 @@
    +#include <string_view>
    +
    diff --git a/src/bench/index_blockfilter.cpp b/src/bench/index_blockfilter.cpp
    index a945754..350a66a 100644
    --- a/src/bench/index_blockfilter.cpp
    +++ b/src/bench/index_blockfilter.cpp
    @@ -12 +11,0 @@
    -#include <primitives/block.h>
    @@ -25,0 +25 @@
    +#include <string_view>
    diff --git a/src/bench/load_external.cpp b/src/bench/load_external.cpp
    index 77c229f..c5856e3 100644
    --- a/src/bench/load_external.cpp
    +++ b/src/bench/load_external.cpp
    @@ -21,0 +22 @@
    +#include <string_view>
    diff --git a/src/bench/lockedpool.cpp b/src/bench/lockedpool.cpp
    index 0a924a7..9d0de2b 100644
    --- a/src/bench/lockedpool.cpp
    +++ b/src/bench/lockedpool.cpp
    @@ -12,0 +13 @@
    +#include <string_view>
    diff --git a/src/bench/logging.cpp b/src/bench/logging.cpp
    index 498469d..273ae25 100644
    --- a/src/bench/logging.cpp
    +++ b/src/bench/logging.cpp
    @@ -5 +4,0 @@
    -#include <bench/bench.h>
    @@ -6,0 +6,2 @@
    +
    +#include <bench/bench.h>
    @@ -9,0 +11 @@
    +#include <string_view>
    diff --git a/src/bench/mempool_ephemeral_spends.cpp b/src/bench/mempool_ephemeral_spends.cpp
    index f88643c..1c3529e 100644
    --- a/src/bench/mempool_ephemeral_spends.cpp
    +++ b/src/bench/mempool_ephemeral_spends.cpp
    @@ -21,0 +22 @@
    +#include <string_view>
    diff --git a/src/bench/mempool_eviction.cpp b/src/bench/mempool_eviction.cpp
    index 37bb721..97d7ddd 100644
    --- a/src/bench/mempool_eviction.cpp
    +++ b/src/bench/mempool_eviction.cpp
    @@ -18,0 +19 @@
    +#include <string_view>
    diff --git a/src/bench/mempool_stress.cpp b/src/bench/mempool_stress.cpp
    index ab1146e..cf8ccfc 100644
    --- a/src/bench/mempool_stress.cpp
    +++ b/src/bench/mempool_stress.cpp
    @@ -19,0 +20 @@
    +#include <string_view>
    diff --git a/src/bench/merkle_root.cpp b/src/bench/merkle_root.cpp
    index d80ddb2..e8b1014 100644
    --- a/src/bench/merkle_root.cpp
    +++ b/src/bench/merkle_root.cpp
    @@ -11,0 +12 @@
    +#include <string_view>
    diff --git a/src/bench/nanobench.h b/src/bench/nanobench.h
    index 7851290..92ab052 100644
    --- a/src/bench/nanobench.h
    +++ b/src/bench/nanobench.h
    @@ -50,0 +51,2 @@
    +#include <__locale>
    +#include <forward_list>
    @@ -91,0 +94 @@
    +
    @@ -375 +377,0 @@ struct PerfCountSet;
    -
    @@ -1110,0 +1113 @@ private:
    +
    @@ -1382 +1384,0 @@ void doNotOptimizeAway(T const& val) {
    -#    include <functional>
    diff --git a/src/bench/obfuscation.cpp b/src/bench/obfuscation.cpp
    index 1587b73..198b815 100644
    --- a/src/bench/obfuscation.cpp
    +++ b/src/bench/obfuscation.cpp
    @@ -4,0 +5,2 @@
    +#include <util/obfuscation.h>
    +
    @@ -7 +8,0 @@
    -#include <util/obfuscation.h>
    @@ -10,0 +12 @@
    +#include <string_view>
    diff --git a/src/bench/parse_hex.cpp b/src/bench/parse_hex.cpp
    index 846009a..388eb4f 100644
    --- a/src/bench/parse_hex.cpp
    +++ b/src/bench/parse_hex.cpp
    @@ -12,0 +13 @@
    +#include <string_view>
    diff --git a/src/bench/peer_eviction.cpp b/src/bench/peer_eviction.cpp
    index b9c1c9b..171cf0f 100644
    --- a/src/bench/peer_eviction.cpp
    +++ b/src/bench/peer_eviction.cpp
    @@ -12,0 +13 @@
    +#include <string_view>
    diff --git a/src/bench/poly1305.cpp b/src/bench/poly1305.cpp
    index a3d0f94..3651653 100644
    --- a/src/bench/poly1305.cpp
    +++ b/src/bench/poly1305.cpp
    @@ -13,0 +14 @@
    +#include <string_view>
    diff --git a/src/bench/pool.cpp b/src/bench/pool.cpp
    index cf4ba13..414a5d0 100644
    --- a/src/bench/pool.cpp
    +++ b/src/bench/pool.cpp
    @@ -5 +4,0 @@
    -#include <bench/bench.h>
    @@ -7,0 +7,2 @@
    +#include <bench/bench.h>
    +
    @@ -10,0 +12 @@
    +#include <string_view>
    diff --git a/src/bench/prevector.cpp b/src/bench/prevector.cpp
    index 2b5544f..ad770a4 100644
    --- a/src/bench/prevector.cpp
    +++ b/src/bench/prevector.cpp
    @@ -12,0 +13 @@
    +#include <string_view>
    diff --git a/src/bench/random.cpp b/src/bench/random.cpp
    index c3ac72e..18dd465 100644
    --- a/src/bench/random.cpp
    +++ b/src/bench/random.cpp
    @@ -5 +4,0 @@
    -#include <bench/bench.h>
    @@ -7,0 +7,2 @@
    +#include <bench/bench.h>
    +
    @@ -11,0 +13 @@
    +#include <string_view>
    diff --git a/src/bench/readwriteblock.cpp b/src/bench/readwriteblock.cpp
    index 984936d..da8dd4f 100644
    --- a/src/bench/readwriteblock.cpp
    +++ b/src/bench/readwriteblock.cpp
    @@ -21,0 +22 @@
    +#include <string_view>
    diff --git a/src/bench/rollingbloom.cpp b/src/bench/rollingbloom.cpp
    index 0f9bc9e..d8b340e 100644
    --- a/src/bench/rollingbloom.cpp
    +++ b/src/bench/rollingbloom.cpp
    @@ -10,0 +11 @@
    +#include <string_view>
    diff --git a/src/bench/rpc_blockchain.cpp b/src/bench/rpc_blockchain.cpp
    index b09eae6..239ff1b 100644
    --- a/src/bench/rpc_blockchain.cpp
    +++ b/src/bench/rpc_blockchain.cpp
    @@ -23,0 +24 @@
    +#include <string_view>
    diff --git a/src/bench/rpc_mempool.cpp b/src/bench/rpc_mempool.cpp
    index f319c96..c43f558 100644
    --- a/src/bench/rpc_mempool.cpp
    +++ b/src/bench/rpc_mempool.cpp
    @@ -18,0 +19 @@
    +#include <string_view>
    diff --git a/src/bench/sign_transaction.cpp b/src/bench/sign_transaction.cpp
    index 3895559..fe97655 100644
    --- a/src/bench/sign_transaction.cpp
    +++ b/src/bench/sign_transaction.cpp
    @@ -21,0 +22 @@
    +#include <string_view>
    diff --git a/src/bench/streams_findbyte.cpp b/src/bench/streams_findbyte.cpp
    index 456f5ae..201f4a9 100644
    --- a/src/bench/streams_findbyte.cpp
    +++ b/src/bench/streams_findbyte.cpp
    @@ -14,0 +15 @@
    +#include <string_view>
    diff --git a/src/bench/strencodings.cpp b/src/bench/strencodings.cpp
    index 4b52b74..135185a 100644
    --- a/src/bench/strencodings.cpp
    +++ b/src/bench/strencodings.cpp
    @@ -12,0 +13 @@
    +#include <string_view>
    diff --git a/src/bench/txgraph.cpp b/src/bench/txgraph.cpp
    index 57081dd..93bd1d0 100644
    --- a/src/bench/txgraph.cpp
    +++ b/src/bench/txgraph.cpp
    @@ -4,0 +5,2 @@
    +#include <txgraph.h>
    +
    @@ -7 +8,0 @@
    -#include <txgraph.h>
    @@ -16,0 +18 @@
    +#include <string_view>
    diff --git a/src/bench/txorphanage.cpp b/src/bench/txorphanage.cpp
    index 8765a7b..d7d7282 100644
    --- a/src/bench/txorphanage.cpp
    +++ b/src/bench/txorphanage.cpp
    @@ -4,0 +5,2 @@
    +#include <node/txorphanage.h>
    +
    @@ -12 +13,0 @@
    -#include <node/txorphanage.h>
    @@ -22,0 +24 @@
    +#include <string_view>
    diff --git a/src/bench/util_time.cpp b/src/bench/util_time.cpp
    index 0079549..4f6f0cf 100644
    --- a/src/bench/util_time.cpp
    +++ b/src/bench/util_time.cpp
    @@ -8,0 +9,2 @@
    +#include <string_view>
    +
    diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp
    index b6d73b8..04d1222 100644
    --- a/src/bench/verify_script.cpp
    +++ b/src/bench/verify_script.cpp
    @@ -26,0 +27 @@
    +#include <string_view>
    diff --git a/src/bench/wallet_balance.cpp b/src/bench/wallet_balance.cpp
    index 958044e..f64c63f 100644
    --- a/src/bench/wallet_balance.cpp
    +++ b/src/bench/wallet_balance.cpp
    @@ -7 +6,0 @@
    -#include <interfaces/handler.h>
    @@ -26,0 +26 @@
    +#include <string_view>
    diff --git a/src/bench/wallet_create.cpp b/src/bench/wallet_create.cpp
    index 13e8ee1..b624c73 100644
    --- a/src/bench/wallet_create.cpp
    +++ b/src/bench/wallet_create.cpp
    @@ -19,0 +20 @@
    +#include <string_view>
    diff --git a/src/bench/wallet_create_tx.cpp b/src/bench/wallet_create_tx.cpp
    index 394f21c..dada0e3 100644
    --- a/src/bench/wallet_create_tx.cpp
    +++ b/src/bench/wallet_create_tx.cpp
    @@ -33 +32,0 @@
    -#include <wallet/types.h>
    @@ -41,0 +41 @@
    +#include <string_view>
    diff --git a/src/bench/wallet_encrypt.cpp b/src/bench/wallet_encrypt.cpp
    index 81e64a2..25af00f 100644
    --- a/src/bench/wallet_encrypt.cpp
    +++ b/src/bench/wallet_encrypt.cpp
    @@ -24 +23,0 @@
    -#include <functional>
    @@ -26,0 +26 @@
    +#include <string_view>
    diff --git a/src/bench/wallet_ismine.cpp b/src/bench/wallet_ismine.cpp
    index 572a271..2265b2b 100644
    --- a/src/bench/wallet_ismine.cpp
    +++ b/src/bench/wallet_ismine.cpp
    @@ -22 +21,0 @@
    -#include <functional>
    @@ -24,0 +24 @@
    +#include <string_view>
    diff --git a/src/bench/wallet_loading.cpp b/src/bench/wallet_loading.cpp
    index 6b1208e..6614ca7 100644
    --- a/src/bench/wallet_loading.cpp
    +++ b/src/bench/wallet_loading.cpp
    @@ -24,0 +25 @@
    +#include <string_view>
    diff --git a/src/bench/wallet_migration.cpp b/src/bench/wallet_migration.cpp
    index 22caec7..590d361 100644
    --- a/src/bench/wallet_migration.cpp
    +++ b/src/bench/wallet_migration.cpp
    @@ -7,0 +8 @@
    +#include <interfaces/chain.h>
    @@ -30,0 +32 @@
    +#include <string_view>
    diff --git a/src/core_io.cpp b/src/core_io.cpp
    index 3650d70..b266577 100644
    --- a/src/core_io.cpp
    +++ b/src/core_io.cpp
    @@ -44,0 +45 @@
    +#include <string_view>
    diff --git a/src/crypto/muhash.cpp b/src/crypto/muhash.cpp
    index c04f58e..e383b57 100644
    --- a/src/crypto/muhash.cpp
    +++ b/src/crypto/muhash.cpp
    @@ -16,0 +17 @@
    +#include <string_view>
    diff --git a/src/index/base.cpp b/src/index/base.cpp
    index 906ed26..ae13dd5 100644
    --- a/src/index/base.cpp
    +++ b/src/index/base.cpp
    @@ -38,0 +39,2 @@
    +#include <ostream>
    +#include <ratio>
    @@ -40,0 +43 @@
    +#include <string_view>
    diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp
    index 5c4a181..33f9be5 100644
    --- a/src/index/blockfilterindex.cpp
    +++ b/src/index/blockfilterindex.cpp
    @@ -32,0 +33 @@
    +#include <string_view>
    diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp
    index 204f434..d38d1fb 100644
    --- a/src/index/coinstatsindex.cpp
    +++ b/src/index/coinstatsindex.cpp
    @@ -33,0 +34 @@
    +#include <string_view>
    diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp
    index cc77a37..9a0dcc7 100644
    --- a/src/kernel/chainparams.cpp
    +++ b/src/kernel/chainparams.cpp
    @@ -32,0 +33 @@
    +#include <string_view>
    diff --git a/src/kernel/coinstats.cpp b/src/kernel/coinstats.cpp
    index 4f2f3fe..45e51b7 100644
    --- a/src/kernel/coinstats.cpp
    +++ b/src/kernel/coinstats.cpp
    @@ -25,0 +26 @@
    +#include <string_view>
    diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp
    index b060108..7e9ebe2 100644
    --- a/src/node/blockstorage.cpp
    +++ b/src/node/blockstorage.cpp
    @@ -53,0 +54 @@
    +#include <string_view>
    diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h
    index 347dbc3..b82b14e 100644
    --- a/src/node/blockstorage.h
    +++ b/src/node/blockstorage.h
    @@ -42,0 +43 @@
    +#include <tuple>
    @@ -50,0 +52 @@ class ChainstateManager;
    +
    diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp
    index 3e34c3a..66607f5 100644
    --- a/src/node/interfaces.cpp
    +++ b/src/node/interfaces.cpp
    @@ -81,0 +82 @@
    +#include <string_view>
    diff --git a/src/node/miner.cpp b/src/node/miner.cpp
    index ccd9cc7..4c1f4e6 100644
    --- a/src/node/miner.cpp
    +++ b/src/node/miner.cpp
    @@ -49,0 +50 @@
    +#include <ratio>
    @@ -52,0 +54 @@
    +#include <string_view>
    diff --git a/src/prevector.h b/src/prevector.h
    index e8a71bc..07e699e 100644
    --- a/src/prevector.h
    +++ b/src/prevector.h
    @@ -9,0 +10 @@
    +#include <cstddef>
    diff --git a/src/script/sign.cpp b/src/script/sign.cpp
    index f38ac2b..ca0a502 100644
    --- a/src/script/sign.cpp
    +++ b/src/script/sign.cpp
    @@ -35,0 +36 @@
    +#include <string_view>
    diff --git a/src/script/signingprovider.cpp b/src/script/signingprovider.cpp
    index 2b5d6e2..ba91795 100644
    --- a/src/script/signingprovider.cpp
    +++ b/src/script/signingprovider.cpp
    @@ -15,0 +16,2 @@
    +#include <string_view>
    +#include <variant>
    diff --git a/src/script/signingprovider.h b/src/script/signingprovider.h
    index c104e21..ee5b1e8 100644
    --- a/src/script/signingprovider.h
    +++ b/src/script/signingprovider.h
    @@ -28 +27,0 @@
    -#include <variant>
    diff --git a/src/util/feefrac.h b/src/util/feefrac.h
    index f9c9a0a..8073deb 100644
    --- a/src/util/feefrac.h
    +++ b/src/util/feefrac.h
    @@ -14,0 +15 @@
    +#include <string_view>
    diff --git a/src/util/fs_helpers.h b/src/util/fs_helpers.h
    index f4d406f..88f2ac3 100644
    --- a/src/util/fs_helpers.h
    +++ b/src/util/fs_helpers.h
    @@ -12,0 +13 @@
    +#include <ios>
    diff --git a/src/util/sock.cpp b/src/util/sock.cpp
    index db3f5fc..e336e4a 100644
    --- a/src/util/sock.cpp
    +++ b/src/util/sock.cpp
    @@ -19,0 +20 @@
    +#include <ratio>
    diff --git a/src/util/sock.h b/src/util/sock.h
    index 50c1ab0..1aad598 100644
    --- a/src/util/sock.h
    +++ b/src/util/sock.h
    @@ -10,0 +11 @@
    +#include <cstddef>
    diff --git a/src/util/threadnames.cpp b/src/util/threadnames.cpp
    index a9a3649..637c5d7 100644
    --- a/src/util/threadnames.cpp
    +++ b/src/util/threadnames.cpp
    @@ -5,0 +6 @@
    +
    @@ -10,0 +12 @@
    +#include <string_view>
    diff --git a/src/util/time.cpp b/src/util/time.cpp
    index 974eb05..d511b5b 100644
    --- a/src/util/time.cpp
    +++ b/src/util/time.cpp
    @@ -16,0 +17 @@
    +#include <ratio>
    
  4. fanquake commented at 4:23 PM on May 29, 2026: member

    https://github.com/bitcoin/bitcoin/actions/runs/26644389739/job/78537895187?pr=35414#step:11:2209:

    [ 83%] Linking CXX executable ../../bin/bench_bitcoin
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/wallet_create.cpp.o: in function `wallet::WalletCreate(ankerl::nanobench::Bench&, bool)':
    /home/runner/work/_temp/src/bench/nanobench.h:1281:(.text+0x928): undefined reference to `ankerl::nanobench::detail::IterationLogic::moveResultTo(std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> >&)'
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/bench.cpp.o: in function `benchmark::BenchRunner::RunAll(benchmark::Args const&)':
    /home/runner/work/_temp/src/bench/bench.cpp:124:(.text+0xb0e): undefined reference to `ankerl::nanobench::operator<<(std::ostream&, std::__debug::vector<ankerl::nanobench::BigO, std::allocator<ankerl::nanobench::BigO> > const&)'
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/bench.cpp.o: in function `(anonymous namespace)::GenerateTemplateResults(std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> > const&, fs::path const&, char const*)':
    /home/runner/work/_temp/src/bench/bench.cpp:53:(.text+0x119a): undefined reference to `ankerl::nanobench::render(char const*, std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> > const&, std::ostream&)'
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/addrman.cpp.o: in function `AddrManAddThenGood(ankerl::nanobench::Bench&)':
    /home/runner/work/_temp/src/bench/nanobench.h:1281:(.text+0x1507): undefined reference to `ankerl::nanobench::detail::IterationLogic::moveResultTo(std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> >&)'
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/addrman.cpp.o: in function `ankerl::nanobench::Bench& ankerl::nanobench::Bench::run<AddrManAdd(ankerl::nanobench::Bench&)::$_0>(AddrManAdd(ankerl::nanobench::Bench&)::$_0&&)':
    /home/runner/work/_temp/src/bench/nanobench.h:1281:(.text+0x1abf): undefined reference to `ankerl::nanobench::detail::IterationLogic::moveResultTo(std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> >&)'
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/addrman.cpp.o: in function `ankerl::nanobench::Bench& ankerl::nanobench::Bench::run<AddrManSelect(ankerl::nanobench::Bench&)::$_0>(AddrManSelect(ankerl::nanobench::Bench&)::$_0&&)':
    /home/runner/work/_temp/src/bench/nanobench.h:1281:(.text+0x1f95): undefined reference to `ankerl::nanobench::detail::IterationLogic::moveResultTo(std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> >&)'
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/addrman.cpp.o: in function `ankerl::nanobench::Bench& ankerl::nanobench::Bench::run<AddrManSelectFromAlmostEmpty(ankerl::nanobench::Bench&)::$_0>(AddrManSelectFromAlmostEmpty(ankerl::nanobench::Bench&)::$_0&&)':
    /home/runner/work/_temp/src/bench/nanobench.h:1281:(.text+0x2255): undefined reference to `ankerl::nanobench::detail::IterationLogic::moveResultTo(std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> >&)'
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/addrman.cpp.o: in function `ankerl::nanobench::Bench& ankerl::nanobench::Bench::run<AddrManSelectByNetwork(ankerl::nanobench::Bench&)::$_0>(AddrManSelectByNetwork(ankerl::nanobench::Bench&)::$_0&&)':
    /home/runner/work/_temp/src/bench/nanobench.h:1281:(.text+0x24ed): undefined reference to `ankerl::nanobench::detail::IterationLogic::moveResultTo(std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> >&)'
    /usr/bin/ld: CMakeFiles/bench_bitcoin.dir/addrman.cpp.o:/home/runner/work/_temp/src/bench/nanobench.h:1281: more undefined references to `ankerl::nanobench::detail::IterationLogic::moveResultTo(std::__debug::vector<ankerl::nanobench::Result, std::allocator<ankerl::nanobench::Result> >&)' follow
    
  5. DrahtBot added the label CI failed on May 29, 2026
  6. DrahtBot commented at 5:48 PM on May 29, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task i686, no IPC: https://github.com/bitcoin/bitcoin/actions/runs/26644389739/job/78537895187</sub> <sub>LLM reason (✨ experimental): CI failed due to a build linker error (undefined references to ankerl::nanobench symbols when linking bench_bitcoin).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. hebasto force-pushed on May 29, 2026
  8. DrahtBot removed the label CI failed on May 29, 2026
  9. in src/bench/CMakeLists.txt:16 in f8654d5052
      11 | +  PRIVATE
      12 | +    core_interface
      13 | +)
      14 | +set_target_properties(bitcoin_nanobench PROPERTIES
      15 | +  EXPORT_COMPILE_COMMANDS OFF
      16 | +  SKIP_LINTING ON  # Ignored before CMake 4.2.
    


    maflcko commented at 1:13 PM on June 2, 2026:

    according to git log src/bench/nanobench.h, we are doing in-tree modifications, so commands and linting should be on, no?


    hebasto commented at 5:13 PM on June 4, 2026:

    Fair enough. We've treated this header as our own code since #34208 and #35124.

  10. hebasto force-pushed on Jun 4, 2026
  11. hebasto commented at 7:49 PM on June 4, 2026: member

    The feedback from @maflcko has been fixed.

  12. DrahtBot added the label Needs rebase on Jun 9, 2026
  13. bench, refactor: Use `std::string_view` for `BenchRunner` ctor parameter
    This avoids implicit conversions from string literals to `std::string`,
    eliminating the need to include `<string>` everywhere the `BENCHMARK()`
    macro is used.
    a6ed29d6c2
  14. hebasto force-pushed on Jun 9, 2026
  15. hebasto commented at 2:16 PM on June 9, 2026: member

    Rebased to resolve conflicts.

  16. DrahtBot removed the label Needs rebase on Jun 9, 2026
  17. in src/bench/nanobench.h:1364 in de30dad402 outdated
    1376 | @@ -1359,12 +1377,15 @@ void doNotOptimizeAway(T const& val) {
    1377 |  ///////////////////////////////////////////////////////////////////////////////////////////////////
    1378 |  
    1379 |  #    include <algorithm> // sort, reverse
    1380 | -#    include <atomic>    // compare_exchange_strong in loop overhead
    1381 | +#    include <cmath>
    1382 | +#    include <compare>
    1383 |  #    include <cstdlib>   // getenv
    1384 | -#    include <cstring>   // strstr, strncmp
    


    maflcko commented at 8:46 AM on June 10, 2026:

    de30dad4024fe03df061d711d37aac5aa9e5ec29: This removal is wrong?


  18. in src/bench/nanobench.h:51 in de30dad402
      46 | +// IWYU cannot analyze this header with
      47 | +// `ANKERL_NANOBENCH_IMPLEMENT` undefined,
      48 | +// which makes it suggest removing forward
      49 | +// declarations for the Input/output library.
      50 | +// IWYU pragma: begin_keep
      51 |  #include <iosfwd>        // for std::ostream* custom output target in Config
    


    maflcko commented at 8:48 AM on June 10, 2026:

    Why does a PP macro cause this IWYU behavior?


    hebasto commented at 9:13 AM on June 10, 2026:

    IWYU analyzes translation units. In this case, it's nanobench.cpp and its associated header nanobench.h.

    As seen here: https://github.com/bitcoin/bitcoin/blob/de30dad4024fe03df061d711d37aac5aa9e5ec29/src/bench/nanobench.cpp#L5-L6

    Therefore, ANKERL_NANOBENCH_IMPLEMENT is always defined during the analysis.


    maflcko commented at 9:16 AM on June 10, 2026:

    Oh, I see. So "IWYU cannot" does not mean this is a iwyu shortcoming, but rather something given by this translation unit.

    Maybe reword to "IWYU will only see this header with ANKERL_NANOBENCH_IMPLEMENT defined, which ..."

    This will also remove the double negation, but just a nit, up to you.


    hebasto commented at 9:33 AM on June 10, 2026:

    Thanks! Taken.

  19. maflcko commented at 8:50 AM on June 10, 2026: member

    lgtm, just some nits.

    review ACK de30dad4024fe03df061d711d37aac5aa9e5ec29 🛡

    <details><summary>Show signature</summary>

    Signature:

    untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    trusted comment: review ACK de30dad4024fe03df061d711d37aac5aa9e5ec29 🛡
    5ba/or98yvnASP1wAa8X6vQtQvnTGvCHPv3dVGW5KYONbvUNh4AP6ykmZaR5Oa+m6ct5VwDJVap/iunTFMwxBQ==
    

    </details>

  20. iwyu: Fix warnings in `src/bench` and treat them as error 6751a323c0
  21. hebasto force-pushed on Jun 10, 2026
  22. maflcko commented at 10:17 AM on June 10, 2026: member

    re-ACK 6751a323c0130310880c84e03f7104f6bb86385d 📃

    <details><summary>Show signature</summary>

    Signature:

    untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    trusted comment: re-ACK 6751a323c0130310880c84e03f7104f6bb86385d 📃
    u17ulDaN6GyuCD7D74F2CgwleM3MiF+cXzsywNl5tEH3kHJYBgURRzbWIVUdxHpjB3qeY8Eypnovna3TXDbsBA==
    

    </details>

  23. BrandonOdiwuor commented at 5:53 AM on June 13, 2026: contributor

    ACK 6751a323c0130310880c84e03f7104f6bb86385d

    I reviewed the changes and manually tested IWYU enforcement on src/bench (enabled on base commit a6ed29d6c2f213de5d4b75afdcc8be3a32f8f0d0 and compared before/after this PR).

    I have noted the following and they are reasonable:

    • #include <cassert> was replaced by #include <util/check.h>
    • #include <chrono> was replaced by #include <util/time.h>
    • IWYU enforcement was disabled (via pragmas) for #include <util/byte_units.h>, #include <iosfwd>, and the ankerl namespace in src/bench/nanobench.h.

    <details> <summary>Suggestions after IWYU enforcement on a6ed29d6c2f213de5d4b75afdcc8be3a32f8f0d0 </summary>

    diff --git a/src/addrman.h b/src/addrman.h
    index 94e7d3e..f714338 100644
    --- a/src/addrman.h
    +++ b/src/addrman.h
    @@ -7,18 +7,22 @@
     #define BITCOIN_ADDRMAN_H
     
     #include <netaddress.h>
    -#include <netgroup.h>
     #include <protocol.h>
    -#include <streams.h>
     #include <util/time.h>
     
    +#include <cstddef>
     #include <cstdint>
    +#include <ios>
     #include <memory>
     #include <optional>
    +#include <string>
    +#include <tuple>
     #include <unordered_set>
     #include <utility>
     #include <vector>
     
    +class NetGroupManager;
    +
     /** Over how many buckets entries with tried addresses from a single group (/16 for IPv4) are spread */
     static constexpr uint32_t ADDRMAN_TRIED_BUCKETS_PER_GROUP{8};
     /** Over how many buckets entries with new addresses originating from a single group are spread */
    diff --git a/src/base58.h b/src/base58.h
    index f258163..1656cbe 100644
    --- a/src/base58.h
    +++ b/src/base58.h
    @@ -14,8 +14,7 @@
     #ifndef BITCOIN_BASE58_H
     #define BITCOIN_BASE58_H
     
    -#include <span.h>
    -
    +#include <span>
     #include <string>
     #include <vector>
     
    diff --git a/src/bech32.h b/src/bech32.h
    index ba4c79b..9a43a58 100644
    --- a/src/bech32.h
    +++ b/src/bech32.h
    @@ -14,8 +14,10 @@
     #ifndef BITCOIN_BECH32_H
     #define BITCOIN_BECH32_H
     
    +#include <cstddef>
     #include <cstdint>
     #include <string>
    +#include <utility>
     #include <vector>
     
     namespace bech32
    diff --git a/src/bench/addrman.cpp b/src/bench/addrman.cpp
    index 703b4d2..779b532 100644
    --- a/src/bench/addrman.cpp
    +++ b/src/bench/addrman.cpp
    @@ -3,6 +3,7 @@
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
     #include <addrman.h>
    +
     #include <bench/bench.h>
     #include <compat/compat.h>
     #include <netaddress.h>
    @@ -10,13 +11,13 @@
     #include <netgroup.h>
     #include <protocol.h>
     #include <random.h>
    -#include <span.h>
     #include <uint256.h>
     #include <util/check.h>
     #include <util/time.h>
     
     #include <cstring>
     #include <optional>
    +#include <span>
     #include <vector>
     
     /* A "source" is a source address from which we have received a bunch of other addresses. */
    diff --git a/src/bench/base58.cpp b/src/bench/base58.cpp
    index 0be1643..714969f 100644
    --- a/src/bench/base58.cpp
    +++ b/src/bench/base58.cpp
    @@ -3,8 +3,8 @@
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
     #include <base58.h>
    +
     #include <bench/bench.h>
    -#include <span.h>
     
     #include <array>
     #include <cstring>
    diff --git a/src/bench/bech32.cpp b/src/bench/bech32.cpp
    index c5e864a..aae2306 100644
    --- a/src/bench/bech32.cpp
    +++ b/src/bench/bech32.cpp
    @@ -3,9 +3,11 @@
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
     #include <bech32.h>
    +
     #include <bench/bench.h>
     #include <util/strencodings.h>
     
    +#include <array>
     #include <vector>
     
     using namespace util::hex_literals;
    diff --git a/src/bench/bench_bitcoin.cpp b/src/bench/bench_bitcoin.cpp
    index 987523a..18bf07b 100644
    --- a/src/bench/bench_bitcoin.cpp
    +++ b/src/bench/bench_bitcoin.cpp
    @@ -3,19 +3,19 @@
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
     #include <bench/bench.h>
    -#include <common/args.h>
     #include <crypto/sha256.h>
    +#include <test/util/setup_common.h>
     #include <tinyformat.h>
     #include <util/fs.h>
    -#include <util/string.h>
    -#include <test/util/setup_common.h>
     
     #include <chrono>
     #include <cstdint>
     #include <cstdlib>
     #include <exception>
     #include <iostream>
    +#include <optional>
     #include <sstream>
    +#include <string>
     #include <vector>
     
     static const char* DEFAULT_BENCH_FILTER = ".*";
    diff --git a/src/bench/bip324_ecdh.cpp b/src/bench/bip324_ecdh.cpp
    index 65deb8b..c8d3a35 100644
    --- a/src/bench/bip324_ecdh.cpp
    +++ b/src/bench/bip324_ecdh.cpp
    @@ -11,6 +11,7 @@
     #include <algorithm>
     #include <array>
     #include <cstddef>
    +#include <span>
     
     static void BIP324_ECDH(benchmark::Bench& bench)
     {
    diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp
    index be03917..45603da 100644
    --- a/src/bench/block_assemble.cpp
    +++ b/src/bench/block_assemble.cpp
    @@ -18,7 +18,6 @@
     #include <cassert>
     #include <cstddef>
     #include <memory>
    -#include <string>
     #include <vector>
     
     using node::BlockCreateOptions;
    diff --git a/src/bench/blockencodings.cpp b/src/bench/blockencodings.cpp
    index ce968db..dec61e2 100644
    --- a/src/bench/blockencodings.cpp
    +++ b/src/bench/blockencodings.cpp
    @@ -2,20 +2,29 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
    -#include <bench/bench.h>
     #include <blockencodings.h>
    +
    +#include <bench/bench.h>
     #include <consensus/amount.h>
     #include <kernel/cs_main.h>
     #include <net_processing.h>
    +#include <primitives/block.h>
     #include <primitives/transaction.h>
    +#include <random.h>
     #include <script/script.h>
     #include <sync.h>
     #include <test/util/setup_common.h>
     #include <test/util/txmempool.h>
     #include <txmempool.h>
    +#include <uint256.h>
     #include <util/check.h>
     
    +#include <algorithm>
    +#include <array>
    +#include <cstddef>
     #include <memory>
    +#include <span>
    +#include <utility>
     #include <vector>
     
     
    diff --git a/src/bench/ccoins_caching.cpp b/src/bench/ccoins_caching.cpp
    index 12ea076..712c2ec 100644
    --- a/src/bench/ccoins_caching.cpp
    +++ b/src/bench/ccoins_caching.cpp
    @@ -5,6 +5,7 @@
     #include <bench/bench.h>
     #include <coins.h>
     #include <consensus/amount.h>
    +#include <consensus/validation.h>
     #include <key.h>
     #include <policy/policy.h>
     #include <primitives/transaction.h>
    @@ -13,6 +14,7 @@
     #include <test/util/transaction_utils.h>
     
     #include <cassert>
    +#include <span>
     #include <vector>
     
     // Microbenchmark for simple accesses to a CCoinsViewCache database. Note from
    diff --git a/src/bench/chacha20.cpp b/src/bench/chacha20.cpp
    index b5a333d..20a6a5d 100644
    --- a/src/bench/chacha20.cpp
    +++ b/src/bench/chacha20.cpp
    @@ -3,14 +3,14 @@
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
     
    -#include <bench/bench.h>
     #include <crypto/chacha20.h>
    +
    +#include <bench/bench.h>
     #include <crypto/chacha20poly1305.h>
    -#include <span.h>
    -#include <util/byte_units.h>
     
     #include <cstddef>
     #include <cstdint>
    +#include <span>
     #include <vector>
     
     /* Number of bytes to process per iteration */
    diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp
    index b943dc0..9ca9d81 100644
    --- a/src/bench/checkblock.cpp
    +++ b/src/bench/checkblock.cpp
    @@ -5,13 +5,17 @@
     #include <bench/bench.h>
     #include <bench/data/block413567.raw.h>
     #include <consensus/validation.h>
    +#include <kernel/chainparams.h>
     #include <primitives/block.h>
     #include <primitives/transaction.h>
    +#include <serialize.h>
     #include <streams.h>
     #include <validation.h>
     
     #include <cassert>
    -#include <cstddef>
    +#include <memory>
    +#include <span>
    +#include <vector>
     
     // These are the two major time-sinks which happen after we have fully received
     // a block off the wire, but before we can relay the block on to peers using
    diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp
    index 2c9126d..4e84f23 100644
    --- a/src/bench/checkqueue.cpp
    +++ b/src/bench/checkqueue.cpp
    @@ -2,8 +2,9 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
    -#include <bench/bench.h>
     #include <checkqueue.h>
    +
    +#include <bench/bench.h>
     #include <common/system.h>
     #include <key.h>
     #include <prevector.h>
    @@ -12,6 +13,7 @@
     
     #include <cstddef>
     #include <cstdint>
    +#include <optional>
     #include <utility>
     #include <vector>
     
    diff --git a/src/bench/cluster_linearize.cpp b/src/bench/cluster_linearize.cpp
    index 0799cc2..c755f84 100644
    --- a/src/bench/cluster_linearize.cpp
    +++ b/src/bench/cluster_linearize.cpp
    @@ -2,15 +2,21 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
    -#include <bench/bench.h>
     #include <cluster_linearize.h>
    +
    +#include <bench/bench.h>
    +#include <serialize.h>
    +#include <streams.h>
     #include <test/util/cluster_linearize.h>
    +#include <tinyformat.h>
     #include <util/bitset.h>
     #include <util/strencodings.h>
     
    -#include <algorithm>
     #include <cassert>
     #include <cstdint>
    +#include <span>
    +#include <string>
    +#include <tuple>
     #include <vector>
     
     using namespace cluster_linearize;
    diff --git a/src/bench/coin_selection.cpp b/src/bench/coin_selection.cpp
    index ff68272..597efd3 100644
    --- a/src/bench/coin_selection.cpp
    +++ b/src/bench/coin_selection.cpp
    @@ -4,8 +4,6 @@
     
     #include <bench/bench.h>
     #include <consensus/amount.h>
    -#include <interfaces/chain.h>
    -#include <node/context.h>
     #include <outputtype.h>
     #include <policy/feerate.h>
     #include <policy/policy.h>
    @@ -15,17 +13,19 @@
     #include <test/util/setup_common.h>
     #include <util/result.h>
     #include <wallet/coinselection.h>
    -#include <wallet/context.h>
    +#include <wallet/db.h>
     #include <wallet/spend.h>
     #include <wallet/test/util.h>
     #include <wallet/transaction.h>
     #include <wallet/wallet.h>
     
     #include <cassert>
    +#include <cstddef>
    +#include <cstdint>
     #include <map>
     #include <memory>
     #include <optional>
    -#include <set>
    +#include <string>
     #include <utility>
     #include <vector>
     
    diff --git a/src/bench/connectblock.cpp b/src/bench/connectblock.cpp
    index 0c7470b..40aada1 100644
    --- a/src/bench/connectblock.cpp
    +++ b/src/bench/connectblock.cpp
    @@ -23,7 +23,6 @@
     #include <cstddef>
     #include <memory>
     #include <optional>
    -#include <string>
     #include <utility>
     #include <vector>
     
    diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp
    index 666ff3c..e681ad0 100644
    --- a/src/bench/crypto_hash.cpp
    +++ b/src/bench/crypto_hash.cpp
    @@ -12,11 +12,12 @@
     #include <crypto/sha512.h>
     #include <crypto/siphash.h>
     #include <random.h>
    -#include <span.h>
     #include <tinyformat.h>
     #include <uint256.h>
     
     #include <cstdint>
    +#include <span>
    +#include <string>
     #include <vector>
     
     /* Number of bytes to hash per iteration */
    diff --git a/src/bench/disconnected_transactions.cpp b/src/bench/disconnected_transactions.cpp
    index 4dd5de4..fa5424c 100644
    --- a/src/bench/disconnected_transactions.cpp
    +++ b/src/bench/disconnected_transactions.cpp
    @@ -2,8 +2,9 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
    -#include <bench/bench.h>
     #include <kernel/disconnected_transactions.h>
    +
    +#include <bench/bench.h>
     #include <primitives/block.h>
     #include <primitives/transaction.h>
     #include <script/script.h>
    @@ -14,7 +15,6 @@
     #include <cstddef>
     #include <cstdint>
     #include <iterator>
    -#include <memory>
     #include <vector>
     
     constexpr size_t BLOCK_VTX_COUNT{4000};
    diff --git a/src/bench/ellswift.cpp b/src/bench/ellswift.cpp
    index 2daf1a9..36e9c16 100644
    --- a/src/bench/ellswift.cpp
    +++ b/src/bench/ellswift.cpp
    @@ -11,6 +11,7 @@
     
     #include <algorithm>
     #include <cassert>
    +#include <span>
     
     static void EllSwiftCreate(benchmark::Bench& bench)
     {
    diff --git a/src/bench/index_blockfilter.cpp b/src/bench/index_blockfilter.cpp
    index 781aa09..60b8e72 100644
    --- a/src/bench/index_blockfilter.cpp
    +++ b/src/bench/index_blockfilter.cpp
    @@ -13,17 +13,16 @@
     #include <primitives/transaction.h>
     #include <pubkey.h>
     #include <script/script.h>
    -#include <span.h>
     #include <sync.h>
     #include <test/util/setup_common.h>
     #include <test/util/time.h>
     #include <uint256.h>
     #include <util/strencodings.h>
    -#include <util/time.h>
     #include <validation.h>
     
     #include <cassert>
     #include <memory>
    +#include <span>
     #include <vector>
     
     using namespace util::hex_literals;
    diff --git a/src/bench/load_external.cpp b/src/bench/load_external.cpp
    index 8e7201e..77c229f 100644
    --- a/src/bench/load_external.cpp
    +++ b/src/bench/load_external.cpp
    @@ -7,7 +7,6 @@
     #include <chainparams.h>
     #include <flatfile.h>
     #include <node/blockstorage.h>
    -#include <span.h>
     #include <streams.h>
     #include <test/util/setup_common.h>
     #include <uint256.h>
    @@ -18,8 +17,8 @@
     #include <cstdio>
     #include <map>
     #include <memory>
    +#include <span>
     #include <stdexcept>
    -#include <vector>
     
     /**
      * The LoadExternalBlockFile() function is used during -reindex and -loadblock.
    diff --git a/src/bench/lockedpool.cpp b/src/bench/lockedpool.cpp
    index 61b35cc..16cbfa3 100644
    --- a/src/bench/lockedpool.cpp
    +++ b/src/bench/lockedpool.cpp
    @@ -2,12 +2,12 @@
    + echo '^^^ ⚠️ Failure generated from IWYU'
    + false
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
    -#include <bench/bench.h>
     #include <support/lockedpool.h>
     
    +#include <bench/bench.h>
    +
     #include <cstddef>
     #include <cstdint>
    -#include <util/byte_units.h>
     #include <vector>
     
     #define ASIZE 2048
    diff --git a/src/bench/mempool_ephemeral_spends.cpp b/src/bench/mempool_ephemeral_spends.cpp
    index 1c06928..f88643c 100644
    --- a/src/bench/mempool_ephemeral_spends.cpp
    +++ b/src/bench/mempool_ephemeral_spends.cpp
    @@ -4,9 +4,10 @@
     
     #include <bench/bench.h>
     #include <consensus/amount.h>
    +#include <consensus/validation.h>
     #include <kernel/cs_main.h>
     #include <policy/ephemeral_policy.h>
    -#include <policy/policy.h>
    +#include <policy/feerate.h>
     #include <primitives/transaction.h>
     #include <script/script.h>
     #include <sync.h>
    @@ -15,6 +16,7 @@
     #include <txmempool.h>
     #include <util/check.h>
     
    +#include <cstddef>
     #include <cstdint>
     #include <memory>
     #include <vector>
    diff --git a/src/bench/mempool_stress.cpp b/src/bench/mempool_stress.cpp
    index 1f58208..ab1146e 100644
    --- a/src/bench/mempool_stress.cpp
    +++ b/src/bench/mempool_stress.cpp
    @@ -4,7 +4,6 @@
     
     #include <bench/bench.h>
     #include <consensus/amount.h>
    -#include <policy/policy.h>
     #include <primitives/transaction.h>
     #include <random.h>
     #include <script/script.h>
    @@ -17,6 +16,7 @@
     #include <cstddef>
     #include <cstdint>
     #include <memory>
    +#include <optional>
     #include <vector>
     
     class CCoinsViewCache;
    diff --git a/src/bench/merkle_root.cpp b/src/bench/merkle_root.cpp
    index 17f7fa8..e3471c7 100644
    --- a/src/bench/merkle_root.cpp
    +++ b/src/bench/merkle_root.cpp
    @@ -8,6 +8,8 @@
     #include <uint256.h>
     
     #include <cassert>
    +#include <initializer_list>
    +#include <utility>
     #include <vector>
     
     static void MerkleRoot(benchmark::Bench& bench)
    diff --git a/src/bench/nanobench.h b/src/bench/nanobench.h
    index 79a384a..8d452c1 100644
    --- a/src/bench/nanobench.h
    +++ b/src/bench/nanobench.h
    @@ -39,13 +39,24 @@
     // public facing api - as minimal as possible
     ///////////////////////////////////////////////////////////////////////////////////////////////////
     
    -#include <chrono>        // high_resolution_clock
    -#include <cassert>       // assert
    -#include <cstring>       // memcpy
    -#include <iosfwd>        // for std::ostream* custom output target in Config
    -#include <string>        // all names
    +#include <sys/types.h>
    +
    +#include <cassert> // assert
    +#include <chrono>  // high_resolution_clock
    +#include <cmath>
    +#include <compare>
    +#include <cstdint>
    +#include <cstring> // memcpy
    +#include <functional>
    +#include <iterator>
    +#include <limits>
    +#include <locale>
    +#include <ratio>
    +#include <string> // all names
    +#include <type_traits>
     #include <unordered_map> // holds context information of results
    -#include <vector>        // holds all results
    +#include <utility>
    +#include <vector> // holds all results
     
     #define ANKERL_NANOBENCH(x) ANKERL_NANOBENCH_PRIVATE_##x()
     
    @@ -79,11 +90,12 @@
     #endif
     
     #if defined(ANKERL_NANOBENCH_LOG_ENABLED)
    -#    include <iostream>
    -#    define ANKERL_NANOBENCH_LOG(x)                                                 \
    -        do {                                                                        \
    -            std::cout << __FUNCTION__ << "@" << __LINE__ << ": " << x << std::endl; \
    -        } while (0)
    +#include <iostream>
    +
    +#define ANKERL_NANOBENCH_LOG(x)                                                 \
    +    do {                                                                        \
    +        std::cout << __FUNCTION__ << "@" << __LINE__ << ": " << x << std::endl; \
    +    } while (0)
     #else
     #    define ANKERL_NANOBENCH_LOG(x) \
             do {                        \
    @@ -133,9 +145,7 @@ namespace nanobench {
     using Clock = std::conditional<std::chrono::high_resolution_clock::is_steady, std::chrono::high_resolution_clock,
                                    std::chrono::steady_clock>::type;
     class Bench;
    -struct Config;
     class Result;
    -class Rng;
     class BigO;
     
     namespace detail {
    @@ -356,10 +366,6 @@ char const* json() noexcept;
     
     namespace detail {
     
    -template <typename T>
    -struct PerfCountSet;
    -
    -class IterationLogic;
     class PerformanceCounters;
     
     #if ANKERL_NANOBENCH(PERF_COUNTERS)
    @@ -1092,6 +1098,7 @@ public:
     
     private:
         struct Impl;
    +
         Impl* mPimpl;
     };
     ANKERL_NANOBENCH(IGNORE_EFFCPP_POP)
    @@ -1358,11 +1365,9 @@ void doNotOptimizeAway(T const& val) {
     // implementation part - only visible in .cpp
     ///////////////////////////////////////////////////////////////////////////////////////////////////
     
    -#    include <algorithm> // sort, reverse
    -#    include <atomic>    // compare_exchange_strong in loop overhead
    -#    include <cstdlib>   // getenv
    -#    include <cstring>   // strstr, strncmp
    -#    include <fstream>   // ifstream to parse proc files
    +#include <algorithm>     // sort, reverse
    +#include <cstdlib>       // getenv
    +#include <fstream>       // ifstream to parse proc files
     #    include <iomanip>   // setw, setprecision
     #    include <iostream>  // cout
     #    include <numeric>   // accumulate
    @@ -1383,28 +1388,6 @@ void doNotOptimizeAway(T const& val) {
     
     // declarations ///////////////////////////////////////////////////////////////////////////////////
     
    -namespace ankerl {
    -namespace nanobench {
    -
    -// helper stuff that is only intended to be used internally
    -namespace detail {
    -
    -struct TableInfo;
    -
    -// formatting utilities
    -namespace fmt {
    -
    -class NumSep;
    -class StreamStateRestorer;
    -class Number;
    -class MarkDownColumn;
    -class MarkDownCode;
    -
    -} // namespace fmt
    -} // namespace detail
    -} // namespace nanobench
    -} // namespace ankerl
    -
     // definitions ////////////////////////////////////////////////////////////////////////////////////
     
     namespace ankerl {
    diff --git a/src/bench/obfuscation.cpp b/src/bench/obfuscation.cpp
    index c7392e0..74ac192 100644
    --- a/src/bench/obfuscation.cpp
    +++ b/src/bench/obfuscation.cpp
    @@ -2,11 +2,13 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or [https://opensource.org/license/mit/.](https://opensource.org/license/mit/)
     
    +#include <util/obfuscation.h>
    +
     #include <bench/bench.h>
     #include <random.h>
    -#include <util/obfuscation.h>
     
     #include <cstddef>
    +#include <span>
     #include <vector>
     
     static void ObfuscationBench(benchmark::Bench& bench)
    diff --git a/src/bench/parse_hex.cpp b/src/bench/parse_hex.cpp
    index 928176b..6e55bb1 100644
    --- a/src/bench/parse_hex.cpp
    +++ b/src/bench/parse_hex.cpp
    @@ -9,6 +9,7 @@
     #include <cassert>
     #include <cstddef>
     #include <optional>
    +#include <string>
     #include <vector>
     
     std::string generateHexString(size_t length) {
    diff --git a/src/bench/peer_eviction.cpp b/src/bench/peer_eviction.cpp
    index 24b78e3..b9c1c9b 100644
    --- a/src/bench/peer_eviction.cpp
    +++ b/src/bench/peer_eviction.cpp
    @@ -7,8 +7,8 @@
     #include <node/eviction.h>
     #include <random.h>
     #include <test/util/net.h>
    +#include <util/time.h>
     
    -#include <chrono>
     #include <functional>
     #include <vector>
     
    diff --git a/src/bench/poly1305.cpp b/src/bench/poly1305.cpp
    index ef5a573..c58048b 100644
    --- a/src/bench/poly1305.cpp
    +++ b/src/bench/poly1305.cpp
    @@ -3,13 +3,13 @@
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
     
    -#include <bench/bench.h>
     #include <crypto/poly1305.h>
    -#include <span.h>
    -#include <util/byte_units.h>
    +
    +#include <bench/bench.h>
     
     #include <cstddef>
     #include <cstdint>
    +#include <span>
     #include <vector>
     
     /* Number of bytes to process per iteration */
    diff --git a/src/bench/pool.cpp b/src/bench/pool.cpp
    index cf4ba13..6f54506 100644
    --- a/src/bench/pool.cpp
    +++ b/src/bench/pool.cpp
    @@ -2,14 +2,16 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
    -#include <bench/bench.h>
     #include <support/allocators/pool.h>
     
    +#include <bench/bench.h>
    +
     #include <cstddef>
     #include <cstdint>
     #include <functional>
     #include <unordered_map>
     #include <utility>
    +#include <variant>
     
     template <typename Map>
     void BenchFillClearMap(benchmark::Bench& bench, Map& map)
    diff --git a/src/bench/prevector.cpp b/src/bench/prevector.cpp
    index e842aec..2b5544f 100644
    --- a/src/bench/prevector.cpp
    +++ b/src/bench/prevector.cpp
    @@ -9,6 +9,7 @@
     #include <serialize.h>
     #include <streams.h>
     
    +#include <span>
     #include <type_traits>
     #include <vector>
     
    diff --git a/src/bench/readwriteblock.cpp b/src/bench/readwriteblock.cpp
    index f1ad24a..5c2adff 100644
    --- a/src/bench/readwriteblock.cpp
    +++ b/src/bench/readwriteblock.cpp
    @@ -9,15 +9,16 @@
     #include <primitives/block.h>
     #include <primitives/transaction.h>
     #include <serialize.h>
    -#include <span.h>
     #include <streams.h>
    +#include <sync.h>
     #include <test/util/setup_common.h>
    +#include <uint256.h>
     #include <validation.h>
     
     #include <cassert>
    -#include <cstdint>
     #include <memory>
    -#include <vector>
    +#include <optional>
    +#include <span>
     
     static CBlock CreateTestBlock()
     {
    diff --git a/src/bench/rollingbloom.cpp b/src/bench/rollingbloom.cpp
    index 8331eb6..b4e985d 100644
    --- a/src/bench/rollingbloom.cpp
    +++ b/src/bench/rollingbloom.cpp
    @@ -6,9 +6,9 @@
     #include <bench/bench.h>
     #include <common/bloom.h>
     #include <crypto/common.h>
    -#include <span.h>
     
     #include <cstdint>
    +#include <span>
     #include <vector>
     
     static void RollingBloom(benchmark::Bench& bench)
    diff --git a/src/bench/rpc_blockchain.cpp b/src/bench/rpc_blockchain.cpp
    index fe83c4a..b09eae6 100644
    --- a/src/bench/rpc_blockchain.cpp
    +++ b/src/bench/rpc_blockchain.cpp
    @@ -5,21 +5,22 @@
     #include <bench/bench.h>
     #include <bench/data/block413567.raw.h>
     #include <chain.h>
    +#include <consensus/params.h>
     #include <core_io.h>
    +#include <kernel/chainparams.h>
     #include <primitives/block.h>
     #include <primitives/transaction.h>
     #include <rpc/blockchain.h>
     #include <serialize.h>
    -#include <span.h>
     #include <streams.h>
     #include <test/util/setup_common.h>
     #include <uint256.h>
     #include <univalue.h>
     #include <validation.h>
     
    -#include <cstddef>
     #include <memory>
    -#include <vector>
    +#include <span>
    +#include <string>
     
     namespace {
     
    diff --git a/src/bench/sign_transaction.cpp b/src/bench/sign_transaction.cpp
    index 63a5d97..83ec2a4 100644
    --- a/src/bench/sign_transaction.cpp
    +++ b/src/bench/sign_transaction.cpp
    @@ -8,17 +8,17 @@
     #include <key.h>
     #include <primitives/transaction.h>
     #include <pubkey.h>
    +#include <random.h>
     #include <script/interpreter.h>
     #include <script/script.h>
     #include <script/sign.h>
     #include <script/signingprovider.h>
    -#include <span.h>
    -#include <test/util/random.h>
     #include <uint256.h>
     #include <util/translation.h>
     
     #include <cassert>
     #include <map>
    +#include <span>
     #include <vector>
     
     enum class InputType {
    diff --git a/src/bench/streams_findbyte.cpp b/src/bench/streams_findbyte.cpp
    index c9ea486..41c261f 100644
    --- a/src/bench/streams_findbyte.cpp
    +++ b/src/bench/streams_findbyte.cpp
    @@ -7,9 +7,11 @@
     #include <test/util/setup_common.h>
     #include <util/fs.h>
     
    +#include <cassert>
     #include <cstddef>
     #include <cstdint>
     #include <cstdio>
    +#include <memory>
     
     static void FindByte(benchmark::Bench& bench)
     {
    diff --git a/src/bench/strencodings.cpp b/src/bench/strencodings.cpp
    index c00de18..4b52b74 100644
    --- a/src/bench/strencodings.cpp
    +++ b/src/bench/strencodings.cpp
    @@ -6,9 +6,10 @@
     #include <consensus/consensus.h>
     #include <crypto/hex_base.h>
     #include <random.h>
    -#include <span.h>
    -#include <util/strencodings.h>
     
    +#include <cstddef>
    +#include <span>
    +#include <string>
     #include <vector>
     
     static void HexStrBench(benchmark::Bench& bench)
    diff --git a/src/bench/txgraph.cpp b/src/bench/txgraph.cpp
    index c56a284..a172b8d 100644
    --- a/src/bench/txgraph.cpp
    +++ b/src/bench/txgraph.cpp
    @@ -2,13 +2,21 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
    +#include <txgraph.h>
    +
     #include <bench/bench.h>
     #include <random.h>
    -#include <txgraph.h>
     #include <util/feefrac.h>
     
    +#include <algorithm>
     #include <cassert>
    +#include <compare>
    +#include <cstddef>
     #include <cstdint>
    +#include <functional>
    +#include <memory>
    +#include <utility>
    +#include <vector>
     
     namespace {
     
    diff --git a/src/bench/txorphanage.cpp b/src/bench/txorphanage.cpp
    index 1f94553..d294dee 100644
    --- a/src/bench/txorphanage.cpp
    +++ b/src/bench/txorphanage.cpp
    @@ -2,20 +2,26 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or http://www.opensource.org/licenses/mit-license.php.
     
    +#include <node/txorphanage.h>
    +
     #include <bench/bench.h>
    -#include <consensus/amount.h>
    +#include <consensus/consensus.h>
    +#include <consensus/validation.h>
     #include <net.h>
     #include <policy/policy.h>
    +#include <primitives/block.h>
     #include <primitives/transaction.h>
    -#include <pubkey.h>
    -#include <script/sign.h>
    -#include <test/util/setup_common.h>
    -#include <node/txorphanage.h>
    -#include <util/check.h>
    +#include <random.h>
     #include <test/util/transaction_utils.h>
    +#include <threadsafety.h>
    +#include <util/check.h>
     
    +#include <algorithm>
    +#include <cstddef>
     #include <cstdint>
     #include <memory>
    +#include <numeric>
    +#include <vector>
     
     static constexpr node::TxOrphanage::Usage TINY_TX_WEIGHT{240};
     static constexpr int64_t APPROX_WEIGHT_PER_INPUT{200};
    diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp
    index 63a9544..a559e8c 100644
    --- a/src/bench/verify_script.cpp
    +++ b/src/bench/verify_script.cpp
    @@ -11,14 +11,19 @@
     #include <pubkey.h>
     #include <script/interpreter.h>
     #include <script/script.h>
    +#include <script/script_error.h>
    +#include <script/sign.h>
    +#include <script/signingprovider.h>
    +#include <script/verify_flags.h>
     #include <span.h>
     #include <test/util/transaction_utils.h>
     #include <uint256.h>
     #include <util/translation.h>
     
    -#include <array>
     #include <cassert>
    -#include <cstdint>
    +#include <cstddef>
    +#include <map>
    +#include <span>
     #include <vector>
     
     enum class ScriptType {
    diff --git a/src/bench/wallet_balance.cpp b/src/bench/wallet_balance.cpp
    index dd04a5c..777f045 100644
    --- a/src/bench/wallet_balance.cpp
    +++ b/src/bench/wallet_balance.cpp
    @@ -4,6 +4,7 @@
     
     #include <bench/bench.h>
     #include <interfaces/chain.h>
    +#include <interfaces/handler.h>
     #include <kernel/chainparams.h>
     #include <primitives/block.h>
     #include <primitives/transaction.h>
    @@ -12,8 +13,8 @@
     #include <test/util/setup_common.h>
     #include <test/util/time.h>
     #include <uint256.h>
    -#include <util/time.h>
     #include <validation.h>
    +#include <wallet/db.h>
     #include <wallet/receive.h>
     #include <wallet/test/util.h>
     #include <wallet/wallet.h>
    diff --git a/src/bench/wallet_create.cpp b/src/bench/wallet_create.cpp
    index 11244fe..3770289 100644
    --- a/src/bench/wallet_create.cpp
    +++ b/src/bench/wallet_create.cpp
    @@ -4,7 +4,6 @@
     
     #include <bench/bench.h>
     #include <random.h>
    -#include <support/allocators/secure.h>
     #include <test/util/setup_common.h>
     #include <uint256.h>
     #include <util/fs.h>
    diff --git a/src/bench/wallet_create_tx.cpp b/src/bench/wallet_create_tx.cpp
    index 68bbc3d..a259988 100644
    --- a/src/bench/wallet_create_tx.cpp
    +++ b/src/bench/wallet_create_tx.cpp
    @@ -9,7 +9,6 @@
     #include <consensus/amount.h>
     #include <consensus/consensus.h>
     #include <consensus/merkle.h>
    -#include <interfaces/chain.h>
     #include <kernel/chain.h>
     #include <kernel/types.h>
     #include <node/blockstorage.h>
    @@ -23,13 +22,14 @@
     #include <test/util/time.h>
     #include <uint256.h>
     #include <util/result.h>
    -#include <util/time.h>
     #include <validation.h>
     #include <versionbits.h>
     #include <wallet/coincontrol.h>
     #include <wallet/coinselection.h>
    +#include <wallet/db.h>
     #include <wallet/spend.h>
     #include <wallet/test/util.h>
    +#include <wallet/types.h>
     #include <wallet/wallet.h>
     #include <wallet/walletutil.h>
     
    @@ -38,6 +38,7 @@
     #include <map>
     #include <memory>
     #include <optional>
    +#include <string>
     #include <utility>
     #include <vector>
     
    diff --git a/src/bench/wallet_encrypt.cpp b/src/bench/wallet_encrypt.cpp
    index 5864601..81e64a2 100644
    --- a/src/bench/wallet_encrypt.cpp
    +++ b/src/bench/wallet_encrypt.cpp
    @@ -3,19 +3,29 @@
     // file COPYING or https://www.opensource.org/licenses/mit-license.php.
     
     #include <bench/bench.h>
    +#include <key.h>
     #include <key_io.h>
    -#include <outputtype.h>
     #include <random.h>
    +#include <script/descriptor.h>
    +#include <script/signingprovider.h>
     #include <support/allocators/secure.h>
    +#include <sync.h>
     #include <test/util/setup_common.h>
     #include <test/util/time.h>
    -#include <util/time.h>
    +#include <util/check.h>
     #include <wallet/context.h>
    +#include <wallet/crypter.h>
    +#include <wallet/db.h>
     #include <wallet/test/util.h>
     #include <wallet/wallet.h>
     #include <wallet/walletutil.h>
     
    -#include <cassert>
    +#include <cstdint>
    +#include <functional>
    +#include <memory>
    +#include <string>
    +#include <utility>
    +#include <vector>
     
     namespace wallet {
     static void WalletEncrypt(benchmark::Bench& bench, unsigned int key_count)
    diff --git a/src/bench/wallet_ismine.cpp b/src/bench/wallet_ismine.cpp
    index 6bfbb42..572a271 100644
    --- a/src/bench/wallet_ismine.cpp
    +++ b/src/bench/wallet_ismine.cpp
    @@ -11,17 +11,19 @@
     #include <script/signingprovider.h>
     #include <sync.h>
     #include <test/util/setup_common.h>
    +#include <util/check.h>
     #include <wallet/context.h>
     #include <wallet/db.h>
     #include <wallet/test/util.h>
     #include <wallet/wallet.h>
     #include <wallet/walletutil.h>
     
    -#include <cassert>
     #include <cstdint>
    +#include <functional>
     #include <memory>
     #include <string>
     #include <utility>
    +#include <vector>
     
     namespace wallet {
     static void WalletIsMine(benchmark::Bench& bench, int num_combo = 0)
    diff --git a/src/bench/wallet_loading.cpp b/src/bench/wallet_loading.cpp
    index 09028ac..6b1208e 100644
    --- a/src/bench/wallet_loading.cpp
    +++ b/src/bench/wallet_loading.cpp
    @@ -7,8 +7,10 @@
     #include <consensus/amount.h>
     #include <outputtype.h>
     #include <primitives/transaction.h>
    +#include <script/script.h>
     #include <test/util/setup_common.h>
     #include <util/check.h>
    +#include <util/translation.h>
     #include <wallet/context.h>
     #include <wallet/db.h>
     #include <wallet/test/util.h>
    @@ -18,6 +20,8 @@
     
     #include <cstdint>
     #include <memory>
    +#include <optional>
    +#include <string>
     #include <utility>
     #include <vector>
     
    diff --git a/src/bench/wallet_migration.cpp b/src/bench/wallet_migration.cpp
    index 578fdb5..22caec7 100644
    --- a/src/bench/wallet_migration.cpp
    +++ b/src/bench/wallet_migration.cpp
    @@ -2,20 +2,34 @@
     // Distributed under the MIT software license, see the accompanying
     // file COPYING or https://www.opensource.org/licenses/mit-license.php.
     
    +#include <addresstype.h>
     #include <bench/bench.h>
    -#include <interfaces/chain.h>
    +#include <consensus/amount.h>
     #include <interfaces/wallet.h>
    -#include <kernel/chain.h>
    -#include <kernel/types.h>
    -#include <node/context.h>
    -#include <test/util/mining.h>
    +#include <key.h>
    +#include <primitives/block.h>
    +#include <primitives/transaction.h>
    +#include <pubkey.h>
    +#include <script/script.h>
    +#include <sync.h>
     #include <test/util/setup_common.h>
    -#include <wallet/context.h>
    -#include <wallet/receive.h>
    +#include <tinyformat.h>
    +#include <util/check.h>
    +#include <util/result.h>
    +#include <wallet/db.h>
    +#include <wallet/scriptpubkeyman.h>
     #include <wallet/test/util.h>
    +#include <wallet/transaction.h>
     #include <wallet/wallet.h>
    +#include <wallet/walletdb.h>
     
    +#include <algorithm>
    +#include <cstddef>
    +#include <memory>
     #include <optional>
    +#include <string>
    +#include <utility>
    +#include <vector>
     
     namespace wallet{
     
    diff --git a/src/prevector.h b/src/prevector.h
    index 91be488..e8a71bc 100644
    --- a/src/prevector.h
    +++ b/src/prevector.h
    @@ -7,11 +7,11 @@
     
     #include <algorithm>
     #include <cassert>
    -#include <cstddef>
     #include <cstdint>
     #include <cstdlib>
     #include <cstring>
     #include <iterator>
    +#include <new>
     #include <type_traits>
     #include <utility>
    

    </details

  24. fanquake merged this on Jun 15, 2026
  25. fanquake closed this on Jun 15, 2026

  26. hebasto deleted the branch on Jun 15, 2026
  27. hebasto commented at 1:56 PM on June 15, 2026: member

    I'm afraid there was a silent merge conflict with #35101.

    Let's wait for the CI in the master branch: https://github.com/bitcoin/bitcoin/actions/runs/27548580113/job/81428406546.

  28. fanquake referenced this in commit d92a20b310 on Jun 15, 2026
  29. fanquake referenced this in commit f655d887f0 on Jun 15, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-06-21 02:51 UTC

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