Commit Graph

50173 Commits

Author SHA1 Message Date
Matthew Zipkin
b3d6d2d1a7 http: limit connected clients to 16 2026-08-17 07:35:47 -04:00
Matthew Zipkin
86651d8197 scripted-diff: Rename nUserBind, nBind, nMaxConnections to snake_case
-BEGIN VERIFY SCRIPT-
sed -i 's/\bnUserBind\b/num_user_p2p_bind/g' src/init.cpp
sed -i 's/\bnBind\b/num_p2p_bind/g' src/init.cpp
sed -i 's/\bnMaxConnections\b/num_p2p_max_connections/g' src/init.cpp
sed -i 's/\buser_max_connection\b/user_p2p_max_connections/g' src/init.cpp
-END VERIFY SCRIPT-
2026-08-17 07:32:34 -04:00
merge-script
f72537037d Merge bitcoin/bitcoin#35972: fuzz: Fix assertion in txorphan
01dde6b205 fuzz: Fix assertion in txorphan (marcofleon)

Pull request description:

  `EraseTx()` calls `LimitOrphans()`, which may evict announcements from a peer that didn't announce the erased transaction, causing that peer's usage to decrease. Relax the assertion in the `EraseTx()` branch that claimed usage of a non-announcer peer should be unchanged. Also, add assertions for the other cases.

ACKs for top commit:
  dergoegge:
    utACK 01dde6b205
  instagibbs:
    ACK 01dde6b205

Tree-SHA512: 2e597b85fd41058c2fa79fa55f0d37e12505065b5e27aba7b9680e0c249a5450e6fa97b45394d6ffe1318f42538134ffa9c423b126c455f6f8e6d8ca59eed4b6
2026-08-17 12:04:02 +01:00
merge-script
4800cb7aea Merge bitcoin/bitcoin#35735: Add state to HTTPRequest
9954aa7728 http: don't parse any new requests from a client if m_req_busy = true (Matthew Zipkin)
c7db3ae1f9 test: cover HTTPRequest state machine (Matthew Zipkin)
90676e24ad Add state to HTTPRequest to avoid duplicate work over I/O cycles (Matthew Zipkin)
507e528e84 http: reuse HTTPHeaders to parse chunked trailer (Matthew Zipkin)
902d8908c9 http: only read one HTTPRequest at a time per client (Matthew Zipkin)

