Skip to content

dash-spv: filter header sync restarts at height 0 after truncating to genesis #1397

Done

Description

@ZocoLini

FilterHeadersManager reads the stored filter tip with get_filter_tip_height().await?.unwrap_or(0) (dash-spv/src/sync/filter_headers/manager.rs), so a storage holding only the genesis filter header (Some(0)) looks empty (None). The sync then starts at height 0 instead of 1 and rewrites the stored header at 0.

This happens after truncate_above(0), for example when a fork is followed down to genesis. In debug builds it panics on the debug_assert in Segment::insert (dash-spv/src/storage/segments.rs), which kills the filter header task. In release builds the slot is silently overwritten.

The start height should come from the Option: None starts at the header start height, Some(n) at n + 1.

Activity

  1. self-assigned this
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions