7534 Commits

Author SHA1 Message Date
tboy1337
d221d1c633
psbt: validate pubkeys in MuSig2 pubnonce/partial sig deserialization
Add validation for pubkeys in MuSig2 pubnonce and partial signature deserialization to prevent crashes with invalid curve points.

- Validate aggregate and participant pubkeys in PSBT MuSig2 fields

- Add comprehensive test coverage for invalid pubkey rejection

- Ensure proper error handling during PSBT deserialization

Github-Pull: #34219
Rebased-From: f51665bee72c26d3f3cc6813b6c02adad5f0af6a
2026-03-09 15:52:30 +00:00
MarcoFalke
c17a5cd5f8
test: Add missing timeout_factor to zmq socket
Github-Pull: #34690
Rebased-From: fa48f8c8655d93e78b32b560a870577909b666d3
2026-03-09 15:52:29 +00:00
MarcoFalke
475a5b0504
refactor: Use static_cast<decltype(...)> to suppress integer sanitizer warning
This refactor does not change any behavior, except for the integer
sanitizer warning.

Can be tested via:

UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" ./bld-cmake/bin/bitcoin-cli -stdinrpcpass uptime

Github-Pull: #34597
Rebased-From: fa6af856341384e4a84c5674e66fe7c1f13dd73c
2026-03-09 15:52:29 +00:00
MarcoFalke
dca7700269
test: valgrind --trace-children=yes for bitcoin wrapper
Github-Pull: #34608
Rebased-From: fa5d478853a88ce7d7095b6abfe8112390298b65
2026-02-25 10:56:44 +00:00
MarcoFalke
dd8924909a
test: Remove redundant warning about missing binaries
The error was added in commit 1ea7e45a1f445d32a2b690d52befb2e63418653b,
because there was an additional confusing `AssertionError: [node 0]
Error: no RPC connection` instead of just a single `FileNotFoundError:
[Errno 2] No such file or directory`.

This is no longer needed on current master.

Also, the test is incomplete, because it was just checking bitcoind and
bitcoin-cli, not any other missing binaries.

Also, after the previous commit, it would not work in combination with
--valgrind.

Instead of trying to make it complete, and work in all combinations,
just remove it, because the already existing error will be clear in any
case.

This can be tested via:

```sh
 ./test/get_previous_releases.py

 mv releases releases_backup
 # Confirm the test is skipped due to missing releases
 ./bld-cmake/test/functional/wallet_migration.py
 # Confirm the test fails due to missing releases
 ./bld-cmake/test/functional/wallet_migration.py --previous-releases
 mv releases_backup releases

 mv ./releases/v28.2 ./releases/v28.2_backup
 # Confirm the test fails with a single FileNotFoundError
 ./bld-cmake/test/functional/wallet_migration.py
 mv ./releases/v28.2_backup ./releases/v28.2
 # Confirm the test runs and passes
 ./bld-cmake/test/functional/wallet_migration.py

 rm ./bld-cmake/bin/bitcoind
 # Confirm the test fails with a single "No such file or directory",
 # testing with and without --valgrind
 ./bld-cmake/test/functional/wallet_migration.py
 ./bld-cmake/test/functional/wallet_migration.py --valgrind
```

Github-Pull: #34608
Rebased-From: fa29fb72cb21bec798ddae49b842c78ac84a5a3b
2026-02-25 10:56:43 +00:00
MarcoFalke
6993b1be78
test: Fix broken --valgrind handling after bitcoin wrapper
Prior to this commit, tool_bitcoin.py was failing:

```sh
$ ./bld-cmake/test/functional/tool_bitcoin.py --valgrind
TestFramework (ERROR): Unexpected exception
Traceback (most recent call last):
  File "./test/functional/test_framework/test_framework.py", line 138, in main
    self.setup()
    ~~~~~~~~~~^^
  File "./test/functional/test_framework/test_framework.py", line 269, in setup
    self.setup_network()
    ~~~~~~~~~~~~~~~~~~^^
  File "./test/functional/tool_bitcoin.py", line 38, in setup_network
    assert all(node.args[:len(node_argv)] == node_argv for node in self.nodes)
           ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
```

