42340 Commits

Author SHA1 Message Date
David Gumberg
4d219725a7 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-12 13:31:08 -08:00
furszy
77622e000b test: coverage for migration failure when last sync is beyond prune height
Github-Pull: bitcoin/bitcoin#34156
Rebased-From: b7c34d08dd9549a95cffc6ec1ffa4bb4f81e35eb
2026-01-12 13:21:45 -08:00
furszy
86eaf71e60 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: bitcoin/bitcoin#34156
Rebased-From: 82caa8193a3e36f248dcc949e0cd41def191efac
2026-01-09 16:31:46 -08:00
furszy
fb4406e63a 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: bitcoin/bitcoin#34156
Rebased-From: d70b159c42008ac3b63d1c43d99d4f1316d2f1ef
2026-01-09 13:38:51 -08:00
furszy
75b59e5aba 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: bitcoin/bitcoin#34156
Rebased-From: f011e0f0680a8c39988ae57dae57eb86e92dd449
2026-01-09 13:26:35 -08:00
furszy
1d4662441f 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: bitcoin/bitcoin#34156
Rebased-From: 36093bde63286e19821a9e62cdff1712b6245dc7
2026-01-09 13:26:28 -08:00
furszy
e47af69222 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: bitcoin/bitcoin#34156
Rebased-From: f4c7e28e80bf9af50b03a770b641fd309a801589
2026-01-09 11:26:44 -08:00
furszy
e1e9d71da9 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: bitcoin/bitcoin#34156
Rebased-From: 4ed0693a3f2a427ef9e7ad016930ec29fa244995
2026-01-08 18:12:02 -08:00
Ava Chow
b54cdfc617 wallettool: do not use fs::remove_all in createfromdump cleanup
Github-Pull: bitcoin/bitcoin#34215
Rebased-From: f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42
2026-01-08 18:12:02 -08:00
furszy
5f07b93d7f wallet: introduce method to return all db created files
Github-Pull: bitcoin/bitcoin#31423
Rebased-From: 1de423e0a08bbc63eed36c8772e9ef8b48e80fb8
2026-01-08 18:12:02 -08:00
furszy
0a944e62cb refactor: remove sqlite dir path back-and-forth conversion
Github-Pull: bitcoin/bitcoin#31423
Rebased-From: d04f6a97ba9a55aa9455e1a805feeed4d630f59a
2026-01-08 10:09:45 -08:00
merge-script
ad8b23e589
Merge bitcoin/bitcoin#33613: [28.x] Backport & finalise 28.3
2dfb3a06902e9a98e00a422705afa002a3744545 doc: update manual pages for v28.3 (fanquake)
3590bbffa6a1ce408c65e5749578b1bdfe04f8f2 build: bump version to 28.3 (fanquake)
da5f5de4055ecad75490820c0f51db007a0a7d8f doc: update release notes for 28.3 (fanquake)
1c521ae922103d676170371416e776672c7969a1 ci: Properly include $FILE_ENV in DEPENDS_HASH (Ava Chow)

Pull request description:

  Backports:
  * #33581

  Plus the changes to finalise `v28.3`

ACKs for top commit:
  marcofleon:
    ACK 2dfb3a06902e9a98e00a422705afa002a3744545
  stickies-v:
    ACK 2dfb3a06902e9a98e00a422705afa002a3744545
  willcl-ark:
    ACK 2dfb3a06902e9a98e00a422705afa002a3744545

Tree-SHA512: 5e972d51629f156b0a462d49b42e8109490060d05c76cb6d2f98c904ec0668e018d0b25dad3660946df699f850a1935e7292a62789346b08a78d798bd8dbc9f3
v28.3
2025-10-16 16:05:37 +01:00
fanquake
2dfb3a0690
doc: update manual pages for v28.3 2025-10-13 17:04:01 +01:00
fanquake
3590bbffa6
build: bump version to 28.3 2025-10-13 16:57:25 +01:00
fanquake
da5f5de405
doc: update release notes for 28.3 2025-10-13 16:56:51 +01:00
Ava Chow
1c521ae922
ci: Properly include $FILE_ENV in DEPENDS_HASH
$FILE_ENV has a full relative path already, prepending with ci/test/
results in a non-existent path which means that DEPENDS_HASH was not
actually committing to the test's environment file.

Github-Pull: #33581
Rebased-From: ceeb53adcd0a6a87a65c8ebbb20472c15c502dfd
2025-10-13 16:56:17 +01:00
merge-script
d70e9c5d13
Merge bitcoin/bitcoin#33557: [28.x] 28.3rc2
44d05b2fb25b0a5f14e7487c792ac25ad5f5c284 doc: update release notes for 28.x (fanquake)
201221b7502dce7c6c640a4d8e8018d3e14284fa doc: update manual pages for v28.3rc2 (fanquake)
e2e1138350863e46ef4800b6afac54b6a4d6d110 build: bump version to 28.3rc2 (fanquake)
9c911f7e2dcb6dc26b5824bdae2d389cc931607e build: fix depends Qt download link (fanquake)
ae8605825ff2fb07560976160066e43598de8a13 contrib: fix using macdploy script without translations. (amisha)

Pull request description:

  Backports:
  * #33482
  * #33563

  Plus final changes for a `28.3rc2`.

ACKs for top commit:
  marcofleon:
    Nice, re ACK 44d05b2fb25b0a5f14e7487c792ac25ad5f5c284
  stickies-v:
    re-ACK 44d05b2fb25b0a5f14e7487c792ac25ad5f5c284

Tree-SHA512: 63d46b93fcc2201071328a0708d32ef7b9ce80348455ec059c11edf238003a6f0ec7bd018a76bf0d7ba90ab99dae5176dfa387f9ea1b791e1f8ef785d7c2f1f2
v28.3rc2
2025-10-13 12:30:28 +01:00
fanquake
44d05b2fb2
doc: update release notes for 28.x 2025-10-13 12:04:53 +01:00
fanquake
201221b750
doc: update manual pages for v28.3rc2 2025-10-07 14:53:26 +01:00
fanquake
e2e1138350
build: bump version to 28.3rc2 2025-10-07 14:53:26 +01:00
fanquake
9c911f7e2d
build: fix depends Qt download link
Github-Pull: #33563
Rebased-From: abf4a6eeaee116917dafd56eb9caee03e13048d2
2025-10-07 14:53:26 +01:00
amisha
ae8605825f
contrib: fix using macdploy script without translations.
QT translations are optional, but the script would error when
'translations_dir' falls back to its default value NULL.

This PR fixes it by moving the set-up of QT translations under
the check for 'translations_dir' presence.

Github-Pull: #33482
Rebased-From: 7b5261f7ef3d88361204c40eb10c0d9dc44f5ed7
2025-10-07 14:53:26 +01:00
merge-script
42c4c6b6dd
Merge bitcoin/bitcoin#33561: [28.x] ci: Fix Qt 5.15 URL
2cd432dc6dad1b9f97d1c791ff1c1b0dd25a8db6 [28.x] ci: Fix Qt 5.15 URL (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  fanquake:
    ACK 2cd432dc6dad1b9f97d1c791ff1c1b0dd25a8db6

Tree-SHA512: 762dcd7d08012a683d88b6f6437d7ffe31271abfa6a1a0be604746fad8473ba0ff6066880a8a6f56382f8da46f01fb3349440efef30990b1bab818521963496f
2025-10-07 14:52:44 +01:00
Hennadii Stepanov
2cd432dc6d
[28.x] ci: Fix Qt 5.15 URL 2025-10-07 13:43:24 +01:00
merge-script
e9dd94abcc
Merge bitcoin/bitcoin#33535: [28.x] More backports
06fe49dc88638e2ad21f1b7d0dd87661de384517 doc: update release notes for 28.x (fanquake)
11da80fe6a5e83014fdfa2b4393e69afdaf3402d test: add more TRUC reorg coverge (Greg Sanders)
05f4aa7662ff4922435a3e25d02da0ff63be55b3 Mempool: Do not enforce TRUC checks on reorg (Greg Sanders)
ffffdc4e97b847fcbcea794608f1df2accf76804 fuzz: don't bypass_limits for most mempool harnesses (Greg Sanders)

Pull request description:

  Backports:
  * #33504

ACKs for top commit:
  darosior:
    utACK 06fe49dc88638e2ad21f1b7d0dd87661de384517.
  dergoegge:
    ACK 06fe49dc88638e2ad21f1b7d0dd87661de384517
  instagibbs:
    ACK 06fe49dc88638e2ad21f1b7d0dd87661de384517

Tree-SHA512: 50495b75dec6dbbe24686cd7f1e832a79c841d29983d6be415783ba4ad3a1f7657459d491fc214de4d45f60467abc92f1daf75479f3db854fc6b3410368e67fc
2025-10-07 10:01:49 +01:00
fanquake
06fe49dc88
doc: update release notes for 28.x 2025-10-03 16:16:56 +01:00
Greg Sanders
11da80fe6a
test: add more TRUC reorg coverge
Github-Pull: #33504
Rebased-From: 06df14ba75be5f48cf9c417424900ace17d1cf4d
2025-10-03 16:15:25 +01:00
Greg Sanders
05f4aa7662
Mempool: Do not enforce TRUC checks on reorg
Not enforcing TRUC topology on reorg was the intended
behavior, but the appropriate bypass argument was not
checked.

This mistake means we could potentially invalidate a long
chain of perfectly incentive-compatible transactions that
were made historically, including subsequent non-TRUC
transactions, all of which may have been very high feerate.

Lastly, it wastes CPU cycles doing topology checks since
this behavior cannot actually enforce the topology in
general for the reorg setting.

Github-Pull: #33504
Rebased-From: 26e71c237d9d2197824b547f55ee3a0a60149f92
2025-10-03 15:50:24 +01:00
Greg Sanders
ffffdc4e97
fuzz: don't bypass_limits for most mempool harnesses
Using bypass_limits=true is essentially fuzzing part of a
reorg only, and results in TRUC invariants unable to be
checked. Remove most instances of bypassing limits, leaving
one harness able to do so.

Github-Pull: #33504
Rebased-From: bbe8e9063c15dc230553e0cbf16d603f5ad0e4cf
2025-10-03 15:49:17 +01:00
Ava Chow
ed730c5674
Merge bitcoin/bitcoin#33476: [28.x] backports + 28.3rc1
9968b15937cbc2071c3474bd83f9c9fb4bb3a970 [doc] update bitcoin.conf example (glozow)
dcac36271f9c6d47a863ab638a91382be6f7a50f [doc] manpages for 28.3rc1 (glozow)
df7412803d5e83a8995ddadf2e35c2ec52f8b9f6 [build] bump version to 28.3rc1 (glozow)
d3194cb8cd81db0d7602fadc9eb71431e7a6c948 [doc] update release notes for 28.x (glozow)
18f6430b4a1e8e844cb1ecf41011e1a3b9eb9aa3 test: compare BDB dumps of test framework parser and wallet tool (Sebastian Falbesoner)
6ede736da10fd5f389054f5301a84adf57849527 test: complete BDB parser (handle internal/overflow pages, support all page sizes) (Sebastian Falbesoner)
66559d1a4af5f5a4d7e311d0ab8e0c1e3c9e2d4a [policy] lower default minrelaytxfee and incrementalrelayfee to 100sat/kvB (glozow)
a02e0a401ceae2f2242c364164df828b51d9cdd4 [prep/test] make wallet_fundrawtransaction's minrelaytxfee assumption explicit (glozow)
f25fc092abe71d870c721b766dabdfe4223fafb4 [prep/util] help MockMempoolMinFee handle more precise feerates (glozow)
4d809efeb980aa76693c7cda179ae91e3deb4c57 [prep/test] replace magic number 1000 with respective feerate vars (glozow)
f7dde40c70f16800048ee6731ff1069f2ec1b437 test: Add missing sync_mempools() to fill_mempool() (MarcoFalke)
a60281526b337047f4dd034496341f1c52ab63ef test: Refactor fill_mempool to extract send_batch helper (MarcoFalke)
08eeb0d3423cdfb6110794dd2bfdd5571459f751 [miner] lower default -blockmintxfee to 1sat/kvB (glozow)
b7ba0167070c93e2c35b3cc1df2979c4a4a2464e test: add `BulkTransaction` helper to unit test transaction utils (Sebastian Falbesoner)
27b775586ebe702c6ac7fe022e2a42216aefea27 [doc] assert that default min relay feerate and incremental are the same (glozow)
e3273e03b1aea0c3ee3aeca802c984ab007f91ed [test] explicitly check default -minrelaytxfee and -incrementalrelayfee (glozow)
cf875f15596052d42abccecb81a96d8e343fd2cd [test] RBF rule 4 for various incrementalrelayfee settings (glozow)
308778b7b614c29bf8fd3e9edcf938d9f19cbba2 [test] check bypass of minrelay for various minrelaytxfee settings (glozow)
e779d59eca62dd20885158256cdbbfbe2ff3ac5c [test] check miner doesn't select 0fee transactions (glozow)

Pull request description:

  Includes backports of
  - #33106
  - #30125
  - #30948
  - #30784

ACKs for top commit:
  achow101:
    ACK 9968b15937cbc2071c3474bd83f9c9fb4bb3a970
  stickies-v:
    re-ACK 9968b15937cbc2071c3474bd83f9c9fb4bb3a970

Tree-SHA512: 1d4ec354a743ec3a894a44d2d9b98dc5169f515081071b887768afee1c42cefdaa6c5f595829dc9b579699bba3e4b4aa73a519d4c4ef8579375ad34513f26cd9
v28.3rc1
2025-10-01 10:42:26 -07:00
glozow
9968b15937 [doc] update bitcoin.conf example 2025-09-30 17:21:25 -04:00
glozow
dcac36271f [doc] manpages for 28.3rc1 2025-09-29 16:48:04 -04:00
glozow
df7412803d [build] bump version to 28.3rc1 2025-09-29 16:48:04 -04:00
glozow
d3194cb8cd [doc] update release notes for 28.x 2025-09-26 10:24:20 -04:00
Sebastian Falbesoner
18f6430b4a test: compare BDB dumps of test framework parser and wallet tool
Github-Pull: #30125
Rebased-From: d45eb3964f693eddcf96f1e4083cf19d327be989
2025-09-26 10:24:20 -04:00
Sebastian Falbesoner
6ede736da1 test: complete BDB parser (handle internal/overflow pages, support all page sizes)
This aims to complete our test framework BDB parser to reflect
our read-only BDB parser in the wallet codebase. This could be
useful both for making review of #26606 easier and to also possibly
improve our functional tests for the BDB parser by comparing with
an alternative implementation.

Github-Pull: #30125
Rebased-From: 01ddd9f646a5329a92341bb216f3757fa97c0709
2025-09-26 10:24:20 -04:00
glozow
66559d1a4a [policy] lower default minrelaytxfee and incrementalrelayfee to 100sat/kvB
Let's say an attacker wants to use/exhaust the network's bandwidth, and
has the choice between renting resources from a commercial provider and
getting the network to "spam" itself it by sending unconfirmed
transactions. We'd like the latter to be more expensive than the former.

The bandwidth for relaying a transaction across the network is roughly
its serialized size (plus relay overhead) x number of nodes. A 1000vB
transaction is 1000-4000B serialized. With 100k nodes, that's 0.1-0.4GB
If the going rate for commercial services is 10c/GB, that's like 1-4c per kvB
of transaction data, so a 1000vB transaction should pay at least $0.04.

At a price of 120k USD/BTC, 100sat is about $0.12. This price allows us
to tolerate a large decrease in the conversion rate or increase in the
number of nodes.

Github-Pull: #33106
Rebased-From: 6da5de58cabc4133c379baa50845e30e5bc6b3e4
2025-09-26 10:24:19 -04:00
glozow
a02e0a401c [prep/test] make wallet_fundrawtransaction's minrelaytxfee assumption explicit
Github-Pull: #33106
Rebased-From: 2e515d2897eaa5a9b012eb78aef105e1cf80d42b
2025-09-26 10:22:38 -04:00
glozow
f25fc092ab [prep/util] help MockMempoolMinFee handle more precise feerates
Use a virtual size of 1000 to keep precision when using a feerate
(which is rounded to the nearest satoshi per kvb) that isn't just an
integer.

Github-Pull: #33106
Rebased-From: 457cfb61b5323a13218b3cfb5a6a6d8b3a7c5f7f
2025-09-26 10:22:38 -04:00
glozow
4d809efeb9 [prep/test] replace magic number 1000 with respective feerate vars
Github-Pull: #33106
Rebased-From: 3eab8b724044dc321f70e5eed66b149713158a04
2025-09-26 10:22:38 -04:00
MarcoFalke
f7dde40c70 test: Add missing sync_mempools() to fill_mempool()
Also disable the function, when it is not needed.

Github-Pull: #30948
Rebased-From: faf801515f8fcd11a3454105cab66c38f6f240fe
2025-09-26 10:22:38 -04:00
MarcoFalke
a60281526b test: Refactor fill_mempool to extract send_batch helper
This is needed for the next commit

Github-Pull: #30948
Rebased-From: fa48be6f0233cfbd5c1eab7b832c913912062fa5
2025-09-26 10:22:38 -04:00
glozow
08eeb0d342 [miner] lower default -blockmintxfee to 1sat/kvB
Back when we implemented coin age priority as a miner policy, miners
mempools might admit transactions paying very low fees, but then want to
set a higher fee for block inclusion. However, since coin age priority
was removed in v0.15, the block assembly policy is solely based on fees,
so we do not need to apply minimum feerate rules in multiple places. In
fact, the block assembly policy ignoring transactions that are added to
the mempool is likely undesirable as we waste resources accepting and
storing this transaction.

Instead, rely on mempool policy to enforce a minimum entry feerate to
the mempool (minrelaytxfee). Set the minimum block feerate to the
minimum non-zero amount (1sat/kvB) so it collects everything it finds in
mempool into the block.

Github-Pull: #33106
Rebased-From:  5f2df0ef78be7b24798d0983c9b962740608f1f4
2025-09-26 10:22:38 -04:00
Sebastian Falbesoner
b7ba016707 test: add BulkTransaction helper to unit test transaction utils
The padding method used matches the one used in MiniWallet,
`MiniWallet._bulk_tx`.

Github-Pull: #30784
Rebased-From: ed7d2246661ec1789b7db0f21668270f0681ea4a
2025-09-26 10:22:38 -04:00
glozow
27b775586e [doc] assert that default min relay feerate and incremental are the same
Github-Pull: #33106
Rebased-From: d6213d6aa114aeed6804a585491d741386fd2739
2025-09-26 10:22:38 -04:00
glozow
e3273e03b1 [test] explicitly check default -minrelaytxfee and -incrementalrelayfee
Github-Pull: #33106
Rebased-From:  1fbee5d7b61b83e68e4230c8a97ca308de92c4c3
2025-09-26 10:22:38 -04:00
glozow
cf875f1559 [test] RBF rule 4 for various incrementalrelayfee settings
Github-Pull: #33106
Rebased-From: 72dc18467dbfc16cdbda2dd109b087243b397799
2025-09-26 10:22:38 -04:00
glozow
308778b7b6 [test] check bypass of minrelay for various minrelaytxfee settings
Github-Pull: #33106
Rebased-From: 85f498893f54ea7d84f2bdf12aa35d198edf8a72
2025-09-26 10:22:38 -04:00
glozow
e779d59eca [test] check miner doesn't select 0fee transactions
Github-Pull: #33106
Rebased-From: e5f896bb1f052fb8c7811c6024cb49143b427512
2025-09-26 10:22:38 -04:00
Ava Chow
a0b5730f85
Merge bitcoin/bitcoin#33415: [28.x] More backports
a5e4fec4949f61ebbd7d6696f39da26df04515f9 doc: update release notes for 28.x (fanquake)
4598dfcfdebacaf3e080925f99d147270af23b2b doc: Remove wrong and redundant doxygen tag (MarcoFalke)
9e56d8889ae8a30c3a672ba60d1a7c8c861fb6ba net: Do not apply whitelist permission to onion inbounds (Martin Zumsande)
a381de750d74b3e43d3ad0acfe848e25b0fec0ff Fix benchmark CSV output (Hennadii Stepanov)

Pull request description:

  Further backports for `28.x`:
  * #33236
  * #33340
  * #33395

ACKs for top commit:
  achow101:
    ACK a5e4fec4949f61ebbd7d6696f39da26df04515f9
  willcl-ark:
    ACK a5e4fec4949f61ebbd7d6696f39da26df04515f9

Tree-SHA512: eb00b395dea8a3e50e19683e824abd946d0e0ef5188cca3fddbc35a8e2ecc203cfc7a8f480e0fbf09cc48f660b1da324da4d777ec47346c52d230c5b93f536c3
2025-09-25 13:41:04 -07:00