29071 Commits

Author SHA1 Message Date
marcofleon
0a768d4a5a
fuzz: Use __AFL_SHM_ID for naming test directories
Use the AFL++ shared memory ID environment variable to create
a deterministic datadir path. This prevents accumulation of stale
directories after a fuzz iteration crashes or times out. During
long fuzz campaigns, this accumulation has occasionally resulted
in running out of disk space.

Github-Pull: #34445
Rebased-From: d3e681bc06758fe0686cd96fcfd4a1c4c5af62b4
2026-01-30 11:52:57 +00:00
Antoine Poinsot
48749cf4c7
miniscript: correct and_v() properties
and_v() must never be 'd'. This is not a bug fix since this was
unreachable in valid Miniscripts: the first sub of an and_v() must be of
type V, which conflicts with (i.e. never has) property 'd'.

Github-Pull: #34434
Rebased-From: 4fab35cf88c048d2784fe6d71d3f83cc4e420879
2026-01-30 11:51:35 +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
Lőrinc
7e1090f5e8
psbt: Fix PSBTInputSignedAndVerified bounds assert
The previous `assert` used `>=`, allowing `input_index == psbt.inputs.size()` and out-of-bounds access in `psbt.inputs[input_index]`.

Found during review: https://github.com/bitcoin/bitcoin/pull/31650#discussion_r2685892867

Github-Pull: #34272
Rebased-From: 2f5b1c5f80590ffa6b5a5bcfb21fddb1dc22e852
2026-01-14 12:19:04 +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
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
bef4b1fdee
wallet: improve post-migration logging
Right now, after migration the last message users see is "migration completed",
but the migration isn't actually finished yet. We still need to load the new wallets
to ensure consistency, and if that fails, the migration will be rolled back. This
can be confusing for users.

This change logs the post-migration loading step and if a wallet fails to load and
the migration will be rolled back.

Github-Pull: #34156
Rebased-From: d70b159c42008ac3b63d1c43d99d4f1316d2f1ef
2026-01-07 11:20:00 +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
furszy
454ac8e7db
wallet: RestoreWallet failure, erase only what was created
Track what RestoreWallet creates so only those files and directories
are removed during a failure and nothing else. Preexisting paths
must be left untouched.

Note:
Using fs::remove_all() instead of fs::remove() in RestoreWallet does
not cause any problems currently, but the change is necessary for the
next commit which extends RestoreWallet to work with existing directories,
which may contain files that must not be deleted.

Github-Pull: #34156
Rebased-From: 4ed0693a3f2a427ef9e7ad016930ec29fa244995
2026-01-07 11:18:38 +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
brunoerg
f620dde411
fuzz: doc: remove any mention to address_deserialize_v2
Github-Pull: #34091
Rebased-From: caf4843a59a9d2512d69f8fd88a9672112bd80ac
2025-12-31 12:30:48 +00:00
SatsAndSports
18f3ada037
Remove unreliable seed from chainparams.cpp, and the associated README
Github-Pull: #33723
Rebased-From: b0c706795ce6a3a00bf068a81ee99fef2ee9bf7e
2025-12-05 09:46:37 +00:00
glozow
ab58b2c0f8
[wallet] never try to spend from unconfirmed TRUC that already has ancestors
Github-Pull: #33528
Rebased-From: e753fadfd01cb8a4a8de3bddc7391481551cca89
2025-12-05 09:46:32 +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
Hennadii Stepanov
c0d851e6c6
qt: Modernize custom filtering
In `QSortFilterProxyModel`, `invalidateFilter()` is scheduled for
deprecation in Qt 6.13.
`beginFilterChange()` was introduced in Qt 6.9.
`endFilterChange()` was introduced in Qt 6.10.

Github-Pull: gui#899
Rebased-From: e15e8cbadad5ce1de41ebb817b87054f8b5192f2
2025-11-05 09:52:41 +00:00
WakeTrainDev
049bf100f1
qt: add createwallet, createwalletdescriptor, and migratewallet to history filter
Github-Pull: #gui901
Rebased-From: 4e352efa2ce756c668664486c99d003eef530e0c
2025-11-04 11:40:15 +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
42d4847fdf
init: add exe name to bitcoind, bitcoin-node -version output to be able to distinguish these in tests
Github-Pull: #33229
Rebased-From: 0972f5504021b482b27523fd3bcb8036cf6b439c
2025-10-17 15:43:18 +01:00
glozow
96110f8846
[doc] correct topology requirements in submitpackage helptext
Github-Pull: #33630
Rebased-From: 3d222825642bfb052ce40cbc1c69318a0d8835bf
2025-10-17 15:17:37 +01:00
Cory Fields
729e4c2abd
multiprocess: align our logging with libmultiprocess's
Without this change, logging (even if unused) may account for a
substantial portion of bitcoin-node's and/or client's runtime cpu usage, due
to libmultiprocess's expensive message serialization.

This (along with some recent upstream changes) avoids the overhead by opting
out of log handling for messages that we're not interested in.

Info, Warning, and Error are logged unconditionally to match our behavior
elsewhere. See BCLog::Logger::GetCategoryLogLevel .

Github-Pull: #33517
Rebased-From: 0626b90f507db68610a69feec86deb712dd095a1
2025-10-16 09:55:12 +01:00
Cory Fields
f8db6f6ce7
multiprocess: update multiprocess EventLoop construction to use options
This uses the constructors recently added upstream.

Github-Pull: #33517
Rebased-From: 9d068225ee2b79da43e264994cd84279655a2210
2025-10-16 09:55:09 +01:00
merge-script
a14e7b9dee
Merge bitcoin/bitcoin#33519: Update libmultiprocess subtree in 30.x branch
abcd4c4ff928a7af280ca271f8a939367fc4e09a Squashed 'src/ipc/libmultiprocess/' changes from 13424cf2ecc1..a4f929696490 (Ryan Ofsky)

