Commit Graph

49905 Commits

Author SHA1 Message Date
Gregory Sanders
fe7d475d45 private broadcast: bound broadcast attempts per tx to 1k
Rather than rebroadcasting forever, bound attempts at
private broadcast, report remaining attempts over RPC
results, and allow exhausted transactions to be
retried when submitted.
2026-08-14 17:09:29 -04:00
merge-script
e27c179db2 Merge bitcoin/bitcoin#35869: lint: (re-)add contrib/guix for Python linting
8221d714c7 lint: document CI lief version requirement (fanquake)
594a02c3ae lint: re-add guix scripts to mypy linting (fanquake)

Pull request description:

  These were no-longer being linted after https://github.com/bitcoin/bitcoin/pull/32458.

  suppress `[union-attr]` warning. i.e:
  ```bash
  contrib/guix/symbol-check.py:309: error: Item "None" of "lief.PE.Binary | lief.ELF.Binary | lief.MachO.Binary | lief.COFF.Binary | None" has no attribute "format"  [union-attr]
  contrib/guix/security-check.py:284: error: Item "lief.COFF.Binary" of "lief.PE.Binary | lief.ELF.Binary | lief.MachO.Binary | lief.COFF.Binary | None" has no attribute "abstract"  [union-attr]
  ```

  Add the comment suggested in [#35855.](https://github.com/bitcoin/bitcoin/pull/35855#discussion_r3694954625).

ACKs for top commit:
  maflcko:
    lgtm ACK 8221d714c7 in any case.
  hebasto:
    ACK 8221d714c7, I have reviewed the code and it looks OK.

Tree-SHA512: ec404a8235fd40b212aad71ee3fe3473a3ce6f1ebaed46661d36ef02862b08528e3b6b829e05c5b943c8543380f3876e33da725154ce31d4022ad39ae5ef5ab3
2026-08-03 13:29:58 +01:00
merge-script
30f6b05857 Merge bitcoin/bitcoin#35860: fuzz: Rework rpc fuzz target
fa895bb77a fuzz: Rework rpc fuzz target (MarcoFalke)

Pull request description:

  The `rpc` fuzz target constructs a vector of string args and passes that to `RPCConvertValues`.

  This has many issues:

  * Each of those strings could represent an array itself. E.g. via `range argument` or via `ConsumeArrayRPCArgument`. However, those strings may not be converted to an array via `RPCConvertValues` and just be passed on as string argument. Having a call to `ConsumeArrayRPCArgument` that ends up with a plain json string is confusing.
  * The strings could only represent an object or json null, when a raw string represented such a serialized json and was also converted to one via `RPCConvertValues`. Having a call to `ConsumeScalarRPCArgument` that was intended to give a raw string but ends up with a arbitrary json object is confusing.

  Fix those "stringly-typed" issues by making the fuzz target "type safe":

  * Rename `ConsumeScalarRPCArgument` to `ConsumeBasicRPCArgument` and return a proper `UniValue` from it.
  * The "consume string" case inside that function, which had a "double meaning" is turned into two type-safe cases: One that returns a json string and one that reads an arbitrary json from a string.
  * A new case for json null is added.
  * `ConsumeRPCArgument` is changed to cover both json arrays and json dicts properly.
  * Pass the resulting positional UniValue array directly to the RPC method, avoiding the need for `RPCConvertValues`.

  Making the fuzz target "type safe" is also the first step in making it schema-aware.

ACKs for top commit:
  dergoegge:
    utACK fa895bb77a

Tree-SHA512: ee22310c981be802f4838454be0e7ef2be213704621c08ffe98dbeab2e3d7cc6ff6a37f7a129e1570185f13a740d34fd9e2c6de3a8281e8b8dc1277f673c4a48
2026-08-03 12:17:52 +01:00
merge-script
dcc2ed52b8 Merge bitcoin/bitcoin#35856: fuzz: cover the mempool interface for transaction announcement
dd2561003d fuzz: cover the mempool interface for transaction announcement (Antoine Poinsot)

Pull request description:

  This adds coverage in the existing `tx_pool` harness for the `ExtractBestByMiningScoreWithTopology` method recently added in #34628.

ACKs for top commit:
  dergoegge:
    utACK dd2561003d

Tree-SHA512: 3e2ea6afff080f48f5b519c49cb6ef51a76eb20186bcfcb5d8cf194f67aa99bf5f5683271b58b97c9bc4e521ea3e08a46ee019e0ffc028222db9dbcb383c48fd
2026-08-03 12:08:11 +01:00
fanquake
8221d714c7 lint: document CI lief version requirement 2026-08-03 11:52:17 +01:00
fanquake
594a02c3ae lint: re-add guix scripts to mypy linting
These were no-longer being linted after #32458.

suppress `[union-attr]` warning. i.e:
```bash
contrib/guix/symbol-check.py:309: error: Item "None" of "lief.PE.Binary | lief.ELF.Binary | lief.MachO.Binary | lief.COFF.Binary | None" has no attribute "format"  [union-attr]
contrib/guix/security-check.py:284: error: Item "lief.COFF.Binary" of "lief.PE.Binary | lief.ELF.Binary | lief.MachO.Binary | lief.COFF.Binary | None" has no attribute "abstract"  [union-attr]
```
2026-08-03 11:52:14 +01:00
merge-script
556988790a Merge bitcoin/bitcoin#35592: http: check rpcallowip immediately after accepting connection
55d3cd51a4 doc: add release note describing change for forbidden clients (Matthew Zipkin)
d1ed2a6e25 http: check rpcallowip immediately after accepting connection (Matthew Zipkin)

Pull request description:

  This is a follow-up to #35182 addressing a review comment from that PR: https://github.com/bitcoin/bitcoin/pull/35182#pullrequestreview-4322490068

  This update to HTTPServer checks the IP subnet allowlist as soon as possible (immediately after receiving a connection from a client) before any data is received. This does not entirely protect the server from the "slow loris" attack or [CWE-400](https://cwe.mitre.org/data/definitions/400.html) but does restrict the attack surface to localhost and clients explicitly allowed by the user.

  If a client is not allowed by the list, we disconnect as soon as possible. This is a behavior change from master branch (and previous release with libevent) where `403 Forbidden` was returned (after a potentially large amount request data was written to memory by the server).

  To facilitate existing unit tests, this commit includes a refactor that moves the subnet allow list and relevant methods into the HTTPServer class instead of static file scope. This is needed because otherwise the allow list would be empty when the unit tests run.

  There is still plenty of refactoring to do in order to modernize `HTTPServer` and de-globalize it, but since this specific issue has a resource allocation guard, I wanted to open it quickly on its own.

ACKs for top commit:
  janb84:
    ACK 55d3cd51a4
  winterrdog:
    ACK 55d3cd51a4
  w0xlt:
    ACK 55d3cd51a4
  fjahr:
    Code review ACK 55d3cd51a4

Tree-SHA512: 545911f2e4d2f97ab8bc854e9e57c39eb896428f8c349d34c8e8025a1f6bfb8cfd436f381e36af8b87592c07df3e16210819f3eef7943e23c6626030e615fdf5
2026-08-01 16:43:57 +01:00
MarcoFalke
fa895bb77a fuzz: Rework rpc fuzz target 2026-08-01 16:40:46 +02:00
Antoine Poinsot
dd2561003d fuzz: cover the mempool interface for transaction announcement
This adds coverage for the recently-added ExtractBestByMiningScoreWithTopology method.
2026-07-31 15:44:47 -04:00
merge-script
67efced1fc Merge bitcoin/bitcoin#35838: qa: Enable interface_gui.py on macOS
45f5609f2e qa: Enable `interface_gui.py` on macOS (Hennadii Stepanov)

Pull request description:

  This is a follow-up to bitcoin/bitcoin#35551.

  Addresses https://github.com/bitcoin/bitcoin/pull/35551#discussion_r3619539472.

ACKs for top commit:
  maflcko:
    lgtm ACK 45f5609f2e

Tree-SHA512: 2fd8ebd8529d9d2dc0535181995fb126dfc1033e74ed7680e600fa41bf931f047d82095547538a0c94e1254ecd465d72b4a0ff5189663f25425e1477f845863e
2026-07-30 12:32:26 +01:00
Hennadii Stepanov
45f5609f2e qa: Enable interface_gui.py on macOS
This is a follow-up to bitcoin/bitcoin#35551.
2026-07-30 11:38:01 +01:00
Ava Chow
9611a35603 Merge bitcoin/bitcoin#35828: util: Make LineReader consistently use string_view
dff44e4c8f util: LineReader - Drop support for raw std::byte spans (Hodlinator)
5d5cdcd79d util: Make LineReader consistently use string_views (Hodlinator)
e8eaa80ce2 util: LineReader - Don't include newline and acknowledge single-char \r (Hodlinator)

Pull request description:

  3 commits changing `LineReader`:
  * Avoid the duplicate check for `\n` happening inside `RemoveSuffixView()`. https://github.com/bitcoin/bitcoin/pull/35182#discussion_r3333154138
  * Use `string_view` internally rather than 2 `span::iterator`s.
  * Stop accepting `span<byte>` inputs since internally and as outputs we treat them as strings.

  Found while reviewing #35182.

ACKs for top commit:
  achow101:
    ACK dff44e4c8f
  pinheadmz:
    ACK dff44e4c8f
  furszy:
    ACK dff44e4c8f

Tree-SHA512: f4108cdc3895cce879eb21538ae6b11e7af3322abeb7026b766ca25419c53e691921ba94b1bc99dd34696b9bd3abcbde404ea62fc0f1e75d292f256d75fbf154
2026-07-29 16:04:19 -07:00
Ava Chow
6e2962e48c Merge bitcoin/bitcoin#35753: kernel: handle null mempool on chainstate deletion
a99b27f192 validation: handle null mempool on delete (Lőrinc)

Pull request description:

  **Problem:** Kernel creates a `ChainstateManager` without a mempool, while `AppInitMain()` supplies one for node applications.
  If chainstate wiping is enabled and the data directory contains a saved AssumeUTXO snapshot, `LoadChainstate()` calls `DeleteChainstate()`, which dereferences the snapshot's null mempool pointer.

  **Fix:** Accept a missing mempool when deleting the snapshot, matching the existing check in `AddChainstate()`.

  <details>
  <summary>Failure without the fix</summary>

  ```
  unknown location:0: fatal error: in "validation_chainstatemanager_tests/chainstatemanager_delete_chainstate_no_mempool": memory access violation at address: 0x48: invalid permissions
  ```
  </details>

ACKs for top commit:
  achow101:
    ACK a99b27f192
  sedited:
    ACK a99b27f192
  andrewtoth:
    ACK a99b27f192

Tree-SHA512: 19579c03bdd525be29362db2d869e76d9ac8fd33b53527190942e2198a5b148453250ec536c57f95bf5d8ab414bb53ef114e62725ecad9d6ff6976cfa9cc5c51
2026-07-29 15:47:41 -07:00
Ava Chow
87bc4c74c4 Merge bitcoin/bitcoin#35787: init, rpc: ignore empty addnode values
90ce21e21d rpc: reject empty node argument in addnode (w0xlt)
69465de447 init: ignore empty addnode values (w0xlt)

Pull request description:

  An empty `addnode=` entry currently creates an empty added-node record. The node then repeatedly attempts to connect to the empty destination:

  ```text
  2026-07-23T19:22:33Z [net] trying v2 connection (manual) to , lastseen=0.0hrs
  2026-07-23T19:23:33Z [net] trying v2 connection (manual) to , lastseen=0.0hrs
  2026-07-23T19:24:34Z [net] trying v2 connection (manual) to , lastseen=0.0hrs
  ```

  With this change, the node ignores empty `-addnode` values when initializing the connection manager. This preserves the existing startup behavior while avoiding useless connection attempts. Non-empty values are unaffected. Values consisting only of whitespace are ignored as well, and every ignored value is logged.

  The `addnode` RPC has the same issue, so it now returns `Error: Node address cannot be empty` instead of adding such a record.

  Functional tests verify that the node starts with `addnode=`, that no added-node record is created while non-empty values are still added, and that the RPC rejects empty values.

ACKs for top commit:
  l0rinc:
    lightly tested ACK 90ce21e21d
  achow101:
    ACK 90ce21e21d
  pablomartin4btc:
    ACK 90ce21e21d
  furszy:
    utACK 90ce21e21d

Tree-SHA512: e3074ff8a4e477f12c1f3331bc941854c2c994290afca85d4695a2ade79d0f230d167aaa9a141e619415164a853c54b7225477d0df8e5b96e0f1480223e188e5
2026-07-29 13:36:10 -07:00
Ava Chow
67998e15c8 Merge bitcoin/bitcoin#35553: test: Add missing test case for getdata requests from blocks-only peers
278710a88d test: Add missing test case for getdata requests from blocks-only peers (Roqqit)

Pull request description:

  ProcessGetData starts by eagerly processing getdata requests. In this loop, a special case checks for peers that have not requested transaction announcements (ie blocksonly) and ignores those requests.  This test prevents regressions for that special case, which is currently not covered by existing tests.

ACKs for top commit:
  maflcko:
    lgtm ACK 278710a88d
  achow101:
    ACK 278710a88d
  sedited:
    ACK 278710a88d
  nebula-21:
    ACK 278710a88d

Tree-SHA512: 2f96efdd4d27e6f754dbdca74c9bf21214f77ee0a05f79ef9d6eb3d8166793346323d71be80bec7fb93bfcb8d764de24f31e5345951591b105557f30ddaabd0e
2026-07-29 13:28:20 -07:00
Hennadii Stepanov
9b38d077f8 Merge bitcoin-core/gui#953: Adds option to not load the wallet after migration
4cea59573c add release notes (Pol Espinasa)
492a715d78 gui: Adds option to not load the wallet after migration (Pol Espinasa)

Pull request description:

  Following https://github.com/bitcoin/bitcoin/pull/35266 this PR adds the option to not load the wallet after migrating to the GUI.

  It is only added for the `migrate` option, not for the `restore_and_migrate`. I guess if we are restoring the wallet we always want to load it.
  In any case, it's pretty straightforward to implement it there too.

  Inside the original migration pop-up box it appears a checkbox that allows the user to choose if want to load the wallet or not, it is checked by default:

  <img width="497" height="388" alt="imagen" src="https://github.com/user-attachments/assets/79c76f9b-9b06-4fcb-88fe-3b5db3eaf14f" />

  If yes, the wallet is loaded and shown, if not the wallet gets migrated and the GUI returns to it's state.

  The checkbox has a tooltip that informs when not loading a migrated wallet can be useful:
  <img width="503" height="494" alt="imagen" src="https://github.com/user-attachments/assets/3a3404ff-1fd3-44ef-8f9d-db526c9f032f" />

ACKs for top commit:
  achow101:
    ACK 4cea59573c
  pablomartin4btc:
    ACK 4cea59573c
  hebasto:
    ACK 4cea59573c, I have reviewed the code and it looks OK.

Tree-SHA512: 6256849ecca3888fe24866ed539b262be6275c6192d29d272e7ad1475943c2947c04a3fadaae94e1843b3fcfa43a1f84edb02365933bf954b8ba7d0ae53eda32
2026-07-29 19:41:43 +01:00
Ava Chow
146988ef6c Merge bitcoin/bitcoin#35551: test: add interface_gui.py to test bitcoin-qt startup
aa01721c89 test: add interface_gui.py to test bitcoin-gui startup via RPC (Ryan Ofsky)

Pull request description:

  Adds a functional test that starts bitcoin-qt using QT_QPA_PLATFORM=minimal for headless operation, then verifies it responds to a stop RPC call. This detects startup crashes in the GUI that have no CI coverage today like https://github.com/bitcoin-core/gui/issues/940

  The new test is currently skipped on macos and windows due to different problems on those platforms that may be resolved with future PRs. Fixing the windows issue should also allow the `tool_bitcoin.py` test to be enabled on windows, and fixing the macos issue should allow Qt addressbook and wallet tests to be enabled on macos.

ACKs for top commit:
  achow101:
    ACK aa01721c89
  sedited:
    ACK aa01721c89
  pablomartin4btc:
    ACK aa01721c89
  hebasto:
    ACK aa01721c89.

Tree-SHA512: 84873aed41a856322eca1c391d3ff19b6eb4a0aa253d09ace342e3efe970a330cb11506eb4efe2580b7991132b644c7408feb013c18dbfbfaaf879f88f12e02e
2026-07-29 11:32:46 -07:00
Hennadii Stepanov
7e5952b0aa Merge bitcoin/bitcoin#35821: guix: followups to #35537
683ae4c520 guix: consolidate config flags (fanquake)
665f11d04a guix: consolidate gcc toolchain setup (fanquake)
288f76ed0f guix: consolidate mingw-w64 toolchain setup (fanquake)
cc9b0f2266 guix: consolidate LLVM toolchain setup (fanquake)
b12a70f330 guix: turn linux/win linker warnings into errors (fanquake)

Pull request description:

  This deduplicates setup code, as well as adds flags to turn linker warnings into errors, which is easier now that the GUI build has been split out (the gui link warns about shared libs during linking).

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

Tree-SHA512: 08b4fa14494481149844750bd6741c61b3a9367eed46923e8c788f3cd22ea9c4b319326075df0114dbb17e11f0dd1340999ba80e40a244208e6b4e90c86e3361
2026-07-29 15:03:02 +01:00
fanquake
683ae4c520 guix: consolidate config flags 2026-07-29 11:16:58 +01:00
fanquake
665f11d04a guix: consolidate gcc toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
288f76ed0f guix: consolidate mingw-w64 toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
cc9b0f2266 guix: consolidate LLVM toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
b12a70f330 guix: turn linux/win linker warnings into errors
Can do this now that the GUI has been split out.

riscv64-linux-gnu failus due to
https://github.com/boostorg/test/issues/345:
```bash
[102%] Linking CXX executable ../../bin/test_bitcoin
/gnu/store/r03804zpq5i6wsalx0yaqrr5jb7pqrmv-binutils-cross-riscv64-linux-gnu-2.46.0/bin/riscv64-linux-gnu-ld: CMakeFiles/test_bitcoin.dir/main.cpp.o: in function `boost::fpe::disable(unsigned int)':
/bitcoin/depends/riscv64-linux-gnu/boost/include/boost/test/impl/execution_monitor.ipp:1538:(.text+0x9dc8): warning: fedisableexcept is not implemented and will always fail
/gnu/store/r03804zpq5i6wsalx0yaqrr5jb7pqrmv-binutils-cross-riscv64-linux-gnu-2.46.0/bin/riscv64-linux-gnu-ld: CMakeFiles/test_bitcoin.dir/main.cpp.o: in function `boost::fpe::enable(unsigned int)':
/bitcoin/depends/riscv64-linux-gnu/boost/include/boost/test/impl/execution_monitor.ipp:1502:(.text+0x9d76): warning: feenableexcept is not implemented and will always fail
collect2: error: ld returned 1 exit status
```

Darwin could be done after something like
https://github.com/bitcoin/bitcoin/pull/35756.
2026-07-29 11:16:58 +01:00
Hennadii Stepanov
fd7d4f2970 Merge bitcoin/bitcoin#35795: build: set CMAKE_VISIBILITY_INLINES_HIDDEN in REDUCE_EXPORTS
3f313a774b build: set CMAKE_VISIBILITY_INLINES_HIDDEN in REDUCE_EXPORTS (fanquake)

Pull request description:

  This was originally part of the CMake switchover, but was removed because it was an addition, rather than a port. Add it now.

  See https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-fvisibility-inlines-hidden:

  > This switch declares that the user does not attempt to compare pointers
  > to inline functions or methods where the addresses of the two functions
  > are taken in different shared objects.

  > The effect of this is that GCC may, effectively, mark inline methods
  > with __attribute__ ((visibility ("hidden"))) so that they do not appear
  > in the export table of a DSO

  See also https://cmake.org/cmake/help/latest/prop_tgt/VISIBILITY_INLINES_HIDDEN.html.

  When building for macOS, this will also enable [`-fvisibility-inlines-hidden-static-local-var`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fvisibility-inlines-hidden-static-local-var).

ACKs for top commit:
  purpleKarrot:
    ACK 3f313a774b
  151henry151:
    Tested ACK 3f313a774b
  hebasto:
    ACK 3f313a774b.

Tree-SHA512: 98c8f342fa9ac922826bbd3c31766f8f7eff46356db7ccd8199fb2cfc2a9719f0ca18d426f69468f1013c9ea1de90162b5941721e0ecb93e2d770611b029c785
2026-07-29 11:14:54 +01:00
merge-script
8ecbe270f0 Merge bitcoin/bitcoin#35606: script: qa: Improve Key::Fingerprint type safety
c9a70f9338 script: qa: Improve Key::Fingerprint type safety (David Gumberg)

Pull request description:

  Extracted from pseudoramdom's work in #35436:

  Instead of using c style arrays for key fingerprints, use `std::array`'s whose length can always reasoned about at compile time and for most operations the compiler enforces the size being correct.

  ```cpp
  using KeyFingerprint = std::array<unsigned char, 4>;
  ```

  ```diff
  -    unsigned char vchFingerprint[4];
  +    KeyFingerprint fingerprint;
  ```

  This allows the replacement of a lot of raw `memcpy` + trust-me-bro lengths, with the assignment operator:

  ```cpp
  -    memcpy(ret.vchFingerprint, vchFingerprint, 4);
  +    ret.fingerprint = fingerprint;
  ```

  This commit also adds two helper functions for
  - Retrieving the [fingerprint of a key identifier](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#user-content-Key_identifiers) (`CKeyID`)
  - Retrieving the fingerprint of the key identifier of an XPUB.

ACKs for top commit:
  w0xlt:
    ACK c9a70f9338
  sedited:
    ACK c9a70f9338
  pseudoramdom:
    Code review ACK w/ some minor nits c9a70f9338
  polespinasa:
    ACK c9a70f9338

Tree-SHA512: 3ee76742c0bc317dfbc12a6731afdcc40495db6e4d5d94880d0a721990d36cb3e4d374ccc96079ba1f8ad3f88581ee5a609bfe259c0ea7cd28cade373aac1b38
2026-07-29 09:55:39 +02:00
merge-script
a9d181f2d3 Merge bitcoin/bitcoin#35084: ipc: Add nonunix platform support
d3d74e701f ipc, refactor: Update mp::g_thread_context references (Ryan Ofsky)
2d3f72fd3f ipc, refactor: Update mp::SpawnProcess call (Ryan Ofsky)
e9f19815ca ipc, refactor: Add Stream type alias and use it (Ryan Ofsky)
3859805f05 ipc, refactor: Add SocketId type alias and use it (Ryan Ofsky)
2ee9b69c7a ipc, refactor: Add ProcessId type alias and use it (Ryan Ofsky)
3449797141 ipc: Avoid 'unistd.h' error with MSVC (Ryan Ofsky)
dbcc192dce ipc, refactor: fix include order (Ryan Ofsky)
7c86d4834e ipc, refactor: use native path separators in test (Ryan Ofsky)
00287b9a34 ipc, refactor: Change Protocol class field order (Ryan Ofsky)
33d37f3c35 ipc, refactor: Drop connect/listen/serve exe_name parameters (Ryan Ofsky)
794940469e ipc, moveonly: combine ipc_test.cpp and ipc_tests.cpp (Ryan Ofsky)

Pull request description:

  This PR makes Bitcoin Core changes needed to be compatible with https://github.com/bitcoin-core/libmultiprocess/pull/274, which changes the libmultiprocess API to stop using unix-specific types so it is compatible with windows. (Windows support is added in followups: https://github.com/bitcoin-core/libmultiprocess/pull/231 and https://github.com/bitcoin/bitcoin/pull/32387.)

  The PR uses some [compatibility shims](https://github.com/ryanofsky/bitcoin/blob/pr/ipc-wins/src/ipc/util.h) so it can be reviewed and merged without needing to merge https://github.com/bitcoin-core/libmultiprocess/pull/274 first and bump the libmultiprocess subtree. These can be deleted when the subtree is updated.

  ---

  Review note: All the changes here are refactoring, and you don't really need to know anything about IPC or Windows to review this code. It is also a mostly move-only change (131 lines added, 96 removed, 215 moved)

ACKs for top commit:
  xyzconstant:
    tACK d3d74e701f
  enirox001:
    ACK d3d74e701f
  Sjors:
    ACK d3d74e701f
  ViniciusCestarii:
    re-ACK d3d74e701f tested locally on Linux

Tree-SHA512: cd48708f9fd086ac8127dc75cfaf4bd8f8da81e07d11b2c9e65fd9061ffa33478bffc6fd6fa4b3505e86c6437752578fe6e5bd590c683c3bc9969093103a5608
2026-07-29 09:36:13 +02:00
Pol Espinasa
4cea59573c add release notes 2026-07-28 15:59:35 +02:00
Pol Espinasa
492a715d78 gui: Adds option to not load the wallet after migration 2026-07-28 15:59:30 +02:00
Hodlinator
dff44e4c8f util: LineReader - Drop support for raw std::byte spans
TorControlConnection and HTTPRemoteClient have been updated to use std::string receive buffers which mirrors approach in HTTPClient::ReadResponse().
2026-07-28 13:02:21 +02:00
Hodlinator
5d5cdcd79d util: Make LineReader consistently use string_views
Forcing the input through std::byte while always outputting strings was cumbersome.

Also changes LineReader to a class and makes the fields private.
2026-07-28 13:02:20 +02:00
Hodlinator
e8eaa80ce2 util: LineReader - Don't include newline and acknowledge single-char \r
Due to the preceeding if-condition we know \n is always there.
2026-07-28 10:58:01 +02:00
merge-script
7dea464d6b Merge bitcoin/bitcoin#35692: addrman: remove unreachable tried-collision branch
bc7d905046 addrman: remove unreachable tried-collision branch (Bruno Garcia)

Pull request description:

  `ResolveCollisions_()` had a fallback for the case where a pending tried collision no longer collided because the destination tried slot became empty.

  Under current addrman invariants this cannot happen: once an entry is added to `m_tried_collisions`, the corresponding tried slot remains occupied until the collision is resolved. The only other valid outcomes are that the pending new entry disappears or becomes invalid, both of which are already handled.

  Remove the dead branch and replace the implicit assumption with assertions in `ResolveCollisions_()` and `SelectTriedCollision_()`.

  It came to my mind when taking a look at the fuzz coverage report for the addrman harness. After years (?) of fuzzing, I was trying to understand if it was a fault on the harness or a dead branch.

ACKs for top commit:
  Herb-ops:
    ACK bc7d905046
  danielabrozzoni:
    tACK bc7d905046
  stratospher:
    ACK bc7d905. `MakeTried` is the only place where we clear the tried table slot but we also refill the same slot here under the cs hold. so makes sense that during a node's runtime destination tried slot which has a previous entry/collison can't be empty (unless some id internal corruption).
  naiyoma:
    ACK bc7d905046
  mzumsande:
    Code Review ACK bc7d905046

Tree-SHA512: 57236c0f95ec1028e831aeffdc0639faf5fe083b108cb2869fa1ce237bb37ac3be96d6a49d9a6a8f4a21558d9dcfa015ab3276cc30a8826e5c65e8b0853acd45
2026-07-27 21:02:55 +02:00
merge-script
a2aab6df97 Merge bitcoin/bitcoin#35810: guix: Drop unused (guix licenses) import from manifest_build.scm
a92e93429e guix: Drop unused `(guix licenses)` import from `manifest_build.scm` (Hennadii Stepanov)

Pull request description:

  This was overlooked in bitcoin/bitcoin#34948.

ACKs for top commit:
  fanquake:
    ACK a92e93429e

Tree-SHA512: ab1ff63b49da104b21c4731ea06d3a4db009712be7c50f907cd46d0ad2936f7a236915bbe436801f02ea32bd781dfb5f38d349dda0a99a563701bef1089f35a6
2026-07-27 12:00:49 +01:00
w0xlt
90ce21e21d rpc: reject empty node argument in addnode
An empty (or whitespace only) node address cannot be resolved, but would
be added to the added nodes list and retried indefinitely, the same way
that an empty -addnode value was before the previous commits.

Reject it for all commands instead. Returning false from AddNode() would
report the misleading "Node already added" error, so check it here.
2026-07-27 01:40:29 -07:00
w0xlt
69465de447 init: ignore empty addnode values
An empty -addnode currently creates an unresolvable added-node record
that is retried indefinitely. Ignore empty values instead, retaining
startup compatibility while avoiding useless records and connection
attempts.

Values consisting of whitespace only are ignored as well. They can only
be passed on the command line, as the config file parser trims them
away, and are just as unresolvable.

The ignored values are logged, so that the option not taking effect is
not silent.
2026-07-27 00:19:46 -07:00
Hennadii Stepanov
e75b76b12c Merge bitcoin/bitcoin#35261: guix: disable LTO in GCC
baa5a2ce43 guix: pass --disable-tm-clone-registry to base GCC (fanquake)
9c2589630f guix: mirror some arguments from linux-gcc to mingw-w64-gcc (fanquake)
e0b8fbde89 guix: disable-nls in *-base-gcc (fanquake)
7dc87f8e1e guix: disable-lto in *-base-gcc (fanquake)
9ed3d6ef2a guix: modernise style in *-base-gcc (fanquake)

Pull request description:

  We don't use LTO in release builds, and neither do any of our dependencies, so disable support in GCC (`--disable-lto`):
  > Enable support for link-time optimization (LTO). This is enabled by default, and may be disabled using --disable-lto.

  This reduces what needs to be compiled when building the Guix toolchain. It would also make it clear if something started using it.

  Also disable Native Language Support (`--disable-nls`):
  > The --enable-nls option enables Native Language Support (NLS), which lets GCC output diagnostics in languages other than American English. Native Language Support is enabled by default if not doing a canadian cross build.

  Also disable support for transactional memory (`--disable-tm-clone-registry`):
  > Disable TM clone registry in libgcc. It is enabled in libgcc by default. This option helps to reduce code size for embedded targets which do not use transactional memory.

  See https://gcc.gnu.org/install/configure.html.

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

Tree-SHA512: 6fccab4c43f5c506c51ecd0e8c903ca82125a5ade5008cef7c0e50667ec7a417803ad8c26e670f5718cfbca125f6c32fd6534f945adf58f13ea2fc23b16244ac
2026-07-26 19:59:17 +01:00
Hennadii Stepanov
a92e93429e guix: Drop unused (guix licenses) import from manifest_build.scm
This was overlooked in bitcoin/bitcoin#34948.
2026-07-26 15:42:53 +01:00
merge-script
e34b8d5a7d Merge bitcoin/bitcoin#35794: doc: Discourage adding AI agents as commit (co)-authors
f5d7cc66ec doc: Discourage adding AI agents as commit authors (sedited)

Pull request description:

  The goal of the AI policy is to ensure that contributors maintain the responsibility of understanding the change they are contributing. Adding AI agents as co-authors undermines this. I believe this philosophy should extend to commit co-authors in general: They should only be added if they themselves are capable of fully understanding the commit.

  This contribution was sparked by maflcko's comment here: https://github.com/bitcoin/bitcoin/pull/35551#pullrequestreview-4642682025 .

ACKs for top commit:
  l0rinc:
    ACK f5d7cc66ec
  yancyribbens:
    ACK f5d7cc66ec
  xyzconstant:
    ACK f5d7cc66ec
  jonatack:
    ACK f5d7cc66ec modulo IANAL, IDK if there are copyright issues with using/crediting work by LLM agents
  w0xlt:
    ACK f5d7cc66ec
  pablomartin4btc:
    ACK f5d7cc66ec
  theStack:
    ACK f5d7cc66ec

Tree-SHA512: 134902fcf4748bf991a6c3df6e41d5edbbc0e57c35d15d9d84fe4d30153549c05546ea5fe22226356d01f6df15f0c7177d9b1af62b9f90982a7788613bdd94a9
2026-07-25 13:40:55 +01:00
merge-script
b33a7fcd7b Merge bitcoin/bitcoin#34628: p2p: Replace per-peer transaction rate-limiting with global rate limits
349c72ee00 net_processing: Drop unnecessary txid arg from InitiateTxBroadcastToAll (Anthony Towns)
12b0dc33c4 doc: Add release note for -txsendrate etc (Anthony Towns)
5cde66341a tests: basic functional test for tx rate limiting (Anthony Towns)
4842903ac1 rpc: report -txsendrate and bucket info via getnetworkinfo (Anthony Towns)
74a47a5207 init: add -txsendrate configuration parameter (Anthony Towns)
6307bd034b net_processing: Provide a 30bpm heartbeat log while inv backlog is in use (Anthony Towns)
df31ee57aa net_processing: add a global delay queue for sending txs (Anthony Towns)
7927650e56 util/tokenbucket.h: Provide a generic TokenBucket class (Anthony Towns)
749bb447f8 txmempool: Drop CompareMiningScoreWithTopology (Anthony Towns)
e1b7490fbc net_processing: Replace CompareInvMempoolOrder (Anthony Towns)
6cfc65d210 txmempool: Add ExtractBestByMiningScoreWithTopology (Anthony Towns)
026f70e05f net_processing: Remove per-peer rate-limiting (Anthony Towns)
46c8c471dc net_processing: bump last_inv_sequence for bip35 messages explicitly (Anthony Towns)

Pull request description:

  Per-peer `m_tx_inventory_to_send` queues have CPU and memory costs that scale with both queue size and peer count. Under high transaction volume, this has previously caused severe issues ([May 2023 disclosure][1]) and still can cause measurable delays ([Feb 2026 Runestone surge][2], with the msghand thread observed hitting 100% CPU and queue memory reaching ~95MB).

  This PR replaces the per-peer rate limiting with a global queue using dual token buckets (limiting transaction by both count and serialized size). Transactions that arrive within the bucket capacity still relay nearly immediately, but excess transactions queue in a global backlog and drain as the token buckets refill.

  Key parameters:
    - Count bucket: 14 tx/s, 420 capacity (30s buffer)
    - Size bucket: 20 kB/s (~12 MB/600s), 50 MB capacity
    - Outbound peers refill faster by a factor of 2.5

  Per-peer queues are retained solely for privacy batching and are always fully emptied, removing the old `INVENTORY_BROADCAST_MAX` cap.

  This reduces the memory and CPU burden during transaction spikes when the queuing logic is engaged from O(queue * peers) to O(queue), as the queued transactions no longer need to be retained per-peer or re-sorted per-peer.

  Design discussion: https://gist.github.com/ajtowns/d61bea974a07190fa6c6c8eaef3638b9

  [1]: https://bitcoincore.org/en/2024/10/08/disclose-large-inv-to-send/
  [2]: https://bnoc.xyz/t/increased-b-msghand-thread-utilization-due-to-runestone-transactions-on-2026-02-17/81

ACKs for top commit:
  sipa:
    Code review ACK 349c72ee00. I haven't tested it myself yet (though switched my well-connected node to it now), but the posted benchmarks and analyses look convincing.
  instagibbs:
    reACK 349c72ee00
  mzumsande:
    ACK 349c72ee00

Tree-SHA512: 2196a23308cb7fe36738cf638edf5c5b0e9ba32b11c083609fd8b50291e05bb33484f9921f8beab28d94c58d1adddea4c8ae1182a60a7f53f54be7370e2a0e47
2026-07-25 12:15:44 +02:00
Ava Chow
6b059d9dbd Merge bitcoin/bitcoin#32800: rpc: Distinguish between vsize and sigop adjusted mempool vsize
29b124416e doc: add release notes for 32800 (Musa Haruna)
5d25a0c28d rpc: add `vsize_adjusted` field to getrawtransaction output for mempool transactions (Musa Haruna)
eaef8d3111 rpc: add `vsize_adjusted` and `vsize_bip141` field to mempool-related RPCs (Musa Haruna)

Pull request description:

  ### Motivation and Problem

  `CTxMemPoolEntry::GetTxSize()` returns the larger of two values: the BIP 141 virtual size (vsize) and the "sigop-adjusted size." This sigop-adjusted size is used by mempool validation and mining algorithms as a safeguard to prevent overfilling blocks with transactions that approach both the weight and signature operation (sigop) limits in a way that could harm block space efficiency.

  In the current implementation, the sigop-adjusted size is reported as the "vsize" in RPCs that provide mempool transaction data, such as `getmempoolentry`, `getrawmempool`, `testmempoolaccept`, and `submitpackage`. However, the documentation for these RPCs typically describes this value simply as the "virtual transaction size as defined in BIP 141," without acknowledging the sigop adjustment. Since the reported size may differ from the pure BIP 141 definition, this confuses people as in this [tweet](https://x.com/mononautical/status/1646166180145577990?s=20), discrepancy can be misleading, as the reported size may differ from the pure BIP 141 definition.

  ### Proposed Solution
  To resolve this, all mempool-related RPCs now return two separate fields:

  **vsize_adjusted:** the sigop-adjusted size, i.e. max(BIP 141 vsize, sigop-adjusted size), which reflects the value previously returned under the vsize label and continues to drive mempool acceptance and block template scoring.

  **vsize_bip141:** the pure BIP 141 virtual size, strictly `ceil(weight/4)`, matching the consensus definition is now reported here in `vsize_bip141` field. `vsize` field in now marked as DEPRECATED and users are advised to use the new `vsize_bip141` field for pure virtual size instead.

  This means that clients that depends on mempool policy size reported vsize will use `vsize_adjusted`, while `vsize` is now purely BIP 141.

  Additionally, this PR updates the relevant RPC help text to clearly document the distinction between these two sizes, and adds supporting documentation `doc/policy/feerates-and-vsize.md` to better explain fee rates, virtual size calculations, sigop adjustments, and the mempool policy heuristics.

  A new field, vsize_adjusted, has also been added to the getrawtransaction RPC result when input information (transaction is in the mempool) is available. Exposing this value provides users with more precise insight into how the transaction’s sigops impact its effective size for policy and fee estimation.

  Note: This picks up work from the closed [#27591](https://github.com/bitcoin/bitcoin/pull/27591)
  Fixes [#32775](https://github.com/bitcoin/bitcoin/issues/32775)

ACKs for top commit:
  achow101:
    ACK 29b124416e
  hodlinator:
    re-ACK 29b124416e
  ismaelsadeeq:
    Code review ACK 29b124416e
  sedited:
    ACK 29b124416e

Tree-SHA512: 9322ab1a2f7561b4221fb2bbe9f822c402f845c52a93de14008c1e5bc33e5c6f19ebc647ab6615b7c6be137c76cff6a33c6920818a78813de5632eb88c96a876
2026-07-24 15:09:10 -07:00
Ava Chow
11ebbd9072 Merge bitcoin/bitcoin#28463: p2p: Increase inbound capacity for block-relay only connections
c11508406e doc: Update docs that refer to -maxconnections (Martin Zumsande)
69ce0dba2a test: add test that EvictTxPeerIfFull only evicts tx-relaying peers (brunoerg)
3ed7f06418 p2p: trigger possible eviction if we support bloom filters and change a peer to tx relay (Martin Zumsande)
0bd3d3dfa5 init: make inbound tx relay percentage configurable (Amiti Uttarwar)
cc59aee196 test: add functional test for inbound maxconnection limits (Amiti Uttarwar)
1b76e04736 net: increase inbound capacity for block-relay-only connections (Martin Zumsande)
87bca1c2ad net: add options to AttemptToEvictConnection (Martin Zumsande)

Pull request description:

  This is joint work with amitiuttarwar.

  See issue #28462 for a broader discussion on increasing the number of block-relay-only connections independent of this particular implementation proposal.

  We suggest to increase the number of inbound slots allocated to block-relay-only peers by increasing the default maximum connections from 125 to 200, with 50% of inbound slots accessible for tx-relaying peers.
  This is a prerequisite for being able to increase the default number of outgoing block-relay-only peers later, because the current inbound capacity of the network is not sufficient.
  In order to account for incoming tx-relaying peers separately from incoming block-relay peers, changes to the inbound eviction logic are necessary.

  See the next post in this thread for a more detailed explanation and motivation of the changes.

ACKs for top commit:
  instagibbs:
    ACK c11508406e
  achow101:
    ACK c11508406e
  dergoegge:
    crACK c11508406e
  marcofleon:
    ACK c11508406e

Tree-SHA512: c71e1481eb235429a6c9d7ce771c7bf825f850b135e904ccfa3505112628fef4188b560d0be0847c968e5ece43c1518590069b7e6e2480790d3ef1ce07d1ac38
2026-07-24 14:30:00 -07:00
fanquake
3f313a774b build: set CMAKE_VISIBILITY_INLINES_HIDDEN in REDUCE_EXPORTS
This was originally part of the CMake switchover, but was removed
because it was an addition, rather than a port. Add it now.

> This switch declares that the user does not attempt to compare pointers
> to inline functions or methods where the addresses of the two functions
> are taken in different shared objects.

> The effect of this is that GCC may, effectively, mark inline methods
> with __attribute__ ((visibility ("hidden"))) so that they do not appear
> in the export table of a DSO

See https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html.

See also
https://cmake.org/cmake/help/latest/prop_tgt/VISIBILITY_INLINES_HIDDEN.html.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2026-07-24 18:16:10 +01:00
merge-script
3a2c52f9d7 Merge bitcoin/bitcoin#35792: refactor: Make all const static class members constexpr
05c35c402c refactor: Make all `const static` class members `constexpr` (rustaceanrob)

Pull request description:

  Found in #35713. If a `static class` member is not inlined or `constexpr`, the linker will fail when attempting to ODR-use the constant (passing as `const T&`). These can be fixed by finding all member variables that are `const` qualified and inlining them with `constexpr`. There is a clang-tidy pull request that would lint these callsites: https://github.com/llvm/llvm-project/pull/162741

  A script was used to modify these sites, however it cannot run as a scripted-diff because it uses clang-query and a build folder.

  The script only queries for integer and enumeration types, as other data members would have to be marked `constexpr` or `inline` from what I understand: https://en.cppreference.com/cpp/language/static#Constant_static_members

  Removing the ZMQ forward declaration was a clang-tidy lint.

  <details>
  <summary>The script used to find these sites, LLM assisted:</summary>

  ```
  set -uxo pipefail

  cd "$(git rev-parse --show-toplevel)"

  BUILD=${BUILD:-build}
  if [ ! -f "${BUILD}/compile_commands.json" ]; then
      echo "error: ${BUILD}/compile_commands.json not found. Run cmake -B ${BUILD} first." >&2
      exit 1
  fi
  if ! command -v clang-query >/dev/null; then
      echo "error: clang-query not on PATH. Install clang-tools." >&2
      exit 1
  fi
  if ! git diff --quiet || ! git diff --cached --quiet; then
      echo "error: working tree has uncommitted changes. Commit or stash first." >&2
      exit 1
  fi

  MATCHER='match varDecl(hasParent(cxxRecordDecl()),
                        hasType(qualType(isConstQualified(),
                                         anyOf(hasCanonicalType(isInteger()),
                                               hasDeclaration(enumDecl())))),
                        hasInitializer(expr()),
                        unless(isConstexpr()),
                        isExpansionInFileMatching("/src/"))'

  RAW=$(mktemp)
  trap 'rm -f "$RAW"' EXIT

  echo "Sweeping TUs (batched, may take a few minutes)..." >&2
  find src -type d \( -name secp256k1 -o -name leveldb -o -name crc32c \
                      -o -name minisketch -o -name libmultiprocess -o -name ctaes \) -prune -o \
          -name '*.cpp' -print0 \
      | xargs -0 -n 50 clang-query -p "${BUILD}" \
            -c 'set output diag' \
            -c "${MATCHER}" \
            >>"$RAW" || true

  ROOT=$(pwd)
  LOCS=$(grep -oE "${ROOT}/src/[^:]+:[0-9]+:[0-9]+:" "$RAW" \
      | sed -E "s|^${ROOT}/||; s|:[0-9]+:$||" \
      | sort -u)

  if [ -z "$LOCS" ]; then
      echo "no matches" >&2
      exit 0
  fi

  FILTERED=""
  while IFS=: read -r file line; do
      case "$file" in
          src/secp256k1/*|src/leveldb/*|src/crc32c/*|src/minisketch/*|src/ipc/libmultiprocess/*|src/crypto/ctaes/*) continue ;;
          src/tinyformat.h) continue ;;
      esac
      src=$(sed -n "${line}p" "$file")
      case "$src" in *inline*) continue ;; esac
      FILTERED+="${file}:${line}"$'\n'
  done <<<"$LOCS"
  FILTERED=$(printf '%s' "$FILTERED" | sed '/^$/d')

  if [ -z "$FILTERED" ]; then
      echo "no matches after filtering" >&2
      exit 0
  fi

  echo "Sites to rewrite ($(echo "$FILTERED" | wc -l)):" >&2
  echo "$FILTERED" >&2

  declare -A LINES
  while IFS=: read -r file line; do
      LINES[$file]+="${line} "
  done <<<"$FILTERED"

  for file in "${!LINES[@]}"; do
      args=()
      for line in ${LINES[$file]}; do
          args+=(-e "${line}s/static const /static constexpr /")
      done
      sed -i "${args[@]}" "$file"
  done

  echo >&2
  echo "===== proposed diff =====" >&2
  git --no-pager diff
  ```
  </details>

ACKs for top commit:
  fanquake:
    ACK 05c35c402c
  sedited:
    ACK 05c35c402c

Tree-SHA512: 2b823b94ddfae1a889b50ebdb6a8828d95baaa2578756daa826b6579045f7e92ea91562be96865c1df267f4dd288f91fd84ed60090e9ad38adc4efeb865cd90a
2026-07-24 18:14:07 +01:00
sedited
f5d7cc66ec doc: Discourage adding AI agents as commit authors 2026-07-24 18:35:24 +02:00
rustaceanrob
05c35c402c refactor: Make all const static class members constexpr
If a `static class` member is not inlined or `constexpr`, the linker
will fail when attempting to ODR-use the constant (passing as `const
T&`). These can be fixed by finding all member variables that are
`const` qualified and inlining them with `constexpr`. There is a
clang-tidy pull request that would lint these callsites: https://github.com/llvm/llvm-project/pull/162741

A script was used to modify these sites, however it cannot run as a
scripted-diff because it uses clang-query and a build folder.

The script only queries for integer and enumeration types, as other data
members would have to be marked `constexpr` or `inline` from what I
understand: https://en.cppreference.com/cpp/language/static#Constant_static_members

Removing the ZMQ forward declaration was a clang-tidy lint.

The script used to find these sites, LLM assisted:
```
set -uxo pipefail

cd "$(git rev-parse --show-toplevel)"

BUILD=${BUILD:-build}
if [ ! -f "${BUILD}/compile_commands.json" ]; then
    echo "error: ${BUILD}/compile_commands.json not found. Run cmake -B ${BUILD} first." >&2
    exit 1
fi
if ! command -v clang-query >/dev/null; then
    echo "error: clang-query not on PATH. Install clang-tools." >&2
    exit 1
fi
if ! git diff --quiet || ! git diff --cached --quiet; then
    echo "error: working tree has uncommitted changes. Commit or stash first." >&2
    exit 1
fi

MATCHER='match varDecl(hasParent(cxxRecordDecl()),
                      hasType(qualType(isConstQualified(),
                                       anyOf(hasCanonicalType(isInteger()),
                                             hasDeclaration(enumDecl())))),
                      hasInitializer(expr()),
                      unless(isConstexpr()),
                      isExpansionInFileMatching("/src/"))'

RAW=$(mktemp)
trap 'rm -f "$RAW"' EXIT

echo "Sweeping TUs (batched, may take a few minutes)..." >&2
find src -type d \( -name secp256k1 -o -name leveldb -o -name crc32c \
                    -o -name minisketch -o -name libmultiprocess -o -name ctaes \) -prune -o \
        -name '*.cpp' -print0 \
    | xargs -0 -n 50 clang-query -p "${BUILD}" \
          -c 'set output diag' \
          -c "${MATCHER}" \
          >>"$RAW" || true

ROOT=$(pwd)
LOCS=$(grep -oE "${ROOT}/src/[^:]+:[0-9]+:[0-9]+:" "$RAW" \
    | sed -E "s|^${ROOT}/||; s|:[0-9]+:$||" \
    | sort -u)

if [ -z "$LOCS" ]; then
    echo "no matches" >&2
    exit 0
fi

FILTERED=""
while IFS=: read -r file line; do
    case "$file" in
        src/secp256k1/*|src/leveldb/*|src/crc32c/*|src/minisketch/*|src/ipc/libmultiprocess/*|src/crypto/ctaes/*) continue ;;
        src/tinyformat.h) continue ;;
    esac
    src=$(sed -n "${line}p" "$file")
    case "$src" in *inline*) continue ;; esac
    FILTERED+="${file}:${line}"$'\n'
done <<<"$LOCS"
FILTERED=$(printf '%s' "$FILTERED" | sed '/^$/d')

if [ -z "$FILTERED" ]; then
    echo "no matches after filtering" >&2
    exit 0
fi

echo "Sites to rewrite ($(echo "$FILTERED" | wc -l)):" >&2
echo "$FILTERED" >&2

declare -A LINES
while IFS=: read -r file line; do
    LINES[$file]+="${line} "
done <<<"$FILTERED"

for file in "${!LINES[@]}"; do
    args=()
    for line in ${LINES[$file]}; do
        args+=(-e "${line}s/static const /static constexpr /")
    done
    sed -i "${args[@]}" "$file"
done

echo >&2
echo "===== proposed diff =====" >&2
git --no-pager diff
```
2026-07-24 14:01:06 +01:00
Martin Zumsande
c11508406e doc: Update docs that refer to -maxconnections 2026-07-24 14:16:27 +02:00
brunoerg
69ce0dba2a test: add test that EvictTxPeerIfFull only evicts tx-relaying peers
Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
2026-07-24 14:16:27 +02:00
Martin Zumsande
3ed7f06418 p2p: trigger possible eviction if we support bloom filters and change a peer to tx relay
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
2026-07-24 14:16:27 +02:00
Amiti Uttarwar
0bd3d3dfa5 init: make inbound tx relay percentage configurable
Permit users to change the amount of inbounds that are permitted to relay
transactions. This is particularly relevant to ensure that superusers that are
not concerned with resource usage are not artificially restricted from offering
many transaction relay slots to the network.

Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
2026-07-24 14:16:27 +02:00
Amiti Uttarwar
cc59aee196 test: add functional test for inbound maxconnection limits
Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
2026-07-24 14:16:27 +02:00