-
Notifications
You must be signed in to change notification settings - Fork 52
List invalid or tampered immutable files in verify command #2637
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
List invalid or tampered immutable files in verify command #2637
Conversation
Test Results 4 files ± 0 164 suites ±0 22m 31s ⏱️ -54s Results for commit 9370314. ± Comparison against base commit 0461172. This pull request removes 1 and adds 17 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
48bf6a1 to
68915c2
Compare
68915c2 to
169a685
Compare
6a98b96 to
2af282f
Compare
54a2b7c to
cc140f0
Compare
2eae876 to
65218e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the Cardano database snapshot verification by listing missing or tampered immutable files instead of failing silently. It refactors the digest download and Merkle-proof verification into a unified flow, introduces detailed error types with file listings, and updates the CLI to surface these details in both JSON and human-readable formats.
- Refactored
compute_merkle_proofintodownload_and_verify_digests, returningVerifiedDigests(digest map + Merkle tree). - Extended
MessageBuilder::compute_cardano_database_messageto acceptVerifiedDigests, handle anallow_missingflag, and return rich error information (ImmutableFilesLists). - Updated CLI commands to write JSON error files and print counts of missing/tampered files.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| mithril-client/tests/cardano_db_snapshot_list_get_download_verify.rs | Updated tests to use download_and_verify_digests and VerifiedDigests. |
| mithril-client/src/message.rs | Added ImmutableFilesLists, ComputeCardanoDatabaseMessageError, and enhanced compute_cardano_database_message. |
| mithril-client/src/cardano_database_client/proving.rs | Replaced compute_merkle_proof with download_and_verify_digests returning VerifiedDigests. |
| mithril-client/src/cardano_database_client/api.rs | Updated public API to expose download_and_verify_digests. |
| mithril-client-cli/src/commands/cardano_db/verify.rs | Integrated new error handling in the verify command and JSON output. |
65218e9 to
b33c6f7
Compare
…d to compute_cardano_database_message
…ano database message with a structured error
… immutables files
…red immutables files in case of ImmutableFilesVerification error
…o handle the new typed error
verify command fail
…rdano_database_message function
…f proof computation error
…verification result
…, fix dummy tool import
9eaf920 to
8c183f5
Compare
jpraynaud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
name = "client-cardano-database-v2" -version = "0.0.12" +version = "0.0.13" * mithril-client-cli from `0.12.26` to `0.12.27` * mithril-client from `0.12.27` to `0.12.28`
a06362d to
9370314
Compare
Content
improve client library and CLI for verify command to list missing, tampered and/or non verifiable files
Pre-submit checklist
Comments
Issue(s)
Closes #2618