Skip to content

Commit

Permalink
Revert "Pass SnapshotConfig to SnapshotPackagerService (solana-labs#1…
Browse files Browse the repository at this point in the history
…9616)"

This reverts commit b93c021.
  • Loading branch information
frits-metalogix authored Nov 24, 2021
1 parent f77b1eb commit d7fe0ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
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_config::SnapshotConfig,
snapshot_package::PendingSnapshotPackage, snapshot_utils,
snapshot_archive_info::SnapshotArchiveInfoGetter, 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>,
snapshot_config: SnapshotConfig,
maximum_snapshots_to_retain: usize,
) -> 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,
snapshot_config.maximum_full_snapshot_archives_to_retain,
maximum_snapshots_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.clone(),
snapshot_config.maximum_full_snapshot_archives_to_retain,
);
(
Some(snapshot_packager_service),
Expand Down
6 changes: 4 additions & 2 deletions core/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ mod tests {
None,
&exit,
&cluster_info,
snapshot_config.clone(),
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
);

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

let accounts_hash_verifier = AccountsHashVerifier::new(
Expand Down

0 comments on commit d7fe0ec

Please sign in to comment.