Commit Graph

45763 Commits

Author SHA1 Message Date
merge-script
9f713b83dc Merge bitcoin/bitcoin#32837: depends: fix libevent _WIN32_WINNT usage
f5647c6c5a depends: fix libevent _WIN32_WINNT usage (fanquake)

Pull request description:

  Starting with version 13.x, the mingw headers will define the value of
  `NTDDI_VERSION`, based on the value of `_WIN32_WINNT`, if that version is <
  Windows 10. Given that libevent was undefining our `_WIN32_WINNT`, and
  redefining it to a value < Windows 10 (`0x0501`), `NTDDI_VERSION` was also
  being defined to that value, leading to functions not being exposed in
  the mingw-w64 headers; see here: 9c2668ef77/mingw-w64-headers/include/iphlpapi.h (L36-L41).

  Imports a commit from usptream ([a14ff91254f40cf36e0fee199e26fb11260fab49](a14ff91254)).

  Fixes #32707.

ACKs for top commit:
  willcl-ark:
    crACK f5647c6c5a

Tree-SHA512: eb429457a4af6191dd27ef3d1087667c5304ff0f49d4c6824883651e3c2dbab5d9784fa1f170402f23cd9238005c5214e0a71a4160562a59dfa35618dc702132
2025-07-16 13:49:26 +01:00
rkrux
2dfeb6668c wallet: remove outdated pszSkip arg of database Rewrite func
This argument might have been used in the legacy wallets, but I don't
see any implementation using this argument in the SQLite wallets.
Removing it cleans up the code a bit.
2025-07-16 14:27:17 +05:30
MarcoFalke
faaaddaaf8 init: [gui] Avoid UB/crash in InitAndLoadChainstate 2025-07-16 07:10:30 +02:00
Ava Chow
8a4cfddf23 wallet: Set migrated wallet name only on success
After a wallet is migrated and we are trying to load it, if it could not be
loaded, don't try to set the wallet name.
2025-07-15 16:11:36 -07:00
will
4f502baf8f doc: add alpine depends build instructions 2025-07-15 21:32:54 +01:00
w0xlt
d89c6fa4a7 wallet: Remove upgradewallet RPC 2025-07-15 11:00:48 -07:00
merge-script
184159e4f3 Merge bitcoin/bitcoin#32922: test: use notarized v28.2 binaries and fix macOS detection
4bb4c86599 test: document HOST for get_previous_releases.py (Sjors Provoost)
609203d507 test: stop signing previous releases >= v28.2 (Sjors Provoost)
c6dc2c29f8 test: replace v28.0 with notarized v28.2 (Sjors Provoost)
5bd73d96a3 test: fix macOS detection (Sjors Provoost)

Pull request description:

  Since https://github.com/bitcoin/bitcoin/pull/31407 macOS guix builds are signed and notarized. This was included in v29 and backported to 28.x.

  This PR bumps the v28.0 previous release binary to v28.2 and adjusts the test that uses it. Additionally it no longer manually code signs binaries >= v28.2.

  While testing on an M4 mac and redownloading all the binaries, I noticed that `platform == "arm64-apple-darwin"` doesn't actually work. This initially used `args.platform` in #26694, but that was changed to just `platform` in #32219.

  So the first commit switches this to use `args.host`. I manually tested on Intel macOS 13.7.6 that code-signing still isn't needed there (when downloading using a script).

  Also documented that you can set `HOST`.

ACKs for top commit:
  m3dwards:
    ACK 4bb4c86599
  maflcko:
    review ACK 4bb4c86599 🚏

Tree-SHA512: b4803d39a21cb622fd2388a0528b76d2b502956e2505385d3da201143b0afcf6f9d71c8c28937f27b70d2588fb6da677da058bdcd67b90fb53617acc3a727818
2025-07-15 14:46:31 +01:00
merge-script
5d17e64a02 Merge bitcoin/bitcoin#32677: test: headers sync timeout
61e800e75c test: headers sync timeout (stringintech)

Pull request description:

  When reviewing PR #32051 and considering which functional tests might need to be adapted/extended accordingly, I noticed there appears to be limited functional test coverage for header sync timeouts and thought it might be helpful to add one.

  This test attempts to cover two scenarios:

  1. **Normal peer timeout behavior:** When a peer fails to respond to initial getheaders requests within the timeout period, it should be disconnected and the node should attempt to sync headers from the next available peer.

  2. **Noban peer behavior:** When a peer with noban privileges times out, it should remain connected while the node still attempts to sync headers from other peers.

ACKs for top commit:
  maflcko:
    re-ACK 61e800e75c 🗝
  stratospher:
    reACK 61e800e7.

Tree-SHA512: b8a867e7986b6f0aa00d81a84b205f2bf8fb2e6047a2e37272e0244229d1f43020e9031467827dabbfe7849a91429f2685e00a25356e2ed477fa1a035fa0b1fd
2025-07-15 11:47:11 +01:00
merge-script
0087ba409b Merge bitcoin/bitcoin#32968: test: fix intermittent failure in rpc_invalidateblock.py
28416f367a test: fix intermittent failure in rpc_invalidateblock.py (stratospher)

Pull request description:

  resolves #32965.

  node1 (with 24 blocks) causes node0 (with 6 blocks + 1 extra header) to silently reorg. so move the subtest to a point before the 20 blocks are generated so that node1's state doesn't cause node0 to silently reorg.

ACKs for top commit:
  maflcko:
    lgtm ACK 28416f367a
  mzumsande:
    Code Review ACK 28416f367a

Tree-SHA512: f6cc682b8e5416125f887c094d5e291dd37f0bfc41d7c0de218f3e24fa1ea0cd642f7a1e362f3127f68cde725a67f3054501326b9bd25f0caa9a05de7d0052b0
2025-07-15 11:35:46 +01:00
glozow
50024620b9 [bench] worst case LimitOrphans and EraseForBlock
Co-authored-by: Greg Sanders <gsanders87@gmail.com>
2025-07-14 16:13:47 -04:00
glozow
45c7a4b56d [functional test] orphan resolution works in the presence of DoSy peers
Co-authored-by: Greg Sanders <gsanders87@gmail.com>
2025-07-14 16:13:47 -04:00
glozow
835f5c77cd [prep/test] restart instead of bumpmocktime between p2p_orphan_handling subtests
If we want to restart at all during the tests, we can't have future timestamps.
2025-07-14 16:13:47 -04:00
Pieter Wuille
b113877545 [fuzz] Add simulation fuzz test for TxOrphanage
This adds a large simulation fuzz test for all TxOrphanage public interface
functions, using a mix of comparison with expected behavior (in case it is
fully specified), and testing of properties exhibited otherwise.
2025-07-14 16:13:47 -04:00
Pieter Wuille
03aaaedc6d [prep] Return the made-reconsiderable announcements in AddChildrenToWorkSet
This is preparation for the simulation fuzz test added in a later commit. Since
AddChildrenToWorkSet consumes randomness, there is no way for the simulator to
exactly predict its behavior. By returning the set of made-reconsiderable announcements
instead, the simulator can instead test that it is *a* valid choice, and then
apply it to its own data structures.
2025-07-14 16:13:47 -04:00
glozow
ea29c4371e [p2p] bump DEFAULT_MAX_ORPHANAGE_LATENCY_SCORE to 3,000
For the default number of peers (125), allows each to relay a default
descendant package (up to 25-1=24 can be missing inputs) of small (9
inputs or fewer) transactions out of order.

This limit also gives acceptable bounds for worst case LimitOrphans iterations.

Functional tests aren't changed to check for larger cap because it would
make the runtime too long.

Also deletes the now-unused DEFAULT_MAX_ORPHAN_TRANSACTIONS.
2025-07-14 16:13:47 -04:00
glozow
24afee8d8f [fuzz] TxOrphanage protects peers that don't go over limit
Co-authored-by: Greg Sanders <gsanders87@gmail.com>
2025-07-14 16:13:47 -04:00
glozow
a2878cfb4a [unit test] strengthen GetChildrenFromSamePeer tests: results are in recency order 2025-07-14 16:13:47 -04:00
glozow
7ce3b7ee57 [unit test] basic TxOrphanage eviction and protection 2025-07-14 16:13:47 -04:00
glozow
4d23d1d7e7 [cleanup] remove unused rng param from LimitOrphans 2025-07-14 16:13:47 -04:00
glozow
067365d2a8 [p2p] overhaul TxOrphanage with smarter limits
This is largely a reimplementation using boost::multi_index_container.
All the same public methods are available. It has an index by outpoint,
per-peer tracking, peer worksets, etc.

A few differences:
- Limits have changed: instead of a global limit of 100 unique orphans,
  we have a maximum number of announcements (which can include duplicate
orphans) and a global memory limit which scales with the number of
peers.
- The maximum announcements limit is 100 to match the original limit,
  but this is actually a stricter limit because the announcement count
is not de-duplicated.
- Eviction strategy: when global limits are reached, a per-peer limit
  comes into play. While limits are exceeded, we choose the peer whose
“DoS score” (max usage / limit ratio for announcements and memory
limits) is highest and evict announcements by entry time, sorting
non-reconsiderable ones before reconsiderable ones. Since announcements
are unique by (wtxid, peer), as long as 1 announcement remains for a
transaction, it remains in the orphanage.
- This eviction strategy means no peer can influence the eviction of
  another peer’s orphans.
- Also, since global limits are a multiple of per-peer limits, as long
  as a peer does not exceed its limits, its orphans are protected from
eviction.
- Orphans no longer expire, since older announcements are generally
  removed before newer ones.
- GetChildrenFromSamePeer returns the transactions from newest to
  oldest.

Co-authored-by: Pieter Wuille <pieter@wuille.net>
2025-07-14 16:13:47 -04:00
glozow
1a41e7962d [refactor] create aliases for TxOrphanage Count and Usage 2025-07-14 16:13:47 -04:00
glozow
b50bd72c42 [prep] change return type of EraseTx to bool
This function only ever returns 0 or 1 (number of unique orphans
erased).
2025-07-14 16:13:47 -04:00
glozow
3da6d7f8f6 [prep/refactor] make TxOrphanage a virtual class implemented by TxOrphanageImpl 2025-07-14 16:13:46 -04:00
glozow
77ebe8f280 [prep/test] have TxOrphanage remember its own limits in LimitOrphans
Move towards a model where TxOrphanage is initialized with limits that
it remembers throughout its lifetime.
Remove the param. Limiting by number of unique orphans will be removed
in a later commit.
Now that -maxorphantx is gone, this does not change the node behavior.
The parameter is only used in tests.
2025-07-14 16:13:10 -04:00
glozow
d0af4239b7 [prep/refactor] move DEFAULT_MAX_ORPHAN_TRANSACTIONS to txorphanage.h
This is move only.
2025-07-14 16:13:10 -04:00
glozow
51365225b8 [prep/config] remove -maxorphantx
The orphanage will no longer have a maximum number of unique orphans.
2025-07-14 16:13:10 -04:00
glozow
8dd24c29ae [prep/test] modify test to not access TxOrphanage internals
These internals should and will be private.
2025-07-14 16:12:47 -04:00
glozow
c3cd7fcb2c [doc] remove references to now-nonexistent Finalize() function 2025-07-14 14:48:26 -04:00
glozow
d8140f5f05 don't make a copy of m_non_base_coins 2025-07-14 14:48:26 -04:00
glozow
98ba2b1db2 [doc] MemPoolAccept coins views 2025-07-14 14:48:25 -04:00
glozow
ba02c30b8a [doc] always CleanupTemporaryCoins after a mempool trim 2025-07-14 14:43:11 -04:00
merge-script
b53fab1467 Merge bitcoin/bitcoin#32948: refactor: cleanup index logging
c18bf0bd9b refactor: cleanup index logging (Sjors Provoost)

