Commit Graph

45555 Commits

Author SHA1 Message Date
Hennadii Stepanov
173394d951 depends: Build qt package for FreeBSD hosts 2025-06-24 12:23:02 +01:00
Sebastian Falbesoner
922adf66ac mempool: use FeeFrac for calculating regular score 2025-06-24 02:49:31 +02:00
Sebastian Falbesoner
3322b3a059 mempool: use FeeFrac for calculating ancestor score 2025-06-24 02:34:29 +02:00
Sebastian Falbesoner
ac9c113bd2 mempool: use FeeFrac for calculating descendant score 2025-06-24 02:23:09 +02:00
merge-script
e95bfc1d53 Merge bitcoin/bitcoin#32797: doc: archive 28.2 release notes
907842363c doc: archive 28.2 release notes (fanquake)

Pull request description:

  v28.2 is now tagged: https://github.com/bitcoin/bitcoin/releases/tag/v28.2.

ACKs for top commit:
  glozow:
    ACK  907842363c

Tree-SHA512: 49cde7ac9bbf08510c1914e5c9e0b80e31333a554318e29c9b61a9975d6d6308dabf5c3d8c736eba7aedee815de95d013f39456716c60cef76f0bc712dd74d6c
2025-06-23 17:50:21 -04:00
Martin Zumsande
666016e56b ci: use --usecli in one of the CI jobs
This helps avoid regressions (changes to functional tests
that are not compatible with -usecli).
2025-06-23 17:42:56 -04:00
Martin Zumsande
7ea248a020 test: Disable several (sub)tests with cli
Reason for each test:
rpc_whitelist.py: Relies on direct RPC calls
wallet_encryption.py: Null characters cannot be passed to suprocess.Popen
wallet_fundrawtransaction.py: multiple checks for wrong types, which have different error messages with cli
wallet_send.py: multiple checks for wrong types
2025-06-23 17:42:56 -04:00
Martin Zumsande
f420b6356b test: skip subtests that check for wrong types with cli
The error messages returned for wrong type differ betwen
using rpc or cli - skip these subtests where they happen.
2025-06-23 17:42:56 -04:00
Martin Zumsande
6530d0015b test: add function to convert to json for height_or_hash params
This is necessary for bitcoin-cli because a string without quotes
is not a valid json.
2025-06-23 17:42:56 -04:00
Martin Zumsande
54d28722ba test: Don't send empty named args with cli
If python passed None for an optional (i.e. 'null' is
sent), this will lead to the arg being interpreted as not
provided by bitcoind - except for string args, for which the arg is
interpreted as as 'null' string. Bypass this by not sending
named args to bitcoin-cli - so that the default value will
actually be used.

Also drops an unnecessary str() conversion, kwargs keys
are always strings.
2025-06-23 17:42:56 -04:00
Martin Zumsande
cca422060e test: convert tuple to json for cli
This makes it possible to run rpc_createmultisig.py with --usecli.
2025-06-23 17:42:56 -04:00
Martin Zumsande
af34e98086 test: make rpc_psbt.py usable with --usecli
The psbt string would include a "=" sign, which would
make the cli interpret this as a named argument.
Fix this by making it an actual named arg with the
correct name.
2025-06-23 17:42:56 -04:00
Martin Zumsande
8f8ce9e174 test: rename .rpc to ._rpc and remove unnecessary uses
It is usually not necessary, and makes it impossible to use --usecli
2025-06-23 17:42:55 -04:00
Martin Zumsande
5b08885986 test: enable functional tests with large rpc args for cli
Also, the following tests (for which self.supports_cli = False was not
set) will now work with --usecli:

