Commit Graph

49121 Commits

Author SHA1 Message Date
Sjors Provoost
978e7216e6 test: use shared default_ipc_timeout
This commit does not change behavior.

Suggested in https://github.com/bitcoin/bitcoin/pull/33966#discussion_r3303357712
2026-05-29 09:49:03 +02:00
merge-script
1ea532e590 Merge bitcoin/bitcoin#34953: crypto: disable ASan instrumentation of SSE4 SHA256 for GCC (matching Clang)
fedeff7f20 crypto: disable ASan instrumentation of SSE4 SHA256 for GCC (deadmanoz)

Pull request description:

  Fix the runtime crash described in #34881.

  Upstream already disables ASan instrumentation for `sha256_sse4::Transform()` under Clang. This extends the same workaround to GCC by adding an `#elif` branch for `__GNUC__` / `__SANITIZE_ADDRESS__` that applies the same `no_sanitize("address")` attribute.

  Testing:

  - reproduced the crash before the fix with GCC 13, 14, and 15 on Haswell-class machines / guests without SHA-NI (including by forcing the SSE4 implementation on GitHub CI)
  - SEGV in debug builds regardless of optimization level (tested `-O0`, `-O1`, `-O2`, `-O3`)
  - verified that the GCC + ASan debug configurations that previously crashed pass with this change

  Issue #34881 has more details about the issue.

  Note: the original Clang code placed the `__attribute__` between the function declarator and the opening brace. GCC's [Attribute Syntax](https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html) documentation notes that this position in a function definition "may, in future, be permitted," so it is not currently supported. Placing the attribute at the start of the function definition is valid form for both GCC and Clang.

ACKs for top commit:
  maflcko:
    lgtm ACK fedeff7f20 🏒
  sedited:
    tACK fedeff7f20

Tree-SHA512: d8adda0df140b6c93d18f5ecd096b12012332bb640e678075e668122e596baddcb2182cbaeafe7908ada90b4b5cc776a59dcdfb488229ab6640058ccbbd7ea93
2026-05-28 23:04:29 +02:00
Ava Chow
d0a54dd8e0 Merge bitcoin/bitcoin#35381: wallet, test: optinrbf deprecation followups
f701cd159a doc: fix typo in release notes of #34917 (rkrux)
7bc39e3d08 wallet, test: add wallet_deprecated_rbf.py for walletrbf deprecated keys & options (rkrux)
2cbbcb5659 wallet, test: remove -deprecatedrpc=bip125 from wallet_send.py (rkrux)
307134bd7e wallet, test: remove -deprecatedrpc=bip125 from wallet_migration.py (rkrux)
3ec550d168 wallet, test: remove -deprecatedrpc=bip125 from wallet_basic.py (rkrux)
a52ea9bff9 wallet, test: remove -walletrbf startup option from wallet_backwards_compatibility.py (rkrux)
42330922dd wallet, test: remove -walletrbf startup option from wallet_backwards_compatibility.py (rkrux)
8cb6e405d8 wallet, test: remove -walletrbf startup option from wallet_listtransactions.py (rkrux)
0ee94b2fef wallet, test: remove -deprecatedrpc=bip125 from wallet_listtransactions.py (rkrux)
5e833e068d wallet, test: -walletrbf startup option from wallet_bumpfee.py (rkrux)
a2a2b1745f wallet, test: remove -walletrbf startup option from rpc_psbt.py (rkrux)
a3fe455a95 wallet: refactor to read -walletrbf only once instead of twice (rkrux)

Pull request description:

  Prerequisite to #35404 and #35405.

  All these changes address the points raised in the review of PR #34917
  here: https://github.com/bitcoin/bitcoin/pull/34917#pullrequestreview-4362148900.

  Essentially updating the existing wallet functional tests without using
  the -deprecatedrpc=bip125 and -walletrbf startup options. Instead,
  these two are added and tested via a singular new
  wallet_deprecated_rbf.py test that can be removed easily later when
  these startup options are completely removed from the wallet post
  deprecation.

ACKs for top commit:
  maflcko:
    review ACK f701cd159a  🌄
  achow101:
    ACK f701cd159a

Tree-SHA512: 700785062b5de8ee3b6c4f50570b769d56c6c4960f2b6e2a2e71be8085c6b51eaeb34fb158fae76f812fe82791aaa0c0277f964f0472cb0784b86caabe6d4ec9
2026-05-28 13:44:17 -07:00
merge-script
c6f225c757 Merge bitcoin/bitcoin#28333: wallet: Construct ScriptPubKeyMans with all data rather than loaded progressively
451fdd26a4 test: wallet: Constructing a DSPKM that can't TopUp() throws. (David Gumberg)
32946e0291 wallet: Setup new autogenerated descriptors on construction (Ava Chow)
e20aaff70f wallet: Construct ExternalSignerSPKM with the new descriptor (Ava Chow)
aa4f7823aa wallet: include keys when constructing DescriptorSPKM during import (Ava Chow)
6538f69135 fuzz: Skip adding descriptor to wallet if it cannot be expanded (Ava Chow)
8be5ee554b test: wallet: Check that loading wallet with both unencrypted and encrypted keys fails. (David Gumberg)
80b0c25992 wallet: Load everything into DescSPKM on construction (Ava Chow)
f713fd1725 refactor: wallet: Don't reuse WALLET_BLANK flag for born-encrypted wallets. (David Gumberg)
cd912c4e10 wallet: Consolidate generation setup callers into one function (Ava Chow)
0301c758ea wallet migration, fuzz: Migrate hd seed once (Ava Chow)

Pull request description:

  Instead of constructing ScriptPubKeyMans with no data, and then loading data as we find it, we should gather everything first and then load it all on construction. If there actually is no data and we want to setup generation, then that should also occur in a constructor rather than afterwards.

  This change is only applied to DescriptorScriptPubKeyMan and ExternalSignerScriptPubKeyMan, and should be done for any ScriptPubKeyMans added in the future. I don't think it's really worth it to do this for LegacyScriptPubKeyMan since it would make loading performance worse (or cause layer violations) and it's (supposed to be) going away soon.

ACKs for top commit:
  polespinasa:
    ACK 451fdd26a4
  davidgumberg:
    re crACK 451fdd26a4
  w0xlt:
    ACK 451fdd26a4

Tree-SHA512: 58a889bf7c77d5da78041907a76a1958207f95a19bec8dc4d86d4e4108d256a729e0949c0973f7d447178f78a7fd4268cda71d358cae4dec5a76dc453b5283af
2026-05-28 21:49:59 +02:00
Ava Chow
5486ef8cc2 Merge bitcoin/bitcoin#34198: wallet: fix ancient wallets migration
b86c1c443d test: add coverage for migrating ancient wallets (furszy)
fd44d48b24 wallet: fix ancient wallets migration (furszy)

Pull request description:

  We currently fail migration if the wallet does not contain the best block locator.
  This is a problem for wallets created before https://github.com/bitcoin/bitcoin/pull/152, which are not storing such record.

  Missing this record is not an error. it simply means the wallet will scan the chain prior
  to finish migration.

ACKs for top commit:
  achow101:
    ACK b86c1c443d
  w0xlt:
    reACK b86c1c443d
  sedited:
    Re-ACK b86c1c443d

Tree-SHA512: 5226934e16d32f3337c432a84e1adce9985518e52c62abfa4a8d6b3d857d4b5c6aa99ac90e84ae6772983ceaf7a67e128ff7e0e174843fcb892728b9be4653cf
2026-05-28 11:57:39 -07:00
merge-script
f1344e6c7f Merge bitcoin/bitcoin#35378: ci: switch to warp runners
4bdd46ace3 ci: switch runners from cirrus to warpbuild (will)

Pull request description:

  As cirrus is closing down, switch to warpbuild runners.

  Switch runner and provider names over. We now use GHA cache, so we don't need to switch that over here.

ACKs for top commit:
  m3dwards:
    ACK 4bdd46ace3
  maflcko:
    review ACK 4bdd46ace3  🤾
  hebasto:
    ACK 4bdd46ace3.

Tree-SHA512: 47ed28a6cb7ab10a973af6aa24f4f7a632f59ed17e189ae4f658de37069d763c92cc0e32769693568db6d0e5d2543abcb77bb0977f0b3f296d80a254d6bb3833
2026-05-28 17:10:21 +01:00
merge-script
d12d8e52d2 Merge bitcoin/bitcoin#35400: doc: Remove good_first_issue.yml, Reword "Getting started" section
fa51f37f18 doc: Reword the Getting-Started section (MarcoFalke)
fab5733f5d doc: Remove good_first_issue.yml (MarcoFalke)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/35399

  IIUC, the good-first-issue label and template were meant to make it easier for completely new contributors to get started with something simple. However, I don't think the label and issue template are applicable anymore:

  * There are currently no issues with this label, and directing people toward an empty list seems pointless.
  * Historically the issue and label has been used rarely. 2026: once, 2025 twice, 2024 thrice. Source: https://github.com/bitcoin/bitcoin/issues?q=state%3Aclosed%20is%3Aissue%20label%3A%22good%20first%20issue%22
  * The template has been mis-used, according to https://github.com/bitcoin/bitcoin/issues/35399

  Fix all issues by removing it, since it is clear that it is no longer actively used, nor applicable and possibly a net-negative overall.

  Of course, regular devs are still free to open issues of this kind as a normal issue, if they wish. However, having the template for this in this repo and tracking it via a label doesn't seem useful.

  Since removing the template and label requires rewriting the "Getting Started" section in  `CONTRIBUTING.md`, I went ahead and also removed the mention of `Up for grabs` as good things for newcomers to work on. I don't recall the last new contributor that picked something up successfully. Also, `Up for grabs` is usually stuff that people lost interest in, or is no longer relevant.

  Instead I've added a sentence to encourage new contributors to help with critical and broad review, which will naturally guide them to good first follow-up issues to work on.

  Meta: I know this topic can be subjective and offer bike-shed potential, but I am happy to iterate a bit on this for a few days.

ACKs for top commit:
  stickies-v:
    ACK fa51f37f18
  danielabrozzoni:
    ACK fa51f37f18
  sedited:
    ACK fa51f37f18
  darosior:
    ACK fa51f37f18
  furszy:
    ACK fa51f37f18
  winterrdog:
    ACK fa51f37f18

Tree-SHA512: 9e6d7fe86262bee2df1e0af33ecfb5f77036da2d5d1832bb6afb08f4107d9313eec06d8b769966bf8ecaf8a4c574da5ff99509cc4b7fd9c53ea86788da29721c
2026-05-28 16:12:55 +01:00
furszy
b86c1c443d test: add coverage for migrating ancient wallets
Pre-#152 wallets have no best block stored. Test we
can migrate them.
2026-05-28 09:55:15 -04:00
furszy
fd44d48b24 wallet: fix ancient wallets migration
The best block locator was introduced in #152, previously created
wallets do not have these record.
2026-05-28 09:55:15 -04:00
merge-script
a34dbc836c Merge bitcoin/bitcoin#35313: Bump leveldb subtree
a9ac680af3 build: remove FALLTHROUGH_INTENDED from leveldb.cmake (fanquake)
4d58c3271c build: remove -Wno-conditional-uninitialized from leveldb build (fanquake)
58cdb5c2e8 Squashed 'src/leveldb/' changes from ab6c84e6f3..a7f9bdc611 (fanquake)

Pull request description:

  Includes:
  * https://github.com/bitcoin-core/leveldb-subtree/pull/52
  * https://github.com/bitcoin-core/leveldb-subtree/pull/53
  * https://github.com/bitcoin-core/leveldb-subtree/pull/55
  * https://github.com/bitcoin-core/leveldb-subtree/pull/59
  * https://github.com/bitcoin-core/leveldb-subtree/pull/60
  * https://github.com/bitcoin-core/leveldb-subtree/pull/61

ACKs for top commit:
  hebasto:
    ACK a9ac680af3.
  sedited:
    ACK a9ac680af3
  andrewtoth:
    ACK a9ac680af3

Tree-SHA512: dc80a0e5eabd63866b395681935ba47bd3f67292049f2cce77f6bcf9cdd6f3bb9bcf2d87ae836a7af5b3f07fe21a1885697cbae3eb930900e396c2588910e12a
2026-05-28 14:05:10 +01:00
Ryan Ofsky
896eaacd91 Merge bitcoin/bitcoin#34644: mining: add submitBlock to IPC Mining interface
3962138cc0 test: add IPC submitBlock functional test (woltx)
5b60f69e40 mining: add submitBlock IPC method to Mining interface (woltx)
813b4a80d7 refactor: introduce SubmitBlock helper (w0xlt)

Pull request description:

  This PR adds a `submitBlock` method to the IPC Mining interface, equivalent to the `submitblock` RPC. It accepts a serialized block over IPC, validates/processes it via the normal block-processing path.

  The method uses the same result shape as `checkBlock`: `bool` + `reason/debug out-params`. It reports duplicate, inconclusive, and invalid-block rejection details, and initializes reason/debug on every call.

  Closes #34626

ACKs for top commit:
  Sjors:
    ACK 3962138cc0
  optout21:
    reACK 3962138cc0
  ryanofsky:
    Code review ACK 3962138cc0. Just rebased since and made suggested changes since last review.

Tree-SHA512: 705cbb89972a80b6ff0ab75a78f686983d6077c97f1758795efe5b8968f01065ebef664ac850eae2bc86af8964efa2a68e8dfc677209c312856650f9387ed006
2026-05-28 08:02:24 -04:00
MarcoFalke
fa51f37f18 doc: Reword the Getting-Started section
Explain how to find good first issues to work on.

Also, remove the mention of up-for-grabs for new contributors, because
up-for-grabs is usually stuff that people lost interest in and is often
no longer relevant.
2026-05-28 13:32:05 +02:00
rkrux
f701cd159a doc: fix typo in release notes of #34917 2026-05-28 14:52:39 +05:30
rkrux
7bc39e3d08 wallet, test: add wallet_deprecated_rbf.py for walletrbf deprecated keys & options 2026-05-28 14:52:34 +05:30
rkrux
2cbbcb5659 wallet, test: remove -deprecatedrpc=bip125 from wallet_send.py 2026-05-28 14:50:05 +05:30
rkrux
307134bd7e wallet, test: remove -deprecatedrpc=bip125 from wallet_migration.py 2026-05-28 14:50:05 +05:30
rkrux
3ec550d168 wallet, test: remove -deprecatedrpc=bip125 from wallet_basic.py 2026-05-28 14:50:05 +05:30
rkrux
a52ea9bff9 wallet, test: remove -walletrbf startup option from wallet_backwards_compatibility.py
This option can be removed from the previous releases as well because the
default for them is already 1.
2026-05-28 14:48:39 +05:30
merge-script
e3f5c18913 Merge bitcoin/bitcoin#34948: guix: Split manifest into build and codesign manifests
d846444d01 guix: Split manifest into build and codesign manifests (Hennadii Stepanov)
0b9e10ad40 guix: Update `python-signapple` and wrap with OpenSSL paths (Hennadii Stepanov)

Pull request description:

  This PR narrows the scope of the Guix environments to include only the minimum dependencies required for specific tasks, namely building and codesigning.

ACKs for top commit:
  fanquake:
    ACK d846444d01