Pull request description:

  This PR removes the use of `__func__` from index logging, since we have `-logsourcelocations`.

  It also improves readability by putting `GetName()` in a more logical place.

  Before

  > coinstatsindex: best block of the index not found. Please rebuild the index.

  After:

  > best block of coinstatsindex not found. Please rebuild the index.

  I found myself maintaining this commit as part of https://github.com/Sjors/bitcoin/pull/86, but since that might never land here, it seemed better to split it into its own PR (or get rid of it).

ACKs for top commit:
  l0rinc:
    Lightweight code review ACK c18bf0bd9b
  maflcko:
    review ACK c18bf0bd9b 🚣

Tree-SHA512: 755948371e3ff7a5515b63ce48075631ec7868d69c3c1469176d5be0e8b28e1c071e206ae3f7320f87d8c441f815894acfef61621f05795b5ff6b8a5a3031e3b
2025-07-14 16:26:56 +01:00
Pieter Wuille
62ed1f92ef txgraph: check that DoWork finds optimal if given high budget (tests) 2025-07-14 10:37:00 -04:00
Pieter Wuille
f3c2fc867f txgraph: add work limit to DoWork(), try optimal (feature)
This adds an `iters` parameter to DoWork(), which controls how much work it is
allowed to do right now.

Additionally, DoWork() won't stop at just getting everything ACCEPTABLE, but if
there is work budget left, will also attempt to get every cluster linearized
optimally.
2025-07-14 10:28:54 -04:00
MarcoFalke
fa1fd07468 ci: Enable more shellcheck 2025-07-14 16:27:07 +02:00
Pieter Wuille
e96b00d99e txgraph: make number of acceptable iterations configurable (feature) 2025-07-14 09:42:58 -04:00
Pieter Wuille
cfe9958852 txgraph: track amount of work done in linearization (preparation) 2025-07-14 09:41:17 -04:00
Pieter Wuille
6ba316eaa0 txgraph: 1-or-2-tx split-off clusters are optimal (optimization) 2025-07-14 09:30:24 -04:00
Pieter Wuille
fad0eb091e txgraph: reset quality when merging clusters (bugfix) 2025-07-14 09:30:24 -04:00
stringintech
61e800e75c test: headers sync timeout 2025-07-14 16:48:23 +03:30
stratospher
28416f367a test: fix intermittent failure in rpc_invalidateblock.py
node1 (with 24 blocks) causes node0 (with 6 blocks) to silently
reorg. so move the subtest to a point before the 20 blocks are
generated so that node1's state doesn't cause node0 to silently
reorg.
2025-07-14 18:37:29 +05:30
merge-script
e72cb20c3f Merge bitcoin/bitcoin#32943: depends: Force CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE
44f3bae300 depends: Force `CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE` (Hennadii Stepanov)