feature_fastprune.py
feature_fee_estimation.py
feature_reindex_readonly.py
feature_taproot.py
mempool_package_rbf.py
p2p_net_deadlock.py
p2p_tx_download.py
rpc_packages.py
2025-06-23 17:42:55 -04:00
Martin Zumsande
7d5352ac73 test: use -stdin for large rpc commands
Because of the MAX_ARG_STRLEN limit (128kb on most systems)
for args, these would usually fail. As a workaround, use
-stdin for these large calls. Idea by 0xB10C.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2025-06-23 17:42:55 -04:00
Martin Zumsande
6c364e0c10 test: Enable various tests for usage with cli
These tests run successfully on current master without any changes.
2025-06-23 17:42:55 -04:00
fanquake
907842363c doc: archive 28.2 release notes 2025-06-23 10:15:14 +01:00
merge-script
c5849663ba Merge bitcoin/bitcoin#32771: contrib: tracing: Fix read of pmsg_type in p2p_monitor.py
3473986fe1 contrib: tracing: Correctly read msg type in p2p_monitor.py (David Gumberg)

Pull request description:

  This fixes a bug in the contrib tracing script `p2p_monitor.py`. currently the script fails to read the `msg_type` of inbound and outbound messages, which is useful in the per-peer message view.

  <details>
  <summary>Screenshot of p2p_monitor.py on master</summary>

  ![Screenshot From 2025-06-18 11-37-43](https://github.com/user-attachments/assets/56612088-54d7-465c-b0b6-1b425b919785)
  </details>

  <details>
  <summary>Screenshot of p2p_monitor.py on this branch</summary>

  ![Screenshot From 2025-06-18 11-41-38](https://github.com/user-attachments/assets/4438a483-938c-450b-a12e-6d6909b2c37e)

  </details>

ACKs for top commit:
  yuvicc:
    ACK 3473986fe1
  janb84:
    ut ACK 3473986fe1
  0xB10C:
    ACK 3473986fe1

Tree-SHA512: 94da0dc35072933a20ef693024855b3c382fc6f5ae0a3108d092d7aa5a4004df478f5de07b80f675be13e00f3f4596b0f34c49ec1d8d2c38a15797dcf86c2a56
2025-06-23 09:53:36 +01:00
merge-script
8a36a471e6 Merge bitcoin/bitcoin#32781: refactor: modernize deprecated ipc headers
74b7e9c7db refactor: modernize deprecated ipc headers (Sjors Provoost)

Pull request description:

  Split off from #31802.

  Pre-empt tidy warning when multiprocess is on by default:

  ```
  [10:33:51.654] /ci_container_base/src/ipc/capnp/protocol.cpp:20:10: error: inclusion of deprecated C++ header 'errno.h'; consider using 'cerrno' instead [modernize-deprecated-headers,-warnings-as-errors]
  [10:33:51.654]    20 | #include <errno.h>
  [10:33:51.654]       |          ^~~~~~~~~
  [10:33:51.654]       |          <cerrno>
  [10:33:51.654] 919 warnings generated.
  ```

  https://github.com/bitcoin/bitcoin/pull/31802/checks?check_run_id=43968493627

ACKs for top commit:
  maflcko:
    lgtm ACK 74b7e9c7db
  ryanofsky:
    Code review ACK 74b7e9c7db

Tree-SHA512: a629e9849b420c9de52dc7a74d35ca14c3522784ac101a189b20d3439a4735e2f3bb766864938abb2fc248eb94ec15c71c35db69a3267b6c29ef26e0f91a79ab
2025-06-23 09:48:45 +01:00
Ava Chow
ed060e01e7 Merge bitcoin/bitcoin#32725: test: round difficulty and networkhashps
578ea3eedb test: round difficulty and networkhashps (Sjors Provoost)

Pull request description:

  Both are rational numbers. Client software should only use them to display information to humans. Followup calculations should use the underlying values such as target.

  Therefore it's not necessary to test the handling of these floating point values. Round them down to avoid spurious test failures.

  Fixes #32515

ACKs for top commit:
  Prabhat1308:
    Code Review ACK [`578ea3e`](578ea3eedb)
  achow101:
    ACK 578ea3eedb
  w0xlt:
    Code review ACK 578ea3eedb
  janb84:
    ACK 578ea3eedb

Tree-SHA512: 5fc63c73ad236b7cd55c15da0f1d1e6b45e4289d252147a86717bf77d79f897f42c3e38aa514df6a4a8deca10c87a8710b61b454c533ad56b0daf738365f426c
2025-06-20 16:30:41 -07:00
Ava Chow
daf393b3f1 Merge bitcoin/bitcoin#32642: test: update BIP340 test vectors and implementation (variable-length messages)
b184f5c87c test: update BIP340 test vectors and implementation (variable-length messages) (Sebastian Falbesoner)

Pull request description:

  This PR updates the Schnorr signatures implementation in the functional test framework to the latest BIP changes (see https://github.com/bitcoin/bips/pull/1446,commit 200f9b26fe0a2f235a2af8b30c4be9f12f6bc9cb) and syncs the [test vectors](https://github.com/bitcoin/bips/blob/master/bip-0340/test-vectors.csv) accordingly. Practically, we probably don't need non-32-bytes message signing/verifying any time soon, but it seems good practice anyways to update.

ACKs for top commit:
  stratospher:
    ACK b184f5c.
  achow101:
    ACK b184f5c87c
  real-or-random:
    utACK b184f5c87c
  jonasnick:
    utACK b184f5c87c

Tree-SHA512: b566823aa0f1cd7151215178c57551d772b338d022ccb2807a0df2670df6d59c4b63a6fc936708ccf2922c7e59f474f544adaafc4aea731bfd896250c0d45fa6
2025-06-20 14:45:34 -07:00
Ava Chow
482d255376 Merge bitcoin/bitcoin#32736: wallet: Correct dir iteration error handling
272cd09b79 log: Use warning level while scanning wallet dir (MarcoFalke)
1777644367 qa, wallet: Verify warning when failing to scan (Hodlinator)
893e51ffeb wallet: Correct dir iteration error handling (Hodlinator)

Pull request description:

  Make wallet DB properly detect and report failure to scan wallet directory. Seems to have been broken since moving from Boost to `std::filesystem`.

  Found while reviewing: https://github.com/bitcoin/bitcoin/pull/31410#pullrequestreview-2604068753

ACKs for top commit:
  achow101:
    ACK 272cd09b79
  maflcko:
    re-ACK 272cd09b79 🍽
  rkrux:
    tACK 272cd09b79

Tree-SHA512: 969afde2e37f885ed0c823dc36d2dbeaa0378639849c6a26f8ac67b4f1997eea95bbcae6d58aef5b716807210f37eb166c0cda7ba1d6caffd34249970833af3a
2025-06-20 12:47:28 -07:00
Sjors Provoost
74b7e9c7db refactor: modernize deprecated ipc headers
Co-authored-by: fanquake <fanquake@gmail.com>
2025-06-19 16:29:55 +02:00
merge-script
154b98a7aa Merge bitcoin/bitcoin#32772: fuzz: wallet: remove FundTx from FuzzedWallet
cd1ae1b4df fuzz: wallet: remove FundTx from FuzzedWallet (brunoerg)

Pull request description:

  `FundTx` was used by the `wallet_notifications` target which we recently removed. So it's now unused and can be removed.

ACKs for top commit:
  maflcko:
    lgtm ACK cd1ae1b4df
  kevkevinpal:
    ACK [cd1ae1b](cd1ae1b4df)
  dergoegge:
    utACK cd1ae1b4df

Tree-SHA512: 909cc4c8a0ac2a5f8844993ccf0e725021932888da3591925799145daf9196eadfcd0ebbc74a44f4a245074ded4cb8c3c099513f109ce2681dceff36b5f74bcc
2025-06-19 15:14:18 +01:00
merge-script
fa183045a1 Merge bitcoin/bitcoin#32765: test: Fix list index out of range error in feature_bip68_sequence.py
e285e691b7 test: Fix list index out of range error in feature_bip68_sequence.py (zaidmstrr)

Pull request description:

  Fixes [#32334](https://github.com/bitcoin/bitcoin/issues/32334)

  The test `feature_bip68_sequence.py` fails with `IndexError: list index out of range` error due to a mismatch between the number of inputs requested (at random) and the number of UTXOs available. The error is reproducible with the randomseed:
  ```
  $ ./build/test/functional/feature_bip68_sequence.py --randomseed 6169832640268785903
  ```
  This PR adds a valid upper bound to randomly select the inputs.

ACKs for top commit:
  maflcko:
    lgtm ACK e285e691b7
  Prabhat1308:
    re-ACK [`e285e69`](e285e691b7)
  theStack:
    ACK e285e691b7

Tree-SHA512: 2e5e19d5db2880915f556ed4444abed94e9ceb1ecee5f857df5616040c850dae682aaa4ade3060c48acb16676df92ba81c3af078c1958965e9e874e7bb489388
2025-06-19 15:03:58 +01:00
fanquake
5be31b20e5 lsan: add more Qt suppressions
Using Clang clang version 20.1.6 (Fedora 20.1.6-9.fc43) and:
```bash
export CC=clang
export CXX=clang++
cmake -B build -DBUILD_GUI=ON -DSANITIZERS=address
cmake --build build
export LSAN_OPTIONS="suppressions=/root/bitcoin/test/sanitizer_suppressions/lsan"
ctest --test-dir build
```

```bash
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 1589ms
********* Finished testing of AddressBookTests *********

=================================================================
==21869==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0xaaaab5d5af40 in operator new(unsigned long) (/root/bitcoin/build/bin/test_bitcoin-qt+0x39af40) (BuildId: c0e038f1c507ea6860d1cfd499ac54ad83359872)
    #1 0xffff8c8f56cc in QLayoutPrivate::createWidgetItem(QLayout const*, QWidget*) (/lib64/libQt6Widgets.so.6+0x1a56cc) (BuildId: 8b7b9e470f4d4cd920282a4f963abb01225814fa)
    #2 0xffff8c8d2f90 in QBoxLayout::insertWidget(int, QWidget*, int, QFlags<Qt::AlignmentFlag>) (/lib64/libQt6Widgets.so.6+0x182f90) (BuildId: 8b7b9e470f4d4cd920282a4f963abb01225814fa)
    #3 0xaaaab5fc7188 in SendCoinsDialog::addEntry() /root/bitcoin/build/src/qt/./qt/sendcoinsdialog.cpp:596:18
    #4 0xaaaab5fc4eec in SendCoinsDialog::SendCoinsDialog(PlatformStyle const*, QWidget*) /root/bitcoin/build/src/qt/./qt/sendcoinsdialog.cpp:84:5
    #5 0xaaaab5da67ac in (anonymous namespace)::MiniGUI::MiniGUI(interfaces::Node&, PlatformStyle const*) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:235:75
    #6 0xaaaab5da2000 in (anonymous namespace)::TestGUI(interfaces::Node&, std::shared_ptr<wallet::CWallet> const&) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:270:13
    #7 0xaaaab5d9ebc8 in (anonymous namespace)::TestGUI(interfaces::Node&) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:453:5
    #8 0xaaaab5d9ebc8 in WalletTests::walletTests() /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:475:5
    #9 0xffff8b1c5314 in QMetaMethodInvoker::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) (/lib64/libQt6Core.so.6+0x195314) (BuildId: eacb2d1228362560e5df1a1ce496c99ad61960e7)
    #10 0xffff8b1c5dc8 in QMetaMethod::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) (/lib64/libQt6Core.so.6+0x195dc8) (BuildId: eacb2d1228362560e5df1a1ce496c99ad61960e7)
    #11 0xffff8cf57c54  (/lib64/libQt6Test.so.6+0x27c54) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #12 0xffff8cf5fa18  (/lib64/libQt6Test.so.6+0x2fa18) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #13 0xffff8cf6067c  (/lib64/libQt6Test.so.6+0x3067c) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #14 0xffff8cf610a4  (/lib64/libQt6Test.so.6+0x310a4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #15 0xffff8cf61aa4 in QTest::qRun() (/lib64/libQt6Test.so.6+0x31aa4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #16 0xffff8cf61eb4 in QTest::qExec(QObject*, int, char**) (/lib64/libQt6Test.so.6+0x31eb4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #17 0xaaaab5d7d77c in main /root/bitcoin/build/src/qt/test/./qt/test/test_main.cpp:95:30
    #18 0xffff8aad6398 in __libc_start_call_main (/lib64/libc.so.6+0x26398) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)
    #19 0xffff8aad6478 in __libc_start_main@GLIBC_2.17 (/lib64/libc.so.6+0x26478) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)
    #20 0xaaaab5c74cac in _start (/root/bitcoin/build/bin/test_bitcoin-qt+0x2b4cac) (BuildId: c0e038f1c507ea6860d1cfd499ac54ad83359872)
```

This happens when building using depends:
```bash
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0xaaaabdbe86f8 in malloc (/root/bitcoin/build/bin/test_bitcoin-qt+0x4386f8) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #1 0xfbff97f8c164  (<unknown module>)
    #2 0xaaaabf0cfaa4 in QDBusConnectionPrivate::QDBusConnectionPrivate() (/root/bitcoin/build/bin/test_bitcoin-qt+0x191faa4) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #3 0xaaaabf0c9e30 in QDBusConnectionManager::doConnectToStandardBus(QDBusConnection::BusType, QString const&, bool) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1919e30) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #4 0xaaaabf0cb0e4 in QtPrivate::QCallableObject<QDBusConnectionPrivate* (QDBusConnectionManager::*)(QDBusConnection::BusType, QString const&, bool), QtPrivate::List<QDBusConnection::BusType&, QString const&, bool&>, QDBusConnectionPrivate*>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x191b0e4) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #5 0xaaaabf5cbaf0 in QObject::event(QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1e1baf0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #6 0xaaaabf5a4ce0 in QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df4ce0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #7 0xaaaabf5a486c in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df486c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #8 0xaaaabf5a575c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df575c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #9 0xaaaabf66b858 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1ebb858) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #10 0xaaaabf5a9e3c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df9e3c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #11 0xaaaabf632a44 in QThread::exec() (/root/bitcoin/build/bin/test_bitcoin-qt+0x1e82a44) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #12 0xaaaabf0c9bd0 in QDBusConnectionManager::run() (/root/bitcoin/build/bin/test_bitcoin-qt+0x1919bd0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #13 0xaaaabf669c30 in QThreadPrivate::start(void*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1eb9c30) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #14 0xaaaabdbe5f2c in asan_thread_start(void*) asan_interceptors.cpp.o
    #15 0xffff99538608 in thread_start (/lib64/libc.so.6+0xf8608) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)

SUMMARY: AddressSanitizer: 3592 byte(s) leaked in 37 allocation(s).
```
2025-06-19 14:15:33 +01:00
merge-script
e18322eff2 Merge bitcoin/bitcoin#32774: doc: Explain how to fetch commits directly
fa94fd53c9 doc: Explain how to fetch commits directly (MarcoFalke)

Pull request description:

  This is often needed, and works better than the existing refspec documentation, because even commits that have been force-pushed away can be fetched (as long as they are not garbage collected on the remote).

ACKs for top commit:
  Sjors:
    ACK fa94fd53c9
  l0rinc:
    ACK fa94fd53c9
  willcl-ark:
    ACK fa94fd53c9
  rkrux:
    ACK fa94fd53c9
  janb84:
    ACK fa94fd53c9

Tree-SHA512: b68c0c612e13f501ad4c1c709502e060b0a2d0eb55ef888c7466e2a10bdf3ca63d81b8bd7927de49cde9e29f0b06f8233d51b99d015ae0b39d556854be542b8a
2025-06-19 12:32:30 +01:00
merge-script
b861419254 Merge bitcoin/bitcoin#32777: doc: fix Transifex 404s
53a996f122 doc: fix transifex 404s (fanquake)

Pull request description:

  https://www.transifex.com/bitcoin/bitcoin/ is now a 404.

ACKs for top commit:
  maflcko:
    lgtm ACK 53a996f122
  hebasto:
    ACK 53a996f122, I've verified all the links.

Tree-SHA512: 8e698c83095a3d3a225b0bf2ee9c39ad434b2917ead4271ff39a282cea6283710091d1e8b91edafd280bf356dec2bdbe42981aafe4d64f623a975232c5ca848c
2025-06-19 11:43:55 +01:00
merge-script
79afe6b7c0 Merge bitcoin/bitcoin#32776: doc: taproot became always active in v24.0 (doc/bips.md)
8ee8a951c2 doc: taproot became always active in v24.0 (Sjors Provoost)

Pull request description:

  Split from #26201.

ACKs for top commit:
  maflcko:
    lgtm ACK 8ee8a951c2
  janb84:
    ACK 8ee8a951c2

Tree-SHA512: 1ac6994c6775ca5423f022d1e02e3d531fb7fa295be9940355b8aa9d173787a8d65945a0cf976ab344bcaa3ea8a0f3aa6f8da851325bf475e59375981b115cab
2025-06-19 11:40:47 +01:00
fanquake
53a996f122 doc: fix transifex 404s 2025-06-19 11:22:14 +01:00
Sjors Provoost
8ee8a951c2 doc: taproot became always active in v24.0 2025-06-19 11:15:00 +02:00
MarcoFalke
fa21631595 test: Use self.log
This is in line with all other functional tests.
2025-06-19 09:00:26 +02:00
MarcoFalke
fa346f7797 test: Move error string into exception
This is normally expected and also less code.
2025-06-19 09:00:22 +02:00
MarcoFalke
fa1986181f test: Remove useless catch-throw
This is not done anywhere else in the tests for open or subprocess.run
2025-06-19 09:00:05 +02:00
MarcoFalke
fa94fd53c9 doc: Explain how to fetch commits directly 2025-06-19 08:33:43 +02:00
Ava Chow
9a7eece5a4 Merge bitcoin/bitcoin#31981: Add checkBlock() to Mining interface
a18e572328 test: more template verification tests (Sjors Provoost)
10c908808f test: move gbt proposal mode tests to new file (Sjors Provoost)
94959b8dee Add checkBlock to Mining interface (Sjors Provoost)
6077157531 ipc: drop BlockValidationState special handling (Sjors Provoost)
74690f4ed8 validation: refactor TestBlockValidity (Sjors Provoost)

Pull request description:

  This PR adds the IPC equivalent of the `getblocktemplate` RPC in `proposal` mode.

  In order to do so it has `TestBlockValidity` return error reasons as a string instead of `BlockValidationState`. This avoids complexity in IPC code for handling the latter struct.

  The new Mining interface method is used in `miner_tests`.

  It's not used by the `getblocktemplate` and `generateblock` RPC calls, see https://github.com/bitcoin/bitcoin/pull/31981#discussion_r2096473337

  The `inconclusive-not-best-prevblk` check is moved from RPC
  code to `TestBlockValidity`.

  Test coverage is increased by `mining_template_verification.py`.

  Superseedes #31564

  ## Background

  ### Verifying block templates (no PoW)

  Stratum v2 allows miners to generate their own block template. Pools may wish (or need) to verify these templates. This typically involves comparing mempools, asking miners to providing missing transactions and then reconstructing the proposed block.[^0] This is not sufficient to ensure a proposed block is actually valid. In some schemes miners could take advantage of incomplete validation[^1].

  The Stratum Reference Implementation (SRI), currently the only Stratum v2 implementation, collects all missing mempool transactions, but does not yet fully verify the block.[^2]. It could use the `getblocktemplate` RPC in `proposal` mode, but using IPC is more performant, as it avoids serialising up to 4 MB of transaction data as JSON.

  (although SRI could use this PR, the Template Provider role doesn't need it, so this is _not_ part of #31098)

  [^0]: https://github.com/stratum-mining/sv2-spec/blob/main/06-Job-Declaration-Protocol.md
  [^1]: https://delvingbitcoin.org/t/pplns-with-job-declaration/1099/45?u=sjors
  [^2]: https://github.com/stratum-mining/stratum/blob/v1.1.0/roles/jd-server/src/lib/job_declarator/message_handler.rs#L196

ACKs for top commit:
  davidgumberg:
    reACK a18e572328
  achow101:
    ACK a18e572328
  TheCharlatan:
    ACK a18e572328
  ryanofsky:
    Code review ACK a18e572328 just adding another NONFATAL_UNREACHABLE since last review

Tree-SHA512: 1a6c29f45a1666114f10f55aed155980b90104db27761c78aada4727ce3129e6ae7a522d90a56314bd767bd7944dfa46e85fb9f714370fc83e6a585be7b044f1
2025-06-18 17:07:21 -07:00
w0xlt
8cc9845b8d wallet, rpc: Use OUTPUT_TYPES to describe the output types instead of hardcoding them 2025-06-18 18:11:28 -03:00
David Gumberg
3473986fe1 contrib: tracing: Correctly read msg type in p2p_monitor.py 2025-06-18 11:35:06 -07:00
brunoerg
cd1ae1b4df fuzz: wallet: remove FundTx from FuzzedWallet 2025-06-18 11:11:25 -03:00
MarcoFalke
fa68dcb207 ci: Add missing errexit to lint CI install
Otherwise, a possible failure is silently ignored.

Also, rename the file, while touching it, to clarify installing is the
first step.
2025-06-18 14:11:11 +02:00
MarcoFalke
fa535a6de7 ci: Allow running CI in worktrees 2025-06-18 10:23:45 +02:00
MarcoFalke
faf6a04597 ci: Clean UID/GID mismatch
rsync --archive will preserve owner and group, which is then required to
be handled by adding a git safe.directory workaround.

Remove the need for the workaround by only preserving permissions during
the recursive rsync copy.
2025-06-18 10:22:53 +02:00
Ava Chow
9eb2c82e7c walletdb: Remove unused upgraded_txs 2025-06-17 17:41:46 -07:00
Ava Chow
c668033709 wallet: Remove unused fTimeReceivedIsTxTime
fTimeReceivedIsTxTime has been unused unused since 0.3.24
2025-06-17 17:41:43 -07:00
Ryan Ofsky
5e6dbfd14e Merge bitcoin/bitcoin#32465: thread-safety: fix annotations with REVERSE_LOCK
a201a99f8c thread-safety: fix annotations with REVERSE_LOCK (Cory Fields)
aeea5f0ec1 thread-safety: add missing lock annotation (Cory Fields)
832c57a534 thread-safety: modernize thread safety macros (Cory Fields)

Pull request description:

  This is one of several PRs to cleanup/modernize our threading primitives.

  While replacing the old critical section locks in the mining code with a `REVERSE_LOCK`, I noticed that our thread-safety annotations weren't hooked up to it. This PR gets `REVERSE_LOCK` working properly.

  Firstly it modernizes the attributes as-recommended by the [clang docs](https://clang.llvm.org/docs/ThreadSafetyAnalysis.html) (ctrl+f for `USE_LOCK_STYLE_THREAD_SAFETY_ATTRIBUTES`). There's a subtle difference between the old `unlock_function` and new `release_capability`, where our `reverse_lock` only works with the latter. I believe this is an upstream bug. I've [reported and attempted a fix here](https://github.com/llvm/llvm-project/pull/139343), but either way it makes sense to me to modernize.

  The second adds a missing annotation pointed out by a fixed `REVERSE_LOCK`. Because clang's thread-safety annotations aren't passed through a reference to `UniqueLock` as one may assume (see [here](https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#no-alias-analysis) for more details), `cs_main` has to be listed explicitly as a requirement.

  The last commit actually fixes the `reverse_lock` by making it a `SCOPED_LOCK` and using the pattern [found in a clang test](https://github.com/llvm/llvm-project/blob/main/clang/test/SemaCXX/warn-thread-safety-analysis.cpp#L3126). Though the docs don't describe how to accomplish it, the functionality was added [in this commit](6a68efc959). Due to aliasing issues (see link above), in order to work correctly, the original mutex has to be passed along with the lock, so all existing `REVERSE_LOCK`s have been updated. To ensure that the mutexes actually match, a runtime assertion is added.

ACKs for top commit:
  fjahr:
    re-ACK a201a99f8c
  davidgumberg:
    reACK a201a99f8c
  theuni:
    Ok, done. Those last pushes can be ignored. ACKs on a201a99 are still fresh.
  ryanofsky:
    Code review ACK a201a99f8c. Just dropping 0065b9673db5da2994b0b07c1d50ebfb19af39d0 and fixing incorrect `reverse_lock::lockname` initialization since last review.
  TheCharlatan:
    Re-ACK a201a99f8c

Tree-SHA512: 2755fae0c41021976a1a633014a86d927f104ccbc8014c01c06dae89af363f92e5bc5d4276ad6d759302ac4679fe02a543758124d48318074db1c370989af7a7
2025-06-17 14:12:43 -04:00
zaidmstrr
e285e691b7 test: Fix list index out of range error in feature_bip68_sequence.py 2025-06-17 20:38:21 +05:30
Ava Chow
1be688f575 Merge bitcoin/bitcoin#32682: wallet: have external signer use PSBT error code EXTERNAL_SIGNER_NOT_FOUND
9dfc61d95f test: detect no external signer connected (Sjors Provoost)
0a4ee93529 wallet: use PSBTError::EXTERNAL_SIGNER_NOT_FOUND (Sjors Provoost)
8ba2f9b7c8 refactor: use util::Result for GetExternalSigner() (Sjors Provoost)

Pull request description:

  When attempting to sign a transaction involving an external signer, if the device isn't connected we throw an `std::runtime_error`. This prevents the (mainly GUI) code that's actually supposed to handle this case from running.

  This PR returns a `PSBTError::EXTERNAL_SIGNER_NOT_FOUND` instead of throwing.

  The first commit is a refactor to have `GetExternalSigner()` return a `util::Result<ExternalSigner>` so the caller can decide how to handle the error. There are two other places where call `GetExternalSigner()` which this PR doesn't change (which I think is fine there).

  Before:
  ![before](https://github.com/user-attachments/assets/2e08863b-fe76-479f-9cc0-60571b357a27)

  After (the translation already exist):
  ![after](https://github.com/user-attachments/assets/0e91c7ed-7d44-4030-beec-20d1694c270c)

  Fixes #32426

  Additionally use `LogWarning` instead of `std::cerr` for both a missing signer and failure to sign.

ACKs for top commit:
  achow101:
    ACK 9dfc61d95f
  brunoerg:
    code review ACK 9dfc61d95f

Tree-SHA512: 22515f4f0b4f50cb0ef532b729e247f11a68be9c90e384942d4277087b2e76806a1cdaa57fb51d5883dacf0a428e5279674aab37cce8c0d3d7de0f96346b8233
2025-06-16 17:32:57 -07:00
Cory Fields
a201a99f8c thread-safety: fix annotations with REVERSE_LOCK
Without proper annotations, clang thinks that mutexes are still held for the
duration of a reverse_lock. This could lead to subtle bugs as
EXCLUSIVE_LOCKS_REQUIRED(foo) passes when it shouldn't.

As mentioned in the docs [0], clang's thread-safety analyzer is unable to deal
with aliases of mutexes, so it is not possible to use the lock's copy of the
mutex for that purpose. Instead, the original mutex needs to be passed back to
the reverse_lock for the sake of thread-safety analysis, but it is not actually
used otherwise.

[0]: https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
2025-06-16 18:09:14 +00:00
Ryan Ofsky
26747d9f3e Merge bitcoin/bitcoin#32760: depends: capnp 1.2.0
c7eaac326a depends: capnp 1.2.0 (fanquake)

Pull request description:

  See https://github.com/capnproto/capnproto/compare/release-1.1.0...release-1.2.0. We can drop all the patches we are currently applying.

ACKs for top commit:
  Sjors:
    ACK c7eaac326a
  theStack:
    ACK c7eaac326a
  ryanofsky:
    Code review ACK c7eaac326a. Just checked hashes, compared tarball to git and diffed 1.1.0 and 1.2.0 tarballs which showed only minor and expected changes.

Tree-SHA512: 75085ec96952e9693c67531c3d04cd0d7df580dd1df35ce50dff618b29f651674c17a84e9089c6b7ed230e2b4fd0a7f24e2220e983ec00235db9a9d1ee2d7116
2025-06-16 12:58:25 -04:00
Vasil Dimov
c10e382d2a flatfile: check whether the file has been closed successfully 2025-06-16 15:33:19 +02:00