Pull request description:

  Includes:

  - https://github.com/bitcoin-core/libmultiprocess/pull/207
  - https://github.com/bitcoin-core/libmultiprocess/pull/208
  - https://github.com/bitcoin-core/libmultiprocess/pull/211
  - https://github.com/bitcoin-core/libmultiprocess/pull/201
  - https://github.com/bitcoin-core/libmultiprocess/pull/213
  - https://github.com/bitcoin-core/libmultiprocess/pull/214
  - https://github.com/bitcoin-core/libmultiprocess/pull/221
  - https://github.com/bitcoin-core/libmultiprocess/pull/220
  - https://github.com/bitcoin-core/libmultiprocess/pull/222
  - https://github.com/bitcoin-core/libmultiprocess/pull/224

  Corresponding to #32641 and #33518 in master.

  The changes can be verified by running `test/lint/git-subtree-check.sh src/ipc/libmultiprocess` as described in [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#subtrees) and [lint instructions](https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh)

  They can also be verified by checking `src/ipc/libmultiprocess/` contents are the same in master. (See also #33439).

ACKs for top commit:
  Sjors:
    ACK ae63cc4bf2d25a5b7ce9d166aa288431e8ca16a7
  theuni:
    ACK ae63cc4bf2d25a5b7ce9d166aa288431e8ca16a7 . Verified that it's the same as what's in master.

Tree-SHA512: 6c9462d5fb9201ee8ace900d7d02bfb6d0c7aa3d2f22475dc55e55e0239e2d20ed69f572c0df233da7910375e9d8ccaf3e84bf949ae92df27b88f16adb26dd7a
2025-10-16 09:53:04 +01:00
Ryan Ofsky
ae63cc4bf2 Merge commit 'abcd4c4ff928a7af280ca271f8a939367fc4e09a' into pr/subtree-6-v30 2025-10-07 10:12:08 -04:00
Ryan Ofsky
abcd4c4ff9 Squashed 'src/ipc/libmultiprocess/' changes from 13424cf2ecc1..a4f929696490
a4f929696490 Merge bitcoin-core/libmultiprocess#224: doc: fix typos
f4344ae87da0 Merge bitcoin-core/libmultiprocess#222: test, ci: Fix threadsanitizer errors in mptest
1434642b3804 doc: fix typos
73d22ba2e930 test: Fix tsan race in thread busy test
b74e1bba014d ci: Use tsan-instrumented cap'n proto in sanitizers job
c332774409ad test: Fix failing exception check in new thread busy test
ca3c05d56709 test: Use KJ_LOG instead of std::cout for logging
7eb1da120ab6 ci: Use tsan-instrumented libcxx in sanitizers job
ec86e4336e98 Merge bitcoin-core/libmultiprocess#220: Add log levels and advertise them to users via logging callback
515ce93ad349 Logging: Pass LogData struct to logging callback
213574ccc43d Logging: reclassify remaining log messages
e4de0412b430 Logging: Break out expensive log messages and classify them as Trace
408874a78fdc Logging: Use new logging macros
67b092d835cd Logging: Disable logging if messsage level is less than the requested level
d0a1ba7ebf21 Logging: add log levels to mirror Core's
463a8296d188 Logging: Disable moving or copying Logger
83a2e10c0b03 Logging: Add an EventLoop constructor to allow for user-specified log options
58cf47a7fc8c Merge bitcoin-core/libmultiprocess#221: test default PassField impl handles output parameters
db03a663f514 Merge bitcoin-core/libmultiprocess#214: Fix crash on simultaneous IPC calls using the same thread
afcc40b0f1e8 Merge bitcoin-core/libmultiprocess#213: util+doc: Clearer errors when attempting to run examples + polished docs
6db669628387 test In|Out parameter
29cf2ada75ea test default PassField impl handles output parameters
1238170f68e8 test: simultaneous IPC calls using same thread
eb069ab75d83 Fix crash on simultaneous IPC calls using the same thread
ec03a9639ab5 doc: Precision and typos
2b4348193551 doc: Where possible, remove links to ryanofsky/bitcoin/
286fe469c9c9 util: Add helpful error message when failing to execute file
47d79db8a552 Merge bitcoin-core/libmultiprocess#201: bug: fix mptest hang, ProxyClient<Thread> deadlock in disconnect handler
f15ae9c9b9fb Merge bitcoin-core/libmultiprocess#211: Add .gitignore
4a269b21b8c8 bug: fix ProxyClient<Thread> deadlock if disconnected as IPC call is returning
85df96482c49 Use try_emplace in SetThread instead of threads.find
ca9b380ea91a Use std::optional in ConnThreads to allow shortening locks
9b0799113557 doc: describe ThreadContext struct and synchronization requirements
d60db601ed9b proxy-io.h: add Waiter::m_mutex thread safety annotations
4e365b019a9f ci: Use -Wthread-safety not -Wthread-safety-analysis
15d7bafbb001 Add .gitignore
fe1cd8c76131 Merge bitcoin-core/libmultiprocess#208: ci: Test minimum cmake version in olddeps job
b713a0b7bfbc Merge bitcoin-core/libmultiprocess#207: ci: output CMake version in CI script
0f580397c913 ci: Test minimum cmake version in olddeps job
d603dcc0eef0 ci: output CMake version in CI script

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: a4f92969649018ca70f949a09148bccfeaecd99a
2025-10-07 10:12:08 -04:00
merge-script
d5e0077bef
Merge bitcoin/bitcoin#33473: [30.x] Backports & rc3
4e869a67aa7415f9c756bf6463e3437ae0a3ec44 doc: update example bitcoin conf for 30.0rc3 (fanquake)
a2ac6cce5780b98e6bba6b22eb66765258165cee doc: update manual pages for v30.0rc3 (fanquake)
e4b568917c8a73df30c9ab59575ada0eda8f27bf build: bump version to v30.0rc3 (fanquake)
f957c2171d9667ba133532080f0e1f065bd67593 contrib: fix using macdploy script without translations. (amisha)
1eb578045d295095de95840fcfc800f74c8ca098 depends: static libxcb_cursor (fanquake)
e4f9ec2f05bd28f9cfc35a0d914f3772c1c7666c test: add more TRUC reorg coverge (Greg Sanders)
348525258435ec84c20281a78fda4ad1b5a5565e Mempool: Do not enforce TRUC checks on reorg (Greg Sanders)
a3a1dcb589e417609ae29121e50bb61633e125bd fuzz: don't bypass_limits for most mempool harnesses (Greg Sanders)
fce1c607708871b34f58961897b862ecac12ec99 datacarrier: Undeprecate configuration option (Anthony Towns)
b75afaccb8b83890b416af9b54711683493d0f89 doc: rpc: fix case typo in `finalizepsbt` help (final_scriptwitness) (Sebastian Falbesoner)
45703931e5290dbae44b080394550234489fb704 miner: fix `addPackageTxs` unsigned integer overflow (ismaelsadeeq)
1e348bc55a821780630608e6bb936eaebf96db54 rpc: fix getblock(header) returns target for tip (Sjors Provoost)
4ec30d53eca271ab52fd9ac7b8aef585f572fb4e test: add block 2016 to mock mainnet (Sjors Provoost)

Pull request description:

  Backports:
  * #33434
  * #33446
  * #33453
  * #33475
  * #33482
  * #33484
  * #33504

  Includes changes for `v30.0rc3`:
  * Version bump
  * Regen manpages
  * Regen exmaple .conf

ACKs for top commit:
  marcofleon:
    lgtm ACK 4e869a67aa7415f9c756bf6463e3437ae0a3ec44
  dergoegge:
    ACK 4e869a67aa7415f9c756bf6463e3437ae0a3ec44
  hebasto:
    ACK 4e869a67aa7415f9c756bf6463e3437ae0a3ec44, I agree on the backported PRs. I've reproduced locally all backports, the manpages update, and the example `bitcoin.conf` updated, and obtained zero diff with this PR.
  Zero-1729:
    LGTM ACK 4e869a67aa7415f9c756bf6463e3437ae0a3ec44

Tree-SHA512: 90bffbb6dfe2b512167b5e08253ea163b714505ec3ef2247d798c40b30713a7db13cf0b5486b5f9e0e5b3ba53108dfaeea47276c40816eeb81065d42bd402379
2025-10-06 10:37:26 +01:00
Hennadii Stepanov
71ee0163de
qt: 30.0rc3 translations update 2025-10-05 11:53:45 +01:00
Greg Sanders
3485252584
Mempool: Do not enforce TRUC checks on reorg
Not enforcing TRUC topology on reorg was the intended
behavior, but the appropriate bypass argument was not
checked.

This mistake means we could potentially invalidate a long
chain of perfectly incentive-compatible transactions that
were made historically, including subsequent non-TRUC
transactions, all of which may have been very high feerate.

Lastly, it wastes CPU cycles doing topology checks since
this behavior cannot actually enforce the topology in
general for the reorg setting.

Github-Pull: #33504
Rebased-From: 26e71c237d9d2197824b547f55ee3a0a60149f92
2025-10-02 13:55:58 +01:00
Greg Sanders
a3a1dcb589
fuzz: don't bypass_limits for most mempool harnesses
Using bypass_limits=true is essentially fuzzing part of a
reorg only, and results in TRUC invariants unable to be
checked. Remove most instances of bypassing limits, leaving
one harness able to do so.

Github-Pull: #33504
Rebased-From: bbe8e9063c15dc230553e0cbf16d603f5ad0e4cf
2025-10-02 13:55:33 +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
Sebastian Falbesoner
b75afaccb8
doc: rpc: fix case typo in finalizepsbt help (final_scriptwitness)
Github-Pull: #33484
Rebased-From: ff05bebcc4262966b117082a67dc4c63a3f67d2d
2025-09-28 18:14:03 -04:00
ismaelsadeeq
45703931e5
miner: fix addPackageTxs unsigned integer overflow
Github-Pull: #33475
Rebased-From: b807dfcdc5929c314d43b790c9e705d5bf0a86e8
2025-09-25 08:19:33 -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
Lőrinc
acf7d53ace
test: split out system_ram_tests to signal when total ram cannot be determined
when `GetTotalRAM` returns an `std::nullopt` now we're getting:
```
The following tests did not run:
        106 - system_ram_tests (Skipped)
```

GitHub-Pull: #33435
Rebased-From: 56791b582958e905e5ba5cbf172a8ea7dad1a8b0
2025-09-23 10:20:06 -04:00
Vasil Dimov
ce56548c63
system: improve handling around GetTotalRAM()
This patch achieves two things:
1. Fix unused variable warning (https://github.com/bitcoin/bitcoin/pull/33333#discussion_r2362493046)
2. Enable GetTotalRAM() on other platforms where it was tested to work.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>

Github-Pull: #33435
Rebased-From: 337a6e738616781f81504275bac8ed7bcf8068df
2025-09-23 10:20:06 -04:00
Lőrinc
5226a92f28
coins: warn on oversized -dbcache
Oversized allocations can cause out-of-memory errors or [heavy swapping](https://github.com/getumbrel/umbrel-os/issues/64#issuecomment-663637321), [grinding the system to a halt](https://x.com/murchandamus/status/1964432335849607224).

`LogOversizedDbCache()` now emits a startup warning if the configured `-dbcache` exceeds a cap derived from system RAM, using the same parsing/clamping as cache sizing via CalculateDbCacheBytes(). This isn't meant as a recommended setting, rather a likely upper limit.

Note that we're not modifying the set value, just issuing a warning.
Also note that the 75% calculation is rounded for the last two numbers since we have to divide first before multiplying, otherwise we wouldn't stay inside size_t on 32-bit systems - and this was simpler than casting back and forth.

We could have chosen the remaining free memory for the warning (e.g. warn if free memory is less than 1 GiB), but this is just a heuristic, we assumed that on systems with a lot of memory, other processes are also running, while memory constrained ones run only Core.

If total RAM < 2 GiB, cap is `DEFAULT_DB_CACHE` (`450 MiB`), otherwise it's 75% of total RAM.
The threshold is chosen to be close to values commonly used in [raspiblitz](https://github.com/raspiblitz/raspiblitz/blob/dev/home.admin/_provision.setup.sh#L98-L115) for common setups:

| Total RAM | `dbcache` (MiB) | raspiblitz % | proposed cap (MiB) |
|----------:|----------------:|-------------:|-------------------:|
|     1 GiB |             512 |        50.0% |               450* |
|     2 GiB |            1536 |        75.0% |               1536 |
|     4 GiB |            2560 |        62.5% |               3072 |
|     8 GiB |            4096 |        50.0% |               6144 |
|    16 GiB |            4096 |        25.0% |              12288 |
|    32 GiB |            4096 |        12.5% |              24576 |

[Umbrel issues](https://github.com/getumbrel/umbrel-os/issues/64#issuecomment-663816367) also mention 75% being the upper limit.

Starting `bitcoind` on an 8 GiB rpi4b with a dbcache of 7 GiB:
> ./build/bin/bitcoind -dbcache=7000

warns now as follows:
```
2025-09-07T17:24:29Z [warning] A 7000 MiB dbcache may be too large for a system memory of only 7800 MiB.
2025-09-07T17:24:29Z Cache configuration:
2025-09-07T17:24:29Z * Using 2.0 MiB for block index database
2025-09-07T17:24:29Z * Using 8.0 MiB for chain state database
2025-09-07T17:24:29Z * Using 6990.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
```

Besides the [godbolt](https://godbolt.org/z/EPsaE3xTj) reproducers for the new total memory method, we also tested the warnings manually on:
- [x] Apple M4 Max, macOS 15.6.1
- [x] Intel Core i9-9900K, Ubuntu 24.04.2 LTS
- [x] Raspberry Pi 4 Model B, Armbian Linux 6.12.22-current-bcm2711
- [x] Intel Xeon x64, Windows 11 Home Version 24H2, OS Build 26100.4351

Co-authored-by: stickies-v <stickies-v@protonmail.com>
Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
Co-authored-by: w0xlt <woltx@protonmail.com>

Github-Pull: #33333
Rebased-From: 168360f4ae47cbfdb30a2cc4704435bc67e12f16
2025-09-23 10:20:06 -04:00
Lőrinc
49d4ebcbfe
system: add helper for fetching total system memory
Added a minimal system helper to query total physical RAM on [Linux/macOS/Windows](https://stackoverflow.com/a/2513561) (on other platforms we just return an empty optional).

The added test checks if the value is roughly correct by checking if the CI platforms are returning any value and if the value is at least 1 GiB and not more than 10 TiB.

The max value is only validated on 64 bits, since it's not unreasonable for 32 bits to have max memory, but on 64 bits it's likely an error.

https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-memorystatusex
> ullTotalPhys The amount of actual physical memory, in bytes.

https://man7.org/linux/man-pages/man3/sysconf.3.html:
> _SC_PHYS_PAGES The number of pages of physical memory. Note that it is possible for the product of this value and the value of _SC_PAGESIZE to overflow.
> _SC_PAGESIZE Size of a page in bytes. Must not be less than 1.

See https://godbolt.org/z/ec81Tjvrj for further details

Github-Pull: #33333
Rebased-From: 6c720459beead5c825b354a1d5c11969b6e3a170
2025-09-23 10:20:06 -04:00
Anthony Towns
1bc3be1962
p2p: Increase tx relay rate
In the presence of smaller transactions on the network, blocks can sustain a
higher relay rate than 7tx/second. In this event, the per-peer inventory queues
can grow too large.

This commit bumps the rate up to 14 tx/s (for inbound peers), increasing the
safety margin by a factor of 2.

Outbound peers continue to receive relayed transactions at 2.5x the rate of
inbound peers, for a rate of 35tx/second.

Co-Authored-By: Suhas Daftuar <sdaftuar@gmail.com>

Github-Pull: #28592
Rebased-From: b81f37031c8f2ccad9346f1b65ee0f8083c44796
2025-09-23 10:20:05 -04:00
Hennadii Stepanov
33a0d4bb5b
qt: 30.0rc2 translations update 2025-09-21 21:38:11 +01:00
Hennadii Stepanov
c9f751090c
cmake: Install bitcoin manpage
Github-Pull: #33407
Rebased-From: 7584a4fda95d004d31c2df15fdb6f3a7f9654348
2025-09-17 09:58:49 +01:00
Martin Zumsande
2327b2b0db
net: Do not apply whitelist permission to onion inbounds
Tor inbound connections do not reveal the peer's actual network address.
Therefore do not apply whitelist permissions to them.

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

Github-Pull: #33395
Rebased-From: f563ce90818d486d2a199439d2f6ba39cd106352
2025-09-17 09:58:25 +01:00
Ryan Ofsky
3ae592537d
test: Prevent disk space warning during node_init_tests
mzumsande pointed out https://github.com/bitcoin/bitcoin/pull/32345#issuecomment-3286964369 that this test was causing a warning:

   Warning: Disk space for "/tmp/test_common bitcoin/node_init_tests/init_test/bf78678cb7723a3e84b5/blocks" may not accommodate the block files. Approximately 810 GB of data will be stored in this directory.

Fix by setting regtest instead of mainnet network before running the test.

Github-Pull: #33391
Rebased-From: bdf01c6f61262cd6e211ead3c0dbc66ccb48b32f
2025-09-16 09:49:48 +01:00
Ava Chow
75026cddea
wallet: Add m_cached_from_me to cache "from me" status
m_cached_from_me is used to track whether a transaction is "from me", i.e. has
any inputs which belong to the wallet. This is held in memory only in
the same way that a transaction's balances are.

Github-Pull: #33268
Rebased-From: 113a4228229baedda2a730e097f2d59ad58a4b0d
2025-09-12 14:52:45 +01:00
Ava Chow
b85dc7ed3a
wallet: Throw an error in sendall if the tx size cannot be calculated
Github-Pull: #33268
Rebased-From: c40dc822d74aea46e4a21774ca282e008f609c2a
2025-09-12 14:51:51 +01:00
Ava Chow
d2be9a22d8
wallet: Determine IsFromMe by checking for TXOs of inputs
Instead of checking whether the total amount of inputs known by the
wallet is greater than 0, we should be checking for whether the input is
known by the wallet. This enables us to determine whether a transaction
spends an of output with an amount of 0, which is necessary for marking
0-value dust outputs as spent.

Github-Pull: #33268
Rebased-From: 39a7dbdd277d1dea9a70314d8cc5ae057999ee88
2025-09-12 14:48:15 +01:00
Luke Dashjr
35038b03c9
trace: Workaround GCC bug compiling with old systemtap
Github-Pull: #33310
Rebased-From: 93a29ff2830162c8129d35c7b9beb43fab984503
2025-09-12 11:50:28 +01:00
David Gumberg
6b19ede1a5
gui: Avoid pathological QT text/markdown behavior...
during text selection by only setting plaintext mime data.

Github-Pull: https://github.com/bitcoin-core/gui/pull/886
Rebased-From: 6a371b70c87ad6b763c89384562fce8549f37434
2025-09-10 12:43:27 +01:00
merge-script
84cf542039
Merge bitcoin/bitcoin#33275: Release: 30.0 translations update
b320f5efa1753aead857d4cddd742af16e51d8d1 qt: 30.0 translations update (Hennadii Stepanov)

Pull request description:

  This PR follows our [Release Process](53a996f122/doc/release-process.md) and concludes the translation-specific efforts for this release cycle. It follows two previous translation-related PRs, https://github.com/bitcoin/bitcoin/pull/33152 and https://github.com/bitcoin/bitcoin/pull/33193.

  It is one of the steps required _before_ branch-off, as scheduled in https://github.com/bitcoin/bitcoin/issues/32275.

  A previous similar PR: https://github.com/bitcoin/bitcoin/pull/32004.

  **Notes for reviewers:**
  1. The actual translations on Transifex is a moving target. As a result, your diff after running [`bitcoin-maintainer-tools/update-translations.py`](https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/update-translations.py) may differ.

  2. The Polish translation update has been discarded. See https://github.com/bitcoin/bitcoin/pull/33275#issuecomment-3265688565 and https://github.com/bitcoin/bitcoin/pull/33275#issuecomment-3265829027.

ACKs for top commit:
  fanquake:
    ACK b320f5efa1753aead857d4cddd742af16e51d8d1

Tree-SHA512: 3e34c0fc7471dd27deeff2c871baa523e8741724e2aee5ed8afdf90263904f489dd77df849953425c9f0395dc23932dc4729646e0e4445f53225683f4f635087
2025-09-09 10:20:05 +01:00
merge-script
9cbd346daa
Merge bitcoin/bitcoin#33340: Fix benchmark CSV output
790b440197bde322432a5bab161f1869b667e681 Fix benchmark CSV output (Hennadii Stepanov)

Pull request description:

  The `SHA256AutoDetect` return output is used, among other use cases, to name benchmarks. Using a comma breaks the `bench_bitcoin` CSV output.

  This PR replaces the comma with a semicolon, which fixes https://github.com/bitcoin/bitcoin/issues/33331.

ACKs for top commit:
  Raimo33:
    Code Review ACK 790b440197bde322432a5bab161f1869b667e681
  l0rinc:
    Code review ACK 790b440197bde322432a5bab161f1869b667e681
  janb84:
    code review ACK 790b440197bde322432a5bab161f1869b667e681

Tree-SHA512: 096bfa29a0639a4d97d510a3e2a15f071f384148c3035e4d0fc525794682e499c45a0d0c95728d5c78010098393b2c486a7fa9c21c1e2fbb600dea7c5638a55f
2025-09-09 10:11:29 +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