This commit fixes this issue by running `bitcoin` under valgrind. Also,
it comes with other improvements:

* Drop the outdated valgrind 3.14 requirement, because there is no
  distro that ships a version that old anymore.
* Drop the VALGRIND_SUPPRESSIONS_FILE env var handling, because it was
  presumably never used since it was introduced. Also, the use-case
  seems limited.

Review note:

The set_cmd_args was ignoring the --valgrind test option.

In theory, this could be fixed by refactoring Binaries::node_argv() to
be used here. However, for now, just re-implement the node_argv logic in
set_cmd_args to prepend the valgrind cmd.

Github-Pull: #34608
Rebased-From: fa03fbf7e31f384627230e1bc042f7f29c05ff68
2026-02-25 10:56:40 +00:00
fanquake
19b3e2e50e
test: use ModuleNotFoundError in interface_ipc.py
Change this so we catch the case where the capnp shared libs have been
updated, and can no-longer be loaded by the Python module, resulting in
a skipped test, even though pycapnp is installed. i.e:
```bash
stderr:
Traceback (most recent call last):
  File "/root/ci_scratch/build/test/functional/interface_ipc.py", line 20, in <module>
    import capnp  # type: ignore[import] # noqa: F401
    ^^^^^^^^^^^^
  File "/usr/local/lib64/python3.14/site-packages/capnp/__init__.py", line 36, in <module>
    from .version import version as __version__
  File "/usr/local/lib64/python3.14/site-packages/capnp/version.py", line 1, in <module>
    from .lib.capnp import _CAPNP_VERSION_MAJOR as LIBCAPNP_VERSION_MAJOR  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcapnpc.so.1.0.1: cannot open shared object file: No such file or directory
```

Failing in this way should make it clear that `pycapnp` needs to be
reinstalled/rebuilt.

If  `pycapnp` is not installed, the test still skips as expected:
```bash
Remaining jobs: [interface_ipc.py]
1/1 - interface_ipc.py skipped (capnp module not available.)

TEST             | STATUS    | DURATION

interface_ipc.py | ○ Skipped | 0 s
```

Fixes: #34016.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>

Github-Pull: #34409
Rebased-From: 905dfdee86d679f8ea31d841bceb77a5724a6b1b
2026-01-30 11:48:50 +00:00
Martin Zumsande
290526bc6d
wallet: fix removeprunedfunds bug with conflicting transactions
removeprunedfunds removes all entries from mapTxSpends for the
inputs of the pruned tx. However, this is incorrect, because there could be
multiple entries from conflicting transactions (that shouldn't be
removed as well). This could lead to the wallet creating invalid
transactions, trying to double spend utxos.
The bug persists when the conflicting tx was mined, because
the wallet trusts its internal accounting instead of calling
AddToSpends again.

Github-Pull: #34358
Rebased-From: 1f60ca360eb83fa7982b1aac402eaaf477294197
2026-01-29 09:53:37 +00:00
fanquake
33195bdd9e
test: allow overriding tar in get_previous_releases
Facilitate use on distros that might have 'tar' as something else, such
as 'gtar', i.e Chimera.

Github-Pull: #34390
Rebased-From: be2b48b9f3e56b672e391e18a09f2d5f4e78d74e
2026-01-27 09:49:27 +00:00
Hennadii Stepanov
de79f7d01c
qa: Fix Windows logging bug
The regex `(.*)` was capturing `\r` from subprocess output on Windows,
causing the closing parenthesis in logs to wrap to the next line.

Stripping whitespace from the regex match fixes the formatting.

