Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Retry failed PVF execution (AmbiguousWorkerDeath) #6235

Merged
merged 6 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address a couple of nits
  • Loading branch information
mrcnski committed Nov 7, 2022
commit e2a15ee8358beb616548adf3727203ae52944d17
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node/core/candidate-validation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
[dependencies]
async-trait = "0.1.57"
futures = "0.3.21"
futures-timer = "3.0.2"
gum = { package = "tracing-gum", path = "../../gum" }

sp-maybe-compressed-blob = { package = "sp-maybe-compressed-blob", git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
8 changes: 5 additions & 3 deletions node/core/candidate-validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ use polkadot_node_subsystem::{
overseer, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, SubsystemResult,
SubsystemSender,
};
use polkadot_node_subsystem_util::TimeoutExt;
use polkadot_parachain::primitives::{ValidationParams, ValidationResult as WasmValidationResult};
use polkadot_primitives::v2::{
CandidateCommitments, CandidateDescriptor, CandidateReceipt, Hash, OccupiedCoreAssumption,
Expand All @@ -61,8 +60,11 @@ mod tests;

const LOG_TARGET: &'static str = "parachain::candidate-validation";

// The amount of time to wait before retrying after an AmbiguousWorkerDeath validation error.
/// The amount of time to wait before retrying after an AmbiguousWorkerDeath validation error.
#[cfg(not(test))]
const PVF_EXECUTION_RETRY_DELAY: Duration = Duration::from_secs(1);
slumber marked this conversation as resolved.
Show resolved Hide resolved
eskimor marked this conversation as resolved.
Show resolved Hide resolved
#[cfg(test)]
const PVF_EXECUTION_RETRY_DELAY: Duration = Duration::from_millis(200);

/// Configuration for the candidate validation subsystem
#[derive(Clone)]
Expand Down Expand Up @@ -635,7 +637,7 @@ impl ValidationBackend for ValidationHost {
validation_result
{
// Wait a brief delay before retrying.
let _: Option<()> = future::pending().timeout(PVF_EXECUTION_RETRY_DELAY).await;
futures_timer::Delay::new(PVF_EXECUTION_RETRY_DELAY).await;
execute_pvf_once(self, pvf, timeout, params.encode()).await
} else {
validation_result
Expand Down