diff options
author | merge-script <fanquake@gmail.com> | 2024-05-13 11:53:26 +0800 |
---|---|---|
committer | merge-script <fanquake@gmail.com> | 2024-05-13 11:53:26 +0800 |
commit | c7885ecd778d7e42bc07a0ba73156525e86a8aae (patch) | |
tree | 5c35568d75935595ecf024834a9d0ebcb8001530 | |
parent | d82283950f5ff3b2116e705f931c6e89e5fdd0be (diff) | |
parent | bd5860bc7a892c6bcffe313246dd6b81b973b9c6 (diff) |
Merge bitcoin/bitcoin#29888: [27.x] Backports
bd5860bc7a892c6bcffe313246dd6b81b973b9c6 [WIP] doc: release notes for 27.x (fanquake)
475aac41fba0b55a487c7fe21a1f540d3f0bb7b6 doc: add LLVM instruction for macOS < 13 (Sjors Provoost)
a995902d604c701be4f46087057b907de9a0ecca depends: Fix build of Qt for 32-bit platforms (laanwj)
0fcceefe22532dc6389a95d2e058599e9496003b Fix #29767, set m_synced = true after Commit() (nanlour)
ae9a2ed40a4f40bce822fb7cb47804c45e394e11 sign: don't assume we are parsing a sane Miniscript (Antoine Poinsot)
a6a59cfebc81d82fefb69c6592f4c75fcdde902f rpc: Reword SighashFromStr error message (MarcoFalke)
364bf01ff254f9fa01e14f24002af682a51b4883 build: Fix false positive `CHECK_ATOMIC` test for clang-15 (Hennadii Stepanov)
9277793b4ee70a6f0d471cf3ff3051f2eebdbb15 test: Fix failing univalue float test (MarcoFalke)
5c097910e03229150ed9b5fdae65173cfbf66740 doc: archive 27.0 release notes (fanquake)
897e5af58a1a02e3b555c52eefb8f7cb61a7a91a [rpc, bugfix] Enforce maximum value for setmocktime (dergoegge)
602cfd580a8f44a8f49b59b2a6660c54f6aec1ca ci: Bump s390x to ubuntu:24.04 (MarcoFalke)
20e6e8dc805036730672b64b768ea771a1000fd8 Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us (Luke Dashjr)
a6862c50c52f1606f8ad143da8d8f3c7e8f3f5c3 depends: fix mingw-w64 Qt DEBUG=1 build (fanquake)
Pull request description:
Backports:
* https://github.com/bitcoin/bitcoin/pull/29691
* https://github.com/bitcoin/bitcoin/pull/29747
* https://github.com/bitcoin/bitcoin/pull/29776
* https://github.com/bitcoin/bitcoin/pull/29853
* https://github.com/bitcoin/bitcoin/pull/29856
* https://github.com/bitcoin/bitcoin/pull/29859
* https://github.com/bitcoin/bitcoin/pull/29869
* https://github.com/bitcoin/bitcoin/pull/29870
* https://github.com/bitcoin/bitcoin/pull/29886
* https://github.com/bitcoin/bitcoin/pull/29892
* https://github.com/bitcoin/bitcoin/pull/29934
* https://github.com/bitcoin/bitcoin/pull/29985
ACKs for top commit:
willcl-ark:
reACK bd5860bc7a892c6bcffe313246dd6b81b973b9c6
stickies-v:
re-ACK bd5860bc7a892c6bcffe313246dd6b81b973b9c6
TheCharlatan:
ACK bd5860bc7a892c6bcffe313246dd6b81b973b9c6
Tree-SHA512: a1a40de70cf52b5fc01d9dcc772421751a18c6a48a726c4c05c0371c585a53a27902e17daed9e0d721ab7763c94bb32de05c146bd6bc73fd558edd08b31e8547
-rw-r--r-- | build-aux/m4/l_atomic.m4 | 7 | ||||
-rwxr-xr-x | ci/test/00_setup_env_s390x.sh | 4 | ||||
-rw-r--r-- | depends/packages/qt.mk | 3 | ||||
-rw-r--r-- | depends/patches/qt/zlib-timebits64.patch | 31 | ||||
-rw-r--r-- | doc/build-osx.md | 14 | ||||
-rw-r--r-- | doc/release-notes.md | 174 | ||||
-rw-r--r-- | doc/release-notes/release-notes-27.0.md | 217 | ||||
-rw-r--r-- | src/core_read.cpp | 2 | ||||
-rw-r--r-- | src/index/base.cpp | 2 | ||||
-rw-r--r-- | src/kernel/chainparams.cpp | 2 | ||||
-rw-r--r-- | src/rpc/node.cpp | 7 | ||||
-rw-r--r-- | src/script/sign.cpp | 2 | ||||
-rw-r--r-- | src/test/rpc_tests.cpp | 1 | ||||
-rw-r--r-- | src/test/script_tests.cpp | 24 | ||||
-rw-r--r-- | src/univalue/test/object.cpp | 2 | ||||
-rwxr-xr-x | test/functional/rpc_psbt.py | 4 | ||||
-rwxr-xr-x | test/functional/rpc_signrawtransactionwithkey.py | 2 | ||||
-rwxr-xr-x | test/functional/rpc_uptime.py | 2 | ||||
-rwxr-xr-x | test/functional/wallet_signrawtransactionwithwallet.py | 2 |
19 files changed, 336 insertions, 166 deletions
diff --git a/build-aux/m4/l_atomic.m4 b/build-aux/m4/l_atomic.m4 index aa00168fce..859ddaabbb 100644 --- a/build-aux/m4/l_atomic.m4 +++ b/build-aux/m4/l_atomic.m4 @@ -7,7 +7,7 @@ dnl warranty. # Clang, when building for 32-bit, # and linking against libstdc++, requires linking with # -latomic if using the C++ atomic library. -# Can be tested with: clang++ test.cpp -m32 +# Can be tested with: clang++ -std=c++20 test.cpp -m32 # # Sourced from http://bugs.debian.org/797228 @@ -27,8 +27,11 @@ m4_define([_CHECK_ATOMIC_testbody], [[ auto t1 = t.load(); t.compare_exchange_strong(t1, 3s); - std::atomic<int64_t> a{}; + std::atomic<double> d{}; + d.store(3.14); + auto d1 = d.load(); + std::atomic<int64_t> a{}; int64_t v = 5; int64_t r = a.fetch_add(v); return static_cast<int>(r); diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh index ca84ecce51..2fd94e253c 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" diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 5608e5f073..4b65afda54 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -24,6 +24,7 @@ $(package)_patches += fix-macos-linker.patch $(package)_patches += memory_resource.patch $(package)_patches += utc_from_string_no_optimize.patch $(package)_patches += windows_lto.patch +$(package)_patches += zlib-timebits64.patch $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_sha256_hash=a31785948c640b7c66d9fe2db4993728ca07f64e41c560b3625ad191b276ff20 @@ -178,6 +179,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)-" @@ -254,6 +256,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 0000000000..139c1dfa77 --- /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 <madler@alumni.caltech.edu> +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 diff --git a/doc/build-osx.md b/doc/build-osx.md index 5c3dc1ac7f..20c92ab7a4 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -51,6 +51,20 @@ To install, run the following from your terminal: brew install automake libtool boost pkg-config libevent ``` +For macOS 11 (Big Sur) and 12 (Monterey) you need to install a more recent version of llvm. + +``` bash +brew install llvm +``` + +And append the following to the configure commands below: + +``` bash +CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ +``` + +Try `llvm@17` if compilation fails with the default version of llvm. + ### 4. Clone Bitcoin repository `git` should already be installed by default on your system. diff --git a/doc/release-notes.md b/doc/release-notes.md index 5060068328..00a6cc9447 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,8 +1,8 @@ -Bitcoin Core version 27.0 is now available from: +Bitcoin Core version 27.x is now available from: - <https://bitcoincore.org/bin/bitcoin-core-27.0/> + <https://bitcoincore.org/bin/bitcoin-core-27.x/> -This release includes new features, various bug fixes and performance +This release includes various bug fixes and performance improvements, as well as updated translations. Please report bugs using the issue tracker at GitHub: @@ -37,181 +37,55 @@ unsupported systems. Notable changes =============== -libbitcoinconsensus -------------------- - -- libbitcoinconsensus is deprecated and will be removed for v28. This library has - existed for nearly 10 years with very little known uptake or impact. It has - become a maintenance burden. +### Miniscript - The underlying functionality does not change between versions, so any users of - the library can continue to use the final release indefinitely, with the - understanding that Taproot is its final consensus update. +- #29853 sign: don't assume we are parsing a sane TapMiniscript - In the future, libbitcoinkernel will provide a much more useful API that is - aware of the UTXO set, and therefore be able to fully validate transactions and - blocks. (#29189) +### RPC -mempool.dat compatibility -------------------------- +- #29869 rpc, bugfix: Enforce maximum value for setmocktime +- #29870 rpc: Reword SighashFromStr error message -- The `mempool.dat` file created by -persistmempool or the savemempool RPC will - be written in a new format. This new format includes the XOR'ing of transaction - contents to mitigate issues where external programs (such as anti-virus) attempt - to interpret and potentially modify the file. +### Index - This new format can not be read by previous software releases. To allow for a - downgrade, a temporary setting `-persistmempoolv1` has been added to fall back - to the legacy format. (#28207) +- #29776 Fix #29767, set m_synced = true after Commit() -P2P and network changes ------------------------ +### Test -- BIP324 v2 transport is now enabled by default. It remains possible to disable v2 - by running with `-v2transport=0`. (#29347) -- Manual connection options (`-connect`, `-addnode` and `-seednode`) will - now follow `-v2transport` to connect with v2 by default. They will retry with - v1 on failure. (#29058) +- #29892 test: Fix failing univalue float test -- Network-adjusted time has been removed from consensus code. It is replaced - with (unadjusted) system time. The warning for a large median time offset - (70 minutes or more) is kept. This removes the implicit security assumption of - requiring an honest majority of outbound peers, and increases the importance - of the node operator ensuring their system time is (and stays) correct to not - fall out of consensus with the network. (#28956) +### Build -Mempool Policy Changes ----------------------- +- #29747 depends: fix mingw-w64 Qt DEBUG=1 build +- #29859 build: Fix false positive CHECK_ATOMIC test +- #29985 depends: Fix build of Qt for 32-bit platforms with recent glibc -- Opt-in Topologically Restricted Until Confirmation (TRUC) Transactions policy - (aka v3 transaction policy) is available for use on test networks when - `-acceptnonstdtxn=1` is set. By setting the transaction version number to 3, TRUC transactions - request the application of limits on spending of their unconfirmed outputs. These - restrictions simplify the assessment of incentive compatibility of accepting or - replacing TRUC transactions, thus ensuring any replacements are more profitable for - the node and making fee-bumping more reliable. TRUC transactions are currently - nonstandard and can only be used on test networks where the standardness rules are - relaxed or disabled (e.g. with `-acceptnonstdtxn=1`). (#28948) +### Doc -External Signing ----------------- +- #29934 doc: add LLVM instruction for macOS < 13 -- Support for external signing on Windows has been disabled. It will be re-enabled - once the underlying dependency (Boost Process), has been replaced with a different - library. (#28967) +### CI -Updated RPCs ------------- +- #29856 ci: Bump s390x to ubuntu:24.04 -- The addnode RPC now follows the `-v2transport` option (now on by default, see above) for making connections. - It remains possible to specify the transport type manually with the v2transport argument of addnode. (#29239) +### Misc -Build System ------------- - -- A C++20 capable compiler is now required to build Bitcoin Core. (#28349) -- MacOS releases are configured to use the hardened runtime libraries (#29127) - -Wallet ------- - -- The CoinGrinder coin selection algorithm has been introduced to mitigate unnecessary - large input sets and lower transaction costs at high feerates. CoinGrinder - searches for the input set with minimal weight. Solutions found by - CoinGrinder will produce a change output. CoinGrinder is only active at - elevated feerates (default: 30+ sat/vB, based on `-consolidatefeerate`×3). (#27877) -- The Branch And Bound coin selection algorithm will be disabled when the subtract fee - from outputs feature is used. (#28994) -- If the birth time of a descriptor is detected to be later than the first transaction - involving that descriptor, the birth time will be reset to the earlier time. (#28920) - -Low-level changes -================= - -Pruning -------- - -- When pruning during initial block download, more blocks will be pruned at each - flush in order to speed up the syncing of such nodes. (#20827) - -Init ----- - -- Various fixes to prevent issues where subsequent instances of Bitcoin Core would - result in deletion of files in use by an existing instance. (#28784, #28946) -- Improved handling of empty `settings.json` files. (#29144) +- #29691 Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us Credits ======= Thanks to everyone who directly contributed to this release: -- 22388o⚡️ -- Aaron Clauson -- Amiti Uttarwar -- Andrew Toth -- Anthony Towns - Antoine Poinsot -- Ava Chow -- Brandon Odiwuor -- brunoerg -- Chris Stewart -- Cory Fields - dergoegge -- djschnei21 -- Fabian Jahr - fanquake -- furszy -- Gloria Zhao -- Greg Sanders - Hennadii Stepanov -- Hernan Marino -- iamcarlos94 -- ismaelsadeeq -- Jameson Lopp -- Jesse Barton -- John Moffett -- Jon Atack -- josibake -- jrakibi -- Justin Dhillon -- Kashif Smith -- kevkevin -- Kristaps Kaupe -- L0la L33tz +- laanwj - Luke Dashjr -- Lőrinc -- marco - MarcoFalke -- Mark Friedenbach -- Marnix -- Martin Leitner-Ankerl -- Martin Zumsande -- Max Edwards -- Murch -- muxator -- naiyoma -- Nikodemas Tuckus -- ns-xvrn -- pablomartin4btc -- Peter Todd -- Pieter Wuille -- Richard Myers -- Roman Zeyde -- Russell Yanofsky -- Ryan Ofsky -- Sebastian Falbesoner -- Sergi Delgado Segura +- nanlour - Sjors Provoost -- stickies-v -- stratospher -- Supachai Kheawjuy -- TheCharlatan -- UdjinM6 -- Vasil Dimov -- w0xlt -- willcl-ark - As well as to everyone that helped with translations on [Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-27.0.md b/doc/release-notes/release-notes-27.0.md new file mode 100644 index 0000000000..5060068328 --- /dev/null +++ b/doc/release-notes/release-notes-27.0.md @@ -0,0 +1,217 @@ +Bitcoin Core version 27.0 is now available from: + + <https://bitcoincore.org/bin/bitcoin-core-27.0/> + +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: + + <https://github.com/bitcoin/bitcoin/issues> + +To receive security and update notifications, please subscribe to: + + <https://bitcoincore.org/en/list/announcements/join/> + +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 3.17+, 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 +=============== + +libbitcoinconsensus +------------------- + +- libbitcoinconsensus is deprecated and will be removed for v28. This library has + existed for nearly 10 years with very little known uptake or impact. It has + become a maintenance burden. + + The underlying functionality does not change between versions, so any users of + the library can continue to use the final release indefinitely, with the + understanding that Taproot is its final consensus update. + + In the future, libbitcoinkernel will provide a much more useful API that is + aware of the UTXO set, and therefore be able to fully validate transactions and + blocks. (#29189) + +mempool.dat compatibility +------------------------- + +- The `mempool.dat` file created by -persistmempool or the savemempool RPC will + be written in a new format. This new format includes the XOR'ing of transaction + contents to mitigate issues where external programs (such as anti-virus) attempt + to interpret and potentially modify the file. + + This new format can not be read by previous software releases. To allow for a + downgrade, a temporary setting `-persistmempoolv1` has been added to fall back + to the legacy format. (#28207) + +P2P and network changes +----------------------- + +- BIP324 v2 transport is now enabled by default. It remains possible to disable v2 + by running with `-v2transport=0`. (#29347) +- Manual connection options (`-connect`, `-addnode` and `-seednode`) will + now follow `-v2transport` to connect with v2 by default. They will retry with + v1 on failure. (#29058) + +- Network-adjusted time has been removed from consensus code. It is replaced + with (unadjusted) system time. The warning for a large median time offset + (70 minutes or more) is kept. This removes the implicit security assumption of + requiring an honest majority of outbound peers, and increases the importance + of the node operator ensuring their system time is (and stays) correct to not + fall out of consensus with the network. (#28956) + +Mempool Policy Changes +---------------------- + +- Opt-in Topologically Restricted Until Confirmation (TRUC) Transactions policy + (aka v3 transaction policy) is available for use on test networks when + `-acceptnonstdtxn=1` is set. By setting the transaction version number to 3, TRUC transactions + request the application of limits on spending of their unconfirmed outputs. These + restrictions simplify the assessment of incentive compatibility of accepting or + replacing TRUC transactions, thus ensuring any replacements are more profitable for + the node and making fee-bumping more reliable. TRUC transactions are currently + nonstandard and can only be used on test networks where the standardness rules are + relaxed or disabled (e.g. with `-acceptnonstdtxn=1`). (#28948) + +External Signing +---------------- + +- Support for external signing on Windows has been disabled. It will be re-enabled + once the underlying dependency (Boost Process), has been replaced with a different + library. (#28967) + +Updated RPCs +------------ + +- The addnode RPC now follows the `-v2transport` option (now on by default, see above) for making connections. + It remains possible to specify the transport type manually with the v2transport argument of addnode. (#29239) + +Build System +------------ + +- A C++20 capable compiler is now required to build Bitcoin Core. (#28349) +- MacOS releases are configured to use the hardened runtime libraries (#29127) + +Wallet +------ + +- The CoinGrinder coin selection algorithm has been introduced to mitigate unnecessary + large input sets and lower transaction costs at high feerates. CoinGrinder + searches for the input set with minimal weight. Solutions found by + CoinGrinder will produce a change output. CoinGrinder is only active at + elevated feerates (default: 30+ sat/vB, based on `-consolidatefeerate`×3). (#27877) +- The Branch And Bound coin selection algorithm will be disabled when the subtract fee + from outputs feature is used. (#28994) +- If the birth time of a descriptor is detected to be later than the first transaction + involving that descriptor, the birth time will be reset to the earlier time. (#28920) + +Low-level changes +================= + +Pruning +------- + +- When pruning during initial block download, more blocks will be pruned at each + flush in order to speed up the syncing of such nodes. (#20827) + +Init +---- + +- Various fixes to prevent issues where subsequent instances of Bitcoin Core would + result in deletion of files in use by an existing instance. (#28784, #28946) +- Improved handling of empty `settings.json` files. (#29144) + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- 22388o⚡️ +- Aaron Clauson +- Amiti Uttarwar +- Andrew Toth +- Anthony Towns +- Antoine Poinsot +- Ava Chow +- Brandon Odiwuor +- brunoerg +- Chris Stewart +- Cory Fields +- dergoegge +- djschnei21 +- Fabian Jahr +- fanquake +- furszy +- Gloria Zhao +- Greg Sanders +- Hennadii Stepanov +- Hernan Marino +- iamcarlos94 +- ismaelsadeeq +- Jameson Lopp +- Jesse Barton +- John Moffett +- Jon Atack +- josibake +- jrakibi +- Justin Dhillon +- Kashif Smith +- kevkevin +- Kristaps Kaupe +- L0la L33tz +- Luke Dashjr +- Lőrinc +- marco +- MarcoFalke +- Mark Friedenbach +- Marnix +- Martin Leitner-Ankerl +- Martin Zumsande +- Max Edwards +- Murch +- muxator +- naiyoma +- Nikodemas Tuckus +- ns-xvrn +- pablomartin4btc +- Peter Todd +- Pieter Wuille +- Richard Myers +- Roman Zeyde +- Russell Yanofsky +- Ryan Ofsky +- Sebastian Falbesoner +- Sergi Delgado Segura +- Sjors Provoost +- stickies-v +- stratospher +- Supachai Kheawjuy +- TheCharlatan +- UdjinM6 +- Vasil Dimov +- w0xlt +- willcl-ark + + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/src/core_read.cpp b/src/core_read.cpp index e32e46d1b9..5956d9df5f 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -256,6 +256,6 @@ util::Result<int> 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/src/index/base.cpp b/src/index/base.cpp index bcfe7215be..af7a80392d 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -164,9 +164,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)) { diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp index 264a2fd681..26c261eba2 100644 --- a/src/kernel/chainparams.cpp +++ b/src/kernel/chainparams.cpp @@ -133,7 +133,7 @@ public: // 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.net."); // Peter Todd, only supports x1, x5, x9, and xd diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp index 45053f882d..02e56e61eb 100644 --- a/src/rpc/node.cpp +++ b/src/rpc/node.cpp @@ -26,6 +26,7 @@ #include <univalue.h> #include <util/any.h> #include <util/check.h> +#include <util/time.h> #include <stdint.h> #ifdef HAVE_MALLOC_INFO @@ -58,9 +59,11 @@ static RPCHelpMan setmocktime() LOCK(cs_main); const int64_t time{request.params[0].getInt<int64_t>()}; - if (time < 0) { - throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime cannot be negative: %s.", time)); + constexpr int64_t max_time{Ticks<std::chrono::seconds>(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/src/script/sign.cpp b/src/script/sign.cpp index be4b357568..22ac062a63 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -295,7 +295,7 @@ struct TapSatisfier: Satisfier<XOnlyPubKey> { //! Conversion from a raw xonly public key. template <typename I> std::optional<XOnlyPubKey> 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/rpc_tests.cpp b/src/test/rpc_tests.cpp index 0d2460c606..3a1cb45e8d 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -291,6 +291,7 @@ BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values) BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("1e-8")), COIN/100000000); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.1e-7")), COIN/100000000); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.01e-6")), COIN/100000000); + BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.00000000000000000000000000000000000001e+30")), 1); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.0000000000000000000000000000000000000000000000000000000000000000000000000001e+68")), COIN/100000000); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("10000000000000000000000000000000000000000000000000000000000000000e-64")), COIN); BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("0.000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000e64")), COIN); diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index ac457d9c77..f61eb38679 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1277,6 +1277,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; diff --git a/src/univalue/test/object.cpp b/src/univalue/test/object.cpp index 8b90448b36..1c724555f3 100644 --- a/src/univalue/test/object.cpp +++ b/src/univalue/test/object.cpp @@ -421,7 +421,7 @@ void univalue_readwrite() // Valid, with leading or trailing whitespace BOOST_CHECK(v.read(" 1.0") && (v.get_real() == 1.0)); BOOST_CHECK(v.read("1.0 ") && (v.get_real() == 1.0)); - BOOST_CHECK(v.read("0.00000000000000000000000000000000000001e+30 ") && v.get_real() == 1e-8); + BOOST_CHECK(v.read("0.00000000000000000000000000000000000001e+30 ")); BOOST_CHECK(!v.read(".19e-6")); //should fail, missing leading 0, therefore invalid JSON // Invalid, initial garbage diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index 016aa3ba11..117a65121d 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -886,7 +886,7 @@ class PSBTTest(BitcoinTestFramework): 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 @@ -992,7 +992,7 @@ class PSBTTest(BitcoinTestFramework): 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 0913f5057e..268584331e 100755 --- a/test/functional/rpc_signrawtransactionwithkey.py +++ b/test/functional/rpc_signrawtransactionwithkey.py @@ -124,7 +124,7 @@ class SignRawTransactionWithKeyTest(BitcoinTestFramework): 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/rpc_uptime.py b/test/functional/rpc_uptime.py index cb99e483ec..f8df59d02a 100755 --- a/test/functional/rpc_uptime.py +++ b/test/functional/rpc_uptime.py @@ -23,7 +23,7 @@ class UptimeTest(BitcoinTestFramework): 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 diff --git a/test/functional/wallet_signrawtransactionwithwallet.py b/test/functional/wallet_signrawtransactionwithwallet.py index b0517f951d..612a2542e7 100755 --- a/test/functional/wallet_signrawtransactionwithwallet.py +++ b/test/functional/wallet_signrawtransactionwithwallet.py @@ -55,7 +55,7 @@ class SignRawTransactionWithWalletTest(BitcoinTestFramework): 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. |