Commit Graph

45130 Commits

Author SHA1 Message Date
Greg Sanders
0b4048c733 datacarrier: deprecate startup arguments for future removal 2025-05-30 10:14:18 -04:00
Greg Sanders
63091b79e7 test: remove unnecessary -datacarriersize args from tests 2025-05-30 10:14:18 -04:00
Greg Sanders
9f36962b07 policy: uncap datacarrier by default
Datacarrier output script sizes and output counts are now
uncapped by default.

To avoid introducing another startup argument, we modify the
OP_RETURN accounting to "budget" the spk sizes.

If a user has set a custom default, this results in that
budget being spent over the sum of all OP_RETURN outputs'
scripts in the transaction, no longer capping the number
of OP_RETURN outputs themselves. This should allow a
superset of current behavior while respecting the passed
argument in terms of total arbitrary data storage.

Co-authored-by: Anthony Towns <aj@erisian.com.au>
2025-05-30 10:12:38 -04:00
merge-script
4b1d48a686 Merge bitcoin/bitcoin#32598: walletdb: Log additional exception error messages for corrupted wallets
ad9a13fc42 walletdb: Log additional exception error messages for corrupted wallets (Ava Chow)

Pull request description:

  Many exceptions thrown for corruption are `std::runtime_error`; we should catch those and log the message to help with debugging.

  Split from #32489

ACKs for top commit:
  davidgumberg:
    ACK ad9a13fc42
  furszy:
    ACK ad9a13fc42
  rkrux:
    ACK ad9a13fc42
  Sjors:
    utACK ad9a13fc42

Tree-SHA512: 107b938d67346804733ea27c44ed38822db0e020e5b1ac889ee35280d812ec56dcc9af7b3eab7a521d72cdd9cb4a8d6d35f3a3dfbcb2a6fd170a981f34fbdfc2
2025-05-30 11:33:24 +01:00
merge-script
b933813386 Merge bitcoin/bitcoin#32619: wallet, rpc, gui: List legacy wallets with a message about migration
f3a444c45f gui: Disallow loading legacy wallets (Ava Chow)
09955172f3 wallet, rpc: Give warning in listwalletdir for legacy wallets (Ava Chow)

Pull request description:

  A new field `warnings` is added for each wallet in `listwalletdir`. If a legacy wallet is detected, the warning will contain a message that the wallet is a legacy wallet and will need to be migrated before it can be loaded.

  In the GUI, the "Open Wallet" menu is changed to show legacy wallets greyed out with "(needs migration)" appended to their name to indicate to the user that the legacy wallet will need to be migrated.

ACKs for top commit:
  maflcko:
    lgtm ACK f3a444c45f
  adyshimony:
    Test ACK [f3a444c](f3a444c45f)
  furszy:
    Code review ACK f3a444c45f
  w0xlt:
    Code Review ACK f3a444c45f

Tree-SHA512: 496caec0ca37845487bd709e592240315eb23461fbd697e68a7fde8e4d9b74b48aab1212c88dbbcc8a107a896b824c2e1f69691068641812ae903f873fa2f22b
2025-05-30 11:17:40 +01:00
merge-script
053bda5d9f Merge bitcoin/bitcoin#32460: fs: remove _POSIX_C_SOURCE defining
24e5fd3bed fs: remove _POSIX_C_SOURCE defining (fanquake)

Pull request description:

  On Linux systems, `_POSIX_C_SOURCE` will default to `200809L` (since glibc 2.10). There's currently no reason for us to undefine it, and then set it to an earlier value. Also tested with musl libc.

  I think if anything, the project should be settings macros like `_POSIX_C_SOURCE`, globally.

ACKs for top commit:
  hebasto:
    re-ACK 24e5fd3bed, only rebased since my recent [review](https://github.com/bitcoin/bitcoin/pull/32460#pullrequestreview-2854183748).

Tree-SHA512: 920d60058821992193616e0c73c2f7e4230a9e3ccb9d71d16493ae69696c868f4325d3dd2d4e8388749080c187aa7b205493b3e2c6986ad37440e591ebe107e1
2025-05-30 10:21:01 +01:00
merge-script
9393aeeca4 Merge bitcoin/bitcoin#32641: Update libmultiprocess subtree to fix clang-tidy errors
154af1eea1 Squashed 'src/ipc/libmultiprocess/' changes from 35944ffd23fa..27c7e8e5a581 (Ryan Ofsky)

Pull request description:

  Includes:

  - https://github.com/bitcoin-core/libmultiprocess/pull/165
  - https://github.com/bitcoin-core/libmultiprocess/pull/173
  - https://github.com/bitcoin-core/libmultiprocess/pull/172

  These changes are needed to fix CI errors in #31802.

  The changes can be verified by running `test/lint/git-subtree-check.sh src/ipc/libmultiprocess` as described in [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#subtrees) and [lint instructions](https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh)

ACKs for top commit:
  Sjors:
    ACK 9f6565488f
  TheCharlatan:
    ACK 9f6565488f

Tree-SHA512: 745789a6fba552aa066f9f69592b16a5277999dbf0413eaed7fe25cd440b78af57615edfce781592873659fda91463bef7c5dac202b80362bd86f6a90ab20d69
2025-05-30 10:12:51 +01:00
Ava Chow
5471e29d05 Merge bitcoin/bitcoin#32304: test: test MAX_SCRIPT_SIZE for block validity
b1ea542ae6 test: test MAX_SCRIPT_SIZE for block validity (Greg Sanders)

Pull request description:

  I don't believe there are direct tests for this.

ACKs for top commit:
  achow101:
    ACK b1ea542ae6
  TheCharlatan:
    ACK b1ea542ae6
  theStack:
    ACK b1ea542ae6

Tree-SHA512: 1d7d3eab9c54977844bf2ca1aa403b070aae0f818db2fb5cae367d1c4d12f1e403b6fdec224af769a2ebb648cbca8bfd0d7df5db2a89fccf256c9c244484eba2
2025-05-29 14:32:10 -07:00
Ryan Ofsky
9f6565488f Merge commit '154af1eea1170f5626aa1c5f19cc77d1434bcc9d' into HEAD 2025-05-29 13:57:08 -04:00
Ryan Ofsky
154af1eea1 Squashed 'src/ipc/libmultiprocess/' changes from 35944ffd23fa..27c7e8e5a581
27c7e8e5a581 Merge chaincodelabs/libmultiprocess#172: refactor: fix warnings from clang-tidy-20 and bitcoin-tidy
2fe87d016be4 Merge chaincodelabs/libmultiprocess#173: doc: Fix error string typo
57a65b854664 clang-tidy: Suppress bitcoin-nontrivial-threadlocal error
0d8012f656fe Merge chaincodelabs/libmultiprocess#165: clang-tidy: fix warnings introduced in version 19
3a96cdc18f2d clang-tidy: Fix bugprone-move-forwarding-reference error
c1e8c1a02864 clang-tidy: Fix bugprone-move-forwarding-reference errors
aa19285303ff use ranges transform
a78137ca73b8 make member function const
ca3226ec8ab7 replace custom tuple unpacking code with `std::apply`
949fe85fc91f replace SFINAE trick with `if constexpr`
44ee4b40b89a doc: Fix error string typo

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 27c7e8e5a581b3c41330e758951251ef11807b11
2025-05-29 13:57:08 -04:00
merge-script
c540ede1cb Merge bitcoin/bitcoin#32633: windows: Use predefined RC_INVOKED macro instead of custom one
55f1c2ac8b windows: Use predefined `RC_INVOKED` macro instead of custom one (Hennadii Stepanov)

Pull request description:

  See: https://learn.microsoft.com/en-us/windows/win32/menurc/predefined-macros.

ACKs for top commit:
  hodlinator:
    re-ACK 55f1c2ac8b
  fanquake:
    ACK 55f1c2ac8b

Tree-SHA512: cf18e03d0c2b1cd590e379707fc6d1775f08814f20aa51c0c40b9eac6227f42a6e07ba3e478da7d511ace29782bf964eae3edfeb04bcb1f87596966bdd3a55c9
2025-05-29 13:51:08 +01:00
Antoine Poinsot
cfc42ae5b7 fuzz: add a target for the coins database
It reuses the logic from the `coins_view` target, except it uses an
in-memory CCoinsViewDB as the backend.

Note `CCoinsViewDB` will assert the best block hash is never null, so we
slightly modify the coins_view fuzz logic to take care of this.
2025-05-29 12:14:13 +01:00
Hennadii Stepanov
55f1c2ac8b windows: Use predefined RC_INVOKED macro instead of custom one 2025-05-29 11:18:36 +01:00
merge-script
14c16e8159 Merge bitcoin/bitcoin#32582: log: Additional compact block logging
83df64d749 log: Stats when fulfilling GETBLOCKTXN (David Gumberg)
3733ed2dae log: Size of missing tx'es when reconstructing compact block (David Gumberg)
36bcee05dc log: Log start of compact block initialization. (David Gumberg)

Pull request description:

  This PR adds some additional logging to help measure performance of compact block reconstruction.

  1. Adds a message to the beginning of `PartiallyDownloadedBlock::InitData()` so that that the logs indicate the amount of time it takes to populate a compact block from mempool transactions.
  2. Logs the size of the transactions which a node did not have in its mempool and was forced to request.
  3. Logs the size and number of transactions that a node sends to it's peer in a `BLOCKTXN` to fulfill a compact block `GETBLOCKTXN` request.

  Relevant to this discussion on delving bitcoin: https://delvingbitcoin.org/t/stats-on-compact-block-reconstructions/1052

ACKs for top commit:
  instagibbs:
    reACK 83df64d749
  w0xlt:
    reACK 83df64d749
  1440000bytes:
    ACK 83df64d749

Tree-SHA512: 92c3c7d55005dd47dad90ddb54e4127482260cea5390f7696e8b3b9defb337f5fb09166af6b12eb2ab8151d04dae08b0a570e3509a86509b0ab3151d84387e06
2025-05-29 10:58:19 +01:00
merge-script
aad5938c49 Merge bitcoin/bitcoin#32516: test: add MAX_DISCONNECTED_TX_POOL_BYTES, chainlimits coverage
84aa484d45 test: fix transaction_graph_test reorg test (Greg Sanders)
eaf44f3767 test: check chainlimits respects on reorg (Greg Sanders)
47894367b5 functional test: add MAX_DISCONNECTED_TX_POOL_BYTES coverage (Greg Sanders)

Pull request description:

  `DisconnectedBlockTransactions::LimitMemoryUsage()` has unit test coverage, but the default value end to end doesn't have coverage.

  This test adds exercised coverage of memory limiting of the disconnect pool, and some basic behavior sanity checks.

  Another test added is making sure chainlimits are being respected on reorg, and the expected transactions pruned.

  Lastly, fix the existing test case which was using a deficient test via directly inducing reorgs with `invalidateblock`

ACKs for top commit:
  maflcko:
    re-ACK 84aa484d45 🚋
  TheCharlatan:
    ACK 84aa484d45

Tree-SHA512: f5cdb9647fadc8eb30352ce38de44064103825e5358787dfccd6416fa8faf6ceea42552fe2250b37d56271a6c3898b3912e1c028652da122f5c99304aafddb64
2025-05-29 10:50:48 +01:00
merge-script
1062df81ee Merge bitcoin/bitcoin#32634: build: Add resource file and manifest to bitcoin.exe
dbb2d4c3d5 windows: Add application manifest to `bitcoin.exe` (Hennadii Stepanov)
df82c2dc17 windows: Add resource file for `bitcoin.exe` (Hennadii Stepanov)

Pull request description:

  This PR is a follow up to https://github.com/bitcoin/bitcoin/pull/31375, which:
  1. Adds a resource file for `bitcoin.exe` for consistency with other Windows executables.
  2. Adds an application manifest to `bitcoin.exe`, which has been required for release binaries since https://github.com/bitcoin/bitcoin/pull/32396.

ACKs for top commit:
  davidgumberg:
    ACK dbb2d4c3d5
  hodlinator:
    ACK dbb2d4c3d5

Tree-SHA512: 853c9e578bfd74bfd2e1f0fa39f978638723c8e061456caa165fca6f10497517f9503ae12dfb88e7229a02de593ccf22126f3362ca0d75c74becbb727e80c9ad
2025-05-29 10:42:11 +01:00
David Gumberg
83df64d749 log: Stats when fulfilling GETBLOCKTXN 2025-05-28 13:32:48 -07:00
Ava Chow
370c592612 Merge bitcoin/bitcoin#32630: test: fix sync function in rpc_psbt.py
4df4df45d7 test: fix sync function in rpc_psbt.py (Martin Zumsande)

Pull request description:

  Even though the block is created on `node2`, the sync is only between `node1` and `node0`. Accordingly the test fails if I put a sleep in `msg_type == NetMsgType::HEADERS` processing: In this case, `node1` and `node0` do not hear about the new  block, the sync still passes because they are in sync with each other, and later on in the `test_input_confs_control` subtest, `node1` would generate a forked block instead of building on the previous one, leading to test failure.

  Haven't seen this in the CI, but I ran into it on an experimental branch.

ACKs for top commit:
  maflcko:
    lgtm ACK 4df4df45d7
  achow101:
    ACK 4df4df45d7

Tree-SHA512: 1211ba0ad263ebcd0aa6ef7c856dec7ec6ca6010e1df705e7243f6c9d950ccca6df1275c36a73a83034f49ea8401e8f9800c05cdb74c39e860e7ebcaf2ce6ada
2025-05-28 12:44:51 -07:00
Hennadii Stepanov
dbb2d4c3d5 windows: Add application manifest to bitcoin.exe 2025-05-28 20:22:00 +01:00
Hennadii Stepanov
df82c2dc17 windows: Add resource file for bitcoin.exe 2025-05-28 20:20:54 +01:00
David Gumberg
3733ed2dae log: Size of missing tx'es when reconstructing compact block 2025-05-28 11:46:30 -07:00
Martin Zumsande
4df4df45d7 test: fix sync function in rpc_psbt.py
It currently only syncs between the first two nodes,
which may do nothing when the block is created on the
third node.
2025-05-28 11:01:47 -04:00
Ava Chow
88b22acc3d Merge bitcoin/bitcoin#32528: rpc: Round verificationprogress to 1 for a recent tip
fab1e02086 refactor: Pass verification_progress into block tip notifications (MarcoFalke)
fa76b378e4 rpc: Round verificationprogress to exactly 1 for a recent tip (MarcoFalke)
faf6304bdf test: Use mockable time in GuessVerificationProgress (MarcoFalke)

Pull request description:

  Some users really seem to care about this. While it shouldn't matter much, the diff is so trivial that it is probably worth doing.

  Fixes #31127

  One could also consider to split the field into two dedicated ones (https://github.com/bitcoin/bitcoin/issues/28847#issuecomment-1807115357), but this is left for a more involved follow-up and may also be controversial.

ACKs for top commit:
  achow101:
    ACK fab1e02086
  pinheadmz:
    ACK fab1e02086
  sipa:
    utACK fab1e02086

Tree-SHA512: a3c24e3c446d38fbad9399c1e7f1ffa7904490a3a7d12623b44e583b435cc8b5f1ba83b84d29c7ffaf22028bc909c7cec07202b825480449c6419d2a190938f5
2025-05-27 16:45:23 -07:00
Ava Chow
aee7cec0db Merge bitcoin/bitcoin#32364: refactor: validation: mark CheckBlockIndex as const
3e6ac5bf77 refactor: validation: mark CheckBlockIndex as const (stickies-v)
61a51eccbb validation: don't use GetAll() in CheckBlockIndex() (stickies-v)
d05481df64 refactor: validation: mark SnapshotBase as const (stickies-v)

Pull request description:

  While reviewing another PR, I [noticed](https://github.com/bitcoin/bitcoin/pull/31405#discussion_r2056509235) that `ChainstateManager::CheckBlockIndex()`  is not a `const` method. To try and assert that this method was not causing any side-effects, I modified the method to make it `const`. It did not surface any errors, but I think it would be good to merge this change regardless, even if `CheckBlockIndex` is only used in regtest.

  This PR removes `CheckBlockIndex()`'s calls to non-const `ChainstateManager` methods by marking `SnapshotBase` `const` and ~inlining the `GetAll()` calls (thereby also performing consistency checks on invalid or fully validated `m_disabled==true` chainstates, as slight behaviour change), and finally marks `CheckBlockIndex()` as `const`.

ACKs for top commit:
  achow101:
    ACK 3e6ac5bf77
  mzumsande:
    Code Review ACK 3e6ac5bf77
  TheCharlatan:
    ACK 3e6ac5bf77

Tree-SHA512: 3d3cd351f5af1fab9a9498218ec62dba6e397fc7b5f4868ae0a77dc2b7c813d12c4f53f253f209101a3f6523695014e20c82dfac27cf0035611d5dd29feb80b5
2025-05-27 15:33:09 -07:00
Ava Chow
ce46000712 Merge bitcoin/bitcoin#32509: qa: feature_framework_startup_failures.py fixes & improvements (#30660 follow-up)
bf950c4544 qa: Improve suppressed errors output (Hodlinator)
075352ec8e qa: assert_raises_message() - search in str(e) (Hodlinator)
bd8ebbc4ab qa: Make --timeout-factor=0 result in a smaller factor (Hodlinator)
d8f05e7bf3 qa: Fix dormant bug caused by multiple --tmpdir (Hodlinator)

Pull request description:

  * Handle multiple `--tmpdir` args properly.
  * Handle `--timeout-factor=0` properly (fixes #32506).
  * Improve readability of expected error message (`assert_raises_message()`).
  * Make suppressed error output less confusing (`wait_for_rpc_connection()`).

ACKs for top commit:
  i-am-yuvi:
    re-ACK bf950c4544
  ismaelsadeeq:
    Code review and tested ACK bf950c45
  achow101:
    ACK bf950c4544
  janb84:
    LGTM ACK bf950c4544

Tree-SHA512: 8993f53e962231adef9cad92594dc6a8b8e979b1571d1381cd0fffa1929833b2163c68c03b6a6e29995006a3c3121822ec25ac7725e71ccdab8876ac24aae86c
2025-05-27 14:45:11 -07:00
Ava Chow
d21612fc4b Merge bitcoin/bitcoin#32404: log: print reason when writing chainstate
53e9b71b2f log: print reason for why should_write was triggered in `FlushStateToDisk` (Lőrinc)

Pull request description:

  This PR addresses a leftover logging nit found while reviewing https://github.com/bitcoin/bitcoin/pull/30611#pullrequestreview-2809508852.
  This was also needed to validate its behavior properly, because currently there's no way to visualize how often (and why) we're flushing/syncing.

  Starting with `-debug=coindb` will now add log lines such as
  ```
  2025-05-03T08:34:57Z [coindb] Writing chainstate to disk: flush mode=PERIODIC, prune=0, large=0, critical=0, periodic=1
  2025-05-03T09:26:52Z [coindb] Writing chainstate to disk: flush mode=PERIODIC, prune=0, large=0, critical=0, periodic=1
  2025-05-03T10:27:58Z [coindb] Writing chainstate to disk: flush mode=PERIODIC, prune=0, large=0, critical=0, periodic=1
  2025-05-03T11:39:20Z [coindb] Writing chainstate to disk: flush mode=PERIODIC, prune=0, large=0, critical=0, periodic=1
  2025-05-03T12:41:48Z [coindb] Writing chainstate to disk: flush mode=PERIODIC, prune=0, large=0, critical=0, periodic=1
  2025-05-03T13:40:08Z [coindb] Writing chainstate to disk: flush mode=PERIODIC, prune=0, large=0, critical=0, periodic=1
  2025-05-03T14:49:16Z [coindb] Writing chainstate to disk: flush mode=PERIODIC, prune=0, large=0, critical=0, periodic=1
  2025-05-03T15:14:37Z [coindb] Writing chainstate to disk: flush mode=ALWAYS, prune=0, large=0, critical=0, periodic=0
  2025-05-03T15:17:28Z [coindb] Writing chainstate to disk: flush mode=ALWAYS, prune=0, large=0, critical=0, periodic=0
  ```

ACKs for top commit:
  davidgumberg:
    ACK 53e9b71b2f
  jonatack:
    diff-only review ACK 53e9b71b2f per `git range-diff 2df824 cfc8056 53e9b71`
  achow101:
    ACK 53e9b71b2f
  andrewtoth:
    utACK 53e9b71b2f

Tree-SHA512: 09f3a38cf3ecaa32cf3aba350a9e9dff9345c5468a05070c8b20987f0fdb23a8b1dc59370829c64ea356d2fc0ce99a66cc7240de7fa8c19ef3133da06db6bf3d
2025-05-27 14:30:34 -07:00
Greg Sanders
84aa484d45 test: fix transaction_graph_test reorg test
The current test directly uses invalidatblock to trigger
mempool re-entry of transactions. Unfortunately, the
behavior doesn't match what a real reorg would look like. As
a result you get surprising behavior such as the mempool
descendant chain limits being exceeded, or if a fork is
greater than 10 blocks deep, evicted block transactions stop
being submitted back into in the mempool.

Fix this by preparing an empty fork chain, and then
continuing with the logic, finally submitting the fork chain
once the rest of the test is prepared. This triggers a more
typical codepath.

Also, extend the descendant limit to 100, like ancestor
limit.
2025-05-27 17:08:15 -04:00
Greg Sanders
eaf44f3767 test: check chainlimits respects on reorg 2025-05-27 17:02:42 -04:00
Greg Sanders
47894367b5 functional test: add MAX_DISCONNECTED_TX_POOL_BYTES coverage 2025-05-27 17:02:02 -04:00
Ava Chow
9bd9aee5a6 Merge bitcoin/bitcoin#32487: blocks: avoid recomputing block header hash in ReadBlock
09ee8b7f27 node: avoid recomputing block hash in `ReadBlock` (Lőrinc)
2bf173210f test: exercise `ReadBlock` hash‑mismatch path (Lőrinc)

Pull request description:

  Eliminate one block header hash calculation per block-read by reusing the hash for:
  * proof‑of‑work verification;
  * (optional) integrity check against the supplied hash.

  This part of the code wasn't covered by tests either, so the first commit exercises this part first, before pushing the validation to the delegate method.

ACKs for top commit:
  maflcko:
    lgtm ACK 09ee8b7f27
  achow101:
    ACK 09ee8b7f27
  jonatack:
    ACK 09ee8b7f27
  pinheadmz:
    ACK 09ee8b7f27

Tree-SHA512: 43fe51b478ea574b6d4c952684b13ca54fb8cbd67c3b6c136f460122d9ee953cc70b88778537117eecea71ccb8d88311faeac21b866e11d117f1145973204ed4
2025-05-27 13:02:27 -07:00
Ava Chow
4173805a15 Merge bitcoin/bitcoin#32623: test: Add missing ipc subtree to lint
fa4b8b16c3 test: Add missing ipc subtree to lint (MarcoFalke)

Pull request description:

  The subtree docs and lint checks list the subtrees in three places, making it hard to follow and update and easy to miss one.

  Fix all issues by including the missing one and removing the list in one place.

ACKs for top commit:
  l0rinc:
    ACK fa4b8b16c3
  davidgumberg:
    ACK fa4b8b16c3
  achow101:
    ACK fa4b8b16c3
  hebasto:
    re-ACK fa4b8b16c3, only a [comment](https://github.com/bitcoin/bitcoin/pull/32623#discussion_r2109243775) has been addressed since my recent [review](https://github.com/bitcoin/bitcoin/pull/32623#pullrequestreview-2871162934).
  BrandonOdiwuor:
    Re-ACK fa4b8b16c3

Tree-SHA512: 97a39cf63be2707b2e03502546797ef639a611030e0a860618256c7c0683381be0f05c8bf850f9542a25266a52f58cef690abf9cc243498b6e026c7a6f9a52b2
2025-05-27 12:47:55 -07:00
Ava Chow
012f347685 Merge bitcoin/bitcoin#31375: multiprocess: Add bitcoin wrapper executable
a5ac43d98d doc: Add release notes describing bitcoin wrapper executable (Ryan Ofsky)
258bda80c0 doc: Mention bitcoin wrapper executable in documentation (Ryan Ofsky)
d2739d75c9 build: add bitcoin.exe to windows installer (Sjors Provoost)
ba649c0006 ci: Run multiprocess tests through wrapper executable (Ryan Ofsky)
29bdd743bb test: Support BITCOIN_CMD environment variable (Ryan Ofsky)
9c8c68891b multiprocess: Add bitcoin wrapper executable (Ryan Ofsky)
5076d20fdb util: Add cross-platform ExecVp and GetExePath functions (Ryan Ofsky)

Pull request description:

  Intended to make bitcoin command line features more discoverable and allow installing new multiprocess binaries in libexec/ instead of bin/ so they don't cause confusion.

  Idea and implementation of this were discussed in https://github.com/bitcoin/bitcoin/issues/30983.

  ---

  Initial implementation of this feature is deliberately minimal so the UX can evolve in response to feedback and there are not too many details to debate and discuss in a single PR. But many improvements are possible or planned:

  - Adding manpage and bash completions.
  - Showing nicer error messages that detect if an executable isn't installed and suggest how to fix [(comment)](https://github.com/bitcoin/bitcoin/pull/31375#discussion_r2073194474)
  - Showing wrapper command lines in subcommand in help output [(comment)](https://github.com/bitcoin/bitcoin/pull/31375#discussion_r2077800405). This could be done conditionally as suggested in the comment or be unconditional.
  - Showing wrapper command lines in subcommand error output. There is a bitcoin-cli error pointed out in [(comment)](https://github.com/bitcoin/bitcoin/pull/31375#discussion_r2091152243) that is needlessly confusing.
  - Integrating help so `bitcoin help subcommand` invokes `bitcoin subcommand -h`. `bitcoin -h subcommand` should also be supported and be equivalent [(comment)](https://github.com/bitcoin/bitcoin/pull/31375#discussion_r2093116725)
  - Adding support for `bitcoin-util` subcommands. Ideal interface would probably be more like `bitcoin grind` not `bitcoin util grind` but this has been punted for now. Supporting subcommands directly would require some ArgsManager modifications
  - Adding a dedicated python functional test for the wrapper. Right now there is some CI coverage by setting the `BITCOIN_CMD` variable, but this doesn't cover things like the help output and version output, and support for different directory layouts.
  - Better `--multiprocess` (`-m`) / `--monolithic` (`-M`) default selection. Right now, default is monolithic but it probably makes sense to chose more intelligently depending on whether -ipc options are enabled and what binaries are available.
  - Maybe parsing `bitcoin.conf` and supporting options to control wrapper behavior like custom locations or preferences or aliases.
  - Better command command line usability. Allow combining short options like (`-ah`). Allow fuzzy matching of subcommands or suggestions if you misspell. (suggested by stickies in review club)
  - Not directly related to this PR but `bitcoin-cli named` implementation used by the wrapper should do a better job disambiguating named arguments from base64 arguments ending in = as pointed out in [(comment)](https://github.com/bitcoin/bitcoin/pull/31375#discussion_r2091886628)

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/issues/28722). A review club meeting for it took place in https://bitcoincore.reviews/31375

ACKs for top commit:
  Sjors:
    utACK a5ac43d98d
  achow101:
    ACK a5ac43d98d
  vasild:
    ACK a5ac43d98d
  theStack:
    ACK a5ac43d98d
  ismaelsadeeq:
    fwiw my last review implied an ACK a5ac43d98d
  hodlinator:
    ACK a5ac43d98d

Tree-SHA512: 570e6a4ff8bd79ef6554da3d01f36c0a7c6d2dd7dace8f8732eca98f4a8bc2284474a9beadeba783114fe2f3dd08b2041b3da7753bae0b7f881ec50668cb821f
2025-05-27 12:38:19 -07:00
merge-script
38ad8027a2 Merge bitcoin/bitcoin#32439: guix: accomodate migration to codeberg
c8d9baae94 guix: accomodate migration to codeberg (fanquake)

Pull request description:

  See https://guix.gnu.org/blog/2025/migrating-to-codeberg/.

ACKs for top commit:
  maflcko:
    lgtm ACK c8d9baae94
  hebasto:
    ACK c8d9baae94.

Tree-SHA512: 6a2221faf49c84cd2a4027e4b721553d700a9af0736dbbea80aa94289ff7665e7f4681c12fa3b5195e21dc3ac91fb1796635f26c1298bb5da1dee5690697edd0
2025-05-27 18:08:51 +01:00
MarcoFalke
fa4b8b16c3 test: Add missing ipc subtree to lint 2025-05-27 18:33:56 +02:00
merge-script
f7cc7f6468 Merge bitcoin/bitcoin#32591: test: fix and augment block tests of invalid_txs
8fcd684505 test: ensure reason is checked for invalid blocks rejection (Greg Sanders)
1a689a2c88 test: fix block tests of invalid_txs (Greg Sanders)

Pull request description:

  We are not actually testing some cases accidentally, for block inclusion.

  Issue discovered while reviewing https://github.com/bitcoin/bitcoin/pull/32533

ACKs for top commit:
  maflcko:
    review ACK 8fcd684505 🔶
  theStack:
    ACK 8fcd684505
  BrandonOdiwuor:
    Code Review ACK 8fcd684505
  TheCharlatan:
    ACK 8fcd684505

Tree-SHA512: 7e79ea35b64f56b29811b29df5752945cb10ec62465b385be5e4e2d295c3237b15d5dacf9e99661346967e84899da6fc82e3d2bd0ef6e5c51da85247da31e26a
2025-05-27 14:25:31 +01:00
merge-script
87860143be Merge bitcoin/bitcoin#32270: test: fix pushdata scripts
f66b14d2ec test: fix pushdata scripts (Greg Sanders)

Pull request description:

  The original scripts were done incorrectly,
  so they are changed to represent two
  different 2-byte pushes.

  Fixes https://github.com/bitcoin/bitcoin/pull/32114#discussion_r2034051063

ACKs for top commit:
  ajtowns:
    ACK f66b14d2ec
  TheCharlatan:
    Re-ACK f66b14d2ec

Tree-SHA512: 0956124ee0d2e8b6a594f9feeb47c1f598c68e24d277e874f81a093268113e9da2c75a02863dbaab68b962063f7d910bfd10abe3ad33ec182bc21d72908f06e6
2025-05-27 11:59:31 +01:00
fanquake
c8d9baae94 guix: accomodate migration to codeberg
See https://guix.gnu.org/blog/2025/migrating-to-codeberg/.

When interacting with the old repo you may now also see:
```bash
warning: redirecting to https://codeberg.org/guix/guix/
```
2025-05-27 11:34:03 +01:00
Ava Chow
f3a444c45f gui: Disallow loading legacy wallets
Instead of allowing users to load a legacy wallet from the "Open Wallet"
menu, show the legacy wallet greyed out with a message that the wallet
needs to be migrated.
2025-05-26 15:14:41 -07:00
Ava Chow
09955172f3 wallet, rpc: Give warning in listwalletdir for legacy wallets 2025-05-26 15:14:41 -07:00
Lőrinc
09ee8b7f27 node: avoid recomputing block hash in ReadBlock
Eliminate one SHA‑256 double‑hash computation of the header per block read by reusing the hash for:
* proof‑of‑work verification;
* (optional) integrity check against the supplied hash.
2025-05-26 23:23:44 +02:00
Lőrinc
2bf173210f test: exercise ReadBlock hash‑mismatch path
Ensure `ReadBlock` rejects a block when the tip’s `phashBlock` differs from the expected hash.
2025-05-26 23:11:54 +02:00
MarcoFalke
fab1e02086 refactor: Pass verification_progress into block tip notifications
It is cheap to calculate and the caller does not have to take a lock to
calculate it.

Also turn pointers that can never be null into references.
2025-05-24 13:49:32 +02:00
Ava Chow
638a4c0bd8 Merge bitcoin/bitcoin#32596: wallet, rpc, doc: various legacy wallet removal cleanups in RPCs
e5cbea416b rpc: doc: remove redundant "descriptors" parameter in `createwallet` examples (Sebastian Falbesoner)
7a05f941bb rpc: doc: drop descriptor wallet mentions in fast wallet rescan related RPCs (Sebastian Falbesoner)
db465a50e2 wallet, rpc: remove obsolete "keypoololdest" result field/code (Sebastian Falbesoner)

Pull request description:

  This PR contains a few smaller wallet RPC cleanups based on that we only ever operate on descriptor wallets now:
  * remove the now obsolete "keypoololdest" field from the `getwalletinfo` RPC and the corresponding CWallet/ScriptPubKeyMan methods
  * in RPCs where potential fast wallet rescan is documented, remove the "descriptor wallet" mentions (back then introduced in commit ca48a4694f, PR #25957)
  * for the `createwallet` RPC examples, remove the "descriptors" parameters that always have to be true now (proposed in https://github.com/bitcoin/bitcoin/pull/31250#discussion_r2042020967; corresponds to 86de8c1668, PR #32544 which did the same for functional tests)

ACKs for top commit:
  achow101:
    ACK e5cbea416b
  1440000bytes:
    ACK e5cbea416b
  rkrux:
    ACK e5cbea416b

Tree-SHA512: d785f621af3f3987b258e5d7fb8309344fb13c2cf41855f8adf99ff89f581142db36e3ba59919d6abf82662caa3f7e4a2bd38eba1be9e23665e6a4a23ee52acd
2025-05-23 12:34:39 -07:00
Lőrinc
53e9b71b2f log: print reason for why should_write was triggered in FlushStateToDisk
Co-authored-by: Jon Atack <jon@atack.com>
2025-05-23 21:18:00 +02:00
Ava Chow
ad9a13fc42 walletdb: Log additional exception error messages for corrupted wallets 2025-05-23 11:31:21 -07:00
Antoine Poinsot
46e14630f7 fuzz: move the coins_view target's body into a standalone function
We'll reuse it for a target where the coins view is a DB.
2025-05-23 15:32:16 +01:00
Antoine Poinsot
56d878c465 fuzz: avoid underflow in coins_view target 2025-05-23 15:32:06 +01:00
Sebastian Falbesoner
e5cbea416b rpc: doc: remove redundant "descriptors" parameter in createwallet examples
This is the RPC example counterpart to commit
86de8c1668 (PR #32544).
Since the recent legacy wallet removal this parameter *must* be
true, so providing it in the examples doesn't contain valuable
information anymore and it seems best to remove them.
2025-05-23 00:30:42 +02:00
Sebastian Falbesoner
7a05f941bb rpc: doc: drop descriptor wallet mentions in fast wallet rescan related RPCs
Now that we only ever operate on descriptor wallets, mentioning
that a faster rescan is only available for them is redundant and
can be removed.

These texts were originally introduced in commit
ca48a4694f (PR #25957).
2025-05-23 00:26:19 +02:00
Sebastian Falbesoner
db465a50e2 wallet, rpc: remove obsolete "keypoololdest" result field/code
This `getwalletinfo()` result field was only ever returned for
legacy wallets and is hence not relevant anymore, so we can
delete it and the corresponding CWallet/ScriptPubKeyMan code
behind it.
2025-05-23 00:26:01 +02:00