Adds DCOU to verify_snapshot_archive() (#33298)

This commit is contained in:
Brooks 2023-09-18 19:11:28 -04:00 committed by GitHub
parent c85eb73300
commit bc2b372762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View File

@ -88,6 +88,7 @@ serial_test = { workspace = true }
solana-core = { path = ".", features = ["dev-context-only-utils"] }
solana-logger = { workspace = true }
solana-program-runtime = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-sdk = { workspace = true, features = ["dev-context-only-utils"] }
solana-stake-program = { workspace = true }
static_assertions = { workspace = true }

View File

@ -266,6 +266,7 @@ where
/// used by tests to compare contents of serialized bank fields
/// serialized format is not deterministic - likely due to randomness in structs like hashmaps
#[cfg(feature = "dev-context-only-utils")]
pub(crate) fn compare_two_serialized_banks(
path1: impl AsRef<Path>,
path2: impl AsRef<Path>,

View File

@ -16,7 +16,6 @@ use {
fs_err,
lazy_static::lazy_static,
log::*,
rayon::prelude::*,
regex::Regex,
solana_accounts_db::{
account_storage::AccountStorageMap,
@ -25,10 +24,7 @@ use {
},
accounts_file::AccountsFileError,
append_vec::AppendVec,
hardened_unpack::{
streaming_unpack_snapshot, unpack_snapshot, ParallelSelector, UnpackError,
UnpackedAppendVecMap,
},
hardened_unpack::{self, ParallelSelector, UnpackError},
shared_buffer_reader::{SharedBuffer, SharedBufferReader},
},
solana_measure::{measure, measure::Measure},
@ -49,6 +45,8 @@ use {
tempfile::TempDir,
thiserror::Error,
};
#[cfg(feature = "dev-context-only-utils")]
use {hardened_unpack::UnpackedAppendVecMap, rayon::prelude::*};
mod archive_format;
pub mod snapshot_storage_rebuilder;
@ -1293,7 +1291,7 @@ fn spawn_unpack_snapshot_thread(
Builder::new()
.name(format!("solUnpkSnpsht{thread_index:02}"))
.spawn(move || {
streaming_unpack_snapshot(
hardened_unpack::streaming_unpack_snapshot(
&mut archive,
ledger_dir.as_path(),
&account_paths,
@ -1872,6 +1870,7 @@ pub fn purge_old_snapshot_archives(
}
}
#[cfg(feature = "dev-context-only-utils")]
fn unpack_snapshot_local(
shared_buffer: SharedBuffer,
ledger_dir: &Path,
@ -1895,7 +1894,12 @@ fn unpack_snapshot_local(
divisions: parallel_divisions,
});
let mut archive = Archive::new(reader);
unpack_snapshot(&mut archive, ledger_dir, account_paths, parallel_selector)
hardened_unpack::unpack_snapshot(
&mut archive,
ledger_dir,
account_paths,
parallel_selector,
)
})
.collect::<Vec<_>>();
@ -1925,6 +1929,7 @@ fn untar_snapshot_create_shared_buffer(
}
}
#[cfg(feature = "dev-context-only-utils")]
fn untar_snapshot_in(
snapshot_tar: impl AsRef<Path>,
unpack_dir: &Path,
@ -1983,6 +1988,7 @@ pub enum VerifyBank {
NonDeterministic,
}
#[cfg(feature = "dev-context-only-utils")]
pub fn verify_snapshot_archive(
snapshot_archive: impl AsRef<Path>,
snapshots_to_verify: impl AsRef<Path>,