p2p: cap maxconnections at 2,000 to reduce crash risk #35919

Manually merged
l0rinc merged 1 commit from l0rinc/p2p-handle-zero-orphanage-latency-share into master 2026-10-21 14:03:43 +00:00 AGit
l0rinc commented 2026-08-06 20:40:51 +00:00 (Migrated from github.com)

Problem: The orphanage can abort when more than 3,000 peers have orphan announcements.
The -maxconnections setting currently has no explicit upper bound.

Fix: Cap -maxconnections at 2,000 with a warning before reserving file descriptors, while retaining the default of 200.

**Problem:** The orphanage can abort when more than 3,000 peers have orphan announcements. The `-maxconnections` setting currently has no explicit upper bound. **Fix:** Cap `-maxconnections` at 2,000 with a warning before reserving file descriptors, while retaining the default of 200.
DrahtBot commented 2026-08-06 20:40:58 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK instagibbs, optout21, sedited
Stale ACK jeanpablojp, brunoerg, danielabrozzoni, vasild

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

No conflicts as of last run.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35919 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35919.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35919#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [instagibbs](https://github.com/bitcoin/bitcoin/pull/35919#issuecomment-6296023038), [optout21](https://github.com/bitcoin/bitcoin/pull/35919#issuecomment-6296736285), [sedited](https://github.com/bitcoin/bitcoin/pull/35919#pullrequestreview-5600828291) | | Stale ACK | [jeanpablojp](https://github.com/bitcoin/bitcoin/pull/35919#issuecomment-5254985555), [brunoerg](https://github.com/bitcoin/bitcoin/pull/35919#pullrequestreview-5199777906), [danielabrozzoni](https://github.com/bitcoin/bitcoin/pull/35919#pullrequestreview-5200112366), [vasild](https://github.com/bitcoin/bitcoin/pull/35919#pullrequestreview-5585835334) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts No conflicts as of last run. <!--5faf32d7da4f0f540f40219e4f7537a3-->
jeanpablojp commented 2026-08-10 09:50:49 +00:00 (Migrated from github.com)

ACK 1ac1f10e7b0e06e8d01a35cabf5bef49ea43c69a

Reproduced the abort on master 128456b62d with three peers against a global limit of 2. The two halves of the fix depend on each other: with only the clamp and the old > filter, every peer sits at exactly its floored share, the heap comes out empty and the loop pops from it, which segfaults here. So >= is not cleanup. Full unit suite and p2p_orphan_handling.py pass on the merge.

nit: the comment on MaxPeerLatencyScore() (txorphanage.cpp:210) still says the number of peers times that value adds up to MaxGlobalLatencyScore(), and that keeping every peer below 1 keeps the global limit. LimitOrphans() now enforces a floor of 1 instead, so that stops matching what runs once there are more peers than slots.

nit: the new test passes whichever peer gets trimmed. BOOST_CHECK(!orphanage->HaveTxFromPeer(txns.at(2)->GetWitnessHash(), 2)) pins it, and passes as written.

nit: #include <util/check.h> in orphanage_tests.cpp is added by de6342cd45 and nothing uses it after 1ac1f10e7b. test_bitcoin builds with the line removed.

ACK 1ac1f10e7b0e06e8d01a35cabf5bef49ea43c69a Reproduced the abort on master `128456b62d` with three peers against a global limit of 2. The two halves of the fix depend on each other: with only the clamp and the old `>` filter, every peer sits at exactly its floored share, the heap comes out empty and the loop pops from it, which segfaults here. So `>=` is not cleanup. Full unit suite and `p2p_orphan_handling.py` pass on the merge. nit: the comment on `MaxPeerLatencyScore()` (txorphanage.cpp:210) still says the number of peers times that value adds up to `MaxGlobalLatencyScore()`, and that keeping every peer below 1 keeps the global limit. `LimitOrphans()` now enforces a floor of 1 instead, so that stops matching what runs once there are more peers than slots. nit: the new test passes whichever peer gets trimmed. `BOOST_CHECK(!orphanage->HaveTxFromPeer(txns.at(2)->GetWitnessHash(), 2))` pins it, and passes as written. nit: `#include <util/check.h>` in `orphanage_tests.cpp` is added by de6342cd45 and nothing uses it after 1ac1f10e7b. `test_bitcoin` builds with the line removed.
l0rinc commented 2026-08-11 02:27:20 +00:00 (Migrated from github.com)

