46256 Commits

Author SHA1 Message Date
MarcoFalke
0202ae341f
doc: Update Guix install for Debian/Ubuntu
Fixes https://github.com/bitcoin/bitcoin/issues/33982

Co-authored-by: Purple Ninja <129023353+ToRyVand@users.noreply.github.com>

Github-Pull: #34671
Rebased-From: faa70ca7642bd653cbd2e544c17fa58d2672afa4
2026-02-26 09:40:29 +00:00
fanquake
2d035b1d4f
guix: use a temporary file over sponge
Remove sponge (moreutils).

Github-Pull: #34627
Rebased-From: c86bce597a3c4d45f7c2b6149197d8303bda0e87
2026-02-25 11:01:55 +00:00
MarcoFalke
dca7700269
test: valgrind --trace-children=yes for bitcoin wrapper
Github-Pull: #34608
Rebased-From: fa5d478853a88ce7d7095b6abfe8112390298b65
2026-02-25 10:56:44 +00:00
MarcoFalke
dd8924909a
test: Remove redundant warning about missing binaries
The error was added in commit 1ea7e45a1f445d32a2b690d52befb2e63418653b,
because there was an additional confusing `AssertionError: [node 0]
Error: no RPC connection` instead of just a single `FileNotFoundError:
[Errno 2] No such file or directory`.

This is no longer needed on current master.

Also, the test is incomplete, because it was just checking bitcoind and
bitcoin-cli, not any other missing binaries.

Also, after the previous commit, it would not work in combination with
--valgrind.

Instead of trying to make it complete, and work in all combinations,
just remove it, because the already existing error will be clear in any
case.

This can be tested via:

```sh
 ./test/get_previous_releases.py

 mv releases releases_backup
 # Confirm the test is skipped due to missing releases
 ./bld-cmake/test/functional/wallet_migration.py
 # Confirm the test fails due to missing releases
 ./bld-cmake/test/functional/wallet_migration.py --previous-releases
 mv releases_backup releases

 mv ./releases/v28.2 ./releases/v28.2_backup
 # Confirm the test fails with a single FileNotFoundError
 ./bld-cmake/test/functional/wallet_migration.py
 mv ./releases/v28.2_backup ./releases/v28.2
 # Confirm the test runs and passes
 ./bld-cmake/test/functional/wallet_migration.py

 rm ./bld-cmake/bin/bitcoind
 # Confirm the test fails with a single "No such file or directory",
 # testing with and without --valgrind
 ./bld-cmake/test/functional/wallet_migration.py
 ./bld-cmake/test/functional/wallet_migration.py --valgrind
```

Github-Pull: #34608
Rebased-From: fa29fb72cb21bec798ddae49b842c78ac84a5a3b
2026-02-25 10:56:43 +00:00
MarcoFalke
6993b1be78
test: Fix broken --valgrind handling after bitcoin wrapper
Prior to this commit, tool_bitcoin.py was failing:

```sh
$ ./bld-cmake/test/functional/tool_bitcoin.py --valgrind
TestFramework (ERROR): Unexpected exception
Traceback (most recent call last):
  File "./test/functional/test_framework/test_framework.py", line 138, in main
    self.setup()
    ~~~~~~~~~~^^
  File "./test/functional/test_framework/test_framework.py", line 269, in setup
    self.setup_network()
    ~~~~~~~~~~~~~~~~~~^^
  File "./test/functional/tool_bitcoin.py", line 38, in setup_network
    assert all(node.args[:len(node_argv)] == node_argv for node in self.nodes)
           ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
```

This commit fixes this issue by running `bitcoin` under valgrind. Also,
it comes with other improvements:

* Drop the outdated valgrind 3.14 requirement, because there is no
  distro that ships a version that old anymore.
* Drop the VALGRIND_SUPPRESSIONS_FILE env var handling, because it was
  presumably never used since it was introduced. Also, the use-case
  seems limited.

Review note:

The set_cmd_args was ignoring the --valgrind test option.

