46168 Commits

Author SHA1 Message Date
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
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
willcl-ark
c48d3a6ad8
ci: expose all ACTIONS_* vars
When using `docker buildx build` in conjunction with the `gha` backend
cache type, it's important to specify the URL and TOKEN needed to
authenticate.

On Cirrus runners this is working with only `ACTIONS_CACHE_URL` and
`ACTIONS_RUNTIME_TOKEN`, but this is not enough for the GitHub backend.

Fix this by exporting all `ACTIONS_*` variables.

This fixes cache restore/save on forks or where GH-hosted runners are
being used.

Github-Pull: #33508
Rebased-From: bc706955d740f8a59bec78e44d33e80d1cca373b
2025-10-16 09:53:44 +01:00
Ava Chow
73ed57a35e
depends: Use $(package)_file_name when downloading from the fallback
Github-Pull: #33580
Rebased-From: 671b774d1b58c491b53f2b2f6ee42fb6b65a0e71
2025-10-16 09:53:44 +01:00
MarcoFalke
72d1141bd8
ci: Use native platform for win-cross task
Github-Pull: #33558
Rebased-From: fa6fd16f36e1240cda58a46e1717b02e8d3172a3
2025-10-16 09:53:44 +01:00
Ava Chow
c9fa661131
ci: Properly include $FILE_ENV in DEPENDS_HASH
$FILE_ENV has a full relative path already, prepending with ci/test/
results in a non-existent path which means that DEPENDS_HASH was not
actually committing to the test's environment file.

Github-Pull: #33581
Rebased-From: ceeb53adcd0a6a87a65c8ebbb20472c15c502dfd
2025-10-16 09:53:44 +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
merge-script
d0f6d9953a
Merge bitcoin/bitcoin#33559: [30.x] Finalise v30.0
d615eb6998eeccb9106854dffa95f36b319177e1 doc: re-import release notes for v30.0 (fanquake)
f725754615185ecbdd60719a1253ba9b7b806c7f doc: update manual pages for v30.0 (fanquake)
d7c89ba74e1ca3d0f98e50dbf2c5ec9bc2f6a33d build: bump version to v30.0 (fanquake)

Pull request description:

  Finalise `v30.0`.
  Imports the release notes from https://github.com/bitcoin-core/bitcoin-devwiki/wiki/v30.0-Release-Notes-Draft.

ACKs for top commit:
  instagibbs:
    ACK d615eb6998eeccb9106854dffa95f36b319177e1
  achow101:
    ACK d615eb6998eeccb9106854dffa95f36b319177e1
  janb84:
    ACK d615eb6998eeccb9106854dffa95f36b319177e1
  darosior:
    ACK d615eb6998eeccb9106854dffa95f36b319177e1

Tree-SHA512: 82c2879ad09a4f6ec02f63411bcb8fa4900b8af2cbc2bc588fc0f06fa622253c3ef7e7b4c642f5e7239b088acd17f97b2cca73d15513b75297c2872d3146c673
v30.0
2025-10-09 16:04:52 -04:00
fanquake
d615eb6998
doc: re-import release notes for v30.0
Taken from
https://github.com/bitcoin-core/bitcoin-devwiki/wiki/v30.0-Release-Notes-Draft.
2025-10-08 10:22:50 +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
fanquake
f725754615
doc: update manual pages for v30.0 2025-10-07 11:18:46 +01:00
fanquake
d7c89ba74e
build: bump version to v30.0 2025-10-07 11:18:43 +01: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
v30.0rc3
2025-10-06 10:37:26 +01:00
merge-script
2869dae5ec
Merge bitcoin/bitcoin#33541: Release: 30.0rc3 translations update
71ee0163dedd28327993415120e864253b127f8e qt: 30.0rc3 translations update (Hennadii Stepanov)

Pull request description:

  This PR updates the Polish (pl) translation and addresses [this](https://github.com/bitcoin/bitcoin/pull/33275#issuecomment-3329617679) comment.

  Updates for other languages have been skipped, as I believe the review effort would not be worthwhile at this stage of the release process.

ACKs for top commit:
  maflcko:
    Though, this lgtm ACK 71ee0163dedd28327993415120e864253b127f8e
  janb84:
    ACK 71ee0163dedd28327993415120e864253b127f8e

Tree-SHA512: e9ee8146542d0928f5ddaac5b2cb0c0032cd7d236fc19b38fd4ebe91e13eccdfa7d25ff279376c3f27f0bc461729b2c0574fedbb670a2555bc7a534e5ec0cd76
2025-10-06 10:24:07 +01:00
Hennadii Stepanov
71ee0163de
qt: 30.0rc3 translations update 2025-10-05 11:53:45 +01:00
fanquake
4e869a67aa
doc: update example bitcoin conf for 30.0rc3 2025-10-03 16:33:13 +01:00
fanquake
a2ac6cce57
doc: update manual pages for v30.0rc3 2025-10-03 16:32:40 +01:00
fanquake
e4b568917c
build: bump version to v30.0rc3 2025-10-03 16:28:31 +01:00
amisha
f957c2171d
contrib: fix using macdploy script without translations.
QT translations are optional, but the script would error when
'translations_dir' falls back to its default value NULL.

This PR fixes it by moving the set-up of QT translations under
the check for 'translations_dir' presence.

Github-Pull: #33482
Rebased-From: 7b5261f7ef3d88361204c40eb10c0d9dc44f5ed7
2025-10-03 15:41:37 +01:00
fanquake
1eb578045d
depends: static libxcb_cursor
Modern Ubuntu isn't shipping with this library installed by default.
Staticly link it to remove the need for end-users to install it.

Closes #33432.

Github-Pull: #33434
Rebased-From: eca50854e1cb04e20478bd3df4762e18520a3611
2025-10-03 15:27:48 +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
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
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
merge-script
72c1f13c33
Merge bitcoin/bitcoin#33424: [30.0] Final changes + rc2
7ebdfa2173b90faad71057d37b6b71c462dd3ea1 ci: link against -lstdc++ in native fuzz with msan job (fanquake)
ecbcef33d698371f1478d2635ba5295ec9e21b4c doc: remove unrelated `bitcoin-wallet` binary from `libbitcoin_ipc` description (Sebastian Falbesoner)
8c973d66141af72e2484864c37a86e3615f4b5bc ci: disable cirrus cache in 32bit arm job (will)
2378bbf3560fd886b86081f340c9fd94b5add6cb ci: refactor docker action to return provider str (will)
acf7d53ace4c25e6f77edf842d79df858cd6ba5c test: split out `system_ram_tests` to signal when total ram cannot be determined (Lőrinc)
ce56548c63404877f8e3bcc21764bd23fb063887 system: improve handling around GetTotalRAM() (Vasil Dimov)
5226a92f282b26b5fec27ef4fa9660d035ce0154 coins: warn on oversized -dbcache (Lőrinc)
49d4ebcbfe4c71dbf05f6bb777bf976a7416a04a system: add helper for fetching total system memory (Lőrinc)
0a80b1ae6258f14339c4d00356630e6d26014c62 doc: update manual pages for v30.0rc2 (fanquake)
b8fb918969cf472b4a6ff5e5ff5b910e0890c516 build: bump version to v30.0rc2 (fanquake)
792a75ac869c17426f6291d93ebee93a9b985863 build(windows): Remove lingering registry entries and shortcuts upon install (Hodlinator)
1bc3be19620dd4b753a5e15003aec4d66d4fef21 p2p: Increase tx relay rate (Anthony Towns)
4b02bc1a7235375f3d3450d7b395a8353de8db9e test: Avoid interface_ipc.py Duplicate ID errors (Ryan Ofsky)

Pull request description:

  Backports:
  * #28592
  * #33302
  * #33333
  * #33420
  * #33422
  * #33425
  * #33435
  * #33459

  Finalise `v30.0rc2`

ACKs for top commit:
  willcl-ark:
    ACK 7ebdfa2173b90faad71057d37b6b71c462dd3ea1
  hebasto:
    ACK 7ebdfa2173b90faad71057d37b6b71c462dd3ea1, I applied all backports locally without conflicts and obtained a zero diff with this PR branch.

Tree-SHA512: 73d641a5d783511a959e63f240453bb020705cb620b85a5a0968b32b937ac28816ef142f78bdf41976ed1c2bee431def945c5c37da33621031e3198cfdae51f3
v30.0rc2
2025-09-23 18:46:24 -04:00
fanquake
7ebdfa2173
ci: link against -lstdc++ in native fuzz with msan job
Github-Pull: #33425
Rebased-From: b77137a5644e09a08442aed7d8a4a9290fb53526
2025-09-23 10:20:07 -04:00
Sebastian Falbesoner
ecbcef33d6
doc: remove unrelated bitcoin-wallet binary from libbitcoin_ipc description
`bitcoin-wallet` as-is is merely an offline wallet inspection tool
(introduced more than 9 years ago in PR #13926) that doesn't have any
relation with IPC/multiprocess, so remove it from the list of binaries
that use `libbitcoin_ipc`.

Github-Pull: #33459
Rebased-From: fbde8d9a81d82e53933fe45e36d3a70206a48e0e
2025-09-23 10:20:07 -04:00
will
8c973d6614
ci: disable cirrus cache in 32bit arm job
Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
Add an optional matrix field allowing opt-out of configuring cirrus
GHA cache when not using cirrus runners.

This is not needed for the cirruslabs/[save|restore]-cache actions, as
they automatically fallback based on runner type.

Github-Pull: #33302
Rebased-From: 00c253d494176b31dc4aaba24dc7e61aecb20be2
2025-09-23 10:20:06 -04:00
will
2378bbf356
ci: refactor docker action to return provider str
Avoid relying on future truthy evaluations of string 'false'.

Github-Pull: #33302
Rebased-From: ff18b6bbaf322739fe98fd51b0d89d65a5775ab5
2025-09-23 10:20:06 -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
fanquake
0a80b1ae62
doc: update manual pages for v30.0rc2 2025-09-23 10:20:06 -04:00
fanquake
b8fb918969
build: bump version to v30.0rc2 2025-09-23 10:20:06 -04:00
Hodlinator
792a75ac86
build(windows): Remove lingering registry entries and shortcuts upon install
Prior releases installed using these paths. Especially annoying was that the lingering registry entry for the uninstaller would show up as "Bitcoin Core (64-bit)" besides the current "Bitcoin Core" entry in the list of installed programs, and whichever was uninstalled last would fail to work as they would default to the same install directory.

Github-Pull: #33422
Rebased-From: 79752b9c0b6bd9b2203ac98d28dd67734050c14a
2025-09-23 10:20:05 -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
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
merge-script
52bcf62c0b
Merge bitcoin/bitcoin#33452: Release: 30.0rc2 translations update
33a0d4bb5b475ddec00229366183c7aabe4c3501 qt: 30.0rc2 translations update (Hennadii Stepanov)

Pull request description:

  This PR updates Spanish (es) and Czech (cs) translations and addresses the following comments:
  - https://github.com/bitcoin/bitcoin/pull/33275#issuecomment-3315273628
  - https://github.com/bitcoin/bitcoin/pull/33275#issuecomment-3316206549

  Updates for other languages were skipped, as I believe the review effort would not be worthwhile at this stage of the release process.

ACKs for top commit:
  fanquake:
    ACK 33a0d4bb5b475ddec00229366183c7aabe4c3501.

Tree-SHA512: 94c1c1fb4a0079f3e733c573ba1fddd149307ec39220e811d33f5bbfd929a634b24ef9adbe9e789bd0127539ce5e134dde3a241db0e233d53446abf96a4d49b6
2025-09-23 10:18:54 -04:00
Hennadii Stepanov
33a0d4bb5b
qt: 30.0rc2 translations update 2025-09-21 21:38:11 +01:00
merge-script
b7a722724d
Merge bitcoin/bitcoin#33356: [30.0] rc2 backports
c9f751090cb638ad8fff600133349446bf426e15 cmake: Install `bitcoin` manpage (Hennadii Stepanov)
2327b2b0db084fdaefa0a8e9d666fa3a4bc90c07 net: Do not apply whitelist permission to onion inbounds (Martin Zumsande)
26208b3a0c8ca68421c343fab61945a71684bffb test: Add submitblock test in interface_ipc (TheCharlatan)
3ae592537d52deaf4e123c2469c42784b86a9d07 test: Prevent disk space warning during node_init_tests (Ryan Ofsky)
5dbb1bae38576adcc007a61f15cc81b377f3fe4d ci: Enable CI_LIMIT_STACK_SIZE=1 in i686_no_ipc task (MarcoFalke)
c7faf72ac64b57e04a563b1093b7292f28e6a4d0 test: Fix CLI_MAX_ARG_SIZE issues (MarcoFalke)
0a2afbeb776bd47953d65843df343a4ee2c59e0e cmake: Fix regression in `secp256k1.cmake` (Hennadii Stepanov)
75026cddea26eaaabaaebdf6024c66c56d1722c7 wallet: Add m_cached_from_me to cache "from me" status (Ava Chow)
bbb4e118f35e24ee3ac2f63e8cdc388cc9166d16 test: Add a test for anchor outputs in the wallet (Ava Chow)
b85dc7ed3ae68c963c5dc2330d272fd4da49e205 wallet: Throw an error in sendall if the tx size cannot be calculated (Ava Chow)
d2be9a22d8e2b0d10ee7871dc2b39f0d95bad057 wallet: Determine IsFromMe by checking for TXOs of inputs (Ava Chow)
ad6c13e041b91005a5ecc6f4aa8370fe9500454d test: Test wallet 'from me' status change (Ava Chow)
35038b03c9cfbcde2fda977c848173b24e514b59 trace: Workaround GCC bug compiling with old systemtap (Luke Dashjr)
f7eded1dca5377c3e15ffbfcabc426f19778d2f8 ci: always use tag for LLVM checkout (fanquake)
6b19ede1a5b500d66e8edaef6e8d80492ed9f74f gui: Avoid pathological QT text/markdown behavior... (David Gumberg)

Pull request description:

  Backports:
  * #33243
  * #33268
  * #33310
  * #33364
  * #33379
  * #33380
  * #33391
  * #33407
  * https://github.com/bitcoin-core/gui/pull/886

ACKs for top commit:
  darosior:
    utACK c9f751090cb638ad8fff600133349446bf426e15
  hebasto:
    ACK c9f751090cb638ad8fff600133349446bf426e15, I applied all backports locally without conflicts and obtained a zero diff with this PR branch.

Tree-SHA512: 257cc5bd0423fbf2aff62c72957faea3de8731353d809b11e18d0e5cad174c7023dca9dedd0c73e07497eb804b7c48355a055b4461db260e2f0a5712d2514ff6
2025-09-17 14:01:51 -04:00
Hennadii Stepanov
c9f751090c
cmake: Install bitcoin manpage
Github-Pull: #33407
Rebased-From: 7584a4fda95d004d31c2df15fdb6f3a7f9654348
2025-09-17 09:58:49 +01:00