mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
Point KZG params to proving key file
This commit is contained in:
parent
c4c033d912
commit
8f0af7c487
@ -13,7 +13,7 @@ num_samples: 1
|
||||
num_subnets: 2
|
||||
old_blobs_check_interval: "5.0"
|
||||
blobs_validity_duration: "60.0"
|
||||
global_params_path: "/kzgrs_test_params"
|
||||
global_params_path: "/kzgrs_test_params/pol/proving_key.zkey"
|
||||
min_dispersal_peers: 1
|
||||
min_replication_peers: 1
|
||||
monitor_failure_time_window: "5.0"
|
||||
|
||||
@ -25,9 +25,27 @@ use crate::secret_key_to_peer_id;
|
||||
|
||||
pub static GLOBAL_PARAMS_PATH: LazyLock<String> = LazyLock::new(resolve_global_params_path);
|
||||
|
||||
fn canonicalize_params_path(mut path: PathBuf) -> PathBuf {
|
||||
if path.is_dir() {
|
||||
let candidates = [
|
||||
path.join("pol/proving_key.zkey"),
|
||||
path.join("proving_key.zkey"),
|
||||
];
|
||||
if let Some(file) = candidates.iter().find(|p| p.is_file()) {
|
||||
return file.clone();
|
||||
}
|
||||
}
|
||||
if let Ok(resolved) = path.canonicalize() {
|
||||
path = resolved;
|
||||
}
|
||||
path
|
||||
}
|
||||
|
||||
fn resolve_global_params_path() -> String {
|
||||
if let Ok(path) = env::var("NOMOS_KZGRS_PARAMS_PATH") {
|
||||
return path;
|
||||
return canonicalize_params_path(PathBuf::from(path))
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
}
|
||||
|
||||
let workspace_root = env::var("CARGO_WORKSPACE_DIR")
|
||||
@ -41,7 +59,9 @@ fn resolve_global_params_path() -> String {
|
||||
})
|
||||
.unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")));
|
||||
|
||||
let params_path = workspace_root.join("testing-framework/assets/stack/kzgrs_test_params");
|
||||
let params_path = canonicalize_params_path(
|
||||
workspace_root.join("testing-framework/assets/stack/kzgrs_test_params"),
|
||||
);
|
||||
match params_path.canonicalize() {
|
||||
Ok(path) => path.to_string_lossy().to_string(),
|
||||
Err(err) => {
|
||||
|
||||
@ -90,7 +90,7 @@ pub fn apply_topology_overrides(
|
||||
cfg.old_blobs_check_interval = da.old_blobs_check_interval;
|
||||
cfg.blobs_validity_duration = da.blobs_validity_duration;
|
||||
cfg.global_params_path = if use_kzg_mount {
|
||||
"/kzgrs_test_params".into()
|
||||
"/kzgrs_test_params/pol/proving_key.zkey".into()
|
||||
} else {
|
||||
da.global_params_path.clone()
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user