Persistent account storage across directories

This commit is contained in:
Sathish Ambley
2018-12-24 16:11:20 -08:00
committed by sakridge
parent 130563cd4c
commit c276375a0e
6 changed files with 700 additions and 198 deletions

View File

@@ -71,6 +71,7 @@ pub struct FullnodeConfig {
pub blockstream: Option<String>,
pub storage_rotate_count: u64,
pub tick_config: PohServiceConfig,
pub account_paths: String,
}
impl Default for FullnodeConfig {
fn default() -> Self {
@@ -84,6 +85,7 @@ impl Default for FullnodeConfig {
blockstream: None,
storage_rotate_count: NUM_HASHES_FOR_STORAGE_ROTATE,
tick_config: PohServiceConfig::default(),
account_paths: "0,1,2,3".to_string(),
}
}
}
@@ -123,7 +125,7 @@ impl Fullnode {
assert_eq!(id, node.info.id);
let (mut bank_forks, bank_forks_info, blocktree, ledger_signal_receiver) =
new_banks_from_blocktree(ledger_path);
new_banks_from_blocktree(ledger_path, &config.account_paths);
let exit = Arc::new(AtomicBool::new(false));
let bank_info = &bank_forks_info[0];
@@ -405,6 +407,7 @@ impl Fullnode {
pub fn new_banks_from_blocktree(
blocktree_path: &str,
account_paths: &str,
) -> (BankForks, Vec<BankForksInfo>, Blocktree, Receiver<bool>) {
let genesis_block =
GenesisBlock::load(blocktree_path).expect("Expected to successfully open genesis block");
@@ -743,7 +746,7 @@ mod tests {
// Close the validator so that rocksdb has locks available
validator_exit();
let (bank_forks, bank_forks_info, _, _) = new_banks_from_blocktree(&validator_ledger_path);
let (bank_forks, bank_forks_info, _, _) = new_banks_from_blocktree(&validator_ledger_path, "accounts");
let bank = bank_forks.working_bank();
let entry_height = bank_forks_info[0].entry_height;

View File

@@ -499,7 +499,7 @@ mod test {
let (to_leader_sender, _to_leader_receiver) = channel();
{
let (bank_forks, bank_forks_info, blocktree, l_receiver) =
new_banks_from_blocktree(&my_ledger_path);
new_banks_from_blocktree(&my_ledger_path, "");
let bank = bank_forks.working_bank();
let last_entry_id = bank_forks_info[0].last_entry_id;