-
Notifications
You must be signed in to change notification settings - Fork 44
fix: check of unexpected file too eager on all network except devnet #2517
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
base: main
Are you sure you want to change the base?
Conversation
… downloads as it start at 0 for all networks, this allow to simplify the api
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 fixes the unexpected download verifier so that it always expects immutable files starting at 0 for all networks, simplifying the API and code.
- Removed the redundant network parameter and related logic in UnexpectedDownloadedFileVerifier.
- Updated tests and usage in SnapshotClient and InternalDownloader accordingly.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
mithril-client/src/utils/unexpected_downloaded_file_verifier.rs | Removed network-specific behavior and updated tests/docs. |
mithril-client/src/snapshot_client.rs | Removed outdated network parameter from verifier invocation. |
mithril-client/src/cardano_database_client/download_unpack/internal_downloader.rs | Removed redundant network parameter from verifier call. |
Comments suppressed due to low confidence (2)
mithril-client/src/utils/unexpected_downloaded_file_verifier.rs:15
- Update the module-level comment to reflect the new behavior that immutable file numbers now always start at 0 and remove any reference to devnet-specific logic.
//! * networks: immutables file numbers start at 1 on most network, but 0 on devnet
mithril-client/src/utils/unexpected_downloaded_file_verifier.rs:214
- [nitpick] Revise the test case comments to state that the expected range always begins at 0, since the network distinction has been removed.
// Specs:
Test Results 3 files ±0 77 suites ±0 15m 17s ⏱️ -37s Results for commit 615a138. ± Comparison against base commit 623dbe8. This pull request removes 4 and adds 2 tests. Note that renamed tests count towards both.
|
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 👍
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 👍
Content
This PR make the unexpected download verifier to always expect immutable files starting from
0
on all network.After checking it appears that all network starts at 0, but it was expecting the first immutable to be
1
on network that were not devnet, meaning that the first immutable files trio was removed after download, making impossible for the message verifier to compute the expected message.Note: as this remove what was expected to be a business case, this change allow to simplify the unexpected download verifier api and code a bit.
Pre-submit checklist
Issue(s)
Relates to #2429