Skip to content

Add chainstate storage version mismatch check #1098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 30, 2023

Conversation

azarovh
Copy link
Member

@azarovh azarovh commented Jul 29, 2023

  1. Handle chainstate storage version. In case the version mismatch clean up the chainstate db directory and try initialization again. Relates to Updating the version of the blockchain database should result in a clean re-index #1034
  2. The same applies for ChainConfig::magic_bytes and ChainType::name. They are now stored in db and if mismatch the db is clean up and synced from scratch.
  3. Add clean-data command which cleans up data directory before starting the node. Except for the lock file.

@azarovh azarovh force-pushed the fix/storage_version_mismatch branch 3 times, most recently from 6725b7a to 197521d Compare July 29, 2023 15:53
@azarovh azarovh marked this pull request as ready for review July 29, 2023 15:54
@azarovh azarovh requested a review from pavel-kokolemin July 29, 2023 16:00
Copy link
Contributor

@iljakuklic iljakuklic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough for now. Just one minor suggestion but it's fine to ignore it.

@azarovh azarovh force-pushed the fix/storage_version_mismatch branch from 26495ca to 9c4a229 Compare July 30, 2023 08:45
Copy link
Contributor

@TheQuantumPhysicist TheQuantumPhysicist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides some clean up, this is good to go. We'll add functional tests later.

@azarovh azarovh merged commit b416ae6 into master Jul 30, 2023
@azarovh azarovh deleted the fix/storage_version_mismatch branch July 30, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants