Merge bitcoin/bitcoin#32589: [29.x] More backports

0922f6bbc3 doc: update release notes for 29.x (fanquake)
5697605414 contrib: tracing: Correctly read msg type in p2p_monitor.py (David Gumberg)
4c7ed36c96 test: Fix list index out of range error in feature_bip68_sequence.py (zaidmstrr)
3e23b47a6f doc: fix transifex 404s (fanquake)
616baf3c27 doc: taproot became always active in v24.0 (Sjors Provoost)
ef6111bd18 depends: capnp 1.2.0 (fanquake)
8246c6a65f test: wallet, coverage for crash on dup block disconnection during unclean shutdown (Martin Zumsande)
a18085a18b wallet: fix crash on double block disconnection (furszy)
7264459c0d build: patch cmake min version on freetype (josibake)
27c533052c doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" (Hodlinator)
1b51d750ad depends: fix SHA256SUM command on OpenBSD (use GNU mode output) (Sebastian Falbesoner)
aea8a394b1 doc: make `-DWITH_ZMQ=ON` explicit on `build-unix.md` (Luis Schwab)
23e76ef520 guix: warn and abort when SOURCE_DATE_EPOCH is set (will)
876a7b2db5 doc: add missing packages for BSDs (cmake, gmake, curl) to depends/README.md (Sebastian Falbesoner)
78688c8413 rpc, doc: update `listdescriptors` RCP help (rkrux)
c899334e36 rpc: Note in fundrawtransaction doc, fee rate is for package (benthecarman)
247ee59f55 doc: update tor docs to use bitcoind binary from path (ismaelsadeeq)
4a1143b083 depends: use "mkdir -p" when installing xproto (fanquake)
646fa1d028 test: fix sync function in rpc_psbt.py (Martin Zumsande)
17b31fc802 doc: Add missing top-level description to pruneblockchain RPC (nervana21)
e34b6fbcad guix: accomodate migration to codeberg (fanquake)
142153ee42 cmake: Add missed `SSE41_CXXFLAGS` (Hennadii Stepanov)

Pull request description:

  Backports
  - #31757
  - #32333
  - #32439
  - #32551 (just 800b7cc42ca63f2a6b245a4d327c7092289da6e1)
  - #32568
  - #32607
  - #32630
  - #32678
  - #32679
  - #32690 (just 8713e8060d504f561fed705b4aa5af7b96c36e75)
  - #32693
  - #32696
  - #32708
  - #32711
  - #32719
  - #32760
  - #32765
  - #32771
  - #32776
  - #32777

  Closes #32625.

ACKs for top commit:
  instagibbs:
     ACK 0922f6bbc3
  willcl-ark:
    ACK 0922f6bbc3

Tree-SHA512: 0389e5d85fa897fdbefd37635f6ec822ca5ab48a57c4d40fdd4d1be2465c676f514b0db4d72c962ee15e0090b27ff17701e167d660eaa25f855d06bbb1fe0e6e
This commit is contained in:
merge-script 2025-06-25 11:03:05 +01:00
commit 983b268768
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
31 changed files with 175 additions and 42 deletions

View file

