a15bdc0598 doc: update offline-signing-tutorial to use exportwatchonlywallet rpc (Pol Espinasa)
a388076401 test: Test for exportwatchonlywallet (Ava Chow)
d053e3e5c8 wallet, rpc: Add exportwatchonlywallet RPC (Ava Chow)
444878efef wallet: Add CWallet::ExportWatchOnly (Ava Chow)
f9273f01db wallet: Move listdescriptors retrieving from RPC to CWallet (Ava Chow)
a1c83789a7 wallet: Write new descriptor's cache in AddWalletDescriptor (Ava Chow)
1e996640e6 wallet: Use Descriptor::CanSelfExpand() in CanGetAddresses() (Ava Chow)
d2ee9227da descriptor: Add CanSelfExpand() (Ava Chow)
Pull request description:
Currently, if a user wants to use an airgapped setup, they need to manually create the watchonly wallet that will live on the online node by importing the public descriptors. This PR introduces `exportwatchonlywallet` which will create a wallet file with the public descriptors to avoid exposing the specific internals to the user. Additionally, this RPC will copy any existing labels, transactions, and wallet flags. This ensures that the exported watchonly wallet is almost entirely a copy of the original wallet but without private keys.
ACKs for top commit:
polespinasa:
lgtm ACK a15bdc0598
Sjors:
re-utACK a15bdc0598
pablomartin4btc:
re-ACK [a15bdc0](a15bdc0598)
w0xlt:
lgtm reACK a15bdc0598
Tree-SHA512: cfc59415ad9aa13d1445cf2a85db1c051215496b6edcf5a8db463499b2b51b92ee7bf840b709035dff7635f9d0c533423bceb58c851f220500e1ea254d12f3b8
fb1d152c24 depends: Boost 1.91.0-1 (fanquake)
Pull request description:
https://www.boost.org/releases/1.91.0/.
> MultiIndex
> Breaking change: All type lists accepted or provided by the library (indexed_by, tag, nested typedefs index_specifier_type_list, index_type_list, iterator_type_list and const_iterator_type_list) are no longer based on [Boost.MPL](https://www.boost.org/libs/mpl) but instead they are now [Boost.Mp11 lists](https://www.boost.org/libs/mp11/doc/html/mp11.html#definitions). As a result, Boost.MultiIndex doesn’t depend anymore on Boost.MPL. It is expected that most user code won’t be impacted by this change, but the previous behavior may be restored, however, by globally defining the macro BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT. Legacy support for Boost.MPL may be eventually deprecated and removed in the future.
> Breaking change: composite_key and associated class templates (composite_key_equal_to, composite_key_compare, composite_key_hash) have been made variadic (previously the maximum number of template arguments was limited by BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE). This change should be transparent to users, with the exception that composite_key::key_extractors returns a std::tuple instead of a boost::tuple (and similarly for the rest of affected class templates).
> Removed internal workarounds and fallbacks to support pre-C++11 compilers.
ACKs for top commit:
hebasto:
re-ACK fb1d152c24.
willcl-ark:
ACK fb1d152c24
Tree-SHA512: 08a12d5f2b184faea8a0c68a276e6a11ebeb0dbedfa9e0976d80d49d5cbcee20fec07d77ee90399e0d35a18068755973e30d8451e22e7a151efaded30c7bfcb1
ExportWatchOnly produces a watchonly wallet file from a CWallet. This
can be restored onto another instance of Bitcoin Core to allow that
instance to watch the same descriptors, and also have all of the same
initial address book and transactions.
When listdescriptors retrieves the descriptors from the wallet, instead
of having this logic in the RPC, move it into CWallet itself. This
will enable other functions to get the descriptors in an exportable
form.
037ad77071 fuzz: add IPC round-trip target (Enoch Azariah)
8a739a5510 build: allow ipc fuzz builds (Enoch Azariah)
Pull request description:
As discussed in #23015, this PR adds an IPC fuzz target to exercise the Cap'n Proto/libmultiprocess serialization bridge using an in-process two-way pipe and a reflected test interface.
It covers round-trip serialization for `COutPoint`, `CScript`, `std::vector<uint8_t>`, `UniValue`, and transactions, and exercises libmultiprocess proxy/server interaction. The target guarantees at least one IPC operation per input and is included by default when IPC is enabled in fuzz builds
Coverage [report](https://marcofleon.github.io/coverage/ipc/) provided by marcofleon
ACKs for top commit:
marcofleon:
ACK 037ad77071
sedited:
Re-ACK 037ad77071
Tree-SHA512: aae8835c8a378886b36420c422136c743b235877f6fd6f0c681910903c68e18753598c7f0e0279ce2e64d627241ce3a4e08f7edecc2e38765569c9faa61bf45e
91586f701e test: introduce NodeSigner, run feature_taproot.py without wallet compiled (Sebastian Falbesoner)
771200ca43 test: return full keypair from `getnewdestination` helper (Sebastian Falbesoner)
Pull request description:
This PR introduces a simple `NodeSigner` wallet replacement class that delegates signing to a specified node via the `signrawtransactionwithkey` RPC. Note that this is fundamentally different to `MiniWallet`, as it allows spending standard output types (P2PKH, P2WPKH, P2SH-P2WPKH, P2TR) and operates on already existing raw transactions, rather than allowing to create them from scratch (though support for that could still be added later).
A `NodeSigner` instance is plugged into the taproot functional test (`feature_taproot.py`) in order to allow running without having the Bitcoin Core wallet compiled. This was done with the intention to change the nature of this functional test as little as possible, as it seems that the variety of additional (pre-taproot) output script types and a rather sophisticated scheme for deriving amounts (including change) is desired -- if this is not considered relevant, a more invasive replacement using MiniWallet might also be a possible alternative.
ACKs for top commit:
maflcko:
review ACK 91586f701e 🏗
brunoerg:
code review ACK 91586f701e
Tree-SHA512: 20c047268261ce5c9517bae5e3d71e9313de149841273451df8639bd81009b933b7061c4881651a345c12e11b311ff746feb2dee84ee9b19dd57e18bb7fe3fee
b36730a3ef Add CI job for riscv bare metal (TheCharlatan)
bfdbf513f6 Add CI job for producing a static bare metal binary (TheCharlatan)
a9a1d92a1d build: Add option for building for bare metal envs (TheCharlatan)
Pull request description:
This adds a CI job for building the static consensus library and linking it to an executable. It uses newlib-cygwin as a C library for the final linking step. This ensure compatibility with this target going forward and can serve as a starting point for enabling bare metal builds for the entire kernel library. This would have also caught the error fixed in #31365.
ACKs for top commit:
fanquake:
ACK b36730a3ef
willcl-ark:
reACK b36730a3ef
Tree-SHA512: c199260f243e20df7f6a537e6c1eaf3d32e23f8fc78b9a8e2b75d9feff3830ef61279e93093dacdceb99e8eb010321b4c1c644e2ad9e266f0ca1ae736baa20ae
Add an ipc fuzz target behind ENABLE_IPC.
Set up an in-process two-way pipe and use a small reflected interface
to exercise libmultiprocess client/server calls.
Round-trip COutPoint, CScript, std::vector<uint8_t>, UniValue, and
transactions.
Add bitcoin_ipc_fuzz static library and link it to the fuzz target
via a new src/ipc/test/fuzz/CMakeLists.txt.
b6b1d0653a nanobench: fix perf counter buffer init (Lőrinc)
Pull request description:
**Problem:** The Linux perf counter buffers are documented as starting with three `read_format` metadata slots, but `std::vector<uint64_t>{3}` creates a one-element vector containing `3`.
In normal benchmark runs this is usually hidden because successful `monitor()` calls resize the buffers before `updateResults()`, while failed setup sets `mHasError` before the indexed reads.
**Fix:** Use the vector size constructor so the buffers start with three zero-initialized metadata slots.
This should not change the usual successful benchmark path, but it makes the default object state match the code's indexing assumptions.
**Reproducer:** https://godbolt.org/z/scE8rMd8Y
**Upstream:** https://github.com/martinus/nanobench/pull/138
ACKs for top commit:
dergoegge:
Code review ACK b6b1d0653a
sedited:
ACK b6b1d0653a
Tree-SHA512: f3055e3eaf567e46e99c02497563249a292162606945365a277beacfd95086b5645f67396bfa4f1e08ca109ddd48a6feef3ead6d59b8de8ae898607493ee13ca
d64ea15824 ci: add openBSD cross CI job (fanquake)
5404b62074 depends: add openbsd_LDFLAGS (fanquake)
Pull request description:
This adds a Linux cross job for OpenBSD; similar to https://github.com/bitcoin/bitcoin/pull/34491 (FreeBSD).
ACKs for top commit:
hebasto:
ACK d64ea15824.
willcl-ark:
ACK d64ea15824
Tree-SHA512: 0353c0ae8dd49c861a9100ebd5044fc39227c29859ca68e6454ebdf469c90ff5471e29733613606ee8ba72037f7fca5086275f794e90864a6456ffee73d9113b
Introduce a new simple `NodeSigner` wallet replacement that delegates
signing to a specified node via the `signrawtransactionwithkey` RPC,
and plug in that new class to the functional test feature_taproot.py,
so that it can be ran without the Bitcoin Core wallet compiled.
This can be useful for spending funds that are received at the created
address. Preparatory for the next commit, which modifies the taproot
functional test to work without the Bitcoin Core wallet compiled in.
3765b428d1 logging: More fully remove libevent log category (Ryan Ofsky)
Pull request description:
Libevent log category was partially removed in 39e9099da5, and this commit extends that with the following changes:
- Stops showing libevent in the list of supported log categories in `bitcoind -help` and `bitcoin-cli help logging` output.
- Stops returning `"libevent": false` in `logging` RPC output.
It's not good to treat libevent as a supported log category when it can't be enabled and trying to enable it results in warnings.
There's also no need to define an unused LIBEVENT constant value and keep more complicated logic for dealing with deprecated log categories, so this change also simplifies code internally.
ACKs for top commit:
l0rinc:
code review ACK 3765b428d1
pinheadmz:
ACK 3765b428d1
sedited:
ACK 3765b428d1
Tree-SHA512: 09e9514f905bb0a79d870689af491886baaa31fa19f2ad6aef4283fa20c2fa6ce8d384178139227aeeabffabff6e83d254114daaeefbbfe2c6172b9da8871298
a318f43254 bitcoin-util: Add netmagic command (ekzyis)
Pull request description:
This adds a `netmagic` command to `bitcoin-util`. It will return the network magic bytes of the selected chain:
```
$ bitcoin-util netmagic
f9beb4d9
$ bitcoin-util -regtest netmagic
fabfb5da
$ bitcoin-util -testnet4 netmagic
1c163f28
$ bitcoin-util -signet netmagic
0a03cf40
# default challenge
$ bitcoin-util -signet -signetchallenge=512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae netmagic
0a03cf40
$ bitcoin-util -signet -signetchallenge=51 netmagic
54d26fbd
```
This will be particularly useful for https://github.com/bitcoin/bitcoin/pull/34566 to determine the datadir path of a custom signet, before starting bitcoind, since #34566 will add the network magic as a suffix. This was mentioned in https://github.com/bitcoin/bitcoin/pull/34566#issuecomment-4622356132. It uses the same code from init.cpp to print the signet derived magic:
ea9afb61a1/src/init.cpp (L967-L969)
Since it does not depend on #34566, and the changes are quite simple, I created a separate PR for this for easier review and discussion.
I have tested this by invoking the command with the options above.
ACKs for top commit:
stickies-v:
ACK a318f43254
sedited:
ACK a318f43254
Tree-SHA512: bcb5a1b14260e13a35f5682e4dac735f472ab6ff7781e7e77aef5895ddbecc03a2fc72a26419ba9a28354736a1eaaeddb047bafe276440e339f17ddfe7841862
2ee4fafa3f test: add fuzz test for private broadcast (kevkevinpal)
08b7c61fc7 private broadcast: enforce sending to unique node ids (Vasil Dimov)
Pull request description:
Add a fuzz test that exercises the public methods of the `PrivateBroadcast` class from `src/private_broadcast.h` and checks for correctness.
ACKs for top commit:
instagibbs:
ACK 2ee4fafa3f
nervana21:
re-ACK 2ee4fafa3f
frankomosh:
Code Review ACK 2ee4fafa3f.
Tree-SHA512: 35f9efcf9e7ea8bd071f6b607fd7c901b60ccf14610f501e6cf06f0d05c389424ab8a0c25a2aaffd5755c8f920af4834e0979cae72a474680170de2b94d06e1c
829255c8be cmake: Remove `SelectLibraryConfigurations` from `FindQRencode` module (Hennadii Stepanov)
5c55606da9 depends: Remove unused `lib/pkgconfig` in `qrencode` package (Hennadii Stepanov)
402ba10b20 cmake: Drop optional `PkgConfig` use in `FindQRencode` module (Hennadii Stepanov)
Pull request description:
This PR addresses:
- [this](https://github.com/bitcoin/bitcoin/pull/35602#issuecomment-4799507779) comment:
> If it works without pkg-config, then we should remove the usage of pkgconfig entirely, rather than say it will work without it, and leave the dependency in the code?
- and [this](https://github.com/bitcoin/bitcoin/pull/35602#issuecomment-4799947803) one:
> While cleaning up this module, you may also get rid of `SelectLibraryConfigurations`. We don't want that `QRencode_LIBRARY` or `QRencode_LIBRARIES` is used anywhere; there is no need to set a variable with that name.
ACKs for top commit:
purpleKarrot:
ACK 829255c8be
Tree-SHA512: fd87a5afd7c0b3271a008df8adcb2ff809053799a0658fbb5a1f15ed11f6abad25836c8e1b7507d0d4c35c027dcbba88b136ac827e17b283ee4ffbbe55d6f4ee
bbbbab86a8 ci: Bump tsan config to ubuntu:26.04 with -U_FORTIFY_SOURCE (MarcoFalke)
Pull request description:
The `-U_FORTIFY_SOURCE` should be harmless in the Tsan CI, and is required to work around https://github.com/bitcoin/bitcoin/issues/30586
ACKs for top commit:
fanquake:
ACK bbbbab86a8
Tree-SHA512: 7c4b434342861fabc52eda7b551ebe08fcde6079cd39d54a21938c88dcfd80cdb876dd7de859bac1201a2b928163c19704c24d5b5a5e76f4935e33cb3e6ae2bd
The `ERR` macro is defined on illumos-based systems in the `regset.h`
header included by the Boost.Test framework, which may cause a
compilation error.
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./src/qt/psbtoperationsdialog.* ) ; }
ren StatusLevel::INFO StatusLevel::Info
ren INFO Info
ren StatusLevel::WARN StatusLevel::Warn
ren WARN Warn
ren StatusLevel::ERR StatusLevel::Error
ren ERR Error
-END VERIFY SCRIPT-
6fa4132298 fuzz: share a single mocked steady clock across FuzzedSock instances (Hao Xu)
Pull request description:
This is a follow-up of https://github.com/bitcoin/bitcoin/pull/35478#issuecomment-4667842057, inspired by maflcko .
Each FuzzedSock used to own its mocked steady clock and call MockableSteadyClock::SetMockTime() directly. Hold the clock by reference to an externally provided SteadyClockContext instead, so that several FuzzedSock instances sharing a test case (e.g. one per peer, or one created via Accept()) advance a single mocked clock, and the mocking goes through the SteadyClockContext RAII helper that resets mocktime on destruction.
SteadyClockContext is a LimitOne type, so each fuzz target constructs one instance per iteration and passes it to ConsumeSock / ConsumeNode / the FuzzedSock constructor.
ACKs for top commit:
maflcko:
review ACK 6fa4132298🌕
marcofleon:
crACK 6fa4132298
Tree-SHA512: 3c773b5c0c3ba42a8245c9ea6042b0bc767df4fad506305f3c200310616b48a59deb1542086eb4ce3e8a1407c4d6b42cef3b37cd84bfe80d4821972b8d3b4286
8791c4764c test: use ExtendedPrivateKey in wallet_taproot.py (rkrux)
89ceafafb9 test: use ExtendedPrivateKey in wallet_listdescriptors.py (rkrux)
bbfffcab58 test: use ExtendedPrivateKey in wallet_send.py (rkrux)
2ab6e590f7 test: use ExtendedPrivateKey in wallet_keypool.py (rkrux)
9e20118720 test: use ExtendedPrivateKey in wallet_fundrawtransaction.py (rkrux)
06af0cddbb test: use ExtendedPrivateKey in wallet_descriptor.py (rkrux)
4100fac20e test: use ExtendedPrivateKey in wallet_createwallet.py (rkrux)
ff3f6def9a test: use ExtendedPrivateKey in wallet_bumpfee.py (rkrux)
003f2a01f6 test: use ExtendedPrivateKey in feature_notifications.py (rkrux)
f988e6d6e6 test: use ExtendedPrivateKey in wallet_importdescriptors.py (rkrux)
d2a03d50ac test: add extendedkey.py unit tests by using BIP32 test vectors (rkrux)
afdb378082 test: introduce ExtendedPrivateKey and ExtendedPublicKey classes (rkrux)
4dbaa7cc65 test: generalise byte_to_base58 utility function to allow more version types (rkrux)
Pull request description:
Many a times there has been a need to come up with dynamic xprvs and xpubs
in the functional tests, but the lack of code that creates them dynamically has
led to the presence of several hardcoded keys in the testing framework. This
is not developer friendly and not self-documenting, clutters the testing code,
and makes it difficult to update the tests in the future.
This PR introduces two utility classes ExtendedPrivateKey and
ExtendedPublicKey that allows the developer to create them on the fly
to be used in the tests. I have intentionally not introduced any library for this
purpose and have reused the existing libraries and functions in the framework.
The implementation is supposed to provide basic functionality for creating
xprv randomly or from a fixed seed, creating corresponding xpub, and
deriving child xprvs and xpubs at custom derivation paths.
I've updated many tests to show how these can be used, there are more
tests as well that can be updated in the future to completely remove such
non-deterministic hardcoded keys.
ACKs for top commit:
achow101:
ACK 8791c4764c
w0xlt:
ACK 8791c4764c
Tree-SHA512: f8ec4e09eaa6cc44b0f1c9a91337e570b12fb882c258be89b470de1a8cecf9d2fd40d9f02ee739dcbf639462ea7710aa145a3726f0f537f5a1f1e7772e5b019d
The local `static constexpr auto ERR` shadowed the `Sock::ERR` static
data member. Rename it to `accept_error`, per the Developer Notes'
shadowing guidance.
Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
1a3cfdf1b7 fuzz: connman: cover AddLocalServices/RemoveLocalServices (Bruno Garcia)
c507fb3063 fuzz: connman: add outbound-bytes invariants (Bruno Garcia)
4a6fce43ea fuzz: connman: add AddNode/RemoveAddedNode invariants (Bruno Garcia)
a5859edef4 fuzz: connman: set m_local_services/m_use_addrman_outgoing/m_max_automatic_connections (Bruno Garcia)
4b84c9125a fuzz: connman: add network activity invariants (Bruno Garcia)
Pull request description:
This PR improves the `connman` fuzz target by replacing some "`(void)`" calls with actual invariant checks, adding coverage for previously uncovered methods, and exercising more initialization states.
- Set `m_local_services`, `m_use_addrman_outgoing`, and
`m_max_automatic_connections` via fuzzed values before `Init()` to
explore more startup configurations.
- Add network activity and outbound-bytes invariants.
- Add `AddNode`/`RemoveAddedNode` invariants: e.g. a successful `AddNode`
increases `GetAddedNodeInfo()` by one; adding the same node again
must fail; a subsequent `RemoveAddedNode` must succeed and restore
the original count.
- Add coverage for `AddLocalServices`/`RemoveLocalServices`.
ACKs for top commit:
nervana21:
re-ACK 1a3cfdf1b7
frankomosh:
reACK 1a3cfdf1b7 . Change from the diff is the restoring `(void)connman.RemoveAddedNode(random_string)` arm
sedited:
ACK 1a3cfdf1b7
Tree-SHA512: c7b6799ca65d2e639d8ab9ab0cc77bae663f24fbda934446a8ee2e8ce9e8e36624d16b4f492b1714e2d67375edd35907cb9392d21f368d3d5298275ff1d05c72
The perf counter read buffer comment says the vectors start with three metadata slots, but brace initialization creates one element with value 3.
Normal benchmark construction usually hides this because successful `monitor()` calls resize the buffers before `updateResults()`, while failed setup sets `mHasError` before the indexed reads.
Initialize the vectors with the size constructor so a default-constructed `LinuxPerformanceCounters` object satisfies the `read_format` invariant instead of relying on that construction path.
Reproducer: https://godbolt.org/z/scE8rMd8Y
8ebfff0f88 doc: add send RPC release note (Sjors Provoost)
5884f5a4fa wallet: remove experimental warning from send RPCs (Sjors Provoost)
Pull request description:
The `send` RPC was introduced in v21 an initially marked experimental. The `sendall` RPC was added in v24, based on `send` and also marked experimental.
I'm not aware of any proposed breaking changes, except #35433 which follows the regular deprecation flow.
Time to mark them as no longer experimental.
ACKs for top commit:
w0xlt:
ACK 8ebfff0f88
achow101:
ACK 8ebfff0f88
polespinasa:
ACK 8ebfff0f88
pablomartin4btc:
ACK 8ebfff0f88
Tree-SHA512: beb5321adaf871157bda396c8e5740daff95ffe342416914340ae4197accebe60236032d1329876b42405437b99f59079a56ec1e5ac592b753031ba2ebd36cfb
58560c281d ci: remove some packages from Chimera job (fanquake)
Pull request description:
This job doesn't build QT, so drop `ninja` and `xz`.
With libevent removed, and no Qt build, we can also drop `pkgconf`.
ACKs for top commit:
sedited:
ACK 58560c281d
hebasto:
ACK 58560c281d.
Tree-SHA512: 4537c8c77334637ea177321d95ad39ee103ab0080e8331f9fe9efb92a3bb4dc00fb59d2e250fd43c267c05f0a2b98e779949ff40723633c2f2bff345fa554a31