Skip to content

[pull] master from bitcoin:master - #1871

Merged
pull[bot] merged 13 commits into
All-Blockchains:masterfrom
bitcoin:master
Sep 24, 2026
Merged

pull[bot] merged 13 commits into
All-Blockchains:masterfrom
bitcoin:master

Conversation

@pull

@pull pull Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

AgusR7 and others added 13 commits May 24, 2026 21:17
Track a mempool transaction before and after adding its txid to the unbroadcast set, which currently retains a node without changing reported memory usage.
Include `m_unbroadcast_txids` in `DynamicMemoryUsage()` to count the set nodes retained for locally submitted transactions awaiting their first successful broadcast, with at most one entry per mempool transaction.
CExtKey and CExtPubKey were the only types whose (de)serialization went
through an output parameter (Encode/Decode on a raw pointer), leaving the
caller responsible for the buffer size. Give them Serialize/Unserialize
like the rest of the codebase and route the base58, PSBT and wallet
descriptor cache code through those, so the expected length is enforced
by the stream at every call site.

The wallet loader now checks the cache record's CompactSize prefix
against BIP32_EXTKEY_SIZE and reads the xpub directly from the record
stream. The serialized bytes, and thus the base58 and PSBT encodings and
the wallet's on-disk cache records, are unchanged.
This allows for passing a KeyPair directly to a secp256k1 function without needing to create a
temporary secp256k1_keypair object.

Co-authored-by: Rob <rob.netzke@gmail.com>
Wrap the silentpayments module from libsecp256k1. This is placed in
common as it is intended to be used by:

  * RPCs: for parsing addresses
  * Wallet: for sending, receiving, spending silent payments outputs
  * Node: for creating silent payments indexes for light clients

Co-authored-by: Rob <rob.netzke@gmail.com>
Use the test vectors to test sending and receiving. A few cases are not
covered here, namely anything that requires testing specific to the
wallet. For example:

* Taproot script path spending is not tested, as that is better tested in
  a wallets coin selection / signing logic
* Re-computing outputs during RBF is not tested, as that is better
  tested in a wallets RBF logic
db7ec4f refactor: (de)serialize CExtKey/CExtPubKey through streams (Alhuda Khan)
cb69853 wallet: check descriptor cache xpub length before decoding (alhudz)

Pull request description:

  The descriptor cache records (`WALLETDESCRIPTORCACHE`/`WALLETDESCRIPTORLHCACHE`) deserialise their value into a vector whose length comes from the record itself, but `CExtPubKey::Decode` then reads a fixed `BIP32_EXTKEY_SIZE` bytes. A record encoding a shorter xpub makes `Decode` read past the vector (caught as a container-overflow under ASan).

  The first commit rejects records whose serialised xpub isn't exactly `BIP32_EXTKEY_SIZE`, the same way the other malformed records in this loader return `DBErrors::CORRUPT`, with a unit test covering both cache types.

  The second commit (per #35440 (comment)) replaces `CExtKey`/`CExtPubKey` `Encode`/`Decode` and `EncodeWithVersion`/`DecodeWithVersion`, the only (de)serialisation in the codebase that wrote into a caller-provided buffer, with `Serialize`/`Unserialize`, and routes the base58, PSBT and wallet cache code through them. The serialised bytes are unchanged, so base58 and PSBT encodings and the on-disk cache records are the same as before. The wallet loader now checks the record's CompactSize prefix and reads the xpub straight from the record stream.

ACKs for top commit:
  molnard:
    tACK db7ec4f
  achow101:
    ACK db7ec4f
  winterrdog:
    tACK db7ec4f

Tree-SHA512: e315d1c0e0d542643dc286055fcbe7b1f98891c8dff844cc55888bb970c3147e2b35fc3c0103e9a55101c6820e8bb5817316a5048e3c4e2c548ce30345eaa3a0
e3ee0eb tests: add BIP352 test vectors as unit tests (josibake)
f133d13 common: add bip352.{h,cpp} secp256k1 module (josibake)
44997c3 Add "sp" HRP (josibake)
356c91f crypto: add KeyPair::GetSecpKeypair (josibake)

Pull request description:

  This PR is part of integrating silent payments into Bitcoin Core. It is the second iteration of #28122, now based on bitcoin-core/secp256k1#1765.

  This project is tracked in #28536.

  BIP352
  This PR focuses strictly on the BIP logic and attempts to separate it from the wallet and transaction implementation details. This is accomplished by working directly with public and private keys, instead of needing a wallet backend and transactions for testing. Labels for the receiver are optional and thus deferred for a later PR.

  Test vectors from the BIP are included as unit tests.

ACKs for top commit:
  rustaceanrob:
    reACK e3ee0eb
  theStack:
    re-ACK e3ee0eb
  achow101:
    ACK e3ee0eb

Tree-SHA512: 9b5706e35a49606ac53303c4be0c08f0a08ee273bd69855ff2c869ebcf63dc1e798f8295b8800a41a7094658ab17134366b1ebf2b79dbda5d4af377b05bb2854
…tion

b7cbd80 test: use MiniWallet for getblockstats test data generation (AgustinRivera)

Pull request description:

  Fixes #31838.
  Follow-up to #33184.

  This updates `rpc_getblockstats.py --gen-test-data` to generate its fixture data using `MiniWallet` instead of wallet RPCs.

  The normal test path still loads predefined block/stat data from `rpc_getblockstats.json`, so the test continues to compare `getblockstats` results against fixed expected data rather than against freshly computed RPC output.

  This keeps the generator independent of wallet behavior while preserving the existing regression-test structure.

  Tested on a wallet-disabled Linux build:
  - `python3 /tmp/bitcoin-build/test/functional/rpc_getblockstats.py`
  - `python3 /tmp/bitcoin-build/test/functional/rpc_getblockstats.py --gen-test-data --test-data /tmp/rpc_getblockstats.generated.json`
  - `python3 /tmp/bitcoin-build/test/functional/rpc_getblockstats.py --test-data /tmp/rpc_getblockstats.generated.json`

ACKs for top commit:
  achow101:
    ACK b7cbd80
  theStack:
    ACK b7cbd80
  sedited:
    ACK b7cbd80

Tree-SHA512: f763acd0467143c4f151fa2acd5b154c073fea8551eafcf102ef2d1cc0f4b2ce13b7828bd2736d0cdda782a78dfa6aea60b61bee27e9ca8a2b72d76dffc09340
db21e03 mempool: include unbroadcast txid memory (Lőrinc)
8d5c4a9 test: characterize unbroadcast memory accounting (Lőrinc)

Pull request description:

  **Problem:** The mempool memory estimate omits the txid set used to retry the initial broadcast of locally submitted transactions, so `getmempoolinfo` and `-maxmempool` undercount retained memory.

  **Fix:** Count this set when calculating mempool memory usage.

ACKs for top commit:
  jeanpablojp:
    ACK db21e03
  bartoli:
    ACK db21e03
  achow101:
    ACK db21e03
  musaHaruna:
    Tested ACK [db21e03](db21e03)
  instagibbs:
    ACK db21e03
  ismaelsadeeq:
    ACK db21e03

Tree-SHA512: 1d00381efb65839057a731101753ffd492596c76c23d4a2c229c720dec13b0558bdc4e6e5be0de52b65004872a1a8f87342b085eb1827bb15a7732646101d486
@pull pull Bot locked and limited conversation to collaborators Sep 24, 2026
@pull pull Bot added the ⤵️ pull label Sep 24, 2026
@pull
pull Bot merged commit 2624148 into All-Blockchains:master Sep 24, 2026
0 of 25 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants