Pass SnapshotConfig to SnapshotPackagerService (#19616)

This commit is contained in:
Brooks Prumo 2021-09-03 16:42:32 -05:00 committed by GitHub
parent 2c3bdedea3
commit 1828579580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 9 deletions

View File

@ -1,7 +1,7 @@
use solana_gossip::cluster_info::{ClusterInfo, MAX_SNAPSHOT_HASHES};
use solana_runtime::{
snapshot_archive_info::SnapshotArchiveInfoGetter, snapshot_package::PendingSnapshotPackage,
snapshot_utils,
snapshot_archive_info::SnapshotArchiveInfoGetter, snapshot_config::SnapshotConfig,
snapshot_package::PendingSnapshotPackage, snapshot_utils,
};
use solana_sdk::{clock::Slot, hash::Hash};
use std::{
@ -23,7 +23,7 @@ impl SnapshotPackagerService {
starting_snapshot_hash: Option<(Slot, Hash)>,
exit: &Arc<AtomicBool>,
cluster_info: &Arc<ClusterInfo>,
maximum_snapshots_to_retain: usize,
snapshot_config: SnapshotConfig,
) -> Self {
let exit = exit.clone();
let cluster_info = cluster_info.clone();
@ -53,7 +53,7 @@ impl SnapshotPackagerService {
// last_full_snapshot_slot that requires this archive call to succeed.
snapshot_utils::archive_snapshot_package(
&snapshot_package,
maximum_snapshots_to_retain,
snapshot_config.maximum_full_snapshot_archives_to_retain,
)
.expect("failed to archive snapshot package");

View File

@ -651,7 +651,7 @@ impl Validator {
snapshot_hash,
&exit,
&cluster_info,
snapshot_config.maximum_full_snapshot_archives_to_retain,
snapshot_config.clone(),
);
(
Some(snapshot_packager_service),

View File

@ -505,7 +505,7 @@ mod tests {
None,
&exit,
&cluster_info,
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
snapshot_config.clone(),
);
let _package_receiver = std::thread::Builder::new()
@ -926,9 +926,7 @@ mod tests {
None,
&exit,
&cluster_info,
snapshot_test_config
.snapshot_config
.maximum_full_snapshot_archives_to_retain,
snapshot_test_config.snapshot_config.clone(),
);
let accounts_hash_verifier = AccountsHashVerifier::new(