* Correct missing entry handling to avoid bad warns * Pass storage entries to AccountStorageSerialize * Fix CI..... * Add tests and reorder condition for cheapest first * Remove unneeded reference
43 lines
1.0 KiB
Rust
43 lines
1.0 KiB
Rust
use solana_runtime::{accounts_db::SnapshotStorages, bank::BankSlotDelta};
|
|
use solana_sdk::clock::Slot;
|
|
use solana_sdk::hash::Hash;
|
|
use std::{
|
|
path::PathBuf,
|
|
sync::mpsc::{Receiver, SendError, Sender},
|
|
};
|
|
use tempfile::TempDir;
|
|
|
|
pub type SnapshotPackageSender = Sender<SnapshotPackage>;
|
|
pub type SnapshotPackageReceiver = Receiver<SnapshotPackage>;
|
|
pub type SnapshotPackageSendError = SendError<SnapshotPackage>;
|
|
|
|
#[derive(Debug)]
|
|
pub struct SnapshotPackage {
|
|
pub root: Slot,
|
|
pub slot_deltas: Vec<BankSlotDelta>,
|
|
pub snapshot_links: TempDir,
|
|
pub storages: SnapshotStorages,
|
|
pub tar_output_file: PathBuf,
|
|
pub hash: Hash,
|
|
}
|
|
|
|
impl SnapshotPackage {
|
|
pub fn new(
|
|
root: Slot,
|
|
slot_deltas: Vec<BankSlotDelta>,
|
|
snapshot_links: TempDir,
|
|
storages: SnapshotStorages,
|
|
tar_output_file: PathBuf,
|
|
hash: Hash,
|
|
) -> Self {
|
|
Self {
|
|
root,
|
|
slot_deltas,
|
|
snapshot_links,
|
|
storages,
|
|
tar_output_file,
|
|
hash,
|
|
}
|
|
}
|
|
}
|