Decouple accounts hash calculation from snapshot hash (#9507)

This commit is contained in:
sakridge
2020-04-16 15:12:20 -07:00
committed by GitHub
parent 425b4fe6dd
commit 66abe45ea1
11 changed files with 179 additions and 93 deletions

View File

@@ -8,13 +8,14 @@ use std::{
};
use tempfile::TempDir;
pub type SnapshotPackageSender = Sender<SnapshotPackage>;
pub type SnapshotPackageReceiver = Receiver<SnapshotPackage>;
pub type SnapshotPackageSendError = SendError<SnapshotPackage>;
pub type AccountsPackageSender = Sender<AccountsPackage>;
pub type AccountsPackageReceiver = Receiver<AccountsPackage>;
pub type AccountsPackageSendError = SendError<AccountsPackage>;
#[derive(Debug)]
pub struct SnapshotPackage {
pub struct AccountsPackage {
pub root: Slot,
pub block_height: Slot,
pub slot_deltas: Vec<BankSlotDelta>,
pub snapshot_links: TempDir,
pub storages: SnapshotStorages,
@@ -23,9 +24,10 @@ pub struct SnapshotPackage {
pub compression: CompressionType,
}
impl SnapshotPackage {
impl AccountsPackage {
pub fn new(
root: Slot,
block_height: u64,
slot_deltas: Vec<BankSlotDelta>,
snapshot_links: TempDir,
storages: SnapshotStorages,
@@ -35,6 +37,7 @@ impl SnapshotPackage {
) -> Self {
Self {
root,
block_height,
slot_deltas,
snapshot_links,
storages,