Commit Graph

6916 Commits

Author SHA1 Message Date
Ava Chow
fa1f4feac4 Merge bitcoin/bitcoin#34965: cli: Return more helpful authentication errors
257769a7ce qa: Improve error message (Hodlinator)
20a94c1524 cli: Clearer error messages on authentication failure (Hodlinator)
84c3f8d325 refactor(rpc): GenerateAuthCookieResult -> AuthCookieResult (Hodlinator)

Pull request description:

  Increases precision of error messages to help the user correct authentication issues.

  Inspired by #34935.

ACKs for top commit:
  davidgumberg:
    utACK 257769a7ce
  maflcko:
    review ACK 257769a7ce 🦇
  achow101:
    ACK 257769a7ce
  janb84:
    concept ACK 257769a7ce

Tree-SHA512: 1799db4b2c0ab3b67ed3d768da08c6be4f4beaad91a77406884b73950b420c8264c70b8e60a26a9e6fac058370f6accdb73c821d19bebb6edfbc8d7b84d01232
2026-04-02 15:55:28 -07:00
Ava Chow
8cc690ea9b Merge bitcoin/bitcoin#34379: wallet: fix gethdkeys RPC for descriptors with partial xprvs
43c528aba9 wallet, test: update `gethdkeys` functional test (rkrux)
6e3a0afc2f wallet: fix `gethdkeys` RPC for descriptors with partial xprvs (rkrux)

Pull request description:

  Fixes #34378

  A non-watch-only wallet allows to import descriptors with partial private keys, eg: a multisig descriptor with one private key and one public key. In case an xpub is imported in any such descriptors whose private key the wallet doesn't have, then the `gethdkeys` RPC throws an unhandled error like below when the private keys are requested.

  This fix ensures that such calls are properly handled by conditionally finding the corresponding xprv and the related functional test is accordingly updated.

  ```
  ➜ bitcoincli -named gethdkeys private=true
  error code: -1
  error message:
  map::at:  key not found
  ```

ACKs for top commit:
  achow101:
    ACK 43c528aba9
  w0xlt:
    ACK 43c528aba9
  Eunovo:
    Tested ACK 43c528aba9

Tree-SHA512: 106e02ee368a3fa94d116f54f2fa71f9886e4753e331b91ce13a346559d5497ef6cd7ddaa8736fcfe1a7ac427a44d647fb75e523eb72f917fa866adbe0dbad30
2026-04-01 14:32:49 -07:00
merge-script
5deed3deab Merge bitcoin/bitcoin#34958: test: mining: add coverage for GBT's "coinbasevalue" result field
12c3c3f81d test: mining: add coverage for GBT's "coinbasevalue" result field (Sebastian Falbesoner)

Pull request description:

  This PR adds missing coverage for the "coinbasevalue" result field of the `getblocktemplate` RPC call. Specifically, the introduced test checks that the value is set to claim the full block reward (subsidy plus fees). Can be verified with the following patch, which succeeds on master and fails on the PR branch:

  ```diff
  diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
  index a935810d91..ba9ac9dadb 100644
  --- a/src/rpc/mining.cpp
  +++ b/src/rpc/mining.cpp
  @@ -998,7 +998,7 @@ static RPCHelpMan getblocktemplate()
       result.pushKV("previousblockhash", block.hashPrevBlock.GetHex());
       result.pushKV("transactions", std::move(transactions));
       result.pushKV("coinbaseaux", std::move(aux));
  -    result.pushKV("coinbasevalue", block.vtx[0]->vout[0].nValue);
  +    result.pushKV("coinbasevalue", block.vtx[0]->vout[0].nValue - 1);
       result.pushKV("longpollid", tip.GetHex() + ToString(nTransactionsUpdatedLast));
       result.pushKV("target", hashTarget.GetHex());
       result.pushKV("mintime", GetMinimumTime(pindexPrev, consensusParams.DifficultyAdjustmentInterval()));

  ```

  I'm not sure how relevant this field is nowadays in real-world mining scenarios (we use it for the signet miner at least), but it seems useful to have a test for it anyways. Stumbled upon this while looking at https://github.com/bitcoin-inquisition/bitcoin/pull/111.

ACKs for top commit:
  maflcko:
    lgtm ACK 12c3c3f81d
  Sjors:
    ACK 12c3c3f81d

Tree-SHA512: ae10f63c99b21cf7771feefe3d0e47b2e0d511aceb344cf11efa9182d78f2960f1e079797b8a36db110a3c54acb27a3706413a710a74bf56aed29ea162a6aab2
2026-03-31 23:57:26 +08:00
Hodlinator
257769a7ce qa: Improve error message 2026-03-31 12:25:06 +02:00
Hodlinator
20a94c1524 cli: Clearer error messages on authentication failure
Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
2026-03-31 12:25:05 +02:00
Ava Chow
c97ac44c34 Merge bitcoin/bitcoin#32297: bitcoin-cli: Add -ipcconnect option
4565cff72c bitcoin-gui: Implement missing Init::makeMining method (Ryan Ofsky)
fbea576c26 test: add interface_ipc_cli.py testing bitcoin-cli -ipcconnect (Ryan Ofsky)
0448a19b1b ipc: Improve -ipcconnect error checking (Ryan Ofsky)
8d614bfa47 bitcoin-cli: Add -ipcconnect option (Ryan Ofsky)
6a54834895 ipc: Expose an RPC interface over the -ipcbind socket (Ryan Ofsky)
df76891a3b refactor: Add ExecuteHTTPRPC function (Ryan Ofsky)
3cd1cd3ad3 ipc: Add MakeBasicInit function (Ryan Ofsky)

Pull request description:

  This implements an idea from sipa in https://github.com/bitcoin/bitcoin/issues/28722#issuecomment-2807026958 to allow `bitcoin-cli` to connect to the node via IPC instead of TCP, if the ENABLE_IPC cmake option is enabled and the node has been started with `-ipcbind`.

  This feature can be tested with:

  ```
  build/bin/bitcoin-node -regtest -ipcbind=unix -debug=ipc
  build/bin/bitcoin-cli -regtest -ipcconnect=unix -getinfo
  ```

  The -ipconnect parameter can also be omitted, since this change also makes `bitcoin-cli` prefer IPC over HTTP by default, and falling back to HTTP if an IPC connection can't be established.

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/issues/28722).

ACKs for top commit:
  achow101:
    ACK 4565cff72c
  pinheadmz:
    ACK 4565cff72c
  enirox001:
    Tested ACK 4565cff72c

Tree-SHA512: cb0dc521d82591e4eb2723a37ae60949309a206265e0ccfbee1f4d59b426b770426fafa1e842819a2fa27322ecdfcd226f31da70f91c2c31b8095e1380666f1f
2026-03-30 15:12:04 -07:00
Sebastian Falbesoner
12c3c3f81d test: mining: add coverage for GBT's "coinbasevalue" result field
Add missing test coverage for the `getblocktemplate` RPC call
"coinbasevalue" field, specifically that it is set to claim the
full block reward.
2026-03-30 19:05:08 +02:00
merge-script
550f603025 Merge bitcoin/bitcoin#34382: test: wallet: Check fallbackfee default argument behavior.
3dcdb2b9ba test: wallet: Warning for excessive fallback fee. (David Gumberg)
6664e41e56 test: wallet: -fallbackfee default is 0 (David Gumberg)
d28c989243 test: wallet: refactor: fallbackfee extract common send failure checks. (David Gumberg)

Pull request description:

  In an unmerged branch of #32636 (097e00f907) I unintentionally broke default `-fallbackfee` behavior, but this was not caught by any tests. See https://github.com/bitcoin/bitcoin/pull/32636#discussion_r2706102550.

  Something like the following diff does not cause any test failures on master despite causing a behavior change:

  ```diff
  diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
  index bc27018cd2..079610fba0 100644
  --- a/src/wallet/wallet.cpp
  +++ b/src/wallet/wallet.cpp
  @@ -3048,24 +3048,24 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
       if (const auto arg{args.GetArg("-fallbackfee")}) {
           std::optional<CAmount> fallback_fee = ParseMoney(*arg);
           if (!fallback_fee) {
               error = strprintf(_("Invalid amount for %s=<amount>: '%s'"), "-fallbackfee", *arg);
               return nullptr;
           } else if (fallback_fee.value() > HIGH_TX_FEE_PER_KB) {
               warnings.push_back(AmountHighWarn("-fallbackfee") + Untranslated(" ") +
                                  _("This is the transaction fee you may pay when fee estimates are not available."));
           }
           walletInstance->m_fallback_fee = CFeeRate{fallback_fee.value()};
  +        // Disable fallback fee in case value was set to 0, enable if non-null value
  +        walletInstance->m_allow_fallback_fee = walletInstance->m_fallback_fee.GetFeePerK() != 0;
       }

  -    // Disable fallback fee in case value was set to 0, enable if non-null value
  -    walletInstance->m_allow_fallback_fee = walletInstance->m_fallback_fee.GetFeePerK() != 0;
  ```

  This PR adds a functional test check that when no `-fallbackfee` argument is set and fee estimation is not possible, that sending fails because `-fallbackfee` is disabled by default.

ACKs for top commit:
  maflcko:
    review ACK 3dcdb2b9ba 🐞
  w0xlt:
    reACK 3dcdb2b9ba
  ismaelsadeeq:
    reACK 3dcdb2b9ba 👾

Tree-SHA512: 715625673a781ba3ddfed25f0836b01c2197480bd56732fd1ce548e8969573c2a36601de0b8913b3b79a47b8149022aabcf409b62297e7c2c47b68a8843e6570
2026-03-30 19:50:19 +08:00
Ava Chow
21da421b42 Merge bitcoin/bitcoin#34439: qa: Drop recursive deletes from test code, add lint checks.
0d1301b47a test: functional: drop rmtree usage and add lint check (David Gumberg)
8bfb422de8 test: functional: drop unused --keepcache argument (David Gumberg)
a7e4a59d6d qa: Remove all instances of `remove_all` except test cleanup (David Gumberg)

Pull request description:

  Both `fs::remove_all` and `shutil::rmtree()` are a bit dangerous, and most of their uses are not necessary, this PR removes most instances of both.

  `remove_all()` is still used in in `src/test/util/setup_common.cpp` as part of `BasicTestingSetup::BasicTestingSetup`'s constructor and destructor, and it is used in the kernel test code's [`TestDirectory`](4ae00e9a71/src/test/kernel/test_kernel.cpp (L100-L112)):

  734899a4c4/src/test/kernel/test_kernel.cpp (L100-L112)

  In both cases, `remove_all` is likely necessary, but the kernel's test code is RAII, ideally `BasicTestingSetup` could be made similar in a follow-up or in this PR if reviewers think it is important.

  Similarly in the python code, most usage was unnecessary, but there are a few places where `rmtree()` was necessary, I have added sanity checks to make sure these are inside of the `tmpdir` before doing recursive delete there.

ACKs for top commit:
  achow101:
    ACK 0d1301b47a
  hodlinator:
    ACK 0d1301b47a
  sedited:
    ACK 0d1301b47a

Tree-SHA512: da8ca23846b73eff0eaff61a5f80ba1decf63db783dcd86b25f88f4862ae28816fc9e2e9ee71283ec800d73097b1cfae64e3c5ba0e991be69c200c6098f24d6e
2026-03-26 13:05:01 -07:00
David Gumberg
3dcdb2b9ba test: wallet: Warning for excessive fallback fee. 2026-03-25 19:51:09 -07:00
David Gumberg
6664e41e56 test: wallet: -fallbackfee default is 0
Also check more RPC's for success and check that we are using
`-fallbackfee`.
2026-03-25 19:51:07 -07:00
David Gumberg
d28c989243 test: wallet: refactor: fallbackfee extract common send failure checks. 2026-03-25 19:48:45 -07:00
David Gumberg
0d1301b47a test: functional: drop rmtree usage and add lint check
`shutil.rmtree` is dangerous because it recursively deletes. There are
not likely to be any issues with it's current uses, but it is possible
that some of the assumptions being made now won't always be true, e.g.
about what some of the variables being passed to `rmtree` represent.

For some remaining uses of rmtree that can't be avoided for now, use
`cleanup_dir` which asserts that the recursively deleted folder is a
child of the the `tmpdir` of the test run. Otherwise,
`tempfile.TemporaryDirectory` should be used which does it's own
deleting on being garbage collected, or old fashioned unlinking and
rmdir in the case of directories with known contents.
2026-03-24 16:06:35 -07:00
David Gumberg
8bfb422de8 test: functional: drop unused --keepcache argument
At the time this was added in  #10197, building the test cache took 21
seconds, as described in that PR, but this is no longer true, as
demonstrated by running the functional test framework with and without
the --keepcache arguments on master prior to this commit:

```
hyperfine   --warmup 1  --export-markdown results.md --runs 3 \
    -n 'without --keepcache'    './build/test/functional/test_runner.py -j $(nproc)' \
    -n 'with --keepcache'       './build/test/functional/test_runner.py -j $(nproc) --keepcache'
```

| Command               | Mean [s]       | Min [s] | Max [s] | Relative |
|:----------------------|---------------:|--------:|---:|---:|
| `without --keepcache` | 76.373 ± 3.058 | 74.083  | 79.846  | 1.00 |
| `with --keepcache`    | 77.384 ± 1.836 | 75.952  | 79.454  | 1.01 ± 0.05 |

As a consequence, this argument can be removed from the test runner and
this also has the benefit of being able to use an RAII-like
`tempfile.TemporaryDirectory` instead of having to clean up the cache
manually at the end of test runs.

bitcoin/bitcoin#10197: https://github.com/bitcoin/bitcoin/pull/10197
2026-03-24 16:03:02 -07:00
Ava Chow
bfc84eb2ea Merge bitcoin/bitcoin#33259: rpc, logging: add backgroundvalidation to getblockchaininfo
25f69d970a release note (Pol Espinasa)
af629821cf test: add background validation test for getblockchaininfo (Pol Espinasa)
a3d6f32a39 rpc, log: add backgroundvalidation to getblockchaininfo (Pol Espinasa)
5b2e4c4a88 log: update progress calculations for background validation (Pol Espinasa)

Pull request description:

  `getblockchaininfo` returns `verificationprogress=1` and `initialblockdownload=false` even if there's background validation.
  This PR adds information about background validation to rpc `getblockchaininfo` in a similar way to `validationprogress` does.

  If assume utxo was used the output of a "sync" node performing background validation:
  ```
  $ ./build/bin/bitcoin-cli getblockchaininfo
  ...
    "mediantime": 1756933740,
    "verificationprogress": 1,
    "initialblockdownload": false,
    "backgroundvalidation": {
      "snapshotheight": 880000,
      "blocks": 527589,
      "bestblockhash": "0000000000000000002326308420fa5ccd28a9155217f4d1896ab443d84148fa",
      "mediantime": 1529076654,
      "chainwork": "0000000000000000000000000000000000000000020c92fab9e5e1d8ed2d8dbc",
      "verificationprogress": 0.2815790617966284
    },
    "chainwork": "0000000000000000000000000000000000000000df97866c410b0302954919d2",
    "size_on_disk": 61198817285,

  ...
  ```

  If assume utxo was not used the progress is hidden:
  ```
  $ ./build/bin/bitcoin-cli getblockchaininfo
  ...
    "mediantime": 1756245700,
    "verificationprogress": 1,
    "initialblockdownload": false,
    "chainwork": "00000000000000000000000000000000000000000000000000000656d6bb052b",
    "size_on_disk": 3964972194,
  ...
  ```

  The PR also updates the way we estimate the verification progress returning a 100% on the snapshot block and not on the tip as we will stop doing background validation when reaching it.

ACKs for top commit:
  fjahr:
    ACK 25f69d970a
  danielabrozzoni:
    ACK 25f69d970a
  achow101:
    ACK 25f69d970a
  sedited:
    ACK 25f69d970a

Tree-SHA512: 5e5e08fd39af5f764962b862bc6d8257b0d2175fe920d4b79dc5105578fd4ebe08aee2fe9bfa5c9cad5d7610197a435ebaac0de23e7a5efa740dfea031a8a9d4
2026-03-24 14:36:09 -07:00
Ava Chow
4ecf473c36 Merge bitcoin/bitcoin#34727: test: Add IPC wake-up test and reuse mining context
ad75b147b5 test: scale IPC mining wait timeouts by timeout_factor (Enoch Azariah)
e7a918b69a test: verify IPC error handling for invalid coinbase (Enoch Azariah)
63684d6922 test: move make_mining_ctx to ipc_util.py (Enoch Azariah)
4ada575d6c test: verify createNewBlock wakes promptly when tip advances (Enoch Azariah)

