Struct solana_runtime::snapshot_package::AccountsPackage
source · pub struct AccountsPackage {
pub package_type: AccountsPackageType,
pub slot: Slot,
pub block_height: Slot,
pub snapshot_storages: Vec<Arc<AccountStorageEntry>>,
pub expected_capitalization: u64,
pub accounts_hash_for_testing: Option<AccountsHash>,
pub accounts: Arc<Accounts>,
pub epoch_schedule: EpochSchedule,
pub rent_collector: RentCollector,
pub snapshot_info: Option<SupplementalSnapshotInfo>,
pub enqueued: Instant,
}
Expand description
This struct packages up fields to send from AccountsBackgroundService to AccountsHashVerifier
Fields§
§package_type: AccountsPackageType
§slot: Slot
§block_height: Slot
§snapshot_storages: Vec<Arc<AccountStorageEntry>>
§expected_capitalization: u64
§accounts_hash_for_testing: Option<AccountsHash>
§accounts: Arc<Accounts>
§epoch_schedule: EpochSchedule
§rent_collector: RentCollector
§snapshot_info: Option<SupplementalSnapshotInfo>
Supplemental information needed for snapshots
enqueued: Instant
The instant this accounts package was send to the queue. Used to track how long accounts packages wait before processing.
Implementations§
source§impl AccountsPackage
impl AccountsPackage
sourcepub fn new_for_snapshot(
package_type: AccountsPackageType,
bank: &Bank,
bank_snapshot_info: &BankSnapshotInfo,
bank_snapshots_dir: impl AsRef<Path>,
slot_deltas: Vec<BankSlotDelta>,
full_snapshot_archives_dir: impl AsRef<Path>,
incremental_snapshot_archives_dir: impl AsRef<Path>,
snapshot_storages: Vec<Arc<AccountStorageEntry>>,
archive_format: ArchiveFormat,
snapshot_version: SnapshotVersion,
accounts_hash_for_testing: Option<AccountsHash>
) -> Result<Self>
pub fn new_for_snapshot(
package_type: AccountsPackageType,
bank: &Bank,
bank_snapshot_info: &BankSnapshotInfo,
bank_snapshots_dir: impl AsRef<Path>,
slot_deltas: Vec<BankSlotDelta>,
full_snapshot_archives_dir: impl AsRef<Path>,
incremental_snapshot_archives_dir: impl AsRef<Path>,
snapshot_storages: Vec<Arc<AccountStorageEntry>>,
archive_format: ArchiveFormat,
snapshot_version: SnapshotVersion,
accounts_hash_for_testing: Option<AccountsHash>
) -> Result<Self>
Package up bank files, storages, and slot deltas for a snapshot
sourcepub fn new_for_epoch_accounts_hash(
package_type: AccountsPackageType,
bank: &Bank,
snapshot_storages: Vec<Arc<AccountStorageEntry>>,
accounts_hash_for_testing: Option<AccountsHash>
) -> Self
pub fn new_for_epoch_accounts_hash(
package_type: AccountsPackageType,
bank: &Bank,
snapshot_storages: Vec<Arc<AccountStorageEntry>>,
accounts_hash_for_testing: Option<AccountsHash>
) -> Self
Package up fields needed to compute an EpochAccountsHash
sourcepub fn default_for_tests() -> Self
pub fn default_for_tests() -> Self
Create a new Accounts Package where basically every field is defaulted. Only use for tests; many of the fields are invalid!
sourcepub fn snapshot_links_dir(&self) -> &Path
pub fn snapshot_links_dir(&self) -> &Path
Returns the path to the snapshot links directory
NOTE 1: This path is within the TempDir created for the AccountsPackage, not the bank
snapshots dir passed into new_for_snapshot()
when creating the AccountsPackage.
NOTE 2: This fn will panic if the AccountsPackage is of type EpochAccountsHash.