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

Speedup node bootstrap after client download #1132

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Aug 3, 2023

Content

This PR make the snapshot download command of the client append a empty file named 'clean' in the unpacked database.
This is a trick to tell the cardano node to skip the ledger check at startup (this file is usually added by the node itself on a clean shutdown).

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
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Issue(s)

Relates to #1131

@Alenar Alenar requested review from jpraynaud and a user August 3, 2023 15:04
@Alenar Alenar force-pushed the djo/1131/speedup-node-bootstrap-after-client-download branch from c32573e to ed64fea Compare August 3, 2023 15:06
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Test Results

    3 files  ±0    16 suites  ±0   6m 59s ⏱️ + 1m 19s
655 tests +1  655 ✔️ +1  0 💤 ±0  0 ±0 
695 runs  +3  695 ✔️ +3  0 💤 ±0  0 ±0 

Results for commit a6b0073. ± Comparison against base commit cd56f53.

♻️ This comment has been updated with latest results.

@Alenar Alenar temporarily deployed to testing-preview August 3, 2023 15:53 — with GitHub Actions Inactive
@Alenar Alenar force-pushed the djo/1131/speedup-node-bootstrap-after-client-download branch from 3580289 to bc0941a Compare August 3, 2023 16:13
@Alenar Alenar temporarily deployed to testing-preview August 3, 2023 16:23 — with GitHub Actions Inactive
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

There appears to be some unrelated changes in formatting which clutter the PR, but otherwise LGTM.

mithril-client/src/services/snapshot.rs Outdated Show resolved Hide resolved
mithril-client/src/services/snapshot.rs Outdated Show resolved Hide resolved
mithril-client/src/services/snapshot.rs Show resolved Hide resolved
mithril-client/src/services/snapshot.rs Outdated Show resolved Hide resolved
}

#[tokio::test]
async fn test_download_snapshot_ok_add_clean_file_allowing_node_bootstrap_speedup() {
Copy link

Choose a reason for hiding this comment

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

Do we have a test checking not adding the 'clean' file still works? I was under the impression the could would always try to create it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would be nice bust costly , to do that cleanly I need to extract the code that insert the clean file in a separated service to mock it. For such a small part I don't think that's worth the increased complexity.

@Alenar Alenar force-pushed the djo/1131/speedup-node-bootstrap-after-client-download branch from bc0941a to a6b0073 Compare August 4, 2023 08:01
@Alenar Alenar temporarily deployed to testing-preview August 4, 2023 08:20 — with GitHub Actions Inactive
@Alenar Alenar merged commit 9a1e80d into main Aug 4, 2023
@Alenar Alenar deleted the djo/1131/speedup-node-bootstrap-after-client-download branch August 4, 2023 08:32
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