Pull request description:

  This is a follow-up to implement a couple of test improvements discussed in recent IPC PRs and issues.

  - adds a test to `interface_ipc_mining.py` to verify that `createNewBlock` wakes up immediately when the tip advances, rather than waiting for the cooldown timer to expire (https://github.com/bitcoin/bitcoin/pull/34184#discussion_r2842239399).
  - moves `make_mining_ctx` into `ipc_util.py` so it can be reused across the IPC tests instead of duplicating the setup code (https://github.com/bitcoin/bitcoin/pull/34422#discussion_r2852445430).
  - adds a test case to verify that providing an invalid coinbase to `submitSolution` returns a remote exception instead of crashing the node, closing the loop on the issue reported in #33341.
  - scales IPC wait timeouts using the test suite's `timeout_factor` to prevent spurious failures in heavily loaded CI environments, capping extended waits to avoid test runner hangs (bitcoin-core/libmultiprocess#253 (comment)).

  Closes #33341.

ACKs for top commit:
  Sjors:
    ACK ad75b147b5
  achow101:
    ACK ad75b147b5
  sedited:
    ACK ad75b147b5

Tree-SHA512: 812aa64c03657761f06707e6a15b8b435ab7c75717a6748a919fcbcae317128e18403b0c1bddd4cdad877d286e69db52389633e4012faaa656acc01939091719
2026-03-24 13:34:30 -07:00
Pol Espinasa
af629821cf test: add background validation test for getblockchaininfo 2026-03-24 15:51:24 +01:00
Pol Espinasa
a3d6f32a39 rpc, log: add backgroundvalidation to getblockchaininfo 2026-03-24 15:51:24 +01:00
merge-script
16613c9de9 Merge bitcoin/bitcoin#34857: test: Remove confusing assert_debug_log in wallet_reindex.py
fa30951af5 test: Remove confusing assert_debug_log in wallet_reindex.py (MarcoFalke)

Pull request description:

  The `wallet_reindex.py` test has many issues:

  * It uses a `assert_debug_log` to ensure the reindex happened via `initload thread exit`. However, no other test uses this pattern, because `restart_node` already achieves the same internally (via `getmempoolinfo.loaded`).
  * The `assert_debug_log` may intermittently fail, because the `initload thread exit` log may happen at any time after the inner thread function (lambda) is fully done.
  * The test uses an `node.syncwithvalidationinterfacequeue()` without any explanation. No other test uses this pattern, because all wallet RPCs, in particular the next one (`gettransaction`) call it internally (via `BlockUntilSyncedToCurrentChain`).

  Fix all issues by removing all confusing, useless, and brittle calls.

  Example failure: https://github.com/bitcoin/bitcoin/actions/runs/22671604602/job/65716917459?pr=34419#step:11:22339

  ```
  ...
   node0 2026-03-04T13:55:23.784715Z (mocktime: 2026-03-04T22:15:17Z) [scheduler] [validationinterface.cpp:185] [operator()] [validation] UpdatedBlockTip: new block hash=24b5cc4c1352bc8841ecbe67a43827acd1adc609bd26b2691e80e89b97eff135 fork block hash=24a4dc8be9c157ac31913397d8bb1653900e12b55539c234039559fdeb6dd2fb (in IBD=true)
   node0 2026-03-04T13:55:23.784851Z (mocktime: 2026-03-04T22:15:17Z) [initload] [util/thread.cpp:22] [TraceThread] initload thread exit
   test  2026-03-04T13:55:23.813824Z TestFramework (ERROR): Unexpected exception:
                                     Traceback (most recent call last):
                                       File "/home/admin/actions-runner/_work/_temp/test/functional/test_framework/test_framework.py", line 142, in main
                                         self.run_test()
                                       File "/home/admin/actions-runner/_work/_temp/build/test/functional/wallet_reindex.py", line 90, in run_test
                                         self.birthtime_test(node, miner_wallet)
                                       File "/home/admin/actions-runner/_work/_temp/build/test/functional/wallet_reindex.py", line 64, in birthtime_test
                                         with node.assert_debug_log(expected_msgs=["initload thread exit"]):
                                       File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__
                                         next(self.gen)
                                       File "/home/admin/actions-runner/_work/_temp/test/functional/test_framework/test_node.py", line 607, in assert_debug_log
                                         self._raise_assertion_error(f'Expected message(s) {remaining_expected!s} '
                                       File "/home/admin/actions-runner/_work/_temp/test/functional/test_framework/test_node.py", line 241, in _raise_assertion_error
                                         raise AssertionError(self._node_msg(msg))
                                     AssertionError: [node 0] Expected message(s) ['initload thread exit'] not found in log:
  ```

  Diff to reproduce failure:

  ```diff
  diff --git a/src/util/thread.cpp b/src/util/thread.cpp
  index 0fde73c4e2..de4c05e752 100644
  --- a/src/util/thread.cpp
  +++ b/src/util/thread.cpp
  @@ -8,2 +8,3 @@
   #include <util/log.h>
  +#include <util/time.h>
   #include <util/threadnames.h>
  @@ -21,2 +22,3 @@ void util::TraceThread(std::string_view thread_name, std::function<void()> threa
           thread_func();
  +    UninterruptibleSleep(999ms);
           LogInfo("%s thread exit", thread_name);
  diff --git a/test/functional/wallet_reindex.py b/test/functional/wallet_reindex.py
  index 71ab69e01b..649df4301a 100755
  --- a/test/functional/wallet_reindex.py
  +++ b/test/functional/wallet_reindex.py
  @@ -62,2 +62,3 @@ class WalletReindexTest(BitcoinTestFramework):

  +        import time; time.sleep(1) # Wait for previous initload thread to exit fully
           # Reindex and wait for it to finish
  ```

  Before on master: Test fails
  After on this pull: Test passes

ACKs for top commit:
  rkrux:
    ACK fa30951af5 if this PR needs to be backported.

Tree-SHA512: 1e6599511e09b5b9ac4aed96a6b1b8239d5dc63b164fc0c163b6f9f5bc72c1c61f72ad8256a01875208d825af46d057c4d9de61758002f256388ddb324006bb5
2026-03-24 12:06:25 +08:00
Ava Chow
696b5457c5 Merge bitcoin/bitcoin#34667: test: ensure FastWalletRescanFilter is correctly updated during scanning
92287ae753 test/wallet: ensure FastWalletRescanFilter is updated during scanning (Novo)

Pull request description:

  Part of https://github.com/bitcoin/bitcoin/pull/34400

  On master, the `wallet_fast_rescan.py` test will pass even if the fast rescan filters are not updated during wallet rescan. This PR improves the `wallet_fast_rescan.py` test so that this no longer happens. Testers can verify by applying this diff
  ```diff
  diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
  index 63dab29972..f7d6c5f84a 100644
  --- a/src/wallet/wallet.cpp
  +++ b/src/wallet/wallet.cpp
  @@ -1898,7 +1898,7 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc

           bool fetch_block{true};
           if (fast_rescan_filter) {
  -            fast_rescan_filter->UpdateIfNeeded();
  +            // fast_rescan_filter->UpdateIfNeeded();
               auto matches_block{fast_rescan_filter->MatchesBlock(block_hash)};
               if (matches_block.has_value()) {
                   if (*matches_block) {

  ```
  and running the `wallet_fast_rescan.py` test. The test will pass on master but fail on this PR.

ACKs for top commit:
  achow101:
    ACK 92287ae753
  Bortlesboat:
    re-ACK 92287ae753
  rkrux:
    tACK 92287ae
  ismaelsadeeq:
    Tested ACK 92287ae753

Tree-SHA512: bcd66db0be6604b084230fa3d3aa8d99f5a1a679a7a92592a5e8962abbcf35a14fb6883f25c9e8e6c4799893b774b1c6766876587417f35c4190562ef5ad39fb
2026-03-23 17:34:47 -07:00
merge-script
a703c70bb8 Merge bitcoin/bitcoin#34589: ci: Temporarily use clang in valgrind tasks
fa70b9ebaa ci: Temporarily use clang in valgrind tasks (MarcoFalke)
faf3ef4ee7 ci: Clarify why valgrind task has gui disabled (MarcoFalke)
fadb77169b test: Scale feature_dbcrash.py timeout with factor (MarcoFalke)

Pull request description:

  valgrind currently does not work on GCC compiled executables, due to an upstream bug. https://bugs.kde.org/show_bug.cgi?id=472329

  So temporarily switch to clang, so that a long term solution can be figured out in the meantime.

ACKs for top commit:
  l0rinc:
    ACK fa70b9ebaa
  fanquake:
    ACK fa70b9ebaa - also checked that it doesn't currently work under aarch64.

Tree-SHA512: 2e7c7a709311efa7bf29c3f9b1db60886b189b2d2bfebb516062163d65f0d7e8de3b6fc21c94cd62f6bd7e786e9c36fba55c4bae956b849851eb8b08e772c03e
2026-03-23 12:35:14 +08:00
Ava Chow
483769c046 Merge bitcoin/bitcoin#26201: Remove Taproot BIP 9 deployment
74f71c5054 Remove Taproot activation height (Sjors Provoost)

Pull request description:

  Drop `DEPLOYMENT_TAPROOT` from `consensus.vDeployments`.

  Now that the commit (7c08d81e11) which changes taproot to be enforced for all blocks is included in v24.0, it seems a good time to remove no longer needed non-consensus code.

  Clarify what is considered a `BuriedDeployment`.

  We drop taproot from `getdeploymentinfo` RPC, rather than mark it as `buried`, because this is not a buried deployment in the sense of [BIP 90](https://github.com/bitcoin/bips/blob/master/bip-0090.mediawiki). This is because the activation height has been completely removed from the code, unlike the hardcoded `DEPLOYMENT_SEGWIT` height which is still relied on.[^1]

  See discussion in #24737 and #26162.

  [^1]: `DEPLOYMENT_SEGWIT` is used in `IsBlockMutated` to determine if witness data is allowed, it's used for [BIP147](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki), to trigger `NeedsRedownload()` for users who upgraded after a decade, and for a few other things.

ACKs for top commit:
  ajtowns:
    reACK 74f71c5054
  achow101:
    ACK 74f71c5054
  sedited:
    Re-ACK 74f71c5054
  darosior:
    utACK 74f71c5054

Tree-SHA512: 217e0ee2e144ccfb04cf012f45b75d08f8541287a5531bd18aa81e38bad2f38d28b772137f471c46b63875840ec044cb61a2a832e3a9e89a6183e8ab36b1b9c9
2026-03-20 15:22:24 -07:00
Enoch Azariah
ad75b147b5 test: scale IPC mining wait timeouts by timeout_factor
The IPC mining tests (interface_ipc_mining.py) currently use
hardcoded timeouts (e.g., 1000ms, 60000ms) for operations like
waitTipChanged and waiting for block templates. In heavily
loaded CI environments, such as those running sanitizers with
high parallelism, these hardcoded timeouts can be too short,
leading to spurious test failures and brittleness.

This commit multiplies these timeout variables by the test
suite's global `self.options.timeout_factor`. This ensures that
the IPC wait conditions scale appropriately when the test suite
is run with a higher timeout factor, making the tests robust
against slow execution environments.

Addresses CI brittleness observed in bitcoin-core/libmultiprocess#253.
2026-03-20 19:55:28 +01:00
Enoch Azariah
e7a918b69a test: verify IPC error handling for invalid coinbase
Add a test case to interface_ipc_mining.py to verify that the IPC
server correctly handles and reports serialization errors rather than
crashing the node.

This covers the scenario where submitSolution is called with data
that cannot be deserialized, as discussed in #33341

Also introduces the assert_capnp_failed helper in ipc_util.py to
cleanly handle macOS-specific Cap'n Proto exception strings, and
refactors an existing block weight test to use it.
2026-03-20 19:55:28 +01:00
Enoch Azariah
63684d6922 test: move make_mining_ctx to ipc_util.py
The async routines in both interface_ipc.py and interface_ipc_mining.py
contain redundant code to initialize the mining proxy object.

Move the make_mining_ctx helper into test_framework/ipc_util.py and
update both test files to use it. This removes the boilerplate and
prevents code duplication across the IPC test suite.
2026-03-20 19:55:28 +01:00
Enoch Azariah
4ada575d6c test: verify createNewBlock wakes promptly when tip advances
This adds a complementary test to interface_ipc_mining.py to ensure
that createNewBlock() wakes up immediately once submitblock advances
the tip, rather than needlessly waiting for the cooldown timer to
expire on its own.
2026-03-20 19:55:15 +01:00
merge-script
f80bf5128d Merge bitcoin/bitcoin#34869: tests: applied PYTHON_GIL to the env for every test
b14f2c76a1 tests: applied PYTHON_GIL to the env for every test (kevkevinpal)

Pull request description:

  ## Summay
  If a user is running python3.14.0t they would see a warning log that would fail the integration test suite.

  This change adds `PYTHON_GIL=1` to the env when running our functional test suite to ensure that the tests pass for users running python3.14.0t and are not manually setting `PYTHON_GIL=1`.

  This resolves https://github.com/bitcoin/bitcoin/issues/33582

  ### Tests before and after
  #### Before
  ```
  ./build/test/functional/test_runner.py interface_ipc.py
  Temporary test directory at /tmp/test_runner_₿_🏃_20260319_142327
  Remaining jobs: [interface_ipc.py]
  1/1 - interface_ipc.py failed, Duration: 2 s

  stdout:
  2026-03-19T18:23:27.330123Z TestFramework (INFO): PRNG seed is: 4933091336597497631
  2026-03-19T18:23:27.380917Z TestFramework (INFO): Initializing test directory /tmp/test_runner_₿_🏃_20260319_142327/interface_ipc_0
  2026-03-19T18:23:28.625944Z TestFramework (INFO): Running echo test
  2026-03-19T18:23:28.635856Z TestFramework (INFO): Running mining test
  2026-03-19T18:23:28.648965Z TestFramework (INFO): Running deprecated mining interface test
  2026-03-19T18:23:28.653589Z TestFramework (INFO): Running disconnect during BlockTemplate.waitNext
  2026-03-19T18:23:28.821124Z TestFramework (INFO): Running thread busy test
  2026-03-19T18:23:29.195589Z TestFramework (INFO): Stopping nodes
  2026-03-19T18:23:29.299135Z TestFramework (INFO): Cleaning up /tmp/test_runner_₿_🏃_20260319_142327/interface_ipc_0 on exit
  2026-03-19T18:23:29.299329Z TestFramework (INFO): Tests successful

  stderr:
  <frozen importlib._bootstrap>:491: RuntimeWarning: The global interpreter lock (GIL) has been enabled to load module 'capnp.lib.capnp', which has not declared that it can run safely without the GIL. To override this behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0 or -Xgil=0.

  TEST             | STATUS    | DURATION

  interface_ipc.py | ✖ Failed  | 2 s

  ALL              | ✖ Failed  | 2 s (accumulated)
  Runtime: 2 s

  ```
  #### After
  ```
  ./build/test/functional/test_runner.py interface_ipc.py
  Temporary test directory at /tmp/test_runner_₿_🏃_20260319_142221
  Remaining jobs: [interface_ipc.py]
  1/1 - interface_ipc.py passed, Duration: 2 s

  TEST             | STATUS    | DURATION

  interface_ipc.py | ✓ Passed  | 2 s

  ALL              | ✓ Passed  | 2 s (accumulated)
  Runtime: 2 s
  ```

ACKs for top commit:
  maflcko:
    review ACK b14f2c76a1
  fanquake:
    ACK b14f2c76a1

Tree-SHA512: e5862d2e9211154d4834c88864e8c4e35de195986511ba151871d39266d177e0718960b28020e815ef6b353a0d82800b7cb68e9a6dee82fc85f12d8705e787a8
2026-03-20 11:18:31 +08:00
Ava Chow
bc1c540920 Merge bitcoin/bitcoin#29060: Policy: Report debug message why inputs are non standard
d8f4e7caf0 doc: add release notes (ismaelsadeeq)
248c175e3d test: ensure `ValidateInputsStandardness` optionally returns debug string (ismaelsadeeq)
d2716e9e5b policy: update `AreInputsStandard` to return error string (ismaelsadeeq)

Pull request description:

  This PR is another attempt at  #13525.

  Transactions that fail `PreChecks` Validation due to non-standard inputs now  returns invalid validation state`TxValidationResult::TX_INPUTS_NOT_STANDARD` along with a debug error message.

  Previously, the debug error message for non-standard inputs do not specify why the inputs were considered non-standard.
  Instead, the same error string, `bad-txns-nonstandard-inputs`, used for all types of non-standard input scriptSigs.

  This PR updates the `AreInputsStandard`  to include the reason why inputs are non-standard in the debug message.
  This improves the `Precheck` debug message to be more descriptive.

  Furthermore, I have addressed all remaining comments from #13525 in this PR.

ACKs for top commit:
  instagibbs:
    ACK d8f4e7caf0
  achow101:
    ACK d8f4e7caf0
  sedited:
    Re-ACK d8f4e7caf0

Tree-SHA512: 19b1a73c68584522f863b9ee2c8d3a735348667f3628dc51e36be3ba59158509509fcc1ffc5683555112c09c8b14da3ad140bb879eac629b6f60b8313cfd8b91
2026-03-19 15:43:18 -07:00
kevkevinpal
b14f2c76a1 tests: applied PYTHON_GIL to the env for every test 2026-03-19 15:21:33 -04:00
MarcoFalke
fa30951af5 test: Remove confusing assert_debug_log in wallet_reindex.py 2026-03-19 07:55:38 +01:00
merge-script
81bf3ebff7 Merge bitcoin/bitcoin#34852: test: Fix intermittent issue in feature_assumeutxo.py
faf71d6cb4 test: [refactor] Use verbosity=0 named arg (MarcoFalke)
99996f6c06 test: Fix intermittent issue in feature_assumeutxo.py (MarcoFalke)

Pull request description:

  The test has many issues:

  * It fails intermittently, due to the use of `-stopatheight` (https://github.com/bitcoin/bitcoin/issues/33635)
  * Using `-stopatheight` is expensive, because it requires two restarts, making the test slow

  Fix all issues by using `dumb_sync_blocks` and avoid the two restarts.

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

  Diff to test:

  ```diff
  diff --git a/src/util/tokenpipe.cpp b/src/util/tokenpipe.cpp
  index c982fa6fc4..1dc12ea1d5 100644
  --- a/src/util/tokenpipe.cpp
  +++ b/src/util/tokenpipe.cpp
  @@ -4,2 +4,3 @@
   #include <util/tokenpipe.h>
  +#include <util/time.h>

  @@ -60,2 +61,3 @@ int TokenPipeEnd::TokenRead()
           ssize_t result = read(m_fd, &token, 1);
  +        UninterruptibleSleep(999ms);
           if (result < 0) {
  ```

  On master: Test fails
  On this pull: Test passes

ACKs for top commit:
  fjahr:
    Code review ACK faf71d6cb4
  sedited:
    ACK faf71d6cb4

Tree-SHA512: 8f7705d2b3f17881134d6e696207fe6710d7c4766f1b74edf5a40b4a6eb5e0f4b12be1adfabe56934d27abc46e789437526bcdd26e4f8172f41a11bc6bed8605
2026-03-19 14:04:18 +08:00
merge-script
33eaf910bd Merge bitcoin/bitcoin#34820: test: Use asyncio.SelectorEventLoop() over deprecated asyncio.WindowsSelectorEventLoopPolicy(), move loop creation
fa050da980 test: Move event loop creation to network thread (MarcoFalke)
fa9168ffcd test: Use asyncio.SelectorEventLoop() over deprecated asyncio.WindowsSelectorEventLoopPolicy() (MarcoFalke)

Pull request description:

  It is deprecated according to https://docs.python.org/3.14/library/asyncio-policy.html#asyncio.WindowsSelectorEventLoopPolicy The replacement exists since python 3.7

  Also, move the event loop creation to happen in the thread that runs the loop.

ACKs for top commit:
  l0rinc:
    ACK fa050da980
  sedited:
    ACK fa050da980

Tree-SHA512: dce25596a04e8f133630d84c03a770185a81b1bcd0aae975f0dbdd579d22b7b79a9b1172abf46c61d0845d3f5ab4a6414fa0f17c59f0ea0f6fa9bdcac085a2a7
2026-03-18 18:24:35 +01:00
MarcoFalke
faf71d6cb4 test: [refactor] Use verbosity=0 named arg
This is less confusing than the verbose=0 alias.
2026-03-18 16:16:22 +01:00
MarcoFalke
99996f6c06 test: Fix intermittent issue in feature_assumeutxo.py 2026-03-18 16:13:09 +01:00
Novo
92287ae753 test/wallet: ensure FastWalletRescanFilter is updated during scanning
The fixed non-range descriptor address ensured that the FastWalletRescanFilter would match all Blocks even if the filter wasn't properly updated.
This commit moves the non-range descriptor tx to a different block, so that the filters must be updated after each TopUp for the test to pass.

Co-authored-by: rkrux <rkrux.connect@gmail.com>
2026-03-16 11:51:56 +01:00
merge-script
ff7cdf633e Merge bitcoin/bitcoin#34816: test: Remove vulture from ci, Remove some --min-confidence=60 unused code
fa90b21430 test: Remove unused feature_segwit.py functions (MarcoFalke)
fa6b05c96f test: Remove unused CUSTOM_._COUNT (MarcoFalke)
fa7bac94d8 test: Remove unused wait_for_addr, firstAddrnServices, on_addr (MarcoFalke)
fa388a3585 test: Remove unused self.p2p_conn_index = 1 (MarcoFalke)
fa803710e2 test: Remove unused AddressType (MarcoFalke)
fab5072ce1 ci: Remove vulture (MarcoFalke)

Pull request description:

  Currently, `vulture` is run with `--min-confidence=100`, which reduces its checks to dead code after control statements, which is nice, but not really a common nor severe issue. See the discussion in https://github.com/bitcoin/bitcoin/issues/34810#issuecomment-4045927137 and commit 5c005363a8, which had to remove dead code manually.

  Reducing the confidence has shown to be too brittle/tedious in the past, so remove the tool for now from CI.

  Of course, removing this from CI does not prevent anyone from running it locally and removing dead code.

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

ACKs for top commit:
  fanquake:
    ACK fa90b21430
  willcl-ark:
    ACK fa90b21430

Tree-SHA512: 6a5998470dae3a17baec29b70b02333f4cd9b81bc4c6a05b56085ff1ba527ed7bdeccd17b09d9ad785ae03c97982ee1f3147e4df3bd537c66b02e9a44d0e5f15
2026-03-16 12:46:50 +08:00
Ava Chow
92a3d30f38 Merge bitcoin/bitcoin#34418: qa: Make wallet_multiwallet.py Windows crossbuild-compatible
111864ac30 qa: Avoid duplicating output in case the diff is the same (Hodlinator)
c2e28d455a ci: Enable `wallet_multiwallet.py` in "Windows, test cross-built" job (Hodlinator)
850a80c199 qa: Disable parts of the test when running under Windows or root (Hodlinator)
fb803e3c79 qa: Test scanning errors individually (Hodlinator)
ed43ce57cc qa: Check for platform-independent part of error message (Hodlinator)
64a098a9b6 refactor(qa): Break apart ginormous run_test() (Hodlinator)
bb1aff7ed7 move-only(qa): Move wallet creation check down to others (Hodlinator)
d1a4ddb58e refactor(qa): Lift out functions to outer scopes (Hodlinator)
c811e47367 scripted-diff: self.nodes[0] => node (Hodlinator)
73cf858911 refactor(qa): Remove unused option (Hodlinator)

Pull request description:

  Makes the functional test compatible with *Linux->Windows cross-built executables*.

  Main parts:
  * Commit "qa: Check for platform-independent part of error message" switches to match on platform-independent part of error message.
  * Commit "qa: Test scanning errors individually" disentangles code causing the same error message substring, based on #31410.
  * Commit "qa: Disable parts of the test when running under Windows or root" enables the test to be run on Windows, based in part on https://github.com/bitcoin/bitcoin/pull/31410#issuecomment-3554721014.

  Also:
  * Removes unused option in wallet_multiwallet.py.
  * Breaks apart wallet_multiwallet.py's `run_test()` into smaller test functions.
  * Improves `assert_equal()` output for dicts.

  Fixes #31409.

ACKs for top commit:
  achow101:
    ACK 111864ac30
  janb84:
    re ACK 111864ac30
  w0xlt:
    reACK 111864ac30

Tree-SHA512: 4e3ff92588ac9f2611fc963ce62097b6c0dd4d4eb8da7952c72619c7b554ff3cae5163fe1886d4d9bbd7af1acca5b846411e7f5b46f9bddb08719b61108efbba
2026-03-13 15:45:47 -07:00
MarcoFalke
fa050da980 test: Move event loop creation to network thread
This should fix https://github.com/bitcoin/bitcoin/issues/34367

I am not familiar with Windows sockets thread-safety, but creating the
event loop on the main thread, and running it in the network thread
could lead to a fast abort in Python on Windows (without any stderr):

```
77/276 - wallet_txn_clone.py failed, Duration: 1 s

stdout:
2025-12-10T08:04:27.500134Z TestFramework (INFO): PRNG seed is: 4018092284830106117

stderr:

Combine the logs and print the last 99999999 lines ...
============
Combined log for D:\a\_temp/test_runner_₿_🏃_20251210_075632/wallet_txn_clone_196:
============
 test  2025-12-10T08:04:27.500134Z TestFramework (INFO): PRNG seed is: 4018092284830106117
 test  2025-12-10T08:04:27.500433Z TestFramework (DEBUG): Setting up network thread
```

Also, I couldn't find any docs that require the loop must be created on
the thread that runs them:

* https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.new_event_loop
* https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_forever

However, the patch seems trivial to review, harmless, and easy to
revert, so it may be a good try to fix the intermittent Windows Python
crash.
2026-03-13 13:48:47 +01:00
MarcoFalke
fa9168ffcd test: Use asyncio.SelectorEventLoop() over deprecated asyncio.WindowsSelectorEventLoopPolicy() 2026-03-13 12:11:56 +01:00
merge-script
5608b8ce9e Merge bitcoin/bitcoin#34750: test: fix addr relay test silently passing and other improvements
57bfa864fe test: use static methods and clarify comment in addr_relay (stratospher)
7ee8c0abc6 test: protect outbound connection from eviction in getaddr_test (stratospher)
ecb5ce6e76 test: fix addr relay test silent pass and wrong peerinfo index (stratospher)

Pull request description:

  couple of improvements in the addr relay test:
    - fixes the silent test pass discovered in https://github.com/bitcoin/bitcoin/pull/34717#issuecomment-3990585763 (will remove this if that PR gets merged - the test doesn't fail even though #34717 changes the behaviour)
    - correct wrong peerinfo index
    - prevent intermittent disconnection warnings like the one shown below by protecting outbound peer from `ConsiderEviction`
    ```
      TestFramework (INFO): Check that we answer getaddr messages only once per connection
      TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:58829 due to [Errno 54] Connection reset by peer
  ```
    - remove a no longer applicable test comment since we don't need to send initial GETADDR for intial self announcement anymore

ACKs for top commit:
  Bortlesboat:
    ACK 57bfa864fe. Ran both `p2p_addr_relay.py` and `p2p_addr_selfannouncement.py` locally, both pass. Good catch on the stale `peerinfo` reference in `inbound_blackhole_tests` — that would silently check the wrong peer.
  naiyoma:
    ACK  57bfa864fe
  mzumsande:
    Code Review ACK 57bfa864fe

Tree-SHA512: 22e4f87f66569bfa629a68a8b440cd21b5285c6dad6eb7926514f2d74e16fe3711525b264f82765c83020be976a0438b8d2ab1e48e7c0b7d85437ee672d52324
2026-03-12 15:06:29 +00:00
MarcoFalke
fa90b21430 test: Remove unused feature_segwit.py functions
Unused after commit c847dee148
2026-03-12 16:01:12 +01:00
MarcoFalke
fa6b05c96f test: Remove unused CUSTOM_._COUNT
Unused after commit cf3ab8e1d0
2026-03-12 16:01:12 +01:00
MarcoFalke
fa7bac94d8 test: Remove unused wait_for_addr, firstAddrnServices, on_addr
Unused after commit be25ac3092
2026-03-12 16:01:09 +01:00
MarcoFalke
fa388a3585 test: Remove unused self.p2p_conn_index = 1
Was never used
2026-03-12 16:01:06 +01:00
MarcoFalke
fa803710e2 test: Remove unused AddressType
unused after commit c847dee148
2026-03-12 16:01:05 +01:00
merge-script
44ddc9c93f Merge bitcoin/bitcoin#31560: rpc: allow writing UTXO set to a named pipe
b19caeea09 doc: add release note for #31560 (named pipe support for `dumptxoutset` RPC) (Sebastian Falbesoner)
61a5460d0d test: add test for utxo-to-sqlite conversion using named pipe (Sebastian Falbesoner)
2e8072edbe rpc: support writing UTXO set dump (`dumptxoutset`) to a named pipe (Sebastian Falbesoner)

Pull request description:

  This PR slightly modifies the `dumptxoutset` RPC to allow writing the UTXO set dump into a [named pipe](https://askubuntu.com/a/449192), so that the output data can be consumed by another process, see #31373. Taking use of this with the utxo-to-sqlite.py tool (introduced in #27432), creating an UTXO set in SQLite3 format is possible on the fly. E.g. for signet:
  ```
  $ mkfifo /tmp/utxo_fifo && ./build/bin/bitcoin-cli -signet dumptxoutset /tmp/utxo_fifo latest &
  $ ./contrib/utxo-tools/utxo_to_sqlite.py /tmp/utxo_fifo ./utxo.sqlite
  UTXO Snapshot for Signet at block hash 000000012711f0a4e741be4a22792982..., contains 61848352 coins
  1048576 coins converted [1.70%], 2.800s passed since start
  ....
  ....
  60817408 coins converted [98.33%], 159.598s passed since start
  {
    "coins_written": 61848352,
    "base_hash": "000000012711f0a4e741be4a22792982370f51326db20fca955c7d45da97f768",
    "base_height": 294305,
    "path": "/tmp/utxo_fifo",
    "txoutset_hash": "34ae7fe7af33f58d4b83e00ecfc3b9605d927f154e7a94401226922f8e3f534e",
    "nchaintx": 28760852
  }
  TOTAL: 61848352 coins written to ./utxo.sqlite, snapshot height is 294305.
  ```
  Note that the `dumptxoutset` RPC calculates an UTXO set hash as a first step before any data is emitted, so especially on mainnet it takes quite a while until the conversion starts and something is happening visibly.

ACKs for top commit:
  ajtowns:
    utACK b19caeea09
  sedited:
    Re-ACK b19caeea09

Tree-SHA512: 7101563d0dba15439cdef8c8fb535f8593d5a779ff04208e2d72382a3f99072db8eac3651d1b3fe72c5e1f03e164efb281c3030d45d0723b943ebbbcf2a841d6
2026-03-12 09:55:07 +00:00
Sebastian Falbesoner
61a5460d0d test: add test for utxo-to-sqlite conversion using named pipe 2026-03-11 16:25:02 +01:00
Sebastian Falbesoner
b267efcdaf rpc, net: completely remove startingheight field of getpeerinfo RPC 2026-03-11 15:51:09 +01:00
merge-script
e96d9e6492 Merge bitcoin/bitcoin#34389: net/log: standardize peer+addr log formatting via LogPeer
22335474d7 net: format peer+addr logs with `LogPeer` (Lőrinc)
e55ea534f7 test: add pre-`LogPeer` net log assertion (Lőrinc)
736b17c0f0 log: fix minor formatting in debug logs (Lőrinc)
9cf82bed32 log: show placeholders for missing peer fields (Lőrinc)

Pull request description:

  This is an alternative to #34293, but aims to address the remaining logging inconsistencies more broadly.
  It extends the example fixed there to every instance, restores the original separator behavior, applies it consistently via a single helper, and adds tests for `logips` (covering both current and new behavior).

  ### Problem
  After #28521 centralized peer address logging into `CNode::LogIP()`, the original comma separator before `peeraddr=` was lost, resulting in inconsistent formatting across net (and recent private broadcast) logs.
  Some lines also had double spaces, empty fields, or mismatched format specifiers.

  ### Fix
  Introduces `CNode::LogPeer(bool)` which always emits `peer=<id>` and, when `-logips=1`, appends `, peeraddr=<addr>`. This eliminates hand-rolled separators and makes peer identification predictable.
  Minor issues (double spaces, empty placeholders, format specifiers) are fixed along the way in separate commits.

  ### Reproducer
  Run with `-debug=net -logips=1` and observe peer log lines now show `peer=<id>, peeraddr=<addr>` (comma-separated). The new assertion in `feature_logging.py` automates this check.

ACKs for top commit:
  naiyoma:
    ACK 22335474d7
  vasild:
    ACK 22335474d7
  sedited:
    ACK 22335474d7

Tree-SHA512: 562262a58c3042f139099ff4c41e3fc6a97505fe9603c2bf700a97fd0aa052954b47c14da0e50c1fc311db1ae6c04e6a92156c9b85e25c777a637b7766c1dafe
2026-03-11 14:34:42 +01:00
merge-script
3201abe3ea Merge bitcoin/bitcoin#34359: test: add test for rebroadcast of transaction received via p2p
73e3853110 test: add test for rebroadcast of transaction received via p2p (Martin Zumsande)

Pull request description:

  The wallet doesn't only rebroadcast transactions it created, but also relevant transactions received via p2p.
  Since this is not self-evident, add test coverage for it.

ACKs for top commit:
  maflcko:
    re-ACK 73e3853110 🦌
  vasild:
    ACK 73e3853110
  furszy:
    ACK 73e3853110
  danielabrozzoni:
    tACK 73e3853110

Tree-SHA512: b5249bb5eb6a124a98030816319aa4364d7aee9c28ee28750ebba5fc8d6bfc9d7960a97ed638611f4560e051760ec4a7a75d302a4cb106dbfadfe11adc604f22
2026-03-11 09:50:47 +01:00