Strictly validate the contents of snapshot/genesis (#8959)

automerge
This commit is contained in:
Ryo Onodera
2020-03-25 18:46:41 +09:00
committed by GitHub
parent 5d3f43c10b
commit f987c18a7e
9 changed files with 549 additions and 76 deletions

View File

@ -11,6 +11,7 @@ use solana_ledger::{
blockstore::Blockstore,
blockstore_db::{self, Column, Database},
blockstore_processor::{BankForksInfo, ProcessOptions},
hardened_unpack::open_genesis_config,
rooted_slot_iterator::RootedSlotIterator,
snapshot_utils,
};
@ -572,16 +573,6 @@ fn analyze_storage(database: &Database) -> Result<(), String> {
Ok(())
}
fn open_genesis_config(ledger_path: &Path) -> GenesisConfig {
GenesisConfig::load(&ledger_path).unwrap_or_else(|err| {
eprintln!(
"Failed to open ledger genesis_config at {:?}: {}",
ledger_path, err
);
exit(1);
})
}
fn open_blockstore(ledger_path: &Path) -> Blockstore {
match Blockstore::open(ledger_path) {
Ok(blockstore) => blockstore,