Skip to content

Grafting onto a pruned base silently loses data #6581

@incrypto32

Description

@incrypto32

Bug

Graft::validate (graph/src/data/subgraph/mod.rs:549) checks that the graft block is below base.latest_block, above the reorg threshold, and that the base is healthy. It does not check that the graft block is at or above base.earliest_block_number.

When the base has pruned past the graft block, the copy step's filter (WHERE lower(block_range) <= target_block) finds no rows for mutable entities whose [lo, hi) versions were deleted by pruning. The destination is silently created missing all pre-graft mutable state. Immutable entities are unaffected — their [lo, ∞) ranges are never pruned.

The destination reports synced: true, healthy: true and returns wrong data with no error.

Scope

Affects any subgraph with:

  • indexerHints.prune enabled on the base
  • A graft.block older than base.earliest_block_number at deploy time
  • At least one mutable entity updated between the graft block and the prune horizon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions