Add shrink paths (#14238)

This commit is contained in:
sakridge
2020-12-21 21:33:37 -08:00
committed by GitHub
parent 3316e7166c
commit baa9602411
8 changed files with 132 additions and 21 deletions

View File

@ -33,6 +33,7 @@ pub fn load(
genesis_config: &GenesisConfig,
blockstore: &Blockstore,
account_paths: Vec<PathBuf>,
shrink_paths: Option<Vec<PathBuf>>,
snapshot_config: Option<&SnapshotConfig>,
process_options: ProcessOptions,
transaction_status_sender: Option<TransactionStatusSender>,
@ -69,6 +70,9 @@ pub fn load(
Some(&crate::builtins::get(process_options.bpf_jit)),
)
.expect("Load from snapshot failed");
if let Some(shrink_paths) = shrink_paths {
deserialized_bank.set_shrink_paths(shrink_paths);
}
let deserialized_snapshot_hash = (
deserialized_bank.slot(),

View File

@ -925,7 +925,7 @@ fn load_frozen_forks(
leader_schedule_cache.set_root(&new_root_bank);
new_root_bank.squash();
if last_free.elapsed() > Duration::from_secs(30) {
if last_free.elapsed() > Duration::from_secs(10) {
// This could take few secs; so update last_free later
new_root_bank.exhaustively_free_unused_resource();
last_free = Instant::now();