Thanks @jeanpablojp, rebased and took all three suggestions (code comment, include and new test) - added you as co-author for the first commit.

Thanks @jeanpablojp, rebased and took all three suggestions (code comment, include and new test) - added you as co-author for the first commit.
jeanpablojp commented 2026-08-11 15:07:22 +00:00 (Migrated from github.com)

re-ACK 5f4429c20c

Thanks for the co-author credit.

re-ACK 5f4429c20c5cae0eb59baa867e131cc939e92d5d Thanks for the co-author credit.
brunoerg (Migrated from github.com) reviewed 2026-09-14 15:22:50 +00:00
brunoerg (Migrated from github.com) commented 2026-09-14 15:22:50 +00:00

It's worthing changing the fuzz targets to reach the zero-share path. See:

diff --git a/src/test/fuzz/txorphan.cpp b/src/test/fuzz/txorphan.cpp
index 9466f77624..90f9fe4fa0 100644
--- a/src/test/fuzz/txorphan.cpp
+++ b/src/test/fuzz/txorphan.cpp
@@ -471,7 +471,7 @@ FUZZ_TARGET(txorphanage_sim)
     // 3. Initialize real orphanage
     //
 
-    auto max_global_latency_score = provider.ConsumeIntegralInRange<node::TxOrphanage::Count>(NUM_PEERS, MAX_ANN);
+    auto max_global_latency_score = provider.ConsumeIntegralInRange<node::TxOrphanage::Count>(1, MAX_ANN);
     auto reserved_peer_usage = provider.ConsumeIntegralInRange<node::TxOrphanage::Usage>(1, total_usage);
     auto real = node::MakeTxOrphanage(max_global_latency_score, reserved_peer_usage);
 
@@ -684,8 +684,8 @@ FUZZ_TARGET(txorphanage_sim)
             }
         }
         // Always trim after each command if needed.
-        const auto max_ann = max_global_latency_score / std::max<unsigned>(1, count_peers_fn());
-        const auto max_mem = reserved_peer_usage;
+        const auto max_ann = std::max<unsigned>(1, max_global_latency_score / std::max<unsigned>(1, count_peers_fn()));
+       const auto max_mem = reserved_peer_usage;
         while (true) {
             // Count global usage and number of peers.
             node::TxOrphanage::Usage total_usage{0};
@@ -713,7 +713,7 @@ FUZZ_TARGET(txorphanage_sim)
                 }
             }
             assert(worst_peer != unsigned(-1));
-            assert(ByRatio{worst_dos_score} > ByRatio{FeeFrac(1, 1)});
+            assert(ByRatio{worst_dos_score} >= ByRatio{FeeFrac(1, 1)});
             // Find oldest announcement from worst_peer, preferring non-reconsiderable ones.
             bool done{false};
             for (int reconsider = 0; reconsider < 2; ++reconsider) {

It's worthing changing the fuzz targets to reach the zero-share path. See: ```diff diff --git a/src/test/fuzz/txorphan.cpp b/src/test/fuzz/txorphan.cpp index 9466f77624..90f9fe4fa0 100644 --- a/src/test/fuzz/txorphan.cpp +++ b/src/test/fuzz/txorphan.cpp @@ -471,7 +471,7 @@ FUZZ_TARGET(txorphanage_sim) // 3. Initialize real orphanage // - auto max_global_latency_score = provider.ConsumeIntegralInRange<node::TxOrphanage::Count>(NUM_PEERS, MAX_ANN); + auto max_global_latency_score = provider.ConsumeIntegralInRange<node::TxOrphanage::Count>(1, MAX_ANN); auto reserved_peer_usage = provider.ConsumeIntegralInRange<node::TxOrphanage::Usage>(1, total_usage); auto real = node::MakeTxOrphanage(max_global_latency_score, reserved_peer_usage); @@ -684,8 +684,8 @@ FUZZ_TARGET(txorphanage_sim) } } // Always trim after each command if needed. - const auto max_ann = max_global_latency_score / std::max<unsigned>(1, count_peers_fn()); - const auto max_mem = reserved_peer_usage; + const auto max_ann = std::max<unsigned>(1, max_global_latency_score / std::max<unsigned>(1, count_peers_fn())); + const auto max_mem = reserved_peer_usage; while (true) { // Count global usage and number of peers. node::TxOrphanage::Usage total_usage{0}; @@ -713,7 +713,7 @@ FUZZ_TARGET(txorphanage_sim) } } assert(worst_peer != unsigned(-1)); - assert(ByRatio{worst_dos_score} > ByRatio{FeeFrac(1, 1)}); + assert(ByRatio{worst_dos_score} >= ByRatio{FeeFrac(1, 1)}); // Find oldest announcement from worst_peer, preferring non-reconsiderable ones. bool done{false}; for (int reconsider = 0; reconsider < 2; ++reconsider) { ```
brunoerg (Migrated from github.com) approved these changes 2026-09-14 15:41:50 +00:00
brunoerg (Migrated from github.com) left a comment

code review ACK 5f4429c20c

code review ACK 5f4429c20c5cae0eb59baa867e131cc939e92d5d
danielabrozzoni (Migrated from github.com) reviewed 2026-09-15 11:01:39 +00:00
danielabrozzoni (Migrated from github.com) left a comment

light ACK 5f4429c20c

I'm light ACKing because it's my first time looking into the orphanage. Code looks good, I left a couple of non-blocking ideas.

light ACK 5f4429c20c5cae0eb59baa867e131cc939e92d5d I'm light ACKing because it's my first time looking into the orphanage. Code looks good, I left a couple of non-blocking ideas.
danielabrozzoni (Migrated from github.com) commented 2026-09-15 11:00:35 +00:00

(comment placed in random location), in src/node/txorphanage.h, we say:
github.com/bitcoin/bitcoin@51ddab532c/src/node/txorphanage.h (L35)

"as long as they don't exceed their limits" is no longer accurate: a peer exactly at his limit isn't protected anymore if the number of peers holding orphans is higher than the global limit. You could rephrase this as "as long as they stay strictly below their limits"

(comment placed in random location), in `src/node/txorphanage.h`, we say: https://github.com/bitcoin/bitcoin/blob/51ddab532cb38213e2258c24c492bc8a392ffc90/src/node/txorphanage.h#L35 "as long as they don't exceed their limits" is no longer accurate: a peer exactly at his limit isn't protected anymore if the number of peers holding orphans is higher than the global limit. You could rephrase this as "as long as they stay strictly below their limits"
danielabrozzoni (Migrated from github.com) commented 2026-09-14 22:19:50 +00:00

Might be worth it to clarify why it might be equal? Something like:

Note that the per-peer latency limit is floored at 1, so if there are more peers with orphans than the global latency limit, the global limit is exceeded even if every peer's DoS score is exactly 1.

Might be worth it to clarify why it might be equal? Something like: Note that the per-peer latency limit is floored at 1, so if there are more peers with orphans than the global latency limit, the global limit is exceeded even if every peer's DoS score is exactly 1.
danielabrozzoni (Migrated from github.com) commented 2026-09-14 16:14:22 +00:00

nit: extra whitespace here

nit: extra whitespace here
danielabrozzoni (Migrated from github.com) commented 2026-09-14 22:00:06 +00:00

nit: (Found with Fable 5): every other block in the test ends with a orphanage->SanityCheck();, you should add it there too. It will initially fail, because the orphanage is not properly trimmed.

In the first commit:

diff --git a/src/node/txorphanage.cpp b/src/node/txorphanage.cpp
index 58880139b3..3285cf51f5 100644
--- a/src/node/txorphanage.cpp
+++ b/src/node/txorphanage.cpp
@@ -765,7 +765,7 @@ void TxOrphanageImpl::SanityCheck() const
         TxOrphanage::Count{0}, [](TxOrphanage::Count sum, const auto pair) { return sum + pair.second.m_total_latency_score; });
     assert(summed_peer_latency_score >= m_unique_rounded_input_scores + m_orphans.size());
 
-    assert(!NeedsTrim());
+    Assert(!NeedsTrim());
 }
 
 TxOrphanage::Count TxOrphanageImpl::MaxGlobalLatencyScore() const { return m_max_global_latency_score; }
diff --git a/src/test/orphanage_tests.cpp b/src/test/orphanage_tests.cpp
index 8a2c2b81ec..07fec603a8 100644
--- a/src/test/orphanage_tests.cpp
+++ b/src/test/orphanage_tests.cpp
@@ -352,6 +352,8 @@ BOOST_AUTO_TEST_CASE(peer_dos_limits)
 
         BOOST_CHECK_GT(orphanage->TotalLatencyScore(), global_limit); // TODO: Trim back to the global limit.
         BOOST_CHECK_GT(orphanage->CountAnnouncements(), global_limit); // TODO: Trim back to the global limit.
+
+        BOOST_CHECK_EXCEPTION(orphanage->SanityCheck(), NonFatalCheckError, HasReason{"!NeedsTrim()"}); // TODO: should pass sanity checks
     }
 
     // Test eviction of multiple transactions at a time

Then you change it to orphanage->SanityCheck(); in the second one.

nit: (Found with Fable 5): every other block in the test ends with a `orphanage->SanityCheck();`, you should add it there too. It will initially fail, because the orphanage is not properly trimmed. In the first commit: ``` diff --git a/src/node/txorphanage.cpp b/src/node/txorphanage.cpp index 58880139b3..3285cf51f5 100644 --- a/src/node/txorphanage.cpp +++ b/src/node/txorphanage.cpp @@ -765,7 +765,7 @@ void TxOrphanageImpl::SanityCheck() const TxOrphanage::Count{0}, [](TxOrphanage::Count sum, const auto pair) { return sum + pair.second.m_total_latency_score; }); assert(summed_peer_latency_score >= m_unique_rounded_input_scores + m_orphans.size()); - assert(!NeedsTrim()); + Assert(!NeedsTrim()); } TxOrphanage::Count TxOrphanageImpl::MaxGlobalLatencyScore() const { return m_max_global_latency_score; } diff --git a/src/test/orphanage_tests.cpp b/src/test/orphanage_tests.cpp index 8a2c2b81ec..07fec603a8 100644 --- a/src/test/orphanage_tests.cpp +++ b/src/test/orphanage_tests.cpp @@ -352,6 +352,8 @@ BOOST_AUTO_TEST_CASE(peer_dos_limits) BOOST_CHECK_GT(orphanage->TotalLatencyScore(), global_limit); // TODO: Trim back to the global limit. BOOST_CHECK_GT(orphanage->CountAnnouncements(), global_limit); // TODO: Trim back to the global limit. + + BOOST_CHECK_EXCEPTION(orphanage->SanityCheck(), NonFatalCheckError, HasReason{"!NeedsTrim()"}); // TODO: should pass sanity checks } // Test eviction of multiple transactions at a time ``` Then you change it to `orphanage->SanityCheck();` in the second one.
l0rinc (Migrated from github.com) reviewed 2026-09-15 22:53:25 +00:00
l0rinc (Migrated from github.com) left a comment

Rebased, adjusted the commit structure, the PR description and pushed a version incorporating the review feedback:

  • The three-peer regression keeps the characterization and fix assertions aligned, and the fix runs SanityCheck() after trimming.
  • txorphanage_sim now exercises global latency scores below the peer count and models the minimum share and score-one eligibility.
  • The eviction comments now distinguish peers below their limits from peers exactly at a limit.
  • Both GetDosScore() resource preconditions now use Assert().

Thanks @brunoerg and @danielabrozzoni for the suggestions.

Rebased, adjusted the commit structure, the PR description and pushed a version incorporating the review feedback: * The three-peer regression keeps the characterization and fix assertions aligned, and the fix runs `SanityCheck()` after trimming. * `txorphanage_sim` now exercises global latency scores below the peer count and models the minimum share and score-one eligibility. * The eviction comments now distinguish peers below their limits from peers exactly at a limit. * Both `GetDosScore()` resource preconditions now use `Assert()`. Thanks @brunoerg and @danielabrozzoni for the suggestions.
l0rinc (Migrated from github.com) commented 2026-09-15 22:51:26 +00:00

Good point, fixed, thanks!

Good point, fixed, thanks!
l0rinc (Migrated from github.com) commented 2026-09-15 22:51:12 +00:00

Added a whole new commit with doc adjustments, thanks!

Added a whole new commit with doc adjustments, thanks!
l0rinc (Migrated from github.com) commented 2026-09-15 17:34:30 +00:00

Thanks, widened the simulation's limits and matched its trimming model to the minimum share of one, added you as coauthor.

Thanks, widened the simulation's limits and matched its trimming model to the minimum share of one, added you as coauthor.
l0rinc (Migrated from github.com) commented 2026-09-15 17:09:44 +00:00

It's not extra, in the next commit it're replaced by a !, this way the diff is simpler :)

It's not extra, in the next commit it're replaced by a `!`, this way the diff is simpler :)
l0rinc (Migrated from github.com) commented 2026-09-15 17:36:02 +00:00

Thanks, added the sanity check after trimming back to the limit (was originally skipped since the characterization test couldn't include it yet).

Thanks, added the sanity check after trimming back to the limit (was originally skipped since the characterization test couldn't include it yet).
First-time contributor

Base: 4303f3b7f0775cdbbe77faddf142e1e44fa590ca
Head: b30f750de56c4e510f8af5a4dbba4e821b71a9b1

Design and approach

The peer bound omits -connect peers (src/node/txorphanage.h:26, head)

The assertion does not bound peers opened through -connect. Startup copies each configured target into m_specified_outgoing, and ThreadOpenConnections opens each as ConnectionType::MANUAL with no outbound grant. This path has no -maxconnections or addnode-semaphore limit, and manual peers can enter the transaction-download path that adds orphan announcements. More than 3,000 such peers could therefore still make MaxPeerLatencyScore() zero, leaving this configuration exposed to the reported risk. Include transaction-relaying -connect peers in the bound or ensure the orphanage handles higher peer counts. Although the checkout permits this configuration, no production configuration with more than 3,000 successful -connect peers was identified, so production impact is unconfirmed.

Review coverage was incomplete.

Review limitations
  • verifier: The supplied GitHub discussion comments and prior-proposal history were not independently checked, so the broader concept comparison remains unresolved.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> Base: `4303f3b7f0775cdbbe77faddf142e1e44fa590ca` Head: `b30f750de56c4e510f8af5a4dbba4e821b71a9b1` ##### Design and approach **The peer bound omits `-connect` peers** (src/node/txorphanage.h:26, head) The assertion does not bound peers opened through `-connect`. Startup copies each configured target into `m_specified_outgoing`, and `ThreadOpenConnections` opens each as `ConnectionType::MANUAL` with no outbound grant. This path has no `-maxconnections` or addnode-semaphore limit, and manual peers can enter the transaction-download path that adds orphan announcements. More than 3,000 such peers could therefore still make `MaxPeerLatencyScore()` zero, leaving this configuration exposed to the reported risk. Include transaction-relaying `-connect` peers in the bound or ensure the orphanage handles higher peer counts. Although the checkout permits this configuration, no production configuration with more than 3,000 successful `-connect` peers was identified, so production impact is unconfirmed. Review coverage was incomplete. <details> <summary>Review limitations</summary> - verifier: The supplied GitHub discussion comments and prior-proposal history were not independently checked, so the broader concept comparison remains unresolved. </details> [Full review report](<https://review.fish.foo/traces/35919-b30f750de56c4e510f8af5a4dbba4e821b71a9b1-941-3.html>)
l0rinc commented 2026-10-16 13:22:22 +00:00 (Migrated from github.com)

Rebased on master and simplified this to cap -maxconnections at 2,000 with a warning instead of changing orphanage trimming - seems simpler, thanks @instagibbs.

Rebased on master and simplified this to cap `-maxconnections` at 2,000 with a warning instead of changing orphanage trimming - seems simpler, thanks @instagibbs.
instagibbs commented 2026-10-18 02:44:59 +00:00 (Migrated from github.com)

concept ACK, we really shouldn't let users configure a number where a deterministic crash is possible

concept ACK, we really shouldn't let users configure a number where a deterministic crash is possible
optout21 (Migrated from github.com) reviewed 2026-10-20 06:45:58 +00:00
optout21 (Migrated from github.com) left a comment

crACK ec01169832
LGTM!

crACK ec01169832452a818dcf3f0539150e87d3358309 LGTM!
optout21 (Migrated from github.com) commented 2026-10-20 06:45:13 +00:00

ec01169 p2p: cap maxconnections at 2000:

Nonblocking nit: There is also another parsing of "-maxconnections" in line 804, there it could be also changed to GetIntArg<int>.

> [ec01169](https://github.com/bitcoin/bitcoin/pull/35919/changes/ec01169832452a818dcf3f0539150e87d3358309) _p2p: cap maxconnections at 2000_: Nonblocking nit: There is also another parsing of "-maxconnections" in line 804, there it could be also changed to `GetIntArg<int>`.
l0rinc (Migrated from github.com) reviewed 2026-10-20 09:56:20 +00:00
l0rinc (Migrated from github.com) commented 2026-10-20 09:56:20 +00:00

We could do that for consistency, but here I changed it to avoid premature 32 bit casts. Given that we're checking the bounds here, whoever requests the param after this should be able to use GetIntArg.

We could do that for consistency, but here I changed it to avoid premature 32 bit casts. Given that we're checking the bounds here, whoever requests the param after this should be able to use `GetIntArg`.
instagibbs (Migrated from github.com) approved these changes 2026-10-20 13:01:35 +00:00
instagibbs (Migrated from github.com) left a comment

ACK ec01169832

The residual risk is the client adding 1000 more connections manually, which seems vanishingly small

ACK ec01169832452a818dcf3f0539150e87d3358309 The residual risk is the client adding 1000 more connections manually, which seems vanishingly small
instagibbs (Migrated from github.com) commented 2026-10-20 12:59:52 +00:00

do we want to document this more? e.g., somewhere have

  static_assert(MAX_PEER_CONNECTIONS + MAX_ADDNODE_CONNECTIONS +
  MAX_PRIVATE_BROADCAST_CONNECTIONS <
  node::DEFAULT_MAX_ORPHANAGE_LATENCY_SCORE);
do we want to document this more? e.g., somewhere have ``` static_assert(MAX_PEER_CONNECTIONS + MAX_ADDNODE_CONNECTIONS + MAX_PRIVATE_BROADCAST_CONNECTIONS < node::DEFAULT_MAX_ORPHANAGE_LATENCY_SCORE); ```
vasild (Migrated from github.com) approved these changes 2026-10-20 13:39:26 +00:00
vasild (Migrated from github.com) left a comment

ACK ec01169832

Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

ACK ec01169832452a818dcf3f0539150e87d3358309
-----BEGIN PGP SIGNATURE-----

iQRPBAEBCAA5FiEE5k2NRWFNsHVF2czBVN8G9ktVy78FAmrXbu4bFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwzAAoJEFTfBvZLVcu/wRUf/2JmvVFzOMX79oBujbIu
pbH1LsqgnfybhKbo8Qs6suNeD1o+Q1fEVfuNDL+j0fRR2ziXWgvZu/NHxdMqF6Mv
d+2bp9i7rVYdiI7Xk3vz6Ha1dzwnu3z6CWTpLGQP7Lr/ScYck+QcJXI/xdGMaVIT
JRuI7KanlgWRd94HMRxy38gBWtOxcypF1YNkVUzYyUGNq+HCwg3yQ+4Nkj/5HXKS
TQQYQIlEmyXCqG3ham7mvOO3iZPreO/kkQH9lo7aWXAm4HGLzehtmh0fwRIp7znT
uC1Mz/zt4iDFoO2IwhkPIU/dUoWtHh7KIvIJ98sKhp1Dw7p664Gb7jdqlHFQ/RW9
N5wOSPAuy7RUEcVtYZpAAW2bkcN9PjMnJedu/hUjZGq/QMR9k+Ouejey9hZmCSa0
EN2MBKj8q/Fav4KE6jATsPxUbIWzQniQpHS27YGE84F4h1ytpLQcgTN8bzyszKN9
Y2BC8LDKWUJYcNBolTo5AYWVLwduU6NlJ+ZvrS9KiOGtikEJVyDjtxLmaCmKvhWf
F+xebzgzeLLFS2cczd5noz9raob5J3Z/FYvC5KENoxlLqiYsJDy6tw0xvhQd201t
GtNrD0vWgjGOa4G1ApBQsBLW4+XCMOrOtzDfdoCLrI2MUS5W7oaOsBWbvTQ+6NFA
Uk9nyCcbc1t8aYqoPJ/NWRZiAmueub+8fAli1oQz19bUT9xZMJHMrui/6Rx02Hfs
Fcak3BUJ5mwsvqUb0w+2SO5Mk7BXzft/Xawd2TiJlT6ovyaUpwUXyHPkAWkUt10y
Qd0UXrQTrO3xN3kINXiDW2NvTkgGqbwtfX3zkJVNa/sxe9NWmFyx5hmqIZcg2ll2
R2S6j1LY/k1FtO1y8scmDk2rMhT0oU+u/j64BgRfZJjTkziCbs3JvAX7P5eNO26n
nOMhWMvjjB/HqI3U5Izx6bb/dkiXA694IRIxzf3mo9CakWIFxqAPnMBk2vc3ATzY
rm1lM3eC6vmR0E10Db34BcSgvYHUozNQ4X8KPVmaT3I92EN2Vg6o2piGCzYYFHpx
QQZE0AlHjfOhwN2Qw6QQA5E2FF3mZcUtfkUcKa6F56ps/KuqSn/NB9FyEM/sOwBG
X8CV1jXevAM7AQrMjlzD9QwRiSA3k3b0gpefNvRl9psYMKUwOm29BrHGWNxfiCR+
lbhvt+L9FIgmCgnm4CbVfzka/uk0td0y4EL0vsvKXcpAQS0bJ3NBhUOZ08KgTEhN
ksCbJkIS1+aDKZ/2pfl+RtXlQFoanrDtpp5jGhQ3CLAKK9NebFZqNJ5N7TUGXDTD
r86Lx99WPHLp84WOgNmHPcGJ32n4I6UslJ2y0AHnCfZrPGfd3C8LSIw6PHlV/IsG
fhs=
=YbB3
-----END PGP SIGNATURE-----

vasild's public key is on openpgp.org

ACK ec01169832452a818dcf3f0539150e87d3358309 <details> <summary>Show Signature</summary> ``` -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 ACK ec01169832452a818dcf3f0539150e87d3358309 -----BEGIN PGP SIGNATURE----- iQRPBAEBCAA5FiEE5k2NRWFNsHVF2czBVN8G9ktVy78FAmrXbu4bFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwzAAoJEFTfBvZLVcu/wRUf/2JmvVFzOMX79oBujbIu pbH1LsqgnfybhKbo8Qs6suNeD1o+Q1fEVfuNDL+j0fRR2ziXWgvZu/NHxdMqF6Mv d+2bp9i7rVYdiI7Xk3vz6Ha1dzwnu3z6CWTpLGQP7Lr/ScYck+QcJXI/xdGMaVIT JRuI7KanlgWRd94HMRxy38gBWtOxcypF1YNkVUzYyUGNq+HCwg3yQ+4Nkj/5HXKS TQQYQIlEmyXCqG3ham7mvOO3iZPreO/kkQH9lo7aWXAm4HGLzehtmh0fwRIp7znT uC1Mz/zt4iDFoO2IwhkPIU/dUoWtHh7KIvIJ98sKhp1Dw7p664Gb7jdqlHFQ/RW9 N5wOSPAuy7RUEcVtYZpAAW2bkcN9PjMnJedu/hUjZGq/QMR9k+Ouejey9hZmCSa0 EN2MBKj8q/Fav4KE6jATsPxUbIWzQniQpHS27YGE84F4h1ytpLQcgTN8bzyszKN9 Y2BC8LDKWUJYcNBolTo5AYWVLwduU6NlJ+ZvrS9KiOGtikEJVyDjtxLmaCmKvhWf F+xebzgzeLLFS2cczd5noz9raob5J3Z/FYvC5KENoxlLqiYsJDy6tw0xvhQd201t GtNrD0vWgjGOa4G1ApBQsBLW4+XCMOrOtzDfdoCLrI2MUS5W7oaOsBWbvTQ+6NFA Uk9nyCcbc1t8aYqoPJ/NWRZiAmueub+8fAli1oQz19bUT9xZMJHMrui/6Rx02Hfs Fcak3BUJ5mwsvqUb0w+2SO5Mk7BXzft/Xawd2TiJlT6ovyaUpwUXyHPkAWkUt10y Qd0UXrQTrO3xN3kINXiDW2NvTkgGqbwtfX3zkJVNa/sxe9NWmFyx5hmqIZcg2ll2 R2S6j1LY/k1FtO1y8scmDk2rMhT0oU+u/j64BgRfZJjTkziCbs3JvAX7P5eNO26n nOMhWMvjjB/HqI3U5Izx6bb/dkiXA694IRIxzf3mo9CakWIFxqAPnMBk2vc3ATzY rm1lM3eC6vmR0E10Db34BcSgvYHUozNQ4X8KPVmaT3I92EN2Vg6o2piGCzYYFHpx QQZE0AlHjfOhwN2Qw6QQA5E2FF3mZcUtfkUcKa6F56ps/KuqSn/NB9FyEM/sOwBG X8CV1jXevAM7AQrMjlzD9QwRiSA3k3b0gpefNvRl9psYMKUwOm29BrHGWNxfiCR+ lbhvt+L9FIgmCgnm4CbVfzka/uk0td0y4EL0vsvKXcpAQS0bJ3NBhUOZ08KgTEhN ksCbJkIS1+aDKZ/2pfl+RtXlQFoanrDtpp5jGhQ3CLAKK9NebFZqNJ5N7TUGXDTD r86Lx99WPHLp84WOgNmHPcGJ32n4I6UslJ2y0AHnCfZrPGfd3C8LSIw6PHlV/IsG fhs= =YbB3 -----END PGP SIGNATURE----- ``` vasild's public key is [on openpgp.org](https://keys.openpgp.org/vks/v1/by-fingerprint/850E138BA9C0923881DFD55FCE712013582E2230) </details>
sedited (Migrated from github.com) reviewed 2026-10-20 14:01:26 +00:00
sedited (Migrated from github.com) commented 2026-10-20 14:01:26 +00:00

I thinks this would be worthwhile to add.

I thinks this would be worthwhile to add.
l0rinc commented 2026-10-20 16:31:43 +00:00 (Migrated from github.com)

Thanks for the reviews, added a static_assert to explain why capping was necessary.

Thanks for the reviews, added a `static_assert` to explain why capping was necessary.
instagibbs commented 2026-10-20 16:39:00 +00:00 (Migrated from github.com)
reACK https://github.com/bitcoin/bitcoin/pull/35919/commits/b30f750de56c4e510f8af5a4dbba4e821b71a9b1
optout21 commented 2026-10-20 17:15:28 +00:00 (Migrated from github.com)

reACK b30f750de5

reACK b30f750de56c4e510f8af5a4dbba4e821b71a9b1
sedited (Migrated from github.com) approved these changes 2026-10-21 13:53:41 +00:00
sedited (Migrated from github.com) left a comment

ACK b30f750de5

Seems fine, don't think I know of anybody actually hitting 2000 peers.

ACK b30f750de56c4e510f8af5a4dbba4e821b71a9b1 Seems fine, don't think I know of anybody actually hitting 2000 peers.
fanquake commented 2026-10-21 20:39:20 +00:00 (Migrated from github.com)

Backported to 32.x in #36596.

Backported to `32.x` in #36596.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35919
No description provided.