Tree-SHA512: f7b0dfc47e1c6c064738be9aeba69b8d553c7f61186b2c03fedf0a11015ab454cac45d6ee28bbabbbd53a3efabc230b77365edf9feb0d4a26c2805079389501d
2026-05-28 10:00:09 +01:00
fanquake
a9ac680af3 build: remove FALLTHROUGH_INTENDED from leveldb.cmake
No-longer needed after
https://github.com/bitcoin-core/leveldb-subtree/pull/60.
2026-05-28 09:35:12 +01:00
fanquake
4d58c3271c build: remove -Wno-conditional-uninitialized from leveldb build 2026-05-28 09:34:49 +01:00
fanquake
5fe0615f7a Update leveldb subtree to latest upstream 2026-05-28 09:34:12 +01:00
fanquake
58cdb5c2e8 Squashed 'src/leveldb/' changes from ab6c84e6f3..a7f9bdc611
a7f9bdc611 Merge bitcoin-core/leveldb-subtree#52: Revert "Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems"
a2f531d2d0 Merge bitcoin-core/leveldb-subtree#60: util: use [[fallthrough]] directly
1a166221cf Merge bitcoin-core/leveldb-subtree#61: Disable seek compaction
6bfdb6093b Disable seek compaction
42a5f29aa9 util: use [[fallthrough]] directly
c274b50867 Merge bitcoin-core/leveldb-subtree#53: refactor: Delete unused `ScopedHandle:operator=(ScopedHandle&&)`
68740f586f Merge bitcoin-core/leveldb-subtree#59: Fix Clang `-Wconditional-uninitialized` warning
70142e186b Merge bitcoin-core/leveldb-subtree#55: build: Require C++17
d123cf5a83 Effectively, this change
31361bf339 Allow different C/C++ standards when this is used as a subproject.
0711e6d082 Fix Clang `-Wconditional-uninitialized` warning
85665f9547 refactor: Delete unused `ScopedHandle:operator=(ScopedHandle&&)`
fd8f69657e Revert "Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems"

git-subtree-dir: src/leveldb
git-subtree-split: a7f9bdc6114fe6eeb848fda2980fe61d86ff2045
2026-05-28 09:34:12 +01:00
will
4bdd46ace3 ci: switch runners from cirrus to warpbuild 2026-05-28 09:08:46 +01:00
MarcoFalke
fab5733f5d doc: Remove good_first_issue.yml 2026-05-28 08:31:49 +02:00
merge-script
00af5620f0 Merge bitcoin/bitcoin#35206: doc: fix doxygen links to threads in developer-notes.md
d5adb9d09b doc: fix doxygen links to threads in developer-notes.md (Matthew Zipkin)

Pull request description:

  The "threads" section of `developer-notes.md` has links to anchor tags in the code generated by doxygen. As far as I can tell this was introduced in #18645 and changes to this section of this document have continued the pattern. The problem is, the content at `https://doxygen.bitcoincore.org` gets re-rendered daily and those anchor tags are generated internally by doxygen, so they are all broken now.

  This PR adds doxygen syntax `\anchor XXXX` comments in the code where functions that run in these threads are defined, and then those stable, human-readable anchor tags are applied to the links in the doc.

  I have generated the doxygen output from this branch, hosted it on my own web server, and created a modified `developer-notes.md` with these anchor tags and my server as host for demonstration:

  https://gist.github.com/pinheadmz/ed3dda7d3c8d589e3989040519190b84#threads

  Just note when looking at this:
  - `main` is at the bottom of the html page so it might not look right at first
  - `initload` is a lambda inside `AppInitMain` so thats where doxygen renders the anchor

ACKs for top commit:
  fanquake:
    ACK d5adb9d09b
  rkrux:
    lgtm ACK d5adb9d

Tree-SHA512: c5517823a2d668b01318b3dae3d76fdd9db8a74d8c721aeb748e4f4a6cb56cb4d24e34b2590a41f8553992005cab368fca4ce322a4f204cec16ce338337ae9ee
2026-05-27 15:48:32 +01:00
merge-script
85c27c9de5 Merge bitcoin/bitcoin#35394: test: remove unnecessary rpc calls from feature_dbcrash
c17cc76a18 test: speed up feature_dbcrash (will)

Pull request description:

  On my machine dbcrash takes 17 minutes to run (wihtout `--usecli`), and is making on the order of 200,000 RPC calls. The bulk of these come from miniwallet's `send_self_transfer_multi` which calls miniwallets `sendrawtransaction`, which does:

  ```python
      def sendrawtransaction(self, *, from_node, tx_hex, maxfeerate=0, **kwargs):
          txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs)
          self.scan_tx(from_node.decoderawtransaction(tx_hex))
          return txid
  ```

  The second `decoderawtransaction` here doubles the number of RPC calls per send, and feature_dbcrash doesn't use the miniwallet utxo list outside of setup and rescans, it already tracks it's own `utxo_list`, so this is wasted work.

  By creating the transaction and sending using a direct node RPC to send, we can halve the number of rpc calls in this section.

  This change reduces the runtime to 9 minutes for me.

ACKs for top commit:
  maflcko:
    review ACK c17cc76a18 📐

Tree-SHA512: fa9cf574f280b776446ac994baa7bfd94200d4a3dd8f52e138b0005dcbeb87b357172ce8c470cd743bb5021328aaf24ef4c0ac81a6dc15dd36ca30a3618dc400
2026-05-27 14:16:54 +01:00
rkrux
42330922dd wallet, test: remove -walletrbf startup option from wallet_backwards_compatibility.py 2026-05-27 17:45:06 +05:30
rkrux
8cb6e405d8 wallet, test: remove -walletrbf startup option from wallet_listtransactions.py
The corresponding test case that tests for optin rbf variations can also
be removed.
2026-05-27 17:45:05 +05:30
rkrux
0ee94b2fef wallet, test: remove -deprecatedrpc=bip125 from wallet_listtransactions.py 2026-05-27 17:45:05 +05:30
rkrux
5e833e068d wallet, test: -walletrbf startup option from wallet_bumpfee.py 2026-05-27 17:45:05 +05:30
rkrux
a2a2b1745f wallet, test: remove -walletrbf startup option from rpc_psbt.py
Also, include PSBT_GLOBAL_FALLBACK_LOCKTIME key/value while making the PSBT v2
blank for combinepsbt RPC.
2026-05-27 17:43:44 +05:30
merge-script
615c0aefa8 Merge bitcoin/bitcoin#35391: test: Use operator<< for time_points instead of manual TickSinceEpoch
fad4f417d1 test: Use operator<< for time_points instead of manual TickSinceEpoch (MarcoFalke)

Pull request description:

  This partially reverts the changes from commit 020166080c to testnet4_miner_tests.cpp

  Also, remove some confusing IWYU pragmas. Those were inconsistently added in 8c58f63578, but without any rationale why adding them is the correct approach. The correct approach should be done in a proper follow-up, with a clear rationale.

ACKs for top commit:
  Sjors:
    ACK fad4f417d1
  sedited:
    ACK fad4f417d1

Tree-SHA512: d88813d5c294b07a567a952c9f4b5351b005ebf1dbd8f31988f922d6d3bd6916cc1553f0d90e23cfaa4517906df176971feb5bc8a7de1938e7896cbe40fe6661
2026-05-27 12:42:24 +01:00
will
c17cc76a18 test: speed up feature_dbcrash 2026-05-27 11:57:11 +01:00
merge-script
0687438e94 Merge bitcoin/bitcoin#35372: refactor: Enhance type safety in overflow operations
0774eaaf0c util: Require integers for SaturatingAdd() and AdditionOverflow() (Hodlinator)
a815e3e262 rpc: Correct type for tx_sigops (Hodlinator)

Pull request description:

  * Correct copy-paste error in RPC code
  * Require proper integers for `SaturatingAdd()` and `AdditionOverflow()` in src/util/overflow.h

  These changes increase the type safety of the code and were done while exploring increasing the type-safety of `CAmount` (currently just a `typedef` of `int64_t`).

  The first commit has nothing to do with overflow but is along for the ride if reviewers agree.

ACKs for top commit:
  maflcko:
    lgtm ACK 0774eaaf0c
  winterrdog:
    ACK 0774eaaf0c
  sedited:
    ACK 0774eaaf0c

Tree-SHA512: a245ad52cfd1c257151aea1a1ed4b6769415c1dddc7c405d8bbe71b9f3abc512a6d890a45cbc8381718be16274e337cc876e6e6da11dc35de71bea83bece6634
2026-05-27 12:06:53 +02:00
MarcoFalke
fad4f417d1 test: Use operator<< for time_points instead of manual TickSinceEpoch
This partially reverts the changes from commit
020166080c to testnet4_miner_tests.cpp

Also, remove some confusing IWYU pragmas. Those were inconsistently
added in 8c58f63578, but without any
rationale why adding them is the correct approach. The correct approach
should be done in a proper follow-up, with a clear rationale.
2026-05-27 10:33:35 +02:00
Hennadii Stepanov
d846444d01 guix: Split manifest into build and codesign manifests 2026-05-26 20:53:20 +01:00
Hennadii Stepanov
0b9e10ad40 guix: Update python-signapple and wrap with OpenSSL paths 2026-05-26 20:40:58 +01:00
woltx
3962138cc0 test: add IPC submitBlock functional test
Test the new Mining.submitBlock IPC method:
- Invalid block (bad version) returns failure with reason
- Valid block (with a real mempool tx) is accepted and propagates
- Duplicate block returns failure with "duplicate" reason
- Witness commitment without coinbase witness nonce is rejected
  (bad-witness-nonce-size), confirming no auto-fix behavior
- submitBlock then submitSolution: duplicate is accepted (submitSolution
  returns true for already-known blocks)
- submitSolution then submitBlock interaction (duplicate)

Build candidate blocks from BlockTemplate data in the existing coinbase and
submission test, then exercise checkBlock(), submitSolution(), and
submitBlock() against those candidates. submitBlock() uses an isolated IPC
node for cases that would otherwise affect the main submitSolution() and
checkBlock() assertions.
2026-05-26 11:40:02 -07:00
woltx
5b60f69e40 mining: add submitBlock IPC method to Mining interface
Add a submitBlock method to the Mining IPC interface, similar to the
submitblock RPC. This accepts a fully assembled block, validates it, and
if accepted as new, processes it into chainstate.

This is needed for Stratum v2 Job Declarator Server (JDS), where accepted
solutions may correspond to jobs not tied to a Bitcoin Core BlockTemplate.
JDS receives PushSolution fields and reconstructs full blocks; without an
IPC submitBlock method, final submission requires the submitblock RPC.

The method returns detailed status (reason/debug strings) matching the
checkBlock pattern, giving callers enough information to handle
validation failures.
2026-05-26 11:40:02 -07:00
w0xlt
813b4a80d7 refactor: introduce SubmitBlock helper
Introduce a SubmitBlock() helper in node/miner.cpp that wraps
ProcessNewBlock submission and captures validation state through
the BlockChecked callback.

Route submitSolution through the helper before adding any new IPC method.

No behavior change.
2026-05-26 11:39:47 -07:00
rkrux
a3fe455a95 wallet: refactor to read -walletrbf only once instead of twice 2026-05-26 19:09:22 +05:30
merge-script
9c15022260 Merge bitcoin/bitcoin#35337: doc: add feature deprecation and removal process to developer notes
2e9fdcc6da doc: add feature deprecation and removal process to developer notes (Guillermo Fernandes)

Pull request description:

  Closes #31980

  Adds a dedicated **"Feature deprecation and removal process"** section to `doc/developer-notes.md` covering the full deprecation lifecycle for all major feature categories.

  ## What's added

  **General principles**
  - Grace period is one major release (deprecated in N, removed in N+1)
  - Deprecation and removal both require release notes
  - Deprecated features should remain accessible via a re-enable flag during the grace period

  **Per-category guidance covering:**
  - RPC methods and fields (`-deprecatedrpc=<feature>` pattern, help text requirements, worked example pointing to #31278)
  - Startup options (`LogWarning`/`InitWarning` on use, help text update)
  - REST interface (document in `doc/REST-interface.md`)
  - ZMQ (document in `doc/zmq.md`)
  - Wallet settings (defer to RPC or startup option process depending on exposure)

  This consolidates the process that currently exists only implicitly across PRs and issue discussions into one place for contributors to reference.

ACKs for top commit:
  maflcko:
    lgtm ACK 2e9fdcc6da
  polespinasa:
    ACK 2e9fdcc6da
  stickies-v:
    ACK 2e9fdcc6da
  sedited:
    ACK 2e9fdcc6da

Tree-SHA512: 1d43df410664a45f937bcbd250664f13379168ca90e3024bea506e21a88177e201dcb4fadade705735099e3b8aaa2102a3080ad005bffb3aecb8f08d530d4277
2026-05-26 15:19:19 +02:00
Ryan Ofsky
a4157fc24a Merge bitcoin/bitcoin#33966: refactor: disentangle miner startup defaults from runtime options
1e5d3b4f0d doc: add release note for mining option validation (Sjors Provoost)
0317f52022 ci: enforce iwyu for touched files (Sjors Provoost)
8c58f63578 refactor: have mining files include what they use (Sjors Provoost)
3bb6498fb0 mining: store block create options in NodeContext (Sjors Provoost)
4637cd157d mining: reject invalid block create options (Sjors Provoost)
8daac1d6eb mining: add block create option helpers (Sjors Provoost)
128da7c3ff miner: add block_max_weight to BlockCreateOptions (Sjors Provoost)
fa81e51eae mining: parse block creation args in mining_args (Sjors Provoost)
020166080c mining: use interface for tests, bench and fuzzers (Sjors Provoost)
44082bea47 interfaces: make Mining use const NodeContext (Sjors Provoost)
d4368e059c move-only: add node/mining_types.h (Sjors Provoost)
6aeb1fbea2 test: cover IPC blockmaxweight policy (Sjors Provoost)
63b23ea1e9 test: regression test for waitNext mining policy (Sjors Provoost)
24750f8b31 test: add createNewBlock failure helper (Sjors Provoost)
63ee9cd15b test: misc interface_ipc_mining.py improvements (Sjors Provoost)

Pull request description:

  Although this PR is primarily a refactor, _there are behavior changes_ documented in the release note:
  - the IPC mining interface now rejects out-of-range block template options instead of silently clamping them;
  - startup now rejects `-blockmaxweight` values lower than `-blockreservedweight`, instead of allowing them to be clamped later.

  The interaction between node startup options like `-blockreservedweight` and runtime options, especially those passed via IPC, is confusing.

  They're combined in `BlockAssembler::Options`, which this PR gets rid of in favour of `BlockCreateOptions`.

  `BlockCreateOptions` is used by interface clients. As before, IPC clients have access to a safe / sane subset, whereas RPC and test code can use all fields. The same type is also used to store mining defaults parsed once during node startup in `NodeContext`.

  The maximum block weight setting (`block_max_weight`) is optional. When read from startup options it matches `-blockmaxweight`; when provided by callers it is a runtime override. `Merge()` fills unset fields from startup defaults while preserving caller-provided values.

  This all happens in commits `mining: add block create option helpers` and `mining: store block create options in NodeContext`, and requires some preparation to keep things easy to review.

  We get rid of `BlockAssembler::Options` but this is used in many tests. Since large churn is inevitable, we might as well switch all tests, bench and fuzzers over to the Mining interface. The `mining: use interface for tests, bench and fuzzers` commit does that, dramatically reducing direct use of `BlockAssembler`. Two exceptions are documented in the commit message. Because `test_block_validity` wasn't available via the interface and the block_assemble benchmark needs it, it's moved from `BlockAssembler::Options` to `BlockCreateOptions` (still not exposed via IPC).

  We need access to mining related structs from both the miner and node initialization code. To avoid having to pull in all of `BlockAssembler` for the latter, the `move-only: add node/mining_types.h` commit introduces `node/mining_types.h` and moves `BlockCreateOptions`, `BlockWaitOptions` and `BlockCheckOptions` there from `src/node/types.h`.

  I considered also moving `DEFAULT_BLOCK_MAX_WEIGHT`, `DEFAULT_BLOCK_RESERVED_WEIGHT`, `MINIMUM_BLOCK_RESERVED_WEIGHT` and `DEFAULT_BLOCK_MIN_TX_FEE` there from `policy.h`, since they are distinct from relay policy and not needed by the kernel. But this seems more appropriate for a follow-up and requires additional discussion.

  ---

  I kept variable renaming and other formatting changes to a minimum to ease review with `--color-moved=dimmed-zebra`.

  ## Commit summary

  Tests and test cleanup:
  - `test: misc interface_ipc_mining.py improvements`
  - `test: add assert_create_fails helper`
  - `test: regression test for waitNext mining policy`
  - `test: cover IPC blockmaxweight policy`

  Refactoring test/bench/fuzz callers:
  - `interfaces: make Mining use const NodeContext`
  - `mining: use interface for tests, bench and fuzzers`

  Moving mining interface types:
  - `move-only: add node/mining_types.h`

  Separating startup defaults from runtime options:
  - `mining: parse block creation args in mining_args`: adds `node/mining_args.{h,cpp}` and moves mining option parsing out of `init.cpp`, without storing the parsed values yet.
  - `miner: add block_max_weight to BlockCreateOptions`: moves the runtime maximum block weight setting into `BlockCreateOptions` as an optional value, so it can later be defaulted from startup args when unset.
  - `mining: add block create option helpers`: centralizes block template option defaulting and merging, removes `BlockAssembler::Options`, and preserves behavior except for dropping the `Specified ` prefix from startup option error messages.
  - `mining: reject invalid block create options`: checks typed `BlockCreateOptions` before block template creation, so invalid runtime options are rejected instead of silently clamped. Startup validation also rejects `-blockmaxweight` values lower than `-blockreservedweight`.
  - `mining: store block create options in NodeContext`: stores the startup mining options in `NodeContext` as `BlockCreateOptions`, so startup defaults and runtime overrides can be merged with the same option type.

  Include hygiene, CI and release note:
  - `refactor: have mining files include what they use`
  - `ci: enforce iwyu for touched files`
  - `doc: add release note for mining option validation`

ACKs for top commit:
  w0xlt:
    reACK 1e5d3b4f0d
  sedited:
    ACK 1e5d3b4f0d
  ryanofsky:
    Code review ACK 1e5d3b4f0d. Looks good, thanks for the updates!

Tree-SHA512: 28c715023cb78f02775caa787b243c994bd0f8ce4559afc8db9301e93400ebbc74963626a4afe65ae15bcc16b9192d051a745839f4c804848d50746ea5a224b4
2026-05-26 08:39:03 -04:00
merge-script
ac9424fdc6 Merge bitcoin/bitcoin#35145: validation: fix misleading VerifyDB summary log
1d66963749 log: clarify VerifyDB summary log (ViniciusCestarii)

Pull request description:

  The final `LogInfo` message about "No coin database inconsistencies" was printed unconditionally, even for check levels 0-2 where no coin DB verification runs and `nGoodTransactions` stays 0. Split into an always-on completion line and a coin-DB result line gated on `nCheckLevel >= 3 && !skipped_l3_checks`.

  Before (checklevel=1):
  `Verification: No coin database inconsistencies in last 6 blocks (0 transactions)`

  After (checklevel=1):
  `Verification: checked last 6 blocks at level 1`

ACKs for top commit:
  sedited:
    ACK 1d66963749

Tree-SHA512: a6c6689cff2f1942a44764a914a1ee01c92efa51489d72f456fccaa1f9ee0640449b55600d43e7dc89d622414854d53e8dfc7e8c87fe454b06e44f76075db267
2026-05-26 13:36:57 +02:00
merge-script
9767e80b21 Merge bitcoin/bitcoin#35296: doc: Fix broken links in dev notes, move sections
faf6afd99d doc: Move mutex and thread section into guideline section (MarcoFalke)
fa514caad7 doc: move-only Valgrind section (MarcoFalke)
fa0202f31d doc: move-only Python section (MarcoFalke)
fa37606c65 doc: Regroup clang-tidy rules (MarcoFalke)
fa9c2ddea9 doc: Fix to use lower-case anchors in links to C++ Core Guidelines (MarcoFalke)

Pull request description:

  The anchors in isocpp links were recently broken, so fix them to point to the correct anchor.

  Also, move/regroup 3 sections while touching the file.

ACKs for top commit:
  fanquake:
    ACK faf6afd99d
  sedited:
    ACK faf6afd99d

Tree-SHA512: 0067eb23a6a8cccfaee5df0df347529f17db39473602fa51bc2f3e53c9709934bb25fca51f6ed58c4896437c890789f29facf54d15a7ebbbd247a2ebb1c0b5cd
2026-05-26 12:45:37 +02:00
merge-script
9ec4efebd1 Merge bitcoin/bitcoin#35015: bitcoin-cli: note -rpcclienttimeout is not implemented for IPC connections
08c3c37d12 bitcoin-cli: note -rpcclienttimeout is not implemented for IPC connections (Ryan Ofsky)

Pull request description:

  The `-rpcclienttimeout` option applies only to HTTP connections. When `bitcoin-cli` connects via IPC, the timeout is silently ignored. Clarify this in the help string.

  Noted by pinheadmz in https://github.com/bitcoin/bitcoin/pull/32297#pullrequestreview-3922849038

ACKs for top commit:
  sedited:
    ACK 08c3c37d12

Tree-SHA512: 82c99bbcb6a776636197407e4371047d6f1386cbe78823358fb5cceb080a976a4f0ac2c195b7ca734acc81d7e5f32e77887aa11a61860596e3bb8dfd2f523531
2026-05-26 11:42:40 +02:00
merge-script
b43a936355 Merge bitcoin/bitcoin#33974: cmake: Check dependencies after build option interaction
a154c05d49 cmake: Check dependencies after build option interaction (Hennadii Stepanov)

Pull request description:

  At present, `CMakeLists.txt` interleaves configuration-option handling with dependency discovery. As a result, unnecessary checks may be performed. For example:
  ```
  $ cmake -B build --preset dev-mode -DBUILD_FOR_FUZZING=ON
  <snip>
  -- Found PkgConfig: /usr/bin/pkg-config (found version "2.3.0")
  -- Found ZeroMQ: /usr/lib64 (found suitable version "4.3.5", minimum required is "4.0.0")
  -- Performing Test HAVE_USDT_H
  -- Performing Test HAVE_USDT_H - Success
  -- Found USDT: /usr/include
  -- Found QRencode: /usr/lib64/libqrencode.so (found version "4.1.1")
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
  -- Found Threads: TRUE
  -- Performing Test HAVE_STDATOMIC
  -- Performing Test HAVE_STDATOMIC - Success
  -- Found WrapAtomic: TRUE
  -- Found OpenGL: /usr/lib64/libOpenGL.so
  -- Found WrapOpenGL: TRUE
  -- Found WrapVulkanHeaders: /usr/include
  -- Found Qt: /usr/lib64/cmake/Qt6 (found suitable version "6.10.1", minimum required is "6.2")
  CMake Warning at CMakeLists.txt:206 (message):
    BUILD_FOR_FUZZING=ON will disable all other targets and force
    BUILD_FUZZ_BINARY=ON.

  <snip>
  ```

  This PR restructures the code to ensure that all dependencies are checked only after the final build option interaction.

ACKs for top commit:
  fanquake:
    ACK a154c05d49
  sedited:
    Re-ACK a154c05d49

Tree-SHA512: f863316770a1e27e6c08736932f73f297add326943e9c32c721f7e771f38b0fdc651abfed61add5ee4924cfbf2afff91fde005d41d1fd239d401184b6caf5453
2026-05-26 10:25:29 +01:00
merge-script
d5188b5592 Merge bitcoin/bitcoin#35363: test: Allow --usecli in more tests
fa24693819 test: Allow --usecli in tests that already support it (MarcoFalke)
fa8d4d5c35 test: Catch CalledProcessError to support --usecli in feature_dbcrash.py (MarcoFalke)
faf0f848ef test: use echojson to allow rpc_named_arguments.py --usecli (MarcoFalke)
faf993ee44 test: Stop node before modifying config to support rpc_users.py --usecli (MarcoFalke)
fa4fc8c1d7 test: Set TestNode url field early, so that feature_loadblock.py --usecli works (MarcoFalke)

Pull request description:

  Some tests disallow to be run under `--usecli`. This reduces the coverage and risks that bugs in the bitcoin-cli go unnoticed.

  The commits should be self-explanatory and can be reviewed and tested one-by-one.

ACKs for top commit:
  willcl-ark:
    ACK fa24693819

Tree-SHA512: e34077be98f88ad1e8649600a5f43fc8c77e4ebb03bbccd88c33f2d67882ccdd52b5d18bcfbfc611dff3ebf7455f8e624a88d062aa1863c5eb813bbf4f48e58b
2026-05-26 10:13:24 +01:00
merge-script
743bf350f2 Merge bitcoin/bitcoin#35049: test: remove circular dependency between authproxy and util
7be0d6fa18 test: remove the lazy import of util in authproxy (rkrux)
779f444680 test: move out JSONRPCException from authproxy to util (rkrux)

Pull request description:

  I noticed this issue while reviewing #34773 where a lazy import
  is added in the __call__ method of the AuthServiceProxy class in
  authproxy.py

  There's a circular dependency between authproxy.py and util.py
  due to which the former can't use the common utility functions
  and thus lazy imports are used as a workaround.

  This patch set breaks the dependency so that authproxy.py can use
  the utility functions from util.py in a standard fashion. Few tests that
  explicitly use get_rpc_proxy and JSONRPCException needed to have
  their imports updated.

ACKs for top commit:
  maflcko:
    review ACK 7be0d6fa18 🏽

Tree-SHA512: 56775cb13d989342ba9482edb255170d695ce5c2d5efbbd64586e0d5463af16467dbf9efe8a0411bde4dfb9bb531839284b2d6f5d828080171d847b70570977d
2026-05-26 09:41:43 +01:00