Skip to content
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

start a tool to validate aspects of the blockchain database #792

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented Nov 14, 2024

add tool to validate some aspects of a blockchain database file. Most importantly, that the coin set is consistent with all the blocks.

To use this program:

cd crates/chia-tools
cargo run --release --bin validate-blockchain-db -- ~/.chia/mainnet/db/blockchain_v2_mainnet.sqlite
cargo run --release --bin validate-blockchain-db -- ~/.chia/mainnet/db/blockchain_v2_testnet11.sqlite --testnet

@arvidn arvidn requested a review from AmineKhaldi November 14, 2024 12:09
Copy link

coveralls-official bot commented Nov 14, 2024

Pull Request Test Coverage Report for Build 11838789837

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 83.825%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/chia-tools/src/visit_spends.rs 0 2 0.0%
Totals Coverage Status
Change from base Build 11828083959: 0.01%
Covered Lines: 12847
Relevant Lines: 15326

💛 - Coveralls

Copy link
Contributor Author

@arvidn arvidn left a comment

Choose a reason for hiding this comment

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

I believe there's one case that's not checked correctly. We don't necessarily verify that unspent coins are marked as unspent.
Maybe we should ensure the coin table is empty for all non-tx blocks

crates/chia-tools/src/bin/validate-blockchain-db.rs Outdated Show resolved Hide resolved
@arvidn arvidn merged commit 40f3a77 into main Nov 14, 2024
52 checks passed
@arvidn arvidn deleted the validate-blockchain-db branch November 14, 2024 15:03
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.

2 participants