Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove retry from backers on failed candidate validation #2182

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
093d537
remove retry from backers on failed candidate validation
jpserrat Nov 6, 2023
186b5d9
rename PvfExecTimeoutKind to PvfExecKind on executor params
jpserrat Nov 6, 2023
11ed725
".git/.scripts/commands/fmt/fmt.sh"
Nov 6, 2023
ab5eb3f
rename PvfPrepKind to PvfPrepKind, remove exec_kind from validate_can…
jpserrat Nov 7, 2023
7fa3947
Merge branch 'jpserrat/backers-dont-retry-on-fail' of github.com:Jpse…
jpserrat Nov 7, 2023
364de31
close delimiter
jpserrat Nov 7, 2023
056146a
refactor candidate-validation tests
jpserrat Nov 8, 2023
d91540b
Merge branch 'master' of github.com:paritytech/polkadot-sdk into jpse…
jpserrat Nov 8, 2023
b5bd481
fix fmt
jpserrat Nov 9, 2023
769cef6
minor fix
jpserrat Nov 10, 2023
5bc8183
add backer dont retry to documentation and refactor candidate-validat…
jpserrat Nov 14, 2023
4777046
Merge branch 'master' into jpserrat/backers-dont-retry-on-fail
mrcnski Nov 14, 2023
d69ef1a
Fix tests
mrcnski Nov 14, 2023
7025c7b
fix multiple ambiguous errors test
jpserrat Nov 15, 2023
c2b69d2
Merge branch 'jpserrat/backers-dont-retry-on-fail' of github.com:Jpse…
jpserrat Nov 16, 2023
8431212
Merge branch 'master' of github.com:paritytech/polkadot-sdk into jpse…
jpserrat Nov 16, 2023
79bf9f5
change PvfPrepKind::Lenient to PvfPrepKind::Prepare
jpserrat Nov 17, 2023
7f74004
minor fix
jpserrat Nov 18, 2023
2507cc1
change doc from PfvPrepKind and PvfExecKind to function
jpserrat Nov 19, 2023
7381ce1
Update polkadot/primitives/src/v6/mod.rs
mrcnski Nov 19, 2023
70c8cbc
Merge branch 'master' into jpserrat/backers-dont-retry-on-fail
mrcnski Nov 20, 2023
852cc85
Merge remote-tracking branch 'Jpserrat/jpserrat/backers-dont-retry-on…
mrcnski Nov 20, 2023
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
21 changes: 21 additions & 0 deletions polkadot/node/core/candidate-validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,8 @@ async fn validate_candidate_exhaustive(
};

let result = match exec_kind {
// Retry is disabled to reduce the chance of nondeterministic blocks getting backed and
// honest backers getting slashed.
PvfExecKind::Backing => {
let prep_timeout = pvf_prep_timeout(&executor_params, PvfPrepKind::Prepare);
let exec_timeout = pvf_exec_timeout(&executor_params, exec_kind);
Expand Down Expand Up @@ -871,6 +873,15 @@ fn perform_basic_checks(
Ok(())
}

/// To determine the amount of timeout time for the pvf execution.
///
/// Precheck
/// The time period after which the preparation worker is considered
/// unresponsive and will be killed.
///
/// Prepare
///The time period after which the preparation worker is considered
/// unresponsive and will be killed.
fn pvf_prep_timeout(executor_params: &ExecutorParams, kind: PvfPrepKind) -> Duration {
if let Some(timeout) = executor_params.pvf_prep_timeout(kind) {
return timeout
Expand All @@ -881,6 +892,16 @@ fn pvf_prep_timeout(executor_params: &ExecutorParams, kind: PvfPrepKind) -> Dura
}
}

/// To determine the amount of timeout time for the pvf execution.
///
/// Backing subsystem
/// The amount of time to spend on execution during backing.
///
/// Approval subsystem
/// The amount of time to spend on execution during approval or disputes.
/// This should be much longer than the backing execution timeout to ensure that in the
/// absence of extremely large disparities between hardware, blocks that pass backing are
/// considered executable by approval checkers or dispute participants.
fn pvf_exec_timeout(executor_params: &ExecutorParams, kind: PvfExecKind) -> Duration {
if let Some(timeout) = executor_params.pvf_exec_timeout(kind) {
return timeout
Expand Down
20 changes: 4 additions & 16 deletions polkadot/primitives/src/v6/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1784,31 +1784,19 @@ impl<T: Encode> WellKnownKey<T> {
/// Type discriminator for PVF preparation.
#[derive(Encode, Decode, TypeInfo, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum PvfPrepKind {
/// For prechecking requests, the time period after which the preparation worker is considered
/// unresponsive and will be killed.
/// For prechecking requests.
Precheck,

/// For execution and heads-up requests, the time period after which the preparation worker is
/// considered unresponsive and will be killed. More lenient than the timeout for prechecking
/// to prevent honest validators from timing out on valid PVFs.
/// For execution and heads-up requestsd.
mrcnski marked this conversation as resolved.
Show resolved Hide resolved
Prepare,
}

/// Type discriminator for PVF execution.
#[derive(Encode, Decode, TypeInfo, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum PvfExecKind {
/// The amount of time to spend on execution during backing.
///
/// Retry is disabled to reduce the chance of nondeterministic blocks getting backed and honest
/// backers getting slashed.
/// For backing requests.
Backing,

/// The amount of time to spend on execution during approval or disputes.
/// With retry enabled.
///
/// This should be much longer than the backing execution timeout to ensure that in the
/// absence of extremely large disparities between hardware, blocks that pass backing are
/// considered executable by approval checkers or dispute participants.
/// For approval and dispute request.
Approval,
}

Expand Down