In theory, this could be fixed by refactoring Binaries::node_argv() to
be used here. However, for now, just re-implement the node_argv logic in
set_cmd_args to prepend the valgrind cmd.

Github-Pull: #34608
Rebased-From: fa03fbf7e31f384627230e1bc042f7f29c05ff68
2026-02-25 10:56:40 +00:00
SomberNight
d54d7dfe9f
wallet: rpc: manpage: fix example missing fee_rate argument
The function signature for the `send` RPC is:
```
send [{"address":amount,...},{"data":"hex"},...] ( conf_target "estimate_mode" fee_rate options version )
```

The last example in the manpage is missing the `fee_rate` arg, but is trying to specify the `options` arg, by index.
The parser confuses the intended `options` arg as the missing `fee_rate` arg.

See:
```
$ bitcoin-cli -rpcuser=doggman -rpcpassword=donkey -rpcport=18554 -regtest send '{"bcrt1qusm48zmlzwr32csxdw4ar7atw260h22c9ten9l": 0.1}' 1 economical '{"add_to_wallet": false, "inputs": [{"txid":"0b7e1a471dc948b7a6187936b16e6d7d9833629b2f9dd8a392eb89928f63aaad", "vout":0}]}'
error code: -8
error message:
Cannot specify both conf_target and fee_rate. Please provide either a confirmation target in blocks for automatic fee estimation, or an explicit fee rate.
```
vs
```
$ bitcoin-cli -rpcuser=doggman -rpcpassword=donkey -rpcport=18554 -regtest send '{"bcrt1qusm48zmlzwr32csxdw4ar7atw260h22c9ten9l": 0.1}' 1 economical null '{"add_to_wallet": false, "inputs": [{"txid":"0b7e1a471dc948b7a6187936b16e6d7d9833629b2f9dd8a392eb89928f63aaad", "vout":0}]}'
{
  "psbt": "cHNidP8BAHECAAAAAa2qY4+SieuSo9idL5tiM5h9bW6xNnkYprdIyR1HGn4LAAAAAAD9////AkR2DwQAAAAAFgAUpLDwJu+wFRHLQAgKAb0psk7UVd2AlpgAAAAAABYAFOQ3U4t/E4cVYgZrq9H7q3K0+6lYAAAAAAABAIUCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wQC4wMA/////wLIF6gEAAAAABYAFLMY1zihXrefAA0DA5nld4MCPjkrAAAAAAAAAAAmaiSqIant4vYcP3HR3v0/qZnfo2lTdVxpBol5mWK0i+vYNpdOjPkAAAAAAQEfyBeoBAAAAAAWABSzGNc4oV63nwANAwOZ5XeDAj45KwEIawJHMEQCIElTV4pbUrsPR9qHWcioowVv3QVWHizxwevfD0u/I8YyAiBCY3OzF81PSLM00h4ueQkehYuxDFZu7Jk51iejphKnnwEhA0VKdYVSyBpWoxBwTDOupB58Fi3mEBs+u+OOqEYVd2sZACICA98YLWyH7dBCfXVxe7woiLSTgV1mJN8Zc8KgZ77pVSg+GNBMeT5UAACAAQAAgAAAAIABAAAAbAAAAAAA",
  "txid": "625b71b314a6ac4f738634e29dc007cd5edc0427c1ae96ab706d06a62910cea2",
  "hex": "02000000000101adaa638f9289eb92a3d89d2f9b6233987d6d6eb1367918a6b748c91d471a7e0b0000000000fdffffff0244760f0400000000160014a4b0f026efb01511cb40080a01bd29b24ed455dd8096980000000000160014e437538b7f13871562066babd1fbab72b4fba9580247304402204953578a5b52bb0f47da8759c8a8a3056fdd05561e2cf1c1ebdf0f4bbf23c6320220426373b317cd4f48b334d21e2e79091e858bb10c566eec9939d627a3a612a79f012103454a758552c81a56a310704c33aea41e7c162de6101b3ebbe38ea84615776b1900000000",
  "complete": true
}
```

Github-Pull: #34561
Rebased-From: 50cf6838e6aa51e0d712cbc1e13d686253bc8fe0
2026-02-25 10:05:09 +00:00
ANAVHEOBA
412725b7a3
net: reduce log level for PCP/NAT-PMP NOT_AUTHORIZED failures
Users running on home networks with routers that don't support PCP (Port
Control Protocol) or NAT-PMP port mapping receive frequent warning-level
log messages every few minutes:

  "pcp: Mapping failed with result NOT_AUTHORIZED (code 2)"

This is expected behavior for many consumer routers that have PCP
disabled by default, not an actionable error.

Add explicit constants for the NOT_AUTHORIZED result code (value 2)
for both NAT-PMP and PCP protocols. Log the first NOT_AUTHORIZED
failure at warning level for visibility, then downgrade subsequent
occurrences to LogDebug to avoid log noise. Other failure types
continue to warn unconditionally.

Fixes #34114

Co-authored-by: willcl-ark <will@256k1.dev>

Github-Pull: #34549
Rebased-From: afea2af1391314be0e5caaa0125c884da2405316
2026-02-20 09:44:19 +00:00
Cory Fields
85f8d28fac
build: avoid exporting secp256k1 symbols
Take advantage of the new secp256k1 option to avoid visibility attributes on
API functions.

While most users of a shared libsecp always want API functions exported so that
they can actually be linked against, we always build it statically. When that
static lib is linked into a (static or shared) libbitcoinkernel, by default its
symbols end up exported there as well.

As libsecp is an implementation detail of the kernel (and any future Core lib),
its symbols should never be exported.

Github-Pull: #34554
Rebased-From: 2ccfdb582b646d9bda07f0f13b97cb8c37a452aa
2026-02-18 16:24:27 +00:00
jayvaliya
b7a182c749
doc: fix broken bpftrace installation link
The bpftrace project moved from iovisor/bpftrace to bpftrace/bpftraceand
removed the separate INSTALL.md file. Installation instructionsare now
in the README.md Quick Start section.

Github-Pull: #34510
Rebased-From: 42ee31e80c99bdb4d6affdc9dc22a0f3d5da7b59
2026-02-09 14:27:59 +00:00
MarcoFalke
1a757af7ea
ci: Print verbose build error message in test-each-commit
Github-Pull: #34461
Rebased-From: bbbb78a4f28fd2378342398ccae60995ae0e08d2
2026-02-03 12:33:05 +00:00
MarcoFalke
f5d4dc9419
ci: [refactor] Allow overwriting check option in run helper
Also, use str(e) consistently in all run helpers.

This refactor does not change any behavior.

This can be reviewed by checking that all instances are exactly
identical code now:
$ git grep --function-context 'def run(cmd'

Github-Pull: #34461
Rebased-From: 2222dadabbbd03be9b4b917583fd51b34857f40c
2026-02-03 10:53:40 +00:00
MarcoFalke
7317a0ba1f
ci: Always print low ccache hit rate notice
Github-Pull: #34453
Rebased-From: fad2876ec330dbb833905d3b2ee5753abc3bc3af
2026-01-30 11:54:20 +00:00
marcofleon
0a768d4a5a
fuzz: Use __AFL_SHM_ID for naming test directories
Use the AFL++ shared memory ID environment variable to create
a deterministic datadir path. This prevents accumulation of stale
directories after a fuzz iteration crashes or times out. During
long fuzz campaigns, this accumulation has occasionally resulted
in running out of disk space.

Github-Pull: #34445
Rebased-From: d3e681bc06758fe0686cd96fcfd4a1c4c5af62b4
2026-01-30 11:52:57 +00:00
Antoine Poinsot
48749cf4c7
miniscript: correct and_v() properties
and_v() must never be 'd'. This is not a bug fix since this was
unreachable in valid Miniscripts: the first sub of an and_v() must be of
type V, which conflicts with (i.e. never has) property 'd'.

Github-Pull: #34434
Rebased-From: 4fab35cf88c048d2784fe6d71d3f83cc4e420879
2026-01-30 11:51:35 +00:00
fanquake
19b3e2e50e
test: use ModuleNotFoundError in interface_ipc.py
Change this so we catch the case where the capnp shared libs have been
updated, and can no-longer be loaded by the Python module, resulting in
a skipped test, even though pycapnp is installed. i.e:
```bash
stderr:
Traceback (most recent call last):
  File "/root/ci_scratch/build/test/functional/interface_ipc.py", line 20, in <module>
    import capnp  # type: ignore[import] # noqa: F401
    ^^^^^^^^^^^^
  File "/usr/local/lib64/python3.14/site-packages/capnp/__init__.py", line 36, in <module>
    from .version import version as __version__
  File "/usr/local/lib64/python3.14/site-packages/capnp/version.py", line 1, in <module>
    from .lib.capnp import _CAPNP_VERSION_MAJOR as LIBCAPNP_VERSION_MAJOR  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcapnpc.so.1.0.1: cannot open shared object file: No such file or directory
```

Failing in this way should make it clear that `pycapnp` needs to be
reinstalled/rebuilt.

If  `pycapnp` is not installed, the test still skips as expected:
```bash
Remaining jobs: [interface_ipc.py]
1/1 - interface_ipc.py skipped (capnp module not available.)

TEST             | STATUS    | DURATION

interface_ipc.py | ○ Skipped | 0 s
```

Fixes: #34016.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>

Github-Pull: #34409
Rebased-From: 905dfdee86d679f8ea31d841bceb77a5724a6b1b
2026-01-30 11:48:50 +00:00
merge-script
3761863e14
Merge bitcoin/bitcoin#34283: [30.x] More backports
624c745e4917306198443fc9fb3465e1d6f8f214 doc: update release notes for v30.x (fanquake)
0f01a4c2458bb5a3d6584697345c116512e62ebf ci: Check windows manifests for all executables (Max Edwards)
4664621abeac2c2311d0d1aee878d844d5371ea5 ci: use a more generic way of finding mt.exe (Max Edwards)
aa937589326dfc7d315fd19f83b7372df15d09ab ci: remove 3rd party js from windows dll gha job (Max Edwards)
290526bc6dec1cdf0f6db8415b05a794260de14a wallet: fix removeprunedfunds bug with conflicting transactions (Martin Zumsande)
4deda48fa44989ee73278fe4eb6e8a27e9e56807 build: Remove outdated comment about -ffile-prefix-map (MarcoFalke)
eda6c979bd7b6971560938c1a4b24671894c6f44 doc: Remove outdated -fdebug-prefix-map section in dev notes (MarcoFalke)
c294b661266bcf81b16894aa6bff0dafa88d7b86 build: Temporarily remove confusing and brittle -fdebug-prefix-map (MarcoFalke)
33195bdd9ee9ded5aec562602978fb89d2d99f4b test: allow overriding tar in get_previous_releases (fanquake)
810c75b9b1a7efb2f8c021fcdc278488f702cd98 chore: Update outdated GitHub Actions versions (Padraic Slattery)
de79f7d01ce43189006cadf08296672fb4d5d5ca qa: Fix Windows logging bug (Hennadii Stepanov)
311da7fee3aba2e6765e193f963b568cf668dbd1 test: check wallet rescan properly in feature_pruning (brunoerg)
4431a60f9c75da2a417d50cd87bcd269f3147489 test: fix feature_pruning when built without wallet (brunoerg)
7e1090f5e8056dd6042ecfe34eae3992a81a18fd psbt: Fix `PSBTInputSignedAndVerified` bounds `assert` (Lőrinc)
22bd00651a48a50ec1d3b7f717b375f62719b456 doc: add 433 (Pay to Anchor) to bips.md (Sebastian Falbesoner)

Pull request description:

  Backports:
  * #32513
  * #34185
  * #34272
  * #34252
  * #34281
  * #34282
  * #34344
  * #34358
  * #34390
  * #34413

ACKs for top commit:
  willcl-ark:
    ACK 624c745e4917306198443fc9fb3465e1d6f8f214
  marcofleon:
    ACK 624c745e4917306198443fc9fb3465e1d6f8f214

Tree-SHA512: 65f413419b50784d2661d89f2044acd5196eacd50841bb93d7437b83bd23ce535565168cd4c53f96ba485863a911f5a1ea5476b22955d6b931b65e87f78b9a17
2026-01-29 15:50:49 +00:00
fanquake
624c745e49
doc: update release notes for v30.x 2026-01-29 14:07:44 +00:00
Max Edwards
0f01a4c245
ci: Check windows manifests for all executables
The other executables have manifests and these should be checked in
addition to bitcoind. Skipping fuzz.exe, bench_bitcoin.exe and
test_bitcoin-qt.exe as they do not have manifests.

Github-Pull: #32513
Rebased-From: 156927903d64297500dd73380908c654b07bfb1a
2026-01-29 14:07:36 +00:00
Max Edwards
4664621abe
ci: use a more generic way of finding mt.exe
This sets up a vs developer command prompt and should hopefully should
be more resilient to upstream changes

Co-authored-by: David Gumberg <davidzgumberg@gmail.com>

Github-Pull: #32513
Rebased-From: e1a1b14c9359751a4d0117a27a303d1f1d3ed30f
2026-01-29 14:07:32 +00:00
Max Edwards
aa93758932
ci: remove 3rd party js from windows dll gha job
We can use vswhere.exe directly to create a vs developer
prompt and so can remove this third party dependency.

Co-authored-by: David Gumberg <davidzgumberg@gmail.com>

Github-Pull: #32513
Rebased-From: 7ae0497eef8f5b37fc1184897a5bbc9f023dfa67
2026-01-29 14:07:28 +00:00
Martin Zumsande
290526bc6d
wallet: fix removeprunedfunds bug with conflicting transactions
removeprunedfunds removes all entries from mapTxSpends for the
inputs of the pruned tx. However, this is incorrect, because there could be
multiple entries from conflicting transactions (that shouldn't be
removed as well). This could lead to the wallet creating invalid
transactions, trying to double spend utxos.
The bug persists when the conflicting tx was mined, because
the wallet trusts its internal accounting instead of calling
AddToSpends again.

Github-Pull: #34358
Rebased-From: 1f60ca360eb83fa7982b1aac402eaaf477294197
2026-01-29 09:53:37 +00:00
MarcoFalke
4deda48fa4
build: Remove outdated comment about -ffile-prefix-map
The -ffile-prefix-map option is no longer used and it seems fine to
remove the warning about it possibly breaking coverage builds.

If this needs documentation, the dev notes seem like a better place,
because it also affects other places, such as depends. C.f. commit
407062f2ac93624f350e9e8a4f641c882a2aaf2f

Github-Pull: #34413
Rebased-From: fa2e1b85dd6b263a77294566bd361d7873731045
2026-01-28 14:24:23 +00:00
MarcoFalke
eda6c979bd
doc: Remove outdated -fdebug-prefix-map section in dev notes
The section claims to be for ccache builds, however those are already
fixed after commit 1cc58d3a0c653ac30df04d1010a3cf84c6bc307a.

If there are still any build or debug problems after that commit,
dedicated instructions can be added back, along with exact steps to
reproduce and test.

Github-Pull: #34413
Rebased-From: fa06cd4ba7303bd3036467cf00d12f36c94bcaff
2026-01-28 14:24:19 +00:00
MarcoFalke
c294b66126
build: Temporarily remove confusing and brittle -fdebug-prefix-map
Github-Pull: #34281
Rebased-From: fa37928536e0048a262260baf998ead026b14bb9
2026-01-27 10:15:31 +00:00
fanquake
33195bdd9e
test: allow overriding tar in get_previous_releases
Facilitate use on distros that might have 'tar' as something else, such
as 'gtar', i.e Chimera.

