47276 Commits

Author SHA1 Message Date
merge-script
377c6dbc3c
Merge bitcoin/bitcoin#34224: init: Return EXIT_SUCCESS on interrupt
997e7b4d7cf7c4622938798423447375383184c0 init: Fix non-zero code on interrupt (sedited)

Pull request description:

  Reported by dergoegge on irc.

  An interrupt does not create a failure exit code during normal operation. This should also be the case when interrupt is triggered during initialization. However a failure exit code is currently returned if an interrupt occurs during init. Fix this by making `AppInitMain` return true instead of false on interrupt, which further up the call stack currently sets the `EXIT_FAILURE` code. Also add a check for the interrupt condition during GUI startup. Returning `EXIT_SUCCESS` seems to be the usual behaviour for daemons, see the discussion on IRC for this: https://www.erisian.com.au/bitcoin-core-dev/log-2026-01-08.html#l-146 .

  Best reviewed with `--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`.

ACKs for top commit:
  maflcko:
    review ACK 997e7b4d7cf7c4622938798423447375383184c0 🔺
  janb84:
    ACK 997e7b4d7cf7c4622938798423447375383184c0
  dergoegge:
    utACK 997e7b4d7cf7c4622938798423447375383184c0

Tree-SHA512: c9542e95d9312567e029426a329144b5bc638d8ebc9c966e0246c1bb728d40f56ca425b00c446f5d238067e629c2337d0fe78bcc5a8760424d2ec38a5578e115
2026-01-13 15:23:12 -08:00
merge-script
c094a966d6
Merge bitcoin/bitcoin#34246: verify-commits: Allow specific commits to allow sha1
8ac134be5e57680eb1c6ef596e5de085825e83ee contrib: verify-commits sha1 exceptions (Ava Chow)

Pull request description:

  Allow specific commits to not require the sha1 check.

  Fixes the CI for aeaa67a9eac0decb89c60a67f9755ca10cbcc1d9 which uses SHA1 somewhere in the key's self signatures.

ACKs for top commit:
  dergoegge:
    utACK 8ac134be5e57680eb1c6ef596e5de085825e83ee
  darosior:
    utACK 8ac134be5e57680eb1c6ef596e5de085825e83ee. Looks good to me provided we want to avoid the temporary red CI on master branch.

Tree-SHA512: cafd080ee35e4f735cbe9281ac2a73488c2f9e4acccd39563e933a3775def35b6e8080a6a772e45e64d90275013e430765a29e87116130ff456257c5ec8a2810
2026-01-13 15:02:20 -08:00
Ava Chow
c352d3c51c
Merge bitcoin/bitcoin#34168: qa: Require --exclude for each excluded test
c5825d4b7fe9ae202ea3c74798f58cd3a920821d qa: Require `--exclude` for each excluded test (Hennadii Stepanov)

Pull request description:

  This PR allows a long `--exclude ...` argument in the `test/functional/test_runner.py` invocation to be split across multiple lines, with optional per-line explanatory comments. I found this useful for the CI scripts in https://github.com/hebasto/bitcoin-core-nightly.

ACKs for top commit:
  l0rinc:
    tested ACK c5825d4b7fe9ae202ea3c74798f58cd3a920821d
  maflcko:
    review ACK c5825d4b7fe9ae202ea3c74798f58cd3a920821d 🛄
  achow101:
    ACK c5825d4b7fe9ae202ea3c74798f58cd3a920821d
  rkrux:
    ACK c5825d4b7fe9ae202ea3c74798f58cd3a920821d

Tree-SHA512: bcf42848516197978b65df8a8bc68e036a62c9afc6158274eac74a325dc01991eb063a042f940c53ea15a7feb18d4bdfc45d8c71f0ef20c76140b12e07ba3ac5
2026-01-13 14:40:43 -08:00
Ryan Ofsky
62557c9529
Merge bitcoin/bitcoin#33819: mining: getCoinbase() returns struct instead of raw tx
48f57bb35bbdbce509b8ef195de69e2a61a2511e mining: add new getCoinbaseTx() returning a struct (Sjors Provoost)
d59b4cdb5772917ee13e48552d51662160104b62 mining: rename getCoinbaseTx() to ..RawTx() (Sjors Provoost)

Pull request description:

  The first commit renames `getCoinbaseTx()` to `getCoinbaseRawTx()` to reflect that it returns a serialised transaction. This does not impact IPC clients, because they do not use the function name.

  The second commit then introduces a replacement `getCoinbase()` that provides a struct with everything clients need to construct a coinbase. This avoids clients having to parse and manipulate our dummy transaction.

  Deprecate but don't remove `getCoinbaseRawTx()`, `getCoinbaseCommitment()` and `getWitnessCommitmentIndex()`.

  After this change we can drop these deprecated methods, which in turn would allow us to clear the dummy transaction from the `getBlock()` result. But that is left for a followup to keep this PR focussed. See https://github.com/Sjors/bitcoin/pull/106 for an approach.

  Expand the `interface_ipc.py` functional test to document its usage.

  Can be tested using:
  - https://github.com/stratum-mining/sv2-tp/pull/59

ACKs for top commit:
  ryanofsky:
    Code review ACK 48f57bb35bbdbce509b8ef195de69e2a61a2511e. Just rebased and addressed comments and dropped coinbase tx "template" suffix, which is a nice change
  ismaelsadeeq:
    code review ACK 48f57bb35bbdbce509b8ef195de69e2a61a2511e
  vasild:
    ACK 48f57bb35bbdbce509b8ef195de69e2a61a2511e

Tree-SHA512: c4f1d752777fb3086a1a0b7b8b06e4205dbe2f3adb41f218855ad1dee952adccc263cf82acd3bf9300cc83c2c64cebd2b27f66a69beee32d325b9a85e3643b0d
2026-01-13 08:01:57 -05:00
merge-script
3c8d389a84
Merge bitcoin/bitcoin#34249: doc: archive v30.2 release notes
f664860e52e1fd685a5c264f01f6f956875db591 doc: archive v30.2 release notes (fanquake)

Pull request description:

  Archive v30.2 release notes.

ACKs for top commit:
  furszy:
    ACK f664860e52e1fd685a5c264f01f6f956875db591
  stickies-v:
    ACK f664860e52e1fd685a5c264f01f6f956875db591

