mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-21 01:41:03 +00:00
PVF: Remove artifact persistence across restarts (#2895)
Considering the complexity of https://github.com/paritytech/polkadot-sdk/pull/2871 and the discussion therein, as well as the further complexity introduced by the hardening in https://github.com/paritytech/polkadot-sdk/pull/2742, as well as the eventual replacement of wasmtime by PolkaVM, it seems best to remove this persistence as it is creating more problems than it solves. ## Related Closes https://github.com/paritytech/polkadot-sdk/issues/2863
This commit is contained in:
@@ -358,6 +358,25 @@ async fn deleting_prepared_artifact_does_not_dispute() {
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn cache_cleared_on_startup() {
|
||||
// Don't drop this host, it owns the `TempDir` which gets cleared on drop.
|
||||
let host = TestHost::new().await;
|
||||
|
||||
let _stats = host.precheck_pvf(halt::wasm_binary_unwrap(), Default::default()).await.unwrap();
|
||||
|
||||
// The cache dir should contain one artifact and one worker dir.
|
||||
let cache_dir = host.cache_dir.path().to_owned();
|
||||
assert_eq!(std::fs::read_dir(&cache_dir).unwrap().count(), 2);
|
||||
|
||||
// Start a new host, previous artifact should be cleared.
|
||||
let _host = TestHost::new_with_config(|cfg| {
|
||||
cfg.cache_path = cache_dir.clone();
|
||||
})
|
||||
.await;
|
||||
assert_eq!(std::fs::read_dir(&cache_dir).unwrap().count(), 0);
|
||||
}
|
||||
|
||||
// This test checks if the adder parachain runtime can be prepared with 10Mb preparation memory
|
||||
// limit enforced. At the moment of writing, the limit if far enough to prepare the PVF. If it
|
||||
// starts failing, either Wasmtime version has changed, or the PVF code itself has changed, and
|
||||
|
||||
Reference in New Issue
Block a user