Pull request description:

  This PR reduces the memory consumption of the HTTP Server when reading data from connected clients, and improves performance especially when requests are large (i.e. requiring multiple TCP packets).

  In https://github.com/bitcoin/bitcoin/pull/35182 the server copies as much data as it can from the socket into application memory, and then tries to parse as many complete HTTP requests as possible from that data. If a request is discovered to be incomplete, the in-progress request is abandoned. The server tries again on the next I/O cycle to read the same data from the buffer, duplicating work as many times as it takes before the client finishes sending the request (or times out).

  This PR implements two improvements to this:
  1. Only parse one request at a time from the receive buffer. The server processes requests from each client in series anyway.
  2. Add state to `HTTPRequest` so it can be filled with data from the receive buffer over multiple I/O loop iterations without losing progress.

  If a client sends large or multiple requests, that data will sit in the kernel's socket buffer instead of the application memory. Eventually the socket buffer will fill up and TCP backpressure will kick in, dropping the TCP window to 0 and blocking the client from sending any more.

  A state machine for `HTTPRemoteClient` was [discussed previously](https://github.com/bitcoin/bitcoin/pull/35182#pullrequestreview-4322490068) to control resource consumption. Another nice benefit of this model (for a follow-up PR) will be to insert the RPC authentication check after reading 8kB-limited headers but before the 32MB-limited request body.

ACKs for top commit:
  winterrdog:
    re-ACK 9954aa7728
  janb84:
    re ACK 9954aa7728
  frankomosh:
    ACK 9954aa7728.
  fjahr:
    ACK 9954aa7728

Tree-SHA512: b7c913114283fbf1f360b40f6c65a01390a26731bf3b166f460ec260f9206f25d738b3a06887bfa839911c1c6aaf634448181da47a752a9a881aebd907e44868
2026-08-17 10:19:34 +01:00
merge-script
e0992599a6 Merge bitcoin/bitcoin#35846: test: Use throwing config parser getters without fallback
fabe100c2b test: Use throwing config parser getters without fallback (MarcoFalke)
fa8acd57cd test: Write true/false values in config.ini (MarcoFalke)

Pull request description:

  Currently, the called `getboolean` member function is *not* the throwing https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.getboolean, but a non-throwing member function on a dict-like proxy object.

  This is confusing and brittle, because tests shouldn't silently skip when a config key is missing. Instead, tests should loudly fail, e.g. when the config key is renamed in one place, but not the other.

ACKs for top commit:
  jeanpablojp:
    tACK fabe100c2b
  willcl-ark:
    ACK fabe100c2b

Tree-SHA512: a970d74ad285372b8adcce8e2a52b01f5a3b563899dfc5262e6ffbf3d8aba43e72f7b03111e8d5188924c7d3d789992407cddb5d182d9be5e42f07896d8ad4a3
2026-08-17 10:11:25 +01:00
merge-script
e5977f0b9e Merge bitcoin/bitcoin#35982: Update minisketch subtree to latest master
461e3be8d3 Squashed 'src/minisketch/' changes from d1bd01e189..4a179c61e3 (fanquake)

Pull request description:

  Includes:
  * https://github.com/bitcoin-core/minisketch/pull/102

ACKs for top commit:
  hebasto:
    ACK 2dcb2c6df2.

Tree-SHA512: 295e217cb6d32e8d0bb4ea84bd0d6682f98735029c659ad06a6c588fa2865176d80adfca32a1a3a339ffb601e5d1cc99c81266914225e27726a8a859fee3549e
2026-08-17 09:51:28 +01:00
merge-script
fe7dbde52c Merge bitcoin/bitcoin#35976: test: Speedup fee estimation functional test with batching
b3d77ea027 test: Speedup fee estimation functional test with batching (sedited)

Pull request description:

  The fee estimation functional test is currently the slowest one by a good margin. It is a bit annoying, because it also increases the total runtime of the functional tests.

  It seems like most of the slowness comes from the transactions propagating between the nodes. This patch helps them do that by submitting them directly to all the nodes. Also take this opportunity to batch the transaction submissions.

  On my machine this speeds up the fee estimation functional test from around 71 seconds to 25 seconds.

ACKs for top commit:
  151henry151:
    tACK b3d77ea027
  maflcko:
    review ACK b3d77ea027 🐇
  ismaelsadeeq:
    ACK  b3d77ea027

Tree-SHA512: f76415dca7997577ca39ac6b95dfdf32b930dd64b4311e3da34e34adb16107ff4ea2d9fa679f3ca50540e80c38af7f9390b44f21ad1b8107fbbc3586edb2ef19
2026-08-17 09:47:08 +01:00
merge-script
c90c23d388 Merge bitcoin/bitcoin#35531: txindex: hash keys and pack positions to reduce disk usage
25bed560be test: add forward-compat functional test for txindex (sedited)
703304ed8c doc: add release notes for txindex disk usage and downgrading (Andrew Toth)
8e5320a2d2 tests: cover txindex hash prefix collisions and legacy fallback (Andrew Toth)
b75efa19ba txindex: skip bloom filters and legacy lookups for new databases (Andrew Toth)
004d7c098c txindex: hash key prefixes and pack block positions (Andrew Toth)
5a255970fd refactor: move txindex db constants and legacy key to txindex_key.h (Andrew Toth)
327660134c txindex: pass the full block to DB::WriteTxs (Andrew Toth)
42771e7998 txindex: use a new block locator for downgrade safety (Andrew Toth)
4b08baed72 txindex: return optional tx and block hash from FindTx (Andrew Toth)

Pull request description:

  The current txindex uses the full 32-byte txid as keys, which takes up about 66 GB of disk space today on mainnet. Using a 5-byte key prefix instead drops the disk usage to 26 GB - cutting the size to less than half.

  Using the full 32-bytes is unnecessary since a 5-byte salted siphash will produce collisions in about 1 in 1.1 trillion. Some collisions will occur, but the penalty is just an extra disk read, deserialization and hash.
  The tx position can be appended to the key instead of used as a value, and a LevelDB iterator can seek to the prefix and then scan for the correct tx. This is an almost identical approach to `txospenderindex`.

  Also instead of storing the file position of the block, we can store only the sequence of the connected block and offset of the transaction in the block. This can be packed into a 6-byte key suffix using 3-byte representations of the sequence and offset in the block. The block file can be recovered by the CBlockIndex that is already in memory. The sequence is mapped to the block hash in the db, so we can lookup the block hash to find the CBlockIndex during reads.

  If a tx is not found with this method, we fallback to looking up the legacy entry. With this method a user with an existing db can opt to erase the `indexes/txindex` folder and reindex, or keep the current index and new entries will be appended with the smaller footprint.

  The time to index was faster on my machine with this method, 1h19m vs current 1h50m.
  Lookups are roughly the same, around 0.2ms per lookup with `getrawtransaction`.
  When testing on mainnet, I got 894,549 2-way collisions, 395 3-way collision, and 1 4-way collision that worst case could cause an extra 3 false positives when reading.

ACKs for top commit:
  l0rinc:
    diff reACK 25bed560be
  sedited:
    ACK 25bed560be
  ajtowns:
    ACK 25bed560be

Tree-SHA512: a25c79ca7e722e2f372b65f5fc11c8b194ad49f2240b4881c7e606306aabbd3604aede3f1c33606b467486affac3a3f503638f513c896935cebbc02709cb60d8
2026-08-15 15:20:47 +01:00
fanquake
2dcb2c6df2 Update minisketch subtree to latest master 2026-08-15 15:05:06 +01:00
fanquake
461e3be8d3 Squashed 'src/minisketch/' changes from d1bd01e189..4a179c61e3
4a179c61e3 Merge bitcoin-core/minisketch#102: Avoid Clang's `-Wunused-template` under restricted field selections
d14cd495ff Avoid Clang's `-Wunused-template` under restricted field selections

git-subtree-dir: src/minisketch
git-subtree-split: 4a179c61e3cbe3ac2b3c027764ce8eb5183155e1
2026-08-15 15:05:06 +01:00
Hennadii Stepanov
05c36d9fad Merge bitcoin-core/gui#957: fix: add .dat file extension automatically when exporting watchonly
75a4e6c678 gui: fix allow restore wallets without .dat file extension (Pol Espinasa)
6ed7e05e20 gui: fix add .dat file extension automatically when exporting watchonly (Pol Espinasa)

Pull request description:

  fixes https://github.com/bitcoin-core/gui/issues/956

  Unlike `backup wallet`, `export watch-only wallet` was not automatically adding the file extension to the exported file, making restoring difficult if the user doesn't manually add the file extension after exporting.

  Allows also to restore a wallet from a non specified `.dat` file extension. This is achieved by removing the filter in the select file screen, matching the RPC behavior.

ACKs for top commit:
  hebasto:
    ACK 75a4e6c678.

Tree-SHA512: 7c45d51205f9abf2b67233e8abd3297e49a4230eb32aa4118b37ab9da0a8d692aae4b67a8880881e5fab42256d1cf52ccf1b289b8f23f85930354130c192b33d
2026-08-15 11:39:53 +01:00
Pol Espinasa
75a4e6c678 gui: fix allow restore wallets without .dat file extension 2026-08-15 08:43:22 +02:00
Ava Chow
a8b582ec1d Merge bitcoin/bitcoin#32784: wallet: derivehdkey RPC to get xpub at arbitrary path
c3945bfd2b doc: use derivehdkey in multisig tutorial (Sjors Provoost)
3662e33669 test: use derivehdkey in M-of-N multisig demo (Sjors Provoost)
d9570f0838 rpc: add derivehdkey (Sjors Provoost)
62da9f9614 wallet: add GetExtKey helper (Sjors Provoost)
aaf1548475 wallet: generalize GetActiveHDPubKeys helper (Sjors Provoost)
3821452c4a refactor: add hardened derivation helper (Sjors Provoost)
0ab61caafd rpc: ParsePathBIP32 helper (Sjors Provoost)
e36c4b76e1 util: reject out-of-range BIP32 keypath indices (Sjors Provoost)
ba78c31a00 fuzz: check ParseHDKeypath/WriteHDKeypath round-trip (Sjors Provoost)
8cce969085 Have ParseHDKeypath handle h derivation marker (Sjors Provoost)
fc53077762 test: move parse_hd_keypath test to bip32_tests (Sjors Provoost)
dab525eb77 key: add DeriveExtKey() helper (Sjors Provoost)

Pull request description:

  Adds a `derivehdkey` RPC that returns an xpub, or optionally the xprv, at an arbitrary BIP32 path (with at least one hardened step), derived from a wallet HD key.

  The main use case is coordinating a multisig setup, where each participant shares an xpub derived at a hardened path (e.g. `m/87h/0h/0h`) distinct from their default single-signature descriptors. See the (updated) `doc/multisig-tutorial.md` and (updated) functional test to see how that workflow improves.

  The first commits are some helpful helpers:

  - _key: add DeriveExtKey() helper_ - performs the actual derivation
  - _test: move parse_hd_keypath test to bip32_tests_ - from `psbt_wallet_tests`
  - _Have ParseHDKeypath handle h derivation marker_
  - _util: reject out-of-range BIP32 keypath indices_ -  `ParseHDKeypath` would previously map overflowing values without `h` to hardened.
  - _fuzz: check ParseHDKeypath/WriteHDKeypath round-trip_
  - _rpc: ParsePathBIP32 helper_
  - _refactor: add hardened derivation helper_ - `HasHardenedDerivation()`, to enforce the "at least one hardened step" rule
  - _wallet: generalize GetActiveHDPubKeys helper_ - extracts code from `gethdkeys` which `derivehdkey` needs
  - _wallet: add GetExtKey helper_ - reconstruct an xprv from a wallet xpub (analog of `GetKey()`); behavior-preserving prep, also simplifies `gethdkeys`.

  Meat and potatoes:
  - _rpc: add derivehdkey_ - the RPC itself, plus the `UnusedKey` filter on `GetHDPubKeys` that drives key selection.
  - _test: use derivehdkey in M-of-N multisig demo_ - rewrites the functional multisig test to use the RPC and `<0;1>` syntax.
  - _doc: use derivehdkey in multisig tutorial_ - same for the prose tutorial.

ACKs for top commit:
  pseudoramdom:
    code review ACK c3945bfd2b
  achow101:
    ACK c3945bfd2b
  w0xlt:
    That being the case, ACK c3945bfd2b

Tree-SHA512: 661f17c9bfe26017eb14c27ba7af37093387100d3baa25f5d29bba9c1aedc40d19afe1bdfc126a18d018857bb02f1fc84386f10b8f4f4b8e9d6f4b0691d9e302
2026-08-14 18:11:26 -07:00
sedited
b3d77ea027 test: Speedup fee estimation functional test with batching 2026-08-14 22:50:01 +02:00
merge-script
683e05a265 Merge bitcoin/bitcoin#35889: rpc: avoid quadratic gettxspendingprevout work and preserve order
ae36e2ef79 rpc: avoid quadratic prevout resolution (Lőrinc)
da1eaeb350 rpc: preserve `gettxspendingprevout` order (Lőrinc)
f98753e762 refactor: identify prevouts by request index (Lőrinc)
221a3fe5cf test: cover mixed `gettxspendingprevout` order (Lőrinc)

Pull request description:

  **Problem:** `gettxspendingprevout` erases each mempool result from a vector while holding `mempool.cs`, shifting the remaining requests every time and making large calls quadratic in the critical section.
  For 10,000 mempool matches, an [operation-count model](https://godbolt.org/z/nzch7McPG) reaches nearly 50 million moves.
  For mixed requests, the RPC returns mempool results before `txospenderindex` results instead of following request order.
  #34749 introduced both regressions.

  **Fix:** `gettxspendingprevout` stores each result at its request position and collects unresolved requests in a reserved worklist for the `txospenderindex` lookup.
  The mempool pass is linear, the response follows request order, and Clang can verify the lock requirement on `GetConflictTx`.

  **Benchmark:** The [functional benchmark](https://gist.github.com/l0rinc/c3231e287cacfdefd100dbf95cd0c3ad) sends mempool-only requests ranging from 8,000 to 128,000 entries ten times per size.
  Using the same settings for the unfixed and fixed commits:

  ```text
  AMD Ryzen 7 3700X (8 cores)
  unfixed  ██████████████████████████████  90 s
  fixed    ███▒░░░░░░░░░░░░░░░░░░░░░░░░░░  10 s  (-80 s, 9.0x faster)

  Raspberry Pi 5 (4 cores)
  unfixed  ██████████████████████████████  685 s
  fixed    ▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  22 s  (-663 s, 31.1x faster)
  ```

  The unfixed run timed out after ~9 minutes on a Raspberry Pi 4 with 1 GB RAM.

  <details><summary>Benchmark command</summary>

  ```bash
  for commit in 963b061358 46e7173550a93cbe9d4e8ea28cfe7216286d8197; do \
    git fetch origin "$commit" && git checkout --detach "$commit" && \
    rm -rfd build && cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DENABLE_WALLET=OFF >/dev/null 2>&1 && \
    ninja -C build -j1 bitcoind >/dev/null 2>&1 && \
    build/test/functional/test_runner.py rpc_gettxspendingprevout_quadratic.py --repeats=10 || break; \
  done
  ```
  </details>

ACKs for top commit:
  andrewtoth:
    ACK ae36e2ef79
  sedited:
    Re-ACK ae36e2ef79

Tree-SHA512: c7734cae481f6638228c8fd3cc6d4c3fbc26cec6981dae7902292af08eae37455d37ff196da2cca5c3694271c99154838431ff21c12855f81f5f10edf85a793a
2026-08-14 22:01:12 +02:00
merge-script
230185a5ee Merge bitcoin/bitcoin#35971: net_processing: remove unused code
0cff3cc518 net_processing: Remove redundant porphanTx in ProcessOrphanTx (fanquake)
c7eacbd45b net_processing: remove Peer& from UpdatePeerStateForReceivedHeaders (fanquake)

Pull request description:

  Remove unused `peer` param from `UpdatePeerStateForReceivedHeaders`.
  Remove redundant `porphanTx` declaration from `ProcessOrphanTx`.

ACKs for top commit:
  marcofleon:
    ACK 0cff3cc518
  sedited:
    ACK 0cff3cc518

Tree-SHA512: d71684052f9f6c788b4d551886e7f6022d76300e9288089eea5fd0c87f9466dbcff88c9004899a399c669477988437e935aad06960cec721c650b66508c7a16a
2026-08-14 21:49:44 +02:00
Lőrinc
ae36e2ef79 rpc: avoid quadratic prevout resolution
`gettxspendingprevout` erases each mempool result from its worklist while holding `mempool.cs`, shifting the remaining requests every time and making the pass quadratic when it resolves many requests.
Collect unresolved requests in a reserved worklist so the mempool pass is linear and the compiler can verify the lock requirement on `GetConflictTx`.

Co-authored-by: Andrew Toth <andrewstoth@gmail.com>
2026-08-14 11:29:28 -07:00
Lőrinc
da1eaeb350 rpc: preserve gettxspendingprevout order
Store each `gettxspendingprevout` result at its request position so mixed mempool and `txospenderindex` results preserve request order.
2026-08-14 11:26:32 -07:00
Lőrinc
f98753e762 refactor: identify prevouts by request index
Replace `Entry`'s pointer into `output_params` with the request index, which identifies both the input and its response slot.
2026-08-14 11:26:32 -07:00
Lőrinc
221a3fe5cf test: cover mixed gettxspendingprevout order
Record that `gettxspendingprevout` currently returns mempool results before `txospenderindex` results for mixed requests.
2026-08-14 11:26:28 -07:00
marcofleon
01dde6b205 fuzz: Fix assertion in txorphan
EraseTx calls LimitOrphans, which may evict announcements from a peer
that didn't announce the erased transaction, causing that peer's usage
to decrease. Relax the assertion in the EraseTx branch that claimed
usage of a non-announcer peer is unchanged. Also, add assertions for
the other cases.
2026-08-14 18:18:07 +01:00
merge-script
dec68f997e Merge bitcoin/bitcoin#35852: scripted-diff: Use inline const(expr) over static constexpr in headers
fab74a0e92 refactor: Use C++14 digit separator for large int literals (MarcoFalke)
fae759be79 scripted-diff: Use inline constexpr over plain constexpr (MarcoFalke)
fa74f58a26 scripted-diff: Use inline const over (static) const (MarcoFalke)
fab1a62c87 refactor: Use inline constexpr for string literals in headers (MarcoFalke)
fa08bbed8d contrib: Adjust generate-seeds.py to write inline constexpr (MarcoFalke)
fad753611b scripted-diff: Use inline constexpr over (static) const (MarcoFalke)
faedb52583 refactor: Make CFeeRate(integral) ctor constexpr (MarcoFalke)
5555d5dcb5 scripted-diff: Use inline constexpr over static constexpr (MarcoFalke)
fa6e1a1e85 refactor: Remove static from constexpr functions in headers (MarcoFalke)

Pull request description:

  Both are fine and this refactor doesn't change any behavior.

  However, `inline constexpr` from C++17 will ensure each symbol has a single address
  across all TU, making the release binary minimally smaller. (For me it is smaller by about 1kB)

ACKs for top commit:
  l0rinc:
    reACK fab74a0e92
  rustaceanrob:
    ACK fab74a0e92
  hebasto:
    ACK fab74a0e92, I have reviewed the code and it looks OK.

Tree-SHA512: 6ec94136c12bcbf696812d0661c9857318a69e367c79fc00b9ca0b4068f269d10e5548d95c9ba2070225308c12d7a54fe8cb8447de7e0979cba99f48892b35f9
2026-08-14 17:29:46 +01:00
merge-script
e95bab98f0 Merge bitcoin/bitcoin#35960: common: remove ::runtime_error from RunCommandParseJSON
8b5da677d7 common: remove ::runtime_error from RunCommandParseJSON (fanquake)

Pull request description:

  I don't think there's a code path that can reach `RunCommandParseJSON` if we compile with `ENABLE_EXTERNAL_SIGNER=OFF`. If there is a reason for having the code this way, it could  be good to document.

  This also requires more workarounds in #35911.

ACKs for top commit:
  stickies-v:
    re-ACK 8b5da677d7
  sedited:
    ACK 8b5da677d7
  willcl-ark:
    ACK 8b5da677d7

Tree-SHA512: b0c50372fed35afe47713310851f0b58cd1803fbe87a3a5a75877772172a3881283394a91663251de22a9972f56b46d84ddc868686dec8b970474cfaf5dc0d32
2026-08-14 16:20:34 +01:00
merge-script
aad830ac4a Merge bitcoin/bitcoin#35847: test: move more tests to baseindex_tests and run them for all indexes
34c03075a5 test: run generic baseindex tests against every index type (Martin Zumsande)
11b3e251c4 test: make baseindex flush test chain-length agnostic (Martin Zumsande)
8b959f4c6a test: move unclean_shutdown test to baseindex_tests (Martin Zumsande)
2232d6afbe test: move index_reorg_crash to baseindex_tests (Martin Zumsande)
a3597e2683 test: move BuildChain helper into test mining util (Martin Zumsande)
954985e6a3 test: simplify blockfilter test's BuildChain helper (Martin Zumsande)

Pull request description:

  In #34897, the `baseindex_tests` unit test was introduced, meant for tests that test basic index functionality (e.g. reorg or unclean shutdown behavior) that should work regardless of the particular index type.
  This PR moves two more of these tests (`index_reorg_crash`, `coinstatsindex_unclean_shutdown`) from test files of specific indexes into that folder.
  In the second part, tests are executed sequentially for all index types instead of just one particular one, where applicable.

  Before moving `index_reorg_crash`  I extracted the `BuildChain` helper to `util/mining` so that it can be used by multiple tests. While doing that, I simplified the helper a bit.

ACKs for top commit:
  jeanpablojp:
    tACK 34c03075a5
  sedited:
    ACK 34c03075a5

Tree-SHA512: 1d7a43160a9b7ec3c75a8c806967f2031da4855fe449c9c8aac8e44b1940e5ee28fde9473406666e74a682cf135b87f8c0eb9ddba50fce156dce9fc54a7763eb
2026-08-14 16:13:57 +01:00
fanquake
0cff3cc518 net_processing: Remove redundant porphanTx in ProcessOrphanTx 2026-08-14 14:05:42 +01:00
fanquake
c7eacbd45b net_processing: remove Peer& from UpdatePeerStateForReceivedHeaders 2026-08-14 11:52:59 +01:00
fanquake
8b5da677d7 common: remove ::runtime_error from RunCommandParseJSON
I don't think there's a code path that can reach RunCommandParseJSON if
we compile with `-DENABLE_EXTERNAL_SIGNER=OFF`. This also requires more
workarounds in #35911.

Co-authored-by: stickies-v <stickies-v@protonmail.com>
2026-08-14 10:39:20 +01:00
sedited
25bed560be test: add forward-compat functional test for txindex 2026-08-13 23:31:36 -04:00
Andrew Toth
703304ed8c doc: add release notes for txindex disk usage and downgrading 2026-08-13 23:31:36 -04:00
Andrew Toth
8e5320a2d2 tests: cover txindex hash prefix collisions and legacy fallback
Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2026-08-13 23:31:36 -04:00
Andrew Toth
b75efa19ba txindex: skip bloom filters and legacy lookups for new databases
New databases never contain legacy ('t' + txid) entries.
Peek at the database before opening it, and if no legacy
entries are found, skip building bloom filters (hashed
entries are only read via iterators, which do not consult
them) and return early from lookups instead of checking
for legacy entries.
2026-08-13 23:31:36 -04:00
Andrew Toth
004d7c098c txindex: hash key prefixes and pack block positions
Use a 5-byte salted siphash to key txindex entries,
instead of the full 32-byte txid. Store the block sequence and tx position
after the hash in the key, so an iterator can scan
through any collisions and return the correct tx.

Fall back to the legacy key lookup if the tx is not found.

Co-authored-by: Pieter Wuille <pieter@wuille.net>
Co-authored-by: l0rinc <pap.lorinc@gmail.com>
Co-authored-by: Anthony Towns <aj@erisian.com.au>
2026-08-13 23:31:36 -04:00
Andrew Toth
5a255970fd refactor: move txindex db constants and legacy key to txindex_key.h
No behavior change. Moving constants to a new file to make the next commit easier to review.
2026-08-13 23:31:36 -04:00
Andrew Toth
327660134c txindex: pass the full block to DB::WriteTxs
Move the per-transaction position computation from CustomAppend into
DB::WriteTxs, so the DB layer receives the whole block instead of a
pre-built vector of positions. This is a non-functional refactor.
2026-08-13 23:31:36 -04:00
Andrew Toth
42771e7998 txindex: use a new block locator for downgrade safety
The hashed txindex entries cannot be found by older nodes. Record sync
progress under a new locator key so a downgraded node will not rely on
entries indexed by upgraded nodes, and instead continue syncing from the
legacy locator.
2026-08-13 23:31:36 -04:00
Andrew Toth
4b08baed72 txindex: return optional tx and block hash from FindTx
Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2026-08-13 23:31:36 -04:00
merge-script
11090c8bb3 Merge bitcoin/bitcoin#35951: doc: release note about I2P ElGamal sunset
800ad9c3c0 doc: release note I2P ElGamal sunset (Jon Atack)

Pull request description:

  See discussion in https://github.com/bitcoin/bitcoin/pull/35696.

ACKs for top commit:
  janb84:
    re ACK 800ad9c3c0
  sedited:
    ACK 800ad9c3c0

Tree-SHA512: 35ba1f0a25b0921ca81fb531500a15dc6ea34b304637b1a7e675f4bd772e6af85d024a3d672dcaf73a5b438a2d6d45c741f41daf140efc29a068e54affaa9025
2026-08-13 11:02:41 +02:00
Ava Chow
b2c45888fd Merge bitcoin/bitcoin#35866: test: Verify unwelcome RPC clients are rejected before reading their requests
d055a3ab10 test: verify disallowed RPC clients are rejected upon `accept()` (winterrdog)

Pull request description:

  this is a follow-up PR from a suggestion in this [comment](https://github.com/bitcoin/bitcoin/pull/35592#pullrequestreview-4823271031)

  it adds a unit test that confirms that clients not permitted by
  `-rpcallowip` are rejected immediately after `accept()`, before any
  request bytes are read from the socket

  specifically, the test checks that: no request is ever dispatched to the
  server's request handler, the connection is closed without any response
  to the client, no `HTTPRemoteClient` is ever registered for it, and the
  client's request bytes are left completely unread in the socket's
  receive buffer

ACKs for top commit:
  achow101:
    ACK d055a3ab10
  pinheadmz:
    ACK d055a3ab10
  w0xlt:
    reACK d055a3ab10

Tree-SHA512: 5b99eb8a795e302333549f3ea5c76118c380402e2ebac8256db0a06ac0b4c0739b0b94471aa2f278214e65574e84f321b416e2543b361bf4fd8eb6854768377a
2026-08-12 15:16:19 -07:00
Ava Chow
625f951ba2 Merge bitcoin/bitcoin#35959: Update secp256k1 subtree to latest master
09cc345c3e Squashed 'src/secp256k1/' changes from d2d04864ef..687155df6b (fanquake)

Pull request description:

  We recently pulled the secp256k1 subtree (#35781), to get access to the recently-merged silent payments module (used in multiple PRs here). Since then, libsecp256k1 has merged more changes, and had a [`0.8.0` release](https://github.com/bitcoin-core/secp256k1/releases/tag/v0.8.0), so update to latest master again.

  Includes:
  * https://github.com/bitcoin-core/secp256k1/pull/1709
  * https://github.com/bitcoin-core/secp256k1/pull/1776
  * https://github.com/bitcoin-core/secp256k1/pull/1863
  * https://github.com/bitcoin-core/secp256k1/pull/1869
  * https://github.com/bitcoin-core/secp256k1/pull/1886
  * https://github.com/bitcoin-core/secp256k1/pull/1896
  * https://github.com/bitcoin-core/secp256k1/pull/1897
  * https://github.com/bitcoin-core/secp256k1/pull/1899
  * https://github.com/bitcoin-core/secp256k1/pull/1900
  * https://github.com/bitcoin-core/secp256k1/pull/1901
  * https://github.com/bitcoin-core/secp256k1/pull/1902
  * https://github.com/bitcoin-core/secp256k1/pull/1903
  * https://github.com/bitcoin-core/secp256k1/pull/1904
  * https://github.com/bitcoin-core/secp256k1/pull/1906
  * https://github.com/bitcoin-core/secp256k1/pull/1907

ACKs for top commit:
  l0rinc:
    ACK f464f6cd67
  achow101:
    ACK f464f6cd67
  w0xlt:
    ACK f464f6cd67

Tree-SHA512: e7a3d0113c08fccd54f6734154aa6ed3aa06a6e52fb52eacb82c82c7079a23bfee8da9aa3934fc3c173097631394b4ba22d17ca6b73f6bf478dcb0c0a227d8d4
2026-08-12 14:22:40 -07:00
Ava Chow
e9ed5e83a3 Merge bitcoin/bitcoin#35605: wallet: rpc: Deprecate removeprunedfunds RPC
f280f5eb47 wallet: rpc: deprecate removeprunedfunds (David Gumberg)
e5b7785447 test: wallet: resend: avoid internal behavior via removeprunedfunds (David Gumberg)

Pull request description:

  Originally added in https://github.com/bitcoin/bitcoin/pull/7558 as a companion to `importprunedfunds`, this RPC has no known helpful use while being both dangerous and a maintenance burden.

  Despite what the name says, it allows the deletion of arbitrary transactions, and `importprunedfunds` does not allow the importing of transactions not belonging to the user, and `listtransactions` does not list transactions not belonging to the wallet, so this RPC can only be used to delete transactions actually belonging to the wallet, and in the unlikely event that transactions not belonging to the wallet are present, they cause no harm except for occupying a few bytes on the users disk.

ACKs for top commit:
  achow101:
    ACK f280f5eb47
  polespinasa:
    ACK f280f5eb47
  pablomartin4btc:
    reACK f280f5eb47

Tree-SHA512: ed9c30c50be514d637999b4c8f3fa9b9b1446a5553e3974703638b45d8f55f1291f5cfb82dd2ead6d0743e424e9e3b1edbd56fc04dae3dcdee4d175e2a1ce061
2026-08-12 14:15:17 -07:00
Jon Atack
800ad9c3c0 doc: release note I2P ElGamal sunset 2026-08-12 13:02:49 -06:00
merge-script
2f72123f61 Merge bitcoin/bitcoin#35867: test: classify SOCKS5 peers via getpeerinfo addrbind
4e8c4bc794 test: classify SOCKS5 peers via getpeerinfo addrbind (Henry Romp)

Pull request description:

  p2p_private_broadcast.py classifies each SOCKS5 connection by scanning the node's debug log for `trying v. connection (...) to <addr>:<port>`, then attaches a fake peer for that type. The helper returned the first match in the whole log, so when a feeler selected a clearnet address that private broadcast had used earlier in the run (in the CI failure, `[50::1]:8333`, about 10 seconds apart), the feeler was labelled private-broadcast, was given the `NoRelayP2PInterface`, and disconnected as a feeler rather than with the expected "connected in vain" message.

  Instead of relying on the debug log, identify the connection via the SOCKS5 proxy client socket's source address, which equals the node's `addrbind` for that peer, and read `connection_type` from getpeerinfo. The proxy replies to the SOCKS5 request before invoking `destinations_factory`, so the node has already registered the peer by the time classification runs. This also stops treating debug.log contents as a stable test interface. Dropping the log scrape removes a full re-read of debug.log per SOCKS5 connection; `p2p_private_broadcast.py` goes from ~23s to ~14s locally.

  Fixes #35843

  Tested with:
  `build/test/functional/test_runner.py p2p_private_broadcast.py p2p_private_broadcast_retry_v1.py --timeout-factor=2`, and against the forced-feeler repro from the issue, which no longer mislabels the feeler.

ACKs for top commit:
  jeanpablojp:
    tACK 4e8c4bc794
  andrewtoth:
    ACK 4e8c4bc794
  mzumsande:
    Code Review ACK 4e8c4bc794

Tree-SHA512: ce2db418787d7ecf518bd49b37d7d664748fee5991a2924522dfaf42b27d90ca001caa0611011310636b453d3aada1061d086f20bb866eb66605645935f55c74
2026-08-12 17:41:34 +01:00
fanquake
f464f6cd67 Update secp256k1 subtree to lastest master 2026-08-12 15:58:59 +01:00
fanquake
09cc345c3e Squashed 'src/secp256k1/' changes from d2d04864ef..687155df6b
687155df6b Merge bitcoin-core/secp256k1#1897: tests: check results before using outputs
8a700a355e Merge bitcoin-core/secp256k1#1907: release cleanup: bump version after 0.8.0
78657bf28b release cleanup: bump version after 0.8.0
6e2c8bc4ec Merge bitcoin-core/secp256k1#1906: release: prepare for 0.8.0
5840c19b4e release: prepare for 0.8.0
3873647bfb Merge bitcoin-core/secp256k1#1904: sha256: cross-check caller supplied compression function
c84ea46561 sha256: cross-check caller supplied compression function
f8c75f89a5 Merge bitcoin-core/secp256k1#1903: changelog: add entry for #1821
2076b06a42 changelog: add entry for #1821
7fecac74ae Merge bitcoin-core/secp256k1#1709: release-process: Add signing of tarball plus minor improvements
12d9cfd86e release-process: Add attaching output of check-abi.sh to PR
b0a0ae8246 release-process: Add "cleaning up"
4a73b1ae27 release-process: Fix nits
fae22e777e release-process: Add signing of tarball
34f00ca9d9 release-process: Refactor
1c2933bb87 Merge bitcoin-core/secp256k1#1902: changelog: add entry for #1859
51fc633e3e changelog: add entry for #1859
d77f44e9cd Merge bitcoin-core/secp256k1#1863: ellswift: don't declassify or leave sk in sha256 buffer
0ae17e304e ellswift: don't declassify or leave sk in sha256 buffer
0a9e788901 Merge bitcoin-core/secp256k1#1900: Use SHA256 override for pointers to known aux functions
300c9bb26d Merge bitcoin-core/secp256k1#1901: changelog: Add entry for #1869
44ba8cd7df changelog: Add entry for #1869
4147f8bdf6 header: Add note on SHA256 override and aux functions
ed091bc49d ecdsa/ecdh: Use SHA256 override if known noncefp/hashfp is passed
209ed1025b Merge bitcoin-core/secp256k1#1886: Remove deprecated `secp256k1_context_no_precomp` pointer
bf435856bb Remove deprecated `secp256k1_context_no_precomp` pointer
528863e61f Merge bitcoin-core/secp256k1#1869: Remove SECP256K1_GNUC_PREREQ macro
3a73d473f2 Merge bitcoin-core/secp256k1#1776: Remove deprecated `secp256k1_schnorrsig_sign` alias
e14756bd25 Remove deprecated `secp256k1_schnorrsig_sign` alias
7151e3b843 Merge bitcoin-core/secp256k1#1899: changelog: add missing entries for #1777 and #1860
f52eb393c4 changelog: add missing entries for #1777 and #1860
0f6baf319f Merge bitcoin-core/secp256k1#1896: silentpayments: address #1765 follow-ups, add changelog entry
a2ad68cd81 ec: check pubkey sort test results
93280c2291 silentpayments: check test serialization
b8de1bc30f musig: check infinity test setup
0618af8131 extrakeys: check test pubkey loads
1d3f72d3fa recovery: check exhaustive API results
564afb0b06 ellswift: check test operation results
658c7edc24 tests: check exhaustive ecmult success
d9ac2ee5e6 Add changelog entry for silentpayments module
0fa38f3d29 silentpayments: API docs and internal comment followups
ae075d7cbd hash: Include secp256k1.h directly
dba4d937a9 include: Remove SECP256K1_GNUC_PREREQ macro
09870e9c54 Use __GNUC__ instead of SECP256K1_GNUC_PREREQ

git-subtree-dir: src/secp256k1
git-subtree-split: 687155df6b76f1da1639a6f0923b69e6beaa3a09
2026-08-12 15:58:59 +01:00
merge-script
4c045f1a03 Merge bitcoin/bitcoin#35945: depends, qt: Add patch for missing headers
e8500cbd19 depends, qt: Add patch for missing headers (Hennadii Stepanov)

Pull request description:

  This PR fixes the build when using recent Clang releases and libc++.

  From https://github.com/hebasto/bitcoin-core-nightly/actions/runs/31400107892/job/93492660951:
  ```
  [27/1645] Building CXX object qtbase/src/tools/syncqt/CMakeFiles/syncqt.dir/main.cpp.o
  FAILED: [code=1] qtbase/src/tools/syncqt/CMakeFiles/syncqt.dir/main.cpp.o
  /usr/bin/clang++-24  -stdlib=libc++ -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_NAMESPACE=\"\" -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QSNPRINTF -DQT_USE_QSTRINGBUILDER -DQT_VERSION_MAJOR=6 -DQT_VERSION_MINOR=8 -DQT_VERSION_PATCH=4 -DQT_VERSION_STR=\"6.8.4\" -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-e34d706caeb/qtbase/src/tools/syncqt -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-e34d706caeb/qtbase/mkspecs/linux-clang -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-e34d706caeb/qtbase/include -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/x86_64-pc-linux-gnu/include  -ffile-prefi
  /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-e34d706caeb/qtbase/src/tools/syncqt/main.cpp:82:10: error: no member named 'transform' in namespace 'std'
     82 |     std::transform(s.begin(), s.end(), s.begin(),
        |          ^~~~~~~~~
  /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-e34d706caeb/qtbase/src/tools/syncqt/main.cpp:89:10: error: no member named 'transform' in namespace 'std'
     89 |     std::transform(s.begin(), s.end(), s.begin(),
        |          ^~~~~~~~~
  2 errors generated.
  [28/1645] Building C object qtbase/src/3rdparty/pcre2/CMakeFiles/BundledPcre2.dir/src/pcre2_ucd.c.o
  [29/1645] Building C object qtbase/src/3rdparty/pcre2/CMakeFiles/BundledPcre2.dir/src/pcre2_match.c.o
  [30/1645] Building C object qtbase/src/3rdparty/pcre2/CMakeFiles/BundledPcre2.dir/src/pcre2_jit_compile.c.o
  ninja: build stopped: subcommand failed.
  gmake: *** [funcs.mk:343: /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-e34d706caeb/./.stamp_built] Error 1
  gmake: Leaving directory '/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends'
  ```

  From https://github.com/hebasto/bitcoin-core-nightly/actions/runs/31403593334/job/93504547098:
  ```
  [892/1645] Building CXX object qtbase/src/plugins/platforms/xcb/CMakeFiles/XcbQpaPrivate.dir/qxcbatom.cpp.o
  FAILED: [code=1] qtbase/src/plugins/platforms/xcb/CMakeFiles/XcbQpaPrivate.dir/qxcbatom.cpp.o
  /usr/bin/clang++-24  -stdlib=libc++ -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_XCB_PLUGIN -DQT_BUILD_XCB_QPA_LIB_LIB -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_GUI_LIB -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QSNPRINTF -DQT_USE_QSTRINGBUILDER -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/src/plugins/platforms/xcb/XcbQpaPrivate_autogen/include -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/src/plugins/platforms/xcb -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/src/plugins/platforms/xcb/gl_integrations -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/src/3rdparty/xcb/include -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/src/corelib -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/include/QtCore/6.8.4 -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/include/QtCore/6.8.4/QtCore -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/include -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/include/QtCore -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/mkspecs/linux-clang -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/src/gui -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/include/QtGui/6.8.4 -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/include/QtGui/6.8.4/QtGui -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/include/QtGui -I/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/x86_64-pc-linux-gnu/include  -ffile-prefix-map=/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777=/usr -O2 -std=gnu++20 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fno-exceptions -ftemplate-depth=1024 -ffunction-sections -fdata-sections -U_FORTIFY_SOURCE -fcf-protection=full -D_FORTIFY_SOURCE=3 -ftrivial-auto-var-init=pattern -fstack-protector-strong -MD -MT qtbase/src/plugins/platforms/xcb/CMakeFiles/XcbQpaPrivate.dir/qxcbatom.cpp.o -MF qtbase/src/plugins/platforms/xcb/CMakeFiles/XcbQpaPrivate.dir/qxcbatom.cpp.o.d -o qtbase/src/plugins/platforms/xcb/CMakeFiles/XcbQpaPrivate.dir/qxcbatom.cpp.o -c /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/src/plugins/platforms/xcb/qxcbatom.cpp
  /home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/depends/work/build/x86_64-pc-linux-gnu/qt/6.8.4-d5ec21e4777/qtbase/src/plugins/platforms/xcb/qxcbatom.cpp:237:13: error: use of undeclared identifier 'free'
    237 |             free(reply);
        |             ^~~~
  1 error generated.
  ```

ACKs for top commit:
  fanquake:
    ACK e8500cbd19

Tree-SHA512: 694007e5f7a47af8b5284a1ee08a47227d2dffaf4bc8ea71f55270dcbd5b33e59df827eb643753f33403b2ebd2dc924f3f65a60cd5c7920e8d031f81e66c4a1a
2026-08-12 11:46:12 +01:00
merge-script
b061567235 Merge bitcoin/bitcoin#35947: build, msvc: Update vcpkg manifest baseline
e2bf51543a build, msvc: Disable default features of the `sqlite3` package (Hennadii Stepanov)
a31425610a build, msvc: Update vcpkg manifest baseline (Hennadii Stepanov)

Pull request description:

  This change updates the vcpkg manifest baseline from the ["2025.08.27 Release"](https://github.com/microsoft/vcpkg/releases/tag/2025.08.27) to the ["2026-07-29 Release"](https://github.com/microsoft/vcpkg/releases/tag/2026.07.29), with the following package changes:
   - boost: 1.88.0 --> 1.91.0
   - sqlite3: 3.50.4 --> 3.53.4
   - zeromq: 4.3.5#2 --> 4.3.5#3
   - qtbase: 6.9.1 --> 6.11.1#1
   - qttools: 6.9.1 --> 6.11.1
   - libqrencode: 4.1.1#2 --> 4.1.1#3

  The previous update was made in https://github.com/bitcoin/bitcoin/pull/33408.

  ---

  Additionally, the default features of the `sqlite3` package have been disabled. See the commit message for more details.

ACKs for top commit:
  fanquake:
    ACK e2bf51543a

Tree-SHA512: dc486afa3e4900ac44c2e51d4aaf1aa8bb4542cb8ef1e0ebb6444a171ea31171564e35f1fcc28469c2890437f23879d4468695033b1583e40709e0f717731ee7
2026-08-12 11:42:23 +01:00
Hennadii Stepanov
1f5c46f7ce Merge bitcoin/bitcoin#35931: ci: Check DLL imports of cross-built bitcoind.exe
67fee5bf44 ci: Check DLL imports of cross-built `bitcoind.exe` (Hennadii Stepanov)

Pull request description:

  Run `dumpbin.exe /imports` on the cross-built `bitcoind.exe` in the "Windows, test cross-built" jobs to list the imported DLLs and to ensure the executable is linked against the expected C runtime.

  This came up during a discussion in https://github.com/bitcoin/bitcoin/pull/35877 ([here](https://github.com/bitcoin/bitcoin/pull/35877#pullrequestreview-4882577358) and [here](https://github.com/bitcoin/bitcoin/pull/35877#issuecomment-5217049246)). Inspired by the analogous CI steps in https://github.com/hebasto/bitcoin-core-nightly.

ACKs for top commit:
  maflcko:
    lgtm ACK 67fee5bf44
  jeanpablojp:
    ACK 67fee5bf44

Tree-SHA512: 3cf054b5c76d5e536f7419ab87e3bc30afea30760fbb3112789a9930098350c0f40ea2c2de4c5b2d1123f1eb58a02aeca28c87461966cf072c3dc86e1b1f106f
2026-08-12 09:55:57 +01:00
Ava Chow
1bec7fa22c Merge bitcoin/bitcoin#35496: kernel: add btck_set_mock_time for testing time-dependent paths
156f2c6c49 kernel: add `btck_set_mock_time` for testing time-dependent paths (stringintech)

Pull request description:

  Some kernel paths read the current time (e.g. header validation's future-time check, and the `btck_SynchronizationState` carried by `btck_NotifyBlockTip` / `btck_NotifyHeaderTip` callbacks), which makes them awkward to exercise deterministically in tests. This PR exposes `btck_set_mock_time` as a wrapper over the existing `SetMockTime`, mirroring what the node has via the `setmocktime` RPC.

  Prior IRC discussion: https://gnusha.org/bitcoin-kernel/2026-06-04.log

ACKs for top commit:
  josibake:
    ACK 156f2c6c49
  purpleKarrot:
    ACK 156f2c6c49
  achow101:
    ACK 156f2c6c49
  janb84:
    ACK 156f2c6c49
  sedited:
    ACK 156f2c6c49

Tree-SHA512: da61faab0477fdc0de0e16420f228923d57733c42ef91b8947ef576e43abc8a1b78b9c1fa2ae60550ed5fd545f4d1c714dad0191d4442d4063112031ef7d1027
2026-08-11 13:18:13 -07:00
merge-script
c1967c4453 Merge bitcoin/bitcoin#35950: Update leveldb subtree to latest master
9f10ef5e96 Squashed 'src/leveldb/' changes from a7f9bdc611..13da2d6758 (fanquake)

Pull request description:

  Includes:
  * https://github.com/bitcoin-core/leveldb-subtree/pull/62
  * https://github.com/bitcoin-core/leveldb-subtree/pull/64 (used in #35911)

ACKs for top commit:
  l0rinc:
    code review ACK 3e76d22de2
  hebasto:
    ACK 3e76d22de2.
  sedited:
    ACK 3e76d22de2

Tree-SHA512: 88b9a673550ab95f99de5fb06c8313464b1a6b962a55aa911d7b8bb362eae71a283663460b1cab2aa99e37a066c3f52cfc834cf679b4db49d172bf91b32ae3fa
2026-08-11 21:38:40 +02:00
Ava Chow
512dc9af1b Merge bitcoin/bitcoin#35930: wallet: post-#35501 cleanups in CWalletTx
4ca182ca40 doc: clarify alternate_wtxids is empty when only one witness variant (pablomartin4btc)
fa48b5d28e test: assert listsinceblock "removed" reports current canonical wtxid (pablomartin4btc)
9b96ee1288 wallet, test: add unit test for variant txid validation in CWalletTx deserializer (pablomartin4btc)
9de6543cb5 wallet: post-#35501 cleanup in CWalletTx (pablomartin4btc)

Pull request description:

  Follow-up cleanups and clarifications after #35501 was merged.

  Commit breakdown:

  1. _post-[#35501](https://github.com/bitcoin/bitcoin/pull/35501) cleanup in_ `CWalletTx`
     - Rename `arg_state` → `new_state` in `Update()` for consistency
     - Simplify `RecomputeCanonical()` using `std::ranges::min_element` with a projection lambda (14 lines → 3 lines)
     - Add variant txid validation in the `CWalletTx` deserialise constructor: throws `std::runtime_error` if any variant's txid doesn't match the canonical txid deserialized from the stream
     - Move `Init()` to `private` and extend it to clear `m_txs` and reset `m_canonical_wtxid`, so a full re-deserialise via `Unserialize()` starts from a clean state

     All [suggested](https://github.com/bitcoin/bitcoin/pull/35501#pullrequestreview-4854519083) by ajtowns.

  2. _add unit test for variant txid validation in_ `CWalletTx` _deserializer_

  3. _assert_ `listsinceblock` "removed" _reports current canonical wtxid_
     Documents that removed entries reflect the wallet's current `CWalletTx` state, not a snapshot of the detached block. A future followup could improve this (requires per-block tracking of which witness variant was included).
     [Suggested](https://github.com/bitcoin/bitcoin/pull/35501#discussion_r3632044472) by w0xlt.

  4. _clarify_ `alternate_wtxids` _is empty when only one witness variant_
     [Suggested](https://github.com/bitcoin/bitcoin/pull/35501#discussion_r3632113003) by polespinasa.

ACKs for top commit:
  jeanpablojp:
    re-ACK 4ca182ca40
  achow101:
    ACK 4ca182ca40
  polespinasa:
    ACK 4ca182ca40

Tree-SHA512: 64eadeb11372d904c79edbfd264c4d8dc1b4fe4ce5e3acc301bfeba9e556efb5dce2c684f0e58c7b74e2c687cc7dd77389970662b3fd629ed034a97bcfdfb71c
2026-08-11 11:06:33 -07:00