Compose: fail early if KZG bundle is missing/empty

This commit is contained in:
andrussal 2025-12-07 05:16:52 +01:00
parent c697129ea6
commit f9c569f22e

View File

@ -62,8 +62,8 @@ impl ComposeWorkspace {
}
let kzg_source = repo_root.join("testing-framework/assets/stack/kzgrs_test_params");
let target = temp.path().join("kzgrs_test_params");
if kzg_source.exists() {
let target = temp.path().join("kzgrs_test_params");
if kzg_source.is_dir() {
copy_dir_recursive(&kzg_source, &target)?;
} else {
@ -72,6 +72,19 @@ impl ComposeWorkspace {
})?;
}
}
// Fail fast if the KZG bundle is missing or empty; DA verifier will panic
// otherwise.
if !target.exists()
|| fs::read_dir(&target)
.ok()
.map(|mut it| it.next().is_none())
.unwrap_or(true)
{
anyhow::bail!(
"KZG params missing in stack assets (expected files in {})",
kzg_source.display()
);
}
Ok(Self { root: temp })
}