mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 01:35:41 +00:00
PVF: re-preparing artifact on failed runtime construction (#3187)
resolve https://github.com/paritytech/polkadot-sdk/issues/3139 - [x] use a distinguishable error for `execute_artifact` - [x] remove artifact in case of a `RuntimeConstruction` error during the execution - [x] augment the `validate_candidate_with_retry` of `ValidationBackend` with the case of retriable `RuntimeConstruction` error during the execution - [x] update the book (https://paritytech.github.io/polkadot-sdk/book/node/utility/pvf-host-and-workers.html#retrying-execution-requests) - [x] add a test - [x] run zombienet tests --------- Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
This commit is contained in:
@@ -238,6 +238,14 @@ impl Artifacts {
|
||||
.is_none());
|
||||
}
|
||||
|
||||
/// Remove artifact by its id.
|
||||
pub fn remove(&mut self, artifact_id: ArtifactId) -> Option<(ArtifactId, PathBuf)> {
|
||||
self.inner.remove(&artifact_id).and_then(|state| match state {
|
||||
ArtifactState::Prepared { path, .. } => Some((artifact_id, path)),
|
||||
_ => None,
|
||||
})
|
||||
}
|
||||
|
||||
/// Remove artifacts older than the given TTL and return id and path of the removed ones.
|
||||
pub fn prune(&mut self, artifact_ttl: Duration) -> Vec<(ArtifactId, PathBuf)> {
|
||||
let now = SystemTime::now();
|
||||
|
||||
Reference in New Issue
Block a user