Tree-SHA512: 0c300f5185d672f8e5d9f65f34506172958954b7afbfe38f0d558ea91eafa44ac0cea55ef60f28d2d8120f4bd2618dbcd8f88796a89beda59f5c2a8ae227c9ac
2026-01-12 15:36:47 -08:00
merge-script
5e98a6a470
Merge bitcoin/bitcoin#34266: release note: cpfp carveout removed in 31.0
61726483e1c226c87212d0e12a3dd640fc393791 release note: cpfp carveout removed in 31.0 (Greg Sanders)

Pull request description:

  Seems it was overlooked for release notes, so let's add something

ACKs for top commit:
  l0rinc:
    ACK 61726483e1c226c87212d0e12a3dd640fc393791
  glozow:
    ACK 61726483e1c226c87212d0e12a3dd640fc393791

Tree-SHA512: 6d01a07977f530c1e3cc2a21a0ed27283e76813f1013af824a3690b47d7a2233244ede88c75d5f138c6965f94ebd6f3503741844522be5a0d1fdc188dee24d75
2026-01-12 15:11:42 -08:00
Greg Sanders
61726483e1 release note: cpfp carveout removed in 31.0 2026-01-12 18:04:45 -05:00
Ryan Ofsky
796f18e559
Merge bitcoin/bitcoin#29415: Broadcast own transactions only via short-lived Tor or I2P connections
89372213048adf37a47427112a1ff836ee84c50e doc: add release notes for 29415 (Vasil Dimov)
582016fa5f013817db650bbba0a40d9195c18e2e test: add unit test for the private broadcast storage (Vasil Dimov)
e74d54e04896a86cad4e4b1bd9641afcc3a026c2 test: add functional test for private broadcast (Vasil Dimov)
818b780a05db126dcfe7efe12c46c84b5cfc3de6 rpc: use private broadcast from sendrawtransaction RPC if -privatebroadcast is ON (Vasil Dimov)
eab595f9cf13f7cb1d25a0db51409535cfe053b1 net_processing: retry private broadcast (Vasil Dimov)
37b79f9c39db5a4a61d360a6a29c8853bb5c7ac0 net_processing: stop private broadcast of a transaction after round-trip (Vasil Dimov)
2de53eee742da11b0e3f6fc44c39f2b5b5929da1 net_processing: handle ConnectionType::PRIVATE_BROADCAST connections (Vasil Dimov)
30a9853ad35365af8545e8e766d75cf398968480 net_processing: move a debug check in VERACK processing earlier (Vasil Dimov)
d1092e5d48ce67bd517068550c78bfcab062a554 net_processing: modernize PushNodeVersion() (Vasil Dimov)
9937a12a2fd5a0033f37f4dda5d75bfc5f15c3b6 net_processing: move the debug log about receiving VERSION earlier (Vasil Dimov)
a098f37b9e240291077a7f440e9f57e61f30e158 net_processing: reorder the code that handles the VERSION message (Vasil Dimov)
679ce3a0b8df6e8cab07965301382d2036ef2368 net_processing: store transactions for private broadcast in PeerManager (Vasil Dimov)
a3faa6f944a672faccac5dd201c8d33a638d9091 node: extend node::TxBroadcast with a 3rd option (Vasil Dimov)
95c051e21051bd469fda659fe7c495d5e264d221 net_processing: rename RelayTransaction() to better describe what it does (Vasil Dimov)
bb49d26032c57714c62a4b31ff1fdd969751683f net: implement opening PRIVATE_BROADCAST connections (Vasil Dimov)
01dad4efe2b38b7a71c96b6222147f395e0c11d9 net: introduce a new connection type for private broadcast (Vasil Dimov)
94aaa5d31b6ff1d0122319fc70e70a7e27e1a0ba init: introduce a new option to enable/disable private broadcast (Vasil Dimov)
d6ee490e0a9a81b69a4751087918303163ba8869 log: introduce a new category for private broadcast (Vasil Dimov)

