From 3070c3e388daaa00bbfb873820957c105f3e6998 Mon Sep 17 00:00:00 2001 From: merge-script Date: Tue, 14 May 2024 11:47:09 +0800 Subject: [PATCH 01/23] Merge bitcoin/bitcoin#30078: depends: set AR & RANLIB for CMake 019ad7327c397094d7648b55503bf5373b108a57 depends: set RANLIB for CMake (fanquake) 43cfb428cba04b8db98d4d0d56ffe28ad686e58c depends: set NM for CMake (fanquake) 1e4412b317f74dd64069309544fe73c95e2c10e7 depends: set AR for CMake (fanquake) Pull request description: Needed for #21778. Should be more correct in any case. ACKs for top commit: theuni: utACK 019ad7327c397094d7648b55503bf5373b108a57. I didn't test, but I tried this approach on a few deps and it seemed to work as expected. TheCharlatan: ACK 019ad7327c397094d7648b55503bf5373b108a57 Tree-SHA512: 78cc8981456f7476cafca0e40fcc569e474b92004c8024d1c4268b6aab53175074a06ab17ebded8d706bf0a7f77401642dd38bb7ce2e4b04abdcd149d3d69969 --- depends/funcs.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/depends/funcs.mk b/depends/funcs.mk index 76b205ae6d..87f25ba4fc 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -181,6 +181,9 @@ $(1)_cmake=env CC="$$($(1)_cc)" \ CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \ LDFLAGS="$$($(1)_ldflags)" \ cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" \ + -DCMAKE_AR=`which $$($(1)_ar)` \ + -DCMAKE_NM=`which $$($(1)_nm)` \ + -DCMAKE_RANLIB=`which $$($(1)_ranlib)` \ -DCMAKE_INSTALL_LIBDIR=lib/ \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ $$($(1)_config_opts) From 3be0d3e5cdd6dd3dd0acbe3d95518469a59a089a Mon Sep 17 00:00:00 2001 From: merge-script Date: Thu, 16 May 2024 08:40:34 +0800 Subject: [PATCH 02/23] Merge bitcoin/bitcoin#30097: crypto: disable asan for sha256_sse4 with clang and -O0 141df0a28810470e53fdbc6d32d3cb4020fe3ca1 crypto: disable asan for sha256_sse4 with clang and -O0 (Cory Fields) Pull request description: Clang is unable to compile the Transform function for that combination of options. Fixes #29801. ACKs for top commit: achow101: ACK 141df0a28810470e53fdbc6d32d3cb4020fe3ca1 Tree-SHA512: d74fdac5840ad7524edfde069fb43ae75c31146e90ecc58bbc7912ff57a02b068547431b1766afeed782272c0b93b0b41a286c1cf26ec55ce332d94ce917d810 --- src/crypto/sha256_sse4.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/crypto/sha256_sse4.cpp b/src/crypto/sha256_sse4.cpp index 143752c7cf..6504a1f12e 100644 --- a/src/crypto/sha256_sse4.cpp +++ b/src/crypto/sha256_sse4.cpp @@ -13,6 +13,13 @@ namespace sha256_sse4 { void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks) +#if defined(__clang__) && !defined(__OPTIMIZE__) + /* + clang is unable to compile this with -O0 and -fsanitize=address. + See upstream bug: https://github.com/llvm/llvm-project/issues/92182 + */ + __attribute__((no_sanitize("address"))) +#endif { static const uint32_t K256 alignas(16) [] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, From 63e139d11b3eaf3ece0a8d52a42bf65de36b3915 Mon Sep 17 00:00:00 2001 From: merge-script Date: Wed, 5 Jun 2024 11:40:47 +0100 Subject: [PATCH 03/23] Merge bitcoin/bitcoin#30185: guix: show `*_FLAGS` variables in pre-build output 5f2c1d84e37697f4f8a20e3c12f37bba71b3c2a6 guix: show *_FLAGS variables in pre-build output (fanquake) Pull request description: For example: ```bash # ADDITIONAL_GUIX_COMMON_FLAGS set in the ENV ADDITIONAL_GUIX_ENVIRONMENT_FLAGS="--emulate-fhs" ./contrib/guix/guix-build INFO: Building f751991 for platform triple x86_64-linux-gnu: ...using reference timestamp: 1716905119 ...running at most 10 jobs ...from worktree directory: '/bitcoin' ...bind-mounted in container to: '/bitcoin' ...in build directory: '/bitcoin/guix-build-f75199182133/distsrc-f75199182133-x86_64-linux-gnu' ...bind-mounted in container to: '/distsrc-base/distsrc-f75199182133-x86_64-linux-gnu' ...outputting in: '/bitcoin/guix-build-f75199182133/output/x86_64-linux-gnu' ...bind-mounted in container to: '/outdir-base/x86_64-linux-gnu' ADDITIONAL FLAGS (if set) ADDITIONAL_GUIX_COMMON_FLAGS: --no-substitutes ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: --emulate-fhs ADDITIONAL_GUIX_TIMEMACHINE_FLAGS: ``` ACKs for top commit: hebasto: ACK 5f2c1d84e37697f4f8a20e3c12f37bba71b3c2a6. Tree-SHA512: 85a6d508499b4ec1d6166343a1707b682d327b2fcfb2fb438571894478aac0062d21e1239b5092091ff98711c5c747151973c4f325a7a7c447d0e807166fcb07 --- contrib/guix/guix-build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build index 2dd61b4dbd..227e1cf644 100755 --- a/contrib/guix/guix-build +++ b/contrib/guix/guix-build @@ -360,6 +360,10 @@ INFO: Building ${VERSION:?not set} for platform triple ${HOST:?not set}: ...bind-mounted in container to: '$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")' ...outputting in: '$(outdir_for_host "$HOST")' ...bind-mounted in container to: '$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")' + ADDITIONAL FLAGS (if set) + ADDITIONAL_GUIX_COMMON_FLAGS: ${ADDITIONAL_GUIX_COMMON_FLAGS} + ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} + ADDITIONAL_GUIX_TIMEMACHINE_FLAGS: ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} EOF # Run the build script 'contrib/guix/libexec/build.sh' in the build From ca83773854943c6ab3499128a21b9ab099ac3ffc Mon Sep 17 00:00:00 2001 From: merge-script Date: Wed, 19 Jun 2024 10:06:59 +0100 Subject: [PATCH 04/23] Merge bitcoin/bitcoin#30283: upnp: fix build with miniupnpc 2.2.8 8acdf66540834b9f9cf28f16d389e8b6a48516d5 upnp: add compatibility for miniupnpc 2.2.8 (Cory Fields) Pull request description: Fixes https://github.com/bitcoin/bitcoin/issues/30266 Miniupnpc 2.2.8 [changed the function signature of `UPNP_GetValidIGD`](https://github.com/miniupnp/miniupnp/commit/c0a50ce33e3b99ce8a96fd43049bb5b53ffac62f#diff-5a0d7cff00628c2c64a617edb347c0f283e3a75e7df910e7e8438fc6db23f610R122) without taking much care with the abi :( ~This is the minimal change to cope with that. Also included in this PR is a temporary bump to 2.2.8 to verify that it builds correctly. I'm happy to revert that and discuss the bump separately, as miniupnpc bumps require some scrutiny.~ I believe that this is problematic if we build against one version and encounter a different one at runtime. This is not a problem for depends because we build statically. But for users who are self-building against shared system libs, care must be taken to run against the same version used for linking. Some quick digging shows that at least Ubuntu/Arch make the distinction between soversions: `libminiupnpc.so.17` -> `libminiupnpc.so.18`. So in practice, I suppose this shouldn't be much of a problem. Boooo for the upstream loose abi policy. ACKs for top commit: edilmedeiros: reACK 8acdf66540834b9f9cf28f16d389e8b6a48516d5 fanquake: ACK 8acdf66540834b9f9cf28f16d389e8b6a48516d5 Tree-SHA512: d2236ec8aef57a5c879065fbbe20080a14e4bf7b44c0bf506707eb946f72aa5837aba2fb2426d6853d21a9b77db5d72561d29d7ea645714d90309e11fe11d354 --- src/mapport.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mapport.cpp b/src/mapport.cpp index 62a3d73ec2..ecdbcdff12 100644 --- a/src/mapport.cpp +++ b/src/mapport.cpp @@ -167,8 +167,11 @@ static bool ProcessUpnp() struct UPNPUrls urls; struct IGDdatas data; int r; - +#if MINIUPNPC_API_VERSION <= 17 r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr)); +#else + r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), nullptr, 0); +#endif if (r == 1) { if (fDiscover) { From 479cb8bcb839469d89170a02e620eec6bc1c9e97 Mon Sep 17 00:00:00 2001 From: merge-script Date: Wed, 26 Jun 2024 10:27:44 +0100 Subject: [PATCH 05/23] Merge bitcoin/bitcoin#30312: contrib: add R(UN)PATH check to ELF symbol-check 4289dd02cce688a69c596f7cd5e47f831b00aa1b contrib: add R(UN)PATH check to ELF symbol-check (fanquake) Pull request description: Our binaries shouldn't contain any rpaths, or runpaths, so check that at release time. Guix build (aarch64): ```bash 14f1b54936f71aaf8fedb987e1c2f5642c34ac35f4856cdbd7bf7b4a9f42507c guix-build-4289dd02cce6/output/aarch64-linux-gnu/SHA256SUMS.part b120503ac4a37c160aa1bdc662348a2a662cb9b3d0477daa177e92afacab6a27 guix-build-4289dd02cce6/output/aarch64-linux-gnu/bitcoin-4289dd02cce6-aarch64-linux-gnu-debug.tar.gz 6416e3678aa13301ba2327e65dcd83afefd15d21c96c1b574cf616a65466a260 guix-build-4289dd02cce6/output/aarch64-linux-gnu/bitcoin-4289dd02cce6-aarch64-linux-gnu.tar.gz b7f11fa4abc034b32c208a9d642a0cafc0de693d49c8f3b28d1cf2d318af6826 guix-build-4289dd02cce6/output/arm-linux-gnueabihf/SHA256SUMS.part 7cf6269025b10bc5ad65cd98baba68b4b65d3caabcd4d62e7af892bbb16c253f guix-build-4289dd02cce6/output/arm-linux-gnueabihf/bitcoin-4289dd02cce6-arm-linux-gnueabihf-debug.tar.gz c136665417cc1f9254f4541c1161ea6d24d2325e4baa2dd4a306f67a1edf9c20 guix-build-4289dd02cce6/output/arm-linux-gnueabihf/bitcoin-4289dd02cce6-arm-linux-gnueabihf.tar.gz 37dd0359e073cbb38dcd6e17953d31e414ce27516c31b18ef6aa1bc9530dbed2 guix-build-4289dd02cce6/output/arm64-apple-darwin/SHA256SUMS.part 3d01f5db06e1b1cbebc5a5a4277ad3da8911afe35e111d4650e2beee6038cfdb guix-build-4289dd02cce6/output/arm64-apple-darwin/bitcoin-4289dd02cce6-arm64-apple-darwin-unsigned.tar.gz 9d8ad7cbdc1e154b33c138de21e7a0ffc8a8857b522db9272c70d5c10732460c guix-build-4289dd02cce6/output/arm64-apple-darwin/bitcoin-4289dd02cce6-arm64-apple-darwin-unsigned.zip 23f14eeaeac2e881e41543a796dfa65f132e89153281f9fbcb8019d08fff7eb2 guix-build-4289dd02cce6/output/arm64-apple-darwin/bitcoin-4289dd02cce6-arm64-apple-darwin.tar.gz b62d9e202e5414ebefe129e733beaee76b4f9b05a7dd20807fbbdbe24f27f692 guix-build-4289dd02cce6/output/dist-archive/bitcoin-4289dd02cce6.tar.gz 1301b33745b9016bbb7f038ee2004f630244deaa6575b6c75391cda2d8d3455d guix-build-4289dd02cce6/output/powerpc64-linux-gnu/SHA256SUMS.part 54e988c3d3fc204d4b232dcf24df8a80733c46e3adf9ea0c81a1637609fc1131 guix-build-4289dd02cce6/output/powerpc64-linux-gnu/bitcoin-4289dd02cce6-powerpc64-linux-gnu-debug.tar.gz 6acb3348d67d3e96a6f3a6e782ae088532b75d4b38cbfe249e114e07eafefdb6 guix-build-4289dd02cce6/output/powerpc64-linux-gnu/bitcoin-4289dd02cce6-powerpc64-linux-gnu.tar.gz cc30cfe72eefa498f347d825c57a19501d0c24330d2b4bcdfa432cf7a17880e8 guix-build-4289dd02cce6/output/riscv64-linux-gnu/SHA256SUMS.part a56144f8a816c6b62970c29d6c805fe7d26c4d1171e96379e1e6a53c7cb504f6 guix-build-4289dd02cce6/output/riscv64-linux-gnu/bitcoin-4289dd02cce6-riscv64-linux-gnu-debug.tar.gz 7d67eac59846d478b5ecefa1396d3214c2f9b394ec4de4c099b2b2304750e13e guix-build-4289dd02cce6/output/riscv64-linux-gnu/bitcoin-4289dd02cce6-riscv64-linux-gnu.tar.gz 2d1b1ec32f566ad37b7fb6e2d8b150389c0d02013fc99b12e9e93cb938cfdbc7 guix-build-4289dd02cce6/output/x86_64-apple-darwin/SHA256SUMS.part 1bb7a360974cc839499f82cf00dc6e59c3584a3094382086217eacb97b6da931 guix-build-4289dd02cce6/output/x86_64-apple-darwin/bitcoin-4289dd02cce6-x86_64-apple-darwin-unsigned.tar.gz 821a1587e285a8514a9f2ed9bec7d422e91d5f1db3cbb9e4c5ce4467298e692f guix-build-4289dd02cce6/output/x86_64-apple-darwin/bitcoin-4289dd02cce6-x86_64-apple-darwin-unsigned.zip 15956787628f5014adc53fe98fc995c56424c8e6c1e698283f65099751a61dbd guix-build-4289dd02cce6/output/x86_64-apple-darwin/bitcoin-4289dd02cce6-x86_64-apple-darwin.tar.gz 76e8a8275f27a5d2b4eb29c0440c5dfbecb0d9348362ff7defe989820d5ec80b guix-build-4289dd02cce6/output/x86_64-linux-gnu/SHA256SUMS.part 3c8b19f1a130ebb12a1ca4103fa283e71d909f09da5cef8047db1e7e7dfea162 guix-build-4289dd02cce6/output/x86_64-linux-gnu/bitcoin-4289dd02cce6-x86_64-linux-gnu-debug.tar.gz 87b3735cda595556e8adfd4de5c9cc966e9996cdb76b8f9dfa8c978d37397d40 guix-build-4289dd02cce6/output/x86_64-linux-gnu/bitcoin-4289dd02cce6-x86_64-linux-gnu.tar.gz fc535f76e6323fb0feeeee790865d0d2c8ea9d2c85d72a620acfb83546fb7628 guix-build-4289dd02cce6/output/x86_64-w64-mingw32/SHA256SUMS.part 9fd5d3b4e91fa8c4d137c9f8d2089c81f4c4165bb6ab9a404b163f7b363587fd guix-build-4289dd02cce6/output/x86_64-w64-mingw32/bitcoin-4289dd02cce6-win64-debug.zip b4658cdc94e70cd7b810a44770684b742d96d7d40d720cc54f209784e0ad4ad6 guix-build-4289dd02cce6/output/x86_64-w64-mingw32/bitcoin-4289dd02cce6-win64-setup-unsigned.exe e4557d1f8c1b0eb5014ad56d2a17a0a618c3ba7e6d073628e633382e1d4191aa guix-build-4289dd02cce6/output/x86_64-w64-mingw32/bitcoin-4289dd02cce6-win64-unsigned.tar.gz 3f9a104633f6962b0b8efb64a7d6be453f56617561e7f5b49a84ae191942ea5d guix-build-4289dd02cce6/output/x86_64-w64-mingw32/bitcoin-4289dd02cce6-win64.zip ``` ACKs for top commit: theuni: utACK 4289dd02cce688a69c596f7cd5e47f831b00aa1b hebasto: ACK 4289dd02cce688a69c596f7cd5e47f831b00aa1b. Tree-SHA512: f2e1f6525f699e0d069c70f5e7f1a7e8f8758dcdaff778d49e671bc106a9592f9a7b25c4dbeeaf92b654646fd3b902ad45c8547fd1b28e3287933e8c1497333d --- contrib/devtools/symbol-check.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 6ddd51ec01..fd070b2823 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -220,6 +220,11 @@ def check_exported_symbols(binary) -> bool: ok = False return ok +def check_RUNPATH(binary) -> bool: + assert binary.get(lief.ELF.DYNAMIC_TAGS.RUNPATH) is None + assert binary.get(lief.ELF.DYNAMIC_TAGS.RPATH) is None + return True + def check_ELF_libraries(binary) -> bool: ok: bool = True for library in binary.libraries: @@ -280,6 +285,7 @@ lief.EXE_FORMATS.ELF: [ ('LIBRARY_DEPENDENCIES', check_ELF_libraries), ('INTERPRETER_NAME', check_ELF_interpreter), ('ABI', check_ELF_ABI), + ('RUNPATH', check_RUNPATH), ], lief.EXE_FORMATS.MACHO: [ ('DYNAMIC_LIBRARIES', check_MACHO_libraries), From 9793fb1a8743457c929a0a410b6c7bba042f6437 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Tue, 2 Jul 2024 16:35:25 -0400 Subject: [PATCH 06/23] Merge bitcoin/bitcoin#30340: test: Added coverage to Block not found error using gettxoutsetinfo 8ec24bdad89e2a72c394060ba5661a91f374b874 test: Added coverage to Block not found error using gettxoutsetinfo (kevkevinpal) Pull request description: #### Description There were no tests that checked for the `Block not found` error called in `ParseHashOrHeight` when using `gettxoutsetinfo`, this change adds coverage to it. You can see there are no tests that do the following by doing the below `grep -nri "Block not found.*gettxoutsetinfo" ./test/functional/` which leads to no results ACKs for top commit: achow101: ACK 8ec24bdad89e2a72c394060ba5661a91f374b874 tdb3: ACK 8ec24bdad89e2a72c394060ba5661a91f374b874 kristapsk: ACK 8ec24bdad89e2a72c394060ba5661a91f374b874 brunoerg: crACK 8ec24bdad89e2a72c394060ba5661a91f374b874 alfonsoromanz: Re ACK 8ec24bdad89e2a72c394060ba5661a91f374b874 Tree-SHA512: 2c61c681e7304c679cc3d7dd13af1b795780e85716c25c7423d68104e253d01271e048e21bc21be35dbc7ec1a4fde94e439542f3cfd669fe5a16478c5fa982ab --- test/functional/feature_coinstatsindex.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py index e01af97c1f..9c3d8523d6 100755 --- a/test/functional/feature_coinstatsindex.py +++ b/test/functional/feature_coinstatsindex.py @@ -261,6 +261,9 @@ class CoinStatsIndexTest(BitcoinTestFramework): ) self.restart_node(1, extra_args=["-coinstatsindex"]) + self.log.info("Test obtaining info for a non-existent block hash") + assert_raises_rpc_error(-5, "Block not found", index_node.gettxoutsetinfo, hash_type="none", hash_or_height="ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", use_index=True) + def _test_use_index_option(self): self.log.info("Test use_index option for nodes running the index") From ebed8af1d04223d02bef6b256d26446253104c86 Mon Sep 17 00:00:00 2001 From: merge-script Date: Fri, 12 Jul 2024 09:40:32 +0100 Subject: [PATCH 07/23] Merge bitcoin/bitcoin#30336: depends: update doc in Qt pwd patch f170fe04ca03fe4021cbff7c5450ce3cc7fda17f depends: update doc in Qt pwd patch (fanquake) Pull request description: Now that upstream has gotten around to fixing this. We don't need any more of the patch, and it likely wont apply to our version of Qt in any case. See: https://github.com/qt/qtbase/commit/3388de698bfb9bbc456c08f03e83bf3e749df35c. ACKs for top commit: theuni: ACK f170fe04ca03fe4021cbff7c5450ce3cc7fda17f Tree-SHA512: f6db8ccad591b1bf144ce71f873f42a115d394c432a95b6b855e3e32751e6331145e0d9676657599b25fd369af8c72c1bd34e192a7a1062c15f152421422a9ed --- depends/patches/qt/dont_hardcode_pwd.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/depends/patches/qt/dont_hardcode_pwd.patch b/depends/patches/qt/dont_hardcode_pwd.patch index a74e9cb098..f6955b2f20 100644 --- a/depends/patches/qt/dont_hardcode_pwd.patch +++ b/depends/patches/qt/dont_hardcode_pwd.patch @@ -1,13 +1,13 @@ -commit 0e953866fc4672486e29e1ba6d83b4207e7b2f0b -Author: fanquake -Date: Tue Aug 18 15:09:06 2020 +0800 +Do not assume FHS in scripts - Don't hardcode pwd path +On systems that do not follow the Filesystem Hierarchy Standard, such as +guix, the hardcoded `/bin/pwd` will fail to be found so that the script +will fail. - Let a man use his builtins if he wants to! Also, removes the unnecessary - assumption that pwd lives under /bin/pwd. +Use `pwd`, instead, so that the command can be found through the normal +path search mechanism. - See #15581. +See https://github.com/qt/qtbase/commit/3388de698bfb9bbc456c08f03e83bf3e749df35c. diff --git a/qtbase/configure b/qtbase/configure index 08b49a8d..faea5b55 100755 From 69c04b2c48e8aa9a0ba8cf7f9853185793a5c442 Mon Sep 17 00:00:00 2001 From: merge-script Date: Fri, 12 Jul 2024 10:28:43 +0100 Subject: [PATCH 08/23] Merge bitcoin/bitcoin#30372: util: Use SteadyClock in RandAddSeedPerfmon fa360b047fc578fd855b8f7420d84dc967884f4a util: Use SteadyClock in RandAddSeedPerfmon (MarcoFalke) Pull request description: `GetTime` is mockable in tests and system-changeable in production. This should be fine and not lead to issues, but using `SteadyClock` is more correct in this context to do an expensive task only so often. ACKs for top commit: sipa: utACK fa360b047fc578fd855b8f7420d84dc967884f4a TheCharlatan: ACK fa360b047fc578fd855b8f7420d84dc967884f4a Tree-SHA512: 1958b9e9e356c9801ac981014b4b528cfc8ce6612853d8b45f6519b16f0b1839ff765abb8b3368b86f00958ddc6a686f6b90278c57a7ad4858bdf3ea33775cca --- src/randomenv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/randomenv.cpp b/src/randomenv.cpp index ddb8983c6c..6b32d4ebfa 100644 --- a/src/randomenv.cpp +++ b/src/randomenv.cpp @@ -71,10 +71,10 @@ void RandAddSeedPerfmon(CSHA512& hasher) // This can take up to 2 seconds, so only do it every 10 minutes. // Initialize last_perfmon to 0 seconds, we don't skip the first call. - static std::atomic last_perfmon{0s}; + static std::atomic last_perfmon{SteadyClock::time_point{0s}}; auto last_time = last_perfmon.load(); - auto current_time = GetTime(); - if (current_time < last_time + std::chrono::minutes{10}) return; + auto current_time = SteadyClock::now(); + if (current_time < last_time + 10min) return; last_perfmon = current_time; std::vector vData(250000, 0); From 4e144be0dd3f8edddec87375de746198b1a21fdc Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:44:19 +0100 Subject: [PATCH 09/23] Merge bitcoin-core/gui#795: Keep focus on "Hide" while ModalOverlay is visible 992b1bbd5da95ee782515fb0f5674bb7a02684b2 qt: keep focus on "Hide" while ModalOverlay is visible (Jadi) Pull request description: During the initial sync, the Tab moves the focus to the widgets of the main window, even when the ModalOverlay is visible. This creates some weird rectangular *selections on the screen*. This PR fixes this by keeping the focus on the "Hide" button while the ModalOverlay is visible. Fixes #783 ACKs for top commit: pablomartin4btc: Concept & approach ACK 992b1bbd5da95ee782515fb0f5674bb7a02684b2 hebasto: re-ACK 992b1bbd5da95ee782515fb0f5674bb7a02684b2 Tree-SHA512: f702a3fd51db4bc10780bccf76394e35a6b5fb45db72c9c23cd10d777106b08c61077d2d989003838921e76d2cb44f809399f31df76448e4305a6c2a71b5c6a3 --- src/qt/modaloverlay.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp index 291dc4e9fe..716da09958 100644 --- a/src/qt/modaloverlay.cpp +++ b/src/qt/modaloverlay.cpp @@ -38,6 +38,7 @@ foreverHidden(false) parent->installEventFilter(this); raise(); } + ui->closeButton->installEventFilter(this); blockProcessTime.clear(); setVisible(false); @@ -75,6 +76,11 @@ bool ModalOverlay::eventFilter(QObject * obj, QEvent * ev) { raise(); } } + + if (obj == ui->closeButton && ev->type() == QEvent::FocusOut && layerIsVisible) { + ui->closeButton->setFocus(Qt::OtherFocusReason); + } + return QWidget::eventFilter(obj, ev); } @@ -195,6 +201,10 @@ void ModalOverlay::showHide(bool hide, bool userRequested) m_animation.setEndValue(QPoint(0, hide ? height() : 0)); m_animation.start(QAbstractAnimation::KeepWhenStopped); layerIsVisible = !hide; + + if (layerIsVisible) { + ui->closeButton->setFocus(Qt::OtherFocusReason); + } } void ModalOverlay::closeClicked() From 745addf6a7c2218705663c5f65ccefa78996f076 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Thu, 18 Jul 2024 17:51:16 -0400 Subject: [PATCH 10/23] Merge bitcoin/bitcoin#30245: net: Allow -proxy=[::1] on nodes with IPV6 lo only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 23333b7ed243071c9b4e4f04c727556d8065acbb net: Allow DNS lookups on nodes with IPV6 lo only (Max Edwards) Pull request description: This is similar to (but does not fix) https://github.com/bitcoin/bitcoin/issues/13155 which I believe is the same issue but in libevent. The issue is on a host that has IPV6 enabled but only a loopback IP address `-proxy=[::1]` will fail as `[::1]` is not considered valid by `getaddrinfo` with `AI_ADDRCONFIG` flag. I think the loopback interface should be considered valid and we have a functional test that will try to test this: `feature_proxy.py`. To replicate the issue, run `feature_proxy.py` inside a docker container that has IPV6 loopback ::1 address without specifically giving that container an external IPV6 address. This should be the default with recent versions of docker. IPV6 on loopback interface was enabled in docker engine 26 and later ([https://docs.docker.com/engine/release-notes/26.0/#bug-fixes-and-enhancements-2](https://docs.docker.com/engine/release-notes/26.0/#bug-fixes-and-enhancements-2)). `AI_ADDRCONFIG` was introduced to prevent slow DNS lookups on systems that were IPV4 only. References: Man section on `AI_ADDRCONFIG`: ``` If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4 addresses are returned in the list pointed to by res only if the local system has at least one IPv4 address configured, and IPv6 addresses are returned only if the local system has at least one IPv6 address configured. The loopback address is not considered for this case as valid as a configured address. This flag is useful on, for ex‐ ample, IPv4-only systems, to ensure that getaddrinfo() does not return IPv6 socket addresses that would always fail in connect(2) or bind(2). ``` [AI_ADDRCONFIG considered harmful Wiki entry by Fedora](https://fedoraproject.org/wiki/QA/Networking/NameResolution/ADDRCONFIG) [Mozilla discussing slow DNS without AI_ADDRCONFIG and also localhost issues with it](https://bugzilla.mozilla.org/show_bug.cgi?id=467497) ACKs for top commit: achow101: ACK 23333b7ed243071c9b4e4f04c727556d8065acbb tdb3: ACK 23333b7ed243071c9b4e4f04c727556d8065acbb pinheadmz: ACK 23333b7ed243071c9b4e4f04c727556d8065acbb Tree-SHA512: 5ecd8c72d1e1c28e3ebff07346381d74eaddef98dca830f6d3dbf098380562fa68847d053c0d84cc8ed19a45148ceb5fb244e4820cf63dccb10ab3db53175020 --- src/netbase.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index f784017bf0..cf1ba19e65 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -47,6 +47,7 @@ std::vector WrappedGetAddrInfo(const std::string& name, bool allow_loo ai_hint.ai_protocol = IPPROTO_TCP; // We don't care which address family (IPv4 or IPv6) is returned ai_hint.ai_family = AF_UNSPEC; + // If we allow lookups of hostnames, use the AI_ADDRCONFIG flag to only // return addresses whose family we have an address configured for. // @@ -58,7 +59,17 @@ std::vector WrappedGetAddrInfo(const std::string& name, bool allow_loo addrinfo* ai_res{nullptr}; const int n_err{getaddrinfo(name.c_str(), nullptr, &ai_hint, &ai_res)}; if (n_err != 0) { - return {}; + if ((ai_hint.ai_flags & AI_ADDRCONFIG) == AI_ADDRCONFIG) { + // AI_ADDRCONFIG on some systems may exclude loopback-only addresses + // If first lookup failed we perform a second lookup without AI_ADDRCONFIG + ai_hint.ai_flags = (ai_hint.ai_flags & ~AI_ADDRCONFIG); + const int n_err_retry{getaddrinfo(name.c_str(), nullptr, &ai_hint, &ai_res)}; + if (n_err_retry != 0) { + return {}; + } + } else { + return {}; + } } // Traverse the linked list starting with ai_trav. From 62dcd43b5848ab60352f35d35eadd5a84b06498e Mon Sep 17 00:00:00 2001 From: merge-script Date: Fri, 19 Jul 2024 09:59:02 +0100 Subject: [PATCH 11/23] Merge bitcoin/bitcoin#29880: depends: build FreeType with CMake ff4f3deb7b8adfcc90fb745440ce4be1176552ca depends: use CMake to build FreeType (fanquake) Pull request description: Switches Freetype to be built with CMake. ACKs for top commit: theuni: ACK ff4f3deb7b8adfcc90fb745440ce4be1176552ca hebasto: ACK ff4f3deb7b8adfcc90fb745440ce4be1176552ca, I've verified the actual compile options, they look sane. Tree-SHA512: e9e4348975998539fde88a84d110d53dbac50ae9cc3fa692d15e09313d6fdb6acb3bb23533786a645fc836091075b4487d6de42ef78ba3a44de46d06360aef4f --- depends/packages/freetype.mk | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/depends/packages/freetype.mk b/depends/packages/freetype.mk index c28259ed67..c942cbb936 100644 --- a/depends/packages/freetype.mk +++ b/depends/packages/freetype.mk @@ -3,14 +3,17 @@ $(package)_version=2.11.0 $(package)_download_path=https://download.savannah.gnu.org/releases/$(package) $(package)_file_name=$(package)-$($(package)_version).tar.xz $(package)_sha256_hash=8bee39bd3968c4804b70614a0a3ad597299ad0e824bc8aad5ce8aaf48067bde7 +$(package)_build_subdir=build define $(package)_set_vars - $(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static - $(package)_config_opts += --enable-option-checking --without-brotli + $(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DBUILD_SHARED_LIBS=TRUE + $(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE + $(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE + $(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE endef define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) -S .. -B . endef define $(package)_build_cmds @@ -22,5 +25,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf share/man lib/*.la + rm -rf share/man endef From e016ffada1fc144077ce1f1b3a256ace4502dabb Mon Sep 17 00:00:00 2001 From: merge-script Date: Wed, 24 Jul 2024 09:04:49 +0100 Subject: [PATCH 12/23] Merge bitcoin/bitcoin#29878: depends: build expat with CMake a517029646ac86f9d72fcea204ff45db41702e37 depends: switch to building expat with CMake (fanquake) Pull request description: Switch to building Expat with CMake, instead of Autotools. ACKs for top commit: hebasto: re-ACK a517029646ac86f9d72fcea204ff45db41702e37. Tree-SHA512: ca040545dd83fb81a8b209aa24cae6e22eaeff04f44bdabc4454adf6ea63d34f4ae27bd5980c65db2d2542e23eb2712102719023c262ab63a933c90b5999c11e --- depends/packages/expat.mk | 16 +++++++++++----- depends/patches/expat/cmake_minimum.patch | 13 +++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 depends/patches/expat/cmake_minimum.patch diff --git a/depends/packages/expat.mk b/depends/packages/expat.mk index 2db283ef3c..9b1eafc06c 100644 --- a/depends/packages/expat.mk +++ b/depends/packages/expat.mk @@ -3,19 +3,25 @@ $(package)_version=2.4.8 $(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/ $(package)_file_name=$(package)-$($(package)_version).tar.xz $(package)_sha256_hash=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25 +$(package)_build_subdir=build +$(package)_patches += cmake_minimum.patch # -D_DEFAULT_SOURCE defines __USE_MISC, which exposes additional # definitions in endian.h, which are required for a working # endianess check in configure when building with -flto. define $(package)_set_vars - $(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples - $(package)_config_opts += --disable-dependency-tracking --enable-option-checking - $(package)_config_opts += --without-xmlwf + $(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DEXPAT_BUILD_TOOLS=OFF + $(package)_config_opts += -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF + $(package)_config_opts += -DBUILD_SHARED_LIBS=OFF $(package)_cppflags += -D_DEFAULT_SOURCE endef +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch +endef + define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) -S .. -B . endef define $(package)_build_cmds @@ -27,5 +33,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf share lib/cmake lib/*.la + rm -rf share lib/cmake endef diff --git a/depends/patches/expat/cmake_minimum.patch b/depends/patches/expat/cmake_minimum.patch new file mode 100644 index 0000000000..a849a82a33 --- /dev/null +++ b/depends/patches/expat/cmake_minimum.patch @@ -0,0 +1,13 @@ +build: set minimum required CMake to 3.16 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,7 +33,7 @@ + # Unlike most of Expat, + # this file is copyrighted under the BSD-license for buildsystem files of KDE. + +-cmake_minimum_required(VERSION 3.1.3) ++cmake_minimum_required(VERSION 3.16) + + # This allows controlling documented build time switches + # when Expat is pulled in using the add_subdirectory function, e.g. From 57945ce33755b4dcec4e376e617b0ed19b2ac55e Mon Sep 17 00:00:00 2001 From: merge-script Date: Thu, 25 Jul 2024 13:59:19 +0100 Subject: [PATCH 13/23] Merge bitcoin/bitcoin#30506: depends: Cleanup postprocess commands after switching to CMake a0314c151679a348d842b68c5ecb7a556700811c depends: cleanup after qrencode build (fanquake) 745bf0fa7e9afc3989e9c60d7ef09e96ae172277 depends: cleanup after miniupnpc build (fanquake) 06d4aab77af4e75f0e8fd96a93e108f92210d878 depends: Cleanup postprocess commands after switching to CMake (Hennadii Stepanov) Pull request description: I overlooked this while reviewing https://github.com/bitcoin/bitcoin/pull/29723, https://github.com/bitcoin/bitcoin/pull/29835, and https://github.com/bitcoin/bitcoin/pull/29880. ACKs for top commit: fanquake: ACK a0314c151679a348d842b68c5ecb7a556700811c Tree-SHA512: debeffa7027e6213cc25c0652660ff0f36f51e63f688041d1d6cd6323e2c6cb02936fa0ecea86455b8c9874d6ea665684085189cfa523ca084792c57b0fb7c4e --- depends/packages/freetype.mk | 3 --- depends/packages/libevent.mk | 2 +- depends/packages/miniupnpc.mk | 5 +++++ depends/packages/qrencode.mk | 4 ++++ depends/packages/zeromq.mk | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/depends/packages/freetype.mk b/depends/packages/freetype.mk index c942cbb936..fef0beaa7b 100644 --- a/depends/packages/freetype.mk +++ b/depends/packages/freetype.mk @@ -24,6 +24,3 @@ define $(package)_stage_cmds $(MAKE) DESTDIR=$($(package)_staging_dir) install endef -define $(package)_postprocess_cmds - rm -rf share/man -endef diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk index 5110e249db..7b5ee2b9ce 100644 --- a/depends/packages/libevent.mk +++ b/depends/packages/libevent.mk @@ -36,7 +36,7 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm bin/event_rpcgen.py && \ + rm -rf bin && \ rm include/ev*.h && \ rm include/event2/*_compat.h endef diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk index 7ad2529e47..f60ef824ab 100644 --- a/depends/packages/miniupnpc.mk +++ b/depends/packages/miniupnpc.mk @@ -28,3 +28,8 @@ define $(package)_stage_cmds install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\ install libminiupnpc.a $($(package)_staging_prefix_dir)/lib endef + +define $(package)_postprocess_cmds + rm -rf bin && \ + rm -rf share +endef diff --git a/depends/packages/qrencode.mk b/depends/packages/qrencode.mk index 4d852d833d..c769ae078f 100644 --- a/depends/packages/qrencode.mk +++ b/depends/packages/qrencode.mk @@ -28,3 +28,7 @@ endef define $(package)_stage_cmds $(MAKE) DESTDIR=$($(package)_staging_dir) install endef + +define $(package)_postprocess_cmds + rm -rf share +endef diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index 28f730ae6d..e7f3000017 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -46,5 +46,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf bin share lib/*.la + rm -rf share endef From df3c2392caa5735657ff6bcddd43e252f672ac33 Mon Sep 17 00:00:00 2001 From: merge-script Date: Fri, 26 Jul 2024 07:08:49 +0100 Subject: [PATCH 14/23] Merge bitcoin/bitcoin#26950: cleanse: switch to SecureZeroMemory for Windows cross-compile c399c80a09a393d38368a44ef04753e9f62350f0 cleanse: Use SecureZeroMemory for mingw-w64 (release) builds (fanquake) Pull request description: This PR switches our Windows release builds to use the [`SecureZeroMemory()`](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa366877(v=vs.85)) provided by mingw-w64. ACKs for top commit: sipa: utACK c399c80a09a393d38368a44ef04753e9f62350f0 TheCharlatan: ACK c399c80a09a393d38368a44ef04753e9f62350f0 Tree-SHA512: dbb20b16c85061d2f9408a3cf69cecc16765f8f61b25a1707146767b664c7ad0caf36975380814ef8e7c49a30199daebac6d5d7a3585354d1adac8e9770199c6 --- src/support/cleanse.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/support/cleanse.cpp b/src/support/cleanse.cpp index a8ddcd793f..4e370f1516 100644 --- a/src/support/cleanse.cpp +++ b/src/support/cleanse.cpp @@ -7,14 +7,14 @@ #include -#if defined(_MSC_VER) -#include // For SecureZeroMemory. +#if defined(WIN32) +#include #endif void memory_cleanse(void *ptr, size_t len) { -#if defined(_MSC_VER) - /* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */ +#if defined(WIN32) + /* SecureZeroMemory is guaranteed not to be optimized out. */ SecureZeroMemory(ptr, len); #else std::memset(ptr, 0, len); From e4e5605ef8a6c3fd71ffec4710f3e5d737e2309b Mon Sep 17 00:00:00 2001 From: merge-script Date: Wed, 31 Jul 2024 12:01:33 +0100 Subject: [PATCH 15/23] Merge bitcoin/bitcoin#30552: test: fix constructor of msg_tx ec5e294e4b830766dcc4a80add0613d3705c1794 test: fix constructor of msg_tx (Martin Zumsande) Pull request description: In python, if the default value is a mutable object (here: a class) it is shared over all instances, so that one instance being changed would affect others to be changed as well. This was the source of #30543, and possibly various other intermittent bugs in the functional tests, see https://github.com/bitcoin/bitcoin/issues/29621#issuecomment-1999298224. Fixes #30543 Fixes #29621 Fixes #25128 ACKs for top commit: sipa: utACK ec5e294e4b830766dcc4a80add0613d3705c1794. I believe some linters even warn about doing this. maflcko: ACK ec5e294e4b830766dcc4a80add0613d3705c1794 vasild: ACK ec5e294e4b830766dcc4a80add0613d3705c1794 :heart: theStack: ACK ec5e294e4b830766dcc4a80add0613d3705c1794 Tree-SHA512: a6204fb1a326de3f9aa965f345fd658f6a4dcf78731db25cc905ff6eb8d4eeb65d14cc316305eebd89387aec8748c57c3a4f4ca62408f8e5ee53f535b88b1411 --- test/functional/test_framework/messages.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index e96af7412a..945f9713ce 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -1724,8 +1724,11 @@ class msg_tx: __slots__ = ("tx",) msgtype = b"tx" - def __init__(self, tx=CTransaction()): - self.tx = tx + def __init__(self, tx=None): + if tx is None: + self.tx = CTransaction() + else: + self.tx = tx def deserialize(self, f): self.tx.deserialize(f) From ddaec964c03ae0bd11d7438f37ad7a6f037cff22 Mon Sep 17 00:00:00 2001 From: merge-script Date: Thu, 1 Aug 2024 11:27:32 +0100 Subject: [PATCH 16/23] Merge bitcoin/bitcoin#30565: depends: Fix `zeromq` build on OpenBSD 89b1d5c818a33440c0c497aa78721fb9b0af35a5 depends: Fix `zeromq` build on OpenBSD (Hennadii Stepanov) Pull request description: On the master branch @ 66e82dc90c598c9c42ff980693ef5367a845e1d0, the `zeromq` package fails to build on OpenBSD 7.5: ``` [ 19%] Building CXX object CMakeFiles/objects.dir/src/io_thread.cpp.o /home/hebasto/bitcoin/depends/work/build/amd64-unknown-openbsd7.5/zeromq/4.3.5-df5b1b9f936/src/io_thread.cpp:14:22: error: static_cast from 'std::nullptr_t' to 'poller_t::handle_t' (aka 'int') is not allowed _mailbox_handle (static_cast (NULL)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` This [regression](https://github.com/bitcoin/bitcoin/pull/29723#issuecomment-2261513105) was overlooked by me in https://github.com/bitcoin/bitcoin/pull/29723. This PR fixes the issue by backporting an upstream commit from https://github.com/zeromq/libzmq/pull/4659. ACKs for top commit: theStack: tACK 89b1d5c818a33440c0c497aa78721fb9b0af35a5 Tree-SHA512: 48d22ea99dfd44c5adf858c74e64082390da27b8ccad8c0d5a91d4dabfa3d12267cef98e4bb8c088e4cd0ec477c242cb1d47aace5c88cd86f796715bba957ed8 --- depends/packages/zeromq.mk | 2 ++ .../zeromq/openbsd_kqueue_headers.patch | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 depends/patches/zeromq/openbsd_kqueue_headers.patch diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index e7f3000017..a6b12f5b52 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -8,6 +8,7 @@ $(package)_patches = remove_libstd_link.patch $(package)_patches += macos_mktemp_check.patch $(package)_patches += builtin_sha1.patch $(package)_patches += fix_have_windows.patch +$(package)_patches += openbsd_kqueue_headers.patch $(package)_patches += cmake_minimum.patch $(package)_patches += no_librt.patch $(package)_patches += fix_mingw_link.patch @@ -28,6 +29,7 @@ define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch && \ patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch && \ patch -p1 < $($(package)_patch_dir)/fix_have_windows.patch && \ + patch -p1 < $($(package)_patch_dir)/openbsd_kqueue_headers.patch && \ patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch && \ patch -p1 < $($(package)_patch_dir)/no_librt.patch && \ patch -p1 < $($(package)_patch_dir)/fix_mingw_link.patch diff --git a/depends/patches/zeromq/openbsd_kqueue_headers.patch b/depends/patches/zeromq/openbsd_kqueue_headers.patch new file mode 100644 index 0000000000..7000e209fe --- /dev/null +++ b/depends/patches/zeromq/openbsd_kqueue_headers.patch @@ -0,0 +1,24 @@ +commit ff231d267370493814f933d151441866bf1e200b +Author: Min RK +Date: Fri Feb 23 13:21:08 2024 +0100 + + Problem: cmake search for kqueue missing headers + + Solution: include sys/types.h and sys/time.h as documented by kqueue + and used in autotools + + fixes kqueue detection on openbsd + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f956f3fd..814d5d46 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -380,7 +380,7 @@ endif(WIN32) + + if(NOT MSVC) + if(POLLER STREQUAL "") +- check_cxx_symbol_exists(kqueue sys/event.h HAVE_KQUEUE) ++ check_cxx_symbol_exists(kqueue "sys/types.h;sys/event.h;sys/time.h" HAVE_KQUEUE) + if(HAVE_KQUEUE) + set(POLLER "kqueue") + endif() From f66547f84e26a3a4e2e2d58680afdf6c60fd7291 Mon Sep 17 00:00:00 2001 From: merge-script Date: Tue, 6 Aug 2024 10:30:00 +0100 Subject: [PATCH 17/23] Merge bitcoin/bitcoin#30588: depends: fix ZMQ CMake getcachesize check a0a9a11642752578fb1f5142c3fb26cb39d1548a depends: fix ZMQ CMake getcachesize check (fanquake) Pull request description: Fixes #30587. ACKs for top commit: maflcko: ACK a0a9a11642752578fb1f5142c3fb26cb39d1548a hebasto: ACK a0a9a11642752578fb1f5142c3fb26cb39d1548a. On Ubuntu (s390x), I was able to reproduce https://github.com/bitcoin/bitcoin/issues/30587. With this PR building `zeromq` succeeds. TheCharlatan: ACK a0a9a11642752578fb1f5142c3fb26cb39d1548a Tree-SHA512: 70ca50ebe8e36d5a10a2354a1fbed49f5f802ae5115e09686bccca7e5d1da35168e84a6cab40dd2c83f8918889cdfdcbd5d1cbe25273b844c8ddd21865ea6c51 --- depends/packages/zeromq.mk | 2 ++ depends/patches/zeromq/cacheline_undefined.patch | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 depends/patches/zeromq/cacheline_undefined.patch diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index a6b12f5b52..d9c1253484 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -10,6 +10,7 @@ $(package)_patches += builtin_sha1.patch $(package)_patches += fix_have_windows.patch $(package)_patches += openbsd_kqueue_headers.patch $(package)_patches += cmake_minimum.patch +$(package)_patches += cacheline_undefined.patch $(package)_patches += no_librt.patch $(package)_patches += fix_mingw_link.patch @@ -28,6 +29,7 @@ define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \ patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch && \ patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch && \ + patch -p1 < $($(package)_patch_dir)/cacheline_undefined.patch && \ patch -p1 < $($(package)_patch_dir)/fix_have_windows.patch && \ patch -p1 < $($(package)_patch_dir)/openbsd_kqueue_headers.patch && \ patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch && \ diff --git a/depends/patches/zeromq/cacheline_undefined.patch b/depends/patches/zeromq/cacheline_undefined.patch new file mode 100644 index 0000000000..02bd2a5fe5 --- /dev/null +++ b/depends/patches/zeromq/cacheline_undefined.patch @@ -0,0 +1,15 @@ +Use proper STREQUAL instead of EQUAL to compare strings.txt + +See: https://github.com/zeromq/libzmq/pull/4711. + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -476,7 +476,7 @@ execute_process( + if(CACHELINE_SIZE STREQUAL "" + OR CACHELINE_SIZE EQUAL 0 + OR CACHELINE_SIZE EQUAL -1 +- OR CACHELINE_SIZE EQUAL "undefined") ++ OR CACHELINE_SIZE STREQUAL "undefined") + set(ZMQ_CACHELINE_SIZE 64) + else() + set(ZMQ_CACHELINE_SIZE ${CACHELINE_SIZE}) From 8a12237745e1af6620bb29a99be06c3a1dcec1d8 Mon Sep 17 00:00:00 2001 From: merge-script Date: Mon, 12 Aug 2024 09:36:22 +0100 Subject: [PATCH 18/23] Merge bitcoin/bitcoin#30630: doc: Update ccache website link fec74a8bcb29e7cdb1ef21c68c7c8c30c4386ca7 doc: Update ccache website link (Hennadii Stepanov) Pull request description: ACKs for top commit: paplorinc: ACK fec74a8bcb29e7cdb1ef21c68c7c8c30c4386ca7 tdb3: ACK fec74a8bcb29e7cdb1ef21c68c7c8c30c4386ca7 hodlinator: ACK fec74a8bcb29e7cdb1ef21c68c7c8c30c4386ca7 Tree-SHA512: 1331b6d37d1bfc124bbce08bb584235c0610671655d7a4a82882aba2aa73c3c741dce013e6ce9baba00a07bc26d4a9c5aa8da4abd38187ffe7b8a101e2366bda --- doc/productivity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/productivity.md b/doc/productivity.md index 4235827e42..ef2bd1a90a 100644 --- a/doc/productivity.md +++ b/doc/productivity.md @@ -33,7 +33,7 @@ The easiest way to faster compile times is to cache compiles. `ccache` is a way Install `ccache` through your distribution's package manager, and run `./configure` with your normal flags to pick it up. -To use ccache for all your C/C++ projects, follow the symlinks method [here](https://ccache.samba.org/manual/latest.html#_run_modes) to set it up. +To use ccache for all your C/C++ projects, follow the symlinks method [here](https://ccache.dev/manual/latest.html#_run_modes) to set it up. To get the most out of ccache, put something like this in `~/.ccache/ccache.conf`: From 1bd090e7fb727fdd4af0570cf6c05a7d2218b0eb Mon Sep 17 00:00:00 2001 From: merge-script Date: Mon, 12 Aug 2024 11:24:59 +0100 Subject: [PATCH 19/23] Merge bitcoin/bitcoin#30597: doc: Drop no longer needed workaround for WSL 16d82611812de4e91e7950fe6d31484cc7a9c937 doc: Drop no longer needed workaround for WSL (Hennadii Stepanov) Pull request description: This PR effectively reverts commit 4f890ba6bc8caba5394c7a5388d7f07959ced78b from https://github.com/bitcoin/bitcoin/pull/11437, which fixed some build issues on WSL seven years ago. Testing the current master branch @ 31a3ff55154bf15fb35b157c3f67ec05408ecdf9 on Windows 11 + WSL using Ubuntu 24.04 or Debian images, I noticed that the workaround is no longer required. Moreover, it doesn't affect the build process at all, which means the hashes of the built packages in depends remain the same and the `configure` log in the main build system remains the same as well. ACKs for top commit: sipsorcery: utACK 16d82611812de4e91e7950fe6d31484cc7a9c937. Tree-SHA512: 703a2ac4647125c91aad47131e2723fd05af30b0cfae5677a26d3e89a77c2779e0197584208f3b378ed64dd7305512d9064fd073ec06517f86e9905af4ec8838 --- doc/build-windows.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/build-windows.md b/doc/build-windows.md index 02fa001ed3..841164eeb3 100644 --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -52,7 +52,6 @@ is to temporarily disable WSL support for Win32 applications. Build using: - PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Disable WSL support for Win32 applications. cd depends make HOST=x86_64-w64-mingw32 From 432f3527197584e342b8e916fb1c434f83d317e9 Mon Sep 17 00:00:00 2001 From: merge-script Date: Mon, 12 Aug 2024 11:40:22 +0100 Subject: [PATCH 20/23] Merge bitcoin/bitcoin#30580: doc: Add note about distro's `g++-mingw-w64-x86-64-posix` version ed83974bb411ab5ebe3eef28f0ac995ce07936cd doc: Add note about distro's g++-mingw-w64-x86-64-posix version (Hennadii Stepanov) Pull request description: This PR stems from a requirement for the `g++` minimum supported version [being >= 11](https://github.com/bitcoin/bitcoin/pull/29091): - https://packages.ubuntu.com/noble/g++-mingw-w64-x86-64-posix - https://packages.debian.org/bookworm/g++-mingw-w64-x86-64-posix ACKs for top commit: m3dwards: ACK ed83974bb411ab5ebe3eef28f0ac995ce07936cd maflcko: review-only ACK ed83974bb411ab5ebe3eef28f0ac995ce07936cd Tree-SHA512: a4c4d5239df5540b2dac922c2834c51337ec67310d596620bea02fe54334917e83da8954107c6a3fdd08143d1eac6a2cd4b0520ad023d7ccad8bcbdc4e03a7c0 --- doc/build-windows.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/build-windows.md b/doc/build-windows.md index 841164eeb3..ee5ca038c7 100644 --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -12,6 +12,9 @@ Other options which may work, but which have not been extensively tested are (pl * On Windows, using a POSIX compatibility layer application such as [cygwin](https://www.cygwin.com/) or [msys2](https://www.msys2.org/). +The instructions below work on Ubuntu and Debian. Make sure the distribution's `g++-mingw-w64-x86-64-posix` +package meets the minimum required `g++` version specified in [dependencies.md](dependencies.md). + Installing Windows Subsystem for Linux --------------------------------------- From 01b570e9e21e5441f763fea0c8cc800533c28fb0 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Mon, 12 Aug 2024 15:22:58 -0400 Subject: [PATCH 21/23] Merge bitcoin/bitcoin#29999: guix: fix suggested fake date for openssl-1.1.1l 8fee5355ee1d2f2b410c548bac9e85f2a21a696d guix: fix suggested fake date for openssl -1.1.1l (Sjors Provoost) Pull request description: Using `2020-10-01` as the fake timestamp will cause many test failures with `/gnu/store/bfirgq65ndhf63nn4q6vlkbha9zd931q-openssl-1.1.1l.drv`. I didn't investigate why, but I guess because it's _before_ the test certificates were created. They expired in June 2022. I tried a month before that, which worked. Also fixes layout of instructions. ACKs for top commit: achow101: ACK 8fee5355ee1d2f2b410c548bac9e85f2a21a696d maflcko: review ACK 8fee5355ee1d2f2b410c548bac9e85f2a21a696d Tree-SHA512: df5dd3aa961e25bd57d0b8b73daeb3ec76856b06e35277f24b6b19be81774512228f75e2b779afa8ea92fcc39beb869f43e0c57fba19ad16a82812e7c0bea38b --- contrib/guix/INSTALL.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/contrib/guix/INSTALL.md b/contrib/guix/INSTALL.md index 01bc093234..f2d6358959 100644 --- a/contrib/guix/INSTALL.md +++ b/contrib/guix/INSTALL.md @@ -671,6 +671,8 @@ More information: https://github.com/python/cpython/issues/81765 OpenSSL includes tests that will fail once some certificate has expired. The workarounds from the GnuTLS section immediately below can be used. +For openssl-1.1.1l use 2022-05-01 as the date. + ### GnuTLS: test-suite FAIL: status-request-revoked *The derivation is likely identified by: `/gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv`* @@ -705,11 +707,12 @@ authorized. This workaround was described [here](https://issues.guix.gnu.org/44559#5). Basically: -2. Turn off NTP -3. Set system time to 2020-10-01 -4. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv -5. Set system time back to accurate current time -6. Turn NTP back on + +1. Turn off NTP +2. Set system time to 2020-10-01 +3. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv +4. Set system time back to accurate current time +5. Turn NTP back on For example, From 745a819683f96847820b09250af1a9ac01053e1e Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Mon, 26 Aug 2024 14:55:10 -0400 Subject: [PATCH 22/23] Merge bitcoin/bitcoin#30690: devtools, utxo-snapshot: Fix block height out of range in script 5b4f34006dbd76223b55b156421f87d2241ac296 devtools, utxo-snapshot: Fix block height out of range (pablomartin4btc) Pull request description:
Fixing a bug in utxo_snapshot.sh. ``` /contrib/devtools/utxo_snapshot.sh 840000 snapshot2.dat ./src/bitcoin-cli -datadir=${AU_DATADIR} Do you want to disable network activity (setnetworkactive false) before running invalidateblock? (Y/n): Disabling network activity false error code: -8 error message: Block height out of range ``` And the user will see the following in the node and it would stay there if not reset: ``` 2024-08-21T14:44:13Z UpdateTip: new best=00000000000000afa0cd000a16e244f56032735d41acd32ac00337aceb2a5240 height=235382 version=0x00000002 log2_work=69.987697 tx=17492185 date='2013-05-09T23:54:32Z' progress=0.016219 cache=71.0MiB(571085txo) 2024-08-21T14:44:13Z UpdateTip: new best=0000000000000087c5e0b820afff496b95ba44ad64640c73b234d3261d3f99d2 height=235383 version=0x00000002 log2_work=69.987750 tx=17492341 date='2013-05-09T23:54:47Z' progress=0.016219 cache=71.0MiB(571291txo) 2024-08-21T14:44:13Z UpdateTip: new best=000000000000014a4b5fddf3c8abb6209247255ca9e8df786b271dd1b2ac82a6 height=235384 version=0x00000002 log2_work=69.987804 tx=17492344 date='2013-05-10T00:20:18Z' progress=0.016219 cache=71.0MiB(571297txo) 2024-08-21T14:44:13Z SetNetworkActive: false ```
This is a "temporary" fix until #29553 gets merged, which will remove the script entirely. Handle the "Block height out of range" error gracefully by checking if the node has synchronized to or beyond the required block height, otherwise without this validation the node would keep the network disabled if the user selected that option.
Provide a user-friendly message if the block height is out of range and exit the script cleanly. ``` /contrib/devtools/utxo_snapshot.sh 840000 snapshot2.dat ./src/bitcoin-cli -datadir=${AU_DATADIR} Error: The node has not yet synchronized to block height 840001. Please wait until the node has synchronized past this block height and try again. ```
ACKs for top commit: achow101: ACK 5b4f34006dbd76223b55b156421f87d2241ac296 fjahr: tACK 5b4f34006dbd76223b55b156421f87d2241ac296 Tree-SHA512: 2b71286b627872d7cfdb367e29361afa3806a7ef9d65075b93892b735ff2ab729069e2f7259d30262909e73cef17fb7dca231615cc1863968cd042f4a2a4f901 --- contrib/devtools/utxo_snapshot.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contrib/devtools/utxo_snapshot.sh b/contrib/devtools/utxo_snapshot.sh index 0e68f03dab..2d8583f965 100755 --- a/contrib/devtools/utxo_snapshot.sh +++ b/contrib/devtools/utxo_snapshot.sh @@ -36,6 +36,16 @@ if (( GENERATE_AT_HEIGHT < PRUNED )); then exit 1 fi +# Check current block height to ensure the node has synchronized past the required block +CURRENT_BLOCK_HEIGHT=$(${BITCOIN_CLI_CALL} getblockcount) +PIVOT_BLOCK_HEIGHT=$(( GENERATE_AT_HEIGHT + 1 )) + +if (( PIVOT_BLOCK_HEIGHT > CURRENT_BLOCK_HEIGHT )); then + (>&2 echo "Error: The node has not yet synchronized to block height ${PIVOT_BLOCK_HEIGHT}.") + (>&2 echo "Please wait until the node has synchronized past this block height and try again.") + exit 1 +fi + # Early exit if file at OUTPUT_PATH already exists if [[ -e "$OUTPUT_PATH" ]]; then (>&2 echo "Error: $OUTPUT_PATH already exists or is not a valid path.") From b6544791b4ec3621713d58af73bd1c1880dedf66 Mon Sep 17 00:00:00 2001 From: merge-script Date: Tue, 27 Aug 2024 11:20:42 +0100 Subject: [PATCH 23/23] Merge bitcoin/bitcoin#30705: test: Avoid intermittent block download timeout in p2p_ibd_stalling fa5b58ea01fac1adb6336b8b6b5217193295c695 test: Avoid intermittent block download timeout in p2p_ibd_stalling (MarcoFalke) Pull request description: Fixes #30704 The goal of the test is to check the stalling timeout, not the block download timeout. On extremely slow hardware (for example qemu virtual hardware), downloading the 1023 blocks may take longer than the block download timeout. Fix it by pinning the time using mocktime, and only advance it when testing the stalling timeout. ACKs for top commit: tdb3: CR ACK fa5b58ea01fac1adb6336b8b6b5217193295c695 brunoerg: utACK fa5b58ea01fac1adb6336b8b6b5217193295c695 Tree-SHA512: 9a9221f264bea52be5e9fe81fd319f5a6970cd315cc5e9f5e2e049c5d84619b19b9f6f075cda8d34565c2d6c17a88fb57e195c66c271e40f73119a77caecb6d7 --- test/functional/p2p_ibd_stalling.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/p2p_ibd_stalling.py b/test/functional/p2p_ibd_stalling.py index 49a297b024..213329b34b 100755 --- a/test/functional/p2p_ibd_stalling.py +++ b/test/functional/p2p_ibd_stalling.py @@ -76,6 +76,7 @@ class P2PIBDStallingTest(BitcoinTestFramework): peers = [] self.log.info("Check that a staller does not get disconnected if the 1024 block lookahead buffer is filled") + self.mocktime = int(time.time()) + 1 for id in range(NUM_PEERS): peers.append(node.add_outbound_p2p_connection(P2PStaller(stall_block), services = NODE_NETWORK | NODE_BLOOM, p2p_idx=id, connection_type="outbound-full-relay")) peers[-1].block_store = block_dict @@ -88,7 +89,7 @@ class P2PIBDStallingTest(BitcoinTestFramework): self.all_sync_send_with_ping(peers) # If there was a peer marked for stalling, it would get disconnected - self.mocktime = int(time.time()) + 3 + self.mocktime += 3 node.setmocktime(self.mocktime) self.all_sync_send_with_ping(peers) assert_equal(node.num_test_p2p_connections(), NUM_PEERS)