Github-Pull: #34390
Rebased-From: be2b48b9f3e56b672e391e18a09f2d5f4e78d74e
2026-01-27 09:49:27 +00:00
Padraic Slattery
810c75b9b1
chore: Update outdated GitHub Actions versions
Github-Pull: #34344
Rebased-From: 9482f00df0b05e8ef710a7f0fac3262855ce335f
2026-01-23 10:57:42 +00:00
Hennadii Stepanov
de79f7d01c
qa: Fix Windows logging bug
The regex `(.*)` was capturing `\r` from subprocess output on Windows,
causing the closing parenthesis in logs to wrap to the next line.

Stripping whitespace from the regex match fixes the formatting.

Github-Pull: #34282
Rebased-From: 979d41bfab248990d7d520873d17fe52daa8d402
2026-01-15 15:22:26 +00:00
brunoerg
311da7fee3
test: check wallet rescan properly in feature_pruning
Github-Pull: #34185
Rebased-From: 8fb5e5f41ddf550a78b1253184d79a107097815a
2026-01-15 11:22:07 +00:00
brunoerg
4431a60f9c
test: fix feature_pruning when built without wallet
Github-Pull: #34185
Rebased-From: 9b57c8d2bd15a414e08a9e43367d8d3d82c25fe4
2026-01-15 11:22:02 +00:00
Lőrinc
7e1090f5e8
psbt: Fix PSBTInputSignedAndVerified bounds assert
The previous `assert` used `>=`, allowing `input_index == psbt.inputs.size()` and out-of-bounds access in `psbt.inputs[input_index]`.

Found during review: https://github.com/bitcoin/bitcoin/pull/31650#discussion_r2685892867

Github-Pull: #34272
Rebased-From: 2f5b1c5f80590ffa6b5a5bcfb21fddb1dc22e852
2026-01-14 12:19:04 +00:00
Sebastian Falbesoner
22bd00651a
doc: add 433 (Pay to Anchor) to bips.md
Github-Pull: #34252
Rebased-From: 44b12cdb11f0fd3264f24f537a5d6989e4fe96a9
2026-01-14 12:18:36 +00:00
merge-script
4d7d5f6b79
Merge bitcoin/bitcoin#34229: [30.2] Backports & Final
04a996b1a77b5e4c73df27540eca0e1f6587c56e doc: update manual pages for v30.2 (fanquake)
ed355b8f57920714b7cc1775d60f3c4b0098ad04 build: bump version to v30.2 (fanquake)
6c98d68be1478e3420a8e3b093f355ac038fe87c doc: update release notes for v30.2 (fanquake)
6d86b32e780e3df5bcc163ed5c288144aa234b78 guix: Fix `osslsigncode` tests (Hennadii Stepanov)
1dae0027cd43583302c1950492568198f2dcf3a9 wallet: test: Failed migration cleanup (David Gumberg)
9e59047a7e5a6d23520fce156dea2ae6b32415ca test: migration, avoid backup name mismatch in default_wallet_failure (furszy)

Pull request description:

  Backports:
  * #34221
  * #34226
  * #34227

ACKs for top commit:
  hebasto:
    ACK 04a996b1a77b5e4c73df27540eca0e1f6587c56e, I have reviewed the code and it looks OK.
  willcl-ark:
    ACK 04a996b1a77b5e4c73df27540eca0e1f6587c56e
  marcofleon:
    ACK 04a996b1a77b5e4c73df27540eca0e1f6587c56e

Tree-SHA512: 3389b9b629dcb920186b383353fd386bb757967d224e0267501b5e2083dc1e6cba051df6ef646de05c0e58fd43c9f549b9175eefb77fed1fe9ab7d1648b2d9e7
v30.2
2026-01-09 14:04:54 +00:00
fanquake
04a996b1a7
doc: update manual pages for v30.2 2026-01-09 11:23:01 +00:00
fanquake
ed355b8f57
build: bump version to v30.2 2026-01-09 11:17:00 +00:00
fanquake
6c98d68be1
doc: update release notes for v30.2 2026-01-09 11:16:32 +00:00
Hennadii Stepanov
6d86b32e78
guix: Fix osslsigncode tests
Github-Pull: #34227
Rebased-From: 194114daf385a5db50e1507fda79a1a93240d494
2026-01-09 11:15:58 +00:00
David Gumberg
1dae0027cd
wallet: test: Failed migration cleanup
Refactor a common way to perform the failed migration test that exists
for default wallets, and add relative-path wallets and absolute-path
wallets.

