Commit Graph

48305 Commits

Author SHA1 Message Date
Hennadii Stepanov
5d8d6dbd09 test, refactor: Remove unused removed_refs in txgraph_tests.cpp
This has been unused since it was introduced in
938e86f8fe.

Github-Pull: #35914
Rebased-From: e550945a39
2026-08-14 11:25:00 +01:00
Hennadii Stepanov
a16e7b5c31 test, refactor: Remove unused variables in test/rbf_tests.cpp
These have been unused since the following commits:
 - c320cddb1b
 - e9c5aeb11d
 - 216e693729

Github-Pull: #35914
Rebased-From: e50f422d25
2026-08-14 11:24:57 +01:00
Hennadii Stepanov
0379a668db fuzz, refactor: Remove unused header in p2p_transport_serialization.cpp
This has been unused since 0de48fe858.

Github-Pull: #35914
Rebased-From: b7ae50e2e2
2026-08-14 11:24:54 +01:00
Hennadii Stepanov
50b21679c0 fuzz, refactor: Remove unused random_string in locale.cpp
This has been unused since 3333282933.

Github-Pull: #35914
Rebased-From: 3df0d067ad
2026-08-14 11:24:50 +01:00
Hennadii Stepanov
289568e930 fuzz, refactor: Remove unused linearization in cluster_linearize.cpp
This has been unused since a52b53926b.

Github-Pull: #35914
Rebased-From: fc28914de4
2026-08-14 11:24:47 +01:00
Hennadii Stepanov
e36bb6e362 test, refactor: Remove unused warnings in wallet/test/util.cpp
These have been unused since the following commits:
 - c61d3f02f5
 - e12ff8aca0

Github-Pull: #35914
Rebased-From: da58e55986
2026-08-14 11:24:43 +01:00
Hennadii Stepanov
10818cef79 doc: Switch pkg-config package to modern pkgconf on NetBSD
Github-Pull: #35908
Rebased-From: 5964c7229f
2026-08-14 10:58:43 +01:00
Hennadii Stepanov
f77502f066 doc: Drop GCC upgrade instructions for NetBSD
NetBSD 11.0, the latest release, ships GCC 12.5.0 as the base
system compiler, which meets the minimum version requirement in
`doc/dependencies.md`.

Github-Pull: #35908
Rebased-From: 9b85c9814d
2026-08-14 10:58:39 +01:00
cyb3ralbert
792ddd6b6f doc: mention -DWITH_ZMQ=ON in macOS build guide
WITH_ZMQ defaults to OFF in CMakeLists.txt with no macOS exception.

Github-Pull: #35928
Rebased-From: 222855ed11
2026-08-14 10:53:06 +01:00
MarcoFalke
a5c6c4f2c8 test: Append print_suppressions=0 to LSAN_OPTIONS, and suppress bitcoin-qt
The print_suppressions=0 is required to avoid a CI failure when the
suppressions were used. E.g:

```
$ LSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/lsan:print_suppressions=1" ./bld-cmake/test/functional/interface_gui.py
2026-08-08T10:53:45.864160Z TestFramework (INFO): PRNG seed is: 8358096631255493262
2026-08-08T10:53:45.914748Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_5zx5343v
2026-08-08T10:53:47.029997Z TestFramework (INFO): Test that bitcoin-gui starts up and can be stopped via RPC
2026-08-08T10:53:47.431761Z TestFramework (ERROR): Unexpected exception:
  File "./test/functional/test_framework/test_node.py", line 534, in is_node_stopped
    raise AssertionError("Unexpected stderr {} != {}".format(stderr, expected_stderr))
AssertionError: Unexpected stderr -----------------------------------------------------
Suppressions used:
  count      bytes template
      2        181 bitcoin-qt
----------------------------------------------------- !=
```

The general suppression of the qt executables is required to avoid CI
failures for i386 builds. E.g:

```
 test  2026-08-05T08:54:08.370427Z TestFramework (ERROR): Unexpected exception:
      Traceback (most recent call last):
        File "/ci_container_base/ci/scratch_ ₿🧪_/build-i686-pc-linux-gnu/test/functional/interface_gui.py", line 34, in run_test
          self.stop_node(0)
          ~~~~~~~~~~~~~~^^^
        File "/ci_container_base/test/functional/test_framework/test_node.py", line 525, in is_node_stopped
          assert return_code in expected_ret_code, self._node_msg(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AssertionError: [node 0] Node returned unexpected exit code (1) vs ((0,)) when stopping

 node0 stderr =================================================================
==73449==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 386 byte(s) in 17 object(s) allocated from:
    #0 0x5df28a2d in malloc (/ci_container_base/ci/scratch_ ₿🧪_/build-i686-pc-linux-gnu/bin/bitcoin-qt+0x1d0da2d) (BuildId: 496a5df531df278fe395724ae917f266331b3f81)
    #1 0xee03c1d1  (<unknown module>)

Indirect leak of 12 byte(s) in 1 object(s) allocated from:
    #0 0x5df28a2d in malloc (/ci_container_base/ci/scratch_ ₿🧪_/build-i686-pc-linux-gnu/bin/bitcoin-qt+0x1d0da2d) (BuildId: 496a5df531df278fe395724ae917f266331b3f81)
    #1 0xee03c1d1  (<unknown module>)

SUMMARY: AddressSanitizer: 398 byte(s) leaked in 18 allocation(s).
```

Github-Pull: #35937
Rebased-From: fad9ab714b
2026-08-10 14:23:06 +01:00
merge-script
017eb433a5 Merge bitcoin/bitcoin#35699: [31.x] More Backports
859c9201c4 doc: update release notes for v31.x (fanquake)
2ba8685578 versionbits: update VersionBitsCache doc comment to match current behaviour (Antoine Poinsot)
4a1fe04884 doc: release notes and bips doc update for #34779 (Antoine Poinsot)
513fd01c12 qa: test we don't warn for ignored unknown version bits deployments (Antoine Poinsot)
3fa1a364cd versionbits: Limit live activation params and activation warnings per BIP323 (Anthony Towns)
163821639c depends, zeromq: Apply upstream patch (Hennadii Stepanov)
c02ff3e793 p2p: Assume v2transport for addresses from seeds (Martin Zumsande)
444f2d7965 fuzz, refactor: Remove `Serialize` overload (Hennadii Stepanov)
504ded6b0e fuzz: Remove unused `DeserializeFromFuzzingInput` params overload (Hennadii Stepanov)
ec1123aed1 rpc: define and use new  RPC_LIMIT_EXCEEDED error code (stickies-v)
cd32ebd3f4 Release cs_main between individual private tx re-attempts (Greg Sanders)
c1a0ed5225 private broadcast: limit outstanding txs to count of 10,000 (Gregory Sanders)
ef7542aa29 net: delay stale evaluation and expose time_added in private broadcast (Mccalabrese)
0086a236cb net: introduce TxSendStatus internal state container (Mccalabrese)
b4dd6ba49b chainparams: delete my DNS seed (Pieter Wuille)

Pull request description:

  Backports:
  * #34779
  * #34873
  * #35406
  * #35678 (partial)
  * #35679
  * #35691
  * #35766
  * #35769

ACKs for top commit:
  marcofleon:
    lgtm ACK 859c9201c4
  darosior:
    utACK 859c9201c4
  willcl-ark:
    ACK 859c9201c4

Tree-SHA512: 66753c651d4ed922ca35d9565512d245af45a7358b9763a8c5c63973ed952a50be38048604549f8122bb591986589aaabb25b13465f309004a10e66f227a7e87
2026-08-10 11:12:13 +01:00
fanquake
859c9201c4 doc: update release notes for v31.x 2026-08-05 08:49:43 +01:00
Antoine Poinsot
2ba8685578 versionbits: update VersionBitsCache doc comment to match current behaviour
Co-Authored-by: Anthony Towns <aj@erisian.com.au>

Github-Pull: #34779
Rebased-From: 107d4178d9
2026-08-05 08:49:43 +01:00
Antoine Poinsot
4a1fe04884 doc: release notes and bips doc update for #34779
Github-Pull: #34779
Rebased-From: 94e3ac0b21
2026-08-05 08:49:40 +01:00
Antoine Poinsot
513fd01c12 qa: test we don't warn for ignored unknown version bits deployments
Co-Authored-by: Anthony Towns <aj@erisian.com.au>

Github-Pull: #34779
Rebased-From: 1d5240574a
2026-08-04 12:08:39 +01:00
Anthony Towns
3fa1a364cd versionbits: Limit live activation params and activation warnings per BIP323
Test bits are conserved. This only has an effect on the warnings.

