Skip to content

fix: missing 00000 immutable files with Cardano DB v2 #2520

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 5 commits into from
May 26, 2025

Conversation

jpraynaud
Copy link
Member

@jpraynaud jpraynaud commented May 26, 2025

Content

This PR includes a fix on Cardano DB v2 which can not restore a valid full Cardano database:

  • embed the 00000 immutable files in the snapshot archive files
  • download the 00000 immutable files in the client

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • No new TODOs introduced

Issue(s)

Closes #2519

In artifact built for Cardano database v2.
@jpraynaud jpraynaud self-assigned this May 26, 2025
Copy link

@Copilot Copilot AI left a 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 ensures the 00000 immutable file is included when embedding and downloading Cardano DB snapshots by updating start indices and related tests.

  • Start immutable file ranges from 0 instead of 1 in client and aggregator code
  • Adjust loops, tests, and expectations to include file number 00000
  • Bump mithril-client and mithril-aggregator crate versions

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
mithril-client/src/cardano_database_client/immutable_file_range.rs Change FIRST_IMMUTABLE_FILE_NUMBER from 1 to 0
mithril-client/Cargo.toml Bump version to 0.12.8
mithril-aggregator/src/artifact_builder/cardano_database_artifacts/immutable.rs Introduce FIRST_IMMUTABLE_FILE_NUMBER=0, update loops and tests
mithril-aggregator/src/artifact_builder/cardano_database.rs Adjust loaded immutable file count (+1)
mithril-aggregator/Cargo.toml Bump version to 0.7.54

@jpraynaud jpraynaud force-pushed the jpraynaud/2519-fix-missing-immutable-files branch from c579e36 to 2338124 Compare May 26, 2025 14:03
Copy link

github-actions bot commented May 26, 2025

Test Results

    3 files  ±0     77 suites  ±0   14m 56s ⏱️ -13s
1 929 tests ±0  1 929 ✅ ±0  0 💤 ±0  0 ❌ ±0 
3 272 runs  ±0  3 272 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9a5e305. ± Comparison against base commit 8ff8117.

♻️ This comment has been updated with latest results.

@jpraynaud jpraynaud temporarily deployed to testing-preview May 26, 2025 14:12 — with GitHub Actions Inactive
Copy link
Collaborator

@Alenar Alenar left a comment

Choose a reason for hiding this comment

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

LGTM

I think you can simplify the tests by shifting the previous upper bound immutable to keep the same number of checks.

@jpraynaud jpraynaud force-pushed the jpraynaud/2519-fix-missing-immutable-files branch from 2338124 to 9a5e305 Compare May 26, 2025 14:33
@jpraynaud jpraynaud temporarily deployed to testing-preview May 26, 2025 14:53 — with GitHub Actions Inactive
@jpraynaud jpraynaud merged commit 0e2ee54 into main May 26, 2025
41 checks passed
@jpraynaud jpraynaud deleted the jpraynaud/2519-fix-missing-immutable-files branch May 26, 2025 14:56
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.

Cardano DB v2 restoration is missing 00000 immutables
3 participants