fix(engine): clear execution cache when block validation fails (#21282)

This commit is contained in:
Matthias Seitz
2026-01-22 02:01:22 +01:00
committed by GitHub
parent 055bf63ee9
commit dbdaf068f0

View File

@@ -297,6 +297,11 @@ where
// Replace the shared cache with the new one; the previous cache (if any) is
// dropped.
*cached = Some(new_cache);
} else {
// Block was invalid; caches were already mutated by insert_state above,
// so we must clear to prevent using polluted state
*cached = None;
debug!(target: "engine::caching", "cleared execution cache on invalid block");
}
});