Skip to content

Commit

Permalink
Revert "Add LastFullSnapshotSlot to SnapshotConfig (#19341)"
Browse files Browse the repository at this point in the history
This reverts commit 4d361af.
  • Loading branch information
brooksprumo committed Aug 31, 2021
1 parent fe9ee91 commit 8517e3e
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 30 deletions.
6 changes: 1 addition & 5 deletions core/src/accounts_hash_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,7 @@ impl AccountsHashVerifier {
mod tests {
use super::*;
use solana_gossip::{cluster_info::make_accounts_hashes_message, contact_info::ContactInfo};
use solana_runtime::{
snapshot_config::LastFullSnapshotSlot,
snapshot_utils::{ArchiveFormat, SnapshotVersion},
};
use solana_runtime::snapshot_utils::{ArchiveFormat, SnapshotVersion};
use solana_sdk::{
genesis_config::ClusterType,
hash::hash,
Expand Down Expand Up @@ -346,7 +343,6 @@ mod tests {
archive_format: ArchiveFormat::Tar,
snapshot_version: SnapshotVersion::default(),
maximum_snapshots_to_retain: usize::MAX,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
};
for i in 0..MAX_SNAPSHOT_HASHES + 1 {
let accounts_package = AccountsPackage {
Expand Down
3 changes: 1 addition & 2 deletions core/src/test_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use {
solana_runtime::{
genesis_utils::create_genesis_config_with_leader_ex,
hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
snapshot_config::{LastFullSnapshotSlot, SnapshotConfig},
snapshot_config::SnapshotConfig,
snapshot_utils::{
ArchiveFormat, SnapshotVersion, DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
},
Expand Down Expand Up @@ -528,7 +528,6 @@ impl TestValidator {
archive_format: ArchiveFormat::Tar,
snapshot_version: SnapshotVersion::default(),
maximum_snapshots_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
}),
enforce_ulimit_nofile: false,
warp_slot: config.warp_slot,
Expand Down
3 changes: 1 addition & 2 deletions core/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mod tests {
bank_forks::BankForks,
genesis_utils::{create_genesis_config, GenesisConfigInfo},
snapshot_archive_info::FullSnapshotArchiveInfo,
snapshot_config::{LastFullSnapshotSlot, SnapshotConfig},
snapshot_config::SnapshotConfig,
snapshot_package::{
AccountsPackage, PendingSnapshotPackage, SnapshotPackage, SnapshotType,
},
Expand Down Expand Up @@ -148,7 +148,6 @@ mod tests {
archive_format: ArchiveFormat::TarBzip2,
snapshot_version,
maximum_snapshots_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
};
bank_forks.set_snapshot_config(Some(snapshot_config.clone()));
SnapshotTestConfig {
Expand Down
3 changes: 1 addition & 2 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use solana_runtime::{
bank_forks::BankForks,
hardened_unpack::{open_genesis_config, MAX_GENESIS_ARCHIVE_UNPACKED_SIZE},
snapshot_archive_info::SnapshotArchiveInfoGetter,
snapshot_config::{LastFullSnapshotSlot, SnapshotConfig},
snapshot_config::SnapshotConfig,
snapshot_utils::{
self, ArchiveFormat, SnapshotVersion, DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
},
Expand Down Expand Up @@ -719,7 +719,6 @@ fn load_bank_forks(
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: SnapshotVersion::default(),
maximum_snapshots_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
})
};
let account_paths = if let Some(account_paths) = arg_matches.value_of("account_paths") {
Expand Down
3 changes: 1 addition & 2 deletions local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use {
},
solana_runtime::{
snapshot_archive_info::SnapshotArchiveInfoGetter,
snapshot_config::{LastFullSnapshotSlot, SnapshotConfig},
snapshot_config::SnapshotConfig,
snapshot_utils::{self, ArchiveFormat},
},
solana_sdk::{
Expand Down Expand Up @@ -3535,7 +3535,6 @@ fn setup_snapshot_validator_config(
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: snapshot_utils::SnapshotVersion::default(),
maximum_snapshots_to_retain: snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
};

// Create the account paths
Expand Down
3 changes: 1 addition & 2 deletions replica-node/src/replica_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use {
bank_forks::BankForks,
commitment::BlockCommitmentCache,
hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
snapshot_config::{LastFullSnapshotSlot, SnapshotConfig},
snapshot_config::SnapshotConfig,
snapshot_utils::{self, ArchiveFormat},
},
solana_sdk::{clock::Slot, exit::Exit, genesis_config::GenesisConfig, hash::Hash},
Expand Down Expand Up @@ -265,7 +265,6 @@ impl ReplicaNode {
snapshot_version: snapshot_utils::SnapshotVersion::default(),
maximum_snapshots_to_retain:
snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
};

let bank_info =
Expand Down
3 changes: 1 addition & 2 deletions replica-node/tests/local_replica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use {
solana_runtime::{
accounts_index::AccountSecondaryIndexes,
snapshot_archive_info::SnapshotArchiveInfoGetter,
snapshot_config::{LastFullSnapshotSlot, SnapshotConfig},
snapshot_config::SnapshotConfig,
snapshot_utils::{self, ArchiveFormat},
},
solana_sdk::{
Expand Down Expand Up @@ -127,7 +127,6 @@ fn setup_snapshot_validator_config(
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: snapshot_utils::SnapshotVersion::default(),
maximum_snapshots_to_retain: snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
};

// Create the account paths
Expand Down
2 changes: 0 additions & 2 deletions rpc/src/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ mod tests {
},
solana_runtime::{
bank::Bank,
snapshot_config::LastFullSnapshotSlot,
snapshot_utils::{
ArchiveFormat, SnapshotVersion, DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
},
Expand Down Expand Up @@ -610,7 +609,6 @@ mod tests {
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: SnapshotVersion::default(),
maximum_snapshots_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
}),
bank_forks,
RpcHealth::stub(),
Expand Down
10 changes: 1 addition & 9 deletions runtime/src/snapshot_config.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use crate::snapshot_utils::ArchiveFormat;
use crate::snapshot_utils::SnapshotVersion;
use solana_sdk::clock::Slot;
use std::{
path::PathBuf,
sync::{Arc, RwLock},
};
use std::path::PathBuf;

/// Snapshot configuration and runtime information
#[derive(Clone, Debug)]
Expand All @@ -29,9 +26,4 @@ pub struct SnapshotConfig {

/// Maximum number of full snapshot archives to retain
pub maximum_snapshots_to_retain: usize,

/// Runtime information of the last full snapshot slot
pub last_full_snapshot_slot: LastFullSnapshotSlot,
}

pub type LastFullSnapshotSlot = Arc<RwLock<Option<Slot>>>;
3 changes: 1 addition & 2 deletions validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ use {
},
hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
snapshot_archive_info::SnapshotArchiveInfoGetter,
snapshot_config::{LastFullSnapshotSlot, SnapshotConfig},
snapshot_config::SnapshotConfig,
snapshot_utils::{
self, ArchiveFormat, SnapshotVersion, DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
},
Expand Down Expand Up @@ -2621,7 +2621,6 @@ pub fn main() {
archive_format,
snapshot_version,
maximum_snapshots_to_retain,
last_full_snapshot_slot: LastFullSnapshotSlot::default(),
});

validator_config.accounts_hash_interval_slots =
Expand Down

0 comments on commit 8517e3e

Please sign in to comment.