Add --trusted-validator support for snapshot hash validation (#8390)

This commit is contained in:
sakridge
2020-02-21 18:42:24 -08:00
committed by GitHub
parent 223f9707ca
commit b7386f9d84
8 changed files with 135 additions and 32 deletions

View File

@ -6,7 +6,7 @@ use log::*;
use solana_measure::measure::Measure;
use solana_metrics::inc_new_counter_info;
use solana_runtime::{bank::Bank, status_cache::MAX_CACHE_ENTRIES};
use solana_sdk::{clock::Slot, timing};
use solana_sdk::{clock::Slot, pubkey::Pubkey, timing};
use std::{
collections::{HashMap, HashSet},
ops::Index,
@ -26,6 +26,10 @@ pub struct SnapshotConfig {
// Where to place the snapshots for recent slots
pub snapshot_path: PathBuf,
// Validators that must vouch for a given snapshot hash before it's accepted
// None = accept any snapshot hash
pub trusted_validators: Option<HashSet<Pubkey>>,
}
#[derive(Error, Debug)]