From c21bbcc898d9c1fbc77ca93e46fc84ae22b68afa Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 17 Apr 2024 13:27:53 +0100 Subject: [PATCH 01/16] [doc] archive 26.1 release notes --- doc/{release-notes.md => release-notes/release-notes-26.1.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/{release-notes.md => release-notes/release-notes-26.1.md} (100%) diff --git a/doc/release-notes.md b/doc/release-notes/release-notes-26.1.md similarity index 100% rename from doc/release-notes.md rename to doc/release-notes/release-notes-26.1.md From d39ea519c71ea9e0f2ed0ee79cc66ecaf35e86ee Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 21 Mar 2024 15:26:20 +0000 Subject: [PATCH 02/16] Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us To avoid issues with DNS blacklisting, I've setup a separate domain for my DNS seed. Github-Pull: #29691 Rebased-From: 4f273ab4360c9aa72c2feb78787e1811ab58dc16 --- src/kernel/chainparams.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp index 73ba330ff039e..96656de572846 100644 --- a/src/kernel/chainparams.cpp +++ b/src/kernel/chainparams.cpp @@ -133,7 +133,7 @@ class CMainParams : public CChainParams { // release ASAP to avoid it where possible. vSeeds.emplace_back("seed.bitcoin.sipa.be."); // Pieter Wuille, only supports x1, x5, x9, and xd vSeeds.emplace_back("dnsseed.bluematt.me."); // Matt Corallo, only supports x9 - vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org."); // Luke Dashjr + vSeeds.emplace_back("dnsseed.bitcoin.dashjr-list-of-p2p-nodes.us."); // Luke Dashjr vSeeds.emplace_back("seed.bitcoinstats.com."); // Christian Decker, supports x1 - xf vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch."); // Jonas Schnelli, only supports x1, x5, x9, and xd vSeeds.emplace_back("seed.btc.petertodd.org."); // Peter Todd, only supports x1, x5, x9, and xd From a81a9228fbaaa10d6308299f11d6093485d645e5 Mon Sep 17 00:00:00 2001 From: dergoegge Date: Mon, 15 Apr 2024 08:53:52 +0100 Subject: [PATCH 03/16] [rpc, bugfix] Enforce maximum value for setmocktime Github-Pull: #29869 Rebased-From: c2e0489b7125cceaeef355fc274dd8988822fff4 --- src/rpc/node.cpp | 7 +++++-- test/functional/rpc_uptime.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp index 6b3662996c43f..020e87f19c521 100644 --- a/src/rpc/node.cpp +++ b/src/rpc/node.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #ifdef HAVE_MALLOC_INFO @@ -54,9 +55,11 @@ static RPCHelpMan setmocktime() LOCK(cs_main); const int64_t time{request.params[0].getInt()}; - if (time < 0) { - throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime cannot be negative: %s.", time)); + constexpr int64_t max_time{Ticks(std::chrono::nanoseconds::max())}; + if (time < 0 || time > max_time) { + throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime must be in the range [0, %s], not %s.", max_time, time)); } + SetMockTime(time); const NodeContext& node_context{EnsureAnyNodeContext(request.context)}; for (const auto& chain_client : node_context.chain_clients) { diff --git a/test/functional/rpc_uptime.py b/test/functional/rpc_uptime.py index cb99e483ece29..f8df59d02ad39 100755 --- a/test/functional/rpc_uptime.py +++ b/test/functional/rpc_uptime.py @@ -23,7 +23,7 @@ def run_test(self): self._test_uptime() def _test_negative_time(self): - assert_raises_rpc_error(-8, "Mocktime cannot be negative: -1.", self.nodes[0].setmocktime, -1) + assert_raises_rpc_error(-8, "Mocktime must be in the range [0, 9223372036], not -1.", self.nodes[0].setmocktime, -1) def _test_uptime(self): wait_time = 10 From bf5b6fc8a7c7e6c13520671bb7b2d4d1d110c2bb Mon Sep 17 00:00:00 2001 From: Jameson Lopp Date: Sat, 30 Sep 2023 15:06:36 -0400 Subject: [PATCH 04/16] Throw error if invalid parameters passed to getnetworkhashps RPC endpoint Github-Pull: #28554 Rebased-From: 9ac114e5cd9d8ade3a1d9f3d76a08ff59a3f1658 --- src/rpc/mining.cpp | 19 ++++++++++++++----- test/functional/rpc_blockchain.py | 27 ++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 76170c32018dd..a1894a303052c 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -49,13 +49,22 @@ using node::UpdateTime; /** * Return average network hashes per second based on the last 'lookup' blocks, - * or from the last difficulty change if 'lookup' is nonpositive. - * If 'height' is nonnegative, compute the estimate at the time when a given block was found. + * or from the last difficulty change if 'lookup' is -1. + * If 'height' is -1, compute the estimate from current chain tip. + * If 'height' is a valid block height, compute the estimate at the time when a given block was found. */ static UniValue GetNetworkHashPS(int lookup, int height, const CChain& active_chain) { + if (lookup < -1 || lookup == 0) { + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid nblocks. Must be a positive number or -1."); + } + + if (height < -1 || height > active_chain.Height()) { + throw JSONRPCError(RPC_INVALID_PARAMETER, "Block does not exist at specified height"); + } + const CBlockIndex* pb = active_chain.Tip(); - if (height >= 0 && height < active_chain.Height()) { + if (height >= 0) { pb = active_chain[height]; } @@ -63,7 +72,7 @@ static UniValue GetNetworkHashPS(int lookup, int height, const CChain& active_ch return 0; // If lookup is -1, then use blocks since last difficulty change. - if (lookup <= 0) + if (lookup == -1) lookup = pb->nHeight % Params().GetConsensus().DifficultyAdjustmentInterval() + 1; // If lookup is larger than chain, then set it to chain length. @@ -97,7 +106,7 @@ static RPCHelpMan getnetworkhashps() "Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\n" "Pass in [height] to estimate the network speed at the time when a certain block was found.\n", { - {"nblocks", RPCArg::Type::NUM, RPCArg::Default{120}, "The number of blocks, or -1 for blocks since last difficulty change."}, + {"nblocks", RPCArg::Type::NUM, RPCArg::Default{120}, "The number of previous blocks to calculate estimate from, or -1 for blocks since last difficulty change."}, {"height", RPCArg::Type::NUM, RPCArg::Default{-1}, "To estimate at the time of the given height."}, }, RPCResult{ diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 53163720bb3f4..b485227d78948 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -436,7 +436,6 @@ def _test_getdifficulty(self): def _test_getnetworkhashps(self): self.log.info("Test getnetworkhashps") - hashes_per_second = self.nodes[0].getnetworkhashps() assert_raises_rpc_error( -3, textwrap.dedent(""" @@ -448,7 +447,33 @@ def _test_getnetworkhashps(self): """).strip(), lambda: self.nodes[0].getnetworkhashps("a", []), ) + assert_raises_rpc_error( + -8, + "Block does not exist at specified height", + lambda: self.nodes[0].getnetworkhashps(100, self.nodes[0].getblockcount() + 1), + ) + assert_raises_rpc_error( + -8, + "Block does not exist at specified height", + lambda: self.nodes[0].getnetworkhashps(100, -10), + ) + assert_raises_rpc_error( + -8, + "Invalid nblocks. Must be a positive number or -1.", + lambda: self.nodes[0].getnetworkhashps(-100), + ) + assert_raises_rpc_error( + -8, + "Invalid nblocks. Must be a positive number or -1.", + lambda: self.nodes[0].getnetworkhashps(0), + ) + + # Genesis block height estimate should return 0 + hashes_per_second = self.nodes[0].getnetworkhashps(100, 0) + assert_equal(hashes_per_second, 0) + # This should be 2 hashes every 10 minutes or 1/300 + hashes_per_second = self.nodes[0].getnetworkhashps() assert abs(hashes_per_second * 300 - 1) < 0.0001 def _test_stopatheight(self): From bb46b90b2ec7c8a4955ed8c5711bbc128d803b76 Mon Sep 17 00:00:00 2001 From: nanlour Date: Mon, 1 Apr 2024 14:13:06 +1100 Subject: [PATCH 05/16] Fix #29767, set m_synced = true after Commit() Github-Pull: #29776 Rebased-From: bbe82c116e72ca0638751e063bf564cd1fe5c4d5 --- src/index/base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index/base.cpp b/src/index/base.cpp index 8474d01c41f8f..298755038c08c 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -165,9 +165,9 @@ void BaseIndex::ThreadSync() const CBlockIndex* pindex_next = NextSyncBlock(pindex, m_chainstate->m_chain); if (!pindex_next) { SetBestBlockIndex(pindex); - m_synced = true; // No need to handle errors in Commit. See rationale above. Commit(); + m_synced = true; break; } if (pindex_next->pprev != pindex && !Rewind(pindex, pindex_next->pprev)) { From e4859c82c7b848554b4e9d27c2f8b8615422528e Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 27 Mar 2024 10:49:50 +0000 Subject: [PATCH 06/16] depends: fix mingw-w64 Qt DEBUG=1 build The issue is that compilation is done with `x86_64-w64-mingw32-g++-posix`, but then linking is done with `x86_64-w64-mingw32-g++`. I'm guessing this has been broken since #24131 (01d1845a80ae48d741deea695ddce95d940ab0d8), but have not checked. Fixes #29734. Unblocks #29527 (now DEBUG=1 builds can be tested). Github-Pull: #29747 Rebased-From: b7e7e727abd86104ee58beb648a94e2f453d1f6d --- depends/packages/qt.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 047d1d5aee178..0e37deb01e7fd 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -180,6 +180,7 @@ $(package)_config_opts_mingw32 += -xplatform win32-g++ $(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'" $(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'" $(package)_config_opts_mingw32 += "QMAKE_CXXFLAGS = '$($(package)_cxxflags) $($(package)_cppflags)'" +$(package)_config_opts_mingw32 += "QMAKE_LINK = '$($(package)_cxx)'" $(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'" $(package)_config_opts_mingw32 += "QMAKE_LIB = '$($(package)_ar) rc'" $(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-" From d9ef6cf934cbd8e9b2f8256de001ca44f74ad6e9 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Thu, 11 Apr 2024 16:08:01 +0200 Subject: [PATCH 07/16] sign: don't assume we are parsing a sane Miniscript The script provided for signature might be externally provided, for instance by way of 'finalizepsbt'. Therefore the script might be ill-crafted, so don't assume pubkeys are always 32 bytes. Thanks to Niklas for finding this. Github-Pull: #29853 Rebased-From: 4d8d21320eba54571ff63931509cd515c3e20339 --- src/script/sign.cpp | 2 +- src/test/script_tests.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 251a8420f7464..d91a246d03cda 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -295,7 +295,7 @@ struct TapSatisfier: Satisfier { //! Conversion from a raw xonly public key. template std::optional FromPKBytes(I first, I last) const { - CHECK_NONFATAL(last - first == 32); + if (last - first != 32) return {}; XOnlyPubKey pubkey; std::copy(first, last, pubkey.begin()); return pubkey; diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 624d0b2c129f6..50715e9a04011 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1276,6 +1276,30 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) BOOST_CHECK(combined.scriptSig == partial3c); } +/** + * Reproduction of an exception incorrectly raised when parsing a public key inside a TapMiniscript. + */ +BOOST_AUTO_TEST_CASE(sign_invalid_miniscript) +{ + FillableSigningProvider keystore; + SignatureData sig_data; + CMutableTransaction prev, curr; + + // Create a Taproot output which contains a leaf in which a non-32 bytes push is used where a public key is expected + // by the Miniscript parser. This offending Script was found by the RPC fuzzer. + const auto invalid_pubkey{ParseHex("173d36c8c9c9c9ffffffffffff0200000000021e1e37373721361818181818181e1e1e1e19000000000000000000b19292929292926b006c9b9b9292")}; + TaprootBuilder builder; + builder.Add(0, {invalid_pubkey}, 0xc0); + XOnlyPubKey nums{ParseHex("50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0")}; + builder.Finalize(nums); + prev.vout.emplace_back(0, GetScriptForDestination(builder.GetOutput())); + curr.vin.emplace_back(COutPoint{prev.GetHash(), 0}); + sig_data.tr_spenddata = builder.GetSpendData(); + + // SignSignature can fail but it shouldn't raise an exception (nor crash). + BOOST_CHECK(!SignSignature(keystore, CTransaction(prev), curr, 0, SIGHASH_ALL, sig_data)); +} + BOOST_AUTO_TEST_CASE(script_standard_push) { ScriptError err; From 7ecdb0846dd7d5ff66aec961515c552a531d25f8 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 11 Apr 2024 16:51:43 +0200 Subject: [PATCH 08/16] ci: Bump s390x to ubuntu:24.04 Re-enable feature_init Github-Pull: #29856 Rebased-From: fadf7e90dc10e212e59bb294209bab2e73c47800 --- ci/test/00_setup_env_s390x.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh index ca84ecce5153c..2fd94e253cac7 100755 --- a/ci/test/00_setup_env_s390x.sh +++ b/ci/test/00_setup_env_s390x.sh @@ -9,8 +9,8 @@ export LC_ALL=C.UTF-8 export HOST=s390x-linux-gnu export PACKAGES="python3-zmq" export CONTAINER_NAME=ci_s390x -export CI_IMAGE_NAME_TAG="docker.io/s390x/debian:bookworm" -export TEST_RUNNER_EXTRA="--exclude feature_init,rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 +export CI_IMAGE_NAME_TAG="docker.io/s390x/ubuntu:24.04" +export TEST_RUNNER_EXTRA="--exclude rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 export RUN_FUNCTIONAL_TESTS=true export GOAL="install" export BITCOIN_CONFIG="--enable-reduce-exports" From c587753f484d2ccb5b93a7cd37c7a8d491e03818 Mon Sep 17 00:00:00 2001 From: laanwj <126646+laanwj@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:25:50 +0100 Subject: [PATCH 09/16] doc: Suggest installing dev packages for debian/ubuntu qt5 build Pretty much all library packages were renamed in the 64-bit time_t migration to add `t64` (even on 64-bit platforms). Instead of complicating the doc with conditional package names, suggest installing the `-dev` packages which still have the same name, and besides that, are the right way to go about it as they contain the "user facing" C++ headers needed to build against Qt5. For Fedora, devel packages are already suggested. This affects Ubuntu 24.04 and Debian Testing. Github-Pull: #29764 Rebased-From: a3c6a13cb23999fa70c428f1229acbf1b3883f11 --- doc/build-unix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index bf367fc4216b1..94404a6d0ddcc 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -81,7 +81,7 @@ To build without GUI pass `--without-gui`. To build with Qt 5 you need the following: - sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools + sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools Additionally, to support Wayland protocol for modern desktop environments: From f9b76bae57a79f55b3a6eff0a029b5dc21b1730c Mon Sep 17 00:00:00 2001 From: laanwj <126646+laanwj@users.noreply.github.com> Date: Fri, 29 Mar 2024 11:15:40 +0100 Subject: [PATCH 10/16] ci: Pull in qtbase5-dev instead of seperate low-level libraries Fix CI build for t64 migration. Github-Pull: #29764 Rebased-From: 6c2990416e2dabd845f5ec50ec6ff138136c9b08 --- .github/workflows/ci.yml | 2 +- ci/test/00_setup_env_native_tidy.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8fa7f9a689e8..b306a1e96ac32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD ^$(git rev-list -n1 --merges HEAD)^@ | head -1)" >> "$GITHUB_ENV" - run: | sudo apt-get update - sudo apt-get install clang ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y + sudo apt-get install clang ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y - name: Compile and run tests run: | # Run tests on commits after the last merge commit and before the PR head commit diff --git a/ci/test/00_setup_env_native_tidy.sh b/ci/test/00_setup_env_native_tidy.sh index c03392af063c4..6ae513031c385 100755 --- a/ci/test/00_setup_env_native_tidy.sh +++ b/ci/test/00_setup_env_native_tidy.sh @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04" export CONTAINER_NAME=ci_native_tidy export TIDY_LLVM_V="17" -export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq bear cmake libevent-dev libboost-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev systemtap-sdt-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev" +export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq bear cmake libevent-dev libboost-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev systemtap-sdt-dev qtbase5-dev qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev" export NO_DEPENDS=1 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false From 7f45e0017417d1a100c60ff02cc72eb788b6f9c6 Mon Sep 17 00:00:00 2001 From: laanwj <126646+laanwj@users.noreply.github.com> Date: Sun, 28 Apr 2024 13:40:22 +0200 Subject: [PATCH 11/16] depends: Fix build of Qt for 32-bit platforms The 32 to 64-bit time_t transition causes a build failure in the built-in zlib about conflicting _TIME_BITS and _FILE_OFFSET_BITS. Note that zlib doesn't use time_t at all, so it is a false alarm. Take the following patch from upstream zlib: https://github.com/madler/zlib/commit/a566e156b3fa07b566ddbf6801b517a9dba04fa3.patch Closes #29980. Github-Pull: #29985 Rebased-From: 2e266f33b5d2be5c233c2c692481f75785714fa1 --- depends/packages/qt.mk | 2 ++ depends/patches/qt/zlib-timebits64.patch | 31 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 depends/patches/qt/zlib-timebits64.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 0e37deb01e7fd..12820dd65bf83 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -23,6 +23,7 @@ $(package)_patches += guix_cross_lib_path.patch $(package)_patches += fix-macos-linker.patch $(package)_patches += memory_resource.patch $(package)_patches += windows_lto.patch +$(package)_patches += zlib-timebits64.patch $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_sha256_hash=38b942bc7e62794dd072945c8a92bb9dfffed24070aea300327a3bb42f855609 @@ -256,6 +257,7 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \ patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \ patch -p1 -i $($(package)_patch_dir)/windows_lto.patch && \ + patch -p1 -i $($(package)_patch_dir)/zlib-timebits64.patch && \ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ diff --git a/depends/patches/qt/zlib-timebits64.patch b/depends/patches/qt/zlib-timebits64.patch new file mode 100644 index 0000000000000..139c1dfa77f3e --- /dev/null +++ b/depends/patches/qt/zlib-timebits64.patch @@ -0,0 +1,31 @@ +From a566e156b3fa07b566ddbf6801b517a9dba04fa3 Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Sat, 29 Jul 2023 22:13:09 -0700 +Subject: [PATCH] Avoid compiler complaints if _TIME_BITS defined when building + zlib. + +zlib does not use time_t, so _TIME_BITS is irrelevant. However it +may be defined anyway as part of a sledgehammer indiscriminately +applied to all builds. + +From https://github.com/madler/zlib/commit/a566e156b3fa07b566ddbf6801b517a9dba04fa3.patch +--- + qtbase/src/3rdparty/zlib/src/gzguts.h | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/qtbase/src/3rdparty/zlib/src/gzguts.h b/qtbase/src/3rdparty/zlib/src/gzguts.h +index e23f831f5..f9375047e 100644 +--- a/qtbase/src/3rdparty/zlib/src/gzguts.h ++++ b/qtbase/src/3rdparty/zlib/src/gzguts.h +@@ -26,9 +26,8 @@ + # ifndef _LARGEFILE_SOURCE + # define _LARGEFILE_SOURCE 1 + # endif +-# ifdef _FILE_OFFSET_BITS +-# undef _FILE_OFFSET_BITS +-# endif ++# undef _FILE_OFFSET_BITS ++# undef _TIME_BITS + #endif + + #ifdef HAVE_HIDDEN From 6685affe92ce61a586d257b3ccdf0d97f8b9ef85 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Fri, 10 May 2024 20:01:05 +0100 Subject: [PATCH 12/16] rpc: move UniValue in blockToJSON Without explicitly declaring the move, these UniValues get copied, causing increased memory usage. Fix this by explicitly moving the UniValue objects. Used by `rest_block` and `getblock` RPC. Github-Pull: #30094 Rebased-From: b77bad309e92f176f340598eec056eb7bff86f5f --- src/rpc/blockchain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 7b84747a3fd8b..1ed1ed50c2d36 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -190,12 +190,12 @@ UniValue blockToJSON(BlockManager& blockman, const CBlock& block, const CBlockIn const CTxUndo* txundo = (have_undo && i > 0) ? &blockUndo.vtxundo.at(i - 1) : nullptr; UniValue objTx(UniValue::VOBJ); TxToUniv(*tx, /*block_hash=*/uint256(), /*entry=*/objTx, /*include_hex=*/true, RPCSerializationFlags(), txundo, verbosity); - txs.push_back(objTx); + txs.push_back(std::move(objTx)); } break; } - result.pushKV("tx", txs); + result.pushKV("tx", std::move(txs)); return result; } From 96d0e818c5801d4af5570241cd9949cddbacba5e Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Mon, 15 Apr 2024 09:57:28 +0200 Subject: [PATCH 13/16] rpc: Reword SighashFromStr error message Github-Pull: #29870 Rebased-From: fa6ab0d020d0b1492203f7eb2ccb8051812de086 --- src/core_read.cpp | 2 +- test/functional/rpc_psbt.py | 4 ++-- test/functional/rpc_signrawtransactionwithkey.py | 2 +- test/functional/wallet_signrawtransactionwithwallet.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core_read.cpp b/src/core_read.cpp index dfabf3a0c2f3d..ffc4bb496566b 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -257,6 +257,6 @@ util::Result SighashFromStr(const std::string& sighash) if (it != map_sighash_values.end()) { return it->second; } else { - return util::Error{Untranslated(sighash + " is not a valid sighash parameter.")}; + return util::Error{Untranslated("'" + sighash + "' is not a valid sighash parameter.")}; } } diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index 60df48f025cfc..d9d8eaf759f65 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -889,7 +889,7 @@ def test_psbt_input_keys(psbt_input, keys): assert_equal(comb_psbt, psbt) self.log.info("Test walletprocesspsbt raises if an invalid sighashtype is passed") - assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].walletprocesspsbt, psbt, sighashtype="all") + assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].walletprocesspsbt, psbt, sighashtype="all") self.log.info("Test decoding PSBT with per-input preimage types") # note that the decodepsbt RPC doesn't check whether preimages and hashes match @@ -996,7 +996,7 @@ def test_psbt_input_keys(psbt_input, keys): self.nodes[2].sendrawtransaction(processed_psbt['hex']) self.log.info("Test descriptorprocesspsbt raises if an invalid sighashtype is passed") - assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[2].descriptorprocesspsbt, psbt, [descriptor], sighashtype="all") + assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[2].descriptorprocesspsbt, psbt, [descriptor], sighashtype="all") if __name__ == '__main__': diff --git a/test/functional/rpc_signrawtransactionwithkey.py b/test/functional/rpc_signrawtransactionwithkey.py index 0913f5057e510..268584331ec32 100755 --- a/test/functional/rpc_signrawtransactionwithkey.py +++ b/test/functional/rpc_signrawtransactionwithkey.py @@ -124,7 +124,7 @@ def invalid_sighashtype_test(self): self.log.info("Test signing transaction with invalid sighashtype") tx = self.nodes[0].createrawtransaction(INPUTS, OUTPUTS) privkeys = [self.nodes[0].get_deterministic_priv_key().key] - assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithkey, tx, privkeys, sighashtype="all") + assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithkey, tx, privkeys, sighashtype="all") def run_test(self): self.successful_signing_test() diff --git a/test/functional/wallet_signrawtransactionwithwallet.py b/test/functional/wallet_signrawtransactionwithwallet.py index d560dfdc11cad..17aef1ca9715e 100755 --- a/test/functional/wallet_signrawtransactionwithwallet.py +++ b/test/functional/wallet_signrawtransactionwithwallet.py @@ -56,7 +56,7 @@ def test_with_lock_outputs(self): def test_with_invalid_sighashtype(self): self.log.info("Test signrawtransactionwithwallet raises if an invalid sighashtype is passed") - assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithwallet, hexstring=RAW_TX, sighashtype="all") + assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithwallet, hexstring=RAW_TX, sighashtype="all") def script_verification_error_test(self): """Create and sign a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script. From ec5ce2fb2b34cdf9691557121faa69298daa97f2 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Tue, 21 May 2024 23:19:51 -0400 Subject: [PATCH 14/16] windeploy: Renew certificate Github-Pull: #30149 Rebased-From: 9f4ff1e9659597307f62510f1885ad8da3a1d9a3 --- contrib/windeploy/win-codesign.cert | 44 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/contrib/windeploy/win-codesign.cert b/contrib/windeploy/win-codesign.cert index 22f17296b6aaa..ec60a3018d91f 100644 --- a/contrib/windeploy/win-codesign.cert +++ b/contrib/windeploy/win-codesign.cert @@ -1,8 +1,8 @@ -----BEGIN CERTIFICATE----- -MIIHfDCCBWSgAwIBAgIQCmVvdQal72U2QxbUTT3SRTANBgkqhkiG9w0BAQsFADBp +MIIHeTCCBWGgAwIBAgIQBzR46J2yq3g++NbQS/BBVDANBgkqhkiG9w0BAQsFADBp MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xQTA/BgNVBAMT OERpZ2lDZXJ0IFRydXN0ZWQgRzQgQ29kZSBTaWduaW5nIFJTQTQwOTYgU0hBMzg0 -IDIwMjEgQ0ExMB4XDTIyMDUyNDAwMDAwMFoXDTI0MDUyOTIzNTk1OVowgYAxCzAJ +IDIwMjEgQ0ExMB4XDTI0MDUyMjAwMDAwMFoXDTI3MDUzMTIzNTk1OVowgYAxCzAJ BgNVBAYTAlVTMREwDw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- -----BEGIN CERTIFICATE----- MIIGsDCCBJigAwIBAgIQCK1AsmDSnEyfXs2pvZOu2TANBgkqhkiG9w0BAQwFADBi From 21d9aaae3226d76094d323c1de8e1470c5384622 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Fri, 11 Aug 2023 16:12:42 -0600 Subject: [PATCH 15/16] p2p, bugfix: detect addnode cjdns peers in GetAddedNodeInfo() Addnode (manual) peers connected to us via the cjdns network are currently not detected by CConnman::GetAddedNodeInfo(), i.e. fConnected is always false. This causes the following issues: - RPC `getaddednodeinfo` incorrectly shows them as not connected - CConnman::ThreadOpenAddedConnections() continually retries to connect them Github-Pull: #30085 Rebased-From: 684da9707040ce25d95b2954eda50b811136d92c --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 5305e1148ad4f..36a8964bb6d17 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2794,7 +2794,7 @@ std::vector CConnman::GetAddedNodeInfo() const } for (const auto& addr : lAddresses) { - CService service(LookupNumeric(addr.m_added_node, GetDefaultPort(addr.m_added_node))); + CService service{MaybeFlipIPv6toCJDNS(LookupNumeric(addr.m_added_node, GetDefaultPort(addr.m_added_node)))}; AddedNodeInfo addedNode{addr, CService(), false, false}; if (service.IsValid()) { // strAddNode is an IP:port From aa7e876953c460e8ff97a719fdb18f4f3ac4896f Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 17 Apr 2024 13:51:56 +0100 Subject: [PATCH 16/16] [doc] add draft release notes for 26.2rc1 --- doc/release-notes.md | 90 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 doc/release-notes.md diff --git a/doc/release-notes.md b/doc/release-notes.md new file mode 100644 index 0000000000000..127d14f4ce2c6 --- /dev/null +++ b/doc/release-notes.md @@ -0,0 +1,90 @@ +26.2rc1 Release Notes +================== + +Bitcoin Core version 26.2rc1 is now available from: + + + +This release includes new features, various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux kernel, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### Script + +- #29853: sign: don't assume we are parsing a sane TapMiniscript + +### P2P and network changes + +- #29691: Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us +- #30085: p2p: detect addnode cjdns peers in GetAddedNodeInfo() + +### RPC + +- #29869: rpc, bugfix: Enforce maximum value for setmocktime +- #28554: bugfix: throw an error if an invalid parameter is passed to getnetworkhashps RPC +- #30094: rpc: move UniValue in blockToJSON +- #29870: rpc: Reword SighashFromStr error message + +### Build + +- #29747: depends: fix mingw-w64 Qt DEBUG=1 build +- #29985: depends: Fix build of Qt for 32-bit platforms with recent glibc + +### Misc + +- #29776: ThreadSanitizer: Fix #29767 +- #29856: ci: Bump s390x to ubuntu:24.04 +- #29764: doc: Suggest installing dev packages for debian/ubuntu qt5 build +- #30149: contrib: Renew Windows code signing certificate + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- Antoine Poinsot +- Ava Chow +- dergoegge +- fanquake +- glozow +- Jameson Lopp +- jonatack +- laanwj +- Luke Dashjr +- MarcoFalke +- nanlour +- willcl-ark + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/).