@ -70,7 +70,7 @@ Translations
------------
Changes to translations as well as new translations can be submitted to
[Bitcoin Core's Transifex page](https://www.transifex.com/bitcoin/bitcoin/).
[Bitcoin Core's Transifex page](https://explore.transifex.com/bitcoin/bitcoin/).
Translations are periodically pulled from Transifex and merged into the git repository. See the
[translation process](doc/translation_process.md) for details on how this works.

View file

@ -319,7 +319,7 @@ Source: https://logs.guix.gnu.org/guix/2020-11-12.log#232527
Start by cloning Guix:
```
git clone https://git.savannah.gnu.org/git/guix.git
git clone https://codeberg.org/guix/guix.git
cd guix
```
@ -607,7 +607,7 @@ checklist.
```
Generation 38 Feb 22 2021 16:39:31 (current)
guix f350df4
repository URL: https://git.savannah.gnu.org/git/guix.git
repository URL: https://codeberg.org/guix/guix.git
branch: version-1.2.0
commit: f350df405fbcd5b9e27e6b6aa500da7f101f41e7
```
@ -760,8 +760,8 @@ Please see the following links for more details:
- An upstream coreutils bug has been filed: [debbugs#47940](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47940)
- A Guix bug detailing the underlying problem has been filed: [guix-issues#47935](https://issues.guix.gnu.org/47935), [guix-issues#49985](https://issues.guix.gnu.org/49985#5)
- A commit to skip this test in Guix has been merged into the core-updates branch:
[savannah/guix@6ba1058](https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
- A commit to skip this test is included since Guix 1.4.0:
[codeberg/guix@6ba1058](https://codeberg.org/guix/guix/commit/6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
[install-script]: #options-1-and-2-using-the-official-shell-installer-script-or-binary-tarball

View file

@ -69,6 +69,24 @@ fi
mkdir -p "$VERSION_BASE"
################
# SOURCE_DATE_EPOCH should not unintentionally be set
################
if [ -n "$SOURCE_DATE_EPOCH" ] && [ -z "$FORCE_SOURCE_DATE_EPOCH" ]; then
cat << EOF
ERR: Environment variable SOURCE_DATE_EPOCH is set which may break reproducibility.
Aborting...
Hint: You may want to:
1. Unset this variable: \`unset SOURCE_DATE_EPOCH\` before rebuilding
2. Set the 'FORCE_SOURCE_DATE_EPOCH' environment variable if you insist on
using your own epoch
EOF
exit 1
fi
################
# Build directories should not exist
################

View file

@ -50,7 +50,7 @@ fi
# across time.
time-machine() {
# shellcheck disable=SC2086
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
guix time-machine --url=https://codeberg.org/guix/guix.git \
--commit=53396a22afc04536ddf75d8f82ad2eafa5082725 \
--cores="$JOBS" \
--keep-failed \

View file

@ -54,7 +54,7 @@ int trace_inbound_message(struct pt_regs *ctx) {
bpf_probe_read_user_str(&msg.peer_addr, sizeof(msg.peer_addr), paddr);
bpf_usdt_readarg(3, ctx, &pconn_type);
bpf_probe_read_user_str(&msg.peer_conn_type, sizeof(msg.peer_conn_type), pconn_type);
bpf_usdt_readarg(4, ctx, &pconn_type);
bpf_usdt_readarg(4, ctx, &pmsg_type);
bpf_probe_read_user_str(&msg.msg_type, sizeof(msg.msg_type), pmsg_type);
bpf_usdt_readarg(5, ctx, &msg.msg_size);
@ -71,7 +71,7 @@ int trace_outbound_message(struct pt_regs *ctx) {
bpf_probe_read_user_str(&msg.peer_addr, sizeof(msg.peer_addr), paddr);
bpf_usdt_readarg(3, ctx, &pconn_type);
bpf_probe_read_user_str(&msg.peer_conn_type, sizeof(msg.peer_conn_type), pconn_type);
bpf_usdt_readarg(4, ctx, &pconn_type);
bpf_usdt_readarg(4, ctx, &pmsg_type);
bpf_probe_read_user_str(&msg.msg_type, sizeof(msg.msg_type), pmsg_type);
bpf_usdt_readarg(5, ctx, &msg.msg_size);

View file

@ -90,15 +90,15 @@ For linux S390X cross compilation:
### Install the required dependencies: FreeBSD
pkg install bash
pkg install bash cmake curl gmake
### Install the required dependencies: NetBSD
pkgin install bash gmake
pkgin install bash cmake curl gmake perl
### Install the required dependencies: OpenBSD
pkg_add bash gmake gtar
pkg_add bash cmake curl gmake gtar
### Dependency Options

View file

@ -1,7 +1,7 @@
build_openbsd_CC = clang
build_openbsd_CXX = clang++
build_openbsd_SHA256SUM = sha256
build_openbsd_SHA256SUM = sha256 -r
build_openbsd_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
build_openbsd_TAR = gtar

View file

@ -4,6 +4,7 @@ $(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
$(package)_patches += cmake_minimum.patch
define $(package)_set_vars
$(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DBUILD_SHARED_LIBS=TRUE
@ -12,6 +13,10 @@ define $(package)_set_vars
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch
endef
define $(package)_config_cmds
$($(package)_cmake) -S .. -B .
endef

View file

@ -1,9 +1,9 @@
package=native_capnp
$(package)_version=1.1.0
$(package)_version=1.2.0
$(package)_download_path=https://capnproto.org/
$(package)_download_file=capnproto-c++-$($(package)_version).tar.gz
$(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz
$(package)_sha256_hash=07167580e563f5e821e3b2af1c238c16ec7181612650c5901330fa9a0da50939
$(package)_sha256_hash=ed00e44ecbbda5186bc78a41ba64a8dc4a861b5f8d4e822959b0144ae6fd42ef
define $(package)_set_vars
$(package)_config_opts := -DBUILD_TESTING=OFF

View file

@ -21,6 +21,8 @@ define $(package)_build_cmds
$(MAKE)
endef
# mkdir detection is broken on Alpine. Set MKDIRPROG to ensure we always
# use "mkdir -p", and avoid parallelism issues during install.
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
$(MAKE) MKDIRPROG="mkdir -p" DESTDIR=$($(package)_staging_dir) install
endef

View file

@ -0,0 +1,13 @@
build: set minimum required CMake to 3.12
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,7 +97,7 @@
# FreeType explicitly marks the API to be exported and relies on the compiler
# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
# starting with 2.8.12.
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.12)
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
# Allow symbol visibility settings also on static libraries. CMake < 3.3

View file

@ -58,7 +58,8 @@ BIPs that are implemented by Bitcoin Core:
Validation rules for Taproot (including Schnorr signatures and Tapscript
leaves) are implemented as of **v0.21.0** ([PR 19953](https://github.com/bitcoin/bitcoin/pull/19953)),
with mainnet activation as of **v0.21.1** ([PR 21377](https://github.com/bitcoin/bitcoin/pull/21377),
[PR 21686](https://github.com/bitcoin/bitcoin/pull/21686)).
[PR 21686](https://github.com/bitcoin/bitcoin/pull/21686)),
always active as of **v24.0** ([PR 23536](https://github.com/bitcoin/bitcoin/pull/23536)).
* [`BIP 350`](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki): Addresses for native v1+ segregated Witness outputs use Bech32m instead of Bech32 as of **v22.0** ([PR 20861](https://github.com/bitcoin/bitcoin/pull/20861)).
* [`BIP 371`](https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki): Taproot fields for PSBT as of **v24.0** ([PR 22558](https://github.com/bitcoin/bitcoin/pull/22558)).
* [`BIP 379`](https://github.com/bitcoin/bips/blob/master/bip-0379.md): Miniscript was partially implemented in **v24.0** ([PR 24148](https://github.com/bitcoin/bitcoin/pull/24148)), and fully implemented as of **v26.0** ([PR 27255](https://github.com/bitcoin/bitcoin/pull/27255)).

View file

@ -60,7 +60,7 @@ executables, which are based on BerkeleyDB 4.8. Otherwise, you can build Berkele
To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
ZMQ dependencies (provides ZMQ API):
ZMQ-enabled binaries are compiled with `-DWITH_ZMQ=ON` and require the following dependency:
sudo apt-get install libzmq3-dev
@ -108,7 +108,7 @@ are based on Berkeley DB 4.8. Otherwise, you can build Berkeley DB [yourself](#b
To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
ZMQ dependencies (provides ZMQ API):
ZMQ-enabled binaries are compiled with `-DWITH_ZMQ=ON` and require the following dependency:
sudo dnf install zeromq-devel

View file

@ -2,7 +2,7 @@ Bitcoin Core version 29.x is now available from:
<https://bitcoincore.org/bin/bitcoin-core-29.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:
@ -39,6 +39,7 @@ Notable changes
### Wallet
- #31757 wallet: fix crash on double block disconnection
- #32553 wallet: Fix logging of wallet version
### Test
@ -47,6 +48,8 @@ Notable changes
- #32312 test: Fix feature_pruning test after nTime typo fix
- #32336 test: Suppress upstream -Wduplicate-decl-specifier in bpfcc
- #32483 test: fix two intermittent failures in wallet_basic.py
- #32630 test: fix sync function in rpc_psbt.py
- #32765 test: Fix list index out of range error in feature_bip68_sequence.py
### Util
@ -57,6 +60,12 @@ Notable changes
- #32356 cmake: Respect user-provided configuration-specific flags
- #32437 crypto: disable ASan for sha256_sse4 with Clang
- #32469 cmake: Allow WITH_DBUS on all Unix-like systems
- #32439 guix: accomodate migration to codeberg
- #32551 cmake: Add missed SSE41_CXXFLAGS
- #32568 depends: use "mkdir -p" when installing xproto
- #32678 guix: warn and abort when SOURCE_DATE_EPOCH is set
- #32690 depends: fix SHA256SUM command on OpenBSD (use GNU mode output)
- #32760 depends: capnp 1.2.0
### Gui
@ -65,8 +74,18 @@ Notable changes
### Doc
- #32333 doc: Add missing top-level description to pruneblockchain RPC
- #32353 doc: Fix fuzz test_runner.py path
- #32389 doc: Fix test_bitcoin path
- #32607 rpc: Note in fundrawtransaction doc, fee rate is for package
- #32679 doc: update tor docs to use bitcoind binary from path
- #32693 depends: fix cmake compatibility error for freetype
- #32696 doc: make -DWITH_ZMQ=ON explicit on build-unix.md
- #32708 rpc, doc: update listdescriptors RCP help
- #32711 doc: add missing packages for BSDs (cmake, gmake, curl) to depends/README.md
- #32719 doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project"
- #32776 doc: taproot became always active in v24.0
- #32777 doc: fix Transifex 404s
### CI
@ -76,6 +95,7 @@ Notable changes
- #32187 refactor: Remove spurious virtual from final ~CZMQNotificationInterface
- #32454 tracing: fix invalid argument in mempool_monitor
- #32771 contrib: tracing: Fix read of pmsg_type in p2p_monitor.py
Credits
=======
@ -83,16 +103,28 @@ Credits
Thanks to everyone who directly contributed to this release:
- achow101
- benthecarman
- Brandon Odiwuor
- davidgumberg
- enirox001
- fanquake
- furszy
- Hennadii Stepanov
- hodlinator
- ismaelsadeeq
- jb55
- josibake
- laanwj
- luisschwab
- MarcoFalke
- Martin Zumsande
- monlovesmango
- nervana21
- rkrux
- Sjors
- theStack
- willcl-ark
- zaidmstrr
As well as to everyone that helped with translations on
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
[Transifex](https://explore.transifex.com/bitcoin/bitcoin/).

View file

@ -57,10 +57,10 @@ Release Process
- Clear the release notes and move them to the wiki (see "Write the release notes" below).
- Translations on Transifex:
- Pull translations from Transifex into the master branch.
- Create [a new resource](https://www.transifex.com/bitcoin/bitcoin/content/) named after the major version with the slug `qt-translation-<RRR>x`, where `RRR` is the major branch number padded with zeros. Use `src/qt/locale/bitcoin_en.xlf` to create it.
- Create [a new resource](https://app.transifex.com/bitcoin/bitcoin/content/) named after the major version with the slug `qt-translation-<RRR>x`, where `RRR` is the major branch number padded with zeros. Use `src/qt/locale/bitcoin_en.xlf` to create it.
- In the project workflow settings, ensure that [Translation Memory Fill-up](https://help.transifex.com/en/articles/6224817-setting-up-translation-memory-fill-up) is enabled and that [Translation Memory Context Matching](https://help.transifex.com/en/articles/6224753-translation-memory-with-context) is disabled.
- Update the Transifex slug in [`.tx/config`](/.tx/config) to the slug of the resource created in the first step. This identifies which resource the translations will be synchronized from.
- Make an announcement that translators can start translating for the new version. You can use one of the [previous announcements](https://www.transifex.com/bitcoin/communication/) as a template.
- Make an announcement that translators can start translating for the new version. You can use one of the [previous announcements](https://app.transifex.com/bitcoin/communication/) as a template.
- Change the auto-update URL for the resource to `master`, e.g. `https://raw.githubusercontent.com/bitcoin/bitcoin/master/src/qt/locale/bitcoin_en.xlf`. (Do this only after the previous steps, to prevent an auto-update from interfering.)
#### After branch-off (on the major release branch)

View file

@ -62,7 +62,7 @@ outgoing connections, but more is possible.
In a typical situation, this suffices to run behind a Tor proxy:
./bitcoind -proxy=127.0.0.1:9050
bitcoind -proxy=127.0.0.1:9050
## 2. Automatically create a Bitcoin Core onion service
@ -187,25 +187,25 @@ should be equal to binding address and port for inbound Tor connections (127.0.0
In a typical situation, where you're only reachable via Tor, this should suffice:
./bitcoind -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen
bitcoind -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen
(obviously, replace the .onion address with your own). It should be noted that you still
listen on all devices and another node could establish a clearnet connection, when knowing
your address. To mitigate this, additionally bind the address of your Tor proxy:
./bitcoind ... -bind=127.0.0.1:8334=onion
bitcoind ... -bind=127.0.0.1:8334=onion
If you don't care too much about hiding your node, and want to be reachable on IPv4
as well, use `discover` instead:
./bitcoind ... -discover
bitcoind ... -discover
and open port 8333 on your firewall (or use port mapping, i.e., `-natpmp`).
If you only want to use Tor to reach .onion addresses, but not use it as a proxy
for normal IPv4/IPv6 communication, use:
./bitcoind -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover
bitcoind -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover
## 4. Privacy recommendations

View file

@ -41,7 +41,7 @@ git commit
### Creating a Transifex account
Visit the [Transifex Signup](https://www.transifex.com/signup/) page to create an account. Take note of your username and password, as they will be required to configure the command-line tool.
You can find the Bitcoin translation project at [https://www.transifex.com/bitcoin/bitcoin/](https://www.transifex.com/bitcoin/bitcoin/).
You can find the Bitcoin translation project at [https://explore.transifex.com/bitcoin/bitcoin/](https://explore.transifex.com/bitcoin/bitcoin/).
### Installing the Transifex client command-line tool
The client is used to fetch updated translations. Please check installation instructions and any other details at https://developers.transifex.com/docs/cli.

View file

@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " CLIENT_NAME ")"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-cli"

View file

@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoin-tx (CLI Bitcoin transaction editor utility)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-tx"

View file

@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoin-util (CLI Bitcoin utility)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-util"

View file

@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoin-wallet (CLI tool for " CLIENT_NAME " wallets)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-wallet"

View file

@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoind (Bitcoin node with a JSON-RPC server)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoind"

View file

@ -47,7 +47,7 @@ if(HAVE_SSE41 AND HAVE_X86_SHANI)
target_compile_definitions(bitcoin_crypto PRIVATE ENABLE_SSE41 ENABLE_X86_SHANI)
target_sources(bitcoin_crypto PRIVATE sha256_x86_shani.cpp)
set_property(SOURCE sha256_x86_shani.cpp PROPERTY
COMPILE_OPTIONS ${X86_SHANI_CXXFLAGS}
COMPILE_OPTIONS ${SSE41_CXXFLAGS} ${X86_SHANI_CXXFLAGS}
)
endif()

View file

@ -21,7 +21,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", CLIENT_NAME " (GUI node for Bitcoin)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "bitcoin-qt"

View file

@ -838,7 +838,9 @@ std::optional<int> GetPruneHeight(const BlockManager& blockman, const CChain& ch
static RPCHelpMan pruneblockchain()
{
return RPCHelpMan{"pruneblockchain", "",
return RPCHelpMan{"pruneblockchain",
"Attempts to delete block and undo data up to a specified height or timestamp, if eligible for pruning.\n"
"Requires `-prune` to be enabled at startup. While pruned data may be re-fetched in some cases (e.g., via `getblockfrompeer`), local deletion is irreversible.\n",
{
{"height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The block height to prune up to. May be set to a discrete height, or to a " + UNIX_EPOCH_TIME + "\n"
" to prune blocks whose block time is at least 2 hours older than the provided timestamp."},

View file

@ -1781,7 +1781,7 @@ RPCHelpMan listdescriptors()
{
return RPCHelpMan{
"listdescriptors",
"\nList descriptors imported into a descriptor-enabled wallet.\n",
"\nList all descriptors present in a descriptor-enabled wallet.\n",
{
{"private", RPCArg::Type::BOOL, RPCArg::Default{false}, "Show private descriptors."}
},

View file

@ -749,7 +749,10 @@ RPCHelpMan fundrawtransaction()
"Note that all inputs selected must be of standard form and P2SH scripts must be\n"
"in the wallet using importaddress or addmultisigaddress (to calculate fees).\n"
"You can see whether this is the case by checking the \"solvable\" field in the listunspent output.\n"
"Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only\n",
"Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only.\n"
"Note that if specifying an exact fee rate, the resulting transaction may have a higher fee rate\n"
"if the transaction has unconfirmed inputs. This is because the wallet will attempt to make the\n"
"entire package have the given fee rate, not the resulting transaction.\n",
{
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"},
{"options", RPCArg::Type::OBJ_NAMED_PARAMS, RPCArg::Optional::OMITTED, "For backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}",

View file

@ -1548,8 +1548,11 @@ void CWallet::blockDisconnected(const interfaces::BlockInfo& block)
int disconnect_height = block.height;
for (const CTransactionRef& ptx : Assert(block.data)->vtx) {
SyncTransaction(ptx, TxStateInactive{});
for (size_t index = 0; index < block.data->vtx.size(); index++) {
const CTransactionRef& ptx = Assert(block.data)->vtx[index];
// Coinbase transactions are not only inactive but also abandoned,
// meaning they should never be relayed standalone via the p2p protocol.
SyncTransaction(ptx, TxStateInactive{/*abandoned=*/index == 0});
for (const CTxIn& tx_in : ptx->vin) {
// No other wallet transactions conflicted with this transaction

View file

@ -148,8 +148,10 @@ class BIP68Test(BitcoinTestFramework):
# between height/time locking). Small random chance of making the locks
# all pass.
for _ in range(400):
available_utxos = len(utxos)
# Randomly choose up to 10 inputs
num_inputs = random.randint(1, 10)
num_inputs = random.randint(1, min(10, available_utxos))
random.shuffle(utxos)
# Track whether any sequence locks used should fail

View file

@ -79,7 +79,7 @@ class PSBTTest(BitcoinTestFramework):
wallet = node.get_wallet_rpc(self.default_wallet_name)
address = wallet.getnewaddress()
wallet.sendtoaddress(address=address, amount=1.0)
self.generate(node, nblocks=1, sync_fun=lambda: self.sync_all(self.nodes[:2]))
self.generate(node, nblocks=1)
utxos = wallet.listunspent(addresses=[address])
psbt = wallet.createpsbt([{"txid": utxos[0]["txid"], "vout": utxos[0]["vout"]}], [{wallet.getnewaddress(): 0.9999}])

View file

@ -19,6 +19,7 @@ import shutil
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
assert_greater_than,
assert_raises_rpc_error
)
@ -90,6 +91,54 @@ class ReorgsRestoreTest(BitcoinTestFramework):
# Verify the coinbase descendant was also marked as abandoned
assert_equal(wallet0.gettransaction(descendant_tx_id)['details'][0]['abandoned'], True)
def test_reorg_handling_during_unclean_shutdown(self):
self.log.info("Test that wallet doesn't crash due to a duplicate block disconnection event after an unclean shutdown")
node = self.nodes[0]
# Receive coinbase reward on a new wallet
node.createwallet(wallet_name="reorg_crash", load_on_startup=True)
wallet = node.get_wallet_rpc("reorg_crash")
self.generatetoaddress(node, 1, wallet.getnewaddress(), sync_fun=self.no_op)
# Restart to ensure node and wallet are flushed
self.restart_node(0)
wallet = node.get_wallet_rpc("reorg_crash")
assert_greater_than(wallet.getwalletinfo()['immature_balance'], 0)
# Disconnect tip and sync wallet state
tip = wallet.getbestblockhash()
wallet.invalidateblock(tip)
wallet.syncwithvalidationinterfacequeue()
# Tip was disconnected, ensure coinbase has been abandoned
assert_equal(wallet.getwalletinfo()['immature_balance'], 0)
coinbase_tx_id = wallet.getblock(tip, verbose=1)["tx"][0]
assert_equal(wallet.gettransaction(coinbase_tx_id)['details'][0]['abandoned'], True)
# Abort process abruptly to mimic an unclean shutdown (no chain state flush to disk)
node.process.kill()
# Restart the node and confirm that it has not persisted the last chain state changes to disk
self.start_node(0)
assert_equal(node.getbestblockhash(), tip)
# Due to an existing bug, the wallet incorrectly keeps the transaction in an abandoned state, even though that's
# no longer the case (after the unclean shutdown, the node's chain returned to the pre-invalidation tip).
# This issue blocks any future spending and results in an incorrect balance display.
wallet = node.get_wallet_rpc("reorg_crash")
assert_equal(wallet.getwalletinfo()['immature_balance'], 0) # FIXME: #31824.
# Previously, a bug caused the node to crash if two block disconnection events occurred consecutively.
# Ensure this is no longer the case by simulating a new reorg.
node.invalidateblock(tip)
assert(node.getbestblockhash() != tip)
# Ensure wallet state is consistent now
assert_equal(wallet.gettransaction(coinbase_tx_id)['details'][0]['abandoned'], True)
assert_equal(wallet.getwalletinfo()['immature_balance'], 0)
# And finally, verify the state if the block ends up being into the best chain again
node.reconsiderblock(tip)
assert_equal(wallet.gettransaction(coinbase_tx_id)['details'][0]['abandoned'], False)
assert_greater_than(wallet.getwalletinfo()['immature_balance'], 0)
def run_test(self):
# Send a tx from which to conflict outputs later
@ -163,6 +212,9 @@ class ReorgsRestoreTest(BitcoinTestFramework):
# Verify we mark coinbase txs, and their descendants, as abandoned during startup
self.test_coinbase_automatic_abandon_during_startup()
# Verify reorg behavior during an unclean shutdown
self.test_reorg_handling_during_unclean_shutdown()
if __name__ == '__main__':
ReorgsRestoreTest(__file__).main()