Pull request description:

  When using CMake policies 3.14 and below, the `export(PACKAGE)` command by default populates the user package registry, which is stored outside the build tree. Setting the `CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable disables this side effect.

  In CMake 3.15 and later, this behavior is disabled by default, and the variable has no effect.

  This PR forces `CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE` globally, rather than managing it for each dependency package individually rather. It may be reverted once all CMake-based packages have updated to policies 3.15 or newer.

  Fixes https://github.com/bitcoin/bitcoin/issues/32938.

ACKs for top commit:
  fanquake:
    ACK 44f3bae300

Tree-SHA512: 0aac398b7182e80185b064d59f81aece4d8477a609fad9cc3fee317da2aff43b66ef7db1efec0135b4f0feaad23b1db664e33bd035fe659712c5b2a9bf2d6fb6
2025-07-14 13:32:44 +01:00
merge-script
97fb46d0a0 Merge bitcoin/bitcoin#32880: ci: Avoid cd into build dir
fad191ff48 ci: Avoid cd into build dir (MarcoFalke)

Pull request description:

  Changing into the build dir is confusing and brittle, because the following commands implicitly assume it. So they could break on unrelated changes.

  The changes are required for stuff like:

  * cmake presets (see https://github.com/bitcoin/bitcoin/pull/30871#issuecomment-2344031208)
  * meta ci tests (like https://github.com/bitcoin/bitcoin/pull/32874)

  So remove the `cd` and just make the build dir explicit.

ACKs for top commit:
  hebasto:
    ACK fad191ff48, I have reviewed the code and it looks OK.

Tree-SHA512: a88a9341445ffe28a0dac3815f235ec8eb0459d10a91a80829fd3184762d3c807d0f68c56243b20c04a6efa5becd8a7fad568f43c2b1e6af1ff8ba07b140ef87
2025-07-14 11:46:56 +01:00
merge-script
69b9ad02da Merge bitcoin/bitcoin#32954: cmake: Drop no longer necessary "cmakeMinimumRequired" object
12a6959892 cmake: Drop no longer necessary "cmakeMinimumRequired" object (Hennadii Stepanov)

Pull request description:

  The minimum required CMake version is 3.22:6a13a6106e/CMakeLists.txt (L10)

ACKs for top commit:
  fanquake:
    ACK 12a6959892 - has been unneeded since it was introduced (minimum was already 3.22).

Tree-SHA512: 26f97662bfe52986e19e38dbf4ab8e1e7558bc78c3a65593cbecd1f35887bba7a9f7d8a3d08ccfab8396f41c2334cdad5b0e503999a759cfa158d3bb8d0d14d7
2025-07-14 11:06:40 +01:00
merge-script
7566b40bd2 Merge bitcoin/bitcoin#32961: fix spelling in tor.md docs
84ef5524d5 fix spelling in tor.md docs (stutxo)

Pull request description:

  This PR is to fix some spelling mistakes i found of the word occurrences! there are two occurrences of this mistake.

  thanks!

ACKs for top commit:
  maflcko:
    lgtm ACK 84ef5524d5
  willcl-ark:
    ACK 84ef5524d5
  delta1:
    ACK 84ef5524d5

Tree-SHA512: 4ba71b772fdc8cf36ada7493d29fb5b312a7a6085099347162eb3495db4de984b0417b7861f2927c617cbd552741356e26688479601bdf7e835c15e097aa28f3
2025-07-14 10:07:55 +01:00
MarcoFalke
faa3171ff2 ci: Use optimized Debug build type in test-each-commit 2025-07-14 09:35:03 +02:00
MarcoFalke
fa21c3401e ci: [doc] reword debug log message 2025-07-14 09:34:55 +02:00
stutxo
84ef5524d5 fix spelling in tor.md docs 2025-07-13 23:25:37 +01:00
Hennadii Stepanov
12a6959892 cmake: Drop no longer necessary "cmakeMinimumRequired" object 2025-07-12 14:03:35 +01:00
Hennadii Stepanov
6a13a6106e Merge bitcoin/bitcoin#32937: Enable -Werror=dev in CI & Guix
8f766f39df ci: enable -Werror=dev (fanquake)
7b420ca834 guix: configure with -Werror=dev (fanquake)
44097ddb19 cmake: enable -Werror=dev in dev-mode preset (fanquake)

Pull request description:

  Pass `-Werror=dev` in the CI, Guix and the `dev-mode` preset.

  https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-Werror:
  > Make developer warnings errors.
  > Make warnings that are meant for the author of the CMakeLists.txt files errors. By default this will also turn on deprecated warnings as errors.

  Pulled out of #32865.

ACKs for top commit:
  Sjors:
    re-ACK 8f766f39df
  hebasto:
    ACK 8f766f39df, tested on Ubuntu 24.04.

Tree-SHA512: 0fa321b77d2519b5249d90590664c4e5938ac86209b068658647adf97ab55ea4d54c913aae2f622385fe2f41d7c851cd5d7371905fdad38b66cb124371e16ac7
2025-07-11 23:10:20 +01:00