Pull request description:

  _Parts of this PR are isolated in independent smaller PRs to ease review:_

  * [x] _https://github.com/bitcoin/bitcoin/pull/29420_
  * [x] _https://github.com/bitcoin/bitcoin/pull/33454_
  * [x] _https://github.com/bitcoin/bitcoin/pull/33567_
  * [x] _https://github.com/bitcoin/bitcoin/pull/33793_

  ---

  To improve privacy, broadcast locally submitted transactions (from the `sendrawtransaction` RPC) to the P2P network only via Tor or I2P short-lived connections, or to IPv4/IPv6 peers but through the Tor network.

  * Introduce a new connection type for private broadcast of transactions with the following properties:
    * started whenever there are local transactions to be sent
    * opened to Tor or I2P peers or IPv4/IPv6 via the Tor proxy
    * opened regardless of max connections limits
    * after handshake is completed one local transaction is pushed to the peer, `PING` is sent and after receiving `PONG` the connection is closed
    * ignore all incoming messages after handshake is completed (except `PONG`)

  * Broadcast transactions submitted via `sendrawtransaction` using this new mechanism, to a few peers. Keep doing this until we receive back this transaction from one of our ordinary peers (this takes about 1 second on mainnet).

  * The transaction is stored in peerman and does not enter the mempool.

  * Once we get an `INV` from one of our ordinary peers, then the normal flow executes: we request the transaction with `GETDATA`, receive it with a `TX` message, put it in our mempool and broadcast it to all our existent connections (as if we see it for the first time).

  * After we receive the full transaction as a `TX` message, in reply to our `GETDATA` request, only then consider the transaction has propagated through the network and remove it from the storage in peerman, ending the private broadcast attempts.

  The messages exchange should look like this:

  ```
  tx-sender >--- connect -------> tx-recipient
  tx-sender >--- VERSION -------> tx-recipient (dummy VERSION with no revealing data)
  tx-sender <--- VERSION -------< tx-recipient
  tx-sender <--- WTXIDRELAY ----< tx-recipient (maybe)
  tx-sender <--- SENDADDRV2 ----< tx-recipient (maybe)
  tx-sender <--- SENDTXRCNCL ---< tx-recipient (maybe)
  tx-sender <--- VERACK --------< tx-recipient
  tx-sender >--- VERACK --------> tx-recipient
  tx-sender >--- INV/TX --------> tx-recipient
  tx-sender <--- GETDATA/TX ----< tx-recipient
  tx-sender >--- TX ------------> tx-recipient
  tx-sender >--- PING ----------> tx-recipient
  tx-sender <--- PONG ----------< tx-recipient
  tx-sender disconnects
  ```

  Whenever a new transaction is received from `sendrawtransaction` RPC, the node will send it to a few (`NUM_PRIVATE_BROADCAST_PER_TX`) recipients right away. If after some time we still have not heard anything about the transaction from the network, then it will be sent to 1 more peer (see `PeerManagerImpl::ReattemptPrivateBroadcast()`).

  A few considerations:
  * The short-lived private broadcast connections are very cheap and fast wrt network traffic. It is expected that some of those peers could blackhole the transaction. Just one honest/proper peer is enough for successful propagation.
  * The peers that receive the transaction could deduce that this is initial transaction broadcast from the transaction originator. This is ok, they can't identify the sender.

  ---

  <details>
  <summary>How to test this?</summary>

  Thank you, @stratospher and @andrewtoth!

  Start `bitcoind` with `-privatebroadcast=1 -debug=privatebroadcast`.

  Create a wallet and get a new address, go to the Signet faucet and request some coins to that address:
  ```bash
  build/bin/bitcoin-cli -chain="signet" createwallet test
  build/bin/bitcoin-cli -chain="signet" getnewaddress
  ```

  Get a new address for the test transaction recipient:
  ```bash
  build/bin/bitcoin-cli -chain="signet" loadwallet test
  new_address=$(build/bin/bitcoin-cli -chain="signet" getnewaddress)
  ```

  Create the transaction:
  ```bash
  # Option 1: `createrawtransaction` and `signrawtransactionwithwallet`:

  txid=$(build/bin/bitcoin-cli -chain="signet" listunspent | jq -r '.[0] | .txid')
  vout=$(build/bin/bitcoin-cli -chain="signet" listunspent | jq -r '.[0] | .vout')
  echo "txid: $txid"
  echo "vout: $vout"

  tx=$(build/bin/bitcoin-cli -chain="signet" createrawtransaction "[{\"txid\": \"$txid\", \"vout\": $vout}]" "[{\"$new_address\": 0.00001000}]" 0 false)
  echo "tx: $tx"

  signed_tx=$(build/bin/bitcoin-cli -chain="signet" signrawtransactionwithwallet "$tx" | jq -r '.hex')
  echo "signed_tx: $signed_tx"

  # OR Option 2: `walletcreatefundedpsbt` and `walletprocesspsbt`:
  # This makes it not have to worry about inputs and also automatically sends back change to the wallet.
  # Start `bitcoind` with `-fallbackfee=0.00003000` for instance for 3 sat/vbyte fee.

  psbt=$(build/bin/bitcoin-cli -chain="signet" walletcreatefundedpsbt "[]" "[{\"$new_address\": 0.00001000}]" | jq -r '.psbt')
  echo "psbt: $psbt"

  signed_tx=$(build/bin/bitcoin-cli -chain="signet" walletprocesspsbt "$psbt" | jq -r '.hex')
  echo "signed_tx: $signed_tx"
  ```

  Finally, send the transaction:
  ```bash
  raw_tx=$(build/bin/bitcoin-cli -chain="signet" sendrawtransaction "$signed_tx")
  echo "raw_tx: $raw_tx"
  ```

  </details>

  ---

  <details>
  <summary>High-level explanation of the commits</summary>

  * New logging category and config option to enable private broadcast
    * `log: introduce a new category for private broadcast`
    * `init: introduce a new option to enable/disable private broadcast`

  * Implement the private broadcast connection handling on the `CConnman` side:
    * `net: introduce a new connection type for private broadcast`
    * `net: implement opening PRIVATE_BROADCAST connections`

  * Prepare `BroadcastTransaction()` for private broadcast requests:
    * `net_processing: rename RelayTransaction to better describe what it does`
    * `node: extend node::TxBroadcast with a 3rd option`
    * `net_processing: store transactions for private broadcast in PeerManager`

  * Implement the private broadcast connection handling on the `PeerManager` side:
    * `net_processing: reorder the code that handles the VERSION message`
    * `net_processing: move the debug log about receiving VERSION earlier`
    * `net_processing: modernize PushNodeVersion()`
    * `net_processing: move a debug check in VERACK processing earlier`
    * `net_processing: handle ConnectionType::PRIVATE_BROADCAST connections`
    * `net_processing: stop private broadcast of a transaction after round-trip`
    * `net_processing: retry private broadcast`

  * Engage the new functionality from `sendrawtransaction`:
    * `rpc: use private broadcast from sendrawtransaction RPC if -privatebroadcast is ON`

  * New tests:
    * `test: add functional test for private broadcast`
    * `test: add unit test for the private broadcast storage`

  </details>

  ---

  **This PR would resolve the following issues:**
  https://github.com/bitcoin/bitcoin/issues/3828 Clients leak IPs if they are recipients of a transaction
  https://github.com/bitcoin/bitcoin/issues/14692 Can't configure bitocoind to only send tx via Tor but receive clearnet transactions
  https://github.com/bitcoin/bitcoin/issues/19042 Tor-only transaction broadcast onlynet=onion alternative
  https://github.com/bitcoin/bitcoin/issues/24557 Option for receive events with all networks, but send transactions and/or blocks only with anonymous network[s]?
  https://github.com/bitcoin/bitcoin/issues/25450 Ability to broadcast wallet transactions only via dedicated oneshot Tor connections
  https://github.com/bitcoin/bitcoin/issues/32235 Tor: TX circuit isolation

  **Issues that are related, but (maybe?) not to be resolved by this PR:**
  https://github.com/bitcoin/bitcoin/issues/21876 Broadcast a transaction to specific nodes
  https://github.com/bitcoin/bitcoin/issues/28636 new RPC: sendrawtransactiontopeer

  ---

  Further extensions:
  * Have the wallet do the private broadcast as well, https://github.com/bitcoin/bitcoin/issues/11887 would have to be resolved.
  * Have the `submitpackage` RPC do the private broadcast as well, [draft diff in the comment below](https://github.com/bitcoin/bitcoin/pull/29415#pullrequestreview-2972293733), thanks ismaelsadeeq!
  * Add some stats via RPC, so that the user can better monitor what is going on during and after the broadcast. Currently this can be done via the debug log, but that is not convenient.
  * Make the private broadcast storage, currently in peerman, persistent over node restarts.
  * Add (optional) random delay before starting to broadcast the transaction in order to avoid correlating unrelated transactions based on the time when they were broadcast. Suggested independently of this PR [here](https://github.com/bitcoin/bitcoin/issues/30471).
  * Consider periodically sending transactions that did not originate from the node as decoy, discussed [here](https://github.com/bitcoin/bitcoin/pull/29415#discussion_r2035414972).
  * Consider waiting for peer's FEEFILTER message and if the transaction that was sent to the peer is below that threshold, then assume the peer is going to drop it. Then use this knowledge to retry more aggressively with another peer, instead of the current 10 min. See [comment below](https://github.com/bitcoin/bitcoin/pull/29415#issuecomment-3258611648).
  * It may make sense to be able to override the default policy -- eg so submitrawtransaction can go straight to the mempool and relay, even if txs are normally privately relayed. See [comment below](https://github.com/bitcoin/bitcoin/pull/29415#issuecomment-3427086681).
  * As a side effect we have a new metric available - the time it takes for a transaction to reach a random node in the network (from the point of view of the private broadcast recipient the tx originator is a random node somewhere in the network). This can be useful for monitoring, unrelated to privacy characteristics of this feature.

  ---

  _A previous incarnation of this can be found at https://github.com/bitcoin/bitcoin/pull/27509. It puts the transaction in the mempool and (tries to) hide it from the outside observers. This turned out to be too error prone or maybe even impossible._

ACKs for top commit:
  l0rinc:
    code review diff ACK 89372213048adf37a47427112a1ff836ee84c50e
  andrewtoth:
    ACK 89372213048adf37a47427112a1ff836ee84c50e
  pinheadmz:
    ACK 89372213048adf37a47427112a1ff836ee84c50e
  w0xlt:
    ACK 8937221304 with nit https://github.com/bitcoin/bitcoin/pull/29415#discussion_r2654849875
  mzumsande:
    re-ACK 89372213048adf37a47427112a1ff836ee84c50e

Tree-SHA512: d51dadc865c2eb080c903cbe2f669e69a967e5f9fc64e9a20a68f39a67bf0db6ac2ad682af7fa24ef9f0942a41c89959341a16ba7b616475e1c5ab8e563b9b96
2026-01-12 15:02:14 -05:00
merge-script
abc6a3a4eb
Merge bitcoin/bitcoin#34252: doc: add 433 (Pay to Anchor) to bips.md
44b12cdb11f0fd3264f24f537a5d6989e4fe96a9 doc: add 433 (Pay to Anchor) to bips.md (Sebastian Falbesoner)

Pull request description:

  See PR https://github.com/bitcoin/bips/pull/1982 (merged recently) and #30352 (first released in v28.0).

ACKs for top commit:
  instagibbs:
    ACK 44b12cdb11f0fd3264f24f537a5d6989e4fe96a9
  glozow:
    ACK 44b12cdb11f0fd3264f24f537a5d6989e4fe96a9

Tree-SHA512: 0389bfd9b57a354ef15eff726783c83969586a73de52d27b6d3b042dba14c1361af29303b6ce42330a841310811a81c5e45b5c7d25e307787f1cfbfd75ab3e62
2026-01-11 14:44:15 -08:00
Sebastian Falbesoner
44b12cdb11 doc: add 433 (Pay to Anchor) to bips.md 2026-01-11 19:04:00 +01:00
fanquake
f664860e52
doc: archive v30.2 release notes 2026-01-10 16:14:57 +00:00
Ava Chow
8ac134be5e contrib: verify-commits sha1 exceptions
Allow some commits to not require the sha1 check.
2026-01-09 16:08:26 -08:00
merge-script
aeaa67a9ea
Merge bitcoin/bitcoin#33428: depends: Boost 1.90.0
ca4a844eed481afa0ca7eab8b972ccbda8dfe168 depends: Boost 1.90.0 (fanquake)

Pull request description:

  Update [Boost to 1.90.0](https://www.boost.org/releases/1.90.0.beta1/) in depends.

ACKs for top commit:
  hebasto:
    ACK ca4a844eed481afa0ca7eab8b972ccbda8dfe168.
  sedited:
    ACK ca4a844eed481afa0ca7eab8b972ccbda8dfe168

Tree-SHA512: d9fbef9f8f8b14b12281a252b17c79abb8bf5bcd5cbbccac0e509c010adca909f66d3f4739f6663741c5ff2829ec58e88185e67ed5815d2588b0980bba9b1b63
2026-01-09 23:19:45 +01:00
merge-script
595504a432
Merge bitcoin/bitcoin#34236: Add sedited to trusted-keys
d1b227f3ad19e1364c74fcb3b34717bb2b9b9243 Add sedited to trusted-keys (sedited)

Pull request description:

  As discussed on irc: https://www.erisian.com.au/bitcoin-core-dev/log-2026-01-08.html#l-286

ACKs for top commit:
  l0rinc:
    ACK d1b227f3ad19e1364c74fcb3b34717bb2b9b9243, well deserved.
  achow101:
    ACK d1b227f3ad19e1364c74fcb3b34717bb2b9b9243
  fjahr:
    ACK d1b227f3ad19e1364c74fcb3b34717bb2b9b9243
  darosior:
    ACK d1b227f3ad19e1364c74fcb3b34717bb2b9b9243
  theStack:
    ACK d1b227f3ad19e1364c74fcb3b34717bb2b9b9243 🍾
  willcl-ark:
    ACK d1b227f3ad19e1364c74fcb3b34717bb2b9b9243
  glozow:
    ACK d1b227f3ad19e1364c74fcb3b34717bb2b9b9243
  mzumsande:
    ACK d1b227f3ad19e1364c74fcb3b34717bb2b9b9243

Tree-SHA512: 865507213459013d88c3bd74797efd5bf2ad81cafb184520fc62a471b3c01786194ef842a046a34085c8ef65a8e02e634cd9b6c2c75ca40298cfb5d0ea38d1dd
2026-01-09 11:35:39 +00:00
merge-script
5c724f3b04
Merge bitcoin/bitcoin#34235: miniminer: stop assuming ancestor fees >= self fees
2cade5d5d17010cd89855b26da350d6e54683805 [miniminer] stop assuming ancestor fees >= self fees (glozow)

Pull request description:

  These assertions exist to detect double-deducting values when we update descendants. However, negative fees are possible with `prioritisetransaction` so it doesn't make sense to check this.

  Leave the check for sizes because those are never negative.

  Fixes #34234

ACKs for top commit:
  instagibbs:
    ACK 2cade5d5d17010cd89855b26da350d6e54683805
  dergoegge:
    utACK 2cade5d5d17010cd89855b26da350d6e54683805

Tree-SHA512: 935bbc8bd9a0d508eea43bb49aa43c22735e3f2c1012598f6843e229c13b76e44f9fd3eb8b61c437fa0b32353b4e7b15afa3e31002bdfa382d3d711d16419fde
2026-01-09 11:24:03 +00:00
merge-script
2d87afcf7d
Merge bitcoin/bitcoin#34227: guix: Fix osslsigncode tests
194114daf385a5db50e1507fda79a1a93240d494 guix: Fix `osslsigncode` tests (Hennadii Stepanov)

Pull request description:

  This PR aims to improve the experience for Guix builders when creating new Guix profiles after 2025. In particular, it should be helpful for those who are new to building with Guix.

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

  Other possible alternatives to consider include:
  1. Applying a workaround as suggested [here](https://github.com/bitcoin/bitcoin/issues/34220#issuecomment-3718991398).

  2. Updating the package as suggested [here](https://github.com/bitcoin/bitcoin/issues/34220#issuecomment-3719022287).

  3. Disabling tests as suggested [here](https://github.com/bitcoin/bitcoin/issues/34220#issuecomment-3719538660).

ACKs for top commit:
  fanquake:
    ACK 194114daf385a5db50e1507fda79a1a93240d494 as a short-term, backportable workaround.
  janb84:
    ACK 194114daf385a5db50e1507fda79a1a93240d494

Tree-SHA512: b263604297adfc54fccab8fe3c3126939b729aebda5b7e15f6f453a17260fd4ea754523a694bbc4268693513d071c4362325b0511696af2e81f00f1a461bcfa9
2026-01-09 11:11:42 +00:00
merge-script
7b17fb78fa
Merge bitcoin/bitcoin#34226: wallet: test: Relative wallet failed migration cleanup
eeaf28dbe0e09819ab0e95bb7762b29536bdeef6 wallet: test: Failed migration cleanup (David Gumberg)

Pull request description:

  Prior to https://github.com/bitcoin/bitcoin/pull/34156, an issue existed where if migration of a wallet with a relative pathname failed, the relatively specified path where the legacy wallet is would be deleted. This issue predates #32273, because the relative pathnames get stacked together, e.g. "../../", the copy conflict bug that caused migration to abort early instead of getting far enough to attempt clean-up that was fixed in #32273 is avoided.

  This is a functional test demonstrating that we handle failed migration clean-up correctly for relatively-named wallets. To see the issue, you can backport this test onto 29.x: https://github.com/davidgumberg/bitcoin/tree/2026-01-07-rel-migration-test-backport

  I've also added an absolute path failed migration cleanup test. WRT this and #34156, absolute paths exhibit similar behavior to unnamed wallets. Because of the name-conflict bug prior to #32273 an absolute-path migration would fail no matter what because migration would attempt to copy a file to a destination that already exists. But after #32273, absolute-path migration gets past there, and if it fails for some other reason, the same behavior that's fixed in #34156 occurs where the directory containing the wallet file is deleted.

ACKs for top commit:
  achow101:
    ACK eeaf28dbe0e09819ab0e95bb7762b29536bdeef6
  furszy:
    ACK eeaf28dbe0e09819ab0e95bb7762b29536bdeef6
  rkrux:
    lgtm ACK eeaf28dbe0e09819ab0e95bb7762b29536bdeef6

Tree-SHA512: ee366fe526d0328654a86c2e9e6f228ca81554c8f8a78c259fa7aab90f024f9e5694ecf3f1d188938355f4e6d351c5a6a8ad236701bdd0ce63005e5d42c15e15
2026-01-09 10:02:21 +00:00
David Gumberg
eeaf28dbe0 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.
2026-01-08 14:00:46 -08:00
sedited
997e7b4d7c
init: Fix non-zero code on interrupt
An interrupt does not create a failure exit code during normal
operation. This should also be the case when interrupt is triggered
during initialization. However a failure exit code is currently returned
if an interrupt occurs during init. Fix this by making `AppInitMain` return
true instead of false, which further up the call stack sets the
`EXIT_FAILURE` code. Also add a check for the interrupt condition during
GUI startup.
2026-01-08 20:08:21 +01:00
sedited
d1b227f3ad
Add sedited to trusted-keys 2026-01-08 19:59:15 +01:00
Hennadii Stepanov
6c3fb719d1
Merge bitcoin-core/gui#921: Remove deprecated "Starting Block" from Peer Detail
301d9eea66cadffe2872776b8a0e9b72ec90b9a2 qt: Remove "Starting Block" from Peer Detail. Following Deprecation in `bitcoin#34197` (WakeTrainDev)

Pull request description:

  the `startingheight` rpc field got deprecated in https://github.com/bitcoin/bitcoin/pull/34197
  this pr removes it from peer detail

ACKs for top commit:
  maflcko:
    review lgtm ACK 301d9eea66cadffe2872776b8a0e9b72ec90b9a2
  theStack:
    ACK 301d9eea66cadffe2872776b8a0e9b72ec90b9a2
  hebasto:
    ACK 301d9eea66cadffe2872776b8a0e9b72ec90b9a2, I verified `forms/debugwindow.ui` using Qt Designer.

Tree-SHA512: b870b4cff8ead073a17d171c01c46fc7e750c0343b4578ffb63abc8f40b33abdf08beb6733fead5307ef5d48b078b60d29ac0e0e41190a98f50f92154f0878cf
2026-01-08 17:51:29 +00:00
glozow
2cade5d5d1 [miniminer] stop assuming ancestor fees >= self fees
Negative fees are possible with prioritisetransaction.
2026-01-08 07:55:27 -08:00
Hennadii Stepanov
194114daf3
guix: Fix osslsigncode tests 2026-01-08 12:45:14 +00:00
merge-script
8d5700ab0f
Merge bitcoin/bitcoin#34221: test: migration, avoid backup name mismatch in default_wallet_failure
cbf0bd35bbf312f3b13d92d281d7112e4b43b9c3 test: migration, avoid backup name mismatch in default_wallet_failure (furszy)

Pull request description:

  This is a possible test failure, pushing it in case the CI starts complaining.
  The change affects only test code; no cpp logic is involved.

  The `test_default_wallet_failure` migration test calls the function
  `migrate_and_get_rpc()`, which sets the mock time internally. But, at the
  same time, the test already caches the mock time value, to later use it
  in the backup existence check.
  Setting the mock time twice can lead to a name mismatch during the
  mentioned check (diff timestamp == diff backup names), which could
  cause the test to fail.

  The fix is very simple, just need to call the migration RPC directly.
  Since the test expects the migration to fail, `migrate_and_get_rpc()` is
  unnecessary here. I'm surprised the CI hasn't complained about this yet.

ACKs for top commit:
  achow101:
    ACK cbf0bd35bbf312f3b13d92d281d7112e4b43b9c3
  bensig:
    ACK cbf0bd35bbf312f3b13d92d281d7112e4b43b9c3

Tree-SHA512: 10b43a491b8ad0c5bf53e423b7d7587fc631551bf5d598e145e1defe9d8e5786c0869a9aee26209e63ccafd828ece34fc40c75abe246c1301b9f17467d64ef28
2026-01-08 10:12:05 +00:00
furszy
cbf0bd35bb
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.
2026-01-07 16:33:00 -05:00
merge-script
cd6e4c9235
Merge bitcoin/bitcoin#34215: wallettool: fix unnamed createfromdump failure walletsdir deletion
f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42 wallettool: do not use fs::remove_all in createfromdump cleanup (Ava Chow)

Pull request description:

  As pointed out in https://github.com/bitcoin/bitcoin/pull/34156#issuecomment-3716728670, it is possible for `createfromdump` to also accidentally delete the entire wallets directory if the wallet name is the empty string and the dumpfile contains a checksum error.

  This is also fixed by removing the files created by only removing the directory for named wallets, and avoiding the use of `fs::remove_all`.

ACKs for top commit:
  waketraindev:
    lgtm ACK f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42
  polespinasa:
    code review and tACK f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42
  rkrux:
    Code review and tACK f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42
  willcl-ark:
    ACK f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42
  pablomartin4btc:
    ACK f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42

Tree-SHA512: ff1e7668131ec3632c67d990c99e8fddff28605e7e553c7e20695e61017c88476c3636e22f2007e763a00d527e80e4d1d3d45409f6678d28729b8397430bfe7a
2026-01-07 14:32:01 +00:00
merge-script
90d651a81f
Merge bitcoin/bitcoin#34156: wallet: fix unnamed legacy wallet migration failure
b7c34d08dd9549a95cffc6ec1ffa4bb4f81e35eb test: coverage for migration failure when last sync is beyond prune height (furszy)
82caa8193a3e36f248dcc949e0cd41def191efac wallet: migration, fix watch-only and solvables wallets names (furszy)
d70b159c42008ac3b63d1c43d99d4f1316d2f1ef wallet: improve post-migration logging (furszy)
f011e0f0680a8c39988ae57dae57eb86e92dd449 test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure (furszy)
36093bde63286e19821a9e62cdff1712b6245dc7 test: add coverage for unnamed wallet migration failure (furszy)
f4c7e28e80bf9af50b03a770b641fd309a801589 wallet: fix unnamed wallet migration failure (furszy)
4ed0693a3f2a427ef9e7ad016930ec29fa244995 wallet: RestoreWallet failure, erase only what was created (furszy)

Pull request description:

  Minimal fix for #34128.

  The issue occurs during the migration of a legacy unnamed wallet
  (the legacy "default" wallet). When the migration fails, the cleanup
  logic is triggered to roll back the state, which involves erasing the
  newly created descriptor wallets directories. Normally, this only
  affects the parent directories of named wallets, since they each
  reside in their own directories. However, because the unnamed
  wallet resides directly in the top-level `/wallets/` folder, this
  logic accidentally deletes the main directory.

  The fix ensures that only the wallet.dat file of the unnamed wallet
  is touched and restored, preserving the wallet in BDB format and
  leaving the main `/wallets/` directory intact.

  #### Story Line:
  #32273 fixed a different set of issues and, in doing so, uncovered
  this one.
  Before the mentioned PR, backups were stored in the same directory
  as the wallet.dat file. On a migration failure, the backup was then
  copied to the top-level `/wallets/` directory. For the unnamed legacy
  wallet, the wallet directory is the `/wallets/` directory, so the source
  and destination paths were identical. As a result, we threw early in the
  `fs::copy_file` call ([here](https://github.com/bitcoin/bitcoin/blob/29.x/src/wallet/wallet.cpp#L4572)) because the file already existed, as we
  were trying to copy the file onto itself. This caused the cleanup logic
  to abort early on and never reach the removal line.

  #### Testing Notes:
  Cherry-pick the test commit on top of master and run it. You will
  see the failure and realize the reason by reading the test code.

ACKs for top commit:
  achow101:
    ACK b7c34d08dd9549a95cffc6ec1ffa4bb4f81e35eb
  davidgumberg:
    crACK b7c34d08dd
  w0xlt:
    ACK b7c34d08dd
  willcl-ark:
    ACK b7c34d08dd9549a95cffc6ec1ffa4bb4f81e35eb

Tree-SHA512: d0be14c0ed6417f999c3f2f429652c2407097d0cc18453c91653e57ae4b5375b327ad3b2553d9ea6ff46a3ae00cdbd5ab325b94eba763072c4fc5a773b85618b
2026-01-07 11:08:57 +00:00
Ava Chow
f78f6f1dc8 wallettool: do not use fs::remove_all in createfromdump cleanup 2026-01-06 16:11:41 -08:00
Ava Chow
a9daa6dbd3
Merge bitcoin/bitcoin#34135: rpc: [wallet] Use unsigned type for tx version in sendall
fafbc70d48e1fb42c4ed3da609e5f30c4cc39418 rpc: [wallet] Use unsigned type for tx version in sendall (MarcoFalke)

Pull request description:

  It is confusing to parse the unsigned tx version as a signed type. Also, it makes it harder to use the integer sanitizer.

  Can be tested via:

  * Build with the flags `-DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DSANITIZERS=undefined,integer,float-divide-by-zero`
  * Set the existing suppressions: `export UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=0:report_error_type=1"`
  * Start the RPC server, e.g. `./bld-cmake/bin/bitcoin-qt -datadir=/tmp -regtest -server`
  * Call the sendall RPC, e.g. `./bld-cmake/bin/bitcoin-cli -datadir=/tmp -regtest -named sendall '["bcrt1qlrt3xps4wxpfcjmljrayr2ualczmnfvd4vzdq3"]' fee_rate=1.234  version=-1`

  Before:

  ```
  src/wallet/rpc/spend.cpp:1470:42: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 4294967295 (32-bit, unsigned)

  Invalid parameter, version out of range(1~3)
  ```

  After:

  ```
  JSON integer out of range

ACKs for top commit:
  bensig:
    ACK fafbc70d48e1fb42c4ed3da609e5f30c4cc39418
  achow101:
    ACK fafbc70d48e1fb42c4ed3da609e5f30c4cc39418
  rkrux:
    utACK fafbc70d48e1fb42c4ed3da609e5f30c4cc39418
  theStack:
    ACK fafbc70d48e1fb42c4ed3da609e5f30c4cc39418

Tree-SHA512: bb7cf54e9691ad2591646b138ffdfac95bf77c5234d489f4e4f2c60b41bdc14cdc18a030fecb0a6ac64e55e4c69b37835afd334f87d8a44b8df6cda053e8fefb
2026-01-06 15:58:25 -08:00
furszy
b7c34d08dd
test: coverage for migration failure when last sync is beyond prune height 2026-01-06 14:38:14 -05:00
furszy
82caa8193a
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"
2026-01-06 14:38:14 -05:00
furszy
d70b159c42
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.
2026-01-06 14:38:14 -05:00
furszy
f011e0f068
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.
2026-01-06 14:38:13 -05:00
furszy
36093bde63
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.
2026-01-06 14:38:13 -05:00
furszy
f4c7e28e80
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.
2026-01-06 14:38:13 -05:00
furszy
4ed0693a3f
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.
2026-01-06 14:02:06 -05:00
merge-script
c60f9cb66e
Merge bitcoin/bitcoin#34085: cluster mempool: exploit SFL properties in txgraph
1808b5aaf7c4910122fcd088e03d790189907438 clusterlin: remove unused FixLinearization (cleanup) (Pieter Wuille)
34a77138b7a6f65a31c6273f2770e943cc0b474b txgraph: permit non-topological clusters to defer fixing (optimization) (Pieter Wuille)
3380e0cbb59b2a893faabfa8f9aa18e582a11c2f txgraph: use PostLinearize less prior to linearizing (Pieter Wuille)
62dd88624a7fba14d2dac32d94fd101eb378d1e7 txgraph: drop NEEDS_SPLIT_ACCEPTABLE (simplification) (Pieter Wuille)
01ffcf464a4679136185e323b5b0328695a5bd1e clusterlin: support fixing linearizations (feature) (Pieter Wuille)

Pull request description:

  Part of #30289, follow-up to #32545.

  This gets rid of `FixLinearization()` by integrating the functionality into `Linearize()`, and makes txgraph exploit that (by delaying fixing of clusters until their first re-linearization). It also reduces (but does not eliminate) the number of calls to `PostLinearize`, as the SFL linearization effectively performs something very similar to postlinearization when loading in an existing linearization already.

ACKs for top commit:
  instagibbs:
    reACK 1808b5aaf7c4910122fcd088e03d790189907438
  marcofleon:
    code review ACK 1808b5aaf7c4910122fcd088e03d790189907438

Tree-SHA512: 81cd9549de2968f5126079cbb532e2cb052ea8157c9c9ce37fd39ad2294105d7c79ee8d946c3d8f7af5b2119299a232c448b42a33e1e43ccc778a5b52957e387
2026-01-06 15:51:45 +00:00
merge-script
114901c065
Merge bitcoin/bitcoin#34203: doc: p2p: replace last remaining "command" terminology with "message type"
5b7bf47f9b92f5d4483a69d0682797e8cf483434 doc: p2p: replace last remaining "command" terminology with "message type" (Sebastian Falbesoner)

Pull request description:

  This small PR is (presumably) the final one in a long series of replacing the confusing "command" terminology with "message type" when referring to the header field of P2P messages, see #18533, #18937, #24078, #24141 and #31163.

  The instances were found manually via `$ git grep -i command`, hope I didn't miss any.

ACKs for top commit:
  l0rinc:
    ACK 5b7bf47f9b92f5d4483a69d0682797e8cf483434
  billymcbip:
    ACK 5b7bf47f9b92f5d4483a69d0682797e8cf483434
  maflcko:
    lgtm ACK 5b7bf47f9b92f5d4483a69d0682797e8cf483434

Tree-SHA512: b895873b82f904c2ee9a81b4a2fbb365b60c57f04587ded5ddc7907d209520acb6073f5dd1a19cb2ae6aadab3c85a5ac751c8c398ce7c0e29314eea54e61295c
2026-01-06 09:45:34 +00:00
merge-script
d7cbdfa090
Merge bitcoin/bitcoin#34204: test: fix intermittent failure in p2p_addr_selfannouncement
31852057ea393e64b7ea2bfabc75a55fda40b786 test: fix intermittent failure in p2p_addr_selfannouncement (0xb10c)

Pull request description:

  Due to the mocktime being bumped before the expected time is updated, it could happen that the self-announcement is send with an newer timestamp than what we expect. To fix this, update the expected time before we bump the mocktime.

  closes #34159

ACKs for top commit:
  bensig:
    ACK 31852057ea393e64b7ea2bfabc75a55fda40b786
  maflcko:
    lgtm ACK 31852057ea393e64b7ea2bfabc75a55fda40b786
  w0xlt:
    ACK 31852057ea
  naiyoma:
    utACK 31852057ea393e64b7ea2bfabc75a55fda40b786

Tree-SHA512: 24696f6005c7131d4c9328f6ff43ddded863b8ba6b2cac6f6009bcb4617616c0c35a0b55812d5010f74385d8e6d4ea09dd2b06b5f4ada2bb7e86d7abee764192
2026-01-06 09:38:12 +00:00
WakeTrainDev
301d9eea66 qt: Remove "Starting Block" from Peer Detail. Following Deprecation in bitcoin#34197 2026-01-06 03:08:01 +02:00
Ava Chow
0ad4376a49
Merge bitcoin/bitcoin#33142: test: Run bench sanity checks in parallel with functional tests
fa65bc0e79dab8a97e0e3f9f31540f1c029a2f6e test: Run bench sanity checks in parallel with functional tests (MarcoFalke)
fa9fdbce7928e1ce8c5e17d965ff9bcc1282c8f5 test: Pass bench exe into test framework utils (MarcoFalke)

Pull request description:

  The ctest target `bench_sanity_check` has many issues:

  * With sanitizers enabled, it is one of the slowest targets, often taking several minutes. See https://github.com/bitcoin/bitcoin/issues/32770#issuecomment-2984264066.
  * There is no insight from ctest into how long each individual sanity check takes.
  * On a timeout, or OOM issue, there is no insight into which sub-bench failed. The failure will generally just look like `75/153 Test   #9: bench_sanity_check ...................***Failed  770.84 sec    out of memory`
  * Places that can't use ctest (like the Windows-cross CI task) have to explicitly run it, or risk forgetting to run it.
  * All benchmarks are run sequentially, when they could run in parallel instead.

  Both issues can lead to CI timeouts and leave CPU unused during testing.

  Fix all issues by running it as part of the functional tests instead. This is similar to the rpcauth tests (https://github.com/bitcoin/bitcoin/pull/32881) and util tests [bitcoin-tx, and bitcoin-util] (https://github.com/bitcoin/bitcoin/pull/32697).

ACKs for top commit:
  achow101:
    ACK fa65bc0e79dab8a97e0e3f9f31540f1c029a2f6e
  l0rinc:
    Tested ACK fa65bc0e79dab8a97e0e3f9f31540f1c029a2f6e
  janb84:
    tACK fa65bc0e79dab8a97e0e3f9f31540f1c029a2f6e
  willcl-ark:
    ACK fa65bc0e79dab8a97e0e3f9f31540f1c029a2f6e

Tree-SHA512: d27e363b7896a7543a4ee8df41a56e58b74f07d4f296e2e5ee293fc91817d0be310e26905755fb94d44417d94fa29ad4cc5d4aa19e78d25d41bc2d9e0948c034
2026-01-05 15:47:49 -08:00
Ava Chow
c267b3a2c6
Merge bitcoin/bitcoin#34197: rpc, net: deprecate startingheight field of getpeerinfo RPC
4ce3f4a26565e9851af950728cda7bcc2242d0c2 rpc, net: deprecate `startingheight` field of `getpeerinfo` RPC (Sebastian Falbesoner)

Pull request description:

  This PR deprecates the "startingheight" result field of the `getpeerinfo` RPC, following the discussion in #33990.

  Rationale: the reported starting height of a peer in the VERSION message is untrusted, and it doesn't seem to be useful anymore (after #20624), so deprecating the corresponding field seems reasonable. After that, it can be removed, along with the `m_starting_height` field of the Peer / CNodeStats structs, as it is sufficient to show the reported height only once at connection in the debug log.

ACKs for top commit:
  optout21:
    crACK 4ce3f4a26565e9851af950728cda7bcc2242d0c2
  achow101:
    ACK 4ce3f4a26565e9851af950728cda7bcc2242d0c2
  fjahr:
    utACK 4ce3f4a26565e9851af950728cda7bcc2242d0c2
  rkrux:
    crACK 4ce3f4a26565e9851af950728cda7bcc2242d0c2
  janb84:
    cr ACK 4ce3f4a26565e9851af950728cda7bcc2242d0c2

Tree-SHA512: b296a28d30084fd35c67a2162e85576e3365e5d6fffe5b1add500034c1850604ee8c37b61afe812bfab8a7cc20f6a9e22db445e3c371311a5f82a777e5700ebf
2026-01-05 15:17:48 -08:00
Ava Chow
d6a6afd955
Merge bitcoin/bitcoin#34010: psbt: detect invalid MuSig2 pubkeys in deserialization
5805a8b54083539c4fede52b4b726102dcfc864e psbt: detect invalid MuSig2 pubkeys in deserialization (rkrux)

Pull request description:

  Throw error while deserializing PSBT if invalid pubkeys are passed
  as a MuSig2 aggregate or participant.

  Should fix #33999 & #34201 by throwing error at the very start while decoding
   an invalid PSBT that should subsequently not allow the MuSig2
  signing operation to take place, thereby avoiding the crash.

ACKs for top commit:
  fjahr:
    utACK 5805a8b54083539c4fede52b4b726102dcfc864e
  achow101:
    ACK 5805a8b54083539c4fede52b4b726102dcfc864e

Tree-SHA512: 4741db96b278e9f3d532e1873af9530a70bbc7a8d3625b9e1c07001acc472fc10cbb79995c16bc4d06cc568ef98fe8d2b8e8d87b617dc05d7554085ffb92dfef
2026-01-05 14:56:25 -08:00
Sebastian Falbesoner
5b7bf47f9b doc: p2p: replace last remaining "command" terminology with "message type" 2026-01-05 17:59:53 +01:00
Pieter Wuille
1808b5aaf7 clusterlin: remove unused FixLinearization (cleanup) 2026-01-05 11:48:34 -05:00
Pieter Wuille
34a77138b7 txgraph: permit non-topological clusters to defer fixing (optimization) 2026-01-05 11:48:30 -05:00
Pieter Wuille
3380e0cbb5 txgraph: use PostLinearize less prior to linearizing
With the new SFL algorithm, the process of loading an existing linearization into the
SFL state is very similar to what PostLinearize does. This means there is little benefit
to performing an explicit PostLinearize step before linearizing inside txgraph. Instead,
it seems better to use our allotted CPU time to perform more SFL optimization steps.
2026-01-05 11:48:16 -05:00
Pieter Wuille
62dd88624a txgraph: drop NEEDS_SPLIT_ACCEPTABLE (simplification)
With the SFL algorithm, we will practically be capable of keeping
most if not all clusters optimal. With that, it seems less valuable
to avoid doing work after splitting an acceptable cluster, because by
doing some work we may get it to OPTIMAL.

This reduces the complexity of the code a bit as well.
2026-01-05 11:48:16 -05:00
Pieter Wuille
01ffcf464a clusterlin: support fixing linearizations (feature)
This also updates FixLinearization to just be a thin wrapper around Linearize.
In a future commit, FixLinearization will be removed entirely.
2026-01-05 11:48:16 -05:00
merge-script
755f0900a2
Merge bitcoin/bitcoin#34136: test: Allow mempool_updatefromblock.py to run on 32-bit
fac5a1b10a6979a7898c5c3555d62b593560772f test: Allow mempool_updatefromblock.py to run on 32-bit (MarcoFalke)

Pull request description:

  The number of dropped parent transactions in the `test_max_disconnect_pool_bytes` test was hard-coded to `2`.

  This happens to work fine on 64-bit for now. However, it seems to fail on 32-bit (https://github.com/bitcoin/bitcoin/issues/34108).

  I don't think we care about the exact number, as long as it is at least `1`.

  So hard-code `1` for an initial sanity check, and then calculate the exact value at runtime via `len(mempool) // 2`.

  Also, enable the functional tests in 32-bit CI, to confirm the regression test.

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

ACKs for top commit:
  bensig:
    ACK fac5a1b10a
  instagibbs:
    ACK fac5a1b10a6979a7898c5c3555d62b593560772f

Tree-SHA512: 8d468f306d95e52cbfac1803293e3b8e9575c9010200010c7833382112509e0d51827dc9681b0b68eeae742af2c14d12da5fd4cf0e1d871a02f91fc80e6720d1
2026-01-05 14:51:24 +00:00