Repository navigation
fix(dash-spv): reject CFHeaders batches that don't connect to stored filter headers - #1166
Conversation
…filter headers A CFHeaders response was stored as long as its stop hash matched an in-flight request. Its `previous_filter_header` was not compared with the filter header already stored at `start_height - 1`, and the number of filter hashes was not compared with the requested range. A batch that did not connect to the stored chain was stored and only failed later at filter verification. Now each batch must contain exactly one filter hash per block in `start_height..=height(stop_hash)`, and every batch except the first one of a fresh checkpoint sync (or one starting at genesis) must chain from the stored header. A batch that fails either check is not stored and is requested again, together with any buffered batches above it, without moving the pipeline forward. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Bots are done — your move: post |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1166 +/- ##
==========================================
+ Coverage 78.76% 78.82% +0.05%
==========================================
Files 302 302
Lines 80644 80874 +230
==========================================
+ Hits 63518 63746 +228
- Misses 17126 17128 +2
|
A CFHeaders response was stored as long as its stop hash matched an in-flight
request. Its
previous_filter_headerwas not compared with the filter headeralready stored at
start_height - 1, and the number of filter hashes was notcompared with the requested range. A batch that doesn't connect to the stored
chain was stored and only failed later at filter verification.
Now
process_cfheaderschecks both before storing:start_height..=height(stop_hash);previous_filter_headerequals the stored header atstart_height - 1.A batch that fails either check is not stored. It is requested again together
with any buffered batches above it, and the pipeline does not move forward.
The in-order and buffered paths in
handle_messagenow share one loop, soboth handle the rejection the same way.
Tests cover a non-connecting batch (in order and buffered), a short batch,
the first checkpoint batch, and resuming from stored filter headers.
Notes:
re-requested indefinitely instead of being stored; recovery belongs with dash-spv: cross-check filter headers across peers #1118.
Related to #1118.
🤖 Generated with Claude Code
Summary by CodeRabbit
PR Hygiene ·
8608c52/self-revieweddash-spv(dash-spv/src/sync/filter_headers/manager.rs,dash-spv/src/sync/filter_headers/pipeline.rs,dash-spv/src/sync/filter_headers/sync_manager.rs) — QuantumExplorer or ZocoLini or xdustinfaceWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.