Repository navigation
fix(dash-spv): spread peers across network groups - #1372
Draft
xdustinface wants to merge 1 commit into
Draft
xdustinface wants to merge 1 commit into
xdustinface wants to merge 1 commit into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/rate-sized-cap #1372 +/- ##
======================================================
+ Coverage 81.11% 85.93% +4.82%
======================================================
Files 171 268 +97
Lines 46147 71266 +25119
======================================================
+ Hits 37430 61240 +23810
- Misses 8717 10026 +1309
|
xdustinface
force-pushed
the
fix/rate-sized-cap
branch
from
November 10, 2026 06:16
d75ca22 to
51aac7c
Compare
Contributor
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
xdustinface
force-pushed
the
fix/peer-diversity
branch
from
November 10, 2026 06:19
b3d7199 to
6cb6619
Compare
xdustinface
force-pushed
the
fix/peer-diversity
branch
from
November 10, 2026 14:27
6cb6619 to
afca6fe
Compare
Most testnet seeds sit in 68.67.122.0/24, so a uniform sample keeps a client inside that block. When the block is congested every peer is slow alike and `underserving_peer` sees nothing to compare. - `PeerDiscoverer::get` orders candidates by `NetGroup`, a /16 for IPv4 and a /32 for IPv6: groups with no connected peer first, one address per group in turn, then the connected groups. It takes the connected and banned addresses, so a banned group cannot shrink the batch. Exclusive peers are not grouped. - While work is queued and the link is not stalled, `repair_round` swaps the slowest peer of the largest group with two or more peers for an address of a group the set lacks, at most one probe per `SWAP_COOLDOWN`. Every newly learned `addr` wakes the supervisor. Configured peers are never swapped for their group. - A node lacking a required service is banned with `Ban::MissingServices` for as long as a misbehaving one, so its group falls through to its next address instead of redialing it every round. Gossiped `addr` and `addrv2` entries are learned only if they advertise every required service. - The supervisor re-checks the set on every `FILL_TICK`. It slept on the timer only while the set was short or crowded, so a full set waited for the next unrelated wake: a peer whose rate became known after the last round was never judged, and a slow peer flagged while `SWAP_COOLDOWN` held the swap back was never re-checked, since the flow controller wakes the supervisor only once per slow peer. A round with nothing to do returns before probing. `a_running_supervisor_swaps_a_slow_peer_once_it_is_measured` drives the real loop and fails with the old gate. - `NetworkState` is built apart from its tasks, so tests can drive the supervisor on a state of their own.
xdustinface
force-pushed
the
fix/rate-sized-cap
branch
from
November 11, 2026 01:21
001a678 to
a92d094
Compare
xdustinface
force-pushed
the
fix/peer-diversity
branch
from
November 11, 2026 01:21
afca6fe to
707faf6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most testnet seeds sit in 68.67.122.0/24, so a uniform sample of addresses keeps a client inside that block. When the block is congested every peer is slow alike, and
underserving_peerhas nothing to compare.PeerDiscoverer::getnow orders candidates by network group, a /16 for IPv4 and a /32 for IPv6, and tries groups with no connected peer first. While work is queued and the link is not stalled,repair_roundswaps the slowest peer of the most crowded group for an address from a group the set lacks, at most once perSWAP_COOLDOWN. Configured peers are never swapped. A node lacking a required service is banned instead of redialed every round, gossiped addresses are learned only if they advertise every required service, and the supervisor re-checks the set on everyFILL_TICK.Stacked on #1371, and will be retargeted to
devwhen that one merges.