Github-Pull: #34226
Rebased-From: eeaf28dbe0e09819ab0e95bb7762b29536bdeef6
2026-01-09 10:11:19 +00:00
furszy
9e59047a7e
test: migration, avoid backup name mismatch in default_wallet_failure
The test calls migrate_and_get_rpc(), which sets mock time internally.
The caller caches a mock time value and later relies on it to predict the
backup filename, so setting the mock time again could cause a naming
mismatch.

Fix this by calling the migration RPC directly. Since the test expects the
migration to fail, migrate_and_get_rpc() is unnecessary here.

Github-Pull: #34221
Rebased-From: cbf0bd35bbf312f3b13d92d281d7112e4b43b9c3
2026-01-08 10:21:49 +00:00
merge-script
abb6ae2ec5
Merge bitcoin/bitcoin#34209: [30.x]: Final backports & 30.2rc1
483d158f538c3d7c1cac30d2b299bc10b256972e doc: update manual pages for v30.2rc1 (fanquake)
747a863f5b6f45f6a4bb8ad6811ef800cf4afb58 build: bump version to v30.2rc1 (fanquake)
cc3cdbe9214f80ab43b66af121fb78abcb9e2d1d doc: update release notes for v30.2rc1 (fanquake)
c4082a45e64d81dda5ec093a8ba3b6dad4b946a8 wallettool: do not use fs::remove_all in createfromdump cleanup (Ava Chow)
185ca0e391aea530db37dd5bbc0e150286083ea9 test: coverage for migration failure when last sync is beyond prune height (furszy)
bc71372c0e3b552fff174772ef9e5c65177405c3 wallet: migration, fix watch-only and solvables wallets names (furszy)
bef4b1fdee1f386662855fb66409c323eee4bae4 wallet: improve post-migration logging (furszy)
ac940ac2ca6d427970b7ebbd8227154cf0159875 test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure (furszy)
8e5c02a77f1b18ae37829200f96ef3fa1cc91246 test: add coverage for unnamed wallet migration failure (furszy)
ac4d0956ccccb43082991d89a8601c39d490d3a5 wallet: fix unnamed wallet migration failure (furszy)
454ac8e7db0f8b2c000b1d2e943bde95dff0127d wallet: RestoreWallet failure, erase only what was created (furszy)

Pull request description:

  Backports:
  * #34156
  * #34215

ACKs for top commit:
  darosior:
    ACK 483d158f538c3d7c1cac30d2b299bc10b256972e
  willcl-ark:
    tACK 483d158f538c3d7c1cac30d2b299bc10b256972e
  janb84:
    ACK 483d158f538c3d7c1cac30d2b299bc10b256972e
  w0xlt:
    ACK 483d158f53
  marcofleon:
    lgtm ACK 483d158f538c3d7c1cac30d2b299bc10b256972e

Tree-SHA512: b43485a8745a663d3a031113a6a266af699b3e70b77f72a0e69ea1986adcaa0ee0d4ce51aacd0fde91611cb4bdba9b6be52e5dca59ff8b12135715b8b1ed5ef2
v30.2rc1
2026-01-07 15:44:56 +00:00
fanquake
483d158f53
doc: update manual pages for v30.2rc1 2026-01-07 14:34:29 +00:00
fanquake
747a863f5b
build: bump version to v30.2rc1 2026-01-07 14:34:28 +00:00
fanquake
cc3cdbe921
doc: update release notes for v30.2rc1 2026-01-07 14:34:24 +00:00
Ava Chow
c4082a45e6
wallettool: do not use fs::remove_all in createfromdump cleanup
Github-Pull: #34215
Rebased-From: f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42
2026-01-07 14:33:39 +00:00
furszy
185ca0e391
test: coverage for migration failure when last sync is beyond prune height
Github-Pull: #34156
Rebased-From: b7c34d08dd9549a95cffc6ec1ffa4bb4f81e35eb
2026-01-07 11:20:07 +00:00
furszy
bc71372c0e
wallet: migration, fix watch-only and solvables wallets names
Because the default wallet has no name, the watch-only and solvables
wallets created during migration end up having no name either.

