Fail fast if account paths cannot be canonicalized (#7300)
* Canonicalize account paths to avoid symlink issues * fixes
This commit is contained in:
@ -295,7 +295,7 @@ mod tests {
|
||||
..ProcessOptions::default()
|
||||
};
|
||||
let (bank_forks, _, cached_leader_schedule) =
|
||||
process_blocktree(&genesis_config, &blocktree, None, opts).unwrap();
|
||||
process_blocktree(&genesis_config, &blocktree, Vec::new(), opts).unwrap();
|
||||
let leader_schedule_cache = Arc::new(cached_leader_schedule);
|
||||
let bank_forks = Arc::new(RwLock::new(bank_forks));
|
||||
|
||||
|
@ -60,7 +60,7 @@ pub struct ValidatorConfig {
|
||||
pub transaction_status_service_disabled: bool,
|
||||
pub blockstream_unix_socket: Option<PathBuf>,
|
||||
pub storage_slots_per_turn: u64,
|
||||
pub account_paths: Option<String>,
|
||||
pub account_paths: Vec<PathBuf>,
|
||||
pub rpc_config: JsonRpcConfig,
|
||||
pub snapshot_config: Option<SnapshotConfig>,
|
||||
pub max_ledger_slots: Option<u64>,
|
||||
@ -80,7 +80,7 @@ impl Default for ValidatorConfig {
|
||||
blockstream_unix_socket: None,
|
||||
storage_slots_per_turn: DEFAULT_SLOTS_PER_TURN,
|
||||
max_ledger_slots: None,
|
||||
account_paths: None,
|
||||
account_paths: Vec::new(),
|
||||
rpc_config: JsonRpcConfig::default(),
|
||||
snapshot_config: None,
|
||||
broadcast_stage_type: BroadcastStageType::Standard,
|
||||
@ -469,7 +469,7 @@ impl Validator {
|
||||
pub fn new_banks_from_blocktree(
|
||||
expected_genesis_hash: Option<Hash>,
|
||||
blocktree_path: &Path,
|
||||
account_paths: Option<String>,
|
||||
account_paths: Vec<PathBuf>,
|
||||
snapshot_config: Option<SnapshotConfig>,
|
||||
poh_verify: bool,
|
||||
dev_halt_at_slot: Option<Slot>,
|
||||
|
@ -52,7 +52,7 @@ mod tests {
|
||||
let genesis_config_info = create_genesis_config(10_000);
|
||||
let bank0 = Bank::new_with_paths(
|
||||
&genesis_config_info.genesis_config,
|
||||
Some(accounts_dir.path().to_str().unwrap().to_string()),
|
||||
vec![accounts_dir.path().to_path_buf()],
|
||||
);
|
||||
bank0.freeze();
|
||||
let mut bank_forks = BankForks::new(0, bank0);
|
||||
@ -73,7 +73,7 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
fn restore_from_snapshot(old_bank_forks: &BankForks, account_paths: String) {
|
||||
fn restore_from_snapshot(old_bank_forks: &BankForks, account_paths: Vec<PathBuf>) {
|
||||
let (snapshot_path, snapshot_package_output_path) = old_bank_forks
|
||||
.snapshot_config
|
||||
.as_ref()
|
||||
@ -81,7 +81,7 @@ mod tests {
|
||||
.unwrap();
|
||||
|
||||
let deserialized_bank = snapshot_utils::bank_from_archive(
|
||||
account_paths,
|
||||
&account_paths,
|
||||
&old_bank_forks
|
||||
.snapshot_config
|
||||
.as_ref()
|
||||
@ -151,10 +151,7 @@ mod tests {
|
||||
.unwrap();
|
||||
SnapshotPackagerService::package_snapshots(&snapshot_package).unwrap();
|
||||
|
||||
restore_from_snapshot(
|
||||
bank_forks,
|
||||
accounts_dir.path().to_str().unwrap().to_string(),
|
||||
);
|
||||
restore_from_snapshot(bank_forks, vec![accounts_dir.path().to_path_buf()]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user