Co-Authored-By: Antoine Poinsot <mail@antoinep.com>

Github-Pull: #34779
Rebased-From: f802edf57c
2026-08-04 12:08:35 +01:00
Hennadii Stepanov
163821639c depends, zeromq: Apply upstream patch
See https://github.com/zeromq/libzmq/pull/4911.

Github-Pull: #35769
Rebased-From: e446ea09c4
2026-07-23 14:29:05 +01:00
Martin Zumsande
c02ff3e793 p2p: Assume v2transport for addresses from seeds
By now, the vast majority of nodes in the network supports BIP324.
Even if the optimistic guess would turn out to be wrong for a given
node, we would just reconnect with v1.
This is better than making v1 connections with peers when both nodes support v2.

Github-Pull: #35766
Rebased-From: cf0f2aeae0
2026-07-22 15:03:39 +01:00
Hennadii Stepanov
444f2d7965 fuzz, refactor: Remove Serialize overload
Serialization parameters should be embedded into the object being
serialized rather than passed as a separate argument. This works here
because only serialization is performed and no new object needs to be
constructed.

Github-Pull: #35679
Rebased-From: afab8d4225
2026-07-20 09:16:22 +01:00
Hennadii Stepanov
504ded6b0e fuzz: Remove unused DeserializeFromFuzzingInput params overload
This overload has been unused since it was added in fac81affb5.

Github-Pull: #35679
Rebased-From: efa7f8c143
2026-07-20 09:16:19 +01:00
stickies-v
ec1123aed1 rpc: define and use new RPC_LIMIT_EXCEEDED error code
The server isn't running out of memory when the private broadcast
transaction queue is full. Add a new RPC_LIMIT_EXCEEDED code that
can be used whenever a resource is bound and currently at capacity.

Github-Pull: #35678
Rebased-From: 82a02a2a22
2026-07-10 12:46:18 +01:00
Greg Sanders
cd32ebd3f4 Release cs_main between individual private tx re-attempts
This queue may be hundreds to thousands of items, each of
which are being revalidated at short interval. Allow the
node to be more responsive in this scenario.

Github-Pull: #35406
Rebased-From: cbf8c107c1
2026-07-10 12:03:10 +01:00
Gregory Sanders
c1a0ed5225 private broadcast: limit outstanding txs to count of 10,000
Add a belt-and-suspenders feature, limit the amount of
memory and cpu possible when unlucky or simply misconfigured.
The worst case limit is roughly 400kB * 10,000 = 4GB, regardless
of usage pattern.

Before this change, sheer volume of broadcasts, mismatches in
standardness rules, or simply fee mismatches may result in unbounded
growth of memory usage. As the feature may be expanded in
the future, explicit bounds helps reasoning going forward.

Github-Pull: #35406
Rebased-From: 5aea3d0373
2026-07-10 12:03:06 +01:00
Mccalabrese
ef7542aa29 net: delay stale evaluation and expose time_added in private broadcast
Github-Pull: #34873
Rebased-From: 325afe664d
2026-07-10 12:03:03 +01:00
Mccalabrese
0086a236cb net: introduce TxSendStatus internal state container
Github-Pull: #34873
Rebased-From: 999d18ab1c
2026-07-10 12:03:00 +01:00
Pieter Wuille
b4dd6ba49b chainparams: delete my DNS seed
Github-Pull: #35691
Rebased-From: d908063980
2026-07-10 10:26:39 +01:00
merge-script
9be056a8a7 Merge bitcoin/bitcoin#35666: [31.x] Finalise 31.1
adc5dc5206 doc: update manual pages for v31.1 (fanquake)
919d74e4c7 doc: update release notes for v31.1 (fanquake)
4219fd4693 build: bump version to v31.1 (fanquake)