Github-Pull: #34282
Rebased-From: 979d41bfab248990d7d520873d17fe52daa8d402
2026-01-15 15:22:26 +00:00
brunoerg
311da7fee3
test: check wallet rescan properly in feature_pruning
Github-Pull: #34185
Rebased-From: 8fb5e5f41ddf550a78b1253184d79a107097815a
2026-01-15 11:22:07 +00:00
brunoerg
4431a60f9c
test: fix feature_pruning when built without wallet
Github-Pull: #34185
Rebased-From: 9b57c8d2bd15a414e08a9e43367d8d3d82c25fe4
2026-01-15 11:22:02 +00:00
David Gumberg
1dae0027cd
wallet: test: Failed migration cleanup
Refactor a common way to perform the failed migration test that exists
for default wallets, and add relative-path wallets and absolute-path
wallets.

Github-Pull: #34226
Rebased-From: eeaf28dbe0e09819ab0e95bb7762b29536bdeef6
2026-01-09 10:11:19 +00:00
furszy
9e59047a7e
test: migration, avoid backup name mismatch in default_wallet_failure
The test calls migrate_and_get_rpc(), which sets mock time internally.
The caller caches a mock time value and later relies on it to predict the
backup filename, so setting the mock time again could cause a naming
mismatch.

Fix this by calling the migration RPC directly. Since the test expects the
migration to fail, migrate_and_get_rpc() is unnecessary here.

Github-Pull: #34221
Rebased-From: cbf0bd35bbf312f3b13d92d281d7112e4b43b9c3
2026-01-08 10:21:49 +00:00
Ava Chow
c4082a45e6
wallettool: do not use fs::remove_all in createfromdump cleanup
Github-Pull: #34215
Rebased-From: f78f6f1dc8e16d5a8a23749e77bc3bf17c91ae42
2026-01-07 14:33:39 +00:00
furszy
185ca0e391
test: coverage for migration failure when last sync is beyond prune height
Github-Pull: #34156
Rebased-From: b7c34d08dd9549a95cffc6ec1ffa4bb4f81e35eb
2026-01-07 11:20:07 +00:00
furszy
bc71372c0e
wallet: migration, fix watch-only and solvables wallets names
Because the default wallet has no name, the watch-only and solvables
wallets created during migration end up having no name either.

This fixes it by applying the same prefix name we use for the backup
file for an unnamed default wallet.

Before: watch-only wallet named "_watchonly"
After:  watch-only wallet named "default_wallet_watchonly"

Github-Pull: #34156
Rebased-From: 82caa8193a3e36f248dcc949e0cd41def191efac
2026-01-07 11:20:04 +00:00
furszy
ac940ac2ca
test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure
The first test verifies that restoring into an existing empty directory
or a directory with no .dat db files succeeds, while restoring into a
dir with a .dat file fails.

The second test covers restoring into the default unnamed wallet
(wallet.dat), which also implicitly exercises the recovery path used
after a failed migration.

The third test covers failure during restore on a prune node. When
the wallet last sync was beyond the pruning height.

Github-Pull: #34156
Rebased-From: f011e0f0680a8c39988ae57dae57eb86e92dd449
2026-01-07 11:19:57 +00:00
furszy
8e5c02a77f
test: add coverage for unnamed wallet migration failure
Verifies that a failed migration of the unnamed (default) wallet
does not erase the main /wallets/ directory, and also that the
backup file exists.

Github-Pull: #34156
Rebased-From: 36093bde63286e19821a9e62cdff1712b6245dc7
2026-01-07 11:19:39 +00:00
furszy
ac4d0956cc
wallet: fix unnamed wallet migration failure
When migrating any legacy unnamed wallet, a failed migration would
cause the cleanup logic to remove its parent directory. Since this
type of legacy wallet lives directly in the main '/wallets/' folder,
this resulted in unintentionally erasing all wallets, including the
backup file.

