Skip to content

refactor: remove current_sync_peer from network manager#511

Draft
xdustinface wants to merge 2 commits intorefactor/peer-service-lookupfrom
refactor/drop-current-sync-peer
Draft

refactor: remove current_sync_peer from network manager#511
xdustinface wants to merge 2 commits intorefactor/peer-service-lookupfrom
refactor/drop-current-sync-peer

Conversation

@xdustinface
Copy link
Collaborator

Simplify peer selection in send_to_single_peer by removing the sticky sync peer tracking. Peers are now selected directly based on message type requirements and the round-robin counter.

Based on:

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9122d495-ce1a-4f7d-8fb3-4ed60ca09270

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/drop-current-sync-peer

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 86.72566% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.97%. Comparing base (33cefc9) to head (d6f2108).
⚠️ Report is 2 commits behind head on refactor/peer-service-lookup.

Files with missing lines Patch % Lines
dash-spv/src/network/manager.rs 53.12% 15 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           refactor/peer-service-lookup     #511      +/-   ##
================================================================
+ Coverage                         66.90%   66.97%   +0.07%     
================================================================
  Files                               313      313              
  Lines                             64757    64777      +20     
================================================================
+ Hits                              43325    43385      +60     
+ Misses                            21432    21392      -40     
Flag Coverage Δ *Carryforward flag
core 74.93% <ø> (ø)
dash-network 74.91% <ø> (ø) Carriedforward from 36be3dd
dash-network-ffi 34.76% <ø> (ø) Carriedforward from 36be3dd
dash-spv 68.76% <ø> (+0.50%) ⬆️ Carriedforward from 36be3dd
dash-spv-ffi 34.76% <ø> (ø) Carriedforward from 36be3dd
dashcore 74.91% <ø> (ø) Carriedforward from 36be3dd
dashcore-private 74.91% <ø> (ø) Carriedforward from 36be3dd
dashcore-rpc 19.92% <ø> (ø) Carriedforward from 36be3dd
dashcore-rpc-json 19.92% <ø> (ø) Carriedforward from 36be3dd
dashcore_hashes 74.91% <ø> (ø) Carriedforward from 36be3dd
ffi 36.38% <ø> (-0.02%) ⬇️
key-wallet 65.65% <ø> (ø) Carriedforward from 36be3dd
key-wallet-ffi 34.76% <ø> (ø) Carriedforward from 36be3dd
key-wallet-manager 65.65% <ø> (ø) Carriedforward from 36be3dd
rpc 19.92% <ø> (ø)
spv 81.48% <86.72%> (+0.37%) ⬆️
wallet 65.68% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
dash-spv/src/network/peer.rs 59.09% <100.00%> (-0.46%) ⬇️
dash-spv/src/network/pool.rs 90.20% <100.00%> (+8.85%) ⬆️
dash-spv/src/network/manager.rs 62.17% <53.12%> (+3.88%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Add `peer_with_service()` and `peers_with_service()` on `PeerPool` to replace repeated "iterate peers, check service flag" loops in message routing.
- Add unit tests
- Generalize the match/log/error pattern for required-service peer
selection in `send_to_single_peer` so new service requirements only need a single match arm.
@xdustinface xdustinface force-pushed the refactor/peer-service-lookup branch from bbaf01d to 36be3dd Compare March 12, 2026 01:03
Simplify peer selection in `send_to_single_peer` by removing the
sticky sync peer tracking. Peers are now selected directly based
on message type requirements and the round-robin counter.
@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Mar 12, 2026
@github-actions
Copy link

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@xdustinface xdustinface force-pushed the refactor/drop-current-sync-peer branch from f2fe73b to d6f2108 Compare March 12, 2026 01:06
@github-actions github-actions bot removed the merge-conflict The PR conflicts with the target branch. label Mar 12, 2026
@xdustinface xdustinface force-pushed the refactor/peer-service-lookup branch from 36be3dd to 22e4161 Compare March 13, 2026 02:48
@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Mar 13, 2026
@github-actions
Copy link

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@xdustinface xdustinface force-pushed the refactor/peer-service-lookup branch from 22e4161 to e5f3bc6 Compare March 13, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR conflicts with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant