diff --git a/core/src/accounts_hash_verifier.rs b/core/src/accounts_hash_verifier.rs index 6087c2e55e..90b08f7f4b 100644 --- a/core/src/accounts_hash_verifier.rs +++ b/core/src/accounts_hash_verifier.rs @@ -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, @@ -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 { diff --git a/core/src/test_validator.rs b/core/src/test_validator.rs index 4008448758..0957125c02 100644 --- a/core/src/test_validator.rs +++ b/core/src/test_validator.rs @@ -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, }, @@ -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, diff --git a/core/tests/snapshots.rs b/core/tests/snapshots.rs index 0108a91e62..1a4b5ec7d9 100644 --- a/core/tests/snapshots.rs +++ b/core/tests/snapshots.rs @@ -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, }, @@ -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 { diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 995df3c368..a47fbdb9ba 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -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, }, @@ -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") { diff --git a/local-cluster/tests/local_cluster.rs b/local-cluster/tests/local_cluster.rs index cba3171165..026135edf5 100644 --- a/local-cluster/tests/local_cluster.rs +++ b/local-cluster/tests/local_cluster.rs @@ -43,7 +43,7 @@ use { }, solana_runtime::{ snapshot_archive_info::SnapshotArchiveInfoGetter, - snapshot_config::{LastFullSnapshotSlot, SnapshotConfig}, + snapshot_config::SnapshotConfig, snapshot_utils::{self, ArchiveFormat}, }, solana_sdk::{ @@ -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 diff --git a/replica-node/src/replica_node.rs b/replica-node/src/replica_node.rs index 4bd519c50b..94838c62d9 100644 --- a/replica-node/src/replica_node.rs +++ b/replica-node/src/replica_node.rs @@ -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}, @@ -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 = diff --git a/replica-node/tests/local_replica.rs b/replica-node/tests/local_replica.rs index 2eb5daf4c3..e2fed68fc5 100644 --- a/replica-node/tests/local_replica.rs +++ b/replica-node/tests/local_replica.rs @@ -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::{ @@ -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 diff --git a/rpc/src/rpc_service.rs b/rpc/src/rpc_service.rs index fa60e9a610..b6c1f4b1b4 100644 --- a/rpc/src/rpc_service.rs +++ b/rpc/src/rpc_service.rs @@ -492,7 +492,6 @@ mod tests { }, solana_runtime::{ bank::Bank, - snapshot_config::LastFullSnapshotSlot, snapshot_utils::{ ArchiveFormat, SnapshotVersion, DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN, }, @@ -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(), diff --git a/runtime/src/snapshot_config.rs b/runtime/src/snapshot_config.rs index da04aa814e..71a504545e 100644 --- a/runtime/src/snapshot_config.rs +++ b/runtime/src/snapshot_config.rs @@ -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)] @@ -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>>; diff --git a/validator/src/main.rs b/validator/src/main.rs index 194ede0439..d22af88437 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -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, }, @@ -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 =