|
@@ -1,6 +1,9 @@
|
|
|
#![allow(clippy::arithmetic_side_effects)]
|
|
#![allow(clippy::arithmetic_side_effects)]
|
|
|
use {
|
|
use {
|
|
|
- agave_snapshots::{paths as snapshot_paths, snapshot_config::SnapshotConfig, SnapshotInterval},
|
|
|
|
|
|
|
+ agave_snapshots::{
|
|
|
|
|
+ paths as snapshot_paths, snapshot_archive_info::SnapshotArchiveInfoGetter,
|
|
|
|
|
+ snapshot_config::SnapshotConfig, SnapshotInterval,
|
|
|
|
|
+ },
|
|
|
assert_matches::assert_matches,
|
|
assert_matches::assert_matches,
|
|
|
crossbeam_channel::{unbounded, Receiver},
|
|
crossbeam_channel::{unbounded, Receiver},
|
|
|
gag::BufferRedirect,
|
|
gag::BufferRedirect,
|
|
@@ -69,8 +72,8 @@ use {
|
|
|
response::RpcSignatureResult,
|
|
response::RpcSignatureResult,
|
|
|
},
|
|
},
|
|
|
solana_runtime::{
|
|
solana_runtime::{
|
|
|
- commitment::VOTE_THRESHOLD_SIZE, snapshot_archive_info::SnapshotArchiveInfoGetter,
|
|
|
|
|
- snapshot_bank_utils, snapshot_package::SnapshotKind, snapshot_utils,
|
|
|
|
|
|
|
+ commitment::VOTE_THRESHOLD_SIZE, snapshot_bank_utils, snapshot_package::SnapshotKind,
|
|
|
|
|
+ snapshot_utils,
|
|
|
},
|
|
},
|
|
|
solana_signer::Signer,
|
|
solana_signer::Signer,
|
|
|
solana_stake_interface::{self as stake, state::NEW_WARMUP_COOLDOWN_RATE},
|
|
solana_stake_interface::{self as stake, state::NEW_WARMUP_COOLDOWN_RATE},
|
|
@@ -841,7 +844,7 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st
|
|
|
&mut None,
|
|
&mut None,
|
|
|
)
|
|
)
|
|
|
.unwrap();
|
|
.unwrap();
|
|
|
- let downloaded_full_snapshot_archive = snapshot_utils::get_highest_full_snapshot_archive_info(
|
|
|
|
|
|
|
+ let downloaded_full_snapshot_archive = snapshot_paths::get_highest_full_snapshot_archive_info(
|
|
|
validator_snapshot_test_config
|
|
validator_snapshot_test_config
|
|
|
.full_snapshot_archives_dir
|
|
.full_snapshot_archives_dir
|
|
|
.path(),
|
|
.path(),
|
|
@@ -879,7 +882,7 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st
|
|
|
)
|
|
)
|
|
|
.unwrap();
|
|
.unwrap();
|
|
|
let downloaded_incremental_snapshot_archive =
|
|
let downloaded_incremental_snapshot_archive =
|
|
|
- snapshot_utils::get_highest_incremental_snapshot_archive_info(
|
|
|
|
|
|
|
+ snapshot_paths::get_highest_incremental_snapshot_archive_info(
|
|
|
validator_snapshot_test_config
|
|
validator_snapshot_test_config
|
|
|
.incremental_snapshot_archives_dir
|
|
.incremental_snapshot_archives_dir
|
|
|
.path(),
|
|
.path(),
|
|
@@ -1028,7 +1031,7 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st
|
|
|
//
|
|
//
|
|
|
// Putting this all in its own block so its clear we're only intended to keep the leader's info
|
|
// Putting this all in its own block so its clear we're only intended to keep the leader's info
|
|
|
let leader_full_snapshot_archive_for_comparison = {
|
|
let leader_full_snapshot_archive_for_comparison = {
|
|
|
- let validator_full_snapshot = snapshot_utils::get_highest_full_snapshot_archive_info(
|
|
|
|
|
|
|
+ let validator_full_snapshot = snapshot_paths::get_highest_full_snapshot_archive_info(
|
|
|
validator_snapshot_test_config
|
|
validator_snapshot_test_config
|
|
|
.full_snapshot_archives_dir
|
|
.full_snapshot_archives_dir
|
|
|
.path(),
|
|
.path(),
|
|
@@ -1036,7 +1039,7 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st
|
|
|
.unwrap();
|
|
.unwrap();
|
|
|
|
|
|
|
|
// Now get the same full snapshot on the LEADER that we just got from the validator
|
|
// Now get the same full snapshot on the LEADER that we just got from the validator
|
|
|
- let mut leader_full_snapshots = snapshot_utils::get_full_snapshot_archives(
|
|
|
|
|
|
|
+ let mut leader_full_snapshots = snapshot_paths::get_full_snapshot_archives(
|
|
|
leader_snapshot_test_config
|
|
leader_snapshot_test_config
|
|
|
.full_snapshot_archives_dir
|
|
.full_snapshot_archives_dir
|
|
|
.path(),
|
|
.path(),
|
|
@@ -1098,7 +1101,7 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st
|
|
|
|
|
|
|
|
// Get the highest full snapshot slot *before* restarting, as a comparison
|
|
// Get the highest full snapshot slot *before* restarting, as a comparison
|
|
|
let validator_full_snapshot_slot_at_startup =
|
|
let validator_full_snapshot_slot_at_startup =
|
|
|
- snapshot_utils::get_highest_full_snapshot_archive_slot(
|
|
|
|
|
|
|
+ snapshot_paths::get_highest_full_snapshot_archive_slot(
|
|
|
validator_snapshot_test_config
|
|
validator_snapshot_test_config
|
|
|
.full_snapshot_archives_dir
|
|
.full_snapshot_archives_dir
|
|
|
.path(),
|
|
.path(),
|
|
@@ -1129,14 +1132,14 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st
|
|
|
);
|
|
);
|
|
|
let timer = Instant::now();
|
|
let timer = Instant::now();
|
|
|
loop {
|
|
loop {
|
|
|
- if let Some(full_snapshot_slot) = snapshot_utils::get_highest_full_snapshot_archive_slot(
|
|
|
|
|
|
|
+ if let Some(full_snapshot_slot) = snapshot_paths::get_highest_full_snapshot_archive_slot(
|
|
|
validator_snapshot_test_config
|
|
validator_snapshot_test_config
|
|
|
.full_snapshot_archives_dir
|
|
.full_snapshot_archives_dir
|
|
|
.path(),
|
|
.path(),
|
|
|
) {
|
|
) {
|
|
|
if full_snapshot_slot >= validator_next_full_snapshot_slot {
|
|
if full_snapshot_slot >= validator_next_full_snapshot_slot {
|
|
|
if let Some(incremental_snapshot_slot) =
|
|
if let Some(incremental_snapshot_slot) =
|
|
|
- snapshot_utils::get_highest_incremental_snapshot_archive_slot(
|
|
|
|
|
|
|
+ snapshot_paths::get_highest_incremental_snapshot_archive_slot(
|
|
|
validator_snapshot_test_config
|
|
validator_snapshot_test_config
|
|
|
.incremental_snapshot_archives_dir
|
|
.incremental_snapshot_archives_dir
|
|
|
.path(),
|
|
.path(),
|
|
@@ -1170,7 +1173,7 @@ fn test_incremental_snapshot_download_with_crossing_full_snapshot_interval_at_st
|
|
|
|
|
|
|
|
// Check to make sure that the full snapshot the validator created during startup is the same
|
|
// Check to make sure that the full snapshot the validator created during startup is the same
|
|
|
// or one greater than the snapshot the leader created.
|
|
// or one greater than the snapshot the leader created.
|
|
|
- let validator_full_snapshot_archives = snapshot_utils::get_full_snapshot_archives(
|
|
|
|
|
|
|
+ let validator_full_snapshot_archives = snapshot_paths::get_full_snapshot_archives(
|
|
|
validator_snapshot_test_config
|
|
validator_snapshot_test_config
|
|
|
.full_snapshot_archives_dir
|
|
.full_snapshot_archives_dir
|
|
|
.path(),
|
|
.path(),
|
|
@@ -1336,7 +1339,7 @@ fn test_snapshots_blockstore_floor() {
|
|
|
|
|
|
|
|
let archive_info = loop {
|
|
let archive_info = loop {
|
|
|
let archive =
|
|
let archive =
|
|
|
- snapshot_utils::get_highest_full_snapshot_archive_info(full_snapshot_archives_dir);
|
|
|
|
|
|
|
+ snapshot_paths::get_highest_full_snapshot_archive_info(full_snapshot_archives_dir);
|
|
|
if archive.is_some() {
|
|
if archive.is_some() {
|
|
|
trace!("snapshot exists");
|
|
trace!("snapshot exists");
|
|
|
break archive.unwrap();
|
|
break archive.unwrap();
|
|
@@ -5175,12 +5178,12 @@ fn test_boot_from_local_state() {
|
|
|
let timer = Instant::now();
|
|
let timer = Instant::now();
|
|
|
loop {
|
|
loop {
|
|
|
if let Some(other_full_snapshot_slot) =
|
|
if let Some(other_full_snapshot_slot) =
|
|
|
- snapshot_utils::get_highest_full_snapshot_archive_slot(
|
|
|
|
|
|
|
+ snapshot_paths::get_highest_full_snapshot_archive_slot(
|
|
|
&other_validator_config.full_snapshot_archives_dir,
|
|
&other_validator_config.full_snapshot_archives_dir,
|
|
|
)
|
|
)
|
|
|
{
|
|
{
|
|
|
let other_incremental_snapshot_slot =
|
|
let other_incremental_snapshot_slot =
|
|
|
- snapshot_utils::get_highest_incremental_snapshot_archive_slot(
|
|
|
|
|
|
|
+ snapshot_paths::get_highest_incremental_snapshot_archive_slot(
|
|
|
&other_validator_config.incremental_snapshot_archives_dir,
|
|
&other_validator_config.incremental_snapshot_archives_dir,
|
|
|
other_full_snapshot_slot,
|
|
other_full_snapshot_slot,
|
|
|
);
|
|
);
|
|
@@ -5196,7 +5199,7 @@ fn test_boot_from_local_state() {
|
|
|
);
|
|
);
|
|
|
std::thread::yield_now();
|
|
std::thread::yield_now();
|
|
|
}
|
|
}
|
|
|
- let other_full_snapshot_archives = snapshot_utils::get_full_snapshot_archives(
|
|
|
|
|
|
|
+ let other_full_snapshot_archives = snapshot_paths::get_full_snapshot_archives(
|
|
|
&other_validator_config.full_snapshot_archives_dir,
|
|
&other_validator_config.full_snapshot_archives_dir,
|
|
|
);
|
|
);
|
|
|
debug!("validator{i} full snapshot archives: {other_full_snapshot_archives:?}");
|
|
debug!("validator{i} full snapshot archives: {other_full_snapshot_archives:?}");
|
|
@@ -5221,7 +5224,7 @@ fn test_boot_from_local_state() {
|
|
|
.collect::<Vec<_>>(),
|
|
.collect::<Vec<_>>(),
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- let other_incremental_snapshot_archives = snapshot_utils::get_incremental_snapshot_archives(
|
|
|
|
|
|
|
+ let other_incremental_snapshot_archives = snapshot_paths::get_incremental_snapshot_archives(
|
|
|
&other_validator_config.incremental_snapshot_archives_dir,
|
|
&other_validator_config.incremental_snapshot_archives_dir,
|
|
|
);
|
|
);
|
|
|
debug!(
|
|
debug!(
|
|
@@ -5311,10 +5314,10 @@ fn test_boot_from_local_state_missing_archive() {
|
|
|
);
|
|
);
|
|
|
debug!(
|
|
debug!(
|
|
|
"snapshot archives:\n\tfull: {:?}\n\tincr: {:?}",
|
|
"snapshot archives:\n\tfull: {:?}\n\tincr: {:?}",
|
|
|
- snapshot_utils::get_full_snapshot_archives(
|
|
|
|
|
|
|
+ snapshot_paths::get_full_snapshot_archives(
|
|
|
validator_config.full_snapshot_archives_dir.path()
|
|
validator_config.full_snapshot_archives_dir.path()
|
|
|
),
|
|
),
|
|
|
- snapshot_utils::get_incremental_snapshot_archives(
|
|
|
|
|
|
|
+ snapshot_paths::get_incremental_snapshot_archives(
|
|
|
validator_config.incremental_snapshot_archives_dir.path()
|
|
validator_config.incremental_snapshot_archives_dir.path()
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
@@ -5328,7 +5331,7 @@ fn test_boot_from_local_state_missing_archive() {
|
|
|
info!("Stopping validator... DONE");
|
|
info!("Stopping validator... DONE");
|
|
|
|
|
|
|
|
info!("Deleting latest full snapshot archive...");
|
|
info!("Deleting latest full snapshot archive...");
|
|
|
- let highest_full_snapshot = snapshot_utils::get_highest_full_snapshot_archive_info(
|
|
|
|
|
|
|
+ let highest_full_snapshot = snapshot_paths::get_highest_full_snapshot_archive_info(
|
|
|
validator_config.full_snapshot_archives_dir.path(),
|
|
validator_config.full_snapshot_archives_dir.path(),
|
|
|
)
|
|
)
|
|
|
.unwrap();
|
|
.unwrap();
|