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

Add arg boot-from-local-state, enable it in validator #30859

Closed
wants to merge 24 commits into from

Conversation

xiangzhu70
Copy link
Contributor

@xiangzhu70 xiangzhu70 commented Mar 22, 2023

Problem

This is the last one of the PRs split from 28745.
After #30171, the functionality is available. This PR adds the command line argument, to allow invoking the functionality.

Summary of Changes

Add the argument "boot-from-local-state";
Call bank_from_latest_snapshot_dir first. If it fails, fall back to booting from latest_archive
Purge the snapshot dirs before the call.

Tested

  1. the local cluster on macbook, success and fallback paths.
    ./multinode-demo/setup.sh
    ./multinode-demo/bootstrap-validator.sh
    hack ledger-tool to use the main paths (not the .ledger-tool paths).
    ledger-tool verify

  2. validator on mainnet-beta

without --boot-from-local-state
[2023-03-24T01:12:46.078234944Z INFO solana_runtime::snapshot_utils] snapshot untar took 109.8s
[2023-03-24T01:12:52.014499164Z INFO solana_runtime::snapshot_utils] incremental snapshot untar took 5.9s
[2023-03-24T01:15:05.145936633Z INFO solana_runtime::snapshot_utils] rebuild bank from snapshots took 133.1s

with --boot-from-local-state
[2023-03-24T00:58:20.726576741Z INFO solana_runtime::snapshot_utils] build storage from snapshot dir took 14.9s
[2023-03-24T01:00:10.734562642Z INFO solana_runtime::snapshot_utils] rebuild bank from snapshots took 110.0s

Fixes #

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Merging #30859 (d2ef120) into master (d621b48) will decrease coverage by 0.1%.
The diff coverage is 19.4%.

@@            Coverage Diff            @@
##           master   #30859     +/-   ##
=========================================
- Coverage    81.5%    81.4%   -0.1%     
=========================================
  Files         731      731             
  Lines      207379   207436     +57     
=========================================
+ Hits       169032   169037      +5     
- Misses      38347    38399     +52     

@xiangzhu70 xiangzhu70 marked this pull request as ready for review March 23, 2023 20:20
validator/src/cli.rs Outdated Show resolved Hide resolved
ledger-tool/src/main.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
ledger/src/bank_forks_utils.rs Outdated Show resolved Hide resolved
core/src/validator.rs Outdated Show resolved Hide resolved
@xiangzhu70 xiangzhu70 force-pushed the arg_snapshot_from_dir branch from 9ff5485 to 2f0f921 Compare March 24, 2023 20:08
validator/src/cli.rs Outdated Show resolved Hide resolved
validator/src/bootstrap.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
@xiangzhu70 xiangzhu70 changed the title Add arg snapshot_from_dir, enable it in validator and ledger-tool Add arg snapshot_from_dir, enable it in validator Mar 27, 2023
@xiangzhu70 xiangzhu70 force-pushed the arg_snapshot_from_dir branch 2 times, most recently from eb2f3ae to 9987e98 Compare March 28, 2023 02:57
@xiangzhu70 xiangzhu70 requested a review from brooksprumo April 4, 2023 14:20
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
@brooksprumo
Copy link
Contributor

Please note that force-pushing in GitHub PRs makes it difficult to track changes. This is exacerbated with many commits within a PR, and increases the amount of time it takes for me to review/re-review. Unless there's a merge conflict, please avoid force pushing.

@xiangzhu70 xiangzhu70 force-pushed the arg_snapshot_from_dir branch from a4e459b to fcf653c Compare April 5, 2023 00:20
@xiangzhu70 xiangzhu70 force-pushed the arg_snapshot_from_dir branch from d882e25 to e91650c Compare April 26, 2023 20:47
@xiangzhu70 xiangzhu70 changed the title Add arg snapshot_from_dir, enable it in validator Add arg boot-from-local-state, enable it in validator Apr 27, 2023
@xiangzhu70 xiangzhu70 force-pushed the arg_snapshot_from_dir branch from cb99350 to 0b7cc81 Compare April 28, 2023 16:14
@mergify mergify bot added community Community contribution need:merge-assist labels May 4, 2023
@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label May 19, 2023
@github-actions github-actions bot closed this May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution need:merge-assist stale [bot only] Added to stale content; results in auto-close after a week.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants