Repository navigation
perf(dash-spv): segment cache two resident - #1086
Conversation
Reverts ae2a5d6 (#946). Segments were released from memory only when a sync manager remembered to call `set_committed_height` on the block and filter storages, and only on the next timed persist. The resident set should be bounded by the segment cache itself, not by callers reporting progress to storage. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017DruChNTWXwJoWPartZwCf
With the committed-height release gone, the segment cache itself has to bound the resident set. Ten 50 000-item segments per cache kept most of a restore in memory; two keep the peak below what the release achieved, without costing time. Mainnet restore, mainnet.100mbi.100ms, #1015/#1016/#1014 applied, jemalloc heap profiling, wallet identical in every run (14114383 sat, 7112 records, 13389 addresses): segments peak RSS time segment loads from disk (headers/filter headers/filters/blocks) 10 + #946 982 MiB 8.2 min - 10 1490 MiB 8.8 min 84 / 2 / 28 / 0 2 930 MiB 8.8 min 212 / 103 / 74 / 0 1 1000 MiB 7.7 min 427 / 742 / 156 / 33 Each cache served ~2.34M requests from memory in every run. One segment starts reloading block segments of up to 87 MB from disk, which raises the peak again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017DruChNTWXwJoWPartZwCf
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: dashpay/rust-dashcore/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (5)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change removes committed-height tracking from segment storage and removes the storage and sync calls that used it. The segment cache’s maximum resident segment count changes from 10 to 2. ChangesSegment storage and sync
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Merge Risk: ⚪ Minimal · up to The two-segment cache policy has no established data-loss or read-correctness regression. The change is mergeable subject to normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The smaller cache makes an existing write-failure path more damaging: unsaved data can be discarded after accessing three distinct segments while saving appears successful. This can impair later wallet replay. No new remote access or privilege expansion was established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1086 +/- ##
==========================================
- Coverage 77.51% 77.48% -0.04%
==========================================
Files 318 318
Lines 81270 81075 -195
==========================================
- Hits 62997 62817 -180
+ Misses 18273 18258 -15
|
PR Hygiene ·
92e2439/skip-botsproceeds without the ones not yet reported/self-reviewedonce the bots are donedash-spv(dash-spv/src/storage/blocks.rs,dash-spv/src/storage/filters.rs,dash-spv/src/storage/mod.rsand 3 more) — QuantumExplorer or xdustinfaceWhen every box is checked the
PR Hygienecheck passes and this can merge.Summary by CodeRabbit