To be fully safe, we will no longer call `fs::remove_all`. Instead,
we only erase the individual db files we have created, leaving
everything else intact. The created wallets parent directories are
erased only if they are empty.
As part of this last change, `RestoreWallet` was modified to allow
an existing directory as the destination, since we no longer remove
the original wallet directory (we only remove the files we created
inside it). This also fixes the restore of top-level default wallets
during failures, which were failing due to the directory existence
check that always returns true for the /wallets/ directory.

This bug started after:
f6ee59b6e2
Previously, the `fs::copy_file` call was failing for top-level wallets,
which prevented the `fs::remove_all` call from being reached.

Github-Pull: #34156
Rebased-From: f4c7e28e80bf9af50b03a770b641fd309a801589
2026-01-07 11:19:35 +00:00
MarcoFalke
7568bc3ab0
test: Avoid hard time.sleep(1) in feature_init.py
Github-Pull: #34137
Rebased-From: fa727e3ec984106371eeedb34d7bbbbc3dcce4ff
2026-01-05 12:09:02 +00:00
Ryan Ofsky
c065bcd2d7
init: Signal m_tip_block_cv on Ctrl-C
Signal m_tip_block_cv when Ctrl-C is pressed or SIGTERM is received, the same
way it is currently signalled when the `stop` RPC is called. This lets RPC
calls like `waitforblockheight` and IPC calls like `waitTipChanged` be
interrupted, instead of waiting for their original timeouts and delaying
shutdown.

Historical notes:

- The behavior where `stop` RPC signals `m_tip_block_cv`, but CTRL-C does not,
  has been around since the condition variable was introduced in #30409
  (7eccdaf16081d6f624c4dc21df75b0474e049d2b).
- The signaling was later moved without changing behavior in #30967
  (5ca28ef28bcca1775ff49921fc2528d9439b71ab). This commit moves it again to
  the Interrupt() function, which is probably the place it should have been
  added initially, so it works for Ctrl-C shutdowns as well as `stop`
  shutdowns.
- A Qt shutdown bug calling wait methods was fixed previously in #18452
  (da73f1513a637a9f347b64de66564d6cdb2541f8), and this change updates that
  fix to avoid the hang happening again in Qt.

Github-Pull: #33511
Rebased-From: c25a5e670b27d3b6eb958ce437dbe89678bd1511
2026-01-05 12:07:02 +00:00
Ryan Ofsky
6983c7d769
test: Test SIGTERM handling during waitforblockheight call
Currently when CTRL-C is pressed and there is an active `waitforblockheight`,
or `waitforblock`, or `waitfornewblock` RPC call, or a mining interface
`waitTipChanged` IPC call with a long timeout, the node will not shut down
right away, and will wait for the timeout to be reached before exiting.

This behavior is not ideal and only happens when the node is stopped with
CTRL-C or SIGTERM. When the node is stopped with `bitcoin-cli stop`, the wait
calls are interrupted and the node does shut down right away.

The next commit improves node behavior. This commit just adds test coverage to
simplify the next commit and clarify the change in behavior there.

Github-Pull: #33511
Rebased-From: 6a29f79006a9d60b476893dface5eea8f9bf271c
2026-01-05 12:06:57 +00:00
glozow
187e3b89b5
[test] wallet send 3 generation TRUC
Github-Pull: #33528
Rebased-From: dcd42d6d8f160ae8bc12c152099a6e6473658e30
2025-12-05 09:46:37 +00:00
ismaelsadeeq
39d53dd8bf
interfaces: add interruptWait method
- This method can be used to cancel a running
  waitNext().

- This commit also adds a test case for interruptWait method

Github-Pull: #33676
Rebased-From: dcb56fd4cb59e6857c110dd87019459989dc1ec3
2025-11-26 16:49:06 +00:00
Sjors Provoost
3afd5a9729
miner: fix empty mempool case for waitNext()
Block template fees are calculated by looping over new_tmpl->vTxFees
and return (early) once the fee_threshold is exceeded.

This left an edge case when the mempool is empty, which this commit
fixes and adds a test for. It does so by using std::accumulate instead
of manual loops.

Also update interface_ipc.py to account for the new behavior.

Co-authored-by: Raimo33 <claudio.raimondi@protonmail.com>

Github-Pull: #33566
Rebased-From: 8f7673257a1a86717c1d83770dc857fc254df107
2025-10-23 15:36:56 +02:00
Ryan Ofsky
23ac752d09
bitcoin: Make wrapper not require -m
Choose the right binary by default if an IPC option is specified

Github-Pull: #33229
Rebased-From: 453b0fa286e5dce0af682b7b73684dd6415a50de
2025-10-17 15:43:25 +01:00
Ryan Ofsky
cd7937ce2d
test: add tool_bitcoin to test bitcoin wrapper behavior
Github-Pull: #33229
Rebased-From: 29e836fae660d9a89c54a094ae1a032e6a88c334
2025-10-17 15:43:22 +01:00
Eugene Siegel
5e389959b9
test: change log rate limit version gate from 299900 to 290100
Github-Pull: #33612
Rebased-From: 7b544341c0021dd713f05bc439ee190de911930c
2025-10-16 09:53:44 +01:00
Greg Sanders
e4f9ec2f05
test: add more TRUC reorg coverge
Github-Pull: #33504
Rebased-From: 06df14ba75be5f48cf9c417424900ace17d1cf4d
2025-10-02 13:56:24 +01:00
Anthony Towns
fce1c60770
datacarrier: Undeprecate configuration option
Reverts commit 0b4048c73385166144d0b3e76beb9a2ac4cc1eca

Github-Pull: #33453
Rebased-From: 451ba9ada41f687c0e4bb34d5925374a68a8f8a3
2025-09-30 18:37:37 -04:00
Sjors Provoost
1e348bc55a
rpc: fix getblock(header) returns target for tip
A target field was added to the getblock and getblockheader RPC calls in bitcoin#31583, but it mistakingly always used the tip value.

Because regtest does not have difficulty adjustment, a test is added for mainnet instead.

Github-Pull: #33446
Rebased-From: bf7996cbc3becf329d8b1cd2f1007fec9b3a3188
2025-09-24 10:09:25 -04:00
Sjors Provoost
4ec30d53ec
test: add block 2016 to mock mainnet
The next commit requires an additional mainnet block which changes the difficulty.

Also fix a few minor mistakes in the test (suite):
- rename the create_coinbase retarger_period argument to halving_period. Before bitcoin#31583 this was hardcoded for regtest where these values are the same.
- drop unused fees argument from mine helper

Finally the CPU miner instructions for generating the alternative mainnet chain are expanded.

Github-Pull: #33446
Rebased-From: 4c3c1f42cf705e039751395799240da33ca969bd
2025-09-24 10:09:04 -04:00
Ryan Ofsky
4b02bc1a72
test: Avoid interface_ipc.py Duplicate ID errors
This change should fix issue https://github.com/bitcoin/bitcoin/issues/33417
reported by zaidmstrr. It's possible to reproduce the `mp/proxy.capnp:0:
failed: Duplicate ID @0xcc316e3f71a040fb` error by installing libmultiprocess
system-wide, or to one of the locations listed in the python test's `imports`
list before the local libmultiprocess subtree, and then running the test.

Github-Pull: #33420
Rebased-From: e9c52272ebd78d01882ac9b32b1aee8e12d87bec
2025-09-23 10:20:05 -04:00
TheCharlatan
26208b3a0c
test: Add submitblock test in interface_ipc
Co-Authored-By: Sjors Provoost <sjors@sprovoost.nl>

Github-Pull: #33380
Rebased-From: 0a26731c4cc182e887ce959cdd301227cdc752d7
2025-09-17 09:50:21 +01:00
MarcoFalke
c7faf72ac6
test: Fix CLI_MAX_ARG_SIZE issues
Github-Pull: #33243
Rebased-From: facfde2cdce661c10be3254a6be99af49ceee072
2025-09-15 10:23:38 +01:00
Ava Chow
bbb4e118f3
test: Add a test for anchor outputs in the wallet
Github-Pull: #33268
Rebased-From: 609d265ebc51abfe9a9ce570da647b6839dc1214
2025-09-12 14:52:20 +01:00
Ava Chow
ad6c13e041
test: Test wallet 'from me' status change
If something is imported into the wallet, it can change the 'from me'
status of a transaction. This status is only visible through
gettransaction's "fee" field which is only shown for transactions that
are 'from me'.

Github-Pull: #33268
Rebased-From: e76c2f7a4111f87080e31539f83c21390fcd8f3b
2025-09-12 14:43:30 +01:00
Ava Chow
0ba44d9c38
Merge bitcoin/bitcoin#33296: net: check for empty header before calling FillBlock
8b6264768030db1840041abeeaeefd6c227a2644 test: send duplicate blocktxn message in p2p_compactblocks.py (Eugene Siegel)
5e585a0fc4fd68dd7b4982054b34deae2e7aeb89 net: check for empty header before calling FillBlock (Eugene Siegel)

Pull request description:

  This avoids an Assume crash if multiple blocktxn messages are received. The first call to `FillBlock` would make the header empty via `SetNull` and the call right before the second `FillBlock` would crash [here](689a321976/src/net_processing.cpp (L3333)) since `LookupBlockIndex` won't find anything. Fix that by checking for an empty header before the Assume.

ACKs for top commit:
  instagibbs:
    reACK 8b62647680
  fjahr:
    tACK 8b6264768030db1840041abeeaeefd6c227a2644
  achow101:
    ACK 8b6264768030db1840041abeeaeefd6c227a2644
  mzumsande:
    Code Review ACK 8b6264768030db1840041abeeaeefd6c227a2644

Tree-SHA512: d43a6f652161d4f7e6137f207a3e95259fc51509279d20347b1698c91179c39c8fcb75d2668b13a6b220f478a03578573208a415804be1d8843acb057fa1a73a
2025-09-08 17:16:28 -07:00
Ava Chow
1861030bea
Merge bitcoin/bitcoin#30469: index: Fix coinstats overflow
c76797481155754329ec6a6f58e8402569043944 clang-tidy: Fix critical warnings (Fabian Jahr)
54dc34ec2279378c78fa2d9155668e39e20decda index: Remove unused coinstatsindex recovery code (Fabian Jahr)
37c4fba1f4c18632bceb16f41f5a8f1a61fb9096 index: Check BIP30 blocks when rewinding Coinstatsindex (Fabian Jahr)
51df9de8e5b9c8ecd8339d95b630f312fcb9414e doc: Add release note for 30469 (Fabian Jahr)
bb8d673183294a43c716ff8738da2492f3d7a94b test: Add coinstatsindex compatibility test (Fabian Jahr)
b2e8b64ddc351124ac1390ee906a8fcd2781ca50 index, refactor: Append blocks to coinstatsindex without db read (Fabian Jahr)
431a076ae6e3cc32a8725d4a01483d27c5081a34 index: Fix coinstatsindex overflow issue (Fabian Jahr)
84e813a02bb7b3c735ae413f06c0fc156bfeb7ac index, refactor: DRY coinbase check (Fabian Jahr)
fab842b3248744fb0030486f64d3febe815f8377 index, refactor: Rename ReverseBlock to RevertBlock (Fabian Jahr)

Pull request description:

  Closes https://github.com/bitcoin/bitcoin/issues/26362

  This continues the work that was started with #26426. It fixes the overflow issue by switching the tracked values that are in danger of overflowing from `CAmount` to `arith_uint256`.

  The current approach opts for a simple solution to ensure compatibility with datadirs including the previous version of the index: The new version of the index goes into a separate location in the datadir (`index/coinstatsindex/` rather than `index/coinstats/` before, the new naming is more consistent with the naming of the other indexes). There is no explicit concept of versioning of the index which earlier versions of this PR had. Having the two different versions of the index in separate places allows for downgrading of the node without having to rebuild the index. However, there will be a warning printed in the logs if the new code (v30) detects the old index still being present. A future version could delete a left-over legacy index automatically.

  The PR also includes several minor improvements but most notably it lets new entries be calculated and stored without needing to read any DB records.

ACKs for top commit:
  achow101:
    ACK c76797481155754329ec6a6f58e8402569043944
  TheCharlatan:
    ACK c76797481155754329ec6a6f58e8402569043944
  mzumsande:
    Tested / Code Review ACK c76797481155754329ec6a6f58e8402569043944

Tree-SHA512: 3fa4a19dd1a01c1b01390247bc9daa6871eece7c1899eac976e0cc21ede09c79c65f758d14daafc46a43c4ddd7055c85fb28ff03029132d48936b248639c6ab9
2025-09-08 17:06:30 -07:00
Eugene Siegel
8b62647680 test: send duplicate blocktxn message in p2p_compactblocks.py
Add test_multiple_blocktxn_response that checks that the peer is
disconnected.
2025-09-08 17:03:24 -04:00
Fabian Jahr
bb8d673183
test: Add coinstatsindex compatibility test 2025-09-07 17:21:19 +02:00
Fabian Jahr
431a076ae6
index: Fix coinstatsindex overflow issue
The index originally stored cumulative values in a CAmount type but this allowed for
potential overflow issues which were observed on Signet. Fix this by
storing the values that are in danger of overflowing in a arith_uint256.

Also turns an unnecessary copy into a reference in RevertBlock and
CustomAppend and gets
rid of the explicit total unspendable tracking which can be calculated
by adding the four categories of unspendables together.
2025-09-07 17:21:00 +02:00
Pieter Wuille
8d2ee88fa2 tests: add functional tests for IPC interface
Co-Authored-By: ismaelsadeeq <ask4ismailsadiq@gmail.com>
Co-Authored-By: ryanofsky <ryan@ofsky.org>
Co-Authored-By: TheCharlatan <seb.kung@gmail.com>
Co-Authored-By: Sjors Provoost <sjors@sprovoost.nl>
2025-09-05 09:24:14 -04:00
Ryan Ofsky
3cc9a06c8d test: Add TestNode ipcbind option
With this change, tests can specify `self.extra_init = [{ipcbind: True}]` to
start a node listening on an IPC socket, instead of needing to choose which
node binary to invoke and what `self.extra_args=[["-ipcbind=..."]]` value to
pass to it.

The eliminates boilerplate code #30437 (interface_ipc_mining.py), #32297
(interface_ipc_cli.py), and #33201 (interface_ipc.py) previously needed in
their test setup.
2025-09-05 07:15:29 -04:00
Ryan Ofsky
3cceb60a71 test: Provide path to bitcoin binary
Set new `BitcoinTestFramework.binary_paths.bitcoin_bin` property with path to
the `bitcoin` wrapper binary. This allows new tests for `bitcoin-mine` in
#30437 and `bitcoin-cli` in #32297 to find the `bitcoin` binary and call
`bitcoin -m` to start nodes with IPC support. This way the new tests can run
whenever the ENABLE_IPC build option is enabled, instead of only running when
the `BITCOIN_CMD` environment variable is set to `bitcoin -m`
2025-09-05 07:15:29 -04:00
Ryan Ofsky
8c7f005629 test: add is_ipc_compiled() and skip_if_no_ipc() functions
Expose ENABLE_IPC build option to functional tests so new tests can test
IPC-only features.
2025-09-05 07:15:29 -04:00
Ava Chow
46369583f3
Merge bitcoin/bitcoin#33224: doc: unify datacarriersize warning with release notes
2885bd0e1c4fc863a7f28ff0fd353f5cffb03442 doc: unify `datacarriersize` warning with release notes (Lőrinc)

Pull request description:

  Follow-up to https://github.com/bitcoin/bitcoin/pull/32406

  ---

  The [release notes](a189d63618/doc/release-notes-32406.md (L1)) claim

  > [...] marked as deprecated and are expected to be removed in a future release

  but the [warning itself](2885bd0e1c/src/init.cpp (L907)) claims

  > [...] marked as deprecated. They **will** be removed in a future version.

  To be less aggressive (since some have objected against this version online) - and to unify the deprecation warning with the release notes - I have changed the warning to communicate our expectation in a friendlier way.

ACKs for top commit:
  cedwies:
    ACK 2885bd0
  ryanofsky:
    Code review ACK 2885bd0e1c4fc863a7f28ff0fd353f5cffb03442. I don't think it is good for the release notes and the runtime warning message to say two different things. I'd also be happy if release notes were updated to match the runtime warning, instead of vice versa. Whatever is more accurate is better.
  ajtowns:
    ACK 2885bd0e1c4fc863a7f28ff0fd353f5cffb03442
  kevkevinpal:
    ACK [2885bd0](2885bd0e1c)
  achow101:
    ACK 2885bd0e1c4fc863a7f28ff0fd353f5cffb03442
  janb84:
    ACK 2885bd0e1c4fc863a7f28ff0fd353f5cffb03442
  Zero-1729:
    crACK 2885bd0e1c4fc863a7f28ff0fd353f5cffb03442
  jonatack:
    ACK 2885bd0e1c4fc863a7f28ff0fd353f5cffb03442
  hodlinator:
    ACK 2885bd0e1c4fc863a7f28ff0fd353f5cffb03442
  w0xlt:
    ACK 2885bd0e1c
  optout21:
    ACK 2885bd0e1c4fc863a7f28ff0fd353f5cffb03442

Tree-SHA512: a9d2a64ab96b3dd7f3a1a29622930054fd5c56e573bc96330f4ef3327dc024b21b3fbc8a698d17aea7c76f57f0c2ccd6403b2df344ae2f69c645ceb8b6fa54a5
2025-09-02 15:48:41 -07:00
MarcoFalke
fa3f682032
test: Fixup fill_mempool docstring
The assumption was removed in commit
3eab8b724044dc321f70e5eed66b149713158a04.
2025-08-29 08:05:40 +02:00
merge-script
6ff2d42362
Merge bitcoin/bitcoin#33189: rpc: followups for 33106
daa40a3ff97346face9dcc64564010a66c91ccb2 doc fixups for 33106 (glozow)
c568511e8ced011103ef6e3616409fa0ac54408c test fixup for incremental feerate (glozow)
636fa219d37f86067d996c86fada286cedc0d78e test fixups (glozow)
9169a50d529efeae465e55947978f5e470d7f7d0 [rpc] expose blockmintxfee via getmininginfo (glozow)

Pull request description:

  Followups from #33106:
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2271855287
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2271909132
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2274373368
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2275327727
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2275120698
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2275470140
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2271864670
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2275120698
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2277786375
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2277669475
  - https://github.com/bitcoin/bitcoin/pull/33106#discussion_r2279251263

ACKs for top commit:
  ajtowns:
    ACK daa40a3ff97346face9dcc64564010a66c91ccb2 ; cursory review, seems reasonable
  davidgumberg:
    ACK daa40a3ff9
  instagibbs:
    ACK daa40a3ff97346face9dcc64564010a66c91ccb2

Tree-SHA512: d6f0ae5d00dadfbaf0998ac332c8536c997628de4f2b9947eb57712f05d3afa19a823c9cc007435be320640cd13a4c500db20c9606988cdd371934496dec009d
2025-08-28 19:44:31 +01:00