Skip to content

AssumeUTXO: keep an unsaved snapshot rejection recognizable on restart when chainstate_snapshot_INVALID already exists #8275

Backlog

Description

@PastaPastaPasta

Problem

When HandleSnapshotStateMismatch cannot persist the snapshot rejection, RevokeSnapshotGeneration() changes only in-memory state, and the on-disk generation stays published. InvalidateCoinsDBOnDisk() then renames chainstate_snapshot onto chainstate_snapshot_INVALID. If an earlier rejection left a nonempty _INVALID directory, the rename fails. The live snapshot directory and its published marker both stay, with no REJECTED record. On restart, RecoverSnapshotCleanup() has nothing to act on, and DetectSnapshotChainstate() can reactivate the rejected generation.

Scope

Only reachable once snapshots can be loaded (#8078). Raised on #7887: #7887 (comment)

Fix

In #8270, stacked directly on #7887: live rejection and startup recovery share node::SetAsideInvalidSnapshotDir(). An earlier _INVALID directory keeps its place, and the rejected directory is moved to chainstate_snapshot_todelete before it is deleted. Its test starts with a nonempty _INVALID and a leftover _todelete, and after a restart the rejected generation is neither active nor promoted.

Closes when #8270 merges.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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