Pull request description:

  The [`v31.1rc1` bins](https://bitcoincore.org/bin/bitcoin-core-31.1/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 `v31.1`.

ACKs for top commit:
  hebasto:
    ACK adc5dc5206.
  sedited:
    ACK adc5dc5206

Tree-SHA512: 4bf7e59a010a08952a60bbb318c514e411d85092086006134521d873c498d544e42cf6880d5f26f02ac1a6bcd0fc155528f2858a81ae8d1b11a3c378f3d11cf9
v31.1
2026-07-06 15:09:19 +02:00
fanquake
adc5dc5206 doc: update manual pages for v31.1 2026-07-06 11:38:15 +01:00
fanquake
919d74e4c7 doc: update release notes for v31.1 2026-07-06 11:36:22 +01:00
fanquake
4219fd4693 build: bump version to v31.1 2026-07-06 11:35:48 +01:00
merge-script
efde623463 Merge bitcoin/bitcoin#35331: [31.x] Backports
c058c29831 doc: update manual pages for v31.1rc1 (fanquake)
1c9d24fddd build: bump version to v31.1rc1 (fanquake)
d813722ef2 doc: update release notes for v31.1rc1 (fanquake)
ea3b318d8d coins: compact chainstate in background (Lőrinc)
711065a3b9 validation: randomly compact chainstate (Lőrinc)
fef6c8a4f2 coins: test chainstate flush baseline (Lőrinc)
ca00827fab util: Check write failures before renaming settings.json (Shrey)
1ee11d8ba6 lint: disable leveldb subtree check (fanquake)
ccb99122f9 net: un-default the OpenNetworkConnection()'s proxy_override argument (Eugene Siegel)
13df77d13b test: add a regression test for private broadcast v1 retries (Vasil Dimov)
6c08cb7323 test: make reusable filling of a node's addrman (Vasil Dimov)
70a8687d9d test: make reusable starting a standalone P2P listener (Vasil Dimov)
ef20249568 test: make reusable SOCKS5 server starting (Vasil Dimov)
66377c3c84 net: ensure no direct private broadcast connections (Vasil Dimov)
2c7986b3ee net: use the proxy if overriden when doing v2->v1 reconnections (Vasil Dimov)
70000a560b ci: use Warp cache for Docker layers (will)
25506ed6d9 ci: Add dynamic cache switching to warp cache (will)
39f8e077c8 ci: use ubuntu-latest instead of ubuntu-24.04 (fanquake)
1f55b3e463 doc: remove reference to cirrus (fanquake)
8f13bb1ea0 crypto: disable ASan instrumentation of SSE4 SHA256 for GCC (deadmanoz)
6caf6de0a1 ci: switch runners from cirrus to warpbuild (will)
78714f6d4f Disable seek compaction (Andrew Toth)
3440027b7d ci: switch to GitHub cache for all runners (willcl-ark)
d61687a2ac musig: Reject empty pubkey list in GetMuSig2KeyAggCache (nervana21)
671e6c2c33 wallet: use outpoint when estimating input size (Lőrinc)
101071722e psbt, test: remove address type restrictions in test (rkrux)

Pull request description:

  Backports:
  * #34953
  * #35228
  * #35279
  * #35313 (only https://github.com/bitcoin-core/leveldb-subtree/pull/61)
  * #35316
  * #35378
  * #35348
  * #35384
  * #35408
  * #35410
  * #35430
  * #35447
  * #35465

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

Tree-SHA512: a04909c1ce82d6f3412655ee7b52f4c482f5a175f9ec4e1468a84a4d488f935ab0ab333a3dc4d75f68fe2a9e7bae169d624c9061308435527b29b5a014c43dc3
v31.1rc1
2026-06-22 15:11:02 +02:00
fanquake
c058c29831 doc: update manual pages for v31.1rc1 2026-06-22 12:06:03 +01:00
fanquake
1c9d24fddd build: bump version to v31.1rc1 2026-06-22 12:03:22 +01:00
fanquake
d813722ef2 doc: update release notes for v31.1rc1 2026-06-22 12:02:31 +01:00
Lőrinc
ea3b318d8d 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 10:39:47 +01:00
Lőrinc
711065a3b9 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 10:39:43 +01:00
Lőrinc
fef6c8a4f2 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 10:39:40 +01:00
Shrey
ca00827fab util: Check write failures before renaming settings.json
In WriteSettings(), verify that writing to the stream and closing it
succeeded before returning true. This prevents RenameOver() from replacing
a valid settings.json with a corrupted or zero-byte file when write limits
or a full disk are encountered.

Additionally, update the ReadSettings() parse failure message to mention
power loss, full disk, or storage error as possible causes.

Fixes #35373

Github-Pull: #35384
Rebased-From: 0654511e1b
2026-06-19 18:47:09 +02:00
fanquake
1ee11d8ba6 lint: disable leveldb subtree check
This is no-longer a proper subtree, because of direct cherry-picks.
2026-06-19 18:47:09 +02:00
Eugene Siegel
ccb99122f9 net: un-default the OpenNetworkConnection()'s proxy_override argument
This way callers will not forget to set it.

Github-Pull: #35410
Rebased-From: bf0d257c11
2026-06-19 18:47:09 +02:00
Vasil Dimov
13df77d13b test: add a regression test for private broadcast v1 retries
Github-Pull: #35410
Rebased-From: 5a3756d150
2026-06-19 18:47:09 +02:00
Vasil Dimov
6c08cb7323 test: make reusable filling of a node's addrman
Extract the part of `p2p_private_broadcast.py` that fills a given node's
addrman and put it into `test_framework/test_framework.py`.

Github-Pull: #35410
Rebased-From: ab35a028ed
2026-06-19 18:47:09 +02:00
Vasil Dimov
70a8687d9d test: make reusable starting a standalone P2P listener
Extract the part of `p2p_private_broadcast.py` that starts
listening on a `P2PConnection` object (or its children classes)
and put it into `test_framework/p2p.py`.

Github-Pull: #35410
Rebased-From: 2333be9cbc
2026-06-19 18:47:09 +02:00
Vasil Dimov
ef20249568 test: make reusable SOCKS5 server starting
Extract the part of `p2p_private_broadcast.py` that configures and
starts the SOCKS5 server into a reusable function and put it into
`test_framework/socks5.py`.

Use bind port 0 to let the OS pick an available port instead of
hackishly assuming that `p2p_port(N)` is available where N is more
than the number of the nodes the test uses.

Github-Pull: #35410
Rebased-From: 2ffa81fac4
2026-06-19 18:47:08 +02:00
Vasil Dimov
66377c3c84 net: ensure no direct private broadcast connections
Private broadcast connections use either Tor or I2P, which require a
proxy intrinsically or IPv4 or IPv6 which must use a proxy in the
context of private broadcast to avoid leaking the originator's IP
address.

Add a safety check to guard against future mistakes.

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

Github-Pull: #35410
Rebased-From: d01b461f71
2026-06-19 18:47:08 +02:00
Vasil Dimov
2c7986b3ee net: use the proxy if overriden when doing v2->v1 reconnections
`OpenNetworkConnection()` supports overriding the proxy to use for
connecting. However when v2 connection is attempted and it fails a v1
connection is tried without that proxy.

Store the override proxy in `CNode` and pass it to
`CConnman::m_reconnections` to be used for v1 retries.

Github-Pull: #35410
Rebased-From: fd230f942d
2026-06-19 18:47:08 +02:00
will
70000a560b ci: use Warp cache for Docker layers
Speeds of 1MB/s and 15 minute cached docker image pulls during builds
are not uncommon.

Warp runners provide a local GitHub Actions cache protocol proxy for
Docker layer cache traffic. Point BuildKit's gha cache backend at that
proxy on Warp runners so cached image layers do not have to be fetched
from GitHub's slower cache service.

Add a default for provider so other users (e.g. qa-assets) don't have to
update this unless they use custome runners.

Github-Pull: #35447
Rebased-From: 82901981bf
2026-06-19 18:47:08 +02:00
will
25506ed6d9 ci: Add dynamic cache switching to warp cache
The GHA cache is very slow, taking on the order of minutes to save and
restore from.

Use WarpBuild's cache instead as this is in the same region and much
faster.

WarpBuild cache action does not auto-fallback to GHA if not being run on
Warp. To allow fork runs to fallback to GHA caching, whilst minimising
duplication in the action files, create new "interal" actions which
perform the switching logic, and use these in the (renamed) cache|save
actions.

Without this we would need the `if` logic in our prvious actions, 4
times in each of save and restore.

Plumb the provider through into the action, as a composite action can't
read `env` (`GITHUB_OUTPUT`) from previous steps.

Github-Pull: #35430
Rebased-From: 2ce4ae7d8f
2026-06-19 18:47:08 +02:00
fanquake
39f8e077c8 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-19 18:47:08 +02:00
fanquake
1f55b3e463 doc: remove reference to cirrus
Github-Pull: #35408
Rebased-From: 265563bf75
2026-06-19 18:47:08 +02:00