This fixes it by applying the same prefix name we use for the backup
file for an unnamed default wallet.

Before: watch-only wallet named "_watchonly"
After:  watch-only wallet named "default_wallet_watchonly"

Github-Pull: #34156
Rebased-From: 82caa8193a3e36f248dcc949e0cd41def191efac
2026-01-07 11:20:04 +00:00
furszy
bef4b1fdee
wallet: improve post-migration logging
Right now, after migration the last message users see is "migration completed",
but the migration isn't actually finished yet. We still need to load the new wallets
to ensure consistency, and if that fails, the migration will be rolled back. This
can be confusing for users.

This change logs the post-migration loading step and if a wallet fails to load and
the migration will be rolled back.

Github-Pull: #34156
Rebased-From: d70b159c42008ac3b63d1c43d99d4f1316d2f1ef
2026-01-07 11:20:00 +00:00
furszy
ac940ac2ca
test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure
The first test verifies that restoring into an existing empty directory
or a directory with no .dat db files succeeds, while restoring into a
dir with a .dat file fails.

The second test covers restoring into the default unnamed wallet
(wallet.dat), which also implicitly exercises the recovery path used
after a failed migration.

The third test covers failure during restore on a prune node. When
the wallet last sync was beyond the pruning height.

Github-Pull: #34156
Rebased-From: f011e0f0680a8c39988ae57dae57eb86e92dd449
2026-01-07 11:19:57 +00:00
furszy
8e5c02a77f
test: add coverage for unnamed wallet migration failure
Verifies that a failed migration of the unnamed (default) wallet
does not erase the main /wallets/ directory, and also that the
backup file exists.

Github-Pull: #34156
Rebased-From: 36093bde63286e19821a9e62cdff1712b6245dc7
2026-01-07 11:19:39 +00:00
furszy
ac4d0956cc
wallet: fix unnamed wallet migration failure
When migrating any legacy unnamed wallet, a failed migration would
cause the cleanup logic to remove its parent directory. Since this
type of legacy wallet lives directly in the main '/wallets/' folder,
this resulted in unintentionally erasing all wallets, including the
backup file.

To be fully safe, we will no longer call `fs::remove_all`. Instead,
we only erase the individual db files we have created, leaving
everything else intact. The created wallets parent directories are
erased only if they are empty.
As part of this last change, `RestoreWallet` was modified to allow
an existing directory as the destination, since we no longer remove
the original wallet directory (we only remove the files we created
inside it). This also fixes the restore of top-level default wallets
during failures, which were failing due to the directory existence
check that always returns true for the /wallets/ directory.

This bug started after:
f6ee59b6e2
Previously, the `fs::copy_file` call was failing for top-level wallets,
which prevented the `fs::remove_all` call from being reached.

Github-Pull: #34156
Rebased-From: f4c7e28e80bf9af50b03a770b641fd309a801589
2026-01-07 11:19:35 +00:00
furszy
454ac8e7db
wallet: RestoreWallet failure, erase only what was created
Track what RestoreWallet creates so only those files and directories
are removed during a failure and nothing else. Preexisting paths
must be left untouched.

Note:
Using fs::remove_all() instead of fs::remove() in RestoreWallet does
not cause any problems currently, but the change is necessary for the
next commit which extends RestoreWallet to work with existing directories,
which may contain files that must not be deleted.

Github-Pull: #34156
Rebased-From: 4ed0693a3f2a427ef9e7ad016930ec29fa244995
2026-01-07 11:18:38 +00:00