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

Pass SnapshotConfig to SnapshotPackagerService #19616

Merged
merged 1 commit into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/src/snapshot_packager_service.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand All @@ -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();
Expand Down Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 2 additions & 4 deletions core/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ mod tests {
None,
&exit,
&cluster_info,
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
snapshot_config.clone(),
);

let _package_receiver = std::thread::Builder::new()
Expand Down Expand Up @@ -923,9 +923,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(
Expand Down