46317 Commits

Author SHA1 Message Date
merge-script
49faec4f87 Merge bitcoin/bitcoin#35668: [30.x] Finalise 30.3
3e3c3d66de doc: update manual pages for v30.3 (fanquake)
0a1d238b25 doc: update release notes for v30.3 (fanquake)
ad5b171a7b build: bump version to v30.3 (fanquake)

Pull request description:

  The [`v30.3rc1` bins](https://bitcoincore.org/bin/bitcoin-core-30.3/test.rc1/) have been up for nearly 2 weeks. There doesn't seem to be anything else that needs backporting, and no issues have been reported. Finalise `v30.3`.

ACKs for top commit:
  hebasto:
    ACK 3e3c3d66de.
  sedited:
    ACK 3e3c3d66de

Tree-SHA512: 03677d5cdd3c910a8e84e91484358a3377bfc11db48dea43cd386808c8674359872e7c90ae91960a9e1f23a7d57affe74d1c96d55d3263c71be2582aadc7b31c
v30.3
2026-07-06 21:37:49 +02:00
fanquake
3e3c3d66de doc: update manual pages for v30.3 2026-07-06 15:11:59 +01:00
fanquake
0a1d238b25 doc: update release notes for v30.3 2026-07-06 14:59:48 +01:00
fanquake
ad5b171a7b build: bump version to v30.3 2026-07-06 14:59:21 +01:00
merge-script
7bc403c1a8 Merge bitcoin/bitcoin#35452: [30.x] 30.3rc1
d52747d8e7 doc: update manual pages for v30.3rc1 (fanquake)
a1406d6333 build: bump version to v30.3rc1 (fanquake)
1bdd2b1334 doc: update release notes for v30.3rc1 (fanquake)
e7c6d391ef fuzz: Remove unused g_setup pointers (MarcoFalke)
b7c7d1ea28 coins: compact chainstate in background (Lőrinc)
992b1dd39f validation: randomly compact chainstate (Lőrinc)
55ead701a3 coins: test chainstate flush baseline (Lőrinc)
d09bd0f402 lint: disable leveldb subtree check (fanquake)

Pull request description:

  Backports:
  * #34918
  * #35465

  Final changes for v`30.3rc1`.

  Backports since `30.2`:
  * #34283
  * #34459
  * #34689
  * #34754
  * #34805
  * #34856
  * #35211
  * #35232

ACKs for top commit:
  sedited:
    ACK d52747d8e7
  marcofleon:
    ACK d52747d8e7

Tree-SHA512: 75fb64f744a0689a9bc4f5a25128bf2aaad7459d7a430f552200b995498428d89de28820f477780f95e7e8485eea9f657ad5fdeae253940df4f29bf51346b4ff
v30.3rc1
2026-06-23 19:46:02 +02:00
fanquake
d52747d8e7 doc: update manual pages for v30.3rc1 2026-06-22 14:01:10 +01:00
fanquake
a1406d6333 build: bump version to v30.3rc1 2026-06-22 14:01:10 +01:00
fanquake
1bdd2b1334 doc: update release notes for v30.3rc1 2026-06-22 14:01:10 +01:00
MarcoFalke
e7c6d391ef fuzz: Remove unused g_setup pointers
These are unused and removing them avoids clang warnings like:

src/test/fuzz/deserialize.cpp:42:26: error: variable g_setup set but not used [-Werror,-Wunused-but-set-variable]

Github-Pull: #34918
Rebased-From: fabbfec3b0
2026-06-22 14:01:10 +01:00
Lőrinc
b7c7d1ea28 coins: compact chainstate in background
Full chainstate compaction can take minutes on large databases.
Move `CCoinsViewDB::CompactFull()` to a named `utxocompact` one-shot background thread so validation only schedules the work.

When validation selects compaction after a full flush, the chainstate was just written and another write is less likely to be needed immediately.
The coins view destructor waits for completion, and a mutex prevents compaction from using `m_db` while `ResizeCache()` replaces it.

Co-authored-by: Andrew Toth <andrewstoth@gmail.com>

Github-Pull: #35465
Rebased-From: 394e473d42
2026-06-22 14:01:08 +01:00
Lőrinc
992b1dd39f validation: randomly compact chainstate
Full chainstate flushes are convenient maintenance points for long-term LevelDB cleanup because the chainstate was just written.
Randomize the trigger so nodes that flush near the same height do not compact together.

Add blocking chainstate compaction through `CCoinsViewDB::CompactFull()` and give each post-IBD full flush on the normal chainstate a 1/320 chance to start compaction.
With hourly flushes this averages roughly every two weeks and makes a six-month miss about one in a million.
This keeps the schedule stateless and leaves last-compaction height or timestamp bookkeeping out of chainstate metadata.

Co-authored-by: Andrew Toth <andrewstoth@gmail.com>

Github-Pull: #35465
Rebased-From: aa021b26f3
2026-06-22 14:00:30 +01:00
Lőrinc
55ead701a3 coins: test chainstate flush baseline
Add `CDBWrapper::GetProperty()` and expose it through `CCoinsViewDB::GetDBProperty()` so coins tests can inspect LevelDB runtime properties through the coins view.
Use it in a coins DB flush baseline that records the LevelDB layout after flushing while keeping readback coverage for the flushed coin and best block.

Co-authored-by: Andrew Toth <andrewstoth@gmail.com>

Github-Pull: #35465
Rebased-From: b10889d107
2026-06-22 11:15:03 +01:00
fanquake
d09bd0f402 lint: disable leveldb subtree check
This is no-longer a proper subtree, because of direct cherry-picks.
2026-06-17 08:06:21 +02:00
merge-script
1fb642efb3 Merge bitcoin/bitcoin#35232: [30.x] Backports
f3320b316e doc: update release notes for v30.x (fanquake)
f074c479a5 ci: use ubuntu-latest instead of ubuntu-24.04 (fanquake)
922626571e doc: remove reference to cirrus (fanquake)
827f9343c4 ci: switch runners from cirrus to warpbuild (will)
c913cd9add Disable seek compaction (Andrew Toth)
1dba05e7f6 wallet: use outpoint when estimating input size (Lőrinc)
f92bd8b8ba doc: mention -DWITH_ZMQ=ON in BSD build guides (junbyjun1238)
c7034f4854 depends: Unset `SOURCE_DATE_EPOCH` in `gen_id` script (Hennadii Stepanov)

Pull request description:

  Backports:
  * #34228
  * #35228
  * #35283
  * #35313 (only https://github.com/bitcoin-core/leveldb-subtree/pull/61)
  * #35378
  * #35408

ACKs for top commit:
  andrewtoth:
    ACK f3320b316e
  marcofleon:
    ACK f3320b316e
  willcl-ark:
    ACK f3320b316e

Tree-SHA512: 10ecd524917397f785af92861f8db8ce1df4ea0869ae84f4a9b566c47fbb74bcbda3b9e966fb4f5bb09a616548442d8b569f9bf4d00461f19f86c646b9768780
2026-06-03 09:50:20 +01:00
fanquake
f3320b316e doc: update release notes for v30.x 2026-06-02 09:26:22 +01:00
fanquake
f074c479a5 ci: use ubuntu-latest instead of ubuntu-24.04
To match the usage of -latest for the warp runners.

Github-Pull: #35408
Rebased-From: 5700a61b73
2026-06-02 09:26:22 +01:00
fanquake
922626571e doc: remove reference to cirrus
Github-Pull: #35408
Rebased-From: 265563bf75
2026-06-02 09:26:22 +01:00
will
827f9343c4 ci: switch runners from cirrus to warpbuild
Github-Pull: #35378
Rebased-From: 4bdd46ace3
2026-06-02 09:26:22 +01:00
Andrew Toth
c913cd9add Disable seek compaction
Seek compaction is causing a cascade effect in the chainstate DB, causing large parts of the database to be rewritten every ~hour.

Every periodic flush writes around 2 MiB. Since this is roughly the `write_buffer_size`, these writes regularly cause the memtable to rotate into a small L0 file. This file has a small seek budget, and with the random UTXO reads done during validation, it can get scheduled for seek compaction quickly.

That seek compaction pushes the small file down to L1. Since most UTXOs are already lower down in L4/L5, many reads that consult this file do not find the key there and continue downward. The bloom filter makes those misses cheap, but LevelDB still decrements the file's seek budget. The file then gets scheduled for another seek compaction, and the same pattern pushes it down through L2 and L3.

The expensive part happens around L3/L4. L4 has many ~32 MiB files holding the bulk of the UTXO set. When LevelDB compacts into L3, it may split the output into many smaller L3 files to limit how much L4 "grandparent" data any one output overlaps. Each of these small L3 files then gets its own small seek budget. Because chainstate keys are hash-random, each small L3 file can still have a broad key range, so many random reads consult it and quickly drain its budget. Once seek-compacted into L4, each tiny L3 file can overlap many L4 files, so compacting a few hundred KiB from L3 can require rewriting hundreds of MiB from L4. Repeating that across many small L3 files can rewrite most of the chainstate.

This is a poor fit for chainstate because UTXO keys are hash-random, the DB is large enough to have many levels, writes are relatively small and periodic, and reads are frequent. The result is that read misses trigger compactions much earlier than size pressure would, and those compactions have very high write amplification.

Disabling seek compaction may leave more files in upper levels for longer, so reads could theoretically consult more files. But Bitcoin Core enables bloom filters for all its LevelDB instances, so these misses are usually cheap in-memory filter checks rather than disk reads.

For the other DBs, the risk is much smaller. They also use bloom filters, and most are smaller and less read-heavy. With fewer levels and less random read pressure, disabling seek compaction should have little effect there.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>

Github-Pull: #35313
Rebased-From: 6bfdb6093bba4710d0f8313ed0113967a8b5176f
2026-06-02 09:25:57 +01:00
Lőrinc
1dba05e7f6 wallet: use outpoint when estimating input size
`CalculateMaximumSignedInputSize()` is passed the outpoint being sized, but that context was not used when estimating the signed input size.
Pass the outpoint through so externally selected inputs are not underestimated.

Co-authored-by: Antoine Poinsot <darosior@protonmail.com>

Github-Pull: #35228
Rebased-From: cd8d3bd937
2026-05-20 15:36:51 +01:00
junbyjun1238
f92bd8b8ba doc: mention -DWITH_ZMQ=ON in BSD build guides
The FreeBSD, NetBSD, and OpenBSD build guides state that ZMQ support is compiled in when the package is installed. Since WITH_ZMQ defaults to OFF, update the wording to mention the required CMake option.

Github-Pull: #35283
Rebased-From: ca93ab808c
2026-05-14 14:13:44 +01:00
Hennadii Stepanov
c7034f4854 depends: Unset SOURCE_DATE_EPOCH in gen_id script
Github-Pull: #34228
Rebased-From: 9f7a2293c4
2026-05-08 12:37:49 +02:00
merge-script
1d97fda8a1 Merge bitcoin/bitcoin#35211: [30.x] validation: correct lifetime of precomputed tx data
17de6d2680 validation: correct lifetime of precomputed tx data (Antoine Poinsot)

Pull request description:

  This backports #35209 to the version 30 branch.

ACKs for top commit:
  achow101:
    ACK 17de6d2680

Tree-SHA512: cdb1f9cb8166a5eb0c0ca0fb88583077a050e07032be8665ef1b0c446b2405ce7ce0138688507a63df4096d52e5dc57a163c239927706043d6431388ce5c16f5
2026-05-07 11:17:29 +02:00
Ava Chow
9fc3724fca Merge bitcoin/bitcoin#35083: [30.x] Backports
6c3f40117f doc: update release notes for v30.x (fanquake)
33d66c67ee ci: unconfine seccomp for i686 no IPC (Lőrinc)
9632450ff6 multi_index: fix compilation failure with boost >= 1.91 (Cory Fields)
561d072e05 test: Add missing self.options.timeout_factor scale in tool_bitcoin_chainstate.py (MarcoFalke)

Pull request description:

  Backports:
  * #35080
  * #35175
  * #35202

ACKs for top commit:
  achow101:
    ACK 6c3f40117f

Tree-SHA512: 3acc73ef19001f4a84e388f21215a239fd3017351f561019b4f688165f3fb2f347879ca285aa31b9cd9b96473c5b6edf175a050cf6c6a7ffed61ad3065df603e
2026-05-06 03:18:24 -07:00
fanquake
6c3f40117f doc: update release notes for v30.x 2026-05-05 15:16:09 +02:00
Lőrinc
33d66c67ee ci: unconfine seccomp for i686 no IPC
Docker 29.4.2 blocks `socketcall(2)` in the default seccomp profile:
https://docs.docker.com/engine/release-notes/29/#2942
https://github.com/moby/profiles/releases/tag/seccomp%2Fv0.2.2
https://github.com/moby/moby/pull/52501

That affects the `i686, no IPC` job because it runs 32-bit Linux test binaries inside Docker.

Add Docker's documented `--security-opt seccomp=unconfined` workaround to this job's `CI_CONTAINER_CAP` - the hook `ci/test/02_run_container.py` already appends to `docker run`.

This restores socket availability for the 32-bit test binaries throughout the job:
https://docs.docker.com/engine/security/seccomp/#run-without-the-default-seccomp-profile

Github-Pull: #35202
Rebased-From: 11c9ef92a8
2026-05-05 15:15:29 +02:00
Antoine Poinsot
17de6d2680 validation: correct lifetime of precomputed tx data
This makes sure `txsdata` always outlives the Script check queue (since local
objects are destructed in reverse order of construction).

This is the root cause for a security vulnerability reported by Cory Fields in
2024 that could be exploited by crafting an invalid block to cause nodes to
read freed memory. The vulnerability was covertly fixed in commit
`492e1f09943fcb6145c21d470299305a19e17d8b`.

See security advisory for CVE-2024-52911 for more details.

Github-Pull: #35209
Rebased-From: 1ed799fb21
2026-05-05 08:13:56 -04:00
Cory Fields
9632450ff6 multi_index: fix compilation failure with boost >= 1.91
This effectively reverts a3cb309e7c from PR #30194.

That PR reduced the multi_index type signatures as recommended upstream, but
this is no longer supported as of boost 1.91 because it is no longer necessary.
1.91 drops support for the pre-c++11 work-arounds that bloated the type
signatures to begin with.

The upstream `BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT` define is meant to provide
compatibility with removed features, but it does not work for this case. Using
`indexed_by` directly when defining the `multi_index` (as opposed to inheriting
from it) works with all versions, and avoids the use of the back-compat define.

This is a slight regression when building against boost < 1.91 because the
bloated type signatures are reintroduced in that case, but it's not significant
enough to go to the trouble of introducing version detection and ifdefs.

Github-Pull: #35175
Rebased-From: 0bc9d354df
2026-05-01 07:52:50 +01:00
MarcoFalke
561d072e05 test: Add missing self.options.timeout_factor scale in tool_bitcoin_chainstate.py
Apply the timeout factor inside the add_block function.

Also, force named args for the two expected strings.

Also, add trailing comma for style.

Github-Pull: #35080
Rebased-From: fa02eb87df
2026-04-15 15:29:06 +01:00
merge-script
c5bf64408c Merge bitcoin/bitcoin#34856: [30.x] Backports
75d707b307 doc: update release notes for v30.x (fanquake)
6bba04ba73 depends, qt: Fix build on aarch64 macOS 26.4 (Hennadii Stepanov)
84c2f003b3 wallet: feebumper, fix crash when combined bump fee is unavailable (furszy)
f05988aa05 wallet: fix amount computed as boolean in coin selection (furszy)
72d2b85414 tests: applied PYTHON_GIL to the env for every test (kevkevinpal)
fde84b822e cmake: Migrate away from deprecated SQLite3 target (Daniel Pfeifer)

Pull request description:

  Backports:
  * #34848
  * #34869
  * #34870
  * #34888
  * #34956

ACKs for top commit:
  marcofleon:
    lgtm ACK 75d707b307

Tree-SHA512: 5bbb3f5480a376105644b10b64af6bc7c04eb9ff7ef3a31b586a018441d1aed6dee24c91862ebae0dd3792b2caa76f7f87d94be58f8a42ed696c382cd26c5e4e
2026-04-07 22:22:46 +08:00
fanquake
75d707b307 doc: update release notes for v30.x 2026-04-01 08:35:56 +08:00
Hennadii Stepanov
6bba04ba73 depends, qt: Fix build on aarch64 macOS 26.4
Github-Pull: #34956
Rebased-From: 3aeccb7d73
2026-04-01 08:35:31 +08:00
furszy
84c2f003b3 wallet: feebumper, fix crash when combined bump fee is unavailable
When a large cluster of unconfirmed transactions exceeds the limit,
calculateCombinedBumpFee() returns std::nullopt.

Previously, we continued executing and the optional value was
accessed unconditionally, leading to a std::bad_optional_access
exception.

Fix this by returning early when the returned bumped fee is null.

Note:
This is a crash for the GUI, and an uncaught exception for the RPC
bumpfee and psbtbumpfee.

Github-Pull: #34870
Rebased-From: 6072a2a6a1
2026-03-24 10:30:30 +08:00
furszy
f05988aa05 wallet: fix amount computed as boolean in coin selection
The comparison is evaluated before the assignment, so total_amount
ends up holding a boolean instead of the actual amount:
total_amount = (a - b < c)
which is not what we want here. This has been working by accident.

Github-Pull: #34888
Rebased-From: 0026b330c4
2026-03-24 10:23:33 +08:00
kevkevinpal
72d2b85414 tests: applied PYTHON_GIL to the env for every test
Github-Pull: #34869
Rebased-From: b14f2c76a1
2026-03-20 11:21:07 +08:00
Daniel Pfeifer
fde84b822e cmake: Migrate away from deprecated SQLite3 target
CMake version 4.3 deprecated the imported target `Sqlite::Sqlite3`.
Use the preferred name `Sqlite3::Sqlite3` instead and provide an
alias for older versions of CMake. Also define the same alias when
using vcpkg.

Github-Pull: #34848
Rebased-From: 498b6eb6b5
2026-03-19 14:47:56 +08:00
merge-script
e2edf09d49 Merge bitcoin/bitcoin#34805: [30.x] Backports
f788f1e5cc doc: update release notes for v30.x (fanquake)
0f922ed1f9 ci: check macos bundle structure and codesigning (fanquake)
17778c2b63 macdeploy: use plugins dir to find plugins (fanquake)
671980e779 macdeploy: subprocess out to zip rather than shutil.make_archive (fanquake)
e2f6e3a80f ci: bump cirruslabs actions versions (will)
1bc5233c19 ci: Bump GHA actions versions (MarcoFalke)

Pull request description:

  Backports:
  * #34787
  * #34802
  * #34815

ACKs for top commit:
  willcl-ark:
    ACK f788f1e5cc
  marcofleon:
    lgtm ACK f788f1e5cc

Tree-SHA512: a4fffdd3b39f9cfce046aea454fe5688f48a20d4055f7e5aaeb80db025fc2f400e34d936fdb59dc0f2b8cd014b86dc4b4eb2f21696b02b59551a0b70e7f192c8
2026-03-18 09:15:01 +08:00
fanquake
f788f1e5cc doc: update release notes for v30.x 2026-03-16 20:58:10 +08:00
fanquake
0f922ed1f9 ci: check macos bundle structure and codesigning
Github-Pull: #34787
Rebased-From: d03e3be246
2026-03-16 20:58:07 +08:00
fanquake
17778c2b63 macdeploy: use plugins dir to find plugins
Rather than looking for /translations, which might not exist (it doesn't
in a recent brew installed qt on macOS). i.e:
```bash
ls /opt/homebrew/opt/qtbase/share/qt
doc
libexec
metatypes
mkspecs
modules
plugins
sbom
```

Github-Pull: #34787
Rebased-From: 66d80d57b4
2026-03-16 19:22:30 +08:00
fanquake
671980e779 macdeploy: subprocess out to zip rather than shutil.make_archive
Calling shutil.make_archive(), does not preserve symlinks when using the
zip format, see https://github.com/python/cpython/issues/139679.

Call `zip` using subprocess instead. This code is only run when using a
macos machine, and I think it's safe to assume that zip is available, same
as codesign, and all other tools we call in this script.

Github-Pull: #34787
Rebased-From: ab137cbfe2
2026-03-16 19:22:26 +08:00
will
e2f6e3a80f ci: bump cirruslabs actions versions
Github-Pull: #34815
Rebased-From: 9a968ad35e
2026-03-12 11:22:38 +00:00
MarcoFalke
1bc5233c19 ci: Bump GHA actions versions
Github-Pull: #34802
Rebased-From: fadaa7db33
2026-03-11 15:40:40 +00:00
merge-script
e292a7b507 Merge bitcoin/bitcoin#34689: [30.x] Backports
49a777d0dd doc: update release notes for v30.x (fanquake)
0f9e08f870 doc: update build guides pre v31 (fanquake)
597ac36285 doc: Fix `fee` field in `getblock` RPC result (nervana21)
47ed306689 depends: Allow building Qt packages after interruption (Hennadii Stepanov)
d221d1c633 psbt: validate pubkeys in MuSig2 pubnonce/partial sig deserialization (tboy1337)
e1210ac259 doc: Improve dependencies.md IPC documentation (Ryan Ofsky)
c17a5cd5f8 test: Add missing timeout_factor to zmq socket (MarcoFalke)
304250983e netif: fix compilation warning in QueryDefaultGatewayImpl() (MarcoFalke)
475a5b0504 refactor: Use static_cast<decltype(...)> to suppress integer sanitizer warning (MarcoFalke)
7220ee3fc7 util: Fix UB in SetStdinEcho when ENOTTY (MarcoFalke)

Pull request description:

  Backports:
  * #34093
  * #34219
  * #34597
  * #34690
  * #34702
  * #34706
  * #34713
  * #34789

ACKs for top commit:
  marcofleon:
    ACK 49a777d0dd

Tree-SHA512: b4ce54860b7306b22de75bb093ad574110875253e4ea3ca96a736809c8291dea1144a617c8791f36618d8e367022709ba5cf84ca0e450ef6d76394ab80f22e2f
2026-03-11 10:03:57 +00:00
fanquake
49a777d0dd doc: update release notes for v30.x 2026-03-10 15:41:57 +00:00
fanquake
0f9e08f870 doc: update build guides pre v31
We are testing on FreeBSD 15 (nightly) and macOS 26 (CI).

Github-Pull: #34789
Rebased-From: 6b20ad84e0
2026-03-10 15:41:52 +00:00
nervana21
597ac36285 doc: Fix fee field in getblock RPC result
The `fee` field in the `getblock` RPC result (verbosity 2 and 3) may be
omitted when block undo data is not available. Marking it optional in
the `RPCResult` aligns the documented schema with the runtime behavior.

Github-Pull: #34702
Rebased-From: f580cc7e9f
2026-03-09 15:52:30 +00:00
Hennadii Stepanov
47ed306689 depends: Allow building Qt packages after interruption
Github-Pull: #34713
Rebased-From: 2a7a4f608a
2026-03-09 15:52:30 +00:00
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: f51665bee7
2026-03-09 15:52:30 +00:00
Ryan Ofsky
e1210ac259 doc: Improve dependencies.md IPC documentation
Improve dependencies.md to document IPC dependencies better:

- Link to native_capnp.mk file not capnp.mk file so it's possible to see what
  version of Cap'n Proto is being used in release binaries. This is important
  since #31895 dropped the "Version Used" column and the capnp.mk file does not
  include version number.
- Indicate Capn"Proto is used for IPC and link to multiprocess.md documenting
  the feature.
- Link to correct PR requiring Cap'n Proto 0.7.1. Previous link was
  pointing at PR which required 0.7.0.
- Mention libmultiprocess as a dependency even though it is included as a git
  subtree and can be built as a cmake subproject. Libmultiprocess still needs
  to be built separately when cross compiling, and is useful to build separately
  when developing, and is still a depends package.

Based on 2cf352fd8e from #33623 by willcl-ark
which made similar changes in the 29.x branch.

Github-Pull: #34706
Rebased-From: b87a1c27c9
2026-03-09 15:52:30 +00:00