refactor(dash-spv): network manager refactor and sync pipelines optimized #902
refactor(dash-spv): network manager refactor and sync pipelines optimized #902ZocoLini wants to merge 2 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #902 +/- ##
==========================================
- Coverage 74.54% 73.80% -0.75%
==========================================
Files 327 318 -9
Lines 75032 72110 -2922
==========================================
- Hits 55936 53222 -2714
+ Misses 19096 18888 -208
|
A docker-driven benchmark that syncs the SPV client against a frozen chain snapshot (local peers via tc netem) or the real testnet/mainnet, reporting sync time and a live dashboard. Base branch for the network-rewrite PR stacked on top; it drives the rewritten client and does not build on dev alone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUb3bkX9C1gBFA65GFsN53
39b7db2 to
fd614fc
Compare
Replaces the old network layer with a self-coordinating PeerNetworkManager (broker): it owns request de-duplication, pacing, per-peer in-flight sizing, timeouts, retries and peer hot-swap, so the sync pipelines just declare what they want. Highlights: - Restore sync/ from dev and re-wire it to the broker; delete the per-pipeline DownloadCoordinator. - Minimal `NetworkManager` trait + in-memory `MockNetworkManager`; the client is generic over the network (`DashSpvClient<W, N, S>`) with the network injected. - Strict-priority message scheduler: control, then blocks, filters, filter headers, block headers. - Drop peer storage and the peer-reputation system (unused; to be redone). - Un-Box the `NetworkMessage` variants to stay close to dev. - Storage kept as on dev (minus the removed peer storage). - Restore dev's integration tests and the network-dependent unit tests via the mock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUb3bkX9C1gBFA65GFsN53
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
Incredible big PR that does many things to get to a point where the sync time is as low as possible, I will be working on refactoring and cleaning the introduced code in the next PRs but since we need a fast sync for a good user experience at the iOS release I would like to get this merge as long as it can sync