From ae8239641978ed59d5d781a04ddfb6bde6470a2c Mon Sep 17 00:00:00 2001 From: merge-script Date: Fri, 22 May 2026 11:09:26 +0100 Subject: [PATCH 01/10] Merge bitcoin/bitcoin#34801: ci: Enable pipefail in 03_test_script.sh fa99a3ccacead02c26ea74c0e12cd845c4dafb91 ci: Enable pipefail in 03_test_script.sh (MarcoFalke) Pull request description: The CI script is problematic, because it is written in Bash, without pipefail enabled. Thus, some failures are silently ignored. Enabling pipefail is a bit tedious, because: * The IWYU task has no (`--verbose`) ccache output, so the pipe fails after `grep` [1]. Also, right now on master, the if silently skips: `ci/test/03_test_script.sh: line 122: [: : integer expression expected`. * The Alpine task has `Hits:` twice in the output, so the pipe fails after `head -1` [2] Not sure what the easiest way to fix this would be. Some options are: * Just use `tail -1` and `0` as fallback: `hit_rate=$(ccache --show-stats | grep "Hits:" | tail -1 | sed 's/.*(\(.*\)%).*/\1/' || echo "0")` * Properly parse, using Python and `--print-stats` (this pull) [1] ``` + ccache --version + head -n 1 ccache version 4.11.2 + ccache --show-stats --verbose Cache directory: /home/admin/actions-runner/_work/_temp/ccache_dir Config file: /home/admin/actions-runner/_work/_temp/ccache_dir/ccache.conf System config file: /etc/ccache.conf Stats updated: Tue Feb 17 08:40:20 2026 Local storage: Cache size (GB): 0.0 / 2.0 ( 0.00%) Files: 0 Hits: 0 Misses: 0 Reads: 0 Writes: 0 ++ ccache --show-stats ++ grep Hits: ++ head -1 ++ sed 's/.*(\(.*\)%).*/\1/' + hit_rate= Command '['docker', 'exec', '--env', 'DANGER_RUN_CI_ON_HOST=1', 'f5e8f319c22101ada5be9d4c5fd7d883ce37b830e86ec64627cb7d2b96749053', '/home/admin/actions-runner/_work/_temp/ci/test/03_test_script.sh']' returned non-zero exit status 1. Error: Process completed with exit code 1. ``` [2] ``` + ccache --version + head -n 1 ccache version 4.12.1 + ccache --show-stats --verbose Cache directory: /home/admin/actions-runner/_work/_temp/ccache_dir Config file: /home/admin/actions-runner/_work/_temp/ccache_dir/ccache.conf System config file: /etc/ccache.conf Stats updated: Tue Feb 17 08:40:35 2026 Cacheable calls: 873 / 873 (100.0%) Hits: 846 / 873 (96.91%) Direct: 822 / 846 (97.16%) Preprocessed: 24 / 846 ( 2.84%) Misses: 27 / 873 ( 3.09%) Successful lookups: Direct: 822 / 873 (94.16%) Preprocessed: 24 / 51 (47.06%) Local storage: Cache size (GB): 2.0 / 2.0 (99.95%) Files: 2580 Cleanups: 13 Hits: 846 / 873 (96.91%) Misses: 27 / 873 ( 3.09%) Reads: 1772 Writes: 52 ++ ccache --show-stats ++ grep Hits: ++ head -1 ++ sed 's/.*(\(.*\)%).*/\1/' + hit_rate=96.91 Command '['docker', 'exec', '--env', 'DANGER_RUN_CI_ON_HOST=1', '272a66a48206f1f6096612e196127ce46ea4dbff5dc14be3a4a20c4ee523956f', '/home/admin/actions-runner/_work/_temp/ci/test/03_test_script.sh']' returned non-zero exit status 141. Error: Process completed with exit code 1. ``` ACKs for top commit: willcl-ark: ACK fa99a3ccacead02c26ea74c0e12cd845c4dafb91 Tree-SHA512: e5b0ddad8f279bd48102543b0496fa2ecdfc6938d208078595a60b96680467a80504b21acdecd86204b82ce2770eede23e498f04c6a9cee59634f83d44cfe094 (cherry picked from commit 59918de329ae8773080e1a9f72ee6c1eb7b22a0a) --- ci/test/03_test_script.sh | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index fd794b512cd4..9dfbbb0e5f5f 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -6,7 +6,7 @@ export LC_ALL=C.UTF-8 -set -o errexit -o xtrace +set -o errexit -o xtrace -o pipefail if [ "${DANGER_RUN_CI_ON_HOST}" != "1" ]; then echo "This script will make unsafe local and global modifications, so it can only be run inside a container and requires DANGER_RUN_CI_ON_HOST=1" @@ -136,10 +136,30 @@ cmake --build "${BASE_BUILD_DIR}" "$MAKEJOBS" --target $GOAL || ( ) ccache --version | head -n 1 && ccache --show-stats --verbose -hit_rate=$(ccache --show-stats | grep "Hits:" | head -1 | sed 's/.*(\(.*\)%).*/\1/') -if [ "${hit_rate%.*}" -lt 75 ]; then - echo "::notice title=low ccache hitrate::Ccache hit-rate in $CONTAINER_NAME was $hit_rate%" -fi +ccache --print-stats | python3 -c ' +import os +import sys + +for line in sys.stdin: + key, value = line.split("\t", 1) + # "primary storage" fallback only needed for ccache version 4.5.1 + if key in ("local_storage_hit", "primary_storage_hit"): + hits = int(value) + elif key in ("local_storage_miss", "primary_storage_miss"): + miss = int(value) + +calls = hits + miss +# codegen has no calls, so skip that here +if calls: + rate = (hits / calls * 100) + print(f"{rate:.2f}") + if rate < 75: + container = os.environ["CONTAINER_NAME"] + print( + "::notice title=low ccache hitrate::" + f"Ccache hit-rate in {container} was {rate:.2f}%" + ) +' du -sh "${DEPENDS_DIR}"/*/ du -sh "${PREVIOUS_RELEASES_DIR}" @@ -191,12 +211,14 @@ if [[ "${RUN_IWYU}" == true ]]; then run_iwyu() { mv "${BASE_BUILD_DIR}/$1" "${BASE_BUILD_DIR}/compile_commands.json" - python3 "/include-what-you-use/iwyu_tool.py" \ + { + python3 "/include-what-you-use/iwyu_tool.py" \ -p "${BASE_BUILD_DIR}" "${MAKEJOBS}" \ -- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \ -Xiwyu --max_line_length=160 \ -Xiwyu --check_also="*/primitives/*.h" \ - 2>&1 | tee /tmp/iwyu_ci.out + 2>&1 || true + } | tee /tmp/iwyu_ci.out python3 "/include-what-you-use/fix_includes.py" --nosafe_headers < /tmp/iwyu_ci.out git diff -U1 | ./contrib/devtools/clang-format-diff.py -binary="clang-format-${IWYU_LLVM_V}" -p1 -i -v } From 4c0d1b3e58cbee79bb58859ea11b4afe56401f41 Mon Sep 17 00:00:00 2001 From: merge-script Date: Sat, 23 May 2026 13:11:28 +0200 Subject: [PATCH 02/10] Merge bitcoin/bitcoin#35141: fuzz: apply node context reset pattern to p2p_handshake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dfe5d6a81dc39fb1a5a26490e931a04874c2360d fuzz: apply node context reset pattern to p2p_handshake (frankomosh) Pull request description: Follow-up to #34302. Applies the node context reset pattern from fabf8d1 to `p2p_handshake`. Previous code pattern created local `AddrMan` and `node::Warnings` objects, and passed them to `PeerManager::make`. `connman` was left holding a dangling `reference_wrapper` across iterations, since the local objects destruct at iteration end while `connman` is global. Like in fabf8d1 , reset and reinstall `node.addrman` and `node.peerman` on each iteration. This PR also removes `includes` made unused by this or prior refactors. ACKs for top commit: nervana21: tACK dfe5d6a81dc39fb1a5a26490e931a04874c2360d maflcko: review ACK dfe5d6a81dc39fb1a5a26490e931a04874c2360d 🦏 sedited: ACK dfe5d6a81dc39fb1a5a26490e931a04874c2360d Tree-SHA512: 141ddec03c6d37f76a3b2d94701d18c851e85ea74e57716abb69ecc955d30371e342c6e267d2669ad853fe2d95fb77dd2fb506e4233ae3a88501d59ee1bbae30 (cherry picked from commit de925455c8025fc1f75d65d981c28b9dfa20e9f7) --- src/test/fuzz/p2p_handshake.cpp | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/test/fuzz/p2p_handshake.cpp b/src/test/fuzz/p2p_handshake.cpp index 421aacd86671..85b18476f1e1 100644 --- a/src/test/fuzz/p2p_handshake.cpp +++ b/src/test/fuzz/p2p_handshake.cpp @@ -2,19 +2,15 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include -#include +#include #include #include -#include #include -#include