Skip to content

graph, store: Reject grafts below the base's earliest block#6610

Open
incrypto32 wants to merge 1 commit into
masterfrom
fix/graft-validate-earliest-block
Open

graph, store: Reject grafts below the base's earliest block#6610
incrypto32 wants to merge 1 commit into
masterfrom
fix/graft-validate-earliest-block

Conversation

@incrypto32
Copy link
Copy Markdown
Member

Graft::validate 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 been pruned past the graft block (or its start block is above it), the copy step silently leaves the destination missing all pre-graft mutable entity versions. Dynamic data source registrations in data_sources$ survive (they are never pruned), so the destination keeps listening to factory-created contracts whose backing entities are gone, producing unexpected null in handler errors on every event.

This adds the missing check, mirroring the equivalent guard added for graphman copy in #6384.

Closes #6581
Closes #6607

Mirrors the guard added for `graphman copy` in #6384. Without this,
grafting at a block below `base.earliest_block_number` silently produces
a destination missing all pre-graft mutable entity versions, and (when
the base has dynamic data sources) handlers fail with
`unexpected null in handler` because `data_sources$` registrations